/** * @brief This function handles External line 10 interrupt request. * @param None * @retval None */ void EXTI2_IRQHandler(void) { #if 0 static JOY_State_TypeDef JoyState = JOY_NONE; if(EXTI_GetITStatus(IOE_IT_EXTI_LINE) != RESET) { if(IOE_GetGITStatus(IOE_2_ADDR, IOE_GIT_GPIO)) { /* Get the Joystick State */ JoyState = IOE_JoyStickGetState(); switch (JoyState) { case JOY_NONE: break; case JOY_UP: { PressedKey = UP; break; } case JOY_DOWN: { PressedKey = DOWN; break; } case JOY_RIGHT : { PressedKey = JOY_NONE; break; } case JOY_LEFT: { PressedKey = JOY_NONE; break; } case JOY_CENTER: { PressedKey = SEL; break; } default: { PressedKey = JOY_NONE; LCD_DisplayStringLine(LINE(17), (uint8_t*)" JOY ERROR "); break; } } } /* Clear the interrupt pending bits */ IOE_ClearGITPending(IOE_2_ADDR, IOE_GIT_GPIO); IOE_ClearIOITPending(IOE_2_ADDR, IOE_JOY_IT); } /* Clear interrupt pending bit */ EXTI_ClearITPendingBit(IOE_IT_EXTI_LINE); #endif }
/** * @brief This function handles External lines interrupt request for Touchscreen. * @param None * @retval None */ void GL_EXTI_TSC_IRQHandler( void ) { #if TOUCH_SCREEN_CAPABILITY if ( EXTI_GetITStatus(pTscHwParam.TSC_Exti_Line) != RESET ) { if (IOE_GetGITStatus(pTscHwParam.TSC_DeviceRegister, IOE_TS_IT) & IOE_TS_IT) { TSC_Read(); /* Clear the interrupt pending bits */ IOE_ClearGITPending(pTscHwParam.TSC_DeviceRegister, IOE_TS_IT); } EXTI_ClearITPendingBit(pTscHwParam.TSC_Exti_Line); } #endif }
/** * @brief This function handles External lines 15 to 10 interrupt request. * @param None * @retval None */ void EXTI15_10_IRQHandler(void) { /* Checks whether the IOE EXTI line is asserted or not */ if(EXTI_GetITStatus(IOE_IT_EXTI_LINE) != RESET) { #ifdef IOE_INTERRUPT_MODE /* Check if the interrupt source is the Touch Screen */ if (IOE_GetGITStatus(IOE_1_ADDR, IOE_TS_IT) & IOE_TS_IT) { static TS_STATE* TS_State; /* Update the structure with the current position */ TS_State = IOE_TS_GetState(); if ((TS_State->TouchDetected) && (TS_State->Y < 220) && (TS_State->Y > 180)) { if ((TS_State->X > 10) && (TS_State->X < 70)) { LCD_DisplayStringLine(Line6, " LD4 "); STM_EVAL_LEDOn(LED4); } else if ((TS_State->X > 90) && (TS_State->X < 150)) { LCD_DisplayStringLine(Line6, " LD3 "); STM_EVAL_LEDOn(LED3); } else if ((TS_State->X > 170) && (TS_State->X < 230)) { LCD_DisplayStringLine(Line6, " LD2 "); STM_EVAL_LEDOn(LED2); } else if ((TS_State->X > 250) && (TS_State->X < 310)) { LCD_DisplayStringLine(Line6, " LD1 "); STM_EVAL_LEDOn(LED1); } } else { STM_EVAL_LEDOff(LED1); STM_EVAL_LEDOff(LED2); STM_EVAL_LEDOff(LED3); STM_EVAL_LEDOff(LED4); } /* Clear the interrupt pending bits */ IOE_ClearGITPending(IOE_1_ADDR, IOE_TS_IT); } #ifdef USE_STM3210C_EVAL else if (IOE_GetGITStatus(IOE_2_ADDR, IOE_GIT_GPIO)) { static JOY_State_TypeDef JoyState = JOY_NONE; /* Get the Joytick State */ JoyState = IOE_JoyStickGetState(); switch (JoyState) { case JOY_NONE: LCD_DisplayStringLine(Line5, "JOY: IT ---- "); break; case JOY_UP: LCD_DisplayStringLine(Line5, "JOY: IT UP "); break; case JOY_DOWN: LCD_DisplayStringLine(Line5, "JOY: IT DOWN "); break; case JOY_LEFT: LCD_DisplayStringLine(Line5, "JOY: IT LEFT "); break; case JOY_RIGHT: LCD_DisplayStringLine(Line5, "JOY: IT RIGHT "); break; case JOY_CENTER: LCD_DisplayStringLine(Line5, "JOY: IT CENTER "); break; default: LCD_DisplayStringLine(Line5, "JOY: IT ERROR "); break; } /* Clear the interrupt pending bits */ IOE_ClearGITPending(IOE_2_ADDR, IOE_GIT_GPIO); IOE_ClearIOITPending(IOE_2_ADDR, IOE_JOY_IT); } /* CLear all pending interrupt */ IOE_ClearGITPending(IOE_2_ADDR, ALL_IT); IOE_ClearIOITPending(IOE_2_ADDR, IOE_JOY_IT); #endif /* USE_STM3210C_EVAL */ /* CLear all pending interrupt */ IOE_ClearGITPending(IOE_1_ADDR, ALL_IT); #endif /* IOE_INTERRUPT_MODE */ EXTI_ClearITPendingBit(IOE_IT_EXTI_LINE); } }
/** * @brief This function handles External lines 9 to 5 interrupt request. * @param None * @retval None */ void EXTI9_5_IRQHandler(void) { if(EXTI_GetITStatus(IOE16_IT_EXTI_LINE) != RESET) { #ifdef IOE_INTERRUPT_MODE __IO uint16_t tmpsr = 0; static JOY_State_TypeDef JoyState = JOY_NONE; static TS_STATE* TS_State; /* Get the interrupt status register */ tmpsr = IOE16_GetITStatus(); /* Check Touch screen interrupt event occurred */ if((tmpsr & IOE16_TS_IT) != 0) { /* Update the structure with the current position */ TS_State = IOE_TS_GetState(); if ((TS_State->TouchDetected) && (TS_State->Y < 92) && (TS_State->Y > 52)) { if ((TS_State->X > 60) && (TS_State->X < 120)) { LCD_SetTextColor(LCD_COLOR_GREEN); LCD_DisplayStringLine(LCD_LINE_10, (uint8_t *)" LED1 "); STM_EVAL_LEDOn(LED1); } else if ((TS_State->X > 140) && (TS_State->X < 200)) { LCD_SetTextColor(LCD_COLOR_YELLOW); LCD_DisplayStringLine(LCD_LINE_10, (uint8_t *)" LED2 "); STM_EVAL_LEDOn(LED2); } else if ((TS_State->X > 220) && (TS_State->X < 280)) { LCD_SetTextColor(LCD_COLOR_RED); LCD_DisplayStringLine(LCD_LINE_10, (uint8_t *)" LED3 "); STM_EVAL_LEDOn(LED3); } else if ((TS_State->X > 300) && (TS_State->X < 360)) { LCD_SetTextColor(LCD_COLOR_BLUE); LCD_DisplayStringLine(LCD_LINE_10, (uint8_t *)" LED4"); STM_EVAL_LEDOn(LED4); } } else { STM_EVAL_LEDOff(LED1); STM_EVAL_LEDOff(LED2); STM_EVAL_LEDOff(LED3); STM_EVAL_LEDOff(LED4); } /* Clear the interrupt pending bits */ IOE_ClearGITPending(IOE16_TS_IT); } /* Check joystick interrupt event occurred */ if((tmpsr & IOE16_JOY_IT) != 0 ) { /* Get the joystick State */ JoyState = IOE16_JoyStickGetState(); /* Set the LCD Text Color */ LCD_SetTextColor(Blue); switch (JoyState) { case JOY_NONE: LCD_DisplayStringLine(LCD_LINE_5, (uint8_t *)" JOY: ---- "); break; case JOY_UP: LCD_DisplayStringLine(LCD_LINE_5, (uint8_t *)" JOY: UP "); break; case JOY_DOWN: LCD_DisplayStringLine(LCD_LINE_5, (uint8_t *)" JOY: DOWN "); break; case JOY_LEFT: LCD_DisplayStringLine(LCD_LINE_5, (uint8_t *)" JOY: LEFT "); break; case JOY_RIGHT: LCD_DisplayStringLine(LCD_LINE_5, (uint8_t *)" JOY: RIGHT "); break; case JOY_CENTER: LCD_DisplayStringLine(LCD_LINE_5, (uint8_t *)" JOY: CENTER "); break; default: LCD_DisplayStringLine(LCD_LINE_5, (uint8_t *)" JOY: ERROR "); break; } } #endif /* IOE_INTERRUPT_MODE */ /* Clear all pending bits */ EXTI_ClearITPendingBit(IOE16_IT_EXTI_LINE); IOE_ClearGITPending(ALL_GIT); IOE16_GetITStatus(); } }
/** * @brief This function handles External lines 15 to 10 interrupt request. * @param None * @retval None */ void EXTI15_10_IRQHandler(void) { #ifdef USE_STM32100E_EVAL if(EXTI_GetITStatus(RIGHT_BUTTON_EXTI_LINE) != RESET) { if (ReadKey == 1) { PressedKey = RIGHT; } else { if (GetMutex == 1) { ShowMutex = 0; } else { ReqOperation = SHOW_TEMPERATURE_OP ; } } /* Clear EXTI interrupts pending bits */ EXTI_ClearITPendingBit(RIGHT_BUTTON_EXTI_LINE); } if(EXTI_GetITStatus(LEFT_BUTTON_EXTI_LINE) != RESET) { if (ReadKey == 1) { PressedKey = LEFT; } else { if (GetMutex == 1) { ShowMutex = 0; } else { ReqOperation = SHOW_TIME_OP; } } /* Clear EXTI interrupts pending bits */ EXTI_ClearITPendingBit(LEFT_BUTTON_EXTI_LINE); } if(EXTI_GetITStatus(UP_BUTTON_EXTI_LINE) != RESET) { if (ReadKey == 1) { PressedKey = UP; } else { if (GetMutex == 0) { ReqOperation = GET_REPORT_OP; } } /* Clear EXTI interrupts pending bits */ EXTI_ClearITPendingBit(UP_BUTTON_EXTI_LINE); } if(EXTI_GetITStatus(DOWN_BUTTON_EXTI_LINE) != RESET) { if (ReadKey == 1) { PressedKey = DOWN; } else { if (GetMutex == 0) { ReqOperation = ERASE_EEPROM_OP; } } /* Clear EXTI interrupts pending bits */ EXTI_ClearITPendingBit(DOWN_BUTTON_EXTI_LINE); } #endif /* USE_STM32100E_EVAL */ if(EXTI_GetITStatus(IOE_IT_EXTI_LINE) != RESET) { #ifdef USE_STM3210C_EVAL static JOY_State_TypeDef JoyState = JOY_NONE; #endif /* USE_STM3210C_EVAL */ static TS_STATE* TS_State; /* Check if the interrupt source is the Touch Screen */ if (IOE_GetGITStatus(IOE_1_ADDR, IOE_TS_IT) & IOE_TS_IT) { /* Update the structure with the current position */ TS_State = IOE_TS_GetState(); if ((TS_State->TouchDetected) && (TS_State->Y < 230) && (TS_State->Y > 200)) { if ((TS_State->X > 10) && (TS_State->X < 70)) { LCD_DisplayStringLine(Line7, (uint8_t*)" TS1 "); } else if ((TS_State->X > 90) && (TS_State->X < 150)) { LCD_DisplayStringLine(Line7, (uint8_t*)" TS2 "); } else if ((TS_State->X > 170) && (TS_State->X < 230)) { LCD_DisplayStringLine(Line7, (uint8_t*)" TS3 "); } else if ((TS_State->X > 250) && (TS_State->X < 310)) { LCD_DisplayStringLine(Line7, (uint8_t*)" TS4 "); } } else { STM_EVAL_LEDOff(LED1); STM_EVAL_LEDOff(LED2); STM_EVAL_LEDOff(LED3); STM_EVAL_LEDOff(LED4); } /* Clear the interrupt pending bits */ IOE_ClearGITPending(IOE_1_ADDR, IOE_TS_IT); } #ifdef USE_STM3210C_EVAL else if (IOE_GetGITStatus(IOE_2_ADDR, IOE_GIT_GPIO)) { /* Get the Joystick State */ JoyState = IOE_JoyStickGetState(); switch (JoyState) { case JOY_NONE: break; case JOY_UP: if (ReadKey == 1) { PressedKey = UP; } else { if (GetMutex == 0) { ReqOperation = GET_REPORT_OP; } } break; case JOY_DOWN: if (ReadKey == 1) { PressedKey = DOWN; } else { if (GetMutex == 0) { ReqOperation = ERASE_EEPROM_OP; } } break; case JOY_RIGHT : if (ReadKey == 1) { PressedKey = RIGHT; } else { if (GetMutex == 1) { ShowMutex = 0; } else { ReqOperation = SHOW_TEMPERATURE_OP ; } } break; case JOY_LEFT: if (ReadKey == 1) { PressedKey = LEFT; } else { if (GetMutex == 1) { ShowMutex = 0; } else { ReqOperation = SHOW_TIME_OP; } } break; case JOY_CENTER: if (ReadKey == 1) { PressedKey = SEL; } else { if (GetMutex == 1) { NextRep = 1; ExitMutex = 1; } } break; default: LCD_DisplayStringLine(Line9, (uint8_t*)" JOY ERROR "); break; } /* Clear the interrupt pending bits */ IOE_ClearGITPending(IOE_2_ADDR, IOE_GIT_GPIO); IOE_ClearIOITPending(IOE_2_ADDR, IOE_JOY_IT); } #endif /* USE_STM3210C_EVAL */ else { /* Clear the interrupt pending bits */ #ifdef USE_STM3210C_EVAL IOE_ClearGITPending(IOE_1_ADDR, ALL_IT); IOE_ClearGITPending(IOE_2_ADDR, ALL_IT); #else IOE_ClearGITPending(IOE_1_ADDR, ALL_IT); #endif /* USE_STM3210C_EVAL */ } } /* Clear EXTI interrupts pending bits */ EXTI_ClearITPendingBit(IOE_IT_EXTI_LINE); }