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.

Data Structures

struct  dgo_wuio_filter_cfg_t
 wakeup io pins filter config structure More...
 
struct  dgo_pcap_cfg_t
 pulse capture config structure More...
 
union  dgo_pcnt_sig_state_t
 
struct  dgo_pcnt_counter_t
 
struct  dgo_pcnt_cfg_t
 pulse counter config structure More...
 

Macros

#define DGO_GPR_WORD_COUNT   (8U)
 
#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)
 

Enumerations

enum  dgo_wakeup_bit_mask_t {
  dgo_wakeup_wkup_pin = PDGO_WKUP_EN_WKUP_MASK , dgo_wakeup_software = PDGO_WKUP_EN_CYC_MASK , dgo_wakeup_wuio_pins = PDGO_WKUP_EN_WUIO_MASK , dgo_wakeup_pcap0 = PDGO_WKUP_EN_PCAP0_MASK ,
  dgo_wakeup_pcnt0 = PDGO_WKUP_EN_PCNT0_MASK
}
 wakeup source More...
 
enum  dgo_irq0_bit_mask_t {
  dgo_irq0_wkup_pin = PDGO_IRQ0_EN_WKUP_MASK , dgo_irq0_software = PDGO_IRQ0_EN_CYC_MASK , dgo_irq0_wuio0_pin = PDGO_IRQ0_EN_WUIO0_MASK , dgo_irq0_wuio1_pin = PDGO_IRQ0_EN_WUIO1_MASK ,
  dgo_irq0_wuio2_pin = PDGO_IRQ0_EN_WUIO2_MASK , dgo_irq0_wuio3_pin = PDGO_IRQ0_EN_WUIO3_MASK
}
 irq0 source More...
 
enum  dgo_irq1_bit_mask_t {
  dgo_irq1_pcap0_period = PDGO_IRQ1_EN_PCAP0_PERIOD_MASK , dgo_irq1_pcap0_dump = PDGO_IRQ1_EN_PCAP0_DUMP_MASK , dgo_irq1_pcap0_match = PDGO_IRQ1_EN_PCAP0_MATCH_MASK , dgo_irq1_pcnt0_update = PDGO_IRQ1_EN_PCNT0_UPDATE_MASK ,
  dgo_irq1_pcnt0_z_match = PDGO_IRQ1_EN_PCNT0_Z_MASK , dgo_irq1_pcnt0_h_match = PDGO_IRQ1_EN_PCNT0_HOME_MASK , dgo_irq1_pcnt0_cmp0_match = PDGO_IRQ1_EN_PCNT0_MATCH0_MASK , dgo_irq1_pcnt0_tacho = PDGO_IRQ1_EN_PCNT0_TACHO_MASK ,
  dgo_irq1_pcnt0_dec_err = PDGO_IRQ1_EN_PCNT0_DECERR_MASK , dgo_irq1_pcnt0_seq_err = PDGO_IRQ1_EN_PCNT0_SEQERR_MASK
}
 irq0 source More...
 
enum  dgo_wuio_pin_num_t { dgo_wuio_pin_0 = 0 , dgo_wuio_pin_1 = 1 , dgo_wuio_pin_2 = 2 , dgo_wuio_pin_3 = 3 }
 wuio pin number More...
 
enum  dgo_pcap_num_t { dgo_pcap_0 = 0 }
 pulse capture number More...
 
enum  dgo_pcnt_num_t { dgo_pcnt_0 = 0 }
 pulse counter number More...
 
enum  dgo_wuio_irq_mode_t { dgo_wuio_irq_disable = 0 , dgo_wuio_irq_level_mode = 1 , dgo_wuio_irq_rise_edge_mode = 2 , dgo_wuio_irq_both_edge_mode = 3 }
 filter mode More...
 
enum  dgo_filter_mode_t {
  dgo_filter_mode_rapid_change = 0 , dgo_filter_mode_delay = 1 , dgo_filter_mode_stable_high = 2 , dgo_filter_mode_stable_low = 3 ,
  dgo_filter_mode_bypass = 4
}
 filter mode More...
 
enum  dgo_pcap_match_mode_t {
  dgo_pcap_match_disable = 0 , dgo_pcap_match_mode_cnt_ge_cmp = 2 , dgo_pcap_match_mode_cnt_le_cmp , dgo_pcap_match_mode_highdump_ge_cmp ,
  dgo_pcap_match_mode_highdump_le_cmp , dgo_pcap_match_mode_lowdump_ge_cmp , dgo_pcap_match_mode_lowdump_le_cmp , dgo_pcap_match_mode_highdump_add_lowdump_ge_cmp ,
  dgo_pcap_match_mode_highdump_add_lowdump_le_cmp , dgo_pcap_match_mode_abs_highdump_minus_lowdump_ge_cmp , dgo_pcap_match_mode_abs_highdump_minus_lowdump_le_cmp , dgo_pcap_match_mode_highdump_minus_lowdump_ge_cmp ,
  dgo_pcap_match_mode_lowdump_minus_highdump_le_cmp , dgo_pcap_match_mode_lowdump_minus_highdump_ge_cmp , dgo_pcap_match_mode_highdump_minus_lowdump_le_cmp
}
 pulse capture match mode More...
 
enum  dgo_pcap_dump_mode_t { dgo_pcap_dump_disable = 0 , dgo_pcap_dump_wuio_rise_edge , dgo_pcap_dump_wuio_fall_edge , dgo_pcap_dump_cnt_finish }
 pulse capture dump mode More...
 
enum  dgo_pcap_cnt_dir_t { dgo_pcap_cnt_up = 0 , dgo_pcap_cnt_down }
 pulse capture counter direction More...
 
enum  dgo_pcap_cnt_mode_t { dgo_pcap_cnt_oneshot = 0 , dgo_pcap_cnt_period }
 pulse capture counter mode More...
 
enum  dgo_pcap_cnt_event_t { dgo_pcap_cnt_internal_clk = 0 , dgo_pcap_cnt_wuio_rise_edge , dgo_pcap_cnt_wuio_fall_edge , dgo_pcap_cnt_wuio_both_edge }
 pulse capture counter event More...
 
enum  dgo_pcnt_decode_mode_t {
  dgo_pcnt_ab_4x = 0 , dgo_pcnt_ab_2x , dgo_pcnt_ab_1x , dgo_pcnt_pd_1x = 4 ,
  dgo_pcnt_pd_f_1x , dgo_pcnt_pd_2x , dgo_pcnt_pd_f_2x , dgo_pcnt_ud_1x ,
  dgo_pcnt_ud_f_1x , dgo_pcnt_ud_2x , dgo_pcnt_ud_f_2x , dgo_pcnt_ud_uvw_6x ,
  dgo_pcnt_ud_uvw_6y
}
 pulse counter decode mode More...
 
enum  dgo_pcnt_z_mode_t { dgo_pcnt_z_disable = 0 , dgo_pcnt_z_edge_mode , dgo_pcnt_z_level_mode_with_ab , dgo_pcnt_z_level_mode }
 pulse counter z phase mode More...
 
enum  dgo_pcnt_h_mode_t { dgo_pcnt_h_disable = 0 , dgo_pcnt_h_edge_mode , dgo_pcnt_h_level_mode_with_ab , dgo_pcnt_h_level_mode }
 pulse counter h phase mode More...
 
enum  dgo_pcnt_dump_mode_t { dgo_pcnt_dump_disable = 0 , dgo_pcnt_dump_h_edge_mode , dgo_pcnt_dump_h_level_mode_with_ab , dgo_pcnt_dump_h_level_mode }
 pulse counter dump mode More...
 
enum  dgo_pcnt_tacho_mode_t { dgo_pcnt_tacho_disable = 0 , dgo_pcnt_tacho_period_mode , dgo_pcnt_tacho_travel_mode }
 pulse counter tacho mode More...
 
enum  dgo_pcnt_cmp_mode_t {
  dgo_pcnt_cmp_disable = 0 , dgo_pcnt_cmp_range_match_mode , dgo_pcnt_cmp_match_mode0 , dgo_pcnt_cmp_match_mode1 ,
  dgo_pcnt_cmp_match_forward_mode0 , dgo_pcnt_cmp_match_forward_mode1 , dgo_pcnt_cmp_match_reverse_mode0 , dgo_pcnt_cmp_match_reverse_mode1
}
 pulse counter compare mode More...
 
enum  dgo_pcnt_range_cmp_src_t { dgo_pcnt_cmp_src_line_phase = 0 , dgo_pcnt_cmp_src_revolution_line_phase , dgo_pcnt_cmp_src_tacho_line , dgo_pcnt_cmp_src_tacho_time }
 pulse counter range match mode compare source More...
 

Functions

static void pdgo_set_turnoff_counter (PDGO_Type *ptr, uint32_t counter)
 Set DGO turn-off counter. More...
 
static void pdgo_enable_software_wakeup (PDGO_Type *ptr)
 Enable Software Wake-up feature on DGO. More...
 
static void pdgo_disable_software_wakeup (PDGO_Type *ptr)
 Disable Software Wake-up feature on DGO. More...
 
static void pdgo_set_wakeup_counter (PDGO_Type *ptr, uint32_t counter)
 Set DGO wakeup counter. More...
 
static uint32_t pdgo_get_wakeup_counter (PDGO_Type *ptr)
 Get DGO wakeup counter value. More...
 
static void pdgo_set_cycle_wakeup_counter (PDGO_Type *ptr, uint32_t counter)
 Set DGO cycle wakeup counter. More...
 
static void pdgo_enable_wkup_pin_wakeup (PDGO_Type *ptr)
 Enable wkup pin Wake-up feature on DGO. More...
 
static void pdgo_disable_wkup_pin_wakeup (PDGO_Type *ptr)
 Disable wkup pin Wake-up feature on DGO. More...
 
static void pdgo_enable_wuio_pins_wakeup (PDGO_Type *ptr)
 Enable wuio pins Wake-up feature on DGO. More...
 
static void pdgo_disable_wuio_pins_wakeup (PDGO_Type *ptr)
 Disable wuio pins Wake-up feature on DGO. More...
 
static void pdgo_enable_pulse_capture0_wakeup (PDGO_Type *ptr)
 Enable pulse capture0 Wake-up feature on DGO. More...
 
static void pdgo_disable_pulse_capture0_wakeup (PDGO_Type *ptr)
 Disable pulse capture0 Wake-up feature on DGO. More...
 
static void pdgo_enable_pulse_counter0_wakeup (PDGO_Type *ptr)
 Enable pulse counter0 Wake-up feature on DGO. More...
 
static void pdgo_disable_pulse_counter0_wakeup (PDGO_Type *ptr)
 Disable pulse counter0 Wake-up feature on DGO. More...
 
static void pdgo_enable_wakeup_by_bit_mask (PDGO_Type *ptr, uint32_t mask)
 Enable Wake-up by bit mask. More...
 
static void pdgo_disable_wakeup_by_bit_mask (PDGO_Type *ptr, uint32_t mask)
 Disable Wake-up by bit mask. More...
 
static uint32_t pdgo_get_wakeup_status (PDGO_Type *ptr)
 Get Wake-up status. More...
 
static void pdgo_clear_wakeup_status (PDGO_Type *ptr, uint32_t mask)
 Clear Wake-up status. More...
 
static void pdgo_disable_all_irq (PDGO_Type *ptr)
 Disable DGO all interrupts. More...
 
static void pdgo_enable_irq0_by_bit_mask (PDGO_Type *ptr, dgo_irq0_bit_mask_t mask)
 Enable DGO interrupt0 by bit mask. More...
 
static void pdgo_disable_irq0_by_bit_mask (PDGO_Type *ptr, dgo_irq0_bit_mask_t mask)
 Disable DGO interrupt0 by bit mask. More...
 
static uint32_t pdgo_get_irq0_en (PDGO_Type *ptr)
 Get DGO interrupt0 enable status. More...
 
static uint32_t pdgo_get_irq0_status (PDGO_Type *ptr)
 Get irq0 status. More...
 
static void pdgo_clear_irq0_status (PDGO_Type *ptr, uint32_t mask)
 Clear irq0 status. More...
 
static void pdgo_enable_irq1_by_bit_mask (PDGO_Type *ptr, dgo_irq1_bit_mask_t mask)
 Enable DGO interrupt1 by bit mask. More...
 
static void pdgo_disable_irq1_by_bit_mask (PDGO_Type *ptr, dgo_irq1_bit_mask_t mask)
 Disable DGO interrupt1 by bit mask. More...
 
static uint32_t pdgo_get_irq1_en (PDGO_Type *ptr)
 Get DGO interrupt1 enable status. More...
 
static uint32_t pdgo_get_irq1_status (PDGO_Type *ptr)
 Get irq1 status. More...
 
static void pdgo_clear_irq1_status (PDGO_Type *ptr, uint32_t mask)
 Clear irq1 status. 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_pullup_resistor_for_reset_pin (PDGO_Type *ptr)
 Enable pull-up resistor for Reset Pin. More...
 
static void pdgo_disable_pullup_resistor_for_reset_pin (PDGO_Type *ptr)
 Disable pull-up resistor for Reset Pin. 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_enable_pulldown_resistor_for_wuio_pin (PDGO_Type *ptr, dgo_wuio_pin_num_t num)
 
static void pdgo_disable_pulldown_resistor_for_wuio_pin (PDGO_Type *ptr, dgo_wuio_pin_num_t num)
 
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...
 
static void pdgo_set_wuio_pin_enable (PDGO_Type *ptr, dgo_wuio_pin_num_t num, bool enable)
 Set WUIO pin enable. More...
 
static void pdgo_set_pcap_enable (PDGO_Type *ptr, dgo_pcap_num_t num, bool enable)
 Set PCAP enable. More...
 
static void pdgo_set_pcap_counter_value (PDGO_Type *ptr, dgo_pcap_num_t num, uint16_t value)
 Set PCAP counter value. More...
 
static uint16_t pdgo_get_pcap_counter_value (PDGO_Type *ptr, dgo_pcap_num_t num)
 Get PCAP counter value. More...
 
static void pdgo_set_pcnt_enable (PDGO_Type *ptr, dgo_pcnt_num_t num, bool enable)
 Set PCNT enable. More...
 
static void pdgo_set_pcnt_cmp_mode (PDGO_Type *ptr, dgo_pcnt_num_t num, dgo_pcnt_cmp_mode_t mode)
 Set PCNT cmp mode. More...
 
static void pdgo_set_pcnt_cmp0_value (PDGO_Type *ptr, dgo_pcnt_num_t num, uint32_t value)
 Set PCNT cmp0 value. More...
 
static void pdgo_set_pcnt_cmp1_value (PDGO_Type *ptr, dgo_pcnt_num_t num, uint32_t value)
 Set PCNT cmp1 value. More...
 
static void pdgo_set_pcnt_raw_counter_value (PDGO_Type *ptr, dgo_pcnt_num_t num, uint32_t value)
 Set PCNT raw counter value. More...
 
static uint32_t pdgo_get_pcnt_raw_counter_value (PDGO_Type *ptr, dgo_pcnt_num_t num)
 Get PCNT raw counter value. More...
 
static void pdgo_enable_pcnt_dir_override (PDGO_Type *ptr, dgo_pcnt_num_t num)
 Enable PCNT dir override. More...
 
static void pdgo_disable_pcnt_dir_override (PDGO_Type *ptr, dgo_pcnt_num_t num)
 Disable PCNT dir override. More...
 
static void pdgo_set_pcnt_dir_override_value (PDGO_Type *ptr, dgo_pcnt_num_t num, bool reverse)
 Set PCNT dir override value. More...
 
void pdgo_config_wuio_filter (PDGO_Type *ptr, dgo_wuio_pin_num_t num, dgo_wuio_filter_cfg_t *cfg)
 Config wakeup IO filter. More...
 
void pdgo_config_pcap (PDGO_Type *ptr, dgo_pcap_num_t num, dgo_pcap_cfg_t *cfg)
 Config pulse capture. More...
 
void pdgo_get_pcnt_defconfig (PDGO_Type *ptr, dgo_pcnt_num_t num, dgo_pcnt_cfg_t *cfg)
 Get pulse capture default config. More...
 
void pdgo_config_pcnt (PDGO_Type *ptr, dgo_pcnt_num_t num, dgo_pcnt_cfg_t *cfg)
 Config pulse capture. More...
 
void pdgo_get_pcnt_counter (PDGO_Type *ptr, dgo_pcnt_num_t num, dgo_pcnt_counter_t *counter)
 Get PCNT counter. More...
 
uint32_t pdgo_convert_pcnt_counter (PDGO_Type *ptr, dgo_pcnt_num_t num, dgo_pcnt_counter_t *counter)
 Convert PCNT counter to raw counter value. More...
 
void pdgo_config_pcnt_range_compare (PDGO_Type *ptr, dgo_pcnt_num_t num, uint32_t cmp0, uint32_t cmp1)
 Config PCNT range compare. More...
 
float pdgo_calc_pcnt_tacho_cycles_per_line (PDGO_Type *ptr, dgo_pcnt_num_t num)
 Calculate PCNT tacho, unit: cycles per line. More...
 

Macro Definition Documentation

◆ DGO_GPR_WORD_COUNT

#define DGO_GPR_WORD_COUNT   (8U)

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)

Enumeration Type Documentation

◆ dgo_filter_mode_t

filter mode

Enumerator
dgo_filter_mode_rapid_change 
dgo_filter_mode_delay 
dgo_filter_mode_stable_high 
dgo_filter_mode_stable_low 
dgo_filter_mode_bypass 

◆ dgo_irq0_bit_mask_t

irq0 source

Enumerator
dgo_irq0_wkup_pin 
dgo_irq0_software 
dgo_irq0_wuio0_pin 
dgo_irq0_wuio1_pin 
dgo_irq0_wuio2_pin 
dgo_irq0_wuio3_pin 

◆ dgo_irq1_bit_mask_t

irq0 source

Enumerator
dgo_irq1_pcap0_period 
dgo_irq1_pcap0_dump 
dgo_irq1_pcap0_match 
dgo_irq1_pcnt0_update 
dgo_irq1_pcnt0_z_match 
dgo_irq1_pcnt0_h_match 
dgo_irq1_pcnt0_cmp0_match 
dgo_irq1_pcnt0_tacho 
dgo_irq1_pcnt0_dec_err 
dgo_irq1_pcnt0_seq_err 

◆ dgo_pcap_cnt_dir_t

pulse capture counter direction

Enumerator
dgo_pcap_cnt_up 
dgo_pcap_cnt_down 

◆ dgo_pcap_cnt_event_t

pulse capture counter event

Enumerator
dgo_pcap_cnt_internal_clk 
dgo_pcap_cnt_wuio_rise_edge 
dgo_pcap_cnt_wuio_fall_edge 
dgo_pcap_cnt_wuio_both_edge 

◆ dgo_pcap_cnt_mode_t

pulse capture counter mode

Enumerator
dgo_pcap_cnt_oneshot 
dgo_pcap_cnt_period 

◆ dgo_pcap_dump_mode_t

pulse capture dump mode

Enumerator
dgo_pcap_dump_disable 
dgo_pcap_dump_wuio_rise_edge 
dgo_pcap_dump_wuio_fall_edge 
dgo_pcap_dump_cnt_finish 

◆ dgo_pcap_match_mode_t

pulse capture match mode

Enumerator
dgo_pcap_match_disable 
dgo_pcap_match_mode_cnt_ge_cmp 
dgo_pcap_match_mode_cnt_le_cmp 
dgo_pcap_match_mode_highdump_ge_cmp 
dgo_pcap_match_mode_highdump_le_cmp 
dgo_pcap_match_mode_lowdump_ge_cmp 
dgo_pcap_match_mode_lowdump_le_cmp 
dgo_pcap_match_mode_highdump_add_lowdump_ge_cmp 
dgo_pcap_match_mode_highdump_add_lowdump_le_cmp 
dgo_pcap_match_mode_abs_highdump_minus_lowdump_ge_cmp 
dgo_pcap_match_mode_abs_highdump_minus_lowdump_le_cmp 
dgo_pcap_match_mode_highdump_minus_lowdump_ge_cmp 
dgo_pcap_match_mode_lowdump_minus_highdump_le_cmp 
dgo_pcap_match_mode_lowdump_minus_highdump_ge_cmp 
dgo_pcap_match_mode_highdump_minus_lowdump_le_cmp 

◆ dgo_pcap_num_t

pulse capture number

Enumerator
dgo_pcap_0 

◆ dgo_pcnt_cmp_mode_t

pulse counter compare mode

Enumerator
dgo_pcnt_cmp_disable 
dgo_pcnt_cmp_range_match_mode 
dgo_pcnt_cmp_match_mode0 
dgo_pcnt_cmp_match_mode1 
dgo_pcnt_cmp_match_forward_mode0 
dgo_pcnt_cmp_match_forward_mode1 
dgo_pcnt_cmp_match_reverse_mode0 
dgo_pcnt_cmp_match_reverse_mode1 

◆ dgo_pcnt_decode_mode_t

pulse counter decode mode

Enumerator
dgo_pcnt_ab_4x 
dgo_pcnt_ab_2x 
dgo_pcnt_ab_1x 
dgo_pcnt_pd_1x 
dgo_pcnt_pd_f_1x 
dgo_pcnt_pd_2x 
dgo_pcnt_pd_f_2x 
dgo_pcnt_ud_1x 
dgo_pcnt_ud_f_1x 
dgo_pcnt_ud_2x 
dgo_pcnt_ud_f_2x 
dgo_pcnt_ud_uvw_6x 
dgo_pcnt_ud_uvw_6y 

◆ dgo_pcnt_dump_mode_t

pulse counter dump mode

Enumerator
dgo_pcnt_dump_disable 
dgo_pcnt_dump_h_edge_mode 
dgo_pcnt_dump_h_level_mode_with_ab 
dgo_pcnt_dump_h_level_mode 

◆ dgo_pcnt_h_mode_t

pulse counter h phase mode

Enumerator
dgo_pcnt_h_disable 
dgo_pcnt_h_edge_mode 
dgo_pcnt_h_level_mode_with_ab 
dgo_pcnt_h_level_mode 

◆ dgo_pcnt_num_t

pulse counter number

Enumerator
dgo_pcnt_0 

◆ dgo_pcnt_range_cmp_src_t

pulse counter range match mode compare source

Enumerator
dgo_pcnt_cmp_src_line_phase 
dgo_pcnt_cmp_src_revolution_line_phase 
dgo_pcnt_cmp_src_tacho_line 
dgo_pcnt_cmp_src_tacho_time 

◆ dgo_pcnt_tacho_mode_t

pulse counter tacho mode

Enumerator
dgo_pcnt_tacho_disable 
dgo_pcnt_tacho_period_mode 
dgo_pcnt_tacho_travel_mode 

◆ dgo_pcnt_z_mode_t

pulse counter z phase mode

Enumerator
dgo_pcnt_z_disable 
dgo_pcnt_z_edge_mode 
dgo_pcnt_z_level_mode_with_ab 
dgo_pcnt_z_level_mode 

◆ dgo_wakeup_bit_mask_t

wakeup source

Enumerator
dgo_wakeup_wkup_pin 
dgo_wakeup_software 
dgo_wakeup_wuio_pins 
dgo_wakeup_pcap0 
dgo_wakeup_pcnt0 

◆ dgo_wuio_irq_mode_t

filter mode

Enumerator
dgo_wuio_irq_disable 
dgo_wuio_irq_level_mode 
dgo_wuio_irq_rise_edge_mode 
dgo_wuio_irq_both_edge_mode 

◆ dgo_wuio_pin_num_t

wuio pin number

Enumerator
dgo_wuio_pin_0 
dgo_wuio_pin_1 
dgo_wuio_pin_2 
dgo_wuio_pin_3 

Function Documentation

◆ pdgo_disable_pulldown_resistor_for_wakeup_pin()

static void pdgo_disable_pulldown_resistor_for_wakeup_pin ( PDGO_Type ptr)
inlinestatic

Disable pull-down resistor for Wakeup pin

Parameters
[in]ptrDGO base address

◆ pdgo_disable_pullup_resistor_for_reset_pin()

static void pdgo_disable_pullup_resistor_for_reset_pin ( PDGO_Type ptr)
inlinestatic

Disable pull-up resistor for Reset Pin.

Parameters
[in]ptrDGO base address

◆ pdgo_disable_retention_mode()

static void pdgo_disable_retention_mode ( PDGO_Type ptr)
inlinestatic

Disable DGO register retention mode.

Parameters
[in]ptrDGO base address

◆ pdgo_enable_pulldown_resistor_for_wakeup_pin()

static void pdgo_enable_pulldown_resistor_for_wakeup_pin ( PDGO_Type ptr)
inlinestatic

Enable pull-down resistor for Wakeup pin

Parameters
[in]ptrDGO base address

◆ pdgo_enable_pullup_resistor_for_reset_pin()

static void pdgo_enable_pullup_resistor_for_reset_pin ( PDGO_Type ptr)
inlinestatic

Enable pull-up resistor for Reset Pin.

Parameters
[in]ptrDGO base address

◆ pdgo_enable_retention_mode()

static void pdgo_enable_retention_mode ( PDGO_Type ptr)
inlinestatic

Enable DGO register retention mode.

Parameters
[in]ptrDGO base address

◆ pdgo_get_turnoff_counter_from_us()

static uint32_t pdgo_get_turnoff_counter_from_us ( uint32_t  us)
inlinestatic

Convert the microsecond to DGO Turn-off counter value.

Parameters
[in]usmicrosecond to be converted
Returns
Converted DGO Turn-off counter value

< DGO Turn-off counter frequency

◆ pdgo_get_us_from_turnoff_counter()

static uint32_t pdgo_get_us_from_turnoff_counter ( uint32_t  counter)
inlinestatic

Convert the DGO Turn-off counter to microseconds.

Parameters
[in]counterDGO Turn-off counter
Returns
Converted microseconds

< DGO Turn-off counter frequency

< DGO Turn-off counter frequency

◆ pdgo_get_us_from_wakeup_counter()

static uint32_t pdgo_get_us_from_wakeup_counter ( uint32_t  counter)
inlinestatic

Convert the DGO Wake-up counter to microseconds.

Parameters
[in]counterDGO counter
Returns
Converted microseconds

< DGO Wakeup Counter frequency

◆ pdgo_get_wakeup_counter()

static uint32_t pdgo_get_wakeup_counter ( PDGO_Type ptr)
inlinestatic

Get DGO wakeup counter value.

Parameters
[in]ptrDGO base address
Returns
DGO wakeup counter value

◆ pdgo_get_wakeup_counter_from_us()

static uint32_t pdgo_get_wakeup_counter_from_us ( uint32_t  us)
inlinestatic

Convert the microsecond to DGO Wake-up counter value.

Parameters
[in]usmicrosecond to be converted
Returns
Converted DGO Wake-up counter value

< DGO Wakeup Counter frequency

< DGO Wakeup Counter frequency

◆ pdgo_is_retention_mode_enabled()

static bool pdgo_is_retention_mode_enabled ( PDGO_Type ptr)
inlinestatic

Check whether the DGO retention mode is enabled or not.

Parameters
[in]ptrDGO base address
Return values
trueRetention mode is enabled
falseRetention mode is disabled

◆ pdgo_read_gpr()

static uint32_t pdgo_read_gpr ( PDGO_Type ptr,
uint32_t  index 
)
inlinestatic

Read data from DGO GPR register.

Parameters
[in]ptrDGO base address
[in]indexGPR register index
Returns
DGO GPR register value

< DGO GPR register count

◆ pdgo_set_turnoff_counter()

static void pdgo_set_turnoff_counter ( PDGO_Type ptr,
uint32_t  counter 
)
inlinestatic

Set DGO turn-off counter.

Parameters
[in]ptrDGO base address
[in]counterTurn-off counter value. Clock source is 24M

◆ pdgo_set_wakeup_counter()

static void pdgo_set_wakeup_counter ( PDGO_Type ptr,
uint32_t  counter 
)
inlinestatic

Set DGO wakeup counter.

Parameters
[in]ptrDGO base address
[in]counterWakeup counter value. Clock source is 32K.

◆ pdgo_write_gpr()

static void pdgo_write_gpr ( PDGO_Type ptr,
uint32_t  index,
uint32_t  content 
)
inlinestatic

Write data to DGO GPR register.

Parameters
[in]ptrDGO base address
[in]indexGPR register index
[in]contentData to be written to DGO GPR register

< DGO GPR register count