STM32F10x Standard Peripherals Library  3.5.0
/opt/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/STM32F10x_StdPeriph_Driver/inc/stm32f10x_exti.h
Go to the documentation of this file.
00001 
00023 /* Define to prevent recursive inclusion -------------------------------------*/
00024 #ifndef __STM32F10x_EXTI_H
00025 #define __STM32F10x_EXTI_H
00026 
00027 #ifdef __cplusplus
00028  extern "C" {
00029 #endif
00030 
00031 /* Includes ------------------------------------------------------------------*/
00032 #include "stm32f10x.h"
00033 
00050 typedef enum
00051 {
00052   EXTI_Mode_Interrupt = 0x00,
00053   EXTI_Mode_Event = 0x04
00054 }EXTIMode_TypeDef;
00055 
00056 #define IS_EXTI_MODE(MODE) (((MODE) == EXTI_Mode_Interrupt) || ((MODE) == EXTI_Mode_Event))
00057 
00062 typedef enum
00063 {
00064   EXTI_Trigger_Rising = 0x08,
00065   EXTI_Trigger_Falling = 0x0C,  
00066   EXTI_Trigger_Rising_Falling = 0x10
00067 }EXTITrigger_TypeDef;
00068 
00069 #define IS_EXTI_TRIGGER(TRIGGER) (((TRIGGER) == EXTI_Trigger_Rising) || \
00070                                   ((TRIGGER) == EXTI_Trigger_Falling) || \
00071                                   ((TRIGGER) == EXTI_Trigger_Rising_Falling))
00072 
00076 typedef struct
00077 {
00078   uint32_t EXTI_Line;               
00081   EXTIMode_TypeDef EXTI_Mode;       
00084   EXTITrigger_TypeDef EXTI_Trigger; 
00087   FunctionalState EXTI_LineCmd;     
00089 }EXTI_InitTypeDef;
00090 
00103 #define EXTI_Line0       ((uint32_t)0x00001)  
00104 #define EXTI_Line1       ((uint32_t)0x00002)  
00105 #define EXTI_Line2       ((uint32_t)0x00004)  
00106 #define EXTI_Line3       ((uint32_t)0x00008)  
00107 #define EXTI_Line4       ((uint32_t)0x00010)  
00108 #define EXTI_Line5       ((uint32_t)0x00020)  
00109 #define EXTI_Line6       ((uint32_t)0x00040)  
00110 #define EXTI_Line7       ((uint32_t)0x00080)  
00111 #define EXTI_Line8       ((uint32_t)0x00100)  
00112 #define EXTI_Line9       ((uint32_t)0x00200)  
00113 #define EXTI_Line10      ((uint32_t)0x00400)  
00114 #define EXTI_Line11      ((uint32_t)0x00800)  
00115 #define EXTI_Line12      ((uint32_t)0x01000)  
00116 #define EXTI_Line13      ((uint32_t)0x02000)  
00117 #define EXTI_Line14      ((uint32_t)0x04000)  
00118 #define EXTI_Line15      ((uint32_t)0x08000)  
00119 #define EXTI_Line16      ((uint32_t)0x10000)  
00120 #define EXTI_Line17      ((uint32_t)0x20000)  
00121 #define EXTI_Line18      ((uint32_t)0x40000)  
00123 #define EXTI_Line19      ((uint32_t)0x80000)  
00125 #define IS_EXTI_LINE(LINE) ((((LINE) & (uint32_t)0xFFF00000) == 0x00) && ((LINE) != (uint16_t)0x00))
00126 #define IS_GET_EXTI_LINE(LINE) (((LINE) == EXTI_Line0) || ((LINE) == EXTI_Line1) || \
00127                             ((LINE) == EXTI_Line2) || ((LINE) == EXTI_Line3) || \
00128                             ((LINE) == EXTI_Line4) || ((LINE) == EXTI_Line5) || \
00129                             ((LINE) == EXTI_Line6) || ((LINE) == EXTI_Line7) || \
00130                             ((LINE) == EXTI_Line8) || ((LINE) == EXTI_Line9) || \
00131                             ((LINE) == EXTI_Line10) || ((LINE) == EXTI_Line11) || \
00132                             ((LINE) == EXTI_Line12) || ((LINE) == EXTI_Line13) || \
00133                             ((LINE) == EXTI_Line14) || ((LINE) == EXTI_Line15) || \
00134                             ((LINE) == EXTI_Line16) || ((LINE) == EXTI_Line17) || \
00135                             ((LINE) == EXTI_Line18) || ((LINE) == EXTI_Line19))
00136 
00137                     
00158 void EXTI_DeInit(void);
00159 void EXTI_Init(EXTI_InitTypeDef* EXTI_InitStruct);
00160 void EXTI_StructInit(EXTI_InitTypeDef* EXTI_InitStruct);
00161 void EXTI_GenerateSWInterrupt(uint32_t EXTI_Line);
00162 FlagStatus EXTI_GetFlagStatus(uint32_t EXTI_Line);
00163 void EXTI_ClearFlag(uint32_t EXTI_Line);
00164 ITStatus EXTI_GetITStatus(uint32_t EXTI_Line);
00165 void EXTI_ClearITPendingBit(uint32_t EXTI_Line);
00166 
00167 #ifdef __cplusplus
00168 }
00169 #endif
00170 
00171 #endif /* __STM32F10x_EXTI_H */
00172 
00184 /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/