HPM SDK
HPMicro Software Development Kit
hpm_pdgo_drv.h File Reference
#include "hpm_common.h"
#include "hpm_pdgo_regs.h"

Go to the source code of this file.

Macros

#define DGO_GPR_WORD_COUNT   (4U)
 
#define DGO_WAKEUP_COUNTER_TICKS_PER_SEC   (32768UL)
 
#define DGO_TURNOFF_COUNTER_TICKS_PER_SEC   (24000000UL)
 
#define DGO_WAKEUP_TICK_IN_US   (1000000UL / DGO_WAKEUP_COUNTER_TICKS_PER_SEC)
 
#define DGO_TURNOFF_TICKS_PER_US   (DGO_TURNOFF_COUNTER_TICKS_PER_SEC / 1000000UL)
 

Functions

static void pdgo_set_turnoff_counter (PDGO_Type *ptr, uint32_t counter)
 Set DGO turn-off counter. More...
 
static void pdgo_enable_wkup_software_wakeup (PDGO_Type *ptr)
 Enable wakeup pin or software wakeup. More...
 
static void pdgo_disable_wkup_software_wakeup (PDGO_Type *ptr)
 Disable wakeup pin or software wakeup. More...
 
static void pdgo_enable_oneshot_wakeup (PDGO_Type *ptr)
 Set DGO to one-shot wakeup mode. More...
 
static void pdgo_enable_retention_mode (PDGO_Type *ptr)
 Enable DGO register retention mode. More...
 
static bool pdgo_is_retention_mode_enabled (PDGO_Type *ptr)
 Check whether the DGO retention mode is enabled or not. More...
 
static void pdgo_disable_retention_mode (PDGO_Type *ptr)
 Disable DGO register retention mode. More...
 
static void pdgo_enable_auto_wakeup (PDGO_Type *ptr)
 Set DGO to automatic wakeup mode. More...
 
static bool pdgo_is_pin_wakeup (PDGO_Type *ptr)
 Check whether DGO is waked up by Wake-up/Reset Pin. More...
 
static bool pdgo_is_auto_wakeup_enabled (PDGO_Type *ptr)
 Check whether Auto wake-up is enabled. More...
 
static void pdgo_enable_pullup_resistor_for_reset_pin (PDGO_Type *ptr)
 Enable pull-up resistor for Reset Pin [in] ptr DGO base address. More...
 
static void pdgo_disable_pullup_resistor_for_reset_pin (PDGO_Type *ptr)
 Disable pull-up resistor for Reset Pin [in] ptr DGO base address. More...
 
static void pdgo_enable_pulldown_resistor_for_wakeup_pin (PDGO_Type *ptr)
 
static void pdgo_disable_pulldown_resistor_for_wakeup_pin (PDGO_Type *ptr)
 
static void pdgo_set_wakeup_counter (PDGO_Type *ptr, uint32_t wakeup_ctr)
 Set DGO wakeup counter. More...
 
static uint32_t pdgo_get_wakeup_counter (PDGO_Type *ptr)
 Get DGO wakeup counter value. More...
 
static void pdgo_write_gpr (PDGO_Type *ptr, uint32_t index, uint32_t content)
 Write data to DGO GPR register. More...
 
static uint32_t pdgo_read_gpr (PDGO_Type *ptr, uint32_t index)
 Read data from DGO GPR register. More...
 
static uint32_t pdgo_get_wakeup_counter_from_us (uint32_t us)
 Convert the microsecond to DGO Wake-up counter value. More...
 
static uint32_t pdgo_get_us_from_wakeup_counter (uint32_t counter)
 Convert the DGO Wake-up counter to microseconds. More...
 
static uint32_t pdgo_get_turnoff_counter_from_us (uint32_t us)
 Convert the microsecond to DGO Turn-off counter value. More...
 
static uint32_t pdgo_get_us_from_turnoff_counter (uint32_t counter)
 Convert the DGO Turn-off counter to microseconds. More...
 

Macro Definition Documentation

◆ DGO_GPR_WORD_COUNT

#define DGO_GPR_WORD_COUNT   (4U)

DGO GPR register count

◆ DGO_TURNOFF_COUNTER_TICKS_PER_SEC

#define DGO_TURNOFF_COUNTER_TICKS_PER_SEC   (24000000UL)

DGO Turn-off counter frequency

◆ DGO_TURNOFF_TICKS_PER_US

#define DGO_TURNOFF_TICKS_PER_US   (DGO_TURNOFF_COUNTER_TICKS_PER_SEC / 1000000UL)

◆ DGO_WAKEUP_COUNTER_TICKS_PER_SEC

#define DGO_WAKEUP_COUNTER_TICKS_PER_SEC   (32768UL)

DGO Wakeup Counter frequency

◆ DGO_WAKEUP_TICK_IN_US

#define DGO_WAKEUP_TICK_IN_US   (1000000UL / DGO_WAKEUP_COUNTER_TICKS_PER_SEC)