12 #include "hpm_pdgo_regs.h"
18 #define DGO_GPR_WORD_COUNT (4U)
19 #define DGO_WAKEUP_COUNTER_TICKS_PER_SEC (32768UL)
20 #define DGO_TURNOFF_COUNTER_TICKS_PER_SEC (24000000UL)
21 #define DGO_WAKEUP_TICK_IN_US (1000000UL / DGO_WAKEUP_COUNTER_TICKS_PER_SEC)
22 #define DGO_TURNOFF_TICKS_PER_US (DGO_TURNOFF_COUNTER_TICKS_PER_SEC / 1000000UL)
109 #if defined(PDGO_SUPPORT_SYS_WAKEUP_STATUS) && (PDGO_SUPPORT_SYS_WAKEUP_STATUS == 1)
116 static inline bool pdgo_is_system_wakeup(
PDGO_Type *ptr)
118 return ((ptr->
DGO_CTR1 & PDGO_DGO_CTR1_SYS_WAKEUP_STATUS_MASK) != 0U);
212 *(
volatile uint32_t *) ((uint32_t) &ptr->
DGO_GPR00 + index * 4) = content;
225 uint32_t reg_val = 0;
227 reg_val = *(
volatile uint32_t *) ((uint32_t) &ptr->
DGO_GPR00 + index * 4);
#define PDGO_DGO_CTR2_RESETN_PULLUP_DISABLE_MASK
Definition: hpm_pdgo_regs.h:174
#define PDGO_DGO_CTR1_WAKEUP_EN_MASK
Definition: hpm_pdgo_regs.h:154
#define PDGO_DGO_CTR2_WAKEUP_PULLDN_DISABLE_MASK
Definition: hpm_pdgo_regs.h:184
#define PDGO_DGO_CTR1_AOTO_SYS_WAKEUP_MASK
Definition: hpm_pdgo_regs.h:144
#define PDGO_DGO_CTR0_RETENTION_MASK
Definition: hpm_pdgo_regs.h:133
#define PDGO_DGO_CTR1_PIN_WAKEUP_STATUS_MASK
Definition: hpm_pdgo_regs.h:164
#define DGO_TURNOFF_TICKS_PER_US
Definition: hpm_pdgo_drv.h:22
#define DGO_GPR_WORD_COUNT
Definition: hpm_pdgo_drv.h:18
#define DGO_WAKEUP_TICK_IN_US
Definition: hpm_pdgo_drv.h:21
static uint32_t pdgo_get_us_from_turnoff_counter(uint32_t counter)
Convert the DGO Turn-off counter to microseconds.
Definition: hpm_pdgo_drv.h:271
static uint32_t pdgo_get_wakeup_counter(PDGO_Type *ptr)
Get DGO wakeup counter value.
Definition: hpm_pdgo_drv.h:198
static uint32_t pdgo_get_us_from_wakeup_counter(uint32_t counter)
Convert the DGO Wake-up counter to microseconds.
Definition: hpm_pdgo_drv.h:249
static void pdgo_enable_oneshot_wakeup(PDGO_Type *ptr)
Set DGO to one-shot wakeup mode.
Definition: hpm_pdgo_drv.h:65
static void pdgo_enable_pullup_resistor_for_reset_pin(PDGO_Type *ptr)
Enable pull-up resistor for Reset Pin [in] ptr DGO base address.
Definition: hpm_pdgo_drv.h:150
static bool pdgo_is_auto_wakeup_enabled(PDGO_Type *ptr)
Check whether Auto wake-up is enabled.
Definition: hpm_pdgo_drv.h:141
static void pdgo_enable_wkup_software_wakeup(PDGO_Type *ptr)
Enable wakeup pin or software wakeup.
Definition: hpm_pdgo_drv.h:47
static bool pdgo_is_pin_wakeup(PDGO_Type *ptr)
Check whether DGO is waked up by Wake-up/Reset Pin.
Definition: hpm_pdgo_drv.h:128
static void pdgo_enable_pulldown_resistor_for_wakeup_pin(PDGO_Type *ptr)
Definition: hpm_pdgo_drv.h:168
static bool pdgo_is_retention_mode_enabled(PDGO_Type *ptr)
Check whether the DGO retention mode is enabled or not.
Definition: hpm_pdgo_drv.h:86
static void pdgo_enable_retention_mode(PDGO_Type *ptr)
Enable DGO register retention mode.
Definition: hpm_pdgo_drv.h:74
static void pdgo_disable_pullup_resistor_for_reset_pin(PDGO_Type *ptr)
Disable pull-up resistor for Reset Pin [in] ptr DGO base address.
Definition: hpm_pdgo_drv.h:159
static void pdgo_disable_wkup_software_wakeup(PDGO_Type *ptr)
Disable wakeup pin or software wakeup.
Definition: hpm_pdgo_drv.h:56
static void pdgo_disable_retention_mode(PDGO_Type *ptr)
Disable DGO register retention mode.
Definition: hpm_pdgo_drv.h:95
static uint32_t pdgo_get_wakeup_counter_from_us(uint32_t us)
Convert the microsecond to DGO Wake-up counter value.
Definition: hpm_pdgo_drv.h:238
static void pdgo_disable_pulldown_resistor_for_wakeup_pin(PDGO_Type *ptr)
Definition: hpm_pdgo_drv.h:177
static uint32_t pdgo_read_gpr(PDGO_Type *ptr, uint32_t index)
Read data from DGO GPR register.
Definition: hpm_pdgo_drv.h:223
static void pdgo_write_gpr(PDGO_Type *ptr, uint32_t index, uint32_t content)
Write data to DGO GPR register.
Definition: hpm_pdgo_drv.h:209
static uint32_t pdgo_get_turnoff_counter_from_us(uint32_t us)
Convert the microsecond to DGO Turn-off counter value.
Definition: hpm_pdgo_drv.h:260
static void pdgo_enable_auto_wakeup(PDGO_Type *ptr)
Set DGO to automatic wakeup mode.
Definition: hpm_pdgo_drv.h:104
static void pdgo_set_wakeup_counter(PDGO_Type *ptr, uint32_t wakeup_ctr)
Set DGO wakeup counter.
Definition: hpm_pdgo_drv.h:187
static void pdgo_set_turnoff_counter(PDGO_Type *ptr, uint32_t counter)
Set DGO turn-off counter.
Definition: hpm_pdgo_drv.h:38
Definition: hpm_pdgo_regs.h:12
__RW uint32_t DGO_CTR0
Definition: hpm_pdgo_regs.h:21
__RW uint32_t DGO_GPR00
Definition: hpm_pdgo_regs.h:16
__RW uint32_t DGO_CTR3
Definition: hpm_pdgo_regs.h:24
__RW uint32_t DGO_CTR2
Definition: hpm_pdgo_regs.h:23
__W uint32_t DGO_TURNOFF
Definition: hpm_pdgo_regs.h:13
__RW uint32_t DGO_CTR1
Definition: hpm_pdgo_regs.h:22