stm32f10x_exti.h

Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32f10x_exti.h
00004   * @author  MCD Application Team
00005   * @version V3.4.0
00006   * @date    10/15/2010
00007   * @brief   This file contains all the functions prototypes for the EXTI firmware
00008   *          library.
00009   ******************************************************************************
00010   * @copy
00011   *
00012   * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
00013   * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
00014   * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
00015   * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
00016   * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
00017   * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
00018   *
00019   * <h2><center>&copy; COPYRIGHT 2010 STMicroelectronics</center></h2>
00020   */ 
00021 
00022 /* Define to prevent recursive inclusion -------------------------------------*/
00023 #ifndef __STM32F10x_EXTI_H
00024 #define __STM32F10x_EXTI_H
00025 
00026 #ifdef __cplusplus
00027  extern "C" {
00028 #endif
00029 
00030 /* Includes ------------------------------------------------------------------*/
00031 #include "stm32f10x.h"
00032 
00033 /** @addtogroup STM32F10x_StdPeriph_Driver
00034   * @{
00035   */
00036 
00037 /** @addtogroup EXTI
00038   * @{
00039   */
00040 
00041 /** @defgroup EXTI_Exported_Types
00042   * @{
00043   */
00044 
00045 /** 
00046   * @brief  EXTI mode enumeration  
00047   */
00048 
00049 typedef enum
00050 {
00051   EXTI_Mode_Interrupt = 0x00,
00052   EXTI_Mode_Event = 0x04
00053 }EXTIMode_TypeDef;
00054 
00055 #define IS_EXTI_MODE(MODE) (((MODE) == EXTI_Mode_Interrupt) || ((MODE) == EXTI_Mode_Event))
00056 
00057 /** 
00058   * @brief  EXTI Trigger enumeration  
00059   */
00060 
00061 typedef enum
00062 {
00063   EXTI_Trigger_Rising = 0x08,
00064   EXTI_Trigger_Falling = 0x0C,  
00065   EXTI_Trigger_Rising_Falling = 0x10
00066 }EXTITrigger_TypeDef;
00067 
00068 #define IS_EXTI_TRIGGER(TRIGGER) (((TRIGGER) == EXTI_Trigger_Rising) || \
00069                                   ((TRIGGER) == EXTI_Trigger_Falling) || \
00070                                   ((TRIGGER) == EXTI_Trigger_Rising_Falling))
00071 /** 
00072   * @brief  EXTI Init Structure definition  
00073   */
00074 
00075 typedef struct
00076 {
00077   uint32_t EXTI_Line;               /*!< Specifies the EXTI lines to be enabled or disabled.
00078                                          This parameter can be any combination of @ref EXTI_Lines */
00079    
00080   EXTIMode_TypeDef EXTI_Mode;       /*!< Specifies the mode for the EXTI lines.
00081                                          This parameter can be a value of @ref EXTIMode_TypeDef */
00082 
00083   EXTITrigger_TypeDef EXTI_Trigger; /*!< Specifies the trigger signal active edge for the EXTI lines.
00084                                          This parameter can be a value of @ref EXTIMode_TypeDef */
00085 
00086   FunctionalState EXTI_LineCmd;     /*!< Specifies the new state of the selected EXTI lines.
00087                                          This parameter can be set either to ENABLE or DISABLE */ 
00088 }EXTI_InitTypeDef;
00089 
00090 /**
00091   * @}
00092   */
00093 
00094 /** @defgroup EXTI_Exported_Constants
00095   * @{
00096   */
00097 
00098 /** @defgroup EXTI_Lines 
00099   * @{
00100   */
00101 
00102 #define EXTI_Line0       ((uint32_t)0x00001)  /*!< External interrupt line 0 */
00103 #define EXTI_Line1       ((uint32_t)0x00002)  /*!< External interrupt line 1 */
00104 #define EXTI_Line2       ((uint32_t)0x00004)  /*!< External interrupt line 2 */
00105 #define EXTI_Line3       ((uint32_t)0x00008)  /*!< External interrupt line 3 */
00106 #define EXTI_Line4       ((uint32_t)0x00010)  /*!< External interrupt line 4 */
00107 #define EXTI_Line5       ((uint32_t)0x00020)  /*!< External interrupt line 5 */
00108 #define EXTI_Line6       ((uint32_t)0x00040)  /*!< External interrupt line 6 */
00109 #define EXTI_Line7       ((uint32_t)0x00080)  /*!< External interrupt line 7 */
00110 #define EXTI_Line8       ((uint32_t)0x00100)  /*!< External interrupt line 8 */
00111 #define EXTI_Line9       ((uint32_t)0x00200)  /*!< External interrupt line 9 */
00112 #define EXTI_Line10      ((uint32_t)0x00400)  /*!< External interrupt line 10 */
00113 #define EXTI_Line11      ((uint32_t)0x00800)  /*!< External interrupt line 11 */
00114 #define EXTI_Line12      ((uint32_t)0x01000)  /*!< External interrupt line 12 */
00115 #define EXTI_Line13      ((uint32_t)0x02000)  /*!< External interrupt line 13 */
00116 #define EXTI_Line14      ((uint32_t)0x04000)  /*!< External interrupt line 14 */
00117 #define EXTI_Line15      ((uint32_t)0x08000)  /*!< External interrupt line 15 */
00118 #define EXTI_Line16      ((uint32_t)0x10000)  /*!< External interrupt line 16 Connected to the PVD Output */
00119 #define EXTI_Line17      ((uint32_t)0x20000)  /*!< External interrupt line 17 Connected to the RTC Alarm event */
00120 #define EXTI_Line18      ((uint32_t)0x40000)  /*!< External interrupt line 18 Connected to the USB Device/USB OTG FS
00121                                                    Wakeup from suspend event */                                    
00122 #define EXTI_Line19      ((uint32_t)0x80000)  /*!< External interrupt line 19 Connected to the Ethernet Wakeup event */
00123                                           
00124 #define IS_EXTI_LINE(LINE) ((((LINE) & (uint32_t)0xFFF00000) == 0x00) && ((LINE) != (uint16_t)0x00))
00125 #define IS_GET_EXTI_LINE(LINE) (((LINE) == EXTI_Line0) || ((LINE) == EXTI_Line1) || \
00126                             ((LINE) == EXTI_Line2) || ((LINE) == EXTI_Line3) || \
00127                             ((LINE) == EXTI_Line4) || ((LINE) == EXTI_Line5) || \
00128                             ((LINE) == EXTI_Line6) || ((LINE) == EXTI_Line7) || \
00129                             ((LINE) == EXTI_Line8) || ((LINE) == EXTI_Line9) || \
00130                             ((LINE) == EXTI_Line10) || ((LINE) == EXTI_Line11) || \
00131                             ((LINE) == EXTI_Line12) || ((LINE) == EXTI_Line13) || \
00132                             ((LINE) == EXTI_Line14) || ((LINE) == EXTI_Line15) || \
00133                             ((LINE) == EXTI_Line16) || ((LINE) == EXTI_Line17) || \
00134                             ((LINE) == EXTI_Line18) || ((LINE) == EXTI_Line19))
00135 
00136                     
00137 /**
00138   * @}
00139   */
00140 
00141 /**
00142   * @}
00143   */
00144 
00145 /** @defgroup EXTI_Exported_Macros
00146   * @{
00147   */
00148 
00149 /**
00150   * @}
00151   */
00152 
00153 /** @defgroup EXTI_Exported_Functions
00154   * @{
00155   */
00156 
00157 void EXTI_DeInit(void);
00158 void EXTI_Init(EXTI_InitTypeDef* EXTI_InitStruct);
00159 void EXTI_StructInit(EXTI_InitTypeDef* EXTI_InitStruct);
00160 void EXTI_GenerateSWInterrupt(uint32_t EXTI_Line);
00161 FlagStatus EXTI_GetFlagStatus(uint32_t EXTI_Line);
00162 void EXTI_ClearFlag(uint32_t EXTI_Line);
00163 ITStatus EXTI_GetITStatus(uint32_t EXTI_Line);
00164 void EXTI_ClearITPendingBit(uint32_t EXTI_Line);
00165 
00166 #ifdef __cplusplus
00167 }
00168 #endif
00169 
00170 #endif /* __STM32F10x_EXTI_H */
00171 /**
00172   * @}
00173   */
00174 
00175 /**
00176   * @}
00177   */
00178 
00179 /**
00180   * @}
00181   */
00182 
00183 /******************* (C) COPYRIGHT 2010 STMicroelectronics *****END OF FILE****/
STM32F10x Standard Peripherals Library: Footer

 

 

 

      For complete documentation on STM32(CORTEX M3) 32-bit Microcontrollers platform visit  www.st.com/STM32