stm32f10x_adc.h 21 KB

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