A bundled STM32F10x Std Periph and CMSIS library
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

186 lines
6.7 KiB

  1. /**
  2. ******************************************************************************
  3. * @file stm32f10x_exti.h
  4. * @author MCD Application Team
  5. * @version V3.5.0
  6. * @date 11-March-2011
  7. * @brief This file contains all the functions prototypes for the EXTI firmware
  8. * library.
  9. ******************************************************************************
  10. * @attention
  11. *
  12. * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
  13. * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
  14. * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
  15. * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
  16. * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
  17. * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
  18. *
  19. * <h2><center>&copy; COPYRIGHT 2011 STMicroelectronics</center></h2>
  20. ******************************************************************************
  21. */
  22. /* Define to prevent recursive inclusion -------------------------------------*/
  23. #ifndef __STM32F10x_EXTI_H
  24. #define __STM32F10x_EXTI_H
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif
  28. /* Includes ------------------------------------------------------------------*/
  29. #include "stm32f10x.h"
  30. #include "stm32f10x_assert.h"
  31. /** @addtogroup STM32F10x_StdPeriph_Driver
  32. * @{
  33. */
  34. /** @addtogroup EXTI
  35. * @{
  36. */
  37. /** @defgroup EXTI_Exported_Types
  38. * @{
  39. */
  40. /**
  41. * @brief EXTI mode enumeration
  42. */
  43. typedef enum
  44. {
  45. EXTI_Mode_Interrupt = 0x00,
  46. EXTI_Mode_Event = 0x04
  47. }EXTIMode_TypeDef;
  48. #define IS_EXTI_MODE(MODE) (((MODE) == EXTI_Mode_Interrupt) || ((MODE) == EXTI_Mode_Event))
  49. /**
  50. * @brief EXTI Trigger enumeration
  51. */
  52. typedef enum
  53. {
  54. EXTI_Trigger_Rising = 0x08,
  55. EXTI_Trigger_Falling = 0x0C,
  56. EXTI_Trigger_Rising_Falling = 0x10
  57. }EXTITrigger_TypeDef;
  58. #define IS_EXTI_TRIGGER(TRIGGER) (((TRIGGER) == EXTI_Trigger_Rising) || \
  59. ((TRIGGER) == EXTI_Trigger_Falling) || \
  60. ((TRIGGER) == EXTI_Trigger_Rising_Falling))
  61. /**
  62. * @brief EXTI Init Structure definition
  63. */
  64. typedef struct
  65. {
  66. uint32_t EXTI_Line; /*!< Specifies the EXTI lines to be enabled or disabled.
  67. This parameter can be any combination of @ref EXTI_Lines */
  68. EXTIMode_TypeDef EXTI_Mode; /*!< Specifies the mode for the EXTI lines.
  69. This parameter can be a value of @ref EXTIMode_TypeDef */
  70. EXTITrigger_TypeDef EXTI_Trigger; /*!< Specifies the trigger signal active edge for the EXTI lines.
  71. This parameter can be a value of @ref EXTIMode_TypeDef */
  72. FunctionalState EXTI_LineCmd; /*!< Specifies the new state of the selected EXTI lines.
  73. This parameter can be set either to ENABLE or DISABLE */
  74. }EXTI_InitTypeDef;
  75. /**
  76. * @}
  77. */
  78. /** @defgroup EXTI_Exported_Constants
  79. * @{
  80. */
  81. /** @defgroup EXTI_Lines
  82. * @{
  83. */
  84. #define EXTI_Line0 ((uint32_t)0x00001) /*!< External interrupt line 0 */
  85. #define EXTI_Line1 ((uint32_t)0x00002) /*!< External interrupt line 1 */
  86. #define EXTI_Line2 ((uint32_t)0x00004) /*!< External interrupt line 2 */
  87. #define EXTI_Line3 ((uint32_t)0x00008) /*!< External interrupt line 3 */
  88. #define EXTI_Line4 ((uint32_t)0x00010) /*!< External interrupt line 4 */
  89. #define EXTI_Line5 ((uint32_t)0x00020) /*!< External interrupt line 5 */
  90. #define EXTI_Line6 ((uint32_t)0x00040) /*!< External interrupt line 6 */
  91. #define EXTI_Line7 ((uint32_t)0x00080) /*!< External interrupt line 7 */
  92. #define EXTI_Line8 ((uint32_t)0x00100) /*!< External interrupt line 8 */
  93. #define EXTI_Line9 ((uint32_t)0x00200) /*!< External interrupt line 9 */
  94. #define EXTI_Line10 ((uint32_t)0x00400) /*!< External interrupt line 10 */
  95. #define EXTI_Line11 ((uint32_t)0x00800) /*!< External interrupt line 11 */
  96. #define EXTI_Line12 ((uint32_t)0x01000) /*!< External interrupt line 12 */
  97. #define EXTI_Line13 ((uint32_t)0x02000) /*!< External interrupt line 13 */
  98. #define EXTI_Line14 ((uint32_t)0x04000) /*!< External interrupt line 14 */
  99. #define EXTI_Line15 ((uint32_t)0x08000) /*!< External interrupt line 15 */
  100. #define EXTI_Line16 ((uint32_t)0x10000) /*!< External interrupt line 16 Connected to the PVD Output */
  101. #define EXTI_Line17 ((uint32_t)0x20000) /*!< External interrupt line 17 Connected to the RTC Alarm event */
  102. #define EXTI_Line18 ((uint32_t)0x40000) /*!< External interrupt line 18 Connected to the USB Device/USB OTG FS
  103. Wakeup from suspend event */
  104. #define EXTI_Line19 ((uint32_t)0x80000) /*!< External interrupt line 19 Connected to the Ethernet Wakeup event */
  105. #define IS_EXTI_LINE(LINE) ((((LINE) & (uint32_t)0xFFF00000) == 0x00) && ((LINE) != (uint16_t)0x00))
  106. #define IS_GET_EXTI_LINE(LINE) (((LINE) == EXTI_Line0) || ((LINE) == EXTI_Line1) || \
  107. ((LINE) == EXTI_Line2) || ((LINE) == EXTI_Line3) || \
  108. ((LINE) == EXTI_Line4) || ((LINE) == EXTI_Line5) || \
  109. ((LINE) == EXTI_Line6) || ((LINE) == EXTI_Line7) || \
  110. ((LINE) == EXTI_Line8) || ((LINE) == EXTI_Line9) || \
  111. ((LINE) == EXTI_Line10) || ((LINE) == EXTI_Line11) || \
  112. ((LINE) == EXTI_Line12) || ((LINE) == EXTI_Line13) || \
  113. ((LINE) == EXTI_Line14) || ((LINE) == EXTI_Line15) || \
  114. ((LINE) == EXTI_Line16) || ((LINE) == EXTI_Line17) || \
  115. ((LINE) == EXTI_Line18) || ((LINE) == EXTI_Line19))
  116. /**
  117. * @}
  118. */
  119. /**
  120. * @}
  121. */
  122. /** @defgroup EXTI_Exported_Macros
  123. * @{
  124. */
  125. /**
  126. * @}
  127. */
  128. /** @defgroup EXTI_Exported_Functions
  129. * @{
  130. */
  131. void EXTI_DeInit(void);
  132. void EXTI_Init(EXTI_InitTypeDef* EXTI_InitStruct);
  133. void EXTI_StructInit(EXTI_InitTypeDef* EXTI_InitStruct);
  134. void EXTI_GenerateSWInterrupt(uint32_t EXTI_Line);
  135. FlagStatus EXTI_GetFlagStatus(uint32_t EXTI_Line);
  136. void EXTI_ClearFlag(uint32_t EXTI_Line);
  137. ITStatus EXTI_GetITStatus(uint32_t EXTI_Line);
  138. void EXTI_ClearITPendingBit(uint32_t EXTI_Line);
  139. #ifdef __cplusplus
  140. }
  141. #endif
  142. #endif /* __STM32F10x_EXTI_H */
  143. /**
  144. * @}
  145. */
  146. /**
  147. * @}
  148. */
  149. /**
  150. * @}
  151. */
  152. /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/