stm32g0xx_ll_exti.h 64 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557
  1. /**
  2. ******************************************************************************
  3. * @file stm32g0xx_ll_exti.h
  4. * @author MCD Application Team
  5. * @brief Header file of EXTI LL module.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * Copyright (c) 2018 STMicroelectronics.
  10. * All rights reserved.
  11. *
  12. * This software is licensed under terms that can be found in the LICENSE file
  13. * in the root directory of this software component.
  14. * If no LICENSE file comes with this software, it is provided AS-IS.
  15. *
  16. ******************************************************************************
  17. */
  18. /* Define to prevent recursive inclusion -------------------------------------*/
  19. #ifndef STM32G0xx_LL_EXTI_H
  20. #define STM32G0xx_LL_EXTI_H
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. /* Includes ------------------------------------------------------------------*/
  25. #include "stm32g0xx.h"
  26. /** @addtogroup STM32G0xx_LL_Driver
  27. * @{
  28. */
  29. #if defined (EXTI)
  30. /** @defgroup EXTI_LL EXTI
  31. * @{
  32. */
  33. /* Private types -------------------------------------------------------------*/
  34. /* Private variables ---------------------------------------------------------*/
  35. /* Private constants ---------------------------------------------------------*/
  36. #define LL_EXTI_REGISTER_PINPOS_SHFT 16u /*!< Define used to shift pin position in EXTICR register */
  37. /* Private Macros ------------------------------------------------------------*/
  38. #if defined(USE_FULL_LL_DRIVER)
  39. /** @defgroup EXTI_LL_Private_Macros EXTI Private Macros
  40. * @{
  41. */
  42. /**
  43. * @}
  44. */
  45. #endif /*USE_FULL_LL_DRIVER*/
  46. /* Exported types ------------------------------------------------------------*/
  47. #if defined(USE_FULL_LL_DRIVER)
  48. /** @defgroup EXTI_LL_ES_INIT EXTI Exported Init structure
  49. * @{
  50. */
  51. typedef struct
  52. {
  53. uint32_t Line_0_31; /*!< Specifies the EXTI lines to be enabled or disabled for Lines in range 0 to 31
  54. This parameter can be any combination of @ref EXTI_LL_EC_LINE */
  55. #if defined(STM32G081xx) || defined(STM32G071xx) || defined(STM32G0C1xx) || defined(STM32G0B1xx) || defined(STM32G0B0xx)
  56. uint32_t Line_32_63; /*!< Specifies the EXTI lines to be enabled or disabled for Lines in range 32 to 63
  57. This parameter can be any combination of @ref EXTI_LL_EC_LINE */
  58. #endif /* STM32G081xx || STM32G071xx || STM32G0C1xx || STM32G0B1xx || STM32G0B0xx */
  59. FunctionalState LineCommand; /*!< Specifies the new state of the selected EXTI lines.
  60. This parameter can be set either to ENABLE or DISABLE */
  61. uint8_t Mode; /*!< Specifies the mode for the EXTI lines.
  62. This parameter can be a value of @ref EXTI_LL_EC_MODE. */
  63. uint8_t Trigger; /*!< Specifies the trigger signal active edge for the EXTI lines.
  64. This parameter can be a value of @ref EXTI_LL_EC_TRIGGER. */
  65. } LL_EXTI_InitTypeDef;
  66. /**
  67. * @}
  68. */
  69. #endif /*USE_FULL_LL_DRIVER*/
  70. /* Exported constants --------------------------------------------------------*/
  71. /** @defgroup EXTI_LL_Exported_Constants EXTI Exported Constants
  72. * @{
  73. */
  74. /** @defgroup EXTI_LL_EC_LINE LINE
  75. * @{
  76. */
  77. #define LL_EXTI_LINE_0 EXTI_IMR1_IM0 /*!< Extended line 0 */
  78. #define LL_EXTI_LINE_1 EXTI_IMR1_IM1 /*!< Extended line 1 */
  79. #define LL_EXTI_LINE_2 EXTI_IMR1_IM2 /*!< Extended line 2 */
  80. #define LL_EXTI_LINE_3 EXTI_IMR1_IM3 /*!< Extended line 3 */
  81. #define LL_EXTI_LINE_4 EXTI_IMR1_IM4 /*!< Extended line 4 */
  82. #define LL_EXTI_LINE_5 EXTI_IMR1_IM5 /*!< Extended line 5 */
  83. #define LL_EXTI_LINE_6 EXTI_IMR1_IM6 /*!< Extended line 6 */
  84. #define LL_EXTI_LINE_7 EXTI_IMR1_IM7 /*!< Extended line 7 */
  85. #define LL_EXTI_LINE_8 EXTI_IMR1_IM8 /*!< Extended line 8 */
  86. #define LL_EXTI_LINE_9 EXTI_IMR1_IM9 /*!< Extended line 9 */
  87. #define LL_EXTI_LINE_10 EXTI_IMR1_IM10 /*!< Extended line 10 */
  88. #define LL_EXTI_LINE_11 EXTI_IMR1_IM11 /*!< Extended line 11 */
  89. #define LL_EXTI_LINE_12 EXTI_IMR1_IM12 /*!< Extended line 12 */
  90. #define LL_EXTI_LINE_13 EXTI_IMR1_IM13 /*!< Extended line 13 */
  91. #define LL_EXTI_LINE_14 EXTI_IMR1_IM14 /*!< Extended line 14 */
  92. #define LL_EXTI_LINE_15 EXTI_IMR1_IM15 /*!< Extended line 15 */
  93. #if defined(EXTI_IMR1_IM16)
  94. #define LL_EXTI_LINE_16 EXTI_IMR1_IM16 /*!< Extended line 16 */
  95. #endif /* EXTI_IMR1_IM16 */
  96. #if defined(EXTI_IMR1_IM17)
  97. #define LL_EXTI_LINE_17 EXTI_IMR1_IM17 /*!< Extended line 17 */
  98. #endif /* EXTI_IMR1_IM17 */
  99. #if defined(EXTI_IMR1_IM18)
  100. #define LL_EXTI_LINE_18 EXTI_IMR1_IM18 /*!< Extended line 18 */
  101. #endif /* EXTI_IMR1_IM18 */
  102. #define LL_EXTI_LINE_19 EXTI_IMR1_IM19 /*!< Extended line 19 */
  103. #if defined(EXTI_IMR1_IM20)
  104. #define LL_EXTI_LINE_20 EXTI_IMR1_IM20 /*!< Extended line 20 */
  105. #endif /* EXTI_IMR1_IM20 */
  106. #if defined(EXTI_IMR1_IM21)
  107. #define LL_EXTI_LINE_21 EXTI_IMR1_IM21 /*!< Extended line 21 */
  108. #endif /* EXTI_IMR1_IM21 */
  109. #if defined(EXTI_IMR1_IM22)
  110. #define LL_EXTI_LINE_22 EXTI_IMR1_IM22 /*!< Extended line 22 */
  111. #endif /* EXTI_IMR1_IM22 */
  112. #define LL_EXTI_LINE_23 EXTI_IMR1_IM23 /*!< Extended line 23 */
  113. #if defined(EXTI_IMR1_IM24)
  114. #define LL_EXTI_LINE_24 EXTI_IMR1_IM24 /*!< Extended line 24 */
  115. #endif /* EXTI_IMR1_IM24 */
  116. #if defined(EXTI_IMR1_IM25)
  117. #define LL_EXTI_LINE_25 EXTI_IMR1_IM25 /*!< Extended line 25 */
  118. #endif /* EXTI_IMR1_IM25 */
  119. #if defined(EXTI_IMR1_IM26)
  120. #define LL_EXTI_LINE_26 EXTI_IMR1_IM26 /*!< Extended line 26 */
  121. #endif /* EXTI_IMR1_IM26 */
  122. #if defined(EXTI_IMR1_IM27)
  123. #define LL_EXTI_LINE_27 EXTI_IMR1_IM27 /*!< Extended line 27 */
  124. #endif /* EXTI_IMR1_IM27 */
  125. #if defined(EXTI_IMR1_IM28)
  126. #define LL_EXTI_LINE_28 EXTI_IMR1_IM28 /*!< Extended line 28 */
  127. #endif /* EXTI_IMR1_IM28 */
  128. #if defined(EXTI_IMR1_IM29)
  129. #define LL_EXTI_LINE_29 EXTI_IMR1_IM29 /*!< Extended line 29 */
  130. #endif /* EXTI_IMR1_IM29 */
  131. #if defined(EXTI_IMR1_IM30)
  132. #define LL_EXTI_LINE_30 EXTI_IMR1_IM30 /*!< Extended line 30 */
  133. #endif /* EXTI_IMR1_IM30 */
  134. #if defined(EXTI_IMR1_IM31)
  135. #define LL_EXTI_LINE_31 EXTI_IMR1_IM31 /*!< Extended line 31 */
  136. #endif /* EXTI_IMR1_IM31 */
  137. #define LL_EXTI_LINE_ALL_0_31 EXTI_IMR1_IM /*!< All Extended line not reserved*/
  138. #if defined(EXTI_IMR2_IM32)
  139. #define LL_EXTI_LINE_32 EXTI_IMR2_IM32 /*!< Extended line 32 */
  140. #endif /* EXTI_IMR2_IM32 */
  141. #if defined(EXTI_IMR2_IM33)
  142. #define LL_EXTI_LINE_33 EXTI_IMR2_IM33 /*!< Extended line 33 */
  143. #endif /* EXTI_IMR2_IM33 */
  144. #if defined(EXTI_IMR2_IM34)
  145. #define LL_EXTI_LINE_34 EXTI_IMR2_IM34 /*!< Extended line 34 */
  146. #endif /* EXTI_IMR2_IM34 */
  147. #if defined(EXTI_IMR2_IM35)
  148. #define LL_EXTI_LINE_35 EXTI_IMR2_IM35 /*!< Extended line 35 */
  149. #endif /* EXTI_IMR2_IM35 */
  150. #if defined(EXTI_IMR2_IM36)
  151. #define LL_EXTI_LINE_36 EXTI_IMR2_IM36 /*!< Extended line 36 */
  152. #endif /* EXTI_IMR2_IM36 */
  153. #if defined(EXTI_IMR2_IM32) || defined(EXTI_IMR2_IM33) || defined(EXTI_IMR2_IM34) || defined(EXTI_IMR2_IM35) || defined(EXTI_IMR2_IM36)
  154. #define LL_EXTI_LINE_ALL_32_63 EXTI_IMR2_IM /*!< All Extended line not reserved*/
  155. #endif /* EXTI_IMR2_IM32 || EXTI_IMR2_IM33 || EXTI_IMR2_IM34 || EXTI_IMR2_IM35 || EXTI_IMR2_IM36 */
  156. #define LL_EXTI_LINE_ALL 0xFFFFFFFFU /*!< All Extended line */
  157. #if defined(USE_FULL_LL_DRIVER)
  158. #define LL_EXTI_LINE_NONE 0x00000000U /*!< None Extended line */
  159. #endif /*USE_FULL_LL_DRIVER*/
  160. /** @defgroup EXTI_LL_EC_CONFIG_PORT EXTI CONFIG PORT
  161. * @{
  162. */
  163. #define LL_EXTI_CONFIG_PORTA 0U /*!< EXTI PORT A */
  164. #define LL_EXTI_CONFIG_PORTB EXTI_EXTICR1_EXTI0_0 /*!< EXTI PORT B */
  165. #define LL_EXTI_CONFIG_PORTC EXTI_EXTICR1_EXTI0_1 /*!< EXTI PORT C */
  166. #if defined(GPIOD_BASE)
  167. #define LL_EXTI_CONFIG_PORTD (EXTI_EXTICR1_EXTI0_1|EXTI_EXTICR1_EXTI0_0) /*!< EXTI PORT D */
  168. #endif /*GPIOD_BASE*/
  169. #if defined(GPIOE_BASE)
  170. #define LL_EXTI_CONFIG_PORTE EXTI_EXTICR1_EXTI0_2 /*!< EXTI PORT E */
  171. #endif /*GPIOE_BASE*/
  172. #define LL_EXTI_CONFIG_PORTF (EXTI_EXTICR1_EXTI0_2|EXTI_EXTICR1_EXTI0_0) /*!< EXTI PORT F */
  173. /**
  174. * @}
  175. */
  176. /** @defgroup EXTI_LL_EC_CONFIG_LINE EXTI CONFIG LINE
  177. * @{
  178. */
  179. #define LL_EXTI_CONFIG_LINE0 ((0uL << LL_EXTI_REGISTER_PINPOS_SHFT) | 0U) /*!< EXTI_POSITION_0 | EXTICR[0] */
  180. #define LL_EXTI_CONFIG_LINE1 ((8uL << LL_EXTI_REGISTER_PINPOS_SHFT) | 0U) /*!< EXTI_POSITION_8 | EXTICR[0] */
  181. #define LL_EXTI_CONFIG_LINE2 ((16uL << LL_EXTI_REGISTER_PINPOS_SHFT) | 0U) /*!< EXTI_POSITION_16 | EXTICR[0] */
  182. #define LL_EXTI_CONFIG_LINE3 ((24uL << LL_EXTI_REGISTER_PINPOS_SHFT) | 0U) /*!< EXTI_POSITION_24 | EXTICR[0] */
  183. #define LL_EXTI_CONFIG_LINE4 ((0uL << LL_EXTI_REGISTER_PINPOS_SHFT) | 1U) /*!< EXTI_POSITION_0 | EXTICR[1] */
  184. #define LL_EXTI_CONFIG_LINE5 ((8uL << LL_EXTI_REGISTER_PINPOS_SHFT) | 1U) /*!< EXTI_POSITION_8 | EXTICR[1] */
  185. #define LL_EXTI_CONFIG_LINE6 ((16uL << LL_EXTI_REGISTER_PINPOS_SHFT) | 1U) /*!< EXTI_POSITION_16 | EXTICR[1] */
  186. #define LL_EXTI_CONFIG_LINE7 ((24uL << LL_EXTI_REGISTER_PINPOS_SHFT) | 1U) /*!< EXTI_POSITION_24 | EXTICR[1] */
  187. #define LL_EXTI_CONFIG_LINE8 ((0uL << LL_EXTI_REGISTER_PINPOS_SHFT) | 2U) /*!< EXTI_POSITION_0 | EXTICR[2] */
  188. #define LL_EXTI_CONFIG_LINE9 ((8uL << LL_EXTI_REGISTER_PINPOS_SHFT) | 2U) /*!< EXTI_POSITION_8 | EXTICR[2] */
  189. #define LL_EXTI_CONFIG_LINE10 ((16uL << LL_EXTI_REGISTER_PINPOS_SHFT) | 2U) /*!< EXTI_POSITION_16 | EXTICR[2] */
  190. #define LL_EXTI_CONFIG_LINE11 ((24uL << LL_EXTI_REGISTER_PINPOS_SHFT) | 2U) /*!< EXTI_POSITION_24 | EXTICR[2] */
  191. #define LL_EXTI_CONFIG_LINE12 ((0uL << LL_EXTI_REGISTER_PINPOS_SHFT) | 3U) /*!< EXTI_POSITION_0 | EXTICR[3] */
  192. #define LL_EXTI_CONFIG_LINE13 ((8uL << LL_EXTI_REGISTER_PINPOS_SHFT) | 3U) /*!< EXTI_POSITION_8 | EXTICR[3] */
  193. #define LL_EXTI_CONFIG_LINE14 ((16uL << LL_EXTI_REGISTER_PINPOS_SHFT) | 3U) /*!< EXTI_POSITION_16 | EXTICR[3] */
  194. #define LL_EXTI_CONFIG_LINE15 ((24uL << LL_EXTI_REGISTER_PINPOS_SHFT) | 3U) /*!< EXTI_POSITION_24 | EXTICR[3] */
  195. /**
  196. * @}
  197. */
  198. /**
  199. * @}
  200. */
  201. #if defined(USE_FULL_LL_DRIVER)
  202. /** @defgroup EXTI_LL_EC_MODE Mode
  203. * @{
  204. */
  205. #define LL_EXTI_MODE_IT ((uint8_t)0x00U) /*!< Interrupt Mode */
  206. #define LL_EXTI_MODE_EVENT ((uint8_t)0x01U) /*!< Event Mode */
  207. #define LL_EXTI_MODE_IT_EVENT ((uint8_t)0x02U) /*!< Interrupt & Event Mode */
  208. /**
  209. * @}
  210. */
  211. /** @defgroup EXTI_LL_EC_TRIGGER Edge Trigger
  212. * @{
  213. */
  214. #define LL_EXTI_TRIGGER_NONE ((uint8_t)0x00U) /*!< No Trigger Mode */
  215. #define LL_EXTI_TRIGGER_RISING ((uint8_t)0x01U) /*!< Trigger Rising Mode */
  216. #define LL_EXTI_TRIGGER_FALLING ((uint8_t)0x02U) /*!< Trigger Falling Mode */
  217. #define LL_EXTI_TRIGGER_RISING_FALLING ((uint8_t)0x03U) /*!< Trigger Rising & Falling Mode */
  218. /**
  219. * @}
  220. */
  221. #endif /*USE_FULL_LL_DRIVER*/
  222. /**
  223. * @}
  224. */
  225. /* Exported macro ------------------------------------------------------------*/
  226. /** @defgroup EXTI_LL_Exported_Macros EXTI Exported Macros
  227. * @{
  228. */
  229. /** @defgroup EXTI_LL_EM_WRITE_READ Common Write and read registers Macros
  230. * @{
  231. */
  232. /**
  233. * @brief Write a value in EXTI register
  234. * @param __REG__ Register to be written
  235. * @param __VALUE__ Value to be written in the register
  236. * @retval None
  237. */
  238. #define LL_EXTI_WriteReg(__REG__, __VALUE__) WRITE_REG(EXTI->__REG__, (__VALUE__))
  239. /**
  240. * @brief Read a value in EXTI register
  241. * @param __REG__ Register to be read
  242. * @retval Register value
  243. */
  244. #define LL_EXTI_ReadReg(__REG__) READ_REG(EXTI->__REG__)
  245. /**
  246. * @}
  247. */
  248. /**
  249. * @}
  250. */
  251. /* Exported functions --------------------------------------------------------*/
  252. /** @defgroup EXTI_LL_Exported_Functions EXTI Exported Functions
  253. * @{
  254. */
  255. /** @defgroup EXTI_LL_EF_IT_Management IT_Management
  256. * @{
  257. */
  258. /**
  259. * @brief Enable ExtiLine Interrupt request for Lines in range 0 to 31
  260. * @note The reset value for the direct or internal lines (see RM)
  261. * is set to 1 in order to enable the interrupt by default.
  262. * Bits are set automatically at Power on.
  263. * @rmtoll IMR1 IMx LL_EXTI_EnableIT_0_31
  264. * @param ExtiLine This parameter can be one of the following values:
  265. * @arg @ref LL_EXTI_LINE_0
  266. * @arg @ref LL_EXTI_LINE_1
  267. * @arg @ref LL_EXTI_LINE_2
  268. * @arg @ref LL_EXTI_LINE_3
  269. * @arg @ref LL_EXTI_LINE_4
  270. * @arg @ref LL_EXTI_LINE_5
  271. * @arg @ref LL_EXTI_LINE_6
  272. * @arg @ref LL_EXTI_LINE_7
  273. * @arg @ref LL_EXTI_LINE_8
  274. * @arg @ref LL_EXTI_LINE_9
  275. * @arg @ref LL_EXTI_LINE_10
  276. * @arg @ref LL_EXTI_LINE_11
  277. * @arg @ref LL_EXTI_LINE_12
  278. * @arg @ref LL_EXTI_LINE_13
  279. * @arg @ref LL_EXTI_LINE_14
  280. * @arg @ref LL_EXTI_LINE_15
  281. * @arg @ref LL_EXTI_LINE_16
  282. * @arg @ref LL_EXTI_LINE_17
  283. * @arg @ref LL_EXTI_LINE_18
  284. * @arg @ref LL_EXTI_LINE_19
  285. * @arg @ref LL_EXTI_LINE_21
  286. * @arg @ref LL_EXTI_LINE_23
  287. * @arg @ref LL_EXTI_LINE_25
  288. * @arg @ref LL_EXTI_LINE_26
  289. * @arg @ref LL_EXTI_LINE_27
  290. * @arg @ref LL_EXTI_LINE_28
  291. * @arg @ref LL_EXTI_LINE_29
  292. * @arg @ref LL_EXTI_LINE_30
  293. * @arg @ref LL_EXTI_LINE_31
  294. * @arg @ref LL_EXTI_LINE_ALL_0_31
  295. * @note Please check each device line mapping for EXTI Line availability
  296. * @retval None
  297. */
  298. __STATIC_INLINE void LL_EXTI_EnableIT_0_31(uint32_t ExtiLine)
  299. {
  300. SET_BIT(EXTI->IMR1, ExtiLine);
  301. }
  302. #if defined(STM32G081xx) || defined(STM32G071xx) || defined(STM32G0C1xx) || defined(STM32G0B1xx) || defined(STM32G0B0xx)
  303. /**
  304. * @brief Enable ExtiLine Interrupt request for Lines in range 32 to 63
  305. * @note The reset value for the direct lines (lines 32 & 33)
  306. * is set to 1 in order to enable the interrupt by default.
  307. * Bits are set automatically at Power on.
  308. * @rmtoll IMR2 IMx LL_EXTI_EnableIT_32_63
  309. * @param ExtiLine This parameter can be one of the following values:
  310. * @arg @ref LL_EXTI_LINE_32
  311. * @arg @ref LL_EXTI_LINE_33
  312. * @arg @ref LL_EXTI_LINE_34
  313. * @arg @ref LL_EXTI_LINE_35
  314. * @arg @ref LL_EXTI_LINE_36
  315. * @arg @ref LL_EXTI_LINE_ALL_32_63
  316. * @note Please check each device line mapping for EXTI Line availability
  317. * @retval None
  318. */
  319. __STATIC_INLINE void LL_EXTI_EnableIT_32_63(uint32_t ExtiLine)
  320. {
  321. SET_BIT(EXTI->IMR2, ExtiLine);
  322. }
  323. #endif /* STM32G081xx || STM32G071xx || STM32G0C1xx || STM32G0B1xx || STM32G0B0xx */
  324. /**
  325. * @brief Disable ExtiLine Interrupt request for Lines in range 0 to 31
  326. * @note The reset value for the direct or internal lines (see RM)
  327. * is set to 1 in order to enable the interrupt by default.
  328. * Bits are set automatically at Power on.
  329. * @rmtoll IMR1 IMx LL_EXTI_DisableIT_0_31
  330. * @param ExtiLine This parameter can be one of the following values:
  331. * @arg @ref LL_EXTI_LINE_0
  332. * @arg @ref LL_EXTI_LINE_1
  333. * @arg @ref LL_EXTI_LINE_2
  334. * @arg @ref LL_EXTI_LINE_3
  335. * @arg @ref LL_EXTI_LINE_4
  336. * @arg @ref LL_EXTI_LINE_5
  337. * @arg @ref LL_EXTI_LINE_6
  338. * @arg @ref LL_EXTI_LINE_7
  339. * @arg @ref LL_EXTI_LINE_8
  340. * @arg @ref LL_EXTI_LINE_9
  341. * @arg @ref LL_EXTI_LINE_10
  342. * @arg @ref LL_EXTI_LINE_11
  343. * @arg @ref LL_EXTI_LINE_12
  344. * @arg @ref LL_EXTI_LINE_13
  345. * @arg @ref LL_EXTI_LINE_14
  346. * @arg @ref LL_EXTI_LINE_15
  347. * @arg @ref LL_EXTI_LINE_16
  348. * @arg @ref LL_EXTI_LINE_17
  349. * @arg @ref LL_EXTI_LINE_18
  350. * @arg @ref LL_EXTI_LINE_19
  351. * @arg @ref LL_EXTI_LINE_21
  352. * @arg @ref LL_EXTI_LINE_23
  353. * @arg @ref LL_EXTI_LINE_25
  354. * @arg @ref LL_EXTI_LINE_26
  355. * @arg @ref LL_EXTI_LINE_27
  356. * @arg @ref LL_EXTI_LINE_28
  357. * @arg @ref LL_EXTI_LINE_29
  358. * @arg @ref LL_EXTI_LINE_30
  359. * @arg @ref LL_EXTI_LINE_31
  360. * @arg @ref LL_EXTI_LINE_ALL_0_31
  361. * @note Please check each device line mapping for EXTI Line availability
  362. * @retval None
  363. */
  364. __STATIC_INLINE void LL_EXTI_DisableIT_0_31(uint32_t ExtiLine)
  365. {
  366. CLEAR_BIT(EXTI->IMR1, ExtiLine);
  367. }
  368. #if defined(STM32G081xx) || defined(STM32G071xx) || defined(STM32G0C1xx) || defined(STM32G0B1xx) || defined(STM32G0B0xx)
  369. /**
  370. * @brief Disable ExtiLine Interrupt request for Lines in range 32 to 63
  371. * @note The reset value for the direct lines (lines 32 & 33)
  372. * is set to 1 in order to enable the interrupt by default.
  373. * Bits are set automatically at Power on.
  374. * @rmtoll IMR2 IMx LL_EXTI_DisableIT_32_63
  375. * @param ExtiLine This parameter can be one of the following values:
  376. * @arg @ref LL_EXTI_LINE_32
  377. * @arg @ref LL_EXTI_LINE_33
  378. * @arg @ref LL_EXTI_LINE_34
  379. * @arg @ref LL_EXTI_LINE_35
  380. * @arg @ref LL_EXTI_LINE_36
  381. * @arg @ref LL_EXTI_LINE_ALL_32_63
  382. * @note Please check each device line mapping for EXTI Line availability
  383. * @retval None
  384. */
  385. __STATIC_INLINE void LL_EXTI_DisableIT_32_63(uint32_t ExtiLine)
  386. {
  387. CLEAR_BIT(EXTI->IMR2, ExtiLine);
  388. }
  389. #endif /* STM32G081xx || STM32G071xx || STM32G0C1xx || STM32G0B1xx || STM32G0B0xx */
  390. /**
  391. * @brief Indicate if ExtiLine Interrupt request is enabled for Lines in range 0 to 31
  392. * @note The reset value for the direct or internal lines (see RM)
  393. * is set to 1 in order to enable the interrupt by default.
  394. * Bits are set automatically at Power on.
  395. * @rmtoll IMR1 IMx LL_EXTI_IsEnabledIT_0_31
  396. * @param ExtiLine This parameter can be one of the following values:
  397. * @arg @ref LL_EXTI_LINE_0
  398. * @arg @ref LL_EXTI_LINE_1
  399. * @arg @ref LL_EXTI_LINE_2
  400. * @arg @ref LL_EXTI_LINE_3
  401. * @arg @ref LL_EXTI_LINE_4
  402. * @arg @ref LL_EXTI_LINE_5
  403. * @arg @ref LL_EXTI_LINE_6
  404. * @arg @ref LL_EXTI_LINE_7
  405. * @arg @ref LL_EXTI_LINE_8
  406. * @arg @ref LL_EXTI_LINE_9
  407. * @arg @ref LL_EXTI_LINE_10
  408. * @arg @ref LL_EXTI_LINE_11
  409. * @arg @ref LL_EXTI_LINE_12
  410. * @arg @ref LL_EXTI_LINE_13
  411. * @arg @ref LL_EXTI_LINE_14
  412. * @arg @ref LL_EXTI_LINE_15
  413. * @arg @ref LL_EXTI_LINE_16
  414. * @arg @ref LL_EXTI_LINE_17
  415. * @arg @ref LL_EXTI_LINE_18
  416. * @arg @ref LL_EXTI_LINE_19
  417. * @arg @ref LL_EXTI_LINE_21
  418. * @arg @ref LL_EXTI_LINE_23
  419. * @arg @ref LL_EXTI_LINE_25
  420. * @arg @ref LL_EXTI_LINE_26
  421. * @arg @ref LL_EXTI_LINE_27
  422. * @arg @ref LL_EXTI_LINE_28
  423. * @arg @ref LL_EXTI_LINE_29
  424. * @arg @ref LL_EXTI_LINE_30
  425. * @arg @ref LL_EXTI_LINE_31
  426. * @arg @ref LL_EXTI_LINE_ALL_0_31
  427. * @note Please check each device line mapping for EXTI Line availability
  428. * @retval State of bit (1 or 0).
  429. */
  430. __STATIC_INLINE uint32_t LL_EXTI_IsEnabledIT_0_31(uint32_t ExtiLine)
  431. {
  432. return ((READ_BIT(EXTI->IMR1, ExtiLine) == (ExtiLine)) ? 1UL : 0UL);
  433. }
  434. #if defined(STM32G081xx) || defined(STM32G071xx) || defined(STM32G0C1xx) || defined(STM32G0B1xx) || defined(STM32G0B0xx)
  435. /**
  436. * @brief Indicate if ExtiLine Interrupt request is enabled for Lines in range 32 to 63
  437. * @note The reset value for the direct lines (lines 32 & 33)
  438. * is set to 1 in order to enable the interrupt by default.
  439. * @rmtoll IMR2 IMx LL_EXTI_IsEnabledIT_32_63
  440. * @param ExtiLine This parameter can be one of the following values:
  441. * @arg @ref LL_EXTI_LINE_32
  442. * @arg @ref LL_EXTI_LINE_33
  443. * @arg @ref LL_EXTI_LINE_34
  444. * @arg @ref LL_EXTI_LINE_35
  445. * @arg @ref LL_EXTI_LINE_36
  446. * @arg @ref LL_EXTI_LINE_ALL_32_63
  447. * @note Please check each device line mapping for EXTI Line availability
  448. * @retval State of bit (1 or 0).
  449. */
  450. __STATIC_INLINE uint32_t LL_EXTI_IsEnabledIT_32_63(uint32_t ExtiLine)
  451. {
  452. return ((READ_BIT(EXTI->IMR2, ExtiLine) == (ExtiLine)) ? 1UL : 0UL);
  453. }
  454. #endif /* STM32G081xx || STM32G071xx || STM32G0C1xx || STM32G0B1xx || STM32G0B0xx */
  455. /**
  456. * @}
  457. */
  458. /** @defgroup EXTI_LL_EF_Event_Management Event_Management
  459. * @{
  460. */
  461. /**
  462. * @brief Enable ExtiLine Event request for Lines in range 0 to 31
  463. * @rmtoll EMR1 EMx LL_EXTI_EnableEvent_0_31
  464. * @param ExtiLine This parameter can be one of the following values:
  465. * @arg @ref LL_EXTI_LINE_0
  466. * @arg @ref LL_EXTI_LINE_1
  467. * @arg @ref LL_EXTI_LINE_2
  468. * @arg @ref LL_EXTI_LINE_3
  469. * @arg @ref LL_EXTI_LINE_4
  470. * @arg @ref LL_EXTI_LINE_5
  471. * @arg @ref LL_EXTI_LINE_6
  472. * @arg @ref LL_EXTI_LINE_7
  473. * @arg @ref LL_EXTI_LINE_8
  474. * @arg @ref LL_EXTI_LINE_9
  475. * @arg @ref LL_EXTI_LINE_10
  476. * @arg @ref LL_EXTI_LINE_11
  477. * @arg @ref LL_EXTI_LINE_12
  478. * @arg @ref LL_EXTI_LINE_13
  479. * @arg @ref LL_EXTI_LINE_14
  480. * @arg @ref LL_EXTI_LINE_15
  481. * @arg @ref LL_EXTI_LINE_16
  482. * @arg @ref LL_EXTI_LINE_17
  483. * @arg @ref LL_EXTI_LINE_18
  484. * @arg @ref LL_EXTI_LINE_19
  485. * @arg @ref LL_EXTI_LINE_21
  486. * @arg @ref LL_EXTI_LINE_23
  487. * @arg @ref LL_EXTI_LINE_25
  488. * @arg @ref LL_EXTI_LINE_26
  489. * @arg @ref LL_EXTI_LINE_27
  490. * @arg @ref LL_EXTI_LINE_28
  491. * @arg @ref LL_EXTI_LINE_29
  492. * @arg @ref LL_EXTI_LINE_30
  493. * @arg @ref LL_EXTI_LINE_31
  494. * @arg @ref LL_EXTI_LINE_ALL_0_31
  495. * @note Please check each device line mapping for EXTI Line availability
  496. * @retval None
  497. */
  498. __STATIC_INLINE void LL_EXTI_EnableEvent_0_31(uint32_t ExtiLine)
  499. {
  500. SET_BIT(EXTI->EMR1, ExtiLine);
  501. }
  502. #if defined(STM32G081xx) || defined(STM32G071xx) || defined(STM32G0C1xx) || defined(STM32G0B1xx) || defined(STM32G0B0xx)
  503. /**
  504. * @brief Enable ExtiLine Event request for Lines in range 32 to 63
  505. * @rmtoll EMR2 EMx LL_EXTI_EnableEvent_32_63
  506. * @param ExtiLine This parameter can be a combination of the following values:
  507. * @arg @ref LL_EXTI_LINE_32
  508. * @arg @ref LL_EXTI_LINE_33
  509. * @arg @ref LL_EXTI_LINE_34
  510. * @arg @ref LL_EXTI_LINE_35
  511. * @arg @ref LL_EXTI_LINE_36
  512. * @arg @ref LL_EXTI_LINE_ALL_32_63
  513. * @note Please check each device line mapping for EXTI Line availability
  514. * @retval None
  515. */
  516. __STATIC_INLINE void LL_EXTI_EnableEvent_32_63(uint32_t ExtiLine)
  517. {
  518. SET_BIT(EXTI->EMR2, ExtiLine);
  519. }
  520. #endif /* STM32G081xx || STM32G071xx || STM32G0C1xx || STM32G0B1xx || STM32G0B0xx */
  521. /**
  522. * @brief Disable ExtiLine Event request for Lines in range 0 to 31
  523. * @rmtoll EMR1 EMx LL_EXTI_DisableEvent_0_31
  524. * @param ExtiLine This parameter can be one of the following values:
  525. * @arg @ref LL_EXTI_LINE_0
  526. * @arg @ref LL_EXTI_LINE_1
  527. * @arg @ref LL_EXTI_LINE_2
  528. * @arg @ref LL_EXTI_LINE_3
  529. * @arg @ref LL_EXTI_LINE_4
  530. * @arg @ref LL_EXTI_LINE_5
  531. * @arg @ref LL_EXTI_LINE_6
  532. * @arg @ref LL_EXTI_LINE_7
  533. * @arg @ref LL_EXTI_LINE_8
  534. * @arg @ref LL_EXTI_LINE_9
  535. * @arg @ref LL_EXTI_LINE_10
  536. * @arg @ref LL_EXTI_LINE_11
  537. * @arg @ref LL_EXTI_LINE_12
  538. * @arg @ref LL_EXTI_LINE_13
  539. * @arg @ref LL_EXTI_LINE_14
  540. * @arg @ref LL_EXTI_LINE_15
  541. * @arg @ref LL_EXTI_LINE_16
  542. * @arg @ref LL_EXTI_LINE_17
  543. * @arg @ref LL_EXTI_LINE_18
  544. * @arg @ref LL_EXTI_LINE_19
  545. * @arg @ref LL_EXTI_LINE_21
  546. * @arg @ref LL_EXTI_LINE_23
  547. * @arg @ref LL_EXTI_LINE_25
  548. * @arg @ref LL_EXTI_LINE_26
  549. * @arg @ref LL_EXTI_LINE_27
  550. * @arg @ref LL_EXTI_LINE_28
  551. * @arg @ref LL_EXTI_LINE_29
  552. * @arg @ref LL_EXTI_LINE_30
  553. * @arg @ref LL_EXTI_LINE_31
  554. * @arg @ref LL_EXTI_LINE_ALL_0_31
  555. * @note Please check each device line mapping for EXTI Line availability
  556. * @retval None
  557. */
  558. __STATIC_INLINE void LL_EXTI_DisableEvent_0_31(uint32_t ExtiLine)
  559. {
  560. CLEAR_BIT(EXTI->EMR1, ExtiLine);
  561. }
  562. #if defined(STM32G081xx) || defined(STM32G071xx) || defined(STM32G0C1xx) || defined(STM32G0B1xx) || defined(STM32G0B0xx)
  563. /**
  564. * @brief Disable ExtiLine Event request for Lines in range 32 to 63
  565. * @rmtoll EMR2 EMx LL_EXTI_DisableEvent_32_63
  566. * @param ExtiLine This parameter can be a combination of the following values:
  567. * @arg @ref LL_EXTI_LINE_32
  568. * @arg @ref LL_EXTI_LINE_33
  569. * @arg @ref LL_EXTI_LINE_34
  570. * @arg @ref LL_EXTI_LINE_35
  571. * @arg @ref LL_EXTI_LINE_36
  572. * @arg @ref LL_EXTI_LINE_ALL_32_63
  573. * @note Please check each device line mapping for EXTI Line availability
  574. * @retval None
  575. */
  576. __STATIC_INLINE void LL_EXTI_DisableEvent_32_63(uint32_t ExtiLine)
  577. {
  578. CLEAR_BIT(EXTI->EMR2, ExtiLine);
  579. }
  580. #endif
  581. /**
  582. * @brief Indicate if ExtiLine Event request is enabled for Lines in range 0 to 31
  583. * @rmtoll EMR1 EMx LL_EXTI_IsEnabledEvent_0_31
  584. * @param ExtiLine This parameter can be one of the following values:
  585. * @arg @ref LL_EXTI_LINE_0
  586. * @arg @ref LL_EXTI_LINE_1
  587. * @arg @ref LL_EXTI_LINE_2
  588. * @arg @ref LL_EXTI_LINE_3
  589. * @arg @ref LL_EXTI_LINE_4
  590. * @arg @ref LL_EXTI_LINE_5
  591. * @arg @ref LL_EXTI_LINE_6
  592. * @arg @ref LL_EXTI_LINE_7
  593. * @arg @ref LL_EXTI_LINE_8
  594. * @arg @ref LL_EXTI_LINE_9
  595. * @arg @ref LL_EXTI_LINE_10
  596. * @arg @ref LL_EXTI_LINE_11
  597. * @arg @ref LL_EXTI_LINE_12
  598. * @arg @ref LL_EXTI_LINE_13
  599. * @arg @ref LL_EXTI_LINE_14
  600. * @arg @ref LL_EXTI_LINE_15
  601. * @arg @ref LL_EXTI_LINE_16
  602. * @arg @ref LL_EXTI_LINE_17
  603. * @arg @ref LL_EXTI_LINE_18
  604. * @arg @ref LL_EXTI_LINE_19
  605. * @arg @ref LL_EXTI_LINE_21
  606. * @arg @ref LL_EXTI_LINE_23
  607. * @arg @ref LL_EXTI_LINE_25
  608. * @arg @ref LL_EXTI_LINE_26
  609. * @arg @ref LL_EXTI_LINE_27
  610. * @arg @ref LL_EXTI_LINE_28
  611. * @arg @ref LL_EXTI_LINE_29
  612. * @arg @ref LL_EXTI_LINE_30
  613. * @arg @ref LL_EXTI_LINE_31
  614. * @arg @ref LL_EXTI_LINE_ALL_0_31
  615. * @note Please check each device line mapping for EXTI Line availability
  616. * @retval State of bit (1 or 0).
  617. */
  618. __STATIC_INLINE uint32_t LL_EXTI_IsEnabledEvent_0_31(uint32_t ExtiLine)
  619. {
  620. return ((READ_BIT(EXTI->EMR1, ExtiLine) == (ExtiLine)) ? 1UL : 0UL);
  621. }
  622. #if defined(STM32G081xx) || defined(STM32G071xx) || defined(STM32G0C1xx) || defined(STM32G0B1xx) || defined(STM32G0B0xx)
  623. /**
  624. * @brief Indicate if ExtiLine Event request is enabled for Lines in range 32 to 63
  625. * @rmtoll EMR2 EMx LL_EXTI_IsEnabledEvent_32_63
  626. * @param ExtiLine This parameter can be a combination of the following values:
  627. * @arg @ref LL_EXTI_LINE_32
  628. * @arg @ref LL_EXTI_LINE_33
  629. * @arg @ref LL_EXTI_LINE_34
  630. * @arg @ref LL_EXTI_LINE_35
  631. * @arg @ref LL_EXTI_LINE_36
  632. * @arg @ref LL_EXTI_LINE_ALL_32_63
  633. * @note Please check each device line mapping for EXTI Line availability
  634. * @retval State of bit (1 or 0).
  635. */
  636. __STATIC_INLINE uint32_t LL_EXTI_IsEnabledEvent_32_63(uint32_t ExtiLine)
  637. {
  638. return ((READ_BIT(EXTI->EMR2, ExtiLine) == (ExtiLine)) ? 1UL : 0UL);
  639. }
  640. #endif /* STM32G081xx || STM32G071xx || STM32G0C1xx || STM32G0B1xx || STM32G0B0xx */
  641. /**
  642. * @}
  643. */
  644. /** @defgroup EXTI_LL_EF_Rising_Trigger_Management Rising_Trigger_Management
  645. * @{
  646. */
  647. /**
  648. * @brief Enable ExtiLine Rising Edge Trigger for Lines in range 0 to 31
  649. * @note The configurable wakeup lines are edge-triggered. No glitch must be
  650. * generated on these lines. If a rising edge on a configurable interrupt
  651. * line occurs during a write operation in the EXTI_RTSR register, the
  652. * pending bit is not set.
  653. * Rising and falling edge triggers can be set for
  654. * the same interrupt line. In this case, both generate a trigger
  655. * condition.
  656. * @rmtoll RTSR1 RTx LL_EXTI_EnableRisingTrig_0_31
  657. * @param ExtiLine This parameter can be a combination of the following values:
  658. * @arg @ref LL_EXTI_LINE_0
  659. * @arg @ref LL_EXTI_LINE_1
  660. * @arg @ref LL_EXTI_LINE_2
  661. * @arg @ref LL_EXTI_LINE_3
  662. * @arg @ref LL_EXTI_LINE_4
  663. * @arg @ref LL_EXTI_LINE_5
  664. * @arg @ref LL_EXTI_LINE_6
  665. * @arg @ref LL_EXTI_LINE_7
  666. * @arg @ref LL_EXTI_LINE_8
  667. * @arg @ref LL_EXTI_LINE_9
  668. * @arg @ref LL_EXTI_LINE_10
  669. * @arg @ref LL_EXTI_LINE_11
  670. * @arg @ref LL_EXTI_LINE_12
  671. * @arg @ref LL_EXTI_LINE_13
  672. * @arg @ref LL_EXTI_LINE_14
  673. * @arg @ref LL_EXTI_LINE_15
  674. * @arg @ref LL_EXTI_LINE_16
  675. * @arg @ref LL_EXTI_LINE_17
  676. * @arg @ref LL_EXTI_LINE_18
  677. * @arg @ref LL_EXTI_LINE_20
  678. * @note Please check each device line mapping for EXTI Line availability
  679. * @retval None
  680. */
  681. __STATIC_INLINE void LL_EXTI_EnableRisingTrig_0_31(uint32_t ExtiLine)
  682. {
  683. SET_BIT(EXTI->RTSR1, ExtiLine);
  684. }
  685. #if defined(STM32G0C1xx) || defined(STM32G0B1xx)
  686. /**
  687. * @brief Enable ExtiLine Rising Edge Trigger for Lines in range 32 to 63
  688. * @note The configurable wakeup lines are edge-triggered. No glitch must be
  689. * generated on these lines. If a rising edge on a configurable interrupt
  690. * line occurs during a write operation in the EXTI_RTSR register, the
  691. * pending bit is not set.
  692. * Rising and falling edge triggers can be set for
  693. * the same interrupt line. In this case, both generate a trigger
  694. * condition.
  695. * @rmtoll RTSR2 RTx LL_EXTI_EnableRisingTrig_32_63
  696. * @param ExtiLine This parameter can be a combination of the following values:
  697. * @arg @ref LL_EXTI_LINE_34
  698. * @note Please check each device line mapping for EXTI Line availability
  699. * @retval None
  700. */
  701. __STATIC_INLINE void LL_EXTI_EnableRisingTrig_32_63(uint32_t ExtiLine)
  702. {
  703. SET_BIT(EXTI->RTSR2, ExtiLine);
  704. }
  705. #endif /* STM32G0C1xx || STM32G0B1xx */
  706. /**
  707. * @brief Disable ExtiLine Rising Edge Trigger for Lines in range 0 to 31
  708. * @note The configurable wakeup lines are edge-triggered. No glitch must be
  709. * generated on these lines. If a rising edge on a configurable interrupt
  710. * line occurs during a write operation in the EXTI_RTSR register, the
  711. * pending bit is not set.
  712. * Rising and falling edge triggers can be set for
  713. * the same interrupt line. In this case, both generate a trigger
  714. * condition.
  715. * @rmtoll RTSR1 RTx LL_EXTI_DisableRisingTrig_0_31
  716. * @param ExtiLine This parameter can be a combination of the following values:
  717. * @arg @ref LL_EXTI_LINE_0
  718. * @arg @ref LL_EXTI_LINE_1
  719. * @arg @ref LL_EXTI_LINE_2
  720. * @arg @ref LL_EXTI_LINE_3
  721. * @arg @ref LL_EXTI_LINE_4
  722. * @arg @ref LL_EXTI_LINE_5
  723. * @arg @ref LL_EXTI_LINE_6
  724. * @arg @ref LL_EXTI_LINE_7
  725. * @arg @ref LL_EXTI_LINE_8
  726. * @arg @ref LL_EXTI_LINE_9
  727. * @arg @ref LL_EXTI_LINE_10
  728. * @arg @ref LL_EXTI_LINE_11
  729. * @arg @ref LL_EXTI_LINE_12
  730. * @arg @ref LL_EXTI_LINE_13
  731. * @arg @ref LL_EXTI_LINE_14
  732. * @arg @ref LL_EXTI_LINE_15
  733. * @arg @ref LL_EXTI_LINE_16
  734. * @arg @ref LL_EXTI_LINE_17
  735. * @arg @ref LL_EXTI_LINE_18
  736. * @arg @ref LL_EXTI_LINE_20
  737. * @note Please check each device line mapping for EXTI Line availability
  738. * @retval None
  739. */
  740. __STATIC_INLINE void LL_EXTI_DisableRisingTrig_0_31(uint32_t ExtiLine)
  741. {
  742. CLEAR_BIT(EXTI->RTSR1, ExtiLine);
  743. }
  744. #if defined(STM32G0C1xx) || defined(STM32G0B1xx)
  745. /**
  746. * @brief Disable ExtiLine Rising Edge Trigger for Lines in range 32 to 63
  747. * @note The configurable wakeup lines are edge-triggered. No glitch must be
  748. * generated on these lines. If a rising edge on a configurable interrupt
  749. * line occurs during a write operation in the EXTI_RTSR register, the
  750. * pending bit is not set.
  751. * Rising and falling edge triggers can be set for
  752. * the same interrupt line. In this case, both generate a trigger
  753. * condition.
  754. * @rmtoll RTSR2 RTx LL_EXTI_DisableRisingTrig_32_63
  755. * @param ExtiLine This parameter can be a combination of the following values:
  756. * @arg @ref LL_EXTI_LINE_34
  757. * @note Please check each device line mapping for EXTI Line availability
  758. * @retval None
  759. */
  760. __STATIC_INLINE void LL_EXTI_DisableRisingTrig_32_63(uint32_t ExtiLine)
  761. {
  762. CLEAR_BIT(EXTI->RTSR2, ExtiLine);
  763. }
  764. #endif /* STM32G0C1xx || STM32G0B1xx */
  765. /**
  766. * @brief Check if rising edge trigger is enabled for Lines in range 0 to 31
  767. * @rmtoll RTSR1 RTx LL_EXTI_IsEnabledRisingTrig_0_31
  768. * @param ExtiLine This parameter can be a combination of the following values:
  769. * @arg @ref LL_EXTI_LINE_0
  770. * @arg @ref LL_EXTI_LINE_1
  771. * @arg @ref LL_EXTI_LINE_2
  772. * @arg @ref LL_EXTI_LINE_3
  773. * @arg @ref LL_EXTI_LINE_4
  774. * @arg @ref LL_EXTI_LINE_5
  775. * @arg @ref LL_EXTI_LINE_6
  776. * @arg @ref LL_EXTI_LINE_7
  777. * @arg @ref LL_EXTI_LINE_8
  778. * @arg @ref LL_EXTI_LINE_9
  779. * @arg @ref LL_EXTI_LINE_10
  780. * @arg @ref LL_EXTI_LINE_11
  781. * @arg @ref LL_EXTI_LINE_12
  782. * @arg @ref LL_EXTI_LINE_13
  783. * @arg @ref LL_EXTI_LINE_14
  784. * @arg @ref LL_EXTI_LINE_15
  785. * @arg @ref LL_EXTI_LINE_16
  786. * @arg @ref LL_EXTI_LINE_17
  787. * @arg @ref LL_EXTI_LINE_20
  788. * @note Please check each device line mapping for EXTI Line availability
  789. * @retval State of bit (1 or 0).
  790. */
  791. __STATIC_INLINE uint32_t LL_EXTI_IsEnabledRisingTrig_0_31(uint32_t ExtiLine)
  792. {
  793. return ((READ_BIT(EXTI->RTSR1, ExtiLine) == (ExtiLine)) ? 1UL : 0UL);
  794. }
  795. #if defined(STM32G0C1xx) || defined(STM32G0B1xx)
  796. /**
  797. * @brief Check if rising edge trigger is enabled for Lines in range 32 to 63
  798. * @rmtoll RTSR2 RTx LL_EXTI_IsEnabledRisingTrig_32_63
  799. * @param ExtiLine This parameter can be a combination of the following values:
  800. * @arg @ref LL_EXTI_LINE_34
  801. * @note Please check each device line mapping for EXTI Line availability
  802. * @retval State of bit (1 or 0).
  803. */
  804. __STATIC_INLINE uint32_t LL_EXTI_IsEnabledRisingTrig_32_63(uint32_t ExtiLine)
  805. {
  806. return ((READ_BIT(EXTI->RTSR2, ExtiLine) == (ExtiLine)) ? 1UL : 0UL);
  807. }
  808. #endif /* STM32G0C1xx || STM32G0B1xx */
  809. /**
  810. * @}
  811. */
  812. /** @defgroup EXTI_LL_EF_Falling_Trigger_Management Falling_Trigger_Management
  813. * @{
  814. */
  815. /**
  816. * @brief Enable ExtiLine Falling Edge Trigger for Lines in range 0 to 31
  817. * @note The configurable wakeup lines are edge-triggered. No glitch must be
  818. * generated on these lines. If a falling edge on a configurable interrupt
  819. * line occurs during a write operation in the EXTI_FTSR register, the
  820. * pending bit is not set.
  821. * Rising and falling edge triggers can be set for
  822. * the same interrupt line. In this case, both generate a trigger
  823. * condition.
  824. * @rmtoll FTSR1 FTx LL_EXTI_EnableFallingTrig_0_31
  825. * @param ExtiLine This parameter can be a combination of the following values:
  826. * @arg @ref LL_EXTI_LINE_0
  827. * @arg @ref LL_EXTI_LINE_1
  828. * @arg @ref LL_EXTI_LINE_2
  829. * @arg @ref LL_EXTI_LINE_3
  830. * @arg @ref LL_EXTI_LINE_4
  831. * @arg @ref LL_EXTI_LINE_5
  832. * @arg @ref LL_EXTI_LINE_6
  833. * @arg @ref LL_EXTI_LINE_7
  834. * @arg @ref LL_EXTI_LINE_8
  835. * @arg @ref LL_EXTI_LINE_9
  836. * @arg @ref LL_EXTI_LINE_10
  837. * @arg @ref LL_EXTI_LINE_11
  838. * @arg @ref LL_EXTI_LINE_12
  839. * @arg @ref LL_EXTI_LINE_13
  840. * @arg @ref LL_EXTI_LINE_14
  841. * @arg @ref LL_EXTI_LINE_15
  842. * @arg @ref LL_EXTI_LINE_16
  843. * @arg @ref LL_EXTI_LINE_17
  844. * @arg @ref LL_EXTI_LINE_18
  845. * @arg @ref LL_EXTI_LINE_20
  846. * @note Please check each device line mapping for EXTI Line availability
  847. * @retval None
  848. */
  849. __STATIC_INLINE void LL_EXTI_EnableFallingTrig_0_31(uint32_t ExtiLine)
  850. {
  851. SET_BIT(EXTI->FTSR1, ExtiLine);
  852. }
  853. #if defined(STM32G0C1xx) || defined(STM32G0B1xx)
  854. /**
  855. * @brief Enable ExtiLine Falling Edge Trigger for Lines in range 32 to 63
  856. * @note The configurable wakeup lines are edge-triggered. No glitch must be
  857. * generated on these lines. If a falling edge on a configurable interrupt
  858. * line occurs during a write operation in the EXTI_FTSR register, the
  859. * pending bit is not set.
  860. * Rising and falling edge triggers can be set for
  861. * the same interrupt line. In this case, both generate a trigger
  862. * condition.
  863. * @rmtoll FTSR2 FTx LL_EXTI_EnableFallingTrig_32_63
  864. * @param ExtiLine This parameter can be a combination of the following values:
  865. * @arg @ref LL_EXTI_LINE_34
  866. * @note Please check each device line mapping for EXTI Line availability
  867. * @retval None
  868. */
  869. __STATIC_INLINE void LL_EXTI_EnableFallingTrig_32_63(uint32_t ExtiLine)
  870. {
  871. SET_BIT(EXTI->FTSR2, ExtiLine);
  872. }
  873. #endif /* STM32G0C1xx || STM32G0B1xx */
  874. /**
  875. * @brief Disable ExtiLine Falling Edge Trigger for Lines in range 0 to 31
  876. * @note The configurable wakeup lines are edge-triggered. No glitch must be
  877. * generated on these lines. If a Falling edge on a configurable interrupt
  878. * line occurs during a write operation in the EXTI_FTSR register, the
  879. * pending bit is not set.
  880. * Rising and falling edge triggers can be set for the same interrupt line.
  881. * In this case, both generate a trigger condition.
  882. * @rmtoll FTSR1 FTx LL_EXTI_DisableFallingTrig_0_31
  883. * @param ExtiLine This parameter can be a combination of the following values:
  884. * @arg @ref LL_EXTI_LINE_0
  885. * @arg @ref LL_EXTI_LINE_1
  886. * @arg @ref LL_EXTI_LINE_2
  887. * @arg @ref LL_EXTI_LINE_3
  888. * @arg @ref LL_EXTI_LINE_4
  889. * @arg @ref LL_EXTI_LINE_5
  890. * @arg @ref LL_EXTI_LINE_6
  891. * @arg @ref LL_EXTI_LINE_7
  892. * @arg @ref LL_EXTI_LINE_8
  893. * @arg @ref LL_EXTI_LINE_9
  894. * @arg @ref LL_EXTI_LINE_10
  895. * @arg @ref LL_EXTI_LINE_11
  896. * @arg @ref LL_EXTI_LINE_12
  897. * @arg @ref LL_EXTI_LINE_13
  898. * @arg @ref LL_EXTI_LINE_14
  899. * @arg @ref LL_EXTI_LINE_15
  900. * @arg @ref LL_EXTI_LINE_16
  901. * @arg @ref LL_EXTI_LINE_17
  902. * @arg @ref LL_EXTI_LINE_18
  903. * @arg @ref LL_EXTI_LINE_20
  904. * @note Please check each device line mapping for EXTI Line availability
  905. * @retval None
  906. */
  907. __STATIC_INLINE void LL_EXTI_DisableFallingTrig_0_31(uint32_t ExtiLine)
  908. {
  909. CLEAR_BIT(EXTI->FTSR1, ExtiLine);
  910. }
  911. #if defined(STM32G0C1xx) || defined(STM32G0B1xx)
  912. /**
  913. * @brief Disable ExtiLine Falling Edge Trigger for Lines in range 32 to 63
  914. * @note The configurable wakeup lines are edge-triggered. No glitch must be
  915. * generated on these lines. If a Falling edge on a configurable interrupt
  916. * line occurs during a write operation in the EXTI_FTSR register, the
  917. * pending bit is not set.
  918. * Rising and falling edge triggers can be set for the same interrupt line.
  919. * In this case, both generate a trigger condition.
  920. * @rmtoll FTSR2 FTx LL_EXTI_DisableFallingTrig_32_63
  921. * @param ExtiLine This parameter can be a combination of the following values:
  922. * @arg @ref LL_EXTI_LINE_34
  923. * @note Please check each device line mapping for EXTI Line availability
  924. * @retval None
  925. */
  926. __STATIC_INLINE void LL_EXTI_DisableFallingTrig_32_63(uint32_t ExtiLine)
  927. {
  928. CLEAR_BIT(EXTI->FTSR2, ExtiLine);
  929. }
  930. #endif /* STM32G0C1xx || STM32G0B1xx */
  931. /**
  932. * @brief Check if falling edge trigger is enabled for Lines in range 0 to 31
  933. * @rmtoll FTSR1 FTx LL_EXTI_IsEnabledFallingTrig_0_31
  934. * @param ExtiLine This parameter can be a combination of the following values:
  935. * @arg @ref LL_EXTI_LINE_0
  936. * @arg @ref LL_EXTI_LINE_1
  937. * @arg @ref LL_EXTI_LINE_2
  938. * @arg @ref LL_EXTI_LINE_3
  939. * @arg @ref LL_EXTI_LINE_4
  940. * @arg @ref LL_EXTI_LINE_5
  941. * @arg @ref LL_EXTI_LINE_6
  942. * @arg @ref LL_EXTI_LINE_7
  943. * @arg @ref LL_EXTI_LINE_8
  944. * @arg @ref LL_EXTI_LINE_9
  945. * @arg @ref LL_EXTI_LINE_10
  946. * @arg @ref LL_EXTI_LINE_11
  947. * @arg @ref LL_EXTI_LINE_12
  948. * @arg @ref LL_EXTI_LINE_13
  949. * @arg @ref LL_EXTI_LINE_14
  950. * @arg @ref LL_EXTI_LINE_15
  951. * @arg @ref LL_EXTI_LINE_16
  952. * @arg @ref LL_EXTI_LINE_17
  953. * @arg @ref LL_EXTI_LINE_18
  954. * @arg @ref LL_EXTI_LINE_20
  955. * @note Please check each device line mapping for EXTI Line availability
  956. * @retval State of bit (1 or 0).
  957. */
  958. __STATIC_INLINE uint32_t LL_EXTI_IsEnabledFallingTrig_0_31(uint32_t ExtiLine)
  959. {
  960. return ((READ_BIT(EXTI->FTSR1, ExtiLine) == (ExtiLine)) ? 1UL : 0UL);
  961. }
  962. #if defined(STM32G0C1xx) || defined(STM32G0B1xx)
  963. /**
  964. * @brief Check if falling edge trigger is enabled for Lines in range 32 to 63
  965. * @rmtoll FTSR2 FTx LL_EXTI_IsEnabledFallingTrig_32_63
  966. * @param ExtiLine This parameter can be a combination of the following values:
  967. * @arg @ref LL_EXTI_LINE_34
  968. * @note Please check each device line mapping for EXTI Line availability
  969. * @retval State of bit (1 or 0).
  970. */
  971. __STATIC_INLINE uint32_t LL_EXTI_IsEnabledFallingTrig_32_63(uint32_t ExtiLine)
  972. {
  973. return ((READ_BIT(EXTI->FTSR2, ExtiLine) == (ExtiLine)) ? 1UL : 0UL);
  974. }
  975. #endif /* STM32G0C1xx || STM32G0B1xx */
  976. /**
  977. * @}
  978. */
  979. /** @defgroup EXTI_LL_EF_Software_Interrupt_Management Software_Interrupt_Management
  980. * @{
  981. */
  982. /**
  983. * @brief Generate a software Interrupt Event for Lines in range 0 to 31
  984. * @note If the interrupt is enabled on this line in the EXTI_IMR, writing a 1 to
  985. * this bit when it is at '0' sets the corresponding pending bit in EXTI_PR
  986. * resulting in an interrupt request generation.
  987. * This bit is cleared by clearing the corresponding bit in the EXTI_PR
  988. * register (by writing a 1 into the bit)
  989. * @rmtoll SWIER1 SWIx LL_EXTI_GenerateSWI_0_31
  990. * @param ExtiLine This parameter can be a combination of the following values:
  991. * @arg @ref LL_EXTI_LINE_0
  992. * @arg @ref LL_EXTI_LINE_1
  993. * @arg @ref LL_EXTI_LINE_2
  994. * @arg @ref LL_EXTI_LINE_3
  995. * @arg @ref LL_EXTI_LINE_4
  996. * @arg @ref LL_EXTI_LINE_5
  997. * @arg @ref LL_EXTI_LINE_6
  998. * @arg @ref LL_EXTI_LINE_7
  999. * @arg @ref LL_EXTI_LINE_8
  1000. * @arg @ref LL_EXTI_LINE_9
  1001. * @arg @ref LL_EXTI_LINE_10
  1002. * @arg @ref LL_EXTI_LINE_11
  1003. * @arg @ref LL_EXTI_LINE_12
  1004. * @arg @ref LL_EXTI_LINE_13
  1005. * @arg @ref LL_EXTI_LINE_14
  1006. * @arg @ref LL_EXTI_LINE_15
  1007. * @arg @ref LL_EXTI_LINE_16
  1008. * @arg @ref LL_EXTI_LINE_17
  1009. * @arg @ref LL_EXTI_LINE_18
  1010. * @arg @ref LL_EXTI_LINE_20
  1011. * @note Please check each device line mapping for EXTI Line availability
  1012. * @retval None
  1013. */
  1014. __STATIC_INLINE void LL_EXTI_GenerateSWI_0_31(uint32_t ExtiLine)
  1015. {
  1016. SET_BIT(EXTI->SWIER1, ExtiLine);
  1017. }
  1018. #if defined(STM32G0C1xx) || defined(STM32G0B1xx)
  1019. /**
  1020. * @brief Generate a software Interrupt Event for Lines in range 32 to 63
  1021. * @note If the interrupt is enabled on this line in the EXTI_IMR, writing a 1 to
  1022. * this bit when it is at '0' sets the corresponding pending bit in EXTI_PR
  1023. * resulting in an interrupt request generation.
  1024. * This bit is cleared by clearing the corresponding bit in the EXTI_PR
  1025. * register (by writing a 1 into the bit)
  1026. * @rmtoll SWIER2 SWIx LL_EXTI_GenerateSWI_32_63
  1027. * @param ExtiLine This parameter can be a combination of the following values:
  1028. * @arg @ref LL_EXTI_LINE_34
  1029. * @note Please check each device line mapping for EXTI Line availability
  1030. * @retval None
  1031. */
  1032. __STATIC_INLINE void LL_EXTI_GenerateSWI_32_63(uint32_t ExtiLine)
  1033. {
  1034. SET_BIT(EXTI->SWIER2, ExtiLine);
  1035. }
  1036. #endif /* STM32G0C1xx || STM32G0B1xx */
  1037. /**
  1038. * @}
  1039. */
  1040. /** @defgroup EXTI_LL_EF_Flag_Management Flag_Management
  1041. * @{
  1042. */
  1043. /**
  1044. * @brief Check if the ExtLine Falling Flag is set or not for Lines in range 0 to 31
  1045. * @note This bit is set when the falling edge event arrives on the interrupt
  1046. * line. This bit is cleared by writing a 1 to the bit.
  1047. * @rmtoll FPR1 FPIFx LL_EXTI_IsActiveFallingFlag_0_31
  1048. * @param ExtiLine This parameter can be a combination of the following values:
  1049. * @arg @ref LL_EXTI_LINE_0
  1050. * @arg @ref LL_EXTI_LINE_1
  1051. * @arg @ref LL_EXTI_LINE_2
  1052. * @arg @ref LL_EXTI_LINE_3
  1053. * @arg @ref LL_EXTI_LINE_4
  1054. * @arg @ref LL_EXTI_LINE_5
  1055. * @arg @ref LL_EXTI_LINE_6
  1056. * @arg @ref LL_EXTI_LINE_7
  1057. * @arg @ref LL_EXTI_LINE_8
  1058. * @arg @ref LL_EXTI_LINE_9
  1059. * @arg @ref LL_EXTI_LINE_10
  1060. * @arg @ref LL_EXTI_LINE_11
  1061. * @arg @ref LL_EXTI_LINE_12
  1062. * @arg @ref LL_EXTI_LINE_13
  1063. * @arg @ref LL_EXTI_LINE_14
  1064. * @arg @ref LL_EXTI_LINE_15
  1065. * @arg @ref LL_EXTI_LINE_16
  1066. * @arg @ref LL_EXTI_LINE_17
  1067. * @arg @ref LL_EXTI_LINE_18
  1068. * @arg @ref LL_EXTI_LINE_20
  1069. * @note Please check each device line mapping for EXTI Line availability
  1070. * @retval State of bit (1 or 0).
  1071. */
  1072. __STATIC_INLINE uint32_t LL_EXTI_IsActiveFallingFlag_0_31(uint32_t ExtiLine)
  1073. {
  1074. return ((READ_BIT(EXTI->FPR1, ExtiLine) == (ExtiLine)) ? 1UL : 0UL);
  1075. }
  1076. #if defined(STM32G0C1xx) || defined(STM32G0B1xx)
  1077. /**
  1078. * @brief Check if the ExtLine Falling Flag is set or not for Lines in range 32 to 63
  1079. * @note This bit is set when the falling edge event arrives on the interrupt
  1080. * line. This bit is cleared by writing a 1 to the bit.
  1081. * @rmtoll FPR2 FPIFx LL_EXTI_IsActiveFallingFlag_32_63
  1082. * @param ExtiLine This parameter can be a combination of the following values:
  1083. * @arg @ref LL_EXTI_LINE_34
  1084. * @note Please check each device line mapping for EXTI Line availability
  1085. * @retval State of bit (1 or 0).
  1086. */
  1087. __STATIC_INLINE uint32_t LL_EXTI_IsActiveFallingFlag_32_63(uint32_t ExtiLine)
  1088. {
  1089. return ((READ_BIT(EXTI->FPR2, ExtiLine) == (ExtiLine)) ? 1UL : 0UL);
  1090. }
  1091. #endif /* STM32G0C1xx || STM32G0B1xx */
  1092. /**
  1093. * @brief Read ExtLine Combination Falling Flag for Lines in range 0 to 31
  1094. * @note This bit is set when the falling edge event arrives on the interrupt
  1095. * line. This bit is cleared by writing a 1 to the bit.
  1096. * @rmtoll FPR1 FPIFx LL_EXTI_ReadFallingFlag_0_31
  1097. * @param ExtiLine This parameter can be a combination of the following values:
  1098. * @arg @ref LL_EXTI_LINE_0
  1099. * @arg @ref LL_EXTI_LINE_1
  1100. * @arg @ref LL_EXTI_LINE_2
  1101. * @arg @ref LL_EXTI_LINE_3
  1102. * @arg @ref LL_EXTI_LINE_4
  1103. * @arg @ref LL_EXTI_LINE_5
  1104. * @arg @ref LL_EXTI_LINE_6
  1105. * @arg @ref LL_EXTI_LINE_7
  1106. * @arg @ref LL_EXTI_LINE_8
  1107. * @arg @ref LL_EXTI_LINE_9
  1108. * @arg @ref LL_EXTI_LINE_10
  1109. * @arg @ref LL_EXTI_LINE_11
  1110. * @arg @ref LL_EXTI_LINE_12
  1111. * @arg @ref LL_EXTI_LINE_13
  1112. * @arg @ref LL_EXTI_LINE_14
  1113. * @arg @ref LL_EXTI_LINE_15
  1114. * @arg @ref LL_EXTI_LINE_16
  1115. * @arg @ref LL_EXTI_LINE_17
  1116. * @arg @ref LL_EXTI_LINE_18
  1117. * @arg @ref LL_EXTI_LINE_20
  1118. * @note Please check each device line mapping for EXTI Line availability
  1119. * @retval @note This bit is set when the selected edge event arrives on the interrupt
  1120. */
  1121. __STATIC_INLINE uint32_t LL_EXTI_ReadFallingFlag_0_31(uint32_t ExtiLine)
  1122. {
  1123. return (READ_BIT(EXTI->FPR1, ExtiLine));
  1124. }
  1125. #if defined(STM32G0C1xx) || defined(STM32G0B1xx)
  1126. /**
  1127. * @brief Read ExtLine Combination Falling Flag for Lines in range 32 to 63
  1128. * @note This bit is set when the falling edge event arrives on the interrupt
  1129. * line. This bit is cleared by writing a 1 to the bit.
  1130. * @rmtoll FPR2 FPIFx LL_EXTI_ReadFallingFlag_32_63
  1131. * @param ExtiLine This parameter can be a combination of the following values:
  1132. * @arg @ref LL_EXTI_LINE_34
  1133. * @note Please check each device line mapping for EXTI Line availability
  1134. * @retval @note This bit is set when the selected edge event arrives on the interrupt
  1135. */
  1136. __STATIC_INLINE uint32_t LL_EXTI_ReadFallingFlag_32_63(uint32_t ExtiLine)
  1137. {
  1138. return (READ_BIT(EXTI->FPR2, ExtiLine));
  1139. }
  1140. #endif /* STM32G0C1xx || STM32G0B1xx */
  1141. /**
  1142. * @brief Clear ExtLine Falling Flags for Lines in range 0 to 31
  1143. * @note This bit is set when the falling edge event arrives on the interrupt
  1144. * line. This bit is cleared by writing a 1 to the bit.
  1145. * @rmtoll FPR1 FPIFx LL_EXTI_ClearFallingFlag_0_31
  1146. * @param ExtiLine This parameter can be a combination of the following values:
  1147. * @arg @ref LL_EXTI_LINE_0
  1148. * @arg @ref LL_EXTI_LINE_1
  1149. * @arg @ref LL_EXTI_LINE_2
  1150. * @arg @ref LL_EXTI_LINE_3
  1151. * @arg @ref LL_EXTI_LINE_4
  1152. * @arg @ref LL_EXTI_LINE_5
  1153. * @arg @ref LL_EXTI_LINE_6
  1154. * @arg @ref LL_EXTI_LINE_7
  1155. * @arg @ref LL_EXTI_LINE_8
  1156. * @arg @ref LL_EXTI_LINE_9
  1157. * @arg @ref LL_EXTI_LINE_10
  1158. * @arg @ref LL_EXTI_LINE_11
  1159. * @arg @ref LL_EXTI_LINE_12
  1160. * @arg @ref LL_EXTI_LINE_13
  1161. * @arg @ref LL_EXTI_LINE_14
  1162. * @arg @ref LL_EXTI_LINE_15
  1163. * @arg @ref LL_EXTI_LINE_16
  1164. * @arg @ref LL_EXTI_LINE_17
  1165. * @arg @ref LL_EXTI_LINE_18
  1166. * @arg @ref LL_EXTI_LINE_20
  1167. * @note Please check each device line mapping for EXTI Line availability
  1168. * @retval None
  1169. */
  1170. __STATIC_INLINE void LL_EXTI_ClearFallingFlag_0_31(uint32_t ExtiLine)
  1171. {
  1172. WRITE_REG(EXTI->FPR1, ExtiLine);
  1173. }
  1174. #if defined(STM32G0C1xx) || defined(STM32G0B1xx)
  1175. /**
  1176. * @brief Clear ExtLine Falling Flags for Lines in range 32 to 63
  1177. * @note This bit is set when the falling edge event arrives on the interrupt
  1178. * line. This bit is cleared by writing a 1 to the bit.
  1179. * @rmtoll FPR2 FPIFx LL_EXTI_ClearFallingFlag_32_63
  1180. * @param ExtiLine This parameter can be a combination of the following values:
  1181. * @arg @ref LL_EXTI_LINE_34
  1182. * @note Please check each device line mapping for EXTI Line availability
  1183. * @retval None
  1184. */
  1185. __STATIC_INLINE void LL_EXTI_ClearFallingFlag_32_63(uint32_t ExtiLine)
  1186. {
  1187. WRITE_REG(EXTI->FPR2, ExtiLine);
  1188. }
  1189. #endif /* STM32G0C1xx || STM32G0B1xx */
  1190. /**
  1191. * @brief Check if the ExtLine Rising Flag is set or not for Lines in range 0 to 31
  1192. * @note This bit is set when the Rising edge event arrives on the interrupt
  1193. * line. This bit is cleared by writing a 1 to the bit.
  1194. * @rmtoll RPR1 RPIFx LL_EXTI_IsActiveRisingFlag_0_31
  1195. * @param ExtiLine This parameter can be a combination of the following values:
  1196. * @arg @ref LL_EXTI_LINE_0
  1197. * @arg @ref LL_EXTI_LINE_1
  1198. * @arg @ref LL_EXTI_LINE_2
  1199. * @arg @ref LL_EXTI_LINE_3
  1200. * @arg @ref LL_EXTI_LINE_4
  1201. * @arg @ref LL_EXTI_LINE_5
  1202. * @arg @ref LL_EXTI_LINE_6
  1203. * @arg @ref LL_EXTI_LINE_7
  1204. * @arg @ref LL_EXTI_LINE_8
  1205. * @arg @ref LL_EXTI_LINE_9
  1206. * @arg @ref LL_EXTI_LINE_10
  1207. * @arg @ref LL_EXTI_LINE_11
  1208. * @arg @ref LL_EXTI_LINE_12
  1209. * @arg @ref LL_EXTI_LINE_13
  1210. * @arg @ref LL_EXTI_LINE_14
  1211. * @arg @ref LL_EXTI_LINE_15
  1212. * @arg @ref LL_EXTI_LINE_16
  1213. * @arg @ref LL_EXTI_LINE_17
  1214. * @arg @ref LL_EXTI_LINE_18
  1215. * @arg @ref LL_EXTI_LINE_20
  1216. * @note Please check each device line mapping for EXTI Line availability
  1217. * @retval State of bit (1 or 0).
  1218. */
  1219. __STATIC_INLINE uint32_t LL_EXTI_IsActiveRisingFlag_0_31(uint32_t ExtiLine)
  1220. {
  1221. return ((READ_BIT(EXTI->RPR1, ExtiLine) == (ExtiLine)) ? 1UL : 0UL);
  1222. }
  1223. #if defined(STM32G0C1xx) || defined(STM32G0B1xx)
  1224. /**
  1225. * @brief Check if the ExtLine Rising Flag is set or not for Lines in range 32 to 63
  1226. * @note This bit is set when the Rising edge event arrives on the interrupt
  1227. * line. This bit is cleared by writing a 1 to the bit.
  1228. * @rmtoll RPR2 RPIFx LL_EXTI_IsActiveRisingFlag_32_63
  1229. * @param ExtiLine This parameter can be a combination of the following values:
  1230. * @arg @ref LL_EXTI_LINE_34
  1231. * @note Please check each device line mapping for EXTI Line availability
  1232. * @retval State of bit (1 or 0).
  1233. */
  1234. __STATIC_INLINE uint32_t LL_EXTI_IsActiveRisingFlag_32_63(uint32_t ExtiLine)
  1235. {
  1236. return ((READ_BIT(EXTI->RPR2, ExtiLine) == (ExtiLine)) ? 1UL : 0UL);
  1237. }
  1238. #endif /* STM32G0C1xx || STM32G0B1xx */
  1239. /**
  1240. * @brief Read ExtLine Combination Rising Flag for Lines in range 0 to 31
  1241. * @note This bit is set when the Rising edge event arrives on the interrupt
  1242. * line. This bit is cleared by writing a 1 to the bit.
  1243. * @rmtoll RPR1 RPIFx LL_EXTI_ReadRisingFlag_0_31
  1244. * @param ExtiLine This parameter can be a combination of the following values:
  1245. * @arg @ref LL_EXTI_LINE_0
  1246. * @arg @ref LL_EXTI_LINE_1
  1247. * @arg @ref LL_EXTI_LINE_2
  1248. * @arg @ref LL_EXTI_LINE_3
  1249. * @arg @ref LL_EXTI_LINE_4
  1250. * @arg @ref LL_EXTI_LINE_5
  1251. * @arg @ref LL_EXTI_LINE_6
  1252. * @arg @ref LL_EXTI_LINE_7
  1253. * @arg @ref LL_EXTI_LINE_8
  1254. * @arg @ref LL_EXTI_LINE_9
  1255. * @arg @ref LL_EXTI_LINE_10
  1256. * @arg @ref LL_EXTI_LINE_11
  1257. * @arg @ref LL_EXTI_LINE_12
  1258. * @arg @ref LL_EXTI_LINE_13
  1259. * @arg @ref LL_EXTI_LINE_14
  1260. * @arg @ref LL_EXTI_LINE_15
  1261. * @arg @ref LL_EXTI_LINE_16
  1262. * @arg @ref LL_EXTI_LINE_17
  1263. * @arg @ref LL_EXTI_LINE_18
  1264. * @arg @ref LL_EXTI_LINE_20
  1265. * @note Please check each device line mapping for EXTI Line availability
  1266. * @retval @note This bit is set when the selected edge event arrives on the interrupt
  1267. */
  1268. __STATIC_INLINE uint32_t LL_EXTI_ReadRisingFlag_0_31(uint32_t ExtiLine)
  1269. {
  1270. return (READ_BIT(EXTI->RPR1, ExtiLine));
  1271. }
  1272. #if defined(STM32G0C1xx) || defined(STM32G0B1xx)
  1273. /**
  1274. * @brief Read ExtLine Combination Rising Flag for Lines in range 32 to 63
  1275. * @note This bit is set when the Rising edge event arrives on the interrupt
  1276. * line. This bit is cleared by writing a 1 to the bit.
  1277. * @rmtoll RPR2 RPIFx LL_EXTI_ReadRisingFlag_32_63
  1278. * @param ExtiLine This parameter can be a combination of the following values:
  1279. * @arg @ref LL_EXTI_LINE_34
  1280. * @note Please check each device line mapping for EXTI Line availability
  1281. * @retval @note This bit is set when the selected edge event arrives on the interrupt
  1282. */
  1283. __STATIC_INLINE uint32_t LL_EXTI_ReadRisingFlag_32_63(uint32_t ExtiLine)
  1284. {
  1285. return (READ_BIT(EXTI->RPR2, ExtiLine));
  1286. }
  1287. #endif /* STM32G0C1xx || STM32G0B1xx */
  1288. /**
  1289. * @brief Clear ExtLine Rising Flags for Lines in range 0 to 31
  1290. * @note This bit is set when the Rising edge event arrives on the interrupt
  1291. * line. This bit is cleared by writing a 1 to the bit.
  1292. * @rmtoll RPR1 RPIFx LL_EXTI_ClearRisingFlag_0_31
  1293. * @param ExtiLine This parameter can be a combination of the following values:
  1294. * @arg @ref LL_EXTI_LINE_0
  1295. * @arg @ref LL_EXTI_LINE_1
  1296. * @arg @ref LL_EXTI_LINE_2
  1297. * @arg @ref LL_EXTI_LINE_3
  1298. * @arg @ref LL_EXTI_LINE_4
  1299. * @arg @ref LL_EXTI_LINE_5
  1300. * @arg @ref LL_EXTI_LINE_6
  1301. * @arg @ref LL_EXTI_LINE_7
  1302. * @arg @ref LL_EXTI_LINE_8
  1303. * @arg @ref LL_EXTI_LINE_9
  1304. * @arg @ref LL_EXTI_LINE_10
  1305. * @arg @ref LL_EXTI_LINE_11
  1306. * @arg @ref LL_EXTI_LINE_12
  1307. * @arg @ref LL_EXTI_LINE_13
  1308. * @arg @ref LL_EXTI_LINE_14
  1309. * @arg @ref LL_EXTI_LINE_15
  1310. * @arg @ref LL_EXTI_LINE_16
  1311. * @arg @ref LL_EXTI_LINE_17
  1312. * @arg @ref LL_EXTI_LINE_18
  1313. * @arg @ref LL_EXTI_LINE_20
  1314. * @note Please check each device line mapping for EXTI Line availability
  1315. * @retval None
  1316. */
  1317. __STATIC_INLINE void LL_EXTI_ClearRisingFlag_0_31(uint32_t ExtiLine)
  1318. {
  1319. WRITE_REG(EXTI->RPR1, ExtiLine);
  1320. }
  1321. #if defined(STM32G0C1xx) || defined(STM32G0B1xx)
  1322. /**
  1323. * @brief Clear ExtLine Rising Flags for Lines in range 32 to 63
  1324. * @note This bit is set when the Rising edge event arrives on the interrupt
  1325. * line. This bit is cleared by writing a 1 to the bit.
  1326. * @rmtoll RPR2 RPIFx LL_EXTI_ClearRisingFlag_32_63
  1327. * @param ExtiLine This parameter can be a combination of the following values:
  1328. * @arg @ref LL_EXTI_LINE_34
  1329. * @note Please check each device line mapping for EXTI Line availability
  1330. * @retval None
  1331. */
  1332. __STATIC_INLINE void LL_EXTI_ClearRisingFlag_32_63(uint32_t ExtiLine)
  1333. {
  1334. WRITE_REG(EXTI->RPR2, ExtiLine);
  1335. }
  1336. #endif /* STM32G0C1xx || STM32G0B1xx */
  1337. /**
  1338. * @}
  1339. */
  1340. /** @defgroup EXTI_LL_EF_Config EF configuration functions
  1341. * @{
  1342. */
  1343. /**
  1344. * @brief Configure source input for the EXTI external interrupt.
  1345. * @rmtoll EXTI_EXTICR1 EXTI0 LL_EXTI_SetEXTISource\n
  1346. * EXTI_EXTICR1 EXTI1 LL_EXTI_SetEXTISource\n
  1347. * EXTI_EXTICR1 EXTI2 LL_EXTI_SetEXTISource\n
  1348. * EXTI_EXTICR1 EXTI3 LL_EXTI_SetEXTISource\n
  1349. * EXTI_EXTICR2 EXTI4 LL_EXTI_SetEXTISource\n
  1350. * EXTI_EXTICR2 EXTI5 LL_EXTI_SetEXTISource\n
  1351. * EXTI_EXTICR2 EXTI6 LL_EXTI_SetEXTISource\n
  1352. * EXTI_EXTICR2 EXTI7 LL_EXTI_SetEXTISource\n
  1353. * EXTI_EXTICR3 EXTI8 LL_EXTI_SetEXTISource\n
  1354. * EXTI_EXTICR3 EXTI9 LL_EXTI_SetEXTISource\n
  1355. * EXTI_EXTICR3 EXTI10 LL_EXTI_SetEXTISource\n
  1356. * EXTI_EXTICR3 EXTI11 LL_EXTI_SetEXTISource\n
  1357. * EXTI_EXTICR4 EXTI12 LL_EXTI_SetEXTISource\n
  1358. * EXTI_EXTICR4 EXTI13 LL_EXTI_SetEXTISource\n
  1359. * EXTI_EXTICR4 EXTI14 LL_EXTI_SetEXTISource\n
  1360. * EXTI_EXTICR4 EXTI15 LL_EXTI_SetEXTISource
  1361. * @param Port This parameter can be one of the following values:
  1362. * @arg @ref EXTI_LL_EC_CONFIG_PORT
  1363. *
  1364. * (*) value not defined in all devices
  1365. * @param Line This parameter can be one of the following values:
  1366. * @arg @ref LL_EXTI_CONFIG_LINE0
  1367. * @arg @ref LL_EXTI_CONFIG_LINE1
  1368. * @arg @ref LL_EXTI_CONFIG_LINE2
  1369. * @arg @ref LL_EXTI_CONFIG_LINE3
  1370. * @arg @ref LL_EXTI_CONFIG_LINE4
  1371. * @arg @ref LL_EXTI_CONFIG_LINE5
  1372. * @arg @ref LL_EXTI_CONFIG_LINE6
  1373. * @arg @ref LL_EXTI_CONFIG_LINE7
  1374. * @arg @ref LL_EXTI_CONFIG_LINE8
  1375. * @arg @ref LL_EXTI_CONFIG_LINE9
  1376. * @arg @ref LL_EXTI_CONFIG_LINE10
  1377. * @arg @ref LL_EXTI_CONFIG_LINE11
  1378. * @arg @ref LL_EXTI_CONFIG_LINE12
  1379. * @arg @ref LL_EXTI_CONFIG_LINE13
  1380. * @arg @ref LL_EXTI_CONFIG_LINE14
  1381. * @arg @ref LL_EXTI_CONFIG_LINE15
  1382. * @retval None
  1383. */
  1384. __STATIC_INLINE void LL_EXTI_SetEXTISource(uint32_t Port, uint32_t Line)
  1385. {
  1386. MODIFY_REG(EXTI->EXTICR[Line & 0x03u], EXTI_EXTICR1_EXTI0 << (Line >> LL_EXTI_REGISTER_PINPOS_SHFT), Port << (Line >> LL_EXTI_REGISTER_PINPOS_SHFT));
  1387. }
  1388. /**
  1389. * @brief Get the configured defined for specific EXTI Line
  1390. * @rmtoll EXTI_EXTICR1 EXTI0 LL_EXTI_SetEXTISource\n
  1391. * EXTI_EXTICR1 EXTI1 LL_EXTI_SetEXTISource\n
  1392. * EXTI_EXTICR1 EXTI2 LL_EXTI_SetEXTISource\n
  1393. * EXTI_EXTICR1 EXTI3 LL_EXTI_SetEXTISource\n
  1394. * EXTI_EXTICR2 EXTI4 LL_EXTI_SetEXTISource\n
  1395. * EXTI_EXTICR2 EXTI5 LL_EXTI_SetEXTISource\n
  1396. * EXTI_EXTICR2 EXTI6 LL_EXTI_SetEXTISource\n
  1397. * EXTI_EXTICR2 EXTI7 LL_EXTI_SetEXTISource\n
  1398. * EXTI_EXTICR3 EXTI8 LL_EXTI_SetEXTISource\n
  1399. * EXTI_EXTICR3 EXTI9 LL_EXTI_SetEXTISource\n
  1400. * EXTI_EXTICR3 EXTI10 LL_EXTI_SetEXTISource\n
  1401. * EXTI_EXTICR3 EXTI11 LL_EXTI_SetEXTISource\n
  1402. * EXTI_EXTICR4 EXTI12 LL_EXTI_SetEXTISource\n
  1403. * EXTI_EXTICR4 EXTI13 LL_EXTI_SetEXTISource\n
  1404. * EXTI_EXTICR4 EXTI14 LL_EXTI_SetEXTISource\n
  1405. * EXTI_EXTICR4 EXTI15 LL_EXTI_SetEXTISource
  1406. * @param Line This parameter can be one of the following values:
  1407. * @arg @ref LL_EXTI_CONFIG_LINE0
  1408. * @arg @ref LL_EXTI_CONFIG_LINE1
  1409. * @arg @ref LL_EXTI_CONFIG_LINE2
  1410. * @arg @ref LL_EXTI_CONFIG_LINE3
  1411. * @arg @ref LL_EXTI_CONFIG_LINE4
  1412. * @arg @ref LL_EXTI_CONFIG_LINE5
  1413. * @arg @ref LL_EXTI_CONFIG_LINE6
  1414. * @arg @ref LL_EXTI_CONFIG_LINE7
  1415. * @arg @ref LL_EXTI_CONFIG_LINE8
  1416. * @arg @ref LL_EXTI_CONFIG_LINE9
  1417. * @arg @ref LL_EXTI_CONFIG_LINE10
  1418. * @arg @ref LL_EXTI_CONFIG_LINE11
  1419. * @arg @ref LL_EXTI_CONFIG_LINE12
  1420. * @arg @ref LL_EXTI_CONFIG_LINE13
  1421. * @arg @ref LL_EXTI_CONFIG_LINE14
  1422. * @arg @ref LL_EXTI_CONFIG_LINE15
  1423. * @retval Returned value can be one of the following values:
  1424. * @arg @ref EXTI_LL_EC_CONFIG_PORT
  1425. *
  1426. * (*) value not defined in all devices
  1427. */
  1428. __STATIC_INLINE uint32_t LL_EXTI_GetEXTISource(uint32_t Line)
  1429. {
  1430. return (READ_BIT(EXTI->EXTICR[Line & 0x03u], (EXTI_EXTICR1_EXTI0 << (Line >> LL_EXTI_REGISTER_PINPOS_SHFT))) >> (Line >> LL_EXTI_REGISTER_PINPOS_SHFT));
  1431. }
  1432. /**
  1433. * @}
  1434. */
  1435. #if defined(USE_FULL_LL_DRIVER)
  1436. /** @defgroup EXTI_LL_EF_Init Initialization and de-initialization functions
  1437. * @{
  1438. */
  1439. uint32_t LL_EXTI_Init(LL_EXTI_InitTypeDef *EXTI_InitStruct);
  1440. uint32_t LL_EXTI_DeInit(void);
  1441. void LL_EXTI_StructInit(LL_EXTI_InitTypeDef *EXTI_InitStruct);
  1442. /**
  1443. * @}
  1444. */
  1445. #endif /* USE_FULL_LL_DRIVER */
  1446. /**
  1447. * @}
  1448. */
  1449. /**
  1450. * @}
  1451. */
  1452. #endif /* EXTI */
  1453. /**
  1454. * @}
  1455. */
  1456. #ifdef __cplusplus
  1457. }
  1458. #endif
  1459. #endif /* STM32G0xx_LL_EXTI_H */