1
0

hpm_pcfg_drv.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639
  1. /*
  2. * Copyright (c) 2021 HPMicro
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. *
  6. */
  7. #ifndef HPM_PCFG_DRV_H
  8. #define HPM_PCFG_DRV_H
  9. #include "hpm_common.h"
  10. #include "hpm_pcfg_regs.h"
  11. /**
  12. *
  13. * @brief PCFG driver APIs
  14. * @defgroup pcfg_interface PCFG driver APIs
  15. * @ingroup io_interfaces
  16. * @{
  17. */
  18. #define PCFG_CLOCK_GATE_MODE_ALWAYS_ON (0x3UL)
  19. #define PCFG_CLOCK_GATE_MODE_ALWAYS_OFF (0x2UL)
  20. #define PCFG_CLOCK_GATE_MODE_ALWAYS_FOLLOW_FLOW (0x1UL)
  21. #define PCFG_PERIPH_KEEP_CLOCK_ON(p) (PCFG_CLOCK_GATE_MODE_ALWAYS_ON << (p))
  22. #define PCFG_PERIPH_KEEP_CLOCK_OFF(p) (PCFG_CLOCK_GATE_MODE_ALWAYS_OFF << (p))
  23. #define PCFG_PERIPH_SET_CLOCK_AUTO(p) (PCFG_CLOCK_GATE_MODE_ALWAYS_FOLLOW_FLOW << (p))
  24. /* @brief PCFG irc24m reference */
  25. typedef enum {
  26. pcfg_irc24m_reference_32k = 0,
  27. pcfg_irc24m_reference_24m_xtal = 1
  28. } pcfg_irc24m_reference_t;
  29. /* @brief PCFG dcdc current limit */
  30. typedef enum {
  31. pcfg_dcdc_lp_current_limit_250ma = 0,
  32. pcfg_dcdc_lp_current_limit_200ma = 1,
  33. } pcfg_dcdc_lp_current_limit_t;
  34. /* @brief PCFG dcdc current hys */
  35. typedef enum {
  36. pcfg_dcdc_current_hys_12_5mv = 0,
  37. pcfg_dcdc_current_hys_25mv = 1,
  38. } pcfg_dcdc_current_hys_t;
  39. /* @brief PCFG dcdc mode */
  40. typedef enum {
  41. pcfg_dcdc_mode_off = 0,
  42. pcfg_dcdc_mode_basic = 1,
  43. pcfg_dcdc_mode_general = 3,
  44. pcfg_dcdc_mode_expert = 7,
  45. } pcfg_dcdc_mode_t;
  46. /* @brief PCFG pmc domain peripherals */
  47. typedef enum {
  48. pcfg_pmc_periph_fuse = 0,
  49. pcfg_pmc_periph_ram = 2,
  50. pcfg_pmc_periph_vad = 4,
  51. pcfg_pmc_periph_gpio = 6,
  52. pcfg_pmc_periph_ioc = 8,
  53. pcfg_pmc_periph_timer = 10,
  54. pcfg_pmc_periph_wdog = 12,
  55. pcfg_pmc_periph_uart = 14,
  56. pcfg_pmc_periph_debug = 16,
  57. } pcfg_pmc_periph_t;
  58. /* @brief PCFG status */
  59. enum {
  60. status_pcfg_ldo_out_of_range = MAKE_STATUS(status_group_pcfg, 1),
  61. };
  62. /* @brief PCFG irc24m config */
  63. typedef struct {
  64. uint32_t freq_in_hz;
  65. pcfg_irc24m_reference_t reference;
  66. bool return_to_default_on_xtal_loss;
  67. bool free_run;
  68. } pcfg_irc24m_config_t;
  69. #define PCFG_CLOCK_GATE_CONTROL_MASK(module, mode) \
  70. ((uint32_t) (mode) << ((module) << 1))
  71. #define PCFG_DEBUG_STOP_SOURCE_ENABLE_CORE0 (PCFG_DEBUG_STOP_CPU0_MASK)
  72. #define PCFG_DEBUG_STOP_SOURCE_DISABLE_CORE0 (0)
  73. #define PCFG_DEBUG_STOP_SOURCE_ENABLE_CORE1 (PCFG_DEBUG_STOP_CPU1_MASK)
  74. #define PCFG_DEBUG_STOP_SOURCE_DISABLE_CORE1 (0)
  75. #ifdef __cplusplus
  76. extern "C" {
  77. #endif
  78. /**
  79. * @brief bandgap disable power save mode
  80. *
  81. * @param[in] ptr base address
  82. */
  83. static inline void pcfg_bandgap_disable_power_save_mode(PCFG_Type *ptr)
  84. {
  85. ptr->BANDGAP &= ~PCFG_BANDGAP_POWER_SAVE_MASK;
  86. }
  87. /**
  88. * @brief bandgap enable power save mode
  89. *
  90. * @param[in] ptr base address
  91. */
  92. static inline void pcfg_bandgap_enable_power_save_mode(PCFG_Type *ptr)
  93. {
  94. ptr->BANDGAP |= PCFG_BANDGAP_POWER_SAVE_MASK;
  95. }
  96. /**
  97. * @brief bandgap disable power save mode
  98. *
  99. * @param[in] ptr base address
  100. */
  101. static inline void pcfg_bandgap_disable_lowpower_mode(PCFG_Type *ptr)
  102. {
  103. ptr->BANDGAP &= ~PCFG_BANDGAP_LOWPOWER_MODE_MASK;
  104. }
  105. /**
  106. * @brief bandgap enable low power mode
  107. *
  108. * @param[in] ptr base address
  109. */
  110. static inline void pcfg_bandgap_enable_lowpower_mode(PCFG_Type *ptr)
  111. {
  112. ptr->BANDGAP |= PCFG_BANDGAP_LOWPOWER_MODE_MASK;
  113. }
  114. /**
  115. * @brief check if bandgap is trimmed or not
  116. *
  117. * @param[in] ptr base address
  118. *
  119. * @retval true if bandgap is trimmed
  120. */
  121. static inline bool pcfg_bandgap_is_trimmed(PCFG_Type *ptr)
  122. {
  123. return ptr->BANDGAP & PCFG_BANDGAP_VBG_TRIMMED_MASK;
  124. }
  125. /**
  126. * @brief bandgap reload trim value
  127. *
  128. * @param[in] ptr base address
  129. */
  130. static inline void pcfg_bandgap_reload_trim(PCFG_Type *ptr)
  131. {
  132. ptr->BANDGAP &= ~PCFG_BANDGAP_VBG_TRIMMED_MASK;
  133. }
  134. /**
  135. * @brief turn off LDO 1V
  136. *
  137. * @param[in] ptr base address
  138. */
  139. static inline void pcfg_ldo1p1_turn_off(PCFG_Type *ptr)
  140. {
  141. ptr->LDO1P1 &= ~PCFG_LDO1P1_ENABLE_MASK;
  142. }
  143. /**
  144. * @brief turn of LDO 1V
  145. *
  146. * @param[in] ptr base address
  147. */
  148. static inline void pcfg_ldo1p1_turn_on(PCFG_Type *ptr)
  149. {
  150. ptr->LDO1P1 |= PCFG_LDO1P1_ENABLE_MASK;
  151. }
  152. /**
  153. * @brief turn off LDO2P5
  154. *
  155. * @param[in] ptr base address
  156. */
  157. static inline void pcfg_ldo2p5_turn_off(PCFG_Type *ptr)
  158. {
  159. ptr->LDO2P5 &= ~PCFG_LDO2P5_ENABLE_MASK;
  160. }
  161. /**
  162. * @brief turn on LDO 2.5V
  163. *
  164. * @param[in] ptr base address
  165. */
  166. static inline void pcfg_ldo2p5_turn_on(PCFG_Type *ptr)
  167. {
  168. ptr->LDO2P5 |= PCFG_LDO2P5_ENABLE_MASK;
  169. }
  170. /**
  171. * @brief check if LDO 2.5V is stable
  172. *
  173. * @param[in] ptr base address
  174. *
  175. * @retval true if LDO2P5 is stable
  176. */
  177. static inline bool pcfg_ldo2p5_is_stable(PCFG_Type *ptr)
  178. {
  179. return PCFG_LDO2P5_READY_GET(ptr->LDO2P5);
  180. }
  181. /*
  182. * @brief check if DCDC is stable or not
  183. * @param[in] ptr base address
  184. * @retval true if DCDC is stable
  185. */
  186. static inline bool pcfg_dcdc_is_stable(PCFG_Type *ptr)
  187. {
  188. return PCFG_DCDC_MODE_READY_GET(ptr->DCDC_MODE);
  189. }
  190. /*
  191. * @brief set DCDC work mode
  192. * @param[in] ptr base address
  193. */
  194. static inline void pcfg_dcdc_set_mode(PCFG_Type *ptr, uint8_t mode)
  195. {
  196. ptr->DCDC_MODE = (ptr->DCDC_MODE & ~PCFG_DCDC_MODE_MODE_MASK) | PCFG_DCDC_MODE_MODE_SET(mode);
  197. }
  198. /**
  199. * @brief set low power current limit
  200. *
  201. * @param[in] ptr base address
  202. * @param[in] limit current limit at low power mode
  203. * @param[in] over_limit set to true means current is greater than limit
  204. */
  205. static inline void pcfg_dcdc_set_lp_current_limit(PCFG_Type *ptr, pcfg_dcdc_lp_current_limit_t limit, bool over_limit)
  206. {
  207. ptr->DCDC_PROT = (ptr->DCDC_PROT & ~(PCFG_DCDC_PROT_ILIMIT_LP_MASK | PCFG_DCDC_PROT_OVERLOAD_LP_MASK))
  208. | PCFG_DCDC_PROT_ILIMIT_LP_SET(limit) | PCFG_DCDC_PROT_OVERLOAD_LP_SET(over_limit);
  209. }
  210. /**
  211. * @brief disable power loss protection
  212. *
  213. * @param[in] ptr base address
  214. */
  215. static inline void pcfg_dcdc_disable_power_loss_prot(PCFG_Type *ptr)
  216. {
  217. ptr->DCDC_PROT |= PCFG_DCDC_PROT_DISABLE_POWER_LOSS_MASK;
  218. }
  219. /**
  220. * @brief enable power loss protection
  221. *
  222. * @param[in] ptr base address
  223. */
  224. static inline void pcfg_dcdc_enable_power_loss_prot(PCFG_Type *ptr)
  225. {
  226. ptr->DCDC_PROT &= ~PCFG_DCDC_PROT_DISABLE_POWER_LOSS_MASK;
  227. }
  228. /**
  229. * @brief check if power loss flag is set
  230. *
  231. * @param[in] ptr base address
  232. *
  233. * @retval true if power loss is set
  234. */
  235. static inline bool pcfg_dcdc_is_power_loss(PCFG_Type *ptr)
  236. {
  237. return PCFG_DCDC_PROT_POWER_LOSS_FLAG_GET(ptr->DCDC_PROT);
  238. }
  239. /**
  240. * @brief disable over voltage protection
  241. *
  242. * @param[in] ptr base address
  243. */
  244. static inline void pcfg_dcdc_disable_over_voltage_prot(PCFG_Type *ptr)
  245. {
  246. ptr->DCDC_PROT |= PCFG_DCDC_PROT_DISABLE_OVERVOLTAGE_MASK;
  247. }
  248. /**
  249. * @brief enable over voltage protection
  250. *
  251. * @param[in] ptr base address
  252. */
  253. static inline void pcfg_dcdc_ensable_over_voltage_prot(PCFG_Type *ptr)
  254. {
  255. ptr->DCDC_PROT &= ~PCFG_DCDC_PROT_DISABLE_OVERVOLTAGE_MASK;
  256. }
  257. /**
  258. * @brief checkover voltage flag
  259. *
  260. * @param[in] ptr base address
  261. * @retval true if flag is set
  262. */
  263. static inline bool pcfg_dcdc_is_over_voltage(PCFG_Type *ptr)
  264. {
  265. return PCFG_DCDC_PROT_OVERVOLT_FLAG_GET(ptr->DCDC_PROT) & PCFG_DCDC_PROT_OVERVOLT_FLAG_MASK;
  266. }
  267. /**
  268. * @brief disable current measurement
  269. *
  270. * @param[in] ptr base address
  271. */
  272. static inline void pcfg_dcdc_disable_measure_current(PCFG_Type *ptr)
  273. {
  274. ptr->DCDC_CURRENT &= ~PCFG_DCDC_CURRENT_ESTI_EN_MASK;
  275. }
  276. /**
  277. * @brief enable current measurement
  278. *
  279. * @param[in] ptr base address
  280. */
  281. static inline void pcfg_dcdc_enable_measure_current(PCFG_Type *ptr)
  282. {
  283. ptr->DCDC_CURRENT |= PCFG_DCDC_CURRENT_ESTI_EN_MASK;
  284. }
  285. /**
  286. * @brief check if measured current is valid
  287. *
  288. * @param[in] ptr base address
  289. *
  290. * @retval true if measured current is valid
  291. */
  292. static inline bool pcfg_dcdc_is_measure_current_valid(PCFG_Type *ptr)
  293. {
  294. return ptr->DCDC_CURRENT & PCFG_DCDC_CURRENT_VALID_MASK;
  295. }
  296. /**
  297. * @brief get DCDC start time in number of 24MHz clock cycles
  298. *
  299. * @param[in] ptr base address
  300. *
  301. * @retval dcdc start time in cycles
  302. */
  303. static inline uint32_t pcfg_dcdc_get_start_time_in_cycle(PCFG_Type *ptr)
  304. {
  305. return PCFG_DCDC_START_TIME_START_TIME_GET(ptr->DCDC_START_TIME);
  306. }
  307. /**
  308. * @brief get DCDC resume time in number of 24MHz clock cycles
  309. *
  310. * @param[in] ptr base address
  311. *
  312. * @retval dcdc resuem time in cycles
  313. */
  314. static inline uint32_t pcfg_dcdc_get_resume_time_in_cycle(PCFG_Type *ptr)
  315. {
  316. return PCFG_DCDC_RESUME_TIME_RESUME_TIME_GET(ptr->DCDC_RESUME_TIME);
  317. }
  318. /**
  319. * @brief set DCDC start time in 24MHz clock cycles
  320. *
  321. * @param[in] ptr base address
  322. * @param[in] cycles start time in cycles
  323. */
  324. static inline void pcfg_dcdc_set_start_time_in_cycle(PCFG_Type *ptr, uint32_t cycles)
  325. {
  326. ptr->DCDC_START_TIME = PCFG_DCDC_START_TIME_START_TIME_SET(cycles);
  327. }
  328. /**
  329. * @brief set DCDC resuem time in 24MHz clock cycles
  330. *
  331. * @param[in] ptr base address
  332. * @param[in] cycles resume time in cycles
  333. */
  334. static inline void pcfg_dcdc_set_resume_time_in_cycle(PCFG_Type *ptr, uint32_t cycles)
  335. {
  336. ptr->DCDC_RESUME_TIME = PCFG_DCDC_RESUME_TIME_RESUME_TIME_SET(cycles);
  337. }
  338. /**
  339. * @brief set dcdc current hysteres range
  340. *
  341. * @param[in] ptr base address
  342. * @param[in] range current hysteres range
  343. */
  344. static inline void pcfg_dcdc_set_current_hys_range(PCFG_Type *ptr, pcfg_dcdc_current_hys_t range)
  345. {
  346. ptr->DCDC_MISC = (ptr->DCDC_MISC & (~PCFG_DCDC_MISC_OL_HYST_MASK)) | PCFG_DCDC_MISC_OL_HYST_SET(range);
  347. }
  348. /**
  349. * @brief disable power trap
  350. *
  351. * @param[in] ptr base address
  352. */
  353. static inline void pcfg_disable_power_trap(PCFG_Type *ptr)
  354. {
  355. ptr->POWER_TRAP &= ~PCFG_POWER_TRAP_TRAP_MASK;
  356. }
  357. /**
  358. * @brief enable power trap
  359. *
  360. * @param[in] ptr base address
  361. */
  362. static inline void pcfg_enable_power_trap(PCFG_Type *ptr)
  363. {
  364. ptr->POWER_TRAP |= PCFG_POWER_TRAP_TRAP_MASK;
  365. }
  366. /**
  367. * @brief check if power trap is triggered
  368. *
  369. * @param[in] ptr base address
  370. *
  371. * @retval true if power trap is triggered
  372. */
  373. static inline bool pcfg_is_power_trap_triggered(PCFG_Type *ptr)
  374. {
  375. return ptr->POWER_TRAP & PCFG_POWER_TRAP_TRIGGERED_MASK;
  376. }
  377. /**
  378. * @brief clear power trap trigger flag
  379. *
  380. * @param[in] ptr base address
  381. */
  382. static inline void pcfg_clear_power_trap_trigger_flag(PCFG_Type *ptr)
  383. {
  384. ptr->POWER_TRAP |= PCFG_POWER_TRAP_TRIGGERED_MASK;
  385. }
  386. /**
  387. * @brief disable dcdc retention
  388. *
  389. * @param[in] ptr base address
  390. */
  391. static inline void pcfg_disable_dcdc_retention(PCFG_Type *ptr)
  392. {
  393. ptr->POWER_TRAP &= ~PCFG_POWER_TRAP_RETENTION_MASK;
  394. }
  395. /**
  396. * @brief enable dcdc retention to retain soc sram data
  397. *
  398. * @param[in] ptr base address
  399. */
  400. static inline void pcfg_enable_dcdc_retention(PCFG_Type *ptr)
  401. {
  402. ptr->POWER_TRAP |= PCFG_POWER_TRAP_RETENTION_MASK;
  403. }
  404. /**
  405. * @brief clear wakeup cause flag
  406. *
  407. * @param[in] ptr base address
  408. * @param[in] mask mask of flags to be cleared
  409. */
  410. static inline void pcfg_clear_wakeup_cause(PCFG_Type *ptr, uint32_t mask)
  411. {
  412. ptr->WAKE_CAUSE |= mask;
  413. }
  414. /**
  415. * @brief get wakeup cause
  416. *
  417. * @param[in] ptr base address
  418. *
  419. * @retval mask of wake cause
  420. */
  421. static inline uint32_t pcfg_get_wakeup_cause(PCFG_Type *ptr)
  422. {
  423. return ptr->WAKE_CAUSE;
  424. }
  425. /**
  426. * @brief enable wakeup source
  427. *
  428. * @param[in] ptr base address
  429. * @param[in] mask wakeup source mask
  430. */
  431. static inline void pcfg_enable_wakeup_source(PCFG_Type *ptr, uint32_t mask)
  432. {
  433. ptr->WAKE_MASK &= ~mask;
  434. }
  435. /**
  436. * @brief disable wakeup source
  437. *
  438. * @param[in] ptr base address
  439. * @param[in] mask source to be disabled as wakeup source
  440. */
  441. static inline void pcfg_disable_wakeup_source(PCFG_Type *ptr, uint32_t mask)
  442. {
  443. ptr->WAKE_MASK |= mask;
  444. }
  445. /**
  446. * @brief set clock gate mode in vpmc domain
  447. *
  448. * @param[in] ptr base address
  449. * @param[in] mode clock gate mode mask
  450. */
  451. static inline void pcfg_set_periph_clock_mode(PCFG_Type *ptr, uint32_t mode)
  452. {
  453. ptr->SCG_CTRL = mode;
  454. }
  455. /**
  456. * @brief Disable CPU0 debug stop notficiation to peripherals
  457. *
  458. * @param[in] ptr
  459. */
  460. static inline void pcfg_disable_cpu0_debug_stop_notfication(PCFG_Type *ptr)
  461. {
  462. ptr->DEBUG_STOP &= ~PCFG_DEBUG_STOP_CPU0_MASK;
  463. }
  464. /**
  465. * @brief Enable CPU0 debug stop notification to peripherals
  466. *
  467. * @param[in] ptr
  468. */
  469. static inline void pcfg_enable_cpu0_debug_stop_notfication(PCFG_Type *ptr)
  470. {
  471. ptr->DEBUG_STOP |= PCFG_DEBUG_STOP_CPU0_MASK;
  472. }
  473. /**
  474. * @brief Disable CPU1 debug stop notification to peripherals
  475. *
  476. * @param[in] ptr
  477. */
  478. static inline void pcfg_disable_cpu1_debug_stop_notfication(PCFG_Type *ptr)
  479. {
  480. ptr->DEBUG_STOP &= ~PCFG_DEBUG_STOP_CPU1_MASK;
  481. }
  482. /**
  483. * @brief Enable CPU1 debug stop notification to peripherals
  484. *
  485. * @param[in] ptr
  486. */
  487. static inline void pcfg_enable_cpu1_debug_stop_notfication(PCFG_Type *ptr)
  488. {
  489. ptr->DEBUG_STOP |= PCFG_DEBUG_STOP_CPU1_MASK;
  490. }
  491. /**
  492. * @brief Configure CPU core debug stop notification to peripherals
  493. *
  494. * @param[in] ptr
  495. * @param[in] mask
  496. */
  497. static inline void pcfg_config_debug_stop_notification(PCFG_Type *ptr, uint8_t mask)
  498. {
  499. ptr->DEBUG_STOP = mask;
  500. }
  501. /**
  502. * @brief check if irc24m is trimmed
  503. *
  504. * @param[in] ptr base address
  505. *
  506. * @retval true if it is trimmed
  507. */
  508. static inline bool pcfg_irc24m_is_trimmed(PCFG_Type *ptr)
  509. {
  510. return ptr->RC24M & PCFG_RC24M_RC_TRIMMED_MASK;
  511. }
  512. /**
  513. * @brief reload irc24m trim value
  514. *
  515. * @param[in] ptr base address
  516. */
  517. static inline void pcfg_irc24m_reload_trim(PCFG_Type *ptr)
  518. {
  519. ptr->RC24M &= ~PCFG_RC24M_RC_TRIMMED_MASK;
  520. }
  521. /**
  522. * @brief config irc24m track
  523. *
  524. * @param[in] ptr base address
  525. * @param[in] config config data
  526. */
  527. void pcfg_irc24m_config_track(PCFG_Type *ptr, pcfg_irc24m_config_t *config);
  528. /*
  529. * @brief set DCDC voltage at standby mode
  530. * @param[in] ptr base address
  531. * @param[in] mv target voltage
  532. * @retval status_success if successfully configured
  533. */
  534. hpm_stat_t pcfg_dcdc_set_lpmode_voltage(PCFG_Type *ptr, uint16_t mv);
  535. /*
  536. * @brief set output voltage of LDO 2.5V in mV
  537. * @param[in] ptr base address
  538. * @param[in] mv target voltage
  539. * @retval status_success if successfully configured
  540. */
  541. hpm_stat_t pcfg_ldo2p5_set_voltage(PCFG_Type *ptr, uint16_t mv);
  542. /*
  543. * @brief set DCDC voltage
  544. * @param[in] ptr base address
  545. * @param[in] mv target voltage
  546. * @retval status_success if successfully configured
  547. */
  548. hpm_stat_t pcfg_dcdc_set_voltage(PCFG_Type *ptr, uint16_t mv);
  549. /*
  550. * @brief set output voltage of LDO 1V in mV
  551. * @param[in] ptr base address
  552. * @param[in] mv target voltage
  553. * @retval status_success if successfully configured
  554. */
  555. hpm_stat_t pcfg_ldo1p1_set_voltage(PCFG_Type *ptr, uint16_t mv);
  556. /*
  557. * @brief get current DCDC current level in mA
  558. *
  559. * @param[in] ptr base address
  560. * @retval Current level at mA
  561. */
  562. uint16_t pcfg_dcdc_get_current_level(PCFG_Type *ptr);
  563. #ifdef __cplusplus
  564. }
  565. #endif
  566. /**
  567. * @}
  568. */
  569. #endif /* HPM_PCFG_DRV_H */