stm32f10x_adc.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484
  1. /**
  2. ******************************************************************************
  3. * @file stm32f10x_adc.h
  4. * @author MCD Application Team
  5. * @version V3.5.0
  6. * @date 11-March-2011
  7. * @brief This file contains all the functions prototypes for the ADC firmware
  8. * library.
  9. ******************************************************************************
  10. * @attention
  11. *
  12. * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
  13. * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
  14. * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
  15. * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
  16. * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
  17. * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
  18. *
  19. * <h2><center>&copy; COPYRIGHT 2011 STMicroelectronics</center></h2>
  20. ******************************************************************************
  21. */
  22. /* Define to prevent recursive inclusion -------------------------------------*/
  23. #ifndef __STM32F10x_ADC_H
  24. #define __STM32F10x_ADC_H
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif
  28. /* Includes ------------------------------------------------------------------*/
  29. #include "stm32f10x.h"
  30. /** @addtogroup STM32F10x_StdPeriph_Driver
  31. * @{
  32. */
  33. /** @addtogroup ADC
  34. * @{
  35. */
  36. /** @defgroup ADC_Exported_Types
  37. * @{
  38. */
  39. /**
  40. * @brief ADC Init structure definition
  41. */
  42. typedef struct
  43. {
  44. uint32_t ADC_Mode; /*!< Configures the ADC to operate in independent or
  45. dual mode.
  46. This parameter can be a value of @ref ADC_mode */
  47. FunctionalState ADC_ScanConvMode; /*!< Specifies whether the conversion is performed in
  48. Scan (multichannels) or Single (one channel) mode.
  49. This parameter can be set to ENABLE or DISABLE */
  50. FunctionalState ADC_ContinuousConvMode; /*!< Specifies whether the conversion is performed in
  51. Continuous or Single mode.
  52. This parameter can be set to ENABLE or DISABLE. */
  53. uint32_t ADC_ExternalTrigConv; /*!< Defines the external trigger used to start the analog
  54. to digital conversion of regular channels. This parameter
  55. can be a value of @ref ADC_external_trigger_sources_for_regular_channels_conversion */
  56. uint32_t ADC_DataAlign; /*!< Specifies whether the ADC data alignment is left or right.
  57. This parameter can be a value of @ref ADC_data_align */
  58. uint8_t ADC_NbrOfChannel; /*!< Specifies the number of ADC channels that will be converted
  59. using the sequencer for regular channel group.
  60. This parameter must range from 1 to 16. */
  61. }ADC_InitTypeDef;
  62. /**
  63. * @}
  64. */
  65. /** @defgroup ADC_Exported_Constants
  66. * @{
  67. */
  68. #define IS_ADC_ALL_PERIPH(PERIPH) (((PERIPH) == ADC1) || \
  69. ((PERIPH) == ADC2) || \
  70. ((PERIPH) == ADC3))
  71. #define IS_ADC_DMA_PERIPH(PERIPH) (((PERIPH) == ADC1) || \
  72. ((PERIPH) == ADC3))
  73. /** @defgroup ADC_mode
  74. * @{
  75. */
  76. #define ADC_Mode_Independent ((uint32_t)0x00000000)
  77. #define ADC_Mode_RegInjecSimult ((uint32_t)0x00010000)
  78. #define ADC_Mode_RegSimult_AlterTrig ((uint32_t)0x00020000)
  79. #define ADC_Mode_InjecSimult_FastInterl ((uint32_t)0x00030000)
  80. #define ADC_Mode_InjecSimult_SlowInterl ((uint32_t)0x00040000)
  81. #define ADC_Mode_InjecSimult ((uint32_t)0x00050000)
  82. #define ADC_Mode_RegSimult ((uint32_t)0x00060000)
  83. #define ADC_Mode_FastInterl ((uint32_t)0x00070000)
  84. #define ADC_Mode_SlowInterl ((uint32_t)0x00080000)
  85. #define ADC_Mode_AlterTrig ((uint32_t)0x00090000)
  86. #define IS_ADC_MODE(MODE) (((MODE) == ADC_Mode_Independent) || \
  87. ((MODE) == ADC_Mode_RegInjecSimult) || \
  88. ((MODE) == ADC_Mode_RegSimult_AlterTrig) || \
  89. ((MODE) == ADC_Mode_InjecSimult_FastInterl) || \
  90. ((MODE) == ADC_Mode_InjecSimult_SlowInterl) || \
  91. ((MODE) == ADC_Mode_InjecSimult) || \
  92. ((MODE) == ADC_Mode_RegSimult) || \
  93. ((MODE) == ADC_Mode_FastInterl) || \
  94. ((MODE) == ADC_Mode_SlowInterl) || \
  95. ((MODE) == ADC_Mode_AlterTrig))
  96. /**
  97. * @}
  98. */
  99. /** @defgroup ADC_external_trigger_sources_for_regular_channels_conversion
  100. * @{
  101. */
  102. #define ADC_ExternalTrigConv_T1_CC1 ((uint32_t)0x00000000) /*!< For ADC1 and ADC2 */
  103. #define ADC_ExternalTrigConv_T1_CC2 ((uint32_t)0x00020000) /*!< For ADC1 and ADC2 */
  104. #define ADC_ExternalTrigConv_T2_CC2 ((uint32_t)0x00060000) /*!< For ADC1 and ADC2 */
  105. #define ADC_ExternalTrigConv_T3_TRGO ((uint32_t)0x00080000) /*!< For ADC1 and ADC2 */
  106. #define ADC_ExternalTrigConv_T4_CC4 ((uint32_t)0x000A0000) /*!< For ADC1 and ADC2 */
  107. #define ADC_ExternalTrigConv_Ext_IT11_TIM8_TRGO ((uint32_t)0x000C0000) /*!< For ADC1 and ADC2 */
  108. #define ADC_ExternalTrigConv_T1_CC3 ((uint32_t)0x00040000) /*!< For ADC1, ADC2 and ADC3 */
  109. #define ADC_ExternalTrigConv_None ((uint32_t)0x000E0000) /*!< For ADC1, ADC2 and ADC3 */
  110. #define ADC_ExternalTrigConv_T3_CC1 ((uint32_t)0x00000000) /*!< For ADC3 only */
  111. #define ADC_ExternalTrigConv_T2_CC3 ((uint32_t)0x00020000) /*!< For ADC3 only */
  112. #define ADC_ExternalTrigConv_T8_CC1 ((uint32_t)0x00060000) /*!< For ADC3 only */
  113. #define ADC_ExternalTrigConv_T8_TRGO ((uint32_t)0x00080000) /*!< For ADC3 only */
  114. #define ADC_ExternalTrigConv_T5_CC1 ((uint32_t)0x000A0000) /*!< For ADC3 only */
  115. #define ADC_ExternalTrigConv_T5_CC3 ((uint32_t)0x000C0000) /*!< For ADC3 only */
  116. #define IS_ADC_EXT_TRIG(REGTRIG) (((REGTRIG) == ADC_ExternalTrigConv_T1_CC1) || \
  117. ((REGTRIG) == ADC_ExternalTrigConv_T1_CC2) || \
  118. ((REGTRIG) == ADC_ExternalTrigConv_T1_CC3) || \
  119. ((REGTRIG) == ADC_ExternalTrigConv_T2_CC2) || \
  120. ((REGTRIG) == ADC_ExternalTrigConv_T3_TRGO) || \
  121. ((REGTRIG) == ADC_ExternalTrigConv_T4_CC4) || \
  122. ((REGTRIG) == ADC_ExternalTrigConv_Ext_IT11_TIM8_TRGO) || \
  123. ((REGTRIG) == ADC_ExternalTrigConv_None) || \
  124. ((REGTRIG) == ADC_ExternalTrigConv_T3_CC1) || \
  125. ((REGTRIG) == ADC_ExternalTrigConv_T2_CC3) || \
  126. ((REGTRIG) == ADC_ExternalTrigConv_T8_CC1) || \
  127. ((REGTRIG) == ADC_ExternalTrigConv_T8_TRGO) || \
  128. ((REGTRIG) == ADC_ExternalTrigConv_T5_CC1) || \
  129. ((REGTRIG) == ADC_ExternalTrigConv_T5_CC3))
  130. /**
  131. * @}
  132. */
  133. /** @defgroup ADC_data_align
  134. * @{
  135. */
  136. #define ADC_DataAlign_Right ((uint32_t)0x00000000)
  137. #define ADC_DataAlign_Left ((uint32_t)0x00000800)
  138. #define IS_ADC_DATA_ALIGN(ALIGN) (((ALIGN) == ADC_DataAlign_Right) || \
  139. ((ALIGN) == ADC_DataAlign_Left))
  140. /**
  141. * @}
  142. */
  143. /** @defgroup ADC_channels
  144. * @{
  145. */
  146. #define ADC_Channel_0 ((uint8_t)0x00)
  147. #define ADC_Channel_1 ((uint8_t)0x01)
  148. #define ADC_Channel_2 ((uint8_t)0x02)
  149. #define ADC_Channel_3 ((uint8_t)0x03)
  150. #define ADC_Channel_4 ((uint8_t)0x04)
  151. #define ADC_Channel_5 ((uint8_t)0x05)
  152. #define ADC_Channel_6 ((uint8_t)0x06)
  153. #define ADC_Channel_7 ((uint8_t)0x07)
  154. #define ADC_Channel_8 ((uint8_t)0x08)
  155. #define ADC_Channel_9 ((uint8_t)0x09)
  156. #define ADC_Channel_10 ((uint8_t)0x0A)
  157. #define ADC_Channel_11 ((uint8_t)0x0B)
  158. #define ADC_Channel_12 ((uint8_t)0x0C)
  159. #define ADC_Channel_13 ((uint8_t)0x0D)
  160. #define ADC_Channel_14 ((uint8_t)0x0E)
  161. #define ADC_Channel_15 ((uint8_t)0x0F)
  162. #define ADC_Channel_16 ((uint8_t)0x10)
  163. #define ADC_Channel_17 ((uint8_t)0x11)
  164. #define ADC_Channel_TempSensor ((uint8_t)ADC_Channel_16)
  165. #define ADC_Channel_Vrefint ((uint8_t)ADC_Channel_17)
  166. #define IS_ADC_CHANNEL(CHANNEL) (((CHANNEL) == ADC_Channel_0) || ((CHANNEL) == ADC_Channel_1) || \
  167. ((CHANNEL) == ADC_Channel_2) || ((CHANNEL) == ADC_Channel_3) || \
  168. ((CHANNEL) == ADC_Channel_4) || ((CHANNEL) == ADC_Channel_5) || \
  169. ((CHANNEL) == ADC_Channel_6) || ((CHANNEL) == ADC_Channel_7) || \
  170. ((CHANNEL) == ADC_Channel_8) || ((CHANNEL) == ADC_Channel_9) || \
  171. ((CHANNEL) == ADC_Channel_10) || ((CHANNEL) == ADC_Channel_11) || \
  172. ((CHANNEL) == ADC_Channel_12) || ((CHANNEL) == ADC_Channel_13) || \
  173. ((CHANNEL) == ADC_Channel_14) || ((CHANNEL) == ADC_Channel_15) || \
  174. ((CHANNEL) == ADC_Channel_16) || ((CHANNEL) == ADC_Channel_17))
  175. /**
  176. * @}
  177. */
  178. /** @defgroup ADC_sampling_time
  179. * @{
  180. */
  181. #define ADC_SampleTime_1Cycles5 ((uint8_t)0x00)
  182. #define ADC_SampleTime_7Cycles5 ((uint8_t)0x01)
  183. #define ADC_SampleTime_13Cycles5 ((uint8_t)0x02)
  184. #define ADC_SampleTime_28Cycles5 ((uint8_t)0x03)
  185. #define ADC_SampleTime_41Cycles5 ((uint8_t)0x04)
  186. #define ADC_SampleTime_55Cycles5 ((uint8_t)0x05)
  187. #define ADC_SampleTime_71Cycles5 ((uint8_t)0x06)
  188. #define ADC_SampleTime_239Cycles5 ((uint8_t)0x07)
  189. #define IS_ADC_SAMPLE_TIME(TIME) (((TIME) == ADC_SampleTime_1Cycles5) || \
  190. ((TIME) == ADC_SampleTime_7Cycles5) || \
  191. ((TIME) == ADC_SampleTime_13Cycles5) || \
  192. ((TIME) == ADC_SampleTime_28Cycles5) || \
  193. ((TIME) == ADC_SampleTime_41Cycles5) || \
  194. ((TIME) == ADC_SampleTime_55Cycles5) || \
  195. ((TIME) == ADC_SampleTime_71Cycles5) || \
  196. ((TIME) == ADC_SampleTime_239Cycles5))
  197. /**
  198. * @}
  199. */
  200. /** @defgroup ADC_external_trigger_sources_for_injected_channels_conversion
  201. * @{
  202. */
  203. #define ADC_ExternalTrigInjecConv_T2_TRGO ((uint32_t)0x00002000) /*!< For ADC1 and ADC2 */
  204. #define ADC_ExternalTrigInjecConv_T2_CC1 ((uint32_t)0x00003000) /*!< For ADC1 and ADC2 */
  205. #define ADC_ExternalTrigInjecConv_T3_CC4 ((uint32_t)0x00004000) /*!< For ADC1 and ADC2 */
  206. #define ADC_ExternalTrigInjecConv_T4_TRGO ((uint32_t)0x00005000) /*!< For ADC1 and ADC2 */
  207. #define ADC_ExternalTrigInjecConv_Ext_IT15_TIM8_CC4 ((uint32_t)0x00006000) /*!< For ADC1 and ADC2 */
  208. #define ADC_ExternalTrigInjecConv_T1_TRGO ((uint32_t)0x00000000) /*!< For ADC1, ADC2 and ADC3 */
  209. #define ADC_ExternalTrigInjecConv_T1_CC4 ((uint32_t)0x00001000) /*!< For ADC1, ADC2 and ADC3 */
  210. #define ADC_ExternalTrigInjecConv_None ((uint32_t)0x00007000) /*!< For ADC1, ADC2 and ADC3 */
  211. #define ADC_ExternalTrigInjecConv_T4_CC3 ((uint32_t)0x00002000) /*!< For ADC3 only */
  212. #define ADC_ExternalTrigInjecConv_T8_CC2 ((uint32_t)0x00003000) /*!< For ADC3 only */
  213. #define ADC_ExternalTrigInjecConv_T8_CC4 ((uint32_t)0x00004000) /*!< For ADC3 only */
  214. #define ADC_ExternalTrigInjecConv_T5_TRGO ((uint32_t)0x00005000) /*!< For ADC3 only */
  215. #define ADC_ExternalTrigInjecConv_T5_CC4 ((uint32_t)0x00006000) /*!< For ADC3 only */
  216. #define IS_ADC_EXT_INJEC_TRIG(INJTRIG) (((INJTRIG) == ADC_ExternalTrigInjecConv_T1_TRGO) || \
  217. ((INJTRIG) == ADC_ExternalTrigInjecConv_T1_CC4) || \
  218. ((INJTRIG) == ADC_ExternalTrigInjecConv_T2_TRGO) || \
  219. ((INJTRIG) == ADC_ExternalTrigInjecConv_T2_CC1) || \
  220. ((INJTRIG) == ADC_ExternalTrigInjecConv_T3_CC4) || \
  221. ((INJTRIG) == ADC_ExternalTrigInjecConv_T4_TRGO) || \
  222. ((INJTRIG) == ADC_ExternalTrigInjecConv_Ext_IT15_TIM8_CC4) || \
  223. ((INJTRIG) == ADC_ExternalTrigInjecConv_None) || \
  224. ((INJTRIG) == ADC_ExternalTrigInjecConv_T4_CC3) || \
  225. ((INJTRIG) == ADC_ExternalTrigInjecConv_T8_CC2) || \
  226. ((INJTRIG) == ADC_ExternalTrigInjecConv_T8_CC4) || \
  227. ((INJTRIG) == ADC_ExternalTrigInjecConv_T5_TRGO) || \
  228. ((INJTRIG) == ADC_ExternalTrigInjecConv_T5_CC4))
  229. /**
  230. * @}
  231. */
  232. /** @defgroup ADC_injected_channel_selection
  233. * @{
  234. */
  235. #define ADC_InjectedChannel_1 ((uint8_t)0x14)
  236. #define ADC_InjectedChannel_2 ((uint8_t)0x18)
  237. #define ADC_InjectedChannel_3 ((uint8_t)0x1C)
  238. #define ADC_InjectedChannel_4 ((uint8_t)0x20)
  239. #define IS_ADC_INJECTED_CHANNEL(CHANNEL) (((CHANNEL) == ADC_InjectedChannel_1) || \
  240. ((CHANNEL) == ADC_InjectedChannel_2) || \
  241. ((CHANNEL) == ADC_InjectedChannel_3) || \
  242. ((CHANNEL) == ADC_InjectedChannel_4))
  243. /**
  244. * @}
  245. */
  246. /** @defgroup ADC_analog_watchdog_selection
  247. * @{
  248. */
  249. #define ADC_AnalogWatchdog_SingleRegEnable ((uint32_t)0x00800200)
  250. #define ADC_AnalogWatchdog_SingleInjecEnable ((uint32_t)0x00400200)
  251. #define ADC_AnalogWatchdog_SingleRegOrInjecEnable ((uint32_t)0x00C00200)
  252. #define ADC_AnalogWatchdog_AllRegEnable ((uint32_t)0x00800000)
  253. #define ADC_AnalogWatchdog_AllInjecEnable ((uint32_t)0x00400000)
  254. #define ADC_AnalogWatchdog_AllRegAllInjecEnable ((uint32_t)0x00C00000)
  255. #define ADC_AnalogWatchdog_None ((uint32_t)0x00000000)
  256. #define IS_ADC_ANALOG_WATCHDOG(WATCHDOG) (((WATCHDOG) == ADC_AnalogWatchdog_SingleRegEnable) || \
  257. ((WATCHDOG) == ADC_AnalogWatchdog_SingleInjecEnable) || \
  258. ((WATCHDOG) == ADC_AnalogWatchdog_SingleRegOrInjecEnable) || \
  259. ((WATCHDOG) == ADC_AnalogWatchdog_AllRegEnable) || \
  260. ((WATCHDOG) == ADC_AnalogWatchdog_AllInjecEnable) || \
  261. ((WATCHDOG) == ADC_AnalogWatchdog_AllRegAllInjecEnable) || \
  262. ((WATCHDOG) == ADC_AnalogWatchdog_None))
  263. /**
  264. * @}
  265. */
  266. /** @defgroup ADC_interrupts_definition
  267. * @{
  268. */
  269. #define ADC_IT_EOC ((uint16_t)0x0220)
  270. #define ADC_IT_AWD ((uint16_t)0x0140)
  271. #define ADC_IT_JEOC ((uint16_t)0x0480)
  272. #define IS_ADC_IT(IT) ((((IT) & (uint16_t)0xF81F) == 0x00) && ((IT) != 0x00))
  273. #define IS_ADC_GET_IT(IT) (((IT) == ADC_IT_EOC) || ((IT) == ADC_IT_AWD) || \
  274. ((IT) == ADC_IT_JEOC))
  275. /**
  276. * @}
  277. */
  278. /** @defgroup ADC_flags_definition
  279. * @{
  280. */
  281. #define ADC_FLAG_AWD ((uint8_t)0x01)
  282. #define ADC_FLAG_EOC ((uint8_t)0x02)
  283. #define ADC_FLAG_JEOC ((uint8_t)0x04)
  284. #define ADC_FLAG_JSTRT ((uint8_t)0x08)
  285. #define ADC_FLAG_STRT ((uint8_t)0x10)
  286. #define IS_ADC_CLEAR_FLAG(FLAG) ((((FLAG) & (uint8_t)0xE0) == 0x00) && ((FLAG) != 0x00))
  287. #define IS_ADC_GET_FLAG(FLAG) (((FLAG) == ADC_FLAG_AWD) || ((FLAG) == ADC_FLAG_EOC) || \
  288. ((FLAG) == ADC_FLAG_JEOC) || ((FLAG)== ADC_FLAG_JSTRT) || \
  289. ((FLAG) == ADC_FLAG_STRT))
  290. /**
  291. * @}
  292. */
  293. /** @defgroup ADC_thresholds
  294. * @{
  295. */
  296. #define IS_ADC_THRESHOLD(THRESHOLD) ((THRESHOLD) <= 0xFFF)
  297. /**
  298. * @}
  299. */
  300. /** @defgroup ADC_injected_offset
  301. * @{
  302. */
  303. #define IS_ADC_OFFSET(OFFSET) ((OFFSET) <= 0xFFF)
  304. /**
  305. * @}
  306. */
  307. /** @defgroup ADC_injected_length
  308. * @{
  309. */
  310. #define IS_ADC_INJECTED_LENGTH(LENGTH) (((LENGTH) >= 0x1) && ((LENGTH) <= 0x4))
  311. /**
  312. * @}
  313. */
  314. /** @defgroup ADC_injected_rank
  315. * @{
  316. */
  317. #define IS_ADC_INJECTED_RANK(RANK) (((RANK) >= 0x1) && ((RANK) <= 0x4))
  318. /**
  319. * @}
  320. */
  321. /** @defgroup ADC_regular_length
  322. * @{
  323. */
  324. #define IS_ADC_REGULAR_LENGTH(LENGTH) (((LENGTH) >= 0x1) && ((LENGTH) <= 0x10))
  325. /**
  326. * @}
  327. */
  328. /** @defgroup ADC_regular_rank
  329. * @{
  330. */
  331. #define IS_ADC_REGULAR_RANK(RANK) (((RANK) >= 0x1) && ((RANK) <= 0x10))
  332. /**
  333. * @}
  334. */
  335. /** @defgroup ADC_regular_discontinuous_mode_number
  336. * @{
  337. */
  338. #define IS_ADC_REGULAR_DISC_NUMBER(NUMBER) (((NUMBER) >= 0x1) && ((NUMBER) <= 0x8))
  339. /**
  340. * @}
  341. */
  342. /**
  343. * @}
  344. */
  345. /** @defgroup ADC_Exported_Macros
  346. * @{
  347. */
  348. /**
  349. * @}
  350. */
  351. /** @defgroup ADC_Exported_Functions
  352. * @{
  353. */
  354. void ADC_DeInit(ADC_TypeDef* ADCx);
  355. void ADC_Init(ADC_TypeDef* ADCx, ADC_InitTypeDef* ADC_InitStruct);
  356. void ADC_StructInit(ADC_InitTypeDef* ADC_InitStruct);
  357. void ADC_Cmd(ADC_TypeDef* ADCx, FunctionalState NewState);
  358. void ADC_DMACmd(ADC_TypeDef* ADCx, FunctionalState NewState);
  359. void ADC_ITConfig(ADC_TypeDef* ADCx, uint16_t ADC_IT, FunctionalState NewState);
  360. void ADC_ResetCalibration(ADC_TypeDef* ADCx);
  361. FlagStatus ADC_GetResetCalibrationStatus(ADC_TypeDef* ADCx);
  362. void ADC_StartCalibration(ADC_TypeDef* ADCx);
  363. FlagStatus ADC_GetCalibrationStatus(ADC_TypeDef* ADCx);
  364. void ADC_SoftwareStartConvCmd(ADC_TypeDef* ADCx, FunctionalState NewState);
  365. FlagStatus ADC_GetSoftwareStartConvStatus(ADC_TypeDef* ADCx);
  366. void ADC_DiscModeChannelCountConfig(ADC_TypeDef* ADCx, uint8_t Number);
  367. void ADC_DiscModeCmd(ADC_TypeDef* ADCx, FunctionalState NewState);
  368. void ADC_RegularChannelConfig(ADC_TypeDef* ADCx, uint8_t ADC_Channel, uint8_t Rank, uint8_t ADC_SampleTime);
  369. void ADC_ExternalTrigConvCmd(ADC_TypeDef* ADCx, FunctionalState NewState);
  370. uint16_t ADC_GetConversionValue(ADC_TypeDef* ADCx);
  371. uint32_t ADC_GetDualModeConversionValue(void);
  372. void ADC_AutoInjectedConvCmd(ADC_TypeDef* ADCx, FunctionalState NewState);
  373. void ADC_InjectedDiscModeCmd(ADC_TypeDef* ADCx, FunctionalState NewState);
  374. void ADC_ExternalTrigInjectedConvConfig(ADC_TypeDef* ADCx, uint32_t ADC_ExternalTrigInjecConv);
  375. void ADC_ExternalTrigInjectedConvCmd(ADC_TypeDef* ADCx, FunctionalState NewState);
  376. void ADC_SoftwareStartInjectedConvCmd(ADC_TypeDef* ADCx, FunctionalState NewState);
  377. FlagStatus ADC_GetSoftwareStartInjectedConvCmdStatus(ADC_TypeDef* ADCx);
  378. void ADC_InjectedChannelConfig(ADC_TypeDef* ADCx, uint8_t ADC_Channel, uint8_t Rank, uint8_t ADC_SampleTime);
  379. void ADC_InjectedSequencerLengthConfig(ADC_TypeDef* ADCx, uint8_t Length);
  380. void ADC_SetInjectedOffset(ADC_TypeDef* ADCx, uint8_t ADC_InjectedChannel, uint16_t Offset);
  381. uint16_t ADC_GetInjectedConversionValue(ADC_TypeDef* ADCx, uint8_t ADC_InjectedChannel);
  382. void ADC_AnalogWatchdogCmd(ADC_TypeDef* ADCx, uint32_t ADC_AnalogWatchdog);
  383. void ADC_AnalogWatchdogThresholdsConfig(ADC_TypeDef* ADCx, uint16_t HighThreshold, uint16_t LowThreshold);
  384. void ADC_AnalogWatchdogSingleChannelConfig(ADC_TypeDef* ADCx, uint8_t ADC_Channel);
  385. void ADC_TempSensorVrefintCmd(FunctionalState NewState);
  386. FlagStatus ADC_GetFlagStatus(ADC_TypeDef* ADCx, uint8_t ADC_FLAG);
  387. void ADC_ClearFlag(ADC_TypeDef* ADCx, uint8_t ADC_FLAG);
  388. ITStatus ADC_GetITStatus(ADC_TypeDef* ADCx, uint16_t ADC_IT);
  389. void ADC_ClearITPendingBit(ADC_TypeDef* ADCx, uint16_t ADC_IT);
  390. #ifdef __cplusplus
  391. }
  392. #endif
  393. #endif /*__STM32F10x_ADC_H */
  394. /**
  395. * @}
  396. */
  397. /**
  398. * @}
  399. */
  400. /**
  401. * @}
  402. */
  403. /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/