stm32f4xx_hal_adc.h 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762
  1. /**
  2. ******************************************************************************
  3. * @file stm32f4xx_hal_adc.h
  4. * @author MCD Application Team
  5. * @version V1.3.0
  6. * @date 09-March-2015
  7. * @brief Header file of ADC HAL extension module.
  8. ******************************************************************************
  9. * @attention
  10. *
  11. * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
  12. *
  13. * Redistribution and use in source and binary forms, with or without modification,
  14. * are permitted provided that the following conditions are met:
  15. * 1. Redistributions of source code must retain the above copyright notice,
  16. * this list of conditions and the following disclaimer.
  17. * 2. Redistributions in binary form must reproduce the above copyright notice,
  18. * this list of conditions and the following disclaimer in the documentation
  19. * and/or other materials provided with the distribution.
  20. * 3. Neither the name of STMicroelectronics nor the names of its contributors
  21. * may be used to endorse or promote products derived from this software
  22. * without specific prior written permission.
  23. *
  24. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  25. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  26. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  27. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  28. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  29. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  30. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  31. * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  32. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  33. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  34. *
  35. ******************************************************************************
  36. */
  37. /* Define to prevent recursive inclusion -------------------------------------*/
  38. #ifndef __STM32F4xx_ADC_H
  39. #define __STM32F4xx_ADC_H
  40. #ifdef __cplusplus
  41. extern "C" {
  42. #endif
  43. /* Includes ------------------------------------------------------------------*/
  44. #include "stm32f4xx_hal_def.h"
  45. /** @addtogroup STM32F4xx_HAL_Driver
  46. * @{
  47. */
  48. /** @addtogroup ADC
  49. * @{
  50. */
  51. /* Exported types ------------------------------------------------------------*/
  52. /** @defgroup ADC_Exported_Types ADC Exported Types
  53. * @{
  54. */
  55. /**
  56. * @brief HAL State structures definition
  57. */
  58. typedef enum
  59. {
  60. HAL_ADC_STATE_RESET = 0x00, /*!< ADC not yet initialized or disabled */
  61. HAL_ADC_STATE_READY = 0x01, /*!< ADC peripheral ready for use */
  62. HAL_ADC_STATE_BUSY = 0x02, /*!< An internal process is ongoing */
  63. HAL_ADC_STATE_BUSY_REG = 0x12, /*!< Regular conversion is ongoing */
  64. HAL_ADC_STATE_BUSY_INJ = 0x22, /*!< Injected conversion is ongoing */
  65. HAL_ADC_STATE_BUSY_INJ_REG = 0x32, /*!< Injected and regular conversion are ongoing */
  66. HAL_ADC_STATE_TIMEOUT = 0x03, /*!< Timeout state */
  67. HAL_ADC_STATE_ERROR = 0x04, /*!< ADC state error */
  68. HAL_ADC_STATE_EOC = 0x05, /*!< Conversion is completed */
  69. HAL_ADC_STATE_EOC_REG = 0x15, /*!< Regular conversion is completed */
  70. HAL_ADC_STATE_EOC_INJ = 0x25, /*!< Injected conversion is completed */
  71. HAL_ADC_STATE_EOC_INJ_REG = 0x35, /*!< Injected and regular conversion are completed */
  72. HAL_ADC_STATE_AWD = 0x06 /*!< ADC state analog watchdog */
  73. }HAL_ADC_StateTypeDef;
  74. /**
  75. * @brief ADC Init structure definition
  76. */
  77. typedef struct
  78. {
  79. uint32_t ClockPrescaler; /*!< Select the frequency of the clock to the ADC. The clock is common for
  80. all the ADCs.
  81. This parameter can be a value of @ref ADC_ClockPrescaler */
  82. uint32_t Resolution; /*!< Configures the ADC resolution dual mode.
  83. This parameter can be a value of @ref ADC_Resolution */
  84. uint32_t DataAlign; /*!< Specifies whether the ADC data alignment is left or right.
  85. This parameter can be a value of @ref ADC_data_align */
  86. uint32_t ScanConvMode; /*!< Specifies whether the conversion is performed in Scan (multi channels) or
  87. Single (one channel) mode.
  88. This parameter can be set to ENABLE or DISABLE */
  89. uint32_t EOCSelection; /*!< Specifies whether the EOC flag is set
  90. at the end of single channel conversion or at the end of all conversions.
  91. This parameter can be a value of @ref ADC_EOCSelection */
  92. uint32_t ContinuousConvMode; /*!< Specifies whether the conversion is performed in Continuous or Single mode.
  93. This parameter can be set to ENABLE or DISABLE. */
  94. uint32_t DMAContinuousRequests; /*!< Specifies whether the DMA requests is performed in Continuous or in Single mode.
  95. This parameter can be set to ENABLE or DISABLE. */
  96. uint32_t NbrOfConversion; /*!< Specifies the number of ADC conversions that will be done using the sequencer for
  97. regular channel group.
  98. This parameter must be a number between Min_Data = 1 and Max_Data = 16. */
  99. uint32_t DiscontinuousConvMode; /*!< Specifies whether the conversion is performed in Discontinuous or not
  100. for regular channels.
  101. This parameter can be set to ENABLE or DISABLE. */
  102. uint32_t NbrOfDiscConversion; /*!< Specifies the number of ADC discontinuous conversions that will be done
  103. using the sequencer for regular channel group.
  104. This parameter must be a number between Min_Data = 1 and Max_Data = 8. */
  105. uint32_t ExternalTrigConv; /*!< Selects the external event used to trigger the conversion start of regular group.
  106. If set to ADC_SOFTWARE_START, external triggers are disabled.
  107. This parameter can be a value of @ref ADC_External_trigger_Source_Regular
  108. Note: This parameter can be modified only if there is no conversion is ongoing. */
  109. uint32_t ExternalTrigConvEdge; /*!< Selects the external trigger edge of regular group.
  110. If trigger is set to ADC_SOFTWARE_START, this parameter is discarded.
  111. This parameter can be a value of @ref ADC_External_trigger_edge_Regular
  112. Note: This parameter can be modified only if there is no conversion is ongoing. */
  113. }ADC_InitTypeDef;
  114. /**
  115. * @brief ADC handle Structure definition
  116. */
  117. typedef struct
  118. {
  119. ADC_TypeDef *Instance; /*!< Register base address */
  120. ADC_InitTypeDef Init; /*!< ADC required parameters */
  121. __IO uint32_t NbrOfCurrentConversionRank; /*!< ADC number of current conversion rank */
  122. DMA_HandleTypeDef *DMA_Handle; /*!< Pointer DMA Handler */
  123. HAL_LockTypeDef Lock; /*!< ADC locking object */
  124. __IO HAL_ADC_StateTypeDef State; /*!< ADC communication state */
  125. __IO uint32_t ErrorCode; /*!< ADC Error code */
  126. }ADC_HandleTypeDef;
  127. /**
  128. * @brief ADC Configuration regular Channel structure definition
  129. */
  130. typedef struct
  131. {
  132. uint32_t Channel; /*!< The ADC channel to configure.
  133. This parameter can be a value of @ref ADC_channels */
  134. uint32_t Rank; /*!< The rank in the regular group sequencer.
  135. This parameter must be a number between Min_Data = 1 and Max_Data = 16 */
  136. uint32_t SamplingTime; /*!< The sample time value to be set for the selected channel.
  137. This parameter can be a value of @ref ADC_sampling_times */
  138. uint32_t Offset; /*!< Reserved for future use, can be set to 0 */
  139. }ADC_ChannelConfTypeDef;
  140. /**
  141. * @brief ADC Configuration multi-mode structure definition
  142. */
  143. typedef struct
  144. {
  145. uint32_t WatchdogMode; /*!< Configures the ADC analog watchdog mode.
  146. This parameter can be a value of @ref ADC_analog_watchdog_selection */
  147. uint32_t HighThreshold; /*!< Configures the ADC analog watchdog High threshold value.
  148. This parameter must be a 12-bit value. */
  149. uint32_t LowThreshold; /*!< Configures the ADC analog watchdog High threshold value.
  150. This parameter must be a 12-bit value. */
  151. uint32_t Channel; /*!< Configures ADC channel for the analog watchdog.
  152. This parameter has an effect only if watchdog mode is configured on single channel
  153. This parameter can be a value of @ref ADC_channels */
  154. uint32_t ITMode; /*!< Specifies whether the analog watchdog is configured
  155. is interrupt mode or in polling mode.
  156. This parameter can be set to ENABLE or DISABLE */
  157. uint32_t WatchdogNumber; /*!< Reserved for future use, can be set to 0 */
  158. }ADC_AnalogWDGConfTypeDef;
  159. /**
  160. * @}
  161. */
  162. /* Exported constants --------------------------------------------------------*/
  163. /** @defgroup ADC_Exported_Constants ADC Exported Constants
  164. * @{
  165. */
  166. /** @defgroup ADC_Error_Code ADC Error Code
  167. * @{
  168. */
  169. #define HAL_ADC_ERROR_NONE ((uint32_t)0x00) /*!< No error */
  170. #define HAL_ADC_ERROR_OVR ((uint32_t)0x01) /*!< OVR error */
  171. #define HAL_ADC_ERROR_DMA ((uint32_t)0x02) /*!< DMA transfer error */
  172. /**
  173. * @}
  174. */
  175. /** @defgroup ADC_ClockPrescaler ADC Clock Prescaler
  176. * @{
  177. */
  178. #define ADC_CLOCKPRESCALER_PCLK_DIV2 ((uint32_t)0x00000000)
  179. #define ADC_CLOCKPRESCALER_PCLK_DIV4 ((uint32_t)ADC_CCR_ADCPRE_0)
  180. #define ADC_CLOCKPRESCALER_PCLK_DIV6 ((uint32_t)ADC_CCR_ADCPRE_1)
  181. #define ADC_CLOCKPRESCALER_PCLK_DIV8 ((uint32_t)ADC_CCR_ADCPRE)
  182. /**
  183. * @}
  184. */
  185. /** @defgroup ADC_delay_between_2_sampling_phases ADC Delay Between 2 Sampling Phases
  186. * @{
  187. */
  188. #define ADC_TWOSAMPLINGDELAY_5CYCLES ((uint32_t)0x00000000)
  189. #define ADC_TWOSAMPLINGDELAY_6CYCLES ((uint32_t)ADC_CCR_DELAY_0)
  190. #define ADC_TWOSAMPLINGDELAY_7CYCLES ((uint32_t)ADC_CCR_DELAY_1)
  191. #define ADC_TWOSAMPLINGDELAY_8CYCLES ((uint32_t)(ADC_CCR_DELAY_1 | ADC_CCR_DELAY_0))
  192. #define ADC_TWOSAMPLINGDELAY_9CYCLES ((uint32_t)ADC_CCR_DELAY_2)
  193. #define ADC_TWOSAMPLINGDELAY_10CYCLES ((uint32_t)(ADC_CCR_DELAY_2 | ADC_CCR_DELAY_0))
  194. #define ADC_TWOSAMPLINGDELAY_11CYCLES ((uint32_t)(ADC_CCR_DELAY_2 | ADC_CCR_DELAY_1))
  195. #define ADC_TWOSAMPLINGDELAY_12CYCLES ((uint32_t)(ADC_CCR_DELAY_2 | ADC_CCR_DELAY_1 | ADC_CCR_DELAY_0))
  196. #define ADC_TWOSAMPLINGDELAY_13CYCLES ((uint32_t)ADC_CCR_DELAY_3)
  197. #define ADC_TWOSAMPLINGDELAY_14CYCLES ((uint32_t)(ADC_CCR_DELAY_3 | ADC_CCR_DELAY_0))
  198. #define ADC_TWOSAMPLINGDELAY_15CYCLES ((uint32_t)(ADC_CCR_DELAY_3 | ADC_CCR_DELAY_1))
  199. #define ADC_TWOSAMPLINGDELAY_16CYCLES ((uint32_t)(ADC_CCR_DELAY_3 | ADC_CCR_DELAY_1 | ADC_CCR_DELAY_0))
  200. #define ADC_TWOSAMPLINGDELAY_17CYCLES ((uint32_t)(ADC_CCR_DELAY_3 | ADC_CCR_DELAY_2))
  201. #define ADC_TWOSAMPLINGDELAY_18CYCLES ((uint32_t)(ADC_CCR_DELAY_3 | ADC_CCR_DELAY_2 | ADC_CCR_DELAY_0))
  202. #define ADC_TWOSAMPLINGDELAY_19CYCLES ((uint32_t)(ADC_CCR_DELAY_3 | ADC_CCR_DELAY_2 | ADC_CCR_DELAY_1))
  203. #define ADC_TWOSAMPLINGDELAY_20CYCLES ((uint32_t)ADC_CCR_DELAY)
  204. /**
  205. * @}
  206. */
  207. /** @defgroup ADC_Resolution ADC Resolution
  208. * @{
  209. */
  210. #define ADC_RESOLUTION_12B ((uint32_t)0x00000000)
  211. #define ADC_RESOLUTION_10B ((uint32_t)ADC_CR1_RES_0)
  212. #define ADC_RESOLUTION_8B ((uint32_t)ADC_CR1_RES_1)
  213. #define ADC_RESOLUTION_6B ((uint32_t)ADC_CR1_RES)
  214. /**
  215. * @}
  216. */
  217. /** @defgroup ADC_External_trigger_edge_Regular ADC External Trigger Edge Regular
  218. * @{
  219. */
  220. #define ADC_EXTERNALTRIGCONVEDGE_NONE ((uint32_t)0x00000000)
  221. #define ADC_EXTERNALTRIGCONVEDGE_RISING ((uint32_t)ADC_CR2_EXTEN_0)
  222. #define ADC_EXTERNALTRIGCONVEDGE_FALLING ((uint32_t)ADC_CR2_EXTEN_1)
  223. #define ADC_EXTERNALTRIGCONVEDGE_RISINGFALLING ((uint32_t)ADC_CR2_EXTEN)
  224. /**
  225. * @}
  226. */
  227. /** @defgroup ADC_External_trigger_Source_Regular ADC External Trigger Source Regular
  228. * @{
  229. */
  230. /* Note: Parameter ADC_SOFTWARE_START is a software parameter used for */
  231. /* compatibility with other STM32 devices. */
  232. #define ADC_EXTERNALTRIGCONV_T1_CC1 ((uint32_t)0x00000000)
  233. #define ADC_EXTERNALTRIGCONV_T1_CC2 ((uint32_t)ADC_CR2_EXTSEL_0)
  234. #define ADC_EXTERNALTRIGCONV_T1_CC3 ((uint32_t)ADC_CR2_EXTSEL_1)
  235. #define ADC_EXTERNALTRIGCONV_T2_CC2 ((uint32_t)(ADC_CR2_EXTSEL_1 | ADC_CR2_EXTSEL_0))
  236. #define ADC_EXTERNALTRIGCONV_T2_CC3 ((uint32_t)ADC_CR2_EXTSEL_2)
  237. #define ADC_EXTERNALTRIGCONV_T2_CC4 ((uint32_t)(ADC_CR2_EXTSEL_2 | ADC_CR2_EXTSEL_0))
  238. #define ADC_EXTERNALTRIGCONV_T2_TRGO ((uint32_t)(ADC_CR2_EXTSEL_2 | ADC_CR2_EXTSEL_1))
  239. #define ADC_EXTERNALTRIGCONV_T3_CC1 ((uint32_t)(ADC_CR2_EXTSEL_2 | ADC_CR2_EXTSEL_1 | ADC_CR2_EXTSEL_0))
  240. #define ADC_EXTERNALTRIGCONV_T3_TRGO ((uint32_t)ADC_CR2_EXTSEL_3)
  241. #define ADC_EXTERNALTRIGCONV_T4_CC4 ((uint32_t)(ADC_CR2_EXTSEL_3 | ADC_CR2_EXTSEL_0))
  242. #define ADC_EXTERNALTRIGCONV_T5_CC1 ((uint32_t)(ADC_CR2_EXTSEL_3 | ADC_CR2_EXTSEL_1))
  243. #define ADC_EXTERNALTRIGCONV_T5_CC2 ((uint32_t)(ADC_CR2_EXTSEL_3 | ADC_CR2_EXTSEL_1 | ADC_CR2_EXTSEL_0))
  244. #define ADC_EXTERNALTRIGCONV_T5_CC3 ((uint32_t)(ADC_CR2_EXTSEL_3 | ADC_CR2_EXTSEL_2))
  245. #define ADC_EXTERNALTRIGCONV_T8_CC1 ((uint32_t)(ADC_CR2_EXTSEL_3 | ADC_CR2_EXTSEL_2 | ADC_CR2_EXTSEL_0))
  246. #define ADC_EXTERNALTRIGCONV_T8_TRGO ((uint32_t)(ADC_CR2_EXTSEL_3 | ADC_CR2_EXTSEL_2 | ADC_CR2_EXTSEL_1))
  247. #define ADC_EXTERNALTRIGCONV_Ext_IT11 ((uint32_t)ADC_CR2_EXTSEL)
  248. #define ADC_SOFTWARE_START ((uint32_t)ADC_CR2_EXTSEL + 1)
  249. /**
  250. * @}
  251. */
  252. /** @defgroup ADC_data_align ADC Data Align
  253. * @{
  254. */
  255. #define ADC_DATAALIGN_RIGHT ((uint32_t)0x00000000)
  256. #define ADC_DATAALIGN_LEFT ((uint32_t)ADC_CR2_ALIGN)
  257. /**
  258. * @}
  259. */
  260. /** @defgroup ADC_channels ADC Common Channels
  261. * @{
  262. */
  263. #define ADC_CHANNEL_0 ((uint32_t)0x00000000)
  264. #define ADC_CHANNEL_1 ((uint32_t)ADC_CR1_AWDCH_0)
  265. #define ADC_CHANNEL_2 ((uint32_t)ADC_CR1_AWDCH_1)
  266. #define ADC_CHANNEL_3 ((uint32_t)(ADC_CR1_AWDCH_1 | ADC_CR1_AWDCH_0))
  267. #define ADC_CHANNEL_4 ((uint32_t)ADC_CR1_AWDCH_2)
  268. #define ADC_CHANNEL_5 ((uint32_t)(ADC_CR1_AWDCH_2 | ADC_CR1_AWDCH_0))
  269. #define ADC_CHANNEL_6 ((uint32_t)(ADC_CR1_AWDCH_2 | ADC_CR1_AWDCH_1))
  270. #define ADC_CHANNEL_7 ((uint32_t)(ADC_CR1_AWDCH_2 | ADC_CR1_AWDCH_1 | ADC_CR1_AWDCH_0))
  271. #define ADC_CHANNEL_8 ((uint32_t)ADC_CR1_AWDCH_3)
  272. #define ADC_CHANNEL_9 ((uint32_t)(ADC_CR1_AWDCH_3 | ADC_CR1_AWDCH_0))
  273. #define ADC_CHANNEL_10 ((uint32_t)(ADC_CR1_AWDCH_3 | ADC_CR1_AWDCH_1))
  274. #define ADC_CHANNEL_11 ((uint32_t)(ADC_CR1_AWDCH_3 | ADC_CR1_AWDCH_1 | ADC_CR1_AWDCH_0))
  275. #define ADC_CHANNEL_12 ((uint32_t)(ADC_CR1_AWDCH_3 | ADC_CR1_AWDCH_2))
  276. #define ADC_CHANNEL_13 ((uint32_t)(ADC_CR1_AWDCH_3 | ADC_CR1_AWDCH_2 | ADC_CR1_AWDCH_0))
  277. #define ADC_CHANNEL_14 ((uint32_t)(ADC_CR1_AWDCH_3 | ADC_CR1_AWDCH_2 | ADC_CR1_AWDCH_1))
  278. #define ADC_CHANNEL_15 ((uint32_t)(ADC_CR1_AWDCH_3 | ADC_CR1_AWDCH_2 | ADC_CR1_AWDCH_1 | ADC_CR1_AWDCH_0))
  279. #define ADC_CHANNEL_16 ((uint32_t)ADC_CR1_AWDCH_4)
  280. #define ADC_CHANNEL_17 ((uint32_t)(ADC_CR1_AWDCH_4 | ADC_CR1_AWDCH_0))
  281. #define ADC_CHANNEL_18 ((uint32_t)(ADC_CR1_AWDCH_4 | ADC_CR1_AWDCH_1))
  282. #define ADC_CHANNEL_VREFINT ((uint32_t)ADC_CHANNEL_17)
  283. #define ADC_CHANNEL_VBAT ((uint32_t)ADC_CHANNEL_18)
  284. /**
  285. * @}
  286. */
  287. /** @defgroup ADC_sampling_times ADC Sampling Times
  288. * @{
  289. */
  290. #define ADC_SAMPLETIME_3CYCLES ((uint32_t)0x00000000)
  291. #define ADC_SAMPLETIME_15CYCLES ((uint32_t)ADC_SMPR1_SMP10_0)
  292. #define ADC_SAMPLETIME_28CYCLES ((uint32_t)ADC_SMPR1_SMP10_1)
  293. #define ADC_SAMPLETIME_56CYCLES ((uint32_t)(ADC_SMPR1_SMP10_1 | ADC_SMPR1_SMP10_0))
  294. #define ADC_SAMPLETIME_84CYCLES ((uint32_t)ADC_SMPR1_SMP10_2)
  295. #define ADC_SAMPLETIME_112CYCLES ((uint32_t)(ADC_SMPR1_SMP10_2 | ADC_SMPR1_SMP10_0))
  296. #define ADC_SAMPLETIME_144CYCLES ((uint32_t)(ADC_SMPR1_SMP10_2 | ADC_SMPR1_SMP10_1))
  297. #define ADC_SAMPLETIME_480CYCLES ((uint32_t)ADC_SMPR1_SMP10)
  298. /**
  299. * @}
  300. */
  301. /** @defgroup ADC_EOCSelection ADC EOC Selection
  302. * @{
  303. */
  304. #define ADC_EOC_SEQ_CONV ((uint32_t)0x00000000)
  305. #define ADC_EOC_SINGLE_CONV ((uint32_t)0x00000001)
  306. #define ADC_EOC_SINGLE_SEQ_CONV ((uint32_t)0x00000002) /*!< reserved for future use */
  307. /**
  308. * @}
  309. */
  310. /** @defgroup ADC_Event_type ADC Event Type
  311. * @{
  312. */
  313. #define ADC_AWD_EVENT ((uint32_t)ADC_FLAG_AWD)
  314. #define ADC_OVR_EVENT ((uint32_t)ADC_FLAG_OVR)
  315. /**
  316. * @}
  317. */
  318. /** @defgroup ADC_analog_watchdog_selection ADC Analog Watchdog Selection
  319. * @{
  320. */
  321. #define ADC_ANALOGWATCHDOG_SINGLE_REG ((uint32_t)(ADC_CR1_AWDSGL | ADC_CR1_AWDEN))
  322. #define ADC_ANALOGWATCHDOG_SINGLE_INJEC ((uint32_t)(ADC_CR1_AWDSGL | ADC_CR1_JAWDEN))
  323. #define ADC_ANALOGWATCHDOG_SINGLE_REGINJEC ((uint32_t)(ADC_CR1_AWDSGL | ADC_CR1_AWDEN | ADC_CR1_JAWDEN))
  324. #define ADC_ANALOGWATCHDOG_ALL_REG ((uint32_t)ADC_CR1_AWDEN)
  325. #define ADC_ANALOGWATCHDOG_ALL_INJEC ((uint32_t)ADC_CR1_JAWDEN)
  326. #define ADC_ANALOGWATCHDOG_ALL_REGINJEC ((uint32_t)(ADC_CR1_AWDEN | ADC_CR1_JAWDEN))
  327. #define ADC_ANALOGWATCHDOG_NONE ((uint32_t)0x00000000)
  328. /**
  329. * @}
  330. */
  331. /** @defgroup ADC_interrupts_definition ADC Interrupts Definition
  332. * @{
  333. */
  334. #define ADC_IT_EOC ((uint32_t)ADC_CR1_EOCIE)
  335. #define ADC_IT_AWD ((uint32_t)ADC_CR1_AWDIE)
  336. #define ADC_IT_JEOC ((uint32_t)ADC_CR1_JEOCIE)
  337. #define ADC_IT_OVR ((uint32_t)ADC_CR1_OVRIE)
  338. /**
  339. * @}
  340. */
  341. /** @defgroup ADC_flags_definition ADC Flags Definition
  342. * @{
  343. */
  344. #define ADC_FLAG_AWD ((uint32_t)ADC_SR_AWD)
  345. #define ADC_FLAG_EOC ((uint32_t)ADC_SR_EOC)
  346. #define ADC_FLAG_JEOC ((uint32_t)ADC_SR_JEOC)
  347. #define ADC_FLAG_JSTRT ((uint32_t)ADC_SR_JSTRT)
  348. #define ADC_FLAG_STRT ((uint32_t)ADC_SR_STRT)
  349. #define ADC_FLAG_OVR ((uint32_t)ADC_SR_OVR)
  350. /**
  351. * @}
  352. */
  353. /** @defgroup ADC_channels_type ADC Channels Type
  354. * @{
  355. */
  356. #define ADC_ALL_CHANNELS ((uint32_t)0x00000001)
  357. #define ADC_REGULAR_CHANNELS ((uint32_t)0x00000002) /*!< reserved for future use */
  358. #define ADC_INJECTED_CHANNELS ((uint32_t)0x00000003) /*!< reserved for future use */
  359. /**
  360. * @}
  361. */
  362. /**
  363. * @}
  364. */
  365. /* Exported macro ------------------------------------------------------------*/
  366. /** @defgroup ADC_Exported_Macros ADC Exported Macros
  367. * @{
  368. */
  369. /** @brief Reset ADC handle state
  370. * @param __HANDLE__: ADC handle
  371. * @retval None
  372. */
  373. #define __HAL_ADC_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_ADC_STATE_RESET)
  374. /**
  375. * @brief Enable the ADC peripheral.
  376. * @param __HANDLE__: ADC handle
  377. * @retval None
  378. */
  379. #define __HAL_ADC_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR2 |= ADC_CR2_ADON)
  380. /**
  381. * @brief Disable the ADC peripheral.
  382. * @param __HANDLE__: ADC handle
  383. * @retval None
  384. */
  385. #define __HAL_ADC_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR2 &= ~ADC_CR2_ADON)
  386. /**
  387. * @brief Enable the ADC end of conversion interrupt.
  388. * @param __HANDLE__: specifies the ADC Handle.
  389. * @param __INTERRUPT__: ADC Interrupt.
  390. * @retval None
  391. */
  392. #define __HAL_ADC_ENABLE_IT(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->CR1) |= (__INTERRUPT__))
  393. /**
  394. * @brief Disable the ADC end of conversion interrupt.
  395. * @param __HANDLE__: specifies the ADC Handle.
  396. * @param __INTERRUPT__: ADC interrupt.
  397. * @retval None
  398. */
  399. #define __HAL_ADC_DISABLE_IT(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->CR1) &= ~(__INTERRUPT__))
  400. /** @brief Check if the specified ADC interrupt source is enabled or disabled.
  401. * @param __HANDLE__: specifies the ADC Handle.
  402. * @param __INTERRUPT__: specifies the ADC interrupt source to check.
  403. * @retval The new state of __IT__ (TRUE or FALSE).
  404. */
  405. #define __HAL_ADC_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->CR1 & (__INTERRUPT__)) == (__INTERRUPT__))
  406. /**
  407. * @brief Clear the ADC's pending flags.
  408. * @param __HANDLE__: specifies the ADC Handle.
  409. * @param __FLAG__: ADC flag.
  410. * @retval None
  411. */
  412. #define __HAL_ADC_CLEAR_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->SR) = ~(__FLAG__))
  413. /**
  414. * @brief Get the selected ADC's flag status.
  415. * @param __HANDLE__: specifies the ADC Handle.
  416. * @param __FLAG__: ADC flag.
  417. * @retval None
  418. */
  419. #define __HAL_ADC_GET_FLAG(__HANDLE__, __FLAG__) ((((__HANDLE__)->Instance->SR) & (__FLAG__)) == (__FLAG__))
  420. /**
  421. * @}
  422. */
  423. /* Include ADC HAL Extension module */
  424. #include "stm32f4xx_hal_adc_ex.h"
  425. /* Exported functions --------------------------------------------------------*/
  426. /** @addtogroup ADC_Exported_Functions
  427. * @{
  428. */
  429. /** @addtogroup ADC_Exported_Functions_Group1
  430. * @{
  431. */
  432. /* Initialization/de-initialization functions ***********************************/
  433. HAL_StatusTypeDef HAL_ADC_Init(ADC_HandleTypeDef* hadc);
  434. HAL_StatusTypeDef HAL_ADC_DeInit(ADC_HandleTypeDef *hadc);
  435. void HAL_ADC_MspInit(ADC_HandleTypeDef* hadc);
  436. void HAL_ADC_MspDeInit(ADC_HandleTypeDef* hadc);
  437. /**
  438. * @}
  439. */
  440. /** @addtogroup ADC_Exported_Functions_Group2
  441. * @{
  442. */
  443. /* I/O operation functions ******************************************************/
  444. HAL_StatusTypeDef HAL_ADC_Start(ADC_HandleTypeDef* hadc);
  445. HAL_StatusTypeDef HAL_ADC_Stop(ADC_HandleTypeDef* hadc);
  446. HAL_StatusTypeDef HAL_ADC_PollForConversion(ADC_HandleTypeDef* hadc, uint32_t Timeout);
  447. HAL_StatusTypeDef HAL_ADC_PollForEvent(ADC_HandleTypeDef* hadc, uint32_t EventType, uint32_t Timeout);
  448. HAL_StatusTypeDef HAL_ADC_Start_IT(ADC_HandleTypeDef* hadc);
  449. HAL_StatusTypeDef HAL_ADC_Stop_IT(ADC_HandleTypeDef* hadc);
  450. void HAL_ADC_IRQHandler(ADC_HandleTypeDef* hadc);
  451. HAL_StatusTypeDef HAL_ADC_Start_DMA(ADC_HandleTypeDef* hadc, uint32_t* pData, uint32_t Length);
  452. HAL_StatusTypeDef HAL_ADC_Stop_DMA(ADC_HandleTypeDef* hadc);
  453. uint32_t HAL_ADC_GetValue(ADC_HandleTypeDef* hadc);
  454. void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc);
  455. void HAL_ADC_ConvHalfCpltCallback(ADC_HandleTypeDef* hadc);
  456. void HAL_ADC_LevelOutOfWindowCallback(ADC_HandleTypeDef* hadc);
  457. void HAL_ADC_ErrorCallback(ADC_HandleTypeDef *hadc);
  458. /**
  459. * @}
  460. */
  461. /** @addtogroup ADC_Exported_Functions_Group3
  462. * @{
  463. */
  464. /* Peripheral Control functions *************************************************/
  465. HAL_StatusTypeDef HAL_ADC_ConfigChannel(ADC_HandleTypeDef* hadc, ADC_ChannelConfTypeDef* sConfig);
  466. HAL_StatusTypeDef HAL_ADC_AnalogWDGConfig(ADC_HandleTypeDef* hadc, ADC_AnalogWDGConfTypeDef* AnalogWDGConfig);
  467. /**
  468. * @}
  469. */
  470. /** @addtogroup ADC_Exported_Functions_Group4
  471. * @{
  472. */
  473. /* Peripheral State functions ***************************************************/
  474. HAL_ADC_StateTypeDef HAL_ADC_GetState(ADC_HandleTypeDef* hadc);
  475. uint32_t HAL_ADC_GetError(ADC_HandleTypeDef *hadc);
  476. /**
  477. * @}
  478. */
  479. /**
  480. * @}
  481. */
  482. /* Private types -------------------------------------------------------------*/
  483. /* Private variables ---------------------------------------------------------*/
  484. /* Private constants ---------------------------------------------------------*/
  485. /** @defgroup ADC_Private_Constants ADC Private Constants
  486. * @{
  487. */
  488. /* Delay for ADC stabilization time. */
  489. /* Maximum delay is 1us (refer to device datasheet, parameter tSTAB). */
  490. /* Unit: us */
  491. #define ADC_STAB_DELAY_US ((uint32_t) 3)
  492. /* Delay for temperature sensor stabilization time. */
  493. /* Maximum delay is 10us (refer to device datasheet, parameter tSTART). */
  494. /* Unit: us */
  495. #define ADC_TEMPSENSOR_DELAY_US ((uint32_t) 10)
  496. /**
  497. * @}
  498. */
  499. /* Private macros ------------------------------------------------------------*/
  500. /** @defgroup ADC_Private_Macros ADC Private Macros
  501. * @{
  502. */
  503. #define IS_ADC_CLOCKPRESCALER(ADC_CLOCK) (((ADC_CLOCK) == ADC_CLOCKPRESCALER_PCLK_DIV2) || \
  504. ((ADC_CLOCK) == ADC_CLOCKPRESCALER_PCLK_DIV4) || \
  505. ((ADC_CLOCK) == ADC_CLOCKPRESCALER_PCLK_DIV6) || \
  506. ((ADC_CLOCK) == ADC_CLOCKPRESCALER_PCLK_DIV8))
  507. #define IS_ADC_SAMPLING_DELAY(DELAY) (((DELAY) == ADC_TWOSAMPLINGDELAY_5CYCLES) || \
  508. ((DELAY) == ADC_TWOSAMPLINGDELAY_6CYCLES) || \
  509. ((DELAY) == ADC_TWOSAMPLINGDELAY_7CYCLES) || \
  510. ((DELAY) == ADC_TWOSAMPLINGDELAY_8CYCLES) || \
  511. ((DELAY) == ADC_TWOSAMPLINGDELAY_9CYCLES) || \
  512. ((DELAY) == ADC_TWOSAMPLINGDELAY_10CYCLES) || \
  513. ((DELAY) == ADC_TWOSAMPLINGDELAY_11CYCLES) || \
  514. ((DELAY) == ADC_TWOSAMPLINGDELAY_12CYCLES) || \
  515. ((DELAY) == ADC_TWOSAMPLINGDELAY_13CYCLES) || \
  516. ((DELAY) == ADC_TWOSAMPLINGDELAY_14CYCLES) || \
  517. ((DELAY) == ADC_TWOSAMPLINGDELAY_15CYCLES) || \
  518. ((DELAY) == ADC_TWOSAMPLINGDELAY_16CYCLES) || \
  519. ((DELAY) == ADC_TWOSAMPLINGDELAY_17CYCLES) || \
  520. ((DELAY) == ADC_TWOSAMPLINGDELAY_18CYCLES) || \
  521. ((DELAY) == ADC_TWOSAMPLINGDELAY_19CYCLES) || \
  522. ((DELAY) == ADC_TWOSAMPLINGDELAY_20CYCLES))
  523. #define IS_ADC_RESOLUTION(RESOLUTION) (((RESOLUTION) == ADC_RESOLUTION_12B) || \
  524. ((RESOLUTION) == ADC_RESOLUTION_10B) || \
  525. ((RESOLUTION) == ADC_RESOLUTION_8B) || \
  526. ((RESOLUTION) == ADC_RESOLUTION_6B))
  527. #define IS_ADC_EXT_TRIG_EDGE(EDGE) (((EDGE) == ADC_EXTERNALTRIGCONVEDGE_NONE) || \
  528. ((EDGE) == ADC_EXTERNALTRIGCONVEDGE_RISING) || \
  529. ((EDGE) == ADC_EXTERNALTRIGCONVEDGE_FALLING) || \
  530. ((EDGE) == ADC_EXTERNALTRIGCONVEDGE_RISINGFALLING))
  531. #define IS_ADC_EXT_TRIG(REGTRIG) (((REGTRIG) == ADC_EXTERNALTRIGCONV_T1_CC1) || \
  532. ((REGTRIG) == ADC_EXTERNALTRIGCONV_T1_CC2) || \
  533. ((REGTRIG) == ADC_EXTERNALTRIGCONV_T1_CC3) || \
  534. ((REGTRIG) == ADC_EXTERNALTRIGCONV_T2_CC2) || \
  535. ((REGTRIG) == ADC_EXTERNALTRIGCONV_T2_CC3) || \
  536. ((REGTRIG) == ADC_EXTERNALTRIGCONV_T2_CC4) || \
  537. ((REGTRIG) == ADC_EXTERNALTRIGCONV_T2_TRGO) || \
  538. ((REGTRIG) == ADC_EXTERNALTRIGCONV_T3_CC1) || \
  539. ((REGTRIG) == ADC_EXTERNALTRIGCONV_T3_TRGO) || \
  540. ((REGTRIG) == ADC_EXTERNALTRIGCONV_T4_CC4) || \
  541. ((REGTRIG) == ADC_EXTERNALTRIGCONV_T5_CC1) || \
  542. ((REGTRIG) == ADC_EXTERNALTRIGCONV_T5_CC2) || \
  543. ((REGTRIG) == ADC_EXTERNALTRIGCONV_T5_CC3) || \
  544. ((REGTRIG) == ADC_EXTERNALTRIGCONV_T8_CC1) || \
  545. ((REGTRIG) == ADC_EXTERNALTRIGCONV_T8_TRGO) || \
  546. ((REGTRIG) == ADC_EXTERNALTRIGCONV_Ext_IT11)|| \
  547. ((REGTRIG) == ADC_SOFTWARE_START))
  548. #define IS_ADC_DATA_ALIGN(ALIGN) (((ALIGN) == ADC_DATAALIGN_RIGHT) || \
  549. ((ALIGN) == ADC_DATAALIGN_LEFT))
  550. #define IS_ADC_SAMPLE_TIME(TIME) (((TIME) == ADC_SAMPLETIME_3CYCLES) || \
  551. ((TIME) == ADC_SAMPLETIME_15CYCLES) || \
  552. ((TIME) == ADC_SAMPLETIME_28CYCLES) || \
  553. ((TIME) == ADC_SAMPLETIME_56CYCLES) || \
  554. ((TIME) == ADC_SAMPLETIME_84CYCLES) || \
  555. ((TIME) == ADC_SAMPLETIME_112CYCLES) || \
  556. ((TIME) == ADC_SAMPLETIME_144CYCLES) || \
  557. ((TIME) == ADC_SAMPLETIME_480CYCLES))
  558. #define IS_ADC_EOCSelection(EOCSelection) (((EOCSelection) == ADC_EOC_SINGLE_CONV) || \
  559. ((EOCSelection) == ADC_EOC_SEQ_CONV) || \
  560. ((EOCSelection) == ADC_EOC_SINGLE_SEQ_CONV))
  561. #define IS_ADC_EVENT_TYPE(EVENT) (((EVENT) == ADC_AWD_EVENT) || \
  562. ((EVENT) == ADC_OVR_EVENT))
  563. #define IS_ADC_ANALOG_WATCHDOG(WATCHDOG) (((WATCHDOG) == ADC_ANALOGWATCHDOG_SINGLE_REG) || \
  564. ((WATCHDOG) == ADC_ANALOGWATCHDOG_SINGLE_INJEC) || \
  565. ((WATCHDOG) == ADC_ANALOGWATCHDOG_SINGLE_REGINJEC) || \
  566. ((WATCHDOG) == ADC_ANALOGWATCHDOG_ALL_REG) || \
  567. ((WATCHDOG) == ADC_ANALOGWATCHDOG_ALL_INJEC) || \
  568. ((WATCHDOG) == ADC_ANALOGWATCHDOG_ALL_REGINJEC) || \
  569. ((WATCHDOG) == ADC_ANALOGWATCHDOG_NONE))
  570. #define IS_ADC_CHANNELS_TYPE(CHANNEL_TYPE) (((CHANNEL_TYPE) == ADC_ALL_CHANNELS) || \
  571. ((CHANNEL_TYPE) == ADC_REGULAR_CHANNELS) || \
  572. ((CHANNEL_TYPE) == ADC_INJECTED_CHANNELS))
  573. #define IS_ADC_THRESHOLD(THRESHOLD) ((THRESHOLD) <= ((uint32_t)0xFFF))
  574. #define IS_ADC_REGULAR_LENGTH(LENGTH) (((LENGTH) >= ((uint32_t)1)) && ((LENGTH) <= ((uint32_t)16)))
  575. #define IS_ADC_REGULAR_RANK(RANK) (((RANK) >= ((uint32_t)1)) && ((RANK) <= ((uint32_t)16)))
  576. #define IS_ADC_REGULAR_DISC_NUMBER(NUMBER) (((NUMBER) >= ((uint32_t)1)) && ((NUMBER) <= ((uint32_t)8)))
  577. #define IS_ADC_RANGE(RESOLUTION, ADC_VALUE) \
  578. ((((RESOLUTION) == ADC_RESOLUTION_12B) && ((ADC_VALUE) <= ((uint32_t)0x0FFF))) || \
  579. (((RESOLUTION) == ADC_RESOLUTION_10B) && ((ADC_VALUE) <= ((uint32_t)0x03FF))) || \
  580. (((RESOLUTION) == ADC_RESOLUTION_8B) && ((ADC_VALUE) <= ((uint32_t)0x00FF))) || \
  581. (((RESOLUTION) == ADC_RESOLUTION_6B) && ((ADC_VALUE) <= ((uint32_t)0x003F))))
  582. /**
  583. * @brief Set ADC Regular channel sequence length.
  584. * @param _NbrOfConversion_: Regular channel sequence length.
  585. * @retval None
  586. */
  587. #define ADC_SQR1(_NbrOfConversion_) (((_NbrOfConversion_) - (uint8_t)1) << 20)
  588. /**
  589. * @brief Set the ADC's sample time for channel numbers between 10 and 18.
  590. * @param _SAMPLETIME_: Sample time parameter.
  591. * @param _CHANNELNB_: Channel number.
  592. * @retval None
  593. */
  594. #define ADC_SMPR1(_SAMPLETIME_, _CHANNELNB_) ((_SAMPLETIME_) << (3 * (((uint32_t)((uint16_t)(_CHANNELNB_))) - 10)))
  595. /**
  596. * @brief Set the ADC's sample time for channel numbers between 0 and 9.
  597. * @param _SAMPLETIME_: Sample time parameter.
  598. * @param _CHANNELNB_: Channel number.
  599. * @retval None
  600. */
  601. #define ADC_SMPR2(_SAMPLETIME_, _CHANNELNB_) ((_SAMPLETIME_) << (3 * ((uint32_t)((uint16_t)(_CHANNELNB_)))))
  602. /**
  603. * @brief Set the selected regular channel rank for rank between 1 and 6.
  604. * @param _CHANNELNB_: Channel number.
  605. * @param _RANKNB_: Rank number.
  606. * @retval None
  607. */
  608. #define ADC_SQR3_RK(_CHANNELNB_, _RANKNB_) (((uint32_t)((uint16_t)(_CHANNELNB_))) << (5 * ((_RANKNB_) - 1)))
  609. /**
  610. * @brief Set the selected regular channel rank for rank between 7 and 12.
  611. * @param _CHANNELNB_: Channel number.
  612. * @param _RANKNB_: Rank number.
  613. * @retval None
  614. */
  615. #define ADC_SQR2_RK(_CHANNELNB_, _RANKNB_) (((uint32_t)((uint16_t)(_CHANNELNB_))) << (5 * ((_RANKNB_) - 7)))
  616. /**
  617. * @brief Set the selected regular channel rank for rank between 13 and 16.
  618. * @param _CHANNELNB_: Channel number.
  619. * @param _RANKNB_: Rank number.
  620. * @retval None
  621. */
  622. #define ADC_SQR1_RK(_CHANNELNB_, _RANKNB_) (((uint32_t)((uint16_t)(_CHANNELNB_))) << (5 * ((_RANKNB_) - 13)))
  623. /**
  624. * @brief Enable ADC continuous conversion mode.
  625. * @param _CONTINUOUS_MODE_: Continuous mode.
  626. * @retval None
  627. */
  628. #define ADC_CR2_CONTINUOUS(_CONTINUOUS_MODE_) ((_CONTINUOUS_MODE_) << 1)
  629. /**
  630. * @brief Configures the number of discontinuous conversions for the regular group channels.
  631. * @param _NBR_DISCONTINUOUSCONV_: Number of discontinuous conversions.
  632. * @retval None
  633. */
  634. #define ADC_CR1_DISCONTINUOUS(_NBR_DISCONTINUOUSCONV_) (((_NBR_DISCONTINUOUSCONV_) - 1) << POSITION_VAL(ADC_CR1_DISCNUM))
  635. /**
  636. * @brief Enable ADC scan mode.
  637. * @param _SCANCONV_MODE_: Scan conversion mode.
  638. * @retval None
  639. */
  640. #define ADC_CR1_SCANCONV(_SCANCONV_MODE_) ((_SCANCONV_MODE_) << 8)
  641. /**
  642. * @brief Enable the ADC end of conversion selection.
  643. * @param _EOCSelection_MODE_: End of conversion selection mode.
  644. * @retval None
  645. */
  646. #define ADC_CR2_EOCSelection(_EOCSelection_MODE_) ((_EOCSelection_MODE_) << 10)
  647. /**
  648. * @brief Enable the ADC DMA continuous request.
  649. * @param _DMAContReq_MODE_: DMA continuous request mode.
  650. * @retval None
  651. */
  652. #define ADC_CR2_DMAContReq(_DMAContReq_MODE_) ((_DMAContReq_MODE_) << 9)
  653. /**
  654. * @brief Return resolution bits in CR1 register.
  655. * @param __HANDLE__: ADC handle
  656. * @retval None
  657. */
  658. #define ADC_GET_RESOLUTION(__HANDLE__) (((__HANDLE__)->Instance->CR1) & ADC_CR1_RES)
  659. /**
  660. * @}
  661. */
  662. /* Private functions ---------------------------------------------------------*/
  663. /** @defgroup ADC_Private_Functions ADC Private Functions
  664. * @{
  665. */
  666. /**
  667. * @}
  668. */
  669. /**
  670. * @}
  671. */
  672. /**
  673. * @}
  674. */
  675. #ifdef __cplusplus
  676. }
  677. #endif
  678. #endif /*__STM32F4xx_ADC_H */
  679. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/