hc32_ll_cmp.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482
  1. /**
  2. *******************************************************************************
  3. * @file hc32_ll_cmp.h
  4. * @brief Head file for CMP module.
  5. *
  6. @verbatim
  7. Change Logs:
  8. Date Author Notes
  9. 2022-12-31 CDT First version
  10. @endverbatim
  11. *******************************************************************************
  12. * Copyright (C) 2022, Xiaohua Semiconductor Co., Ltd. All rights reserved.
  13. *
  14. * This software component is licensed by XHSC under BSD 3-Clause license
  15. * (the "License"); You may not use this file except in compliance with the
  16. * License. You may obtain a copy of the License at:
  17. * opensource.org/licenses/BSD-3-Clause
  18. *
  19. *******************************************************************************
  20. */
  21. #ifndef __HC32_LL_CMP_H__
  22. #define __HC32_LL_CMP_H__
  23. /* C binding of definitions if building with C++ compiler */
  24. #ifdef __cplusplus
  25. extern "C"
  26. {
  27. #endif
  28. /*******************************************************************************
  29. * Include files
  30. ******************************************************************************/
  31. #include "hc32_ll_def.h"
  32. #include "hc32f4xx.h"
  33. #include "hc32f4xx_conf.h"
  34. /**
  35. * @addtogroup LL_Driver
  36. * @{
  37. */
  38. /**
  39. * @addtogroup LL_CMP
  40. * @{
  41. */
  42. #if (LL_CMP_ENABLE == DDL_ON)
  43. /*******************************************************************************
  44. * Global type definitions ('typedef')
  45. ******************************************************************************/
  46. /**
  47. * @defgroup CMP_Global_Types CMP Global Types
  48. * @{
  49. */
  50. /**
  51. * @brief CMP normal mode configuration structure
  52. */
  53. typedef struct {
  54. uint16_t u16PositiveInput; /*!< Positive(compare voltage) input @ref CMP_Positive_Input_Select */
  55. uint16_t u16NegativeInput; /*!< Negative(Reference voltage) input @ref CMP_Negative_Input_Select */
  56. uint16_t u16OutPolarity; /*!< Output polarity select, @ref CMP_Out_Polarity_Select */
  57. uint16_t u16OutDetectEdge; /*!< Output detect edge, @ref CMP_Out_Detect_Edge_Select */
  58. uint16_t u16OutFilter; /*!< Output Filter, @ref CMP_Out_Filter */
  59. } stc_cmp_init_t;
  60. /**
  61. * @brief CMP window mode configuration structure
  62. */
  63. typedef struct {
  64. uint16_t u16PositiveInput; /*!< Window mode Positive(compare voltage) input @ref CMP_Window_Positive_Select */
  65. uint16_t u16WinVolLow; /*!< CMP reference low voltage for window mode @ref CMP_Window_Low_Select */
  66. uint16_t u16WinVolHigh; /*!< CMP reference high voltage for window mode @ref CMP_Window_High_Select */
  67. uint16_t u16OutPolarity; /*!< Output polarity select, @ref CMP_Out_Polarity_Select */
  68. uint16_t u16OutDetectEdge; /*!< Output detect edge, @ref CMP_Out_Detect_Edge_Select */
  69. uint16_t u16OutFilter; /*!< Output Filter, @ref CMP_Out_Filter */
  70. } stc_cmp_window_init_t;
  71. /**
  72. * @brief CMP blank window function configuration structure
  73. */
  74. typedef struct {
  75. uint8_t u8Mode; /*!< blank window mode select, @ref CMP_BlankWindow_Mode */
  76. uint16_t u16Src; /*!< blank window source select,
  77. can be any combination of @ref CMP_BlankWindow_Src */
  78. uint16_t u16ValidLevelEdge; /*!< Valid level for blank window level mode @ref CMP_BlankWindow_Valid_Level
  79. Valid edge for blank window edge mode @ref CMP_BlankWindow_Valid_Edge */
  80. uint16_t u16MaskWidth; /*!< Mask width when valid edge occurs for blank window edge mode, which range
  81. from 0~255 */
  82. uint8_t u8OutLevel; /*!< CMP output level when blank window valid @ref CMP_BlankWindow_output_Level */
  83. } stc_cmp_blankwindow_t;
  84. /**
  85. * @brief CMP input scan mode configuration structure
  86. */
  87. typedef struct {
  88. uint16_t u16Mode; /*!< Scan mode @ref CMP_Scan_Mode */
  89. uint16_t u16Src; /*!< Scan input source @ref CMP_Scan_Inm_Inp_Src */
  90. uint16_t u16Stable; /*!< Scan stable time value, range [0x00U ~ 0x3FU],
  91. The CMP stable time = T(CMP clock) x u16Stable,
  92. The stable time is recommended greater than 100nS */
  93. uint16_t u16Period; /*!< Scan period value, range [0x08 ~ 0xFF],
  94. u16Period > (u16Stable + u16OutFilter * 4 + CMP_SCAN_PERIOD_IMME)
  95. u16OutFilter is configurate in CMP_NormalModeInit() function. */
  96. } stc_cmp_scan_config_t;
  97. /**
  98. * @}
  99. */
  100. /*******************************************************************************
  101. * Global pre-processor symbols/macros ('#define')
  102. ******************************************************************************/
  103. /**
  104. * @defgroup CMP_Global_Macros CMP Global Macros
  105. * @{
  106. */
  107. #define VISR_OFFSET (8U)
  108. /**
  109. * @defgroup CMP_Window_Mode_Unit CMP Window Mode Unit
  110. * @{
  111. */
  112. #define CMP_WIN_CMP12 (0x01U)
  113. #define CMP_WIN_CMP34 (0x02U)
  114. /**
  115. * @}
  116. */
  117. /**
  118. * @defgroup CMP_Positive_Input_Select CMP Positive(Compare) Voltage Input
  119. * @{
  120. */
  121. #define CMP_POSITIVE_NONE (0x0U)
  122. /* Positive input select table
  123. CMP1 CMP2 CMP3 CMP4
  124. -------------------------------------
  125. INP1 PA0 PA4 PB0 PA9
  126. INP2 PA1 PA5 PB1 PB1
  127. INP3 PA2 PA6 PC0 PC0
  128. INP4 PA3 PA3 PA4 PA10
  129. */
  130. #define CMP_POSITIVE_INP1 (CMP_PMSR_CVSL_0 >> CMP_PMSR_CVSL_POS)
  131. #define CMP_POSITIVE_INP2 (CMP_PMSR_CVSL_1 >> CMP_PMSR_CVSL_POS)
  132. #define CMP_POSITIVE_INP3 (CMP_PMSR_CVSL_2 >> CMP_PMSR_CVSL_POS)
  133. #define CMP_POSITIVE_INP4 (CMP_PMSR_CVSL_3 >> CMP_PMSR_CVSL_POS)
  134. /**
  135. * @}
  136. */
  137. /**
  138. * @defgroup CMP_Window_Positive_Select CMP Window Mode positive(compare) Voltage
  139. * @{
  140. */
  141. #define CMP_WIN_POSITIVE_NONE (0x0U)
  142. /* Positive input select table for window mode
  143. WIN_CMP12 WIN_CMP34
  144. ----------------------------------------------
  145. INP1 -- --
  146. INP2 -- PB1
  147. INP3 -- PC0
  148. INP4 PA3 --
  149. */
  150. #define CMP_WIN_POSITIVE_INP2 (CMP_PMSR_CVSL_1 >> CMP_PMSR_CVSL_POS)
  151. #define CMP_WIN_POSITIVE_INP3 (CMP_PMSR_CVSL_2 >> CMP_PMSR_CVSL_POS)
  152. #define CMP_WIN_POSITIVE_INP4 (CMP_PMSR_CVSL_3 >> CMP_PMSR_CVSL_POS)
  153. /**
  154. * @}
  155. */
  156. /**
  157. * @defgroup CMP_Scan_Inp_Status CMP Scan Function Positive In INP Source
  158. * @{
  159. */
  160. #define CMP_SCAN_STAT_INM_NONE (0U)
  161. #define CMP_SCAN_STAT_INP1 (1U << CMP_SCMR_CVST_POS)
  162. #define CMP_SCAN_STAT_INP2 (2U << CMP_SCMR_CVST_POS)
  163. #define CMP_SCAN_STAT_INP3 (4U << CMP_SCMR_CVST_POS)
  164. #define CMP_SCAN_STAT_INP4 (8U << CMP_SCMR_CVST_POS)
  165. /**
  166. * @}
  167. */
  168. /**
  169. * @defgroup CMP_Scan_Inm_Status CMP Scan Function Positive In INM Source
  170. * @{
  171. */
  172. #define CMP_SCAN_STAT_NONE (0U)
  173. #define CMP_SCAN_STAT_INM1 (1U << CMP_SCMR_RVST_POS)
  174. #define CMP_SCAN_STAT_INM2 (2U << CMP_SCMR_RVST_POS)
  175. #define CMP_SCAN_STAT_INM3 (4U << CMP_SCMR_RVST_POS)
  176. #define CMP_SCAN_STAT_INM4 (8U << CMP_SCMR_RVST_POS)
  177. /**
  178. * @}
  179. */
  180. /**
  181. * @defgroup CMP_Scan_Inm_Inp_Src CMP Scan Inm or Inp Source
  182. * @{
  183. */
  184. #define CMP_SCAN_SRC_INP1_INM1 (1U)
  185. #define CMP_SCAN_SRC_INP2_INM2 (2U)
  186. #define CMP_SCAN_SRC_INP3_INM3 (4U)
  187. #define CMP_SCAN_SRC_INP4_INM4 (8U)
  188. /**
  189. * @}
  190. */
  191. /**
  192. * @defgroup CMP_Scan_Mode CMP Scan Mode
  193. * @{
  194. */
  195. #define CMP_SCAN_NONE (0U)
  196. #define CMP_SCAN_INP (CMP_MDR_CSMD_1)
  197. #define CMP_SCAN_INM (CMP_MDR_CSMD)
  198. /**
  199. * @}
  200. */
  201. /**
  202. * @defgroup CMP_Negative_Input_Select CMP Negative(Reference) Voltage Input
  203. * @{
  204. */
  205. #define CMP_NEGATIVE_NONE (0x0U)
  206. /* Negative input select table
  207. CMP1 CMP2 CMP3 CMP4
  208. ----------------------------------------------------
  209. INM1 PA7 PA7 PA7 PA7
  210. INM2 PC3 PC4 PC5 PA8
  211. INM3 DAO1 DAO1 DAO1 DAO1
  212. INM4 DAO2 DAO2 DAO2 DAO2
  213. */
  214. #define CMP_NEGATIVE_INM1 (CMP_PMSR_RVSL_0)
  215. #define CMP_NEGATIVE_INM2 (CMP_PMSR_RVSL_1)
  216. #define CMP_NEGATIVE_INM3 (CMP_PMSR_RVSL_2)
  217. #define CMP_NEGATIVE_INM4 (CMP_PMSR_RVSL_3)
  218. /**
  219. * @}
  220. */
  221. /**
  222. * @defgroup CMP_Window_Low_Select CMP Window Mode Window Low Voltage
  223. * @{
  224. */
  225. #define CMP_WIN_LOW_NONE (0x0U)
  226. /* Window mode low voltage select table
  227. WIN_CMP12 IN_CMP34
  228. -------------------------------------
  229. INM1 PA7 PA7
  230. INM2 PC3 PC5
  231. INM3 DAO1 DAO1
  232. INM4 DAO2 DAO2
  233. */
  234. #define CMP_WIN_LOW_INM1 (CMP_PMSR_RVSL_0)
  235. #define CMP_WIN_LOW_INM2 (CMP_PMSR_RVSL_1)
  236. #define CMP_WIN_LOW_INM3 (CMP_PMSR_RVSL_2)
  237. #define CMP_WIN_LOW_INM4 (CMP_PMSR_RVSL_3)
  238. /**
  239. * @}
  240. */
  241. /**
  242. * @defgroup CMP_Window_High_Select CMP Window Mode Window High Voltage
  243. * @{
  244. */
  245. #define CMP_WIN_HIGH_NONE (0x0U)
  246. /* Window mode high voltage select table
  247. WIN_CMP12 WIN_CMP34
  248. ------------------------------------------
  249. INM1 PA7 PA7
  250. INM2 PC4 PA8
  251. INM3 DAO1 DAO1
  252. INM4 DAO2 DAO2
  253. */
  254. #define CMP_WIN_HIGH_INM1 (CMP_PMSR_RVSL_0)
  255. #define CMP_WIN_HIGH_INM2 (CMP_PMSR_RVSL_1)
  256. #define CMP_WIN_HIGH_INM3 (CMP_PMSR_RVSL_2)
  257. #define CMP_WIN_HIGH_INM4 (CMP_PMSR_RVSL_3)
  258. /**
  259. * @}
  260. */
  261. /**
  262. * @defgroup CMP_Out_Polarity_Select CMP Output Polarity
  263. * @{
  264. */
  265. #define CMP_OUT_INVT_OFF (0x0U) /*!< CMP output don't reverse */
  266. #define CMP_OUT_INVT_ON (CMP_OCR_COPS) /*!< CMP output level reverse */
  267. /**
  268. * @}
  269. */
  270. /**
  271. * @defgroup CMP_Out_Detect_Edge_Select CMP Output Detect Edge
  272. * @{
  273. */
  274. #define CMP_DETECT_EDGS_NONE (0U) /*!< Do not detect edge */
  275. #define CMP_DETECT_EDGS_RISING (1U << CMP_FIR_EDGS_POS) /*!< Detect rising edge */
  276. #define CMP_DETECT_EDGS_FALLING (2U << CMP_FIR_EDGS_POS) /*!< Detect falling edge */
  277. #define CMP_DETECT_EDGS_BOTH (3U << CMP_FIR_EDGS_POS) /*!< Detect rising and falling edges */
  278. /**
  279. * @}
  280. */
  281. /**
  282. * @defgroup CMP_Out_Filter CMP Output Filter Configuration
  283. * @{
  284. */
  285. #define CMP_OUT_FILTER_NONE (0U) /*!< Do not filter */
  286. #define CMP_OUT_FILTER_CLK (1U << CMP_FIR_FCKS_POS)
  287. #define CMP_OUT_FILTER_CLK_DIV2 (2U << CMP_FIR_FCKS_POS)
  288. #define CMP_OUT_FILTER_CLK_DIV4 (3U << CMP_FIR_FCKS_POS)
  289. #define CMP_OUT_FILTER_CLK_DIV8 (4U << CMP_FIR_FCKS_POS)
  290. #define CMP_OUT_FILTER_CLK_DIV16 (5U << CMP_FIR_FCKS_POS)
  291. #define CMP_OUT_FILTER_CLK_DIV32 (6U << CMP_FIR_FCKS_POS)
  292. /**
  293. * @}
  294. */
  295. /**
  296. * @defgroup CMP_BlankWindow_Src CMP Output blank window Function Control Signal
  297. * @{
  298. */
  299. /* Blank window PWM source select table
  300. CMP1 CMP2 CMP3 CMP4
  301. ------------------------------------------------------------------------
  302. SRC1 TIMA_1_PWM1 TIMA_3_PWM1 TIMA_1_PWM1 TIMA_2_PWM1
  303. SRC2 TIMA_1_PWM2 TIMA_3_PWM2 TIMA_1_PWM2 TIMA_2_PWM2
  304. SRC3 TIMA_1_PWM3 TIMA_3_PWM3 TIMA_1_PWM3 TIMA_2_PWM3
  305. SRC4 TIMA_2_PWM1 TIMA_4_PWM1 TIMA_3_PWM1 TIMA_4_PWM1
  306. SRC5 TIMA_2_PWM2 TIMA_4_PWM2 TIMA_3_PWM2 TIMA_4_PWM2
  307. SRC6 TIMA_2_PWM3 TIMA_4_PWM3 TIMA_3_PWM3 TIMA_4_PWM3
  308. SRC7 TIM6_1_PWMA TIM6_1_PWMA TIM6_1_PWMB TIM6_1_PWMB
  309. SRC8 TIM6_2_PWMA TIM6_2_PWMA TIM6_2_PWMB TIM6_2_PWMB
  310. SRC9 TIM4_1_OUH TIM4_1_OUH TIM4_2_OUH TIM4_2_OUH
  311. SRC10 TIM4_1_OUL TIM4_1_OUL TIM4_2_OUL TIM4_2_OUL
  312. SRC11 TIM4_1_OVH TIM4_1_OVH TIM4_2_OVH TIM4_2_OVH
  313. SRC12 TIM4_1_OVL TIM4_1_OVL TIM4_2_OVL TIM4_2_OVL
  314. SRC13 TIM4_1_OWH TIM4_1_OWH TIM4_2_OWH TIM4_2_OWH
  315. SRC14 TIM4_1_OWL TIM4_1_OWL TIM4_2_OWL TIM4_2_OWL
  316. SRC15 TIM4_1_OXH TIM4_1_OXH TIM4_2_OXH TIM4_2_OXH
  317. SRC16 TIM4_1_OXL TIM4_1_OXL TIM4_2_OXL TIM4_2_OXL
  318. */
  319. #define CMP_BLANKWIN_SRC1 (CMP_BWSR1_CTWS0)
  320. #define CMP_BLANKWIN_SRC2 (CMP_BWSR1_CTWS1)
  321. #define CMP_BLANKWIN_SRC3 (CMP_BWSR1_CTWS2)
  322. #define CMP_BLANKWIN_SRC4 (CMP_BWSR1_CTWS3)
  323. #define CMP_BLANKWIN_SRC5 (CMP_BWSR1_CTWS4)
  324. #define CMP_BLANKWIN_SRC6 (CMP_BWSR1_CTWS5)
  325. #define CMP_BLANKWIN_SRC7 (CMP_BWSR1_CTWS6)
  326. #define CMP_BLANKWIN_SRC8 (CMP_BWSR1_CTWS7)
  327. #define CMP_BLANKWIN_SRC9 (CMP_BWSR1_CTWS8)
  328. #define CMP_BLANKWIN_SRC10 (CMP_BWSR1_CTWS9)
  329. #define CMP_BLANKWIN_SRC11 (CMP_BWSR1_CTWS10)
  330. #define CMP_BLANKWIN_SRC12 (CMP_BWSR1_CTWS11)
  331. #define CMP_BLANKWIN_SRC13 (CMP_BWSR1_CTWS12)
  332. #define CMP_BLANKWIN_SRC14 (CMP_BWSR1_CTWS13)
  333. #define CMP_BLANKWIN_SRC15 (CMP_BWSR1_CTWS14)
  334. #define CMP_BLANKWIN_SRC16 (CMP_BWSR1_CTWS15)
  335. /**
  336. * @}
  337. */
  338. /**
  339. * @defgroup CMP_BlankWindow_Valid_Level CMP Blank Window Valid Level
  340. * @{
  341. */
  342. #define CMP_BLANKWIN_VALID_LVL_LOW (0U) /*!< Blank window valid level is low */
  343. #define CMP_BLANKWIN_VALID_LVL_HIGH (1U) /*!< Blank window valid level is high */
  344. /**
  345. * @}
  346. */
  347. /**
  348. * @defgroup CMP_BlankWindow_output_Level CMP Output Level When Blank Windows Valid
  349. * @{
  350. */
  351. #define CMP_BLANKWIN_OUTPUT_LVL_LOW (0U) /*!< Output low when blank windows valid */
  352. #define CMP_BLANKWIN_OUTPUT_LVL_HIGH (1U << CMP_OCR_BWOL_POS) /*!< Output high when blank windows valid */
  353. #define CMP_BLANKWIN_OUTPUT_LVL_HOLD (2U << CMP_OCR_BWOL_POS) /*!< Output level hold when blank windows valid */
  354. /**
  355. * @}
  356. */
  357. /**
  358. * @defgroup CMP_BlankWindow_Mode CMP Blank Windows Mode
  359. * @{
  360. */
  361. #define CMP_BLANKWIN_MD_LVL (0U)
  362. #define CMP_BLANKWIN_MD_EDGE (CMP_OCR_BWMD)
  363. /**
  364. * @}
  365. */
  366. /**
  367. * @defgroup CMP_BlankWindow_Valid_Edge CMP Blank Windows valid edge for edge mode
  368. * @{
  369. */
  370. #define CMP_BLANKWIN_VALID_EDGE_NONE (0U) /*!< Blank window valid edge none */
  371. #define CMP_BLANKWIN_VALID_EDGE_RISING (CMP_BWSR2_TWEG_0) /*!< Blank window rising edge valid */
  372. #define CMP_BLANKWIN_VALID_EDGE_FALLING (CMP_BWSR2_TWEG_1) /*!< Blank window falling edge valid */
  373. #define CMP_BLANKWIN_VALID_EDGE_ALL (CMP_BWSR2_TWEG_0 | CMP_BWSR2_TWEG_1) /*!< Blank window all edge valid */
  374. /**
  375. * @}
  376. */
  377. /**
  378. * @}
  379. */
  380. /*******************************************************************************
  381. * Global variable definitions ('extern')
  382. ******************************************************************************/
  383. /*******************************************************************************
  384. Global function prototypes (definition in C source)
  385. ******************************************************************************/
  386. /**
  387. * @addtogroup CMP_Global_Functions
  388. * @{
  389. */
  390. int32_t CMP_StructInit(stc_cmp_init_t *pstcCmpInit);
  391. int32_t CMP_NormalModeInit(CM_CMP_TypeDef *CMPx, const stc_cmp_init_t *pstcCmpInit);
  392. void CMP_DeInit(CM_CMP_TypeDef *CMPx);
  393. void CMP_FuncCmd(CM_CMP_TypeDef *CMPx, en_functional_state_t enNewState);
  394. void CMP_IntCmd(CM_CMP_TypeDef *CMPx, en_functional_state_t enNewState);
  395. void CMP_CompareOutCmd(CM_CMP_TypeDef *CMPx, en_functional_state_t enNewState);
  396. void CMP_PinVcoutCmd(CM_CMP_TypeDef *CMPx, en_functional_state_t enNewState);
  397. en_flag_status_t CMP_GetStatus(const CM_CMP_TypeDef *CMPx);
  398. void CMP_SetOutDetectEdge(CM_CMP_TypeDef *CMPx, uint8_t u8CmpEdges);
  399. void CMP_SetOutFilter(CM_CMP_TypeDef *CMPx, uint8_t u8CmpFilter);
  400. void CMP_SetOutPolarity(CM_CMP_TypeDef *CMPx, uint16_t u16CmpPolarity);
  401. void CMP_SetPositiveInput(CM_CMP_TypeDef *CMPx, uint16_t u16PositiveInput);
  402. void CMP_SetNegativeInput(CM_CMP_TypeDef *CMPx, uint16_t u16NegativeInput);
  403. int32_t CMP_WindowModeInit(uint8_t u8WinCMPx, const stc_cmp_window_init_t *pstcCmpWindowInit);
  404. int32_t CMP_WindowStructInit(stc_cmp_window_init_t *pstcCmpWindowInit);
  405. void CMP_BlankWindowSrcDisable(CM_CMP_TypeDef *CMPx, uint16_t u16BlankWindowSrc);
  406. int32_t CMP_BlankWindowConfig(CM_CMP_TypeDef *CMPx, const stc_cmp_blankwindow_t *pstcBlankWindowConfig);
  407. int32_t CMP_BlankWindowStructInit(stc_cmp_blankwindow_t *pstcBlankWindowConfig);
  408. void CMP_BlankWindowCmd(CM_CMP_TypeDef *CMPx, en_functional_state_t enNewState);
  409. void CMP_BlankWindowMode(CM_CMP_TypeDef *CMPx, uint8_t u8Mode);
  410. uint32_t CMP_GetScanInpSrc(CM_CMP_TypeDef *CMPx);
  411. uint32_t CMP_GetScanInmSrc(CM_CMP_TypeDef *CMPx);
  412. void CMP_ScanSetSrc(CM_CMP_TypeDef *CMPx, uint16_t u16Src);
  413. void CMP_ScanSetMode(CM_CMP_TypeDef *CMPx, uint16_t u16Mode);
  414. int32_t CMP_ScanConfig(CM_CMP_TypeDef *CMPx, stc_cmp_scan_config_t *pstcCmpScanConfig);
  415. int32_t CMP_ScanStructInit(stc_cmp_scan_config_t *pstcCmpScanConfig);
  416. int32_t CMP_ScanTimeConfig(CM_CMP_TypeDef *CMPx, uint16_t u16Stable, uint16_t u16Period);
  417. void CMP_ScanCmd(CM_CMP_TypeDef *CMPx, en_functional_state_t enNewState);
  418. /**
  419. * @}
  420. */
  421. #endif /* LL_CMP_ENABLE */
  422. /**
  423. * @}
  424. */
  425. /**
  426. * @}
  427. */
  428. #ifdef __cplusplus
  429. }
  430. #endif
  431. #endif /* __HC32_LL_CMP_H__ */
  432. /*******************************************************************************
  433. * EOF (not truncated)
  434. ******************************************************************************/