at32f415_adc.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592
  1. /**
  2. **************************************************************************
  3. * @file at32f415_adc.h
  4. * @version v2.0.5
  5. * @date 2022-05-20
  6. * @brief at32f415 adc header file
  7. **************************************************************************
  8. * Copyright notice & Disclaimer
  9. *
  10. * The software Board Support Package (BSP) that is made available to
  11. * download from Artery official website is the copyrighted work of Artery.
  12. * Artery authorizes customers to use, copy, and distribute the BSP
  13. * software and its related documentation for the purpose of design and
  14. * development in conjunction with Artery microcontrollers. Use of the
  15. * software is governed by this copyright notice and the following disclaimer.
  16. *
  17. * THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,
  18. * GUARANTEES OR REPRESENTATIONS OF ANY KIND. ARTERY EXPRESSLY DISCLAIMS,
  19. * TO THE FULLEST EXTENT PERMITTED BY LAW, ALL EXPRESS, IMPLIED OR
  20. * STATUTORY OR OTHER WARRANTIES, GUARANTEES OR REPRESENTATIONS,
  21. * INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
  22. * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
  23. *
  24. **************************************************************************
  25. */
  26. /* Define to prevent recursive inclusion -------------------------------------*/
  27. #ifndef __AT32F415_ADC_H
  28. #define __AT32F415_ADC_H
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif
  32. /* Includes ------------------------------------------------------------------*/
  33. #include "at32f415.h"
  34. /** @addtogroup AT32F415_periph_driver
  35. * @{
  36. */
  37. /** @addtogroup ADC
  38. * @{
  39. */
  40. /** @defgroup ADC_interrupts_definition
  41. * @brief adc interrupt
  42. * @{
  43. */
  44. #define ADC_CCE_INT ((uint32_t)0x00000020) /*!< channels conversion end interrupt */
  45. #define ADC_VMOR_INT ((uint32_t)0x00000040) /*!< voltage monitoring out of range interrupt */
  46. #define ADC_PCCE_INT ((uint32_t)0x00000080) /*!< preempt channels conversion end interrupt */
  47. /**
  48. * @}
  49. */
  50. /** @defgroup ADC_flags_definition
  51. * @brief adc flag
  52. * @{
  53. */
  54. #define ADC_VMOR_FLAG ((uint8_t)0x01) /*!< voltage monitoring out of range flag */
  55. #define ADC_CCE_FLAG ((uint8_t)0x02) /*!< channels conversion end flag */
  56. #define ADC_PCCE_FLAG ((uint8_t)0x04) /*!< preempt channels conversion end flag */
  57. #define ADC_PCCS_FLAG ((uint8_t)0x08) /*!< preempt channel conversion start flag */
  58. #define ADC_OCCS_FLAG ((uint8_t)0x10) /*!< ordinary channel conversion start flag */
  59. /**
  60. * @}
  61. */
  62. /** @defgroup ADC_exported_types
  63. * @{
  64. */
  65. /**
  66. * @brief adc data align type
  67. */
  68. typedef enum
  69. {
  70. ADC_RIGHT_ALIGNMENT = 0x00, /*!< data right alignment */
  71. ADC_LEFT_ALIGNMENT = 0x01 /*!< data left alignment */
  72. } adc_data_align_type;
  73. /**
  74. * @brief adc channel select type
  75. */
  76. typedef enum
  77. {
  78. ADC_CHANNEL_0 = 0x00, /*!< adc channel 0 */
  79. ADC_CHANNEL_1 = 0x01, /*!< adc channel 1 */
  80. ADC_CHANNEL_2 = 0x02, /*!< adc channel 2 */
  81. ADC_CHANNEL_3 = 0x03, /*!< adc channel 3 */
  82. ADC_CHANNEL_4 = 0x04, /*!< adc channel 4 */
  83. ADC_CHANNEL_5 = 0x05, /*!< adc channel 5 */
  84. ADC_CHANNEL_6 = 0x06, /*!< adc channel 6 */
  85. ADC_CHANNEL_7 = 0x07, /*!< adc channel 7 */
  86. ADC_CHANNEL_8 = 0x08, /*!< adc channel 8 */
  87. ADC_CHANNEL_9 = 0x09, /*!< adc channel 9 */
  88. ADC_CHANNEL_10 = 0x0A, /*!< adc channel 10 */
  89. ADC_CHANNEL_11 = 0x0B, /*!< adc channel 11 */
  90. ADC_CHANNEL_12 = 0x0C, /*!< adc channel 12 */
  91. ADC_CHANNEL_13 = 0x0D, /*!< adc channel 13 */
  92. ADC_CHANNEL_14 = 0x0E, /*!< adc channel 14 */
  93. ADC_CHANNEL_15 = 0x0F, /*!< adc channel 15 */
  94. ADC_CHANNEL_16 = 0x10, /*!< adc channel 16 */
  95. ADC_CHANNEL_17 = 0x11 /*!< adc channel 17 */
  96. } adc_channel_select_type;
  97. /**
  98. * @brief adc sampletime select type
  99. */
  100. typedef enum
  101. {
  102. ADC_SAMPLETIME_1_5 = 0x00, /*!< adc sample time 1.5 cycle */
  103. ADC_SAMPLETIME_7_5 = 0x01, /*!< adc sample time 7.5 cycle */
  104. ADC_SAMPLETIME_13_5 = 0x02, /*!< adc sample time 13.5 cycle */
  105. ADC_SAMPLETIME_28_5 = 0x03, /*!< adc sample time 28.5 cycle */
  106. ADC_SAMPLETIME_41_5 = 0x04, /*!< adc sample time 41.5 cycle */
  107. ADC_SAMPLETIME_55_5 = 0x05, /*!< adc sample time 55.5 cycle */
  108. ADC_SAMPLETIME_71_5 = 0x06, /*!< adc sample time 71.5 cycle */
  109. ADC_SAMPLETIME_239_5 = 0x07 /*!< adc sample time 239.5 cycle */
  110. } adc_sampletime_select_type;
  111. /**
  112. * @brief adc ordinary group trigger event select type
  113. */
  114. typedef enum
  115. {
  116. /*adc1 ordinary trigger event*/
  117. ADC12_ORDINARY_TRIG_TMR1CH1 = 0x00, /*!< timer1 ch1 event as trigger source of adc1 ordinary sequence */
  118. ADC12_ORDINARY_TRIG_TMR1CH2 = 0x01, /*!< timer1 ch2 event as trigger source of adc1 ordinary sequence */
  119. ADC12_ORDINARY_TRIG_TMR1CH3 = 0x02, /*!< timer1 ch3 event as trigger source of adc1 ordinary sequence */
  120. ADC12_ORDINARY_TRIG_TMR2CH2 = 0x03, /*!< timer2 ch2 event as trigger source of adc1 ordinary sequence */
  121. ADC12_ORDINARY_TRIG_TMR3TRGOUT = 0x04, /*!< timer3 trgout event as trigger source of adc1 ordinary sequence */
  122. ADC12_ORDINARY_TRIG_TMR4CH4 = 0x05, /*!< timer4 ch4 event as trigger source of adc1 ordinary sequence */
  123. ADC12_ORDINARY_TRIG_EXINT11_TMR1TRGOUT = 0x06, /*!< exint line11/timer1 trgout event as trigger source of adc1 ordinary sequence */
  124. ADC12_ORDINARY_TRIG_SOFTWARE = 0x07, /*!< software(OCSWTRG) control bit as trigger source of adc1 ordinary sequence */
  125. ADC12_ORDINARY_TRIG_TMR1TRGOUT = 0x0D, /*!< timer1 trgout event as trigger source of adc1 ordinary sequence */
  126. } adc_ordinary_trig_select_type;
  127. /**
  128. * @brief adc preempt group trigger event select type
  129. */
  130. typedef enum
  131. {
  132. /*adc1 preempt trigger event*/
  133. ADC12_PREEMPT_TRIG_TMR1TRGOUT = 0x00, /*!< timer1 trgout event as trigger source of adc1 preempt sequence */
  134. ADC12_PREEMPT_TRIG_TMR1CH4 = 0x01, /*!< timer1 ch4 event as trigger source of adc1 preempt sequence */
  135. ADC12_PREEMPT_TRIG_TMR2TRGOUT = 0x02, /*!< timer2 trgout event as trigger source of adc1 preempt sequence */
  136. ADC12_PREEMPT_TRIG_TMR2CH1 = 0x03, /*!< timer2 ch1 event as trigger source of adc1 preempt sequence */
  137. ADC12_PREEMPT_TRIG_TMR3CH4 = 0x04, /*!< timer3 ch4 event as trigger source of adc1 preempt sequence */
  138. ADC12_PREEMPT_TRIG_TMR4TRGOUT = 0x05, /*!< timer4 trgout event as trigger source of adc1 preempt sequence */
  139. ADC12_PREEMPT_TRIG_EXINT15_TMR1CH4 = 0x06, /*!< exint line15/timer1 ch4 event as trigger source of adc1 preempt sequence */
  140. ADC12_PREEMPT_TRIG_SOFTWARE = 0x07, /*!< software(PCSWTRG) control bit as trigger source of adc1 preempt sequence */
  141. ADC12_PREEMPT_TRIG_TMR1CH1 = 0x0D, /*!< timer1 ch1 event as trigger source of adc1 preempt sequence */
  142. } adc_preempt_trig_select_type;
  143. /**
  144. * @brief adc preempt channel type
  145. */
  146. typedef enum
  147. {
  148. ADC_PREEMPT_CHANNEL_1 = 0x00, /*!< adc preempt channel 1 */
  149. ADC_PREEMPT_CHANNEL_2 = 0x01, /*!< adc preempt channel 2 */
  150. ADC_PREEMPT_CHANNEL_3 = 0x02, /*!< adc preempt channel 3 */
  151. ADC_PREEMPT_CHANNEL_4 = 0x03 /*!< adc preempt channel 4 */
  152. } adc_preempt_channel_type;
  153. /**
  154. * @brief adc voltage_monitoring type
  155. */
  156. typedef enum
  157. {
  158. ADC_VMONITOR_SINGLE_ORDINARY = 0x00800200, /*!< voltage_monitoring on a single ordinary channel */
  159. ADC_VMONITOR_SINGLE_PREEMPT = 0x00400200, /*!< voltage_monitoring on a single preempt channel */
  160. ADC_VMONITOR_SINGLE_ORDINARY_PREEMPT = 0x00C00200, /*!< voltage_monitoring on a single ordinary or preempt channel */
  161. ADC_VMONITOR_ALL_ORDINARY = 0x00800000, /*!< voltage_monitoring on all ordinary channel */
  162. ADC_VMONITOR_ALL_PREEMPT = 0x00400000, /*!< voltage_monitoring on all preempt channel */
  163. ADC_VMONITOR_ALL_ORDINARY_PREEMPT = 0x00C00000, /*!< voltage_monitoring on all ordinary and preempt channel */
  164. ADC_VMONITOR_NONE = 0x00000000 /*!< no channel guarded by the voltage_monitoring */
  165. } adc_voltage_monitoring_type;
  166. /**
  167. * @brief adc base config type
  168. */
  169. typedef struct
  170. {
  171. confirm_state sequence_mode; /*!< adc sequence mode */
  172. confirm_state repeat_mode; /*!< adc repeat mode */
  173. adc_data_align_type data_align; /*!< adc data alignment */
  174. uint8_t ordinary_channel_length; /*!< adc ordinary channel sequence length*/
  175. } adc_base_config_type;
  176. /**
  177. * @brief type define adc register all
  178. */
  179. typedef struct
  180. {
  181. /**
  182. * @brief adc sts register, offset:0x00
  183. */
  184. union
  185. {
  186. __IO uint32_t sts;
  187. struct
  188. {
  189. __IO uint32_t vmor : 1; /* [0] */
  190. __IO uint32_t cce : 1; /* [1] */
  191. __IO uint32_t pcce : 1; /* [2] */
  192. __IO uint32_t pccs : 1; /* [3] */
  193. __IO uint32_t occs : 1; /* [4] */
  194. __IO uint32_t reserved1 : 27;/* [31:5] */
  195. } sts_bit;
  196. };
  197. /**
  198. * @brief adc ctrl1 register, offset:0x04
  199. */
  200. union
  201. {
  202. __IO uint32_t ctrl1;
  203. struct
  204. {
  205. __IO uint32_t vmcsel : 5; /* [4:0] */
  206. __IO uint32_t cceien : 1; /* [5] */
  207. __IO uint32_t vmorien : 1; /* [6] */
  208. __IO uint32_t pcceien : 1; /* [7] */
  209. __IO uint32_t sqen : 1; /* [8] */
  210. __IO uint32_t vmsgen : 1; /* [9] */
  211. __IO uint32_t pcautoen : 1; /* [10] */
  212. __IO uint32_t ocpen : 1; /* [11] */
  213. __IO uint32_t pcpen : 1; /* [12] */
  214. __IO uint32_t ocpcnt : 3; /* [15:13] */
  215. __IO uint32_t reserved1 : 6; /* [21:16] */
  216. __IO uint32_t pcvmen : 1; /* [22] */
  217. __IO uint32_t ocvmen : 1; /* [23] */
  218. __IO uint32_t reserved2 : 8; /* [31:24] */
  219. } ctrl1_bit;
  220. };
  221. /**
  222. * @brief adc ctrl2 register, offset:0x08
  223. */
  224. union
  225. {
  226. __IO uint32_t ctrl2;
  227. struct
  228. {
  229. __IO uint32_t adcen : 1; /* [0] */
  230. __IO uint32_t rpen : 1; /* [1] */
  231. __IO uint32_t adcal : 1; /* [2] */
  232. __IO uint32_t adcalinit : 1; /* [3] */
  233. __IO uint32_t reserved1 : 4; /* [7:4] */
  234. __IO uint32_t ocdmaen : 1; /* [8] */
  235. __IO uint32_t reserved2 : 2; /* [10:9] */
  236. __IO uint32_t dtalign : 1; /* [11] */
  237. __IO uint32_t pctesel_l : 3; /* [14:12] */
  238. __IO uint32_t pcten : 1; /* [15] */
  239. __IO uint32_t reserved3 : 1; /* [16] */
  240. __IO uint32_t octesel_l : 3; /* [19:17] */
  241. __IO uint32_t octen : 1; /* [20] */
  242. __IO uint32_t pcswtrg : 1; /* [21] */
  243. __IO uint32_t ocswtrg : 1; /* [22] */
  244. __IO uint32_t itsrven : 1; /* [23] */
  245. __IO uint32_t pctesel_h : 1; /* [24] */
  246. __IO uint32_t octesel_h : 1; /* [25] */
  247. __IO uint32_t reserved4 : 6; /* [31:26] */
  248. } ctrl2_bit;
  249. };
  250. /**
  251. * @brief adc spt1 register, offset:0x0C
  252. */
  253. union
  254. {
  255. __IO uint32_t spt1;
  256. struct
  257. {
  258. __IO uint32_t cspt10 : 3; /* [2:0] */
  259. __IO uint32_t cspt11 : 3; /* [5:3] */
  260. __IO uint32_t cspt12 : 3; /* [8:6] */
  261. __IO uint32_t cspt13 : 3; /* [11:9] */
  262. __IO uint32_t cspt14 : 3; /* [14:12] */
  263. __IO uint32_t cspt15 : 3; /* [17:15] */
  264. __IO uint32_t cspt16 : 3; /* [20:18] */
  265. __IO uint32_t cspt17 : 3; /* [23:21] */
  266. __IO uint32_t reserved1 : 8;/* [31:24] */
  267. } spt1_bit;
  268. };
  269. /**
  270. * @brief adc spt2 register, offset:0x10
  271. */
  272. union
  273. {
  274. __IO uint32_t spt2;
  275. struct
  276. {
  277. __IO uint32_t cspt0 : 3;/* [2:0] */
  278. __IO uint32_t cspt1 : 3;/* [5:3] */
  279. __IO uint32_t cspt2 : 3;/* [8:6] */
  280. __IO uint32_t cspt3 : 3;/* [11:9] */
  281. __IO uint32_t cspt4 : 3;/* [14:12] */
  282. __IO uint32_t cspt5 : 3;/* [17:15] */
  283. __IO uint32_t cspt6 : 3;/* [20:18] */
  284. __IO uint32_t cspt7 : 3;/* [23:21] */
  285. __IO uint32_t cspt8 : 3;/* [26:24] */
  286. __IO uint32_t cspt9 : 3;/* [29:27] */
  287. __IO uint32_t reserved1 : 2;/* [31:30] */
  288. } spt2_bit;
  289. };
  290. /**
  291. * @brief adc pcdto1 register, offset:0x14
  292. */
  293. union
  294. {
  295. __IO uint32_t pcdto1;
  296. struct
  297. {
  298. __IO uint32_t pcdto1 : 12; /* [11:0] */
  299. __IO uint32_t reserved1 : 20; /* [31:12] */
  300. } pcdto1_bit;
  301. };
  302. /**
  303. * @brief adc pcdto2 register, offset:0x18
  304. */
  305. union
  306. {
  307. __IO uint32_t pcdto2;
  308. struct
  309. {
  310. __IO uint32_t pcdto2 : 12; /* [11:0] */
  311. __IO uint32_t reserved1 : 20; /* [31:12] */
  312. } pcdto2_bit;
  313. };
  314. /**
  315. * @brief adc pcdto3 register, offset:0x1C
  316. */
  317. union
  318. {
  319. __IO uint32_t pcdto3;
  320. struct
  321. {
  322. __IO uint32_t pcdto3 : 12; /* [11:0] */
  323. __IO uint32_t reserved1 : 20; /* [31:12] */
  324. } pcdto3_bit;
  325. };
  326. /**
  327. * @brief adc pcdto4 register, offset:0x20
  328. */
  329. union
  330. {
  331. __IO uint32_t pcdto4;
  332. struct
  333. {
  334. __IO uint32_t pcdto4 : 12; /* [11:0] */
  335. __IO uint32_t reserved1 : 20; /* [31:12] */
  336. } pcdto4_bit;
  337. };
  338. /**
  339. * @brief adc vmhb register, offset:0x24
  340. */
  341. union
  342. {
  343. __IO uint32_t vmhb;
  344. struct
  345. {
  346. __IO uint32_t vmhb : 12; /* [11:0] */
  347. __IO uint32_t reserved1 : 20; /* [31:12] */
  348. } vmhb_bit;
  349. };
  350. /**
  351. * @brief adc vmlb register, offset:0x28
  352. */
  353. union
  354. {
  355. __IO uint32_t vmlb;
  356. struct
  357. {
  358. __IO uint32_t vmlb : 12; /* [11:0] */
  359. __IO uint32_t reserved1 : 20; /* [31:12] */
  360. } vmlb_bit;
  361. };
  362. /**
  363. * @brief adc osq1 register, offset:0x2C
  364. */
  365. union
  366. {
  367. __IO uint32_t osq1;
  368. struct
  369. {
  370. __IO uint32_t osn13 : 5; /* [4:0] */
  371. __IO uint32_t osn14 : 5; /* [9:5] */
  372. __IO uint32_t osn15 : 5; /* [14:10] */
  373. __IO uint32_t osn16 : 5; /* [19:15] */
  374. __IO uint32_t oclen : 4; /* [23:20] */
  375. __IO uint32_t reserved1 : 8; /* [31:24] */
  376. } osq1_bit;
  377. };
  378. /**
  379. * @brief adc osq2 register, offset:0x30
  380. */
  381. union
  382. {
  383. __IO uint32_t osq2;
  384. struct
  385. {
  386. __IO uint32_t osn7 : 5; /* [4:0] */
  387. __IO uint32_t osn8 : 5; /* [9:5] */
  388. __IO uint32_t osn9 : 5; /* [14:10] */
  389. __IO uint32_t osn10 : 5; /* [19:15] */
  390. __IO uint32_t osn11 : 5; /* [24:20] */
  391. __IO uint32_t osn12 : 5; /* [29:25] */
  392. __IO uint32_t reserved1 : 2; /* [31:30] */
  393. } osq2_bit;
  394. };
  395. /**
  396. * @brief adc osq3 register, offset:0x34
  397. */
  398. union
  399. {
  400. __IO uint32_t osq3;
  401. struct
  402. {
  403. __IO uint32_t osn1 : 5; /* [4:0] */
  404. __IO uint32_t osn2 : 5; /* [9:5] */
  405. __IO uint32_t osn3 : 5; /* [14:10] */
  406. __IO uint32_t osn4 : 5; /* [19:15] */
  407. __IO uint32_t osn5 : 5; /* [24:20] */
  408. __IO uint32_t osn6 : 5; /* [29:25] */
  409. __IO uint32_t reserved1 : 2; /* [31:30] */
  410. } osq3_bit;
  411. };
  412. /**
  413. * @brief adc psq register, offset:0x38
  414. */
  415. union
  416. {
  417. __IO uint32_t psq;
  418. struct
  419. {
  420. __IO uint32_t psn1 : 5; /* [4:0] */
  421. __IO uint32_t psn2 : 5; /* [9:5] */
  422. __IO uint32_t psn3 : 5; /* [14:10] */
  423. __IO uint32_t psn4 : 5; /* [19:15] */
  424. __IO uint32_t pclen : 2; /* [21:20] */
  425. __IO uint32_t reserved1 : 10;/* [31:22] */
  426. } psq_bit;
  427. };
  428. /**
  429. * @brief adc pdt1 register, offset:0x3C
  430. */
  431. union
  432. {
  433. __IO uint32_t pdt1;
  434. struct
  435. {
  436. __IO uint32_t pdt1 : 16; /* [15:0] */
  437. __IO uint32_t reserved1 : 16; /* [31:16] */
  438. } pdt1_bit;
  439. };
  440. /**
  441. * @brief adc pdt2 register, offset:0x40
  442. */
  443. union
  444. {
  445. __IO uint32_t pdt2;
  446. struct
  447. {
  448. __IO uint32_t pdt2 : 16; /* [15:0] */
  449. __IO uint32_t reserved1 : 16; /* [31:16] */
  450. } pdt2_bit;
  451. };
  452. /**
  453. * @brief adc pdt3 register, offset:0x44
  454. */
  455. union
  456. {
  457. __IO uint32_t pdt3;
  458. struct
  459. {
  460. __IO uint32_t pdt3 : 16; /* [15:0] */
  461. __IO uint32_t reserved1 : 16; /* [31:16] */
  462. } pdt3_bit;
  463. };
  464. /**
  465. * @brief adc pdt4 register, offset:0x48
  466. */
  467. union
  468. {
  469. __IO uint32_t pdt4;
  470. struct
  471. {
  472. __IO uint32_t pdt4 : 16; /* [15:0] */
  473. __IO uint32_t reserved1 : 16; /* [31:16] */
  474. } pdt4_bit;
  475. };
  476. /**
  477. * @brief adc odt register, offset:0x4C
  478. */
  479. union
  480. {
  481. __IO uint32_t odt;
  482. struct
  483. {
  484. __IO uint32_t odt : 16; /* [15:0] */
  485. __IO uint32_t reserved1 : 16; /* [31:16] */
  486. } odt_bit;
  487. };
  488. } adc_type;
  489. /**
  490. * @}
  491. */
  492. #define ADC1 ((adc_type *) ADC1_BASE)
  493. /** @defgroup ADC_exported_functions
  494. * @{
  495. */
  496. void adc_reset(adc_type *adc_x);
  497. void adc_enable(adc_type *adc_x, confirm_state new_state);
  498. void adc_base_default_para_init(adc_base_config_type *adc_base_struct);
  499. void adc_base_config(adc_type *adc_x, adc_base_config_type *adc_base_struct);
  500. void adc_dma_mode_enable(adc_type *adc_x, confirm_state new_state);
  501. void adc_interrupt_enable(adc_type *adc_x, uint32_t adc_int, confirm_state new_state);
  502. void adc_calibration_init(adc_type *adc_x);
  503. flag_status adc_calibration_init_status_get(adc_type *adc_x);
  504. void adc_calibration_start(adc_type *adc_x);
  505. flag_status adc_calibration_status_get(adc_type *adc_x);
  506. void adc_voltage_monitor_enable(adc_type *adc_x, adc_voltage_monitoring_type adc_voltage_monitoring);
  507. void adc_voltage_monitor_threshold_value_set(adc_type *adc_x, uint16_t adc_high_threshold, uint16_t adc_low_threshold);
  508. void adc_voltage_monitor_single_channel_select(adc_type *adc_x, adc_channel_select_type adc_channel);
  509. void adc_ordinary_channel_set(adc_type *adc_x, adc_channel_select_type adc_channel, uint8_t adc_sequence, adc_sampletime_select_type adc_sampletime);
  510. void adc_preempt_channel_length_set(adc_type *adc_x, uint8_t adc_channel_lenght);
  511. void adc_preempt_channel_set(adc_type *adc_x, adc_channel_select_type adc_channel, uint8_t adc_sequence, adc_sampletime_select_type adc_sampletime);
  512. void adc_ordinary_conversion_trigger_set(adc_type *adc_x, adc_ordinary_trig_select_type adc_ordinary_trig, confirm_state new_state);
  513. void adc_preempt_conversion_trigger_set(adc_type *adc_x, adc_preempt_trig_select_type adc_preempt_trig, confirm_state new_state);
  514. void adc_preempt_offset_value_set(adc_type *adc_x, adc_preempt_channel_type adc_preempt_channel, uint16_t adc_offset_value);
  515. void adc_ordinary_part_count_set(adc_type *adc_x, uint8_t adc_channel_count);
  516. void adc_ordinary_part_mode_enable(adc_type *adc_x, confirm_state new_state);
  517. void adc_preempt_part_mode_enable(adc_type *adc_x, confirm_state new_state);
  518. void adc_preempt_auto_mode_enable(adc_type *adc_x, confirm_state new_state);
  519. void adc_tempersensor_vintrv_enable(confirm_state new_state);
  520. void adc_ordinary_software_trigger_enable(adc_type *adc_x, confirm_state new_state);
  521. flag_status adc_ordinary_software_trigger_status_get(adc_type *adc_x);
  522. void adc_preempt_software_trigger_enable(adc_type *adc_x, confirm_state new_state);
  523. flag_status adc_preempt_software_trigger_status_get(adc_type *adc_x);
  524. uint16_t adc_ordinary_conversion_data_get(adc_type *adc_x);
  525. uint16_t adc_preempt_conversion_data_get(adc_type *adc_x, adc_preempt_channel_type adc_preempt_channel);
  526. flag_status adc_flag_get(adc_type *adc_x, uint8_t adc_flag);
  527. void adc_flag_clear(adc_type *adc_x, uint32_t adc_flag);
  528. /**
  529. * @}
  530. */
  531. /**
  532. * @}
  533. */
  534. /**
  535. * @}
  536. */
  537. #ifdef __cplusplus
  538. }
  539. #endif
  540. #endif