PDGO driver APIs. More...
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... | |
| 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_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_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_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... | |
PDGO driver APIs.
| float pdgo_calc_pcnt_tacho_cycles_per_line | ( | PDGO_Type * | ptr, |
| dgo_pcnt_num_t | num | ||
| ) |
Calculate PCNT tacho, unit: cycles per line.
| [in] | ptr | DGO base address |
| [in] | num | dgo_pcnt_num_t |
|
inlinestatic |
Clear irq0 status.
| [in] | ptr | DGO base address |
| [in] | mask | dgo_irq0_bit_mask_t |
|
inlinestatic |
Clear irq1 status.
| [in] | ptr | DGO base address |
| [in] | mask | dgo_irq1_bit_mask_t |
|
inlinestatic |
Clear Wake-up status.
| [in] | ptr | DGO base address |
| [in] | mask | dgo_wakeup_bit_mask_t |
| void pdgo_config_pcap | ( | PDGO_Type * | ptr, |
| dgo_pcap_num_t | num, | ||
| dgo_pcap_cfg_t * | cfg | ||
| ) |
Config pulse capture.
| [in] | ptr | DGO base address |
| [in] | num | dgo_pcap_num_t |
| [in] | cfg | dgo_pcap_cfg_t |
| void pdgo_config_pcnt | ( | PDGO_Type * | ptr, |
| dgo_pcnt_num_t | num, | ||
| dgo_pcnt_cfg_t * | cfg | ||
| ) |
Config pulse capture.
| [in] | ptr | DGO base address |
| [in] | num | dgo_pcnt_num_t |
| [in] | cfg | dgo_pcnt_cfg_t |
| void pdgo_config_pcnt_range_compare | ( | PDGO_Type * | ptr, |
| dgo_pcnt_num_t | num, | ||
| uint32_t | cmp0, | ||
| uint32_t | cmp1 | ||
| ) |
Config PCNT range compare.
| [in] | ptr | DGO base address |
| [in] | num | dgo_pcnt_num_t |
| [in] | cmp0 | compare0 value |
| [in] | cmp1 | compare1 value |
| void pdgo_config_wuio_filter | ( | PDGO_Type * | ptr, |
| dgo_wuio_pin_num_t | num, | ||
| dgo_wuio_filter_cfg_t * | cfg | ||
| ) |
Config wakeup IO filter.
| [in] | ptr | DGO base address |
| [in] | num | dgo_wuio_pin_num_t |
| [in] | cfg | dgo_wuio_filter_cfg_t |
| 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.
| [in] | ptr | DGO base address |
| [in] | num | dgo_pcnt_num_t |
| [in] | counter | data. dgo_pcnt_counter_t |
|
inlinestatic |
Disable DGO all interrupts.
| [in] | ptr | DGO base address |
|
inlinestatic |
Disable DGO interrupt0 by bit mask.
| [in] | ptr | DGO base address |
| [in] | mask | dgo_irq0_bit_mask_t |
|
inlinestatic |
Disable DGO interrupt1 by bit mask.
| [in] | ptr | DGO base address |
| [in] | mask | dgo_irq1_bit_mask_t |
|
inlinestatic |
Disable PCNT dir override.
| [in] | ptr | DGO base address |
| [in] | num | dgo_pcnt_num_t |
|
inlinestatic |
Disable pull-down resistor for Wakeup pin [in] ptr DGO base address
|
inlinestatic |
Disable pull-down resistor for Wakeup IO pin
| [in] | ptr | DGO base address |
| [in] | num | dgo_wuio_pin_num_t |
|
inlinestatic |
Disable pull-up resistor for Reset Pin [in] ptr DGO base address.
|
inlinestatic |
Disable pulse capture0 Wake-up feature on DGO.
| [in] | ptr | DGO base address |
|
inlinestatic |
Disable pulse counter0 Wake-up feature on DGO.
| [in] | ptr | DGO base address |
|
inlinestatic |
Disable DGO register retention mode.
| [in] | ptr | DGO base address |
|
inlinestatic |
Disable Software Wake-up feature on DGO.
| [in] | ptr | DGO base address |
|
inlinestatic |
Disable Wake-up by bit mask.
| [in] | ptr | DGO base address |
| [in] | mask | dgo_wakeup_bit_mask_t |
|
inlinestatic |
Disable wkup pin Wake-up feature on DGO.
| [in] | ptr | DGO base address |
|
inlinestatic |
Disable wakeup pin or software wakeup.
| [in] | ptr | DGO base address |
|
inlinestatic |
Disable wuio pins Wake-up feature on DGO.
| [in] | ptr | DGO base address |
|
inlinestatic |
Set DGO to automatic wakeup mode.
| [in] | ptr | DGO base address |
|
inlinestatic |
Enable DGO interrupt0 by bit mask.
| [in] | ptr | DGO base address |
| [in] | mask | dgo_irq0_bit_mask_t |
|
inlinestatic |
Enable DGO interrupt1 by bit mask.
| [in] | ptr | DGO base address |
| [in] | mask | dgo_irq0_bit_mask_t |
|
inlinestatic |
Set DGO to one-shot wakeup mode.
| [in] | ptr | DGO base address |
|
inlinestatic |
Enable PCNT dir override.
| [in] | ptr | DGO base address |
| [in] | num | dgo_pcnt_num_t |
|
inlinestatic |
Enable pull-down resistor for Wakeup pin [in] ptr DGO base address
|
inlinestatic |
Enable pull-down resistor for Wakeup IO pin
| [in] | ptr | DGO base address |
| [in] | num | dgo_wuio_pin_num_t |
|
inlinestatic |
Enable pull-up resistor for Reset Pin [in] ptr DGO base address.
|
inlinestatic |
Enable pulse capture0 Wake-up feature on DGO.
| [in] | ptr | DGO base address |
|
inlinestatic |
Enable pulse counter0 Wake-up feature on DGO.
| [in] | ptr | DGO base address |
|
inlinestatic |
Enable DGO register retention mode.
| [in] | ptr | DGO base address |
|
inlinestatic |
Enable Software Wake-up feature on DGO.
| [in] | ptr | DGO base address |
|
inlinestatic |
Enable Wake-up by bit mask.
| [in] | ptr | DGO base address |
| [in] | mask | dgo_wakeup_bit_mask_t |
|
inlinestatic |
Enable wkup pin Wake-up feature on DGO.
| [in] | ptr | DGO base address |
|
inlinestatic |
Enable wakeup pin or software wakeup.
| [in] | ptr | DGO base address |
|
inlinestatic |
Enable wuio pins Wake-up feature on DGO.
| [in] | ptr | DGO base address |
|
inlinestatic |
Get DGO interrupt0 enable status.
| [in] | ptr | DGO base address |
|
inlinestatic |
|
inlinestatic |
Get DGO interrupt1 enable status.
| [in] | ptr | DGO base address |
|
inlinestatic |
|
inlinestatic |
Get PCAP counter value.
| [in] | ptr | DGO base address |
| [in] | num | dgo_pcap_num_t |
| void pdgo_get_pcnt_counter | ( | PDGO_Type * | ptr, |
| dgo_pcnt_num_t | num, | ||
| dgo_pcnt_counter_t * | counter | ||
| ) |
Get PCNT counter.
| [in] | ptr | DGO base address |
| [in] | num | dgo_pcnt_num_t |
| [out] | counter | data. dgo_pcnt_counter_t |
| void pdgo_get_pcnt_defconfig | ( | PDGO_Type * | ptr, |
| dgo_pcnt_num_t | num, | ||
| dgo_pcnt_cfg_t * | cfg | ||
| ) |
Get pulse capture default config.
| [in] | ptr | DGO base address |
| [in] | num | dgo_pcnt_num_t |
| [out] | cfg | dgo_pcnt_cfg_t |
|
inlinestatic |
Get PCNT raw counter value.
| [in] | ptr | DGO base address |
| [in] | num | dgo_pcnt_num_t |
|
inlinestatic |
Convert the microsecond to DGO Turn-off counter value.
| [in] | us | microsecond to be converted |
< DGO Turn-off counter frequency
|
inlinestatic |
Convert the DGO Turn-off counter to microseconds.
| [in] | counter | DGO Turn-off counter |
< DGO Turn-off counter frequency
< DGO Turn-off counter frequency
|
inlinestatic |
Convert the DGO Wake-up counter to microseconds.
| [in] | counter | DGO counter |
< DGO Wakeup Counter frequency
|
inlinestatic |
Get DGO wakeup counter value.
| [in] | ptr | DGO base address |
|
inlinestatic |
Convert the microsecond to DGO Wake-up counter value.
| [in] | us | microsecond to be converted |
< DGO Wakeup Counter frequency
< DGO Wakeup Counter frequency
|
inlinestatic |
Get Wake-up status.
| [in] | ptr | DGO base address |
|
inlinestatic |
Check whether Auto wake-up is enabled.
| [in] | ptr | DGO base address |
| true | - Auto wake-up is enabled |
| false | - Auto wake-up is disabled |
|
inlinestatic |
Check whether DGO is waked up by Wake-up/Reset Pin.
| [in] | ptr | DGO base address |
| true | if DGO is waked up by Wakeup/Reset pin |
|
inlinestatic |
Check whether the DGO retention mode is enabled or not.
| [in] | ptr | DGO base address |
| true | Retention mode is enabled |
| false | Retention mode is disabled |
|
inlinestatic |
Read data from DGO GPR register.
| [in] | ptr | DGO base address |
| [in] | index | GPR register index |
< DGO GPR register count
|
inlinestatic |
Set DGO cycle wakeup counter.
| [in] | ptr | DGO base address |
| [in] | counter | Wakeup counter value. Clock source is 32K. |
|
inlinestatic |
Set PCAP counter value.
| [in] | ptr | DGO base address |
| [in] | num | dgo_pcap_num_t |
| [in] | value | counter value |
|
inlinestatic |
Set PCAP enable.
| [in] | ptr | DGO base address |
| [in] | num | dgo_pcap_num_t |
| [in] | enable | true to enable, false to disable |
|
inlinestatic |
Set PCNT cmp0 value.
| [in] | ptr | DGO base address |
| [in] | num | dgo_pcnt_num_t |
| [in] | value | cmp0 value |
|
inlinestatic |
Set PCNT cmp1 value.
| [in] | ptr | DGO base address |
| [in] | num | dgo_pcnt_num_t |
| [in] | value | cmp1 value |
|
inlinestatic |
Set PCNT cmp mode.
| [in] | ptr | DGO base address |
| [in] | num | dgo_pcnt_num_t |
| [in] | mode | cmp mode dgo_pcnt_cmp_mode_t |
|
inlinestatic |
Set PCNT dir override value.
| [in] | ptr | DGO base address |
| [in] | num | dgo_pcnt_num_t |
| [in] | reverse | true:reverse, false:forward |
|
inlinestatic |
Set PCNT enable.
| [in] | ptr | DGO base address |
| [in] | num | dgo_pcnt_num_t |
| [in] | enable | true to enable, false to disable |
|
inlinestatic |
Set PCNT raw counter value.
| [in] | ptr | DGO base address |
| [in] | num | dgo_pcnt_num_t |
| [in] | value | counter value |
|
inlinestatic |
Set DGO turn-off counter.
| [in] | ptr | DGO base address |
| [in] | counter | Turn-off counter value. Clock source is 24M |
|
inlinestatic |
Set DGO wakeup counter.
| [in] | ptr | DGO base address |
| [in] | wakeup_ctr | Wakeup counter value. clock source is 32K |
|
inlinestatic |
Set WUIO pin enable.
| [in] | ptr | DGO base address |
| [in] | num | dgo_wuio_pin_num_t |
| [in] | enable | true to enable, false to disable |
|
inlinestatic |
Write data to DGO GPR register.
| [in] | ptr | DGO base address |
| [in] | index | GPR register index |
| [in] | content | Data to be written to DGO GPR register |
< DGO GPR register count