本文整理汇总了C++中BSP_IO_ITClear函数的典型用法代码示例。如果您正苦于以下问题:C++ BSP_IO_ITClear函数的具体用法?C++ BSP_IO_ITClear怎么用?C++ BSP_IO_ITClear使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了BSP_IO_ITClear函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HAL_GPIO_EXTI_Callback
/**
* @brief EXTI line detection callbacks.
* @param GPIO_Pin: Specifies the pins connected EXTI line
* @retval None
*/
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
{
static JOYState_TypeDef JoyState = JOY_NONE;
if(GPIO_Pin == GPIO_PIN_2)
{
/* Get the Joystick State */
JoyState = BSP_JOY_GetState();
MSC_DEMO_ProbeKey(JoyState);
switch(JoyState)
{
case JOY_LEFT:
LCD_LOG_ScrollBack();
break;
case JOY_RIGHT:
LCD_LOG_ScrollForward();
break;
default:
break;
}
/* Clear joystick interrupt pending bits */
BSP_IO_ITClear(JOY_ALL_PINS);
}
}
示例2: ethernetif_notify_conn_changed
/**
* @brief This function notify user about link status changement.
* @param netif: the network interface
* @retval None
*/
void ethernetif_notify_conn_changed(struct netif *netif)
{
struct ip_addr ipaddr;
struct ip_addr netmask;
struct ip_addr gw;
if(netif_is_link_up(netif))
{
IP4_ADDR(&ipaddr, IP_ADDR0, IP_ADDR1, IP_ADDR2, IP_ADDR3);
IP4_ADDR(&netmask, NETMASK_ADDR0, NETMASK_ADDR1 , NETMASK_ADDR2, NETMASK_ADDR3);
IP4_ADDR(&gw, GW_ADDR0, GW_ADDR1, GW_ADDR2, GW_ADDR3);
netif_set_addr(netif, &ipaddr , &netmask, &gw);
/* When the netif is fully configured this function must be called.*/
netif_set_up(netif);
BSP_LED_Off(LED2);
BSP_LED_On(LED1);
}
else
{
/* When the netif link is down this function must be called.*/
netif_set_down(netif);
BSP_LED_Off(LED1);
BSP_LED_On(LED2);
}
/* Clear IO Expander Interrupt flag */
BSP_IO_ITClear();
}
示例3: HAL_GPIO_EXTI_Callback
/**
* @brief EXTI line detection callbacks.
* @param GPIO_Pin: Specifies the pins connected EXTI line
* @retval None
*/
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
{
__IO JOYState_TypeDef JoyState = JOY_NONE;
if(GPIO_Pin == GPIO_PIN_8)
{
/* Get the Joystick State */
JoyState = BSP_JOY_GetState();
HID_DEMO_ProbeKey(JoyState);
switch(JoyState)
{
case JOY_LEFT:
LCD_LOG_ScrollBack();
break;
case JOY_RIGHT:
LCD_LOG_ScrollForward();
break;
default:
break;
}
/* Clear joystick interrupt pending bits */
BSP_IO_ITClear();
osSemaphoreRelease(MenuEvent);
}
}
示例4: BSP_TS_ITClear
/**
* @brief Clears all touch screen interrupts.
* @param None
* @retval None
*/
void BSP_TS_ITClear(void)
{
/* Clear all IO IT pin */
BSP_IO_ITClear();
/* Clear TS IT pending bits */
TsDrv->ClearIT(TS_I2C_ADDRESS);
}
示例5: HAL_GPIO_EXTI_Callback
/**
* @brief EXTI line detection callbacks
* @param GPIO_Pin: Specifies the pins connected EXTI line
* @retval None
*/
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
{
/* Get the IT status register value */
if(BSP_IO_ITGetStatus(MII_INT_PIN))
{
ethernetif_set_link(&gnetif);
}
BSP_IO_ITClear();
}
示例6: BSP_SD_DetectIT
/** @brief SD detect IT treatment.
* @param None
* @retval None
*/
void BSP_SD_DetectIT(void)
{
/* Clear all pending bits */
BSP_IO_ITClear();
/* To re-enable IT */
BSP_SD_ITConfig();
/* SD detect IT callback */
BSP_SD_DetectCallback();
}
示例7: HAL_GPIO_EXTI_Callback
/**
* @brief EXTI line detection callbacks
* @param GPIO_Pin: Specifies the pins connected EXTI line
* @retval None
*/
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
{
if (GPIO_Pin == MFX_IRQOUT_PIN)
{
/* Get the IT status register value */
if(BSP_IO_ITGetStatus(MII_INT_PIN))
{
/* ethernetif_notify_conn_changed(&gnetif);; */
}
BSP_IO_ITClear();
}
}
示例8: HAL_GPIO_EXTI_Callback
/**
* @brief EXTI line detection callbacks
* @param GPIO_Pin: Specifies the pins connected EXTI line
* @retval None
*/
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
{
if (GPIO_Pin == MFX_IRQOUT_PIN)
{
/* Get the IT status register value */
if(BSP_IO_ITGetStatus(MII_INT_PIN))
{
osSemaphoreRelease(Netif_LinkSemaphore);
}
BSP_IO_ITClear();
}
}
示例9: HAL_GPIO_EXTI_Callback
/**
* @brief EXTI line detection callbacks.
* @param GPIO_Pin: Specifies the pins connected EXTI line
* @retval None
*/
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
{
if(BSP_IO_ITGetStatus(JOY_SEL_PIN) != 0)
{
/* SEL is used to pause and resume the audio playback */
if (PressCount == 1)
{
/* Resume playing Wave status */
PauseResumeStatus = RESUME_STATUS;
PressCount = 0;
}
else
{
/* Pause playing Wave status */
PauseResumeStatus = PAUSE_STATUS;
PressCount = 1;
}
}
else if(BSP_IO_ITGetStatus(JOY_UP_PIN) != 0)
{
/* UP is used to increment the volume of the audio playback */
volume ++;
if (volume > 100)
{
volume = 100;
}
VolumeChange = 1;
}
else if(BSP_IO_ITGetStatus(JOY_DOWN_PIN) != 0)
{
/* DOWN is used to decrement the volume of the audio playback */
volume --;
if ((int8_t)volume < 50)
{
volume = 50;
}
VolumeChange = 1;
}
else if(BSP_IO_ITGetStatus(JOY_RIGHT_PIN) != 0)
{
/* Audio change output: speaker only */
UserOutputMode = OUTPUT_DEVICE_SPEAKER;
}
else if(BSP_IO_ITGetStatus(JOY_LEFT_PIN) != 0)
{
/* Audio change output: headset only */
UserOutputMode = OUTPUT_DEVICE_HEADPHONE;
}
/* Clear IO Expander IT */
BSP_IO_ITClear(JOY_ALL_PINS);
}
示例10: Joystick_exti_demo
/**
* @brief Joystick Exti demo
* @param None
* @retval None
*/
void Joystick_exti_demo (void)
{
uint8_t status = 0;
uint32_t ITstatus = 0;
Joystick_SetHint(1);
status = BSP_JOY_Init(JOY_MODE_EXTI);
if (status != IO_OK)
{
BSP_LCD_SetBackColor(LCD_COLOR_WHITE);
BSP_LCD_SetTextColor(LCD_COLOR_RED);
BSP_LCD_DisplayStringAt(0, BSP_LCD_GetYSize()- 95, (uint8_t *)"ERROR", CENTER_MODE);
BSP_LCD_DisplayStringAt(0, BSP_LCD_GetYSize()- 80, (uint8_t *)"Joystick cannot be initialized", CENTER_MODE);
}
if (status == IO_OK)
{
Joystick_SetCursorPosition();
}
while (1) /* pull for USER button in GPIO mode */
{
if (status == IO_OK)
{
if (MfxExtiReceived == 1)
{
MfxExtiReceived = 0;
ITstatus = BSP_IO_ITGetStatus(JOY_ALL_PINS);
if (ITstatus)
{
/* Get the Joystick State */
JoyState = BSP_JOY_GetState();
Joystick_SetCursorPosition();
}
BSP_IO_ITClear();
/* poll if joystick is still pressed until it is released*/
while ( BSP_JOY_GetState() != JOY_NONE)
{
Joystick_SetCursorPosition();
HAL_Delay(5);
}
}
}
if(CheckForUserInput() > 0)
{
return;
}
HAL_Delay(5);
}
}
示例11: main
/**
* @brief Main program
* @param None
* @retval None
*/
int main(void)
{
/* STM32F4xx HAL library initialization:
- Configure the Flash prefetch, instruction and Data caches
- Configure the Systick to generate an interrupt each 1 msec
- Set NVIC Group Priority to 4
- Global MSP (MCU Support Package) initialization
*/
HAL_Init();
/* Configure the system clock to 180 MHz */
SystemClock_Config();
/* Configure LED1 and LED3 */
BSP_LED_Init(LED1);
BSP_LED_Init(LED3);
/* Configure Key Button */
BSP_PB_Init(BUTTON_TAMPER, BUTTON_MODE_EXTI);
/* Configure Joystick using MFX in IT mode in order to wakeup system after standby */
BSP_JOY_Init(JOY_MODE_EXTI);
/* RTC configuration */
RTC_Config();
/* Turn on LED1 */
BSP_LED_On(LED1);
/* Enable WKUP pin */
HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN1);
/* Infinite loop */
while (1)
{
if (AuthorizeToggle)
{
/* Toggle LED1 */
BSP_LED_Toggle(LED1);
AuthorizeToggle = 0;
}
if (MfxExtiReceived)
{
/* Clear MFX IT */
BSP_IO_ITClear();
MfxExtiReceived = 0;
}
}
}
示例12: HAL_GPIO_EXTI_Callback
/**
* @brief EXTI line detection callbacks.
* @param GPIO_Pin: Specifies the pins connected EXTI line
* @retval None
*/
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
{
/* If the interruption comes from the Joystick, check which
Joystick button has been pressed */
JoyState = BSP_JOY_GetState();
if(JoyState == JOY_SEL)
{
/* SEL is used to pause and resume the audio playback */
if (PressCount == 1)
{
/* Resume playing Wave status */
PauseResumeStatus = RESUME_STATUS;
PressCount = 0;
}
else
{
/* Pause playing Wave status */
PauseResumeStatus = PAUSE_STATUS;
PressCount = 1;
}
}
else if(JoyState == JOY_UP)
{
/* UP is used to increment the volume of the audio playback */
volume ++;
if (volume > 100)
{
volume = 100;
}
VolumeChange = 1;
}
else if(JoyState == JOY_DOWN)
{
/* DOWN is used to decrement the volume of the audio playback */
volume --;
if ((int8_t)volume < 50)
{
volume = 50;
}
VolumeChange = 1;
}
/* Clear MFX IT */
BSP_IO_ITClear();
}
示例13: HAL_GPIO_EXTI_Callback
/**
* @brief EXTI line detection callbacks
* @param GPIO_Pin: Specifies the pins connected EXTI line
* @retval None
*/
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
{
if (GPIO_Pin == GPIO_PIN_8)
{
/* Get the IT status register value */
if(BSP_IO_ITGetStatus(MII_INT_PIN))
{
ethernetif_set_link(&gnetif);
}
BSP_IO_ITClear();
}
else if (GPIO_Pin == GPIO_PIN_13)
{
/*connect to tcp server */
udp_echoclient_send();
}
}
示例14: ethernetif_notify_conn_changed
/**
* @brief This function notify user about link status changement.
* @param netif: the network interface
* @retval None
*/
void ethernetif_notify_conn_changed(struct netif *netif)
{
struct ip_addr ipaddr;
struct ip_addr netmask;
struct ip_addr gw;
if(netif_is_link_up(netif))
{
/* IP address setting */
IP4_ADDR(&ipaddr, ip_address[3], ip_address[2], ip_address[1], ip_address[0]);
IP4_ADDR(&netmask, sn_mask[3], sn_mask[2] , sn_mask[1], sn_mask[0]);
IP4_ADDR(&gw, gw_address[3], gw_address[2], gw_address[1], gw_address[0]);
netif_set_addr(netif, &ipaddr , &netmask, &gw);
/* When the netif is fully configured this function must be called.*/
netif_set_up(netif);
_VNCServer_Notify(NOTIFY_SERVER_NETIF_UP);
/* If DHCP: re-start process */
if (_DHCPClinet_TCB != 0)
{
/* Update DHCP state machine */
DHCP_state = DHCP_START;
}
}
else
{
/* When the netif link is down this function must be called.*/
netif_set_down(netif);
_VNCServer_Notify(NOTIFY_SERVER_NETIF_DOWN);
/* If DHCP: stop process */
if (_DHCPClinet_TCB != 0)
{
/* Update DHCP state machine */
DHCP_state = DHCP_LINK_DOWN;
}
}
/* Clear IO Expander Interrupt flag */
BSP_IO_ITClear();
}
示例15: SD_exti_demo
/**
* @brief SD Demo exti detection
* @param None
* @retval None
*/
void SD_exti_demo (void)
{
uint32_t ITstatus = 0;
SD_main_test();
if(BSP_SD_IsDetected() != SD_PRESENT)
{
BSP_SD_Init();
BSP_LCD_SetTextColor(LCD_COLOR_RED);
BSP_LCD_DisplayStringAt(20, BSP_LCD_GetYSize()-30, (uint8_t *)"SD Not Connected", LEFT_MODE);
}
else
{
BSP_LCD_SetTextColor(LCD_COLOR_GREEN);
BSP_LCD_DisplayStringAt(20, BSP_LCD_GetYSize()-30, (uint8_t *)"SD Connected ", LEFT_MODE);
}
BSP_SD_ITConfig();
while (1)
{
if (MfxExtiReceived == 1)
{
MfxExtiReceived = 0;
ITstatus = BSP_IO_ITGetStatus(SD_DETECT_PIN);
if (ITstatus)
{
SD_Detection();
}
BSP_IO_ITClear();
}
if(CheckForUserInput() > 0)
{
BSP_SD_DeInit();
return;
}
}
}