HPM SDK
HPMicro Software Development Kit
hpm_pcfg_drv.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2021 HPMicro
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  *
6  */
7 
8 #ifndef HPM_PCFG_DRV_H
9 #define HPM_PCFG_DRV_H
10 
11 #include "hpm_common.h"
12 #include "hpm_pcfg_regs.h"
13 
21 #define PCFG_CLOCK_GATE_MODE_ALWAYS_ON (0x3UL)
22 #define PCFG_CLOCK_GATE_MODE_ALWAYS_OFF (0x2UL)
23 
24 #define PCFG_PERIPH_KEEP_CLOCK_ON(p) (PCFG_CLOCK_GATE_MODE_ALWAYS_ON << (p))
25 #define PCFG_PERIPH_KEEP_CLOCK_OFF(p) (PCFG_CLOCK_GATE_MODE_ALWAYS_OFF << (p))
26 
27 /* @brief PCFG irc24m reference */
28 typedef enum {
32 
33 /* @brief PCFG dcdc current limit */
34 typedef enum {
38 
39 typedef enum {
43 
44 /* @brief PCFG dcdc current hys */
45 typedef enum {
49 
50 /* @brief PCFG dcdc mode */
51 typedef enum {
57 
58 /* @brief PCFG pmc domain peripherals */
59 typedef enum {
68 
69 /* @brief PCFG status */
70 enum {
72 };
73 
74 /* @brief PCFG irc24m config */
75 typedef struct {
76  uint32_t freq_in_hz;
77  pcfg_irc24m_reference_t reference;
78  bool return_to_default_on_xtal_loss;
79  bool free_run;
81 
82 
83 #define PCFG_CLOCK_GATE_CONTROL_MASK(module, mode) \
84  ((uint32_t) (mode) << ((module) << 1))
85 
86 #ifdef __cplusplus
87 extern "C" {
88 #endif
89 
96 {
98 }
99 
106 {
108 }
109 
116 {
118 }
119 
126 {
128 }
129 
137 static inline bool pcfg_bandgap_is_trimmed(PCFG_Type *ptr)
138 {
140 }
141 
147 static inline void pcfg_bandgap_reload_trim(PCFG_Type *ptr)
148 {
150 }
151 
157 static inline void pcfg_ldo2p5_turn_off(PCFG_Type *ptr)
158 {
160 }
161 
167 static inline void pcfg_ldo2p5_turn_on(PCFG_Type *ptr)
168 {
170 }
171 
179 static inline bool pcfg_ldo2p5_is_stable(PCFG_Type *ptr)
180 {
181  return PCFG_LDO2P5_READY_GET(ptr->LDO2P5);
182 }
183 
184 /*
185  * @brief check if DCDC is stable or not
186  * @param[in] ptr base address
187  * @retval true if DCDC is stable
188  */
189 static inline bool pcfg_dcdc_is_stable(PCFG_Type *ptr)
190 {
191  return PCFG_DCDC_MODE_READY_GET(ptr->DCDC_MODE);
192 }
193 
194 /*
195  * @brief set DCDC work mode
196  * @param[in] ptr base address
197  */
198 static inline void pcfg_dcdc_set_mode(PCFG_Type *ptr, uint8_t mode)
199 {
201 }
202 
210 static inline void pcfg_dcdc_set_lp_current_limit(PCFG_Type *ptr, pcfg_dcdc_lp_current_limit_t limit, bool over_limit)
211 {
212  (void) over_limit;
215 }
216 
223 {
225 }
226 
233 {
235 }
236 
244 static inline bool pcfg_dcdc_is_power_loss(PCFG_Type *ptr)
245 {
247 }
248 
255 {
257 }
258 
265 {
267 }
268 
275 static inline bool pcfg_dcdc_is_over_voltage(PCFG_Type *ptr)
276 {
278 }
279 
286 {
288 }
289 
296 {
298 }
299 
307 {
309 }
310 
317 static inline bool pcfg_dcdc_is_over_current(PCFG_Type *ptr)
318 {
320 }
321 
328 {
330 }
331 
338 {
340 }
341 
350 {
352 }
353 
362 {
364 }
365 
373 static inline uint32_t pcfg_dcdc_get_start_time_in_cycle(PCFG_Type *ptr)
374 {
376 }
377 
385 static inline uint32_t pcfg_dcdc_get_resume_time_in_cycle(PCFG_Type *ptr)
386 {
388 }
389 
396 static inline void pcfg_dcdc_set_start_time_in_cycle(PCFG_Type *ptr, uint32_t cycles)
397 {
399 }
400 
407 static inline void pcfg_dcdc_set_resume_time_in_cycle(PCFG_Type *ptr, uint32_t cycles)
408 {
410 }
411 
419 {
421 }
422 
428 static inline void pcfg_disable_power_trap(PCFG_Type *ptr)
429 {
431 }
432 
438 static inline void pcfg_enable_power_trap(PCFG_Type *ptr)
439 {
441 }
442 
450 static inline bool pcfg_is_power_trap_triggered(PCFG_Type *ptr)
451 {
453 }
454 
461 {
463 }
464 
470 static inline void pcfg_disable_dcdc_retention(PCFG_Type *ptr)
471 {
473 }
474 
480 static inline void pcfg_enable_dcdc_retention(PCFG_Type *ptr)
481 {
483 }
484 
491 static inline void pcfg_clear_wakeup_cause(PCFG_Type *ptr, uint32_t mask)
492 {
493  ptr->WAKE_CAUSE |= mask;
494 }
495 
503 static inline uint32_t pcfg_get_wakeup_cause(PCFG_Type *ptr)
504 {
505  return ptr->WAKE_CAUSE;
506 }
507 
514 static inline void pcfg_enable_wakeup_source(PCFG_Type *ptr, uint32_t mask)
515 {
516  ptr->WAKE_MASK &= ~mask;
517 }
518 
525 static inline void pcfg_disable_wakeup_source(PCFG_Type *ptr, uint32_t mask)
526 {
527  ptr->WAKE_MASK |= mask;
528 }
529 
536 static inline void pcfg_set_periph_clock_mode(PCFG_Type *ptr, uint32_t mode)
537 {
538  ptr->SCG_CTRL = mode;
539 }
540 
541 /*
542  * @brief check if DDR DCDC is stable or not
543  * @param[in] ptr base address
544  * @retval true if DDR DCDC is stable
545  */
546 static inline bool pcfg_ddr_dcdc_is_stable(PCFG_Type *ptr)
547 {
549 }
550 
551 /*
552  * @brief set DDR DCDC work mode
553  * @param[in] ptr base address
554  */
555 static inline void pcfg_ddr_dcdc_set_mode(PCFG_Type *ptr, uint8_t mode)
556 {
558 }
559 
560 
561 /*
562  * @brief set on-chip DDR DCDC enable and voltage
563  * @param[in] ptr base address
564  * @param[in] voltage unit mv
565  */
566 static inline void pcfg_ddr_dcdc_set_voltage_output(PCFG_Type *ptr, uint8_t voltage)
567 {
570 }
571 
579 {
582 }
583 
590 {
592 }
593 
600 {
602 }
603 
611 static inline bool pcfg_ddr_dcdc_is_power_loss(PCFG_Type *ptr)
612 {
614 }
615 
622 {
624 }
625 
632 {
634 }
635 
642 static inline bool pcfg_ddr_dcdc_is_over_voltage(PCFG_Type *ptr)
643 {
645 }
646 
653 {
655 }
656 
663 {
665 }
666 
674 {
676 }
677 
684 static inline bool pcfg_ddr_dcdc_is_over_current(PCFG_Type *ptr)
685 {
687 }
688 
695 {
697 }
698 
705 {
707 }
708 
717 {
719 }
720 
729 {
731 }
732 
741 {
743 }
744 
753 {
755 }
756 
763 static inline void pcfg_ddr_dcdc_set_start_time_in_cycle(PCFG_Type *ptr, uint32_t cycles)
764 {
766 }
767 
774 static inline void pcfg_ddr_dcdc_set_resume_time_in_cycle(PCFG_Type *ptr, uint32_t cycles)
775 {
777 }
778 
786 {
788 }
789 
796 {
798 }
799 
806 {
808 }
809 
817 static inline bool pcfg_irc24m_is_trimmed(PCFG_Type *ptr)
818 {
819  return ptr->RC24M & PCFG_RC24M_RC_TRIMMED_MASK;
820 }
821 
827 static inline void pcfg_irc24m_reload_trim(PCFG_Type *ptr)
828 {
830 }
831 
839 
840 /*
841  * @brief set DCDC voltage at standby mode
842  * @param[in] ptr base address
843  * @param[in] mv target voltage
844  * @retval status_success if successfully configured
845  */
847 
848 /*
849  * @brief set output voltage of LDO 2.5V in mV
850  * @param[in] ptr base address
851  * @param[in] mv target voltage
852  * @retval status_success if successfully configured
853  */
854 hpm_stat_t pcfg_ldo2p5_set_voltage(PCFG_Type *ptr, uint16_t mv);
855 
856 /*
857  * @brief set DCDC voltage
858  * @param[in] ptr base address
859  * @param[in] mv target voltage
860  * @retval status_success if successfully configured
861  */
862 hpm_stat_t pcfg_dcdc_set_voltage(PCFG_Type *ptr, uint16_t mv);
863 
864 /*
865  * @brief set output voltage of LDO 1V in mV
866  * @param[in] ptr base address
867  * @param[in] mv target voltage
868  * @retval status_success if successfully configured
869  */
870 hpm_stat_t pcfg_ldo1p1_set_voltage(PCFG_Type *ptr, uint16_t mv);
871 
872 /*
873  * @brief get current DCDC current level in mA
874  *
875  * @param[in] ptr base address
876  * @retval Current level at mA
877  */
879 
880 
881 #ifdef __cplusplus
882 }
883 #endif
888 #endif /* HPM_PCFG_DRV_H */
#define PCFG_DCDC_RESUME_TIME_RESUME_TIME_GET(x)
Definition: hpm_pcfg_regs.h:592
#define PCFG_LDO2P5_READY_GET(x)
Definition: hpm_pcfg_regs.h:108
#define PCFG_POWER_TRAP_TRIGGERED_MASK
Definition: hpm_pcfg_regs.h:602
#define PCFG_DCDC_CURRENT_VALID_MASK
Definition: hpm_pcfg_regs.h:303
#define PCFG_DCDC_MISC_OL_HYST_MASK
Definition: hpm_pcfg_regs.h:520
#define PCFG_POWER_TRAP_RETENTION_MASK
Definition: hpm_pcfg_regs.h:614
#define PCFG_DCDC_CURRENT_ESTI_EN_MASK
Definition: hpm_pcfg_regs.h:291
#define PCFG_DCDC_MODE_MODE_SET(x)
Definition: hpm_pcfg_regs.h:160
#define PCFG_LDO2P5_ENABLE_MASK
Definition: hpm_pcfg_regs.h:117
#define PCFG_DCDC_PROT_SHORT_CURRENT_MASK
Definition: hpm_pcfg_regs.h:269
#define PCFG_DCDC_MODE_READY_GET(x)
Definition: hpm_pcfg_regs.h:146
#define PCFG_DCDC_START_TIME_START_TIME_GET(x)
Definition: hpm_pcfg_regs.h:581
#define PCFG_DCDC_CURRENT_LEVEL_GET(x)
Definition: hpm_pcfg_regs.h:314
#define PCFG_DCDC_START_TIME_START_TIME_SET(x)
Definition: hpm_pcfg_regs.h:580
#define PCFG_DCDC_PROT_SHORT_CURRENT_SET(x)
Definition: hpm_pcfg_regs.h:271
#define PCFG_DCDC_PROT_SHORT_FLAG_GET(x)
Definition: hpm_pcfg_regs.h:283
#define PCFG_DCDC_MISC_OL_HYST_SET(x)
Definition: hpm_pcfg_regs.h:522
#define PCFG_POWER_TRAP_TRAP_MASK
Definition: hpm_pcfg_regs.h:626
#define PCFG_BANDGAP_VBG_TRIMMED_MASK
Definition: hpm_pcfg_regs.h:48
#define PCFG_DCDC_PROT_DISABLE_OVERVOLTAGE_MASK
Definition: hpm_pcfg_regs.h:234
#define PCFG_DCDC_RESUME_TIME_RESUME_TIME_SET(x)
Definition: hpm_pcfg_regs.h:591
#define PCFG_DCDC_MODE_MODE_MASK
Definition: hpm_pcfg_regs.h:158
#define PCFG_DCDC_PROT_ILIMIT_LP_MASK
Definition: hpm_pcfg_regs.h:200
#define PCFG_DCDC_PROT_OVERVOLT_FLAG_GET(x)
Definition: hpm_pcfg_regs.h:248
#define PCFG_DCDC_PROT_POWER_LOSS_FLAG_GET(x)
Definition: hpm_pcfg_regs.h:225
#define PCFG_RC24M_RC_TRIMMED_MASK
Definition: hpm_pcfg_regs.h:696
#define PCFG_DCDC_PROT_DISABLE_SHORT_MASK
Definition: hpm_pcfg_regs.h:257
#define PCFG_DCDC_PROT_ILIMIT_LP_SET(x)
Definition: hpm_pcfg_regs.h:202
#define PCFG_DCDC_PROT_DISABLE_POWER_LOSS_MASK
Definition: hpm_pcfg_regs.h:248
#define PCFG_BANDGAP_LOWPOWER_MODE_MASK
Definition: hpm_pcfg_regs.h:61
#define PCFG_BANDGAP_POWER_SAVE_MASK
Definition: hpm_pcfg_regs.h:73
#define PCFG_DCDCM_MODE_VOLT_MASK
Definition: hpm_pcfg_regs.h:913
#define PCFG_DCDCM_RESUME_TIME_RESUME_TIME_GET(x)
Definition: hpm_pcfg_regs.h:1345
#define PCFG_DCDCM_PROT_DISABLE_POWER_LOSS_MASK
Definition: hpm_pcfg_regs.h:964
#define PCFG_DCDCM_PROT_SHORT_FLAG_GET(x)
Definition: hpm_pcfg_regs.h:1036
#define PCFG_DCDCM_PROT_ILIMIT_LP_MASK
Definition: hpm_pcfg_regs.h:941
#define PCFG_DCDCM_START_TIME_START_TIME_SET(x)
Definition: hpm_pcfg_regs.h:1333
#define PCFG_DCDCM_MISC_OL_HYST_SET(x)
Definition: hpm_pcfg_regs.h:1275
#define PCFG_DCDCM_PROT_OVERVOLT_FLAG_GET(x)
Definition: hpm_pcfg_regs.h:1001
#define PCFG_DCDCM_PROT_SHORT_CURRENT_SET(x)
Definition: hpm_pcfg_regs.h:1024
#define PCFG_DCDCM_MODE_MODE_MASK
Definition: hpm_pcfg_regs.h:899
#define PCFG_DCDCM_MODE_READY_GET(x)
Definition: hpm_pcfg_regs.h:887
#define PCFG_DCDCM_PROT_DISABLE_OVERVOLTAGE_MASK
Definition: hpm_pcfg_regs.h:987
#define PCFG_DCDCM_PROT_ILIMIT_LP_SET(x)
Definition: hpm_pcfg_regs.h:943
#define PCFG_DCDCM_RESUME_TIME_RESUME_TIME_SET(x)
Definition: hpm_pcfg_regs.h:1344
#define PCFG_DCDCM_CURRENT_LEVEL_GET(x)
Definition: hpm_pcfg_regs.h:1067
#define PCFG_DCDCM_PROT_SHORT_CURRENT_MASK
Definition: hpm_pcfg_regs.h:1022
#define PCFG_DCDCM_MISC_OL_HYST_MASK
Definition: hpm_pcfg_regs.h:1273
#define PCFG_DCDCM_MODE_VOLT_SET(x)
Definition: hpm_pcfg_regs.h:915
#define PCFG_DCDCM_MODE_MODE_SET(x)
Definition: hpm_pcfg_regs.h:901
#define PCFG_DCDCM_PROT_DISABLE_SHORT_MASK
Definition: hpm_pcfg_regs.h:1010
#define PCFG_DCDCM_PROT_POWER_LOSS_FLAG_GET(x)
Definition: hpm_pcfg_regs.h:978
#define PCFG_DCDCM_POWER_CONFIG_RETENTION_MASK
Definition: hpm_pcfg_regs.h:1355
#define PCFG_DCDCM_CURRENT_VALID_MASK
Definition: hpm_pcfg_regs.h:1056
#define PCFG_DCDCM_CURRENT_ESTI_EN_MASK
Definition: hpm_pcfg_regs.h:1044
#define PCFG_DCDCM_START_TIME_START_TIME_GET(x)
Definition: hpm_pcfg_regs.h:1334
static void pcfg_ldo2p5_turn_on(PCFG_Type *ptr)
turn on LDO 2.5V
Definition: hpm_pcfg_drv.h:167
static bool pcfg_bandgap_is_trimmed(PCFG_Type *ptr)
check if bandgap is trimmed or not
Definition: hpm_pcfg_drv.h:137
static void pcfg_enable_power_trap(PCFG_Type *ptr)
enable power trap
Definition: hpm_pcfg_drv.h:438
static bool pcfg_dcdc_is_measure_current_valid(PCFG_Type *ptr)
check if measured current is valid
Definition: hpm_pcfg_drv.h:349
static void pcfg_bandgap_disable_lowpower_mode(PCFG_Type *ptr)
bandgap disable power save mode
Definition: hpm_pcfg_drv.h:115
static void pcfg_dcdc_set_current_hys_range(PCFG_Type *ptr, pcfg_dcdc_current_hys_t range)
set dcdc current hysteres range
Definition: hpm_pcfg_drv.h:418
static void pcfg_clear_power_trap_trigger_flag(PCFG_Type *ptr)
clear power trap trigger flag
Definition: hpm_pcfg_drv.h:460
static void pcfg_bandgap_reload_trim(PCFG_Type *ptr)
bandgap reload trim value
Definition: hpm_pcfg_drv.h:147
static uint32_t pcfg_dcdc_get_start_time_in_cycle(PCFG_Type *ptr)
get DCDC start time in number of 24MHz clock cycles
Definition: hpm_pcfg_drv.h:373
static void pcfg_bandgap_enable_power_save_mode(PCFG_Type *ptr)
bandgap enable power save mode
Definition: hpm_pcfg_drv.h:105
static void pcfg_dcdc_disable_over_voltage_prot(PCFG_Type *ptr)
disable over voltage protection
Definition: hpm_pcfg_drv.h:254
static void pcfg_disable_dcdc_retention(PCFG_Type *ptr)
disable dcdc retention
Definition: hpm_pcfg_drv.h:470
static bool pcfg_is_power_trap_triggered(PCFG_Type *ptr)
check if power trap is triggered
Definition: hpm_pcfg_drv.h:450
static bool pcfg_dcdc_is_stable(PCFG_Type *ptr)
Definition: hpm_pcfg_drv.h:189
static void pcfg_dcdc_enable_power_loss_prot(PCFG_Type *ptr)
enable power loss protection
Definition: hpm_pcfg_drv.h:232
static void pcfg_bandgap_disable_power_save_mode(PCFG_Type *ptr)
bandgap disable power save mode
Definition: hpm_pcfg_drv.h:95
static void pcfg_set_periph_clock_mode(PCFG_Type *ptr, uint32_t mode)
set clock gate mode in vpmc domain
Definition: hpm_pcfg_drv.h:536
static void pcfg_dcdc_set_mode(PCFG_Type *ptr, uint8_t mode)
Definition: hpm_pcfg_drv.h:198
static void pcfg_disable_wakeup_source(PCFG_Type *ptr, uint32_t mask)
disable wakeup source
Definition: hpm_pcfg_drv.h:525
static bool pcfg_dcdc_is_power_loss(PCFG_Type *ptr)
check if power loss flag is set
Definition: hpm_pcfg_drv.h:244
static void pcfg_bandgap_enable_lowpower_mode(PCFG_Type *ptr)
bandgap enable low power mode
Definition: hpm_pcfg_drv.h:125
static bool pcfg_irc24m_is_trimmed(PCFG_Type *ptr)
check if irc24m is trimmed
Definition: hpm_pcfg_drv.h:817
static void pcfg_dcdc_set_resume_time_in_cycle(PCFG_Type *ptr, uint32_t cycles)
set DCDC resuem time in 24MHz clock cycles
Definition: hpm_pcfg_drv.h:407
static bool pcfg_ldo2p5_is_stable(PCFG_Type *ptr)
check if LDO 2.5V is stable
Definition: hpm_pcfg_drv.h:179
static void pcfg_irc24m_reload_trim(PCFG_Type *ptr)
reload irc24m trim value
Definition: hpm_pcfg_drv.h:827
static void pcfg_dcdc_set_start_time_in_cycle(PCFG_Type *ptr, uint32_t cycles)
set DCDC start time in 24MHz clock cycles
Definition: hpm_pcfg_drv.h:396
static void pcfg_dcdc_enable_measure_current(PCFG_Type *ptr)
enable current measurement
Definition: hpm_pcfg_drv.h:337
static void pcfg_dcdc_disable_power_loss_prot(PCFG_Type *ptr)
disable power loss protection
Definition: hpm_pcfg_drv.h:222
static void pcfg_clear_wakeup_cause(PCFG_Type *ptr, uint32_t mask)
clear wakeup cause flag
Definition: hpm_pcfg_drv.h:491
static void pcfg_enable_wakeup_source(PCFG_Type *ptr, uint32_t mask)
enable wakeup source
Definition: hpm_pcfg_drv.h:514
static void pcfg_dcdc_disable_measure_current(PCFG_Type *ptr)
disable current measurement
Definition: hpm_pcfg_drv.h:327
static void pcfg_disable_power_trap(PCFG_Type *ptr)
disable power trap
Definition: hpm_pcfg_drv.h:428
static void pcfg_dcdc_set_lp_current_limit(PCFG_Type *ptr, pcfg_dcdc_lp_current_limit_t limit, bool over_limit)
set low power current limit
Definition: hpm_pcfg_drv.h:210
static bool pcfg_dcdc_is_over_voltage(PCFG_Type *ptr)
checkover over voltage flag
Definition: hpm_pcfg_drv.h:275
static uint32_t pcfg_get_wakeup_cause(PCFG_Type *ptr)
get wakeup cause
Definition: hpm_pcfg_drv.h:503
static void pcfg_enable_dcdc_retention(PCFG_Type *ptr)
enable dcdc retention to retain soc sram data
Definition: hpm_pcfg_drv.h:480
static void pcfg_ldo2p5_turn_off(PCFG_Type *ptr)
turn off LDO2P5
Definition: hpm_pcfg_drv.h:157
static uint32_t pcfg_dcdc_get_resume_time_in_cycle(PCFG_Type *ptr)
get DCDC resume time in number of 24MHz clock cycles
Definition: hpm_pcfg_drv.h:385
uint32_t hpm_stat_t
Definition: hpm_common.h:119
#define MAKE_STATUS(group, code)
Definition: hpm_common.h:128
@ status_group_pcfg
Definition: hpm_common.h:152
static bool pcfg_dcdc_is_over_current(PCFG_Type *ptr)
checkover over current flag
Definition: hpm_pcfg_drv.h:317
static void pcfg_ddr_dcdc_set_start_time_in_cycle(PCFG_Type *ptr, uint32_t cycles)
set ddr dcdc start time in 24MHz clock cycles
Definition: hpm_pcfg_drv.h:763
static void pcfg_ddr_dcdc_disable_power_loss_prot(PCFG_Type *ptr)
disable ddr power loss protection
Definition: hpm_pcfg_drv.h:589
void pcfg_irc24m_config_track(PCFG_Type *ptr, pcfg_irc24m_config_t *config)
config irc24m track
Definition: hpm_pcfg_drv.c:74
hpm_stat_t pcfg_ldo1p1_set_voltage(PCFG_Type *ptr, uint16_t mv)
Definition: hpm_pcfg_drv.c:14
hpm_stat_t pcfg_ldo2p5_set_voltage(PCFG_Type *ptr, uint16_t mv)
Definition: hpm_pcfg_drv.c:24
static void pcfg_ddr_dcdc_enable_over_current_prot(PCFG_Type *ptr)
enable ddr over current protection
Definition: hpm_pcfg_drv.h:662
pcfg_dcdc_lp_current_limit_t
Definition: hpm_pcfg_drv.h:34
uint16_t pcfg_dcdc_get_current_level(PCFG_Type *ptr)
Definition: hpm_pcfg_drv.c:47
hpm_stat_t pcfg_dcdc_set_voltage(PCFG_Type *ptr, uint16_t mv)
Definition: hpm_pcfg_drv.c:63
static bool pcfg_ddr_dcdc_is_over_current(PCFG_Type *ptr)
checkover ddr over current flag
Definition: hpm_pcfg_drv.h:684
static void pcfg_ddr_dcdc_enable_over_voltage_prot(PCFG_Type *ptr)
enable ddr over voltage protection
Definition: hpm_pcfg_drv.h:631
static bool pcfg_ddr_dcdc_get_measured_current_level(PCFG_Type *ptr)
get measured ddr current level
Definition: hpm_pcfg_drv.h:728
pcfg_pmc_periph_t
Definition: hpm_pcfg_drv.h:54
static void pcfg_ddr_dcdc_set_over_current_limit(PCFG_Type *ptr, pcfg_dcdc_oc_limit_t limit)
set ddr over current limit
Definition: hpm_pcfg_drv.h:673
static void pcfg_ddr_dcdc_disable_retention(PCFG_Type *ptr)
disable ddr dcdc retention
Definition: hpm_pcfg_drv.h:795
static uint32_t pcfg_ddr_dcdc_get_start_time_in_cycle(PCFG_Type *ptr)
get ddr dcdc start time in number of 24MHz clock cycles
Definition: hpm_pcfg_drv.h:740
static void pcfg_ddr_dcdc_set_lp_current_limit(PCFG_Type *ptr, pcfg_dcdc_lp_current_limit_t limit)
set ddr low power current limit
Definition: hpm_pcfg_drv.h:578
static void pcfg_ddr_dcdc_disable_over_voltage_prot(PCFG_Type *ptr)
disable ddr over voltage protection
Definition: hpm_pcfg_drv.h:621
static void pcfg_ddr_dcdc_disable_measure_current(PCFG_Type *ptr)
disable ddr current measurement
Definition: hpm_pcfg_drv.h:694
static bool pcfg_ddr_dcdc_is_stable(PCFG_Type *ptr)
Definition: hpm_pcfg_drv.h:546
static bool pcfg_dcdc_get_measured_current_level(PCFG_Type *ptr)
get measured current level
Definition: hpm_pcfg_drv.h:361
pcfg_dcdc_oc_limit_t
Definition: hpm_pcfg_drv.h:39
static void pcfg_dcdc_enable_over_voltage_prot(PCFG_Type *ptr)
enable over voltage protection
Definition: hpm_pcfg_drv.h:264
pcfg_dcdc_mode_t
Definition: hpm_pcfg_drv.h:46
static void pcfg_ddr_dcdc_set_current_hys_range(PCFG_Type *ptr, pcfg_dcdc_current_hys_t range)
set ddr dcdc current hysteres range
Definition: hpm_pcfg_drv.h:785
static void pcfg_ddr_dcdc_set_resume_time_in_cycle(PCFG_Type *ptr, uint32_t cycles)
set ddr dcdc resuem time in 24MHz clock cycles
Definition: hpm_pcfg_drv.h:774
static void pcfg_ddr_dcdc_enable_power_loss_prot(PCFG_Type *ptr)
enable ddr power loss protection
Definition: hpm_pcfg_drv.h:599
static void pcfg_ddr_dcdc_set_voltage_output(PCFG_Type *ptr, uint8_t voltage)
Definition: hpm_pcfg_drv.h:566
static void pcfg_ddr_dcdc_set_mode(PCFG_Type *ptr, uint8_t mode)
Definition: hpm_pcfg_drv.h:555
pcfg_dcdc_current_hys_t
Definition: hpm_pcfg_drv.h:40
static void pcfg_ddr_dcdc_enable_measure_current(PCFG_Type *ptr)
enable ddr current measurement
Definition: hpm_pcfg_drv.h:704
static bool pcfg_ddr_dcdc_is_power_loss(PCFG_Type *ptr)
check if ddr power loss flag is set
Definition: hpm_pcfg_drv.h:611
static void pcfg_dcdc_enable_over_current_prot(PCFG_Type *ptr)
enable over current protection
Definition: hpm_pcfg_drv.h:295
pcfg_irc24m_reference_t
Definition: hpm_pcfg_drv.h:28
static void pcfg_ddr_dcdc_enable_retention(PCFG_Type *ptr)
enable ddr dcdc retention to retain soc sram data
Definition: hpm_pcfg_drv.h:805
static void pcfg_ddr_dcdc_disable_over_current_prot(PCFG_Type *ptr)
disable ddr over current protection
Definition: hpm_pcfg_drv.h:652
hpm_stat_t pcfg_dcdc_set_lpmode_voltage(PCFG_Type *ptr, uint16_t mv)
Definition: hpm_pcfg_drv.c:95
static bool pcfg_ddr_dcdc_is_measure_current_valid(PCFG_Type *ptr)
check if measured ddr current is valid
Definition: hpm_pcfg_drv.h:716
static void pcfg_dcdc_disable_over_current_prot(PCFG_Type *ptr)
disable over current protection
Definition: hpm_pcfg_drv.h:285
static uint32_t pcfg_ddr_dcdc_get_resume_time_in_cycle(PCFG_Type *ptr)
get ddr dcdc resume time in number of 24MHz clock cycles
Definition: hpm_pcfg_drv.h:752
static bool pcfg_ddr_dcdc_is_over_voltage(PCFG_Type *ptr)
checkover ddr over voltage flag
Definition: hpm_pcfg_drv.h:642
static void pcfg_dcdc_set_over_current_limit(PCFG_Type *ptr, pcfg_dcdc_oc_limit_t limit)
set over current limit
Definition: hpm_pcfg_drv.h:306
@ pcfg_dcdc_lp_current_limit_250ma
Definition: hpm_pcfg_drv.h:35
@ pcfg_dcdc_lp_current_limit_200ma
Definition: hpm_pcfg_drv.h:36
@ pcfg_pmc_periph_pmic_mem
Definition: hpm_pcfg_drv.h:66
@ pcfg_pmc_periph_timer
Definition: hpm_pcfg_drv.h:57
@ pcfg_pmc_periph_vad
Definition: hpm_pcfg_drv.h:57
@ pcfg_pmc_periph_uart
Definition: hpm_pcfg_drv.h:59
@ pcfg_pmc_periph_ioc
Definition: hpm_pcfg_drv.h:56
@ pcfg_pmc_periph_gpio
Definition: hpm_pcfg_drv.h:55
@ pcfg_pmc_periph_wdog
Definition: hpm_pcfg_drv.h:58
@ pcfg_dcdc_oc_limit_2000ma
Definition: hpm_pcfg_drv.h:40
@ pcfg_dcdc_oc_limit_1300ma
Definition: hpm_pcfg_drv.h:41
@ pcfg_dcdc_mode_general
Definition: hpm_pcfg_drv.h:49
@ pcfg_dcdc_mode_off
Definition: hpm_pcfg_drv.h:47
@ pcfg_dcdc_mode_basic
Definition: hpm_pcfg_drv.h:48
@ pcfg_dcdc_mode_expert
Definition: hpm_pcfg_drv.h:50
@ status_pcfg_ldo_out_of_range
Definition: hpm_pcfg_drv.h:64
@ pcfg_dcdc_current_hys_25mv
Definition: hpm_pcfg_drv.h:42
@ pcfg_dcdc_current_hys_12_5mv
Definition: hpm_pcfg_drv.h:41
@ pcfg_irc24m_reference_24m_xtal
Definition: hpm_pcfg_drv.h:30
@ pcfg_irc24m_reference_32k
Definition: hpm_pcfg_drv.h:29
Definition: hpm_pcfg_regs.h:12
__RW uint32_t LDO2P5
Definition: hpm_pcfg_regs.h:15
__RW uint32_t DCDCM_POWER_CONFIG
Definition: hpm_pcfg_regs.h:48
__RW uint32_t DCDCM_CURRENT
Definition: hpm_pcfg_regs.h:41
__RW uint32_t POWER_TRAP
Definition: hpm_pcfg_regs.h:28
__RW uint32_t DCDC_CURRENT
Definition: hpm_pcfg_regs.h:20
__RW uint32_t WAKE_MASK
Definition: hpm_pcfg_regs.h:30
__RW uint32_t BANDGAP
Definition: hpm_pcfg_regs.h:13
__RW uint32_t SCG_CTRL
Definition: hpm_pcfg_regs.h:31
__RW uint32_t DCDCM_RESUME_TIME
Definition: hpm_pcfg_regs.h:47
__RW uint32_t DCDC_START_TIME
Definition: hpm_pcfg_regs.h:25
__RW uint32_t DCDC_PROT
Definition: hpm_pcfg_regs.h:19
__RW uint32_t DCDC_MODE
Definition: hpm_pcfg_regs.h:17
__RW uint32_t DCDC_MISC
Definition: hpm_pcfg_regs.h:23
__RW uint32_t DCDCM_START_TIME
Definition: hpm_pcfg_regs.h:46
__RW uint32_t DCDCM_MISC
Definition: hpm_pcfg_regs.h:44
__RW uint32_t DCDCM_MODE
Definition: hpm_pcfg_regs.h:38
__RW uint32_t DCDC_RESUME_TIME
Definition: hpm_pcfg_regs.h:26
__RW uint32_t WAKE_CAUSE
Definition: hpm_pcfg_regs.h:29
__RW uint32_t DCDCM_PROT
Definition: hpm_pcfg_regs.h:40
__RW uint32_t RC24M
Definition: hpm_pcfg_regs.h:33
Definition: hpm_pcfg_drv.h:68