PWM driver APIs. More...
Data Structures | |
| struct | pwm_cmp_config |
| pwm compare config More... | |
| struct | pwm_output_channel |
| pwm output channel config More... | |
| struct | pwm_fault_source_config |
| pwm fault source config More... | |
| struct | pwm_config |
| pwm config data More... | |
| struct | pwm_pair_config |
| pair pwm config More... | |
Macros | |
| #define | PWM_UNLOCK_KEY (0xB0382607UL) |
| #define | PWM_IRQ_FAULT PWM_IRQEN_FAULTIRQE_MASK |
| #define | PWM_IRQ_EX_RELOAD PWM_IRQEN_XRLDIRQE_MASK |
| #define | PWM_IRQ_HALF_RELOAD PWM_IRQEN_HALFRLDIRQE_MASK |
| #define | PWM_IRQ_RELOAD PWM_IRQEN_RLDIRQE_MASK |
| #define | PWM_IRQ_CMP(x) PWM_IRQEN_CMPIRQEX_SET((1 << x)) |
| #define | PWM_FORCE_OUTPUT(pwm_index, force_output) (force_output << (pwm_index << 1)) |
| #define | PWM_DUTY_CYCLE_FP_MAX ((1U << 24) - 1) |
Typedefs | |
| typedef enum pwm_counter_type | pwm_counter_type_t |
| pwm trigger mode More... | |
| typedef enum pwm_cmp_mode | pwm_cmp_mode_t |
| pwm cmp mode More... | |
| typedef enum pwm_register_update | pwm_shadow_register_update_trigger_t |
| update time of the shadow register More... | |
| typedef enum pwm_fault_mode | pwm_fault_mode_t |
| configure the state of channel 0-7 outputs when the forced output is in effect More... | |
| typedef enum pwm_fault_recovery_trigger | pwm_fault_recovery_trigger_t |
| select when to recover PWM output after fault More... | |
| typedef enum pwm_fault_source | pwm_fault_source_t |
| fault input signal More... | |
| typedef enum pwm_force_source | pwm_force_source_t |
| Select sources for force output. More... | |
| typedef enum pwm_force_cmd_timing | pwm_force_cmd_timing_t |
| select when the FRCMD shadow register will be loaded to its work register More... | |
| typedef enum pwm_output_type | pwm_output_type_t |
| pwm output type More... | |
| typedef struct pwm_cmp_config | pwm_cmp_config_t |
| pwm compare config More... | |
| typedef struct pwm_output_channel | pwm_output_channel_t |
| pwm output channel config More... | |
| typedef struct pwm_fault_source_config | pwm_fault_source_config_t |
| pwm fault source config More... | |
| typedef struct pwm_config | pwm_config_t |
| pwm config data More... | |
| typedef struct pwm_pair_config | pwm_pair_config_t |
| pair pwm config More... | |
Functions | |
| static void | pwm_deinit (PWM_Type *pwm_x) |
| pwm deinitialize function More... | |
| static void | pwm_issue_shadow_register_lock_event (PWM_Type *pwm_x) |
| issue all shawdow register More... | |
| static void | pwm_shadow_register_lock (PWM_Type *pwm_x) |
| lock all shawdow register More... | |
| static void | pwm_shadow_register_unlock (PWM_Type *pwm_x) |
| unlock all shadow register More... | |
| static void | pwm_set_start_count (PWM_Type *pwm_x, uint8_t ex_start, uint32_t start) |
| set counter start value and extended start value More... | |
| static void | pwm_set_reload (PWM_Type *pwm_x, uint8_t ex_reload, uint32_t reload) |
| set the reload value More... | |
| static void | pwm_clear_status (PWM_Type *pwm_x, uint32_t mask) |
| clear pwm status register More... | |
| static uint32_t | pwm_get_status (PWM_Type *pwm_x) |
| get pwm status register More... | |
| static void | pwm_disable_irq (PWM_Type *pwm_x, uint32_t mask) |
| disable pwm irq More... | |
| static void | pwm_enable_irq (PWM_Type *pwm_x, uint32_t mask) |
| enable pwm irq More... | |
| static void | pwm_disable_dma_request (PWM_Type *pwm_x, uint32_t mask) |
| disable pwm dma request More... | |
| static void | pwm_enable_dma_request (PWM_Type *pwm_x, uint32_t mask) |
| enable pwm dma request More... | |
| static void | pwm_set_force_cmd_shadow_register_hwevent (PWM_Type *pwm_x, uint8_t target_cmp_index) |
| set target cmp as hardware event to trigger force cmd output More... | |
| static void | pwm_set_load_counter_shadow_register_trigger (PWM_Type *pwm_x, pwm_shadow_register_update_trigger_t trigger, uint8_t target_cmp_index) |
| set shadow register control register More... | |
| static void | pwm_load_cmp_shadow_on_capture (PWM_Type *pwm_x, uint8_t index, bool is_falling_edge) |
| Configure input capture cmp to trigger shadow register updates. More... | |
| static void | pwm_cmp_disable_half_clock (PWM_Type *pwm_x, uint8_t index) |
| disable pwn cmp half clock More... | |
| static void | pwm_cmp_enable_half_clock (PWM_Type *pwm_x, uint8_t index) |
| enable pwm cmp half clock More... | |
| static void | pwm_cmp_update_jitter_value (PWM_Type *pwm_x, uint8_t index, uint8_t jitter) |
| update pwm cmp jitter counter compare value More... | |
| static void | pwm_cmp_update_cmp_value (PWM_Type *pwm_x, uint8_t index, uint32_t cmp, uint16_t ex_cmp) |
| update pwm cmp value More... | |
| static void | pwm_cmp_force_value (PWM_Type *pwm_x, uint8_t index, uint32_t cmp) |
| Forced update of pwm cmp register value, cmp content guaranteed accurate by user. More... | |
| static void | pwm_config_cmp (PWM_Type *pwm_x, uint8_t index, pwm_cmp_config_t *config) |
| config pwm cmp More... | |
| static void | pwm_config_output_channel (PWM_Type *pwm_x, uint8_t index, pwm_output_channel_t *config) |
| config pwm output channel More... | |
| static void | pwm_config_fault_source (PWM_Type *pwm_x, pwm_fault_source_config_t *config) |
| config pwm fault source More... | |
| static void | pwm_clear_fault (PWM_Type *pwm_x) |
| clear pwm fault status More... | |
| static void | pwm_stop_counter (PWM_Type *pwm_x) |
| stop the pwm timer counter More... | |
| static void | pwm_start_counter (PWM_Type *pwm_x) |
| start pwm timer counter More... | |
| static void | pwm_enable_sw_force (PWM_Type *pwm_x) |
| enable software force More... | |
| static void | pwm_disable_sw_force (PWM_Type *pwm_x) |
| disable software force , force will take effect More... | |
| static void | pwm_enable_reload_at_synci (PWM_Type *pwm_x) |
| enable pwm reload value by synci More... | |
| static void | pwm_disable_output (PWM_Type *pwm_x, uint8_t index) |
| disable pwm output More... | |
| static void | pwm_enable_output (PWM_Type *pwm_x, uint8_t index) |
| enable pwm output More... | |
| static void | pwm_set_force_output (PWM_Type *pwm_x, uint32_t output_mask) |
| config pwm force output level per output channel More... | |
| static void | pwm_config_force_polarity (PWM_Type *pwm_x, bool polarity) |
| config pwm force polarity More... | |
| static void | pwm_config_force_cmd_timing (PWM_Type *pwm_x, pwm_force_cmd_timing_t timing) |
| config the force effective time More... | |
| static void | pwm_enable_pwm_sw_force_output (PWM_Type *pwm_x, uint8_t index) |
| enable pwm sw force output More... | |
| static void | pwm_disable_pwm_sw_force_output (PWM_Type *pwm_x, uint8_t index) |
| disable pwm sw force output More... | |
| static void | pwm_config_pwm (PWM_Type *pwm_x, uint8_t index, pwm_config_t *config, bool enable_pair_mode) |
| config PWM channel configure registe More... | |
| static uint32_t | pwm_get_reload_val (PWM_Type *pwm_x) |
| getting the counter reload value for a pwm timer More... | |
| static uint32_t | pwm_get_ex_reload_val (PWM_Type *pwm_x) |
| getting the extended counter reload value for a pwm timer More... | |
| static uint32_t | pwm_get_counter_val (PWM_Type *pwm_x) |
| getting the value of the pwm counter More... | |
| static uint32_t | pwm_get_ex_counter_val (PWM_Type *pwm_x) |
| getting the value of the pwm extended counter More... | |
| hpm_stat_t | pwm_load_cmp_shadow_on_match (PWM_Type *pwm_x, uint8_t index, pwm_cmp_config_t *config) |
| pwm load cmp shadow on match More... | |
| void | pwm_get_captured_count (PWM_Type *pwm_x, uint32_t *buf, pwm_counter_type_t counter, uint8_t start_index, uint8_t num) |
| pwm get captured count More... | |
| void | pwm_get_default_cmp_config (PWM_Type *pwm_x, pwm_cmp_config_t *config) |
| get default cmp config More... | |
| void | pwm_get_default_output_channel_config (PWM_Type *pwm_x, pwm_output_channel_t *config) |
| get default output channel config More... | |
| void | pwm_get_default_pwm_config (PWM_Type *pwm_x, pwm_config_t *config) |
| get default pwm config More... | |
| void | pwm_get_default_pwm_pair_config (PWM_Type *pwm_x, pwm_pair_config_t *config) |
| get default pwm pair config More... | |
| hpm_stat_t | pwm_setup_waveform (PWM_Type *pwm_x, uint8_t pwm_index, pwm_config_t *pwm_config, uint8_t cmp_start_index, pwm_cmp_config_t *cmp, uint8_t cmp_num) |
| setup waveform More... | |
| hpm_stat_t | pwm_setup_waveform_in_pair (PWM_Type *pwm_x, uint8_t pwm_index, pwm_pair_config_t *pwm_pair_config, uint8_t cmp_start_index, pwm_cmp_config_t *cmp, uint8_t cmp_num) |
| setup pwm waveform in pair More... | |
| hpm_stat_t | pwm_update_raw_cmp_edge_aligned (PWM_Type *pwm_x, uint8_t cmp_index, uint32_t target_cmp) |
| update raw compare value for edge aligned waveform More... | |
| hpm_stat_t | pwm_update_raw_cmp_central_aligned (PWM_Type *pwm_x, uint8_t cmp1_index, uint8_t cmp2_index, uint32_t target_cmp1, uint32_t target_cmp2) |
| update raw compare value for central aligned waveform More... | |
PWM driver APIs.
| #define PWM_DUTY_CYCLE_FP_MAX ((1U << 24) - 1) |
#include <drivers/inc/hpm_pwm_drv.h>
| #define PWM_FORCE_OUTPUT | ( | pwm_index, | |
| force_output | |||
| ) | (force_output << (pwm_index << 1)) |
#include <drivers/inc/hpm_pwm_drv.h>
| #define PWM_IRQ_CMP | ( | x | ) | PWM_IRQEN_CMPIRQEX_SET((1 << x)) |
#include <drivers/inc/hpm_pwm_drv.h>
| #define PWM_IRQ_EX_RELOAD PWM_IRQEN_XRLDIRQE_MASK |
#include <drivers/inc/hpm_pwm_drv.h>
| #define PWM_IRQ_FAULT PWM_IRQEN_FAULTIRQE_MASK |
#include <drivers/inc/hpm_pwm_drv.h>
| #define PWM_IRQ_HALF_RELOAD PWM_IRQEN_HALFRLDIRQE_MASK |
#include <drivers/inc/hpm_pwm_drv.h>
| #define PWM_IRQ_RELOAD PWM_IRQEN_RLDIRQE_MASK |
#include <drivers/inc/hpm_pwm_drv.h>
| #define PWM_UNLOCK_KEY (0xB0382607UL) |
#include <drivers/inc/hpm_pwm_drv.h>
| typedef struct pwm_cmp_config pwm_cmp_config_t |
#include <drivers/inc/hpm_pwm_drv.h>
pwm compare config
| typedef enum pwm_cmp_mode pwm_cmp_mode_t |
#include <drivers/inc/hpm_pwm_drv.h>
pwm cmp mode
| typedef struct pwm_config pwm_config_t |
#include <drivers/inc/hpm_pwm_drv.h>
pwm config data
| typedef enum pwm_counter_type pwm_counter_type_t |
#include <drivers/inc/hpm_pwm_drv.h>
pwm trigger mode
| typedef enum pwm_fault_mode pwm_fault_mode_t |
#include <drivers/inc/hpm_pwm_drv.h>
configure the state of channel 0-7 outputs when the forced output is in effect
| typedef enum pwm_fault_recovery_trigger pwm_fault_recovery_trigger_t |
#include <drivers/inc/hpm_pwm_drv.h>
select when to recover PWM output after fault
| typedef struct pwm_fault_source_config pwm_fault_source_config_t |
#include <drivers/inc/hpm_pwm_drv.h>
pwm fault source config
| typedef enum pwm_fault_source pwm_fault_source_t |
#include <drivers/inc/hpm_pwm_drv.h>
fault input signal
| typedef enum pwm_force_cmd_timing pwm_force_cmd_timing_t |
#include <drivers/inc/hpm_pwm_drv.h>
select when the FRCMD shadow register will be loaded to its work register
| typedef enum pwm_force_source pwm_force_source_t |
#include <drivers/inc/hpm_pwm_drv.h>
Select sources for force output.
| typedef struct pwm_output_channel pwm_output_channel_t |
#include <drivers/inc/hpm_pwm_drv.h>
pwm output channel config
| typedef enum pwm_output_type pwm_output_type_t |
#include <drivers/inc/hpm_pwm_drv.h>
pwm output type
| typedef struct pwm_pair_config pwm_pair_config_t |
#include <drivers/inc/hpm_pwm_drv.h>
pair pwm config
| typedef enum pwm_register_update pwm_shadow_register_update_trigger_t |
#include <drivers/inc/hpm_pwm_drv.h>
update time of the shadow register
| enum pwm_cmp_mode |
#include <drivers/inc/hpm_pwm_drv.h>
pwm cmp mode
| Enumerator | |
|---|---|
| pwm_cmp_mode_output_compare | output compare |
| pwm_cmp_mode_input_capture | input compare |
| enum pwm_counter_type |
#include <drivers/inc/hpm_pwm_drv.h>
pwm trigger mode
| Enumerator | |
|---|---|
| pwm_counter_type_capture_rising_edge | rising edge trigger |
| pwm_counter_type_capture_falling_edge | falling edge trigger |
| enum pwm_fault_mode |
#include <drivers/inc/hpm_pwm_drv.h>
configure the state of channel 0-7 outputs when the forced output is in effect
#include <drivers/inc/hpm_pwm_drv.h>
select when to recover PWM output after fault
| enum pwm_fault_source |
#include <drivers/inc/hpm_pwm_drv.h>
fault input signal
| enum pwm_force_cmd_timing |
#include <drivers/inc/hpm_pwm_drv.h>
select when the FRCMD shadow register will be loaded to its work register
| enum pwm_force_source |
#include <drivers/inc/hpm_pwm_drv.h>
Select sources for force output.
| Enumerator | |
|---|---|
| pwm_force_source_force_input | force output is enabled when FRCI assert |
| pwm_force_source_software | force output is enabled by software write swfrc to 1 |
| enum pwm_output_type |
#include <drivers/inc/hpm_pwm_drv.h>
pwm output type
| Enumerator | |
|---|---|
| pwm_output_0 | output 0 |
| pwm_output_1 | output 1 |
| pwm_output_high_z | output |
| pwm_output_no_force | |
| enum pwm_register_update |
#include <drivers/inc/hpm_pwm_drv.h>
update time of the shadow register
|
inlinestatic |
#include <drivers/inc/hpm_pwm_drv.h>
clear pwm fault status
| [in] | pwm_x | PWM base address, HPM_PWMx(x=0..n) |
|
inlinestatic |
#include <drivers/inc/hpm_pwm_drv.h>
clear pwm status register
| [in] | pwm_x | PWM base address, HPM_PWMx(x=0..n) |
| [in] | mask | :
|
|
inlinestatic |
#include <drivers/inc/hpm_pwm_drv.h>
disable pwn cmp half clock
| [in] | pwm_x | PWM base address, HPM_PWMx(x=0..n) |
| [in] | index | cmp index (0..(PWM_SOC_CMP_MAX_COUNT-1)) |
|
inlinestatic |
#include <drivers/inc/hpm_pwm_drv.h>
enable pwm cmp half clock
| [in] | pwm_x | PWM base address, HPM_PWMx(x=0..n) |
| [in] | index | cmp index (0..(PWM_SOC_CMP_MAX_COUNT-1)) |
|
inlinestatic |
#include <drivers/inc/hpm_pwm_drv.h>
Forced update of pwm cmp register value, cmp content guaranteed accurate by user.
| [in] | pwm_x | PWM base address, HPM_PWMx(x=0..n) |
| [in] | index | cmp index (0..(PWM_SOC_CMP_MAX_COUNT-1)) |
| [in] | cmp | cmp register data |
|
inlinestatic |
#include <drivers/inc/hpm_pwm_drv.h>
update pwm cmp value
| [in] | pwm_x | PWM base address, HPM_PWMx(x=0..n) |
| [in] | index | cmp index (0..(PWM_SOC_CMP_MAX_COUNT-1)) |
| [in] | cmp | clock counter compare value |
| [in] | ex_cmp | extended counter compare value |
|
inlinestatic |
#include <drivers/inc/hpm_pwm_drv.h>
update pwm cmp jitter counter compare value
| [in] | pwm_x | PWM base address, HPM_PWMx(x=0..n) |
| [in] | index | cmp index (0..(PWM_SOC_CMP_MAX_COUNT-1)) |
| [in] | jitter | jitter value |
|
inlinestatic |
#include <drivers/inc/hpm_pwm_drv.h>
config pwm cmp
| [in] | pwm_x | PWM base address, HPM_PWMx(x=0..n) |
| [in] | index | cmp index (0..(PWM_SOC_CMP_MAX_COUNT-1)) |
| [in] | config | pwm_cmp_config_t |
|
inlinestatic |
#include <drivers/inc/hpm_pwm_drv.h>
config pwm fault source
| [in] | pwm_x | PWM base address, HPM_PWMx(x=0..n) |
| [in] | config | pwm_fault_source_config_t |
|
inlinestatic |
#include <drivers/inc/hpm_pwm_drv.h>
config the force effective time
| [in] | pwm_x | PWM base address, HPM_PWMx(x=0..n) |
| [in] | timing | pwm_force_cmd_timing_t |
|
inlinestatic |
#include <drivers/inc/hpm_pwm_drv.h>
config pwm force polarity
| [in] | pwm_x | PWM base address, HPM_PWMx(x=0..n) |
| [in] | polarity | polarity of input pwm_force
|
|
inlinestatic |
#include <drivers/inc/hpm_pwm_drv.h>
config pwm output channel
| [in] | pwm_x | PWM base address, HPM_PWMx(x=0..n) |
| [in] | index | channel index (0..(PWM_SOC_PWM_MAX_COUNT-1)) |
| [in] | config | pwm_output_channel_t |
|
inlinestatic |
#include <drivers/inc/hpm_pwm_drv.h>
config PWM channel configure registe
| [in] | pwm_x | PWM base address, HPM_PWMx(x=0..n) |
| [in] | index | pwm channel index (0..(PWM_SOC_PWM_MAX_COUNT-1)) |
| [in] | config | pwm_config_t |
| [in] | enable_pair_mode | enable pair mode
|
|
inlinestatic |
#include <drivers/inc/hpm_pwm_drv.h>
pwm deinitialize function
| [in] | pwm_x | PWM base address, HPM_PWMx(x=0..n) |
|
inlinestatic |
#include <drivers/inc/hpm_pwm_drv.h>
disable pwm dma request
| [in] | pwm_x | PWM base address, HPM_PWMx(x=0..n) |
| [in] | mask | :
|
|
inlinestatic |
#include <drivers/inc/hpm_pwm_drv.h>
disable pwm irq
| [in] | pwm_x | PWM base address, HPM_PWMx(x=0..n) |
| [in] | mask | :
|
|
inlinestatic |
#include <drivers/inc/hpm_pwm_drv.h>
disable pwm output
| [in] | pwm_x | PWM base address, HPM_PWMx(x=0..n) |
| [in] | index | pwm index (0..(PWM_SOC_CMP_MAX_COUNT-1)) |
|
inlinestatic |
#include <drivers/inc/hpm_pwm_drv.h>
disable pwm sw force output
| [in] | pwm_x | PWM base address, HPM_PWMx(x=0..n) |
| [in] | index | pwm cmp index (0..(PWM_SOC_CMP_MAX_COUNT-1)) |
|
inlinestatic |
#include <drivers/inc/hpm_pwm_drv.h>
disable software force , force will take effect
| [in] | pwm_x | PWM base address, HPM_PWMx(x=0..n) |
|
inlinestatic |
#include <drivers/inc/hpm_pwm_drv.h>
enable pwm dma request
| [in] | pwm_x | PWM base address, HPM_PWMx(x=0..n) |
| [in] | mask | :
|
|
inlinestatic |
#include <drivers/inc/hpm_pwm_drv.h>
enable pwm irq
| [in] | pwm_x | PWM base address, HPM_PWMx(x=0..n) |
| [in] | mask | :
|
|
inlinestatic |
#include <drivers/inc/hpm_pwm_drv.h>
enable pwm output
| [in] | pwm_x | PWM base address, HPM_PWMx(x=0..n) |
| [in] | index | pwm index (0..(PWM_SOC_CMP_MAX_COUNT-1)) |
|
inlinestatic |
#include <drivers/inc/hpm_pwm_drv.h>
enable pwm sw force output
| [in] | pwm_x | PWM base address, HPM_PWMx(x=0..n) |
| [in] | index | pwm cmp index (0..(PWM_SOC_CMP_MAX_COUNT-1)) |
|
inlinestatic |
#include <drivers/inc/hpm_pwm_drv.h>
enable pwm reload value by synci
| [in] | pwm_x | PWM base address, HPM_PWMx(x=0..n) |
|
inlinestatic |
#include <drivers/inc/hpm_pwm_drv.h>
enable software force
| [in] | pwm_x | PWM base address, HPM_PWMx(x=0..n) |
| void pwm_get_captured_count | ( | PWM_Type * | pwm_x, |
| uint32_t * | buf, | ||
| pwm_counter_type_t | counter, | ||
| uint8_t | start_index, | ||
| uint8_t | num | ||
| ) |
#include <drivers/inc/hpm_pwm_drv.h>
pwm get captured count
| [in] | pwm_x | PWM base address, HPM_PWMx(x=0..n) |
| [out] | buf | count value |
| [in] | counter | pwm_counter_type_t |
| [in] | start_index | start capture index (0..(PWM_SOC_CMP_MAX_COUNT-1)) |
| [in] | num | capture num (1..PWM_SOC_CMP_MAX_COUNT) |
|
inlinestatic |
#include <drivers/inc/hpm_pwm_drv.h>
getting the value of the pwm counter
| pwm_x | PWM base address, HPM_PWMx(x=0..n) |
| pwm | counter value |
| void pwm_get_default_cmp_config | ( | PWM_Type * | pwm_x, |
| pwm_cmp_config_t * | config | ||
| ) |
#include <drivers/inc/hpm_pwm_drv.h>
get default cmp config
| [in] | pwm_x | PWM base address, HPM_PWMx(x=0..n) |
| [out] | config | pwm_cmp_config_t |
| void pwm_get_default_output_channel_config | ( | PWM_Type * | pwm_x, |
| pwm_output_channel_t * | config | ||
| ) |
#include <drivers/inc/hpm_pwm_drv.h>
get default output channel config
| [in] | pwm_x | PWM base address, HPM_PWMx(x=0..n) |
| [out] | config | pwm_output_channel_t |
| void pwm_get_default_pwm_config | ( | PWM_Type * | pwm_x, |
| pwm_config_t * | config | ||
| ) |
#include <drivers/inc/hpm_pwm_drv.h>
get default pwm config
| [in] | pwm_x | PWM base address, HPM_PWMx(x=0..n) |
| [out] | config | pwm_config_t |
| void pwm_get_default_pwm_pair_config | ( | PWM_Type * | pwm_x, |
| pwm_pair_config_t * | config | ||
| ) |
#include <drivers/inc/hpm_pwm_drv.h>
get default pwm pair config
| [in] | pwm_x | PWM base address, HPM_PWMx(x=0..n) |
| [out] | config | pwm_pair_config_t |
|
inlinestatic |
#include <drivers/inc/hpm_pwm_drv.h>
getting the value of the pwm extended counter
| pwm_x | PWM base address, HPM_PWMx(x=0..n) |
| pwm | counter value |
|
inlinestatic |
#include <drivers/inc/hpm_pwm_drv.h>
getting the extended counter reload value for a pwm timer
| pwm_x | PWM base address, HPM_PWMx(x=0..n) |
| pwm | extended reload value |
|
inlinestatic |
#include <drivers/inc/hpm_pwm_drv.h>
getting the counter reload value for a pwm timer
| pwm_x | PWM base address, HPM_PWMx(x=0..n) |
| pwm | reload value |
|
inlinestatic |
#include <drivers/inc/hpm_pwm_drv.h>
get pwm status register
| [in] | pwm_x | PWM base address, HPM_PWMx(x=0..n) |
| uint32_t | SR register value |
|
inlinestatic |
#include <drivers/inc/hpm_pwm_drv.h>
issue all shawdow register
| [in] | pwm_x | PWM base address, HPM_PWMx(x=0..n) |
|
inlinestatic |
#include <drivers/inc/hpm_pwm_drv.h>
Configure input capture cmp to trigger shadow register updates.
| [in] | pwm_x | PWM base address, HPM_PWMx(x=0..n) |
| [in] | index | cmp index (0..(PWM_SOC_CMP_MAX_COUNT-1)) |
| [in] | is_falling_edge | which edge is used as shadow register hardware load event
|
| hpm_stat_t pwm_load_cmp_shadow_on_match | ( | PWM_Type * | pwm_x, |
| uint8_t | index, | ||
| pwm_cmp_config_t * | config | ||
| ) |
#include <drivers/inc/hpm_pwm_drv.h>
pwm load cmp shadow on match
| [in] | pwm_x | PWM base address, HPM_PWMx(x=0..n) |
| [in] | index | cmp index (0..(PWM_SOC_CMP_MAX_COUNT-1)) |
| [in] | config | pwm_cmp_config_t |
| status_invalid_argument | or status_success |
|
inlinestatic |
#include <drivers/inc/hpm_pwm_drv.h>
set target cmp as hardware event to trigger force cmd output
| [in] | pwm_x | PWM base address, HPM_PWMx(x=0..n) |
| [in] | target_cmp_index | cmp index select one of the cmp as hardware event time to load FRCMD shadow registers [0-23] |
|
inlinestatic |
#include <drivers/inc/hpm_pwm_drv.h>
config pwm force output level per output channel
| [in] | pwm_x | PWM base address, HPM_PWMx(x=0..n) |
| [in] | output_mask | PWM output channel force level, set it using the macro |
|
inlinestatic |
#include <drivers/inc/hpm_pwm_drv.h>
set shadow register control register
| [in] | pwm_x | PWM base address, HPM_PWMx(x=0..n) |
| [in] | trigger | select when the counter related shadow registers pwm_shadow_register_update_trigger_t |
| [in] | target_cmp_index | select one of the comparators as hardware event (0..(PWM_SOC_CMP_MAX_COUNT-1)) |
|
inlinestatic |
#include <drivers/inc/hpm_pwm_drv.h>
set the reload value
| [in] | pwm_x | PWM base address, HPM_PWMx(x=0..n) |
| [in] | ex_reload | pwm timer counter extended reload value |
| [in] | reload | pwm timer counter reload value |
|
inlinestatic |
#include <drivers/inc/hpm_pwm_drv.h>
set counter start value and extended start value
| [in] | pwm_x | PWM base address, HPM_PWMx(x=0..n) |
| [in] | ex_start | pwm timer counter extended start value |
| [in] | start | pwm timer counter start value |
| hpm_stat_t pwm_setup_waveform | ( | PWM_Type * | pwm_x, |
| uint8_t | pwm_index, | ||
| pwm_config_t * | pwm_config, | ||
| uint8_t | cmp_start_index, | ||
| pwm_cmp_config_t * | cmp, | ||
| uint8_t | cmp_num | ||
| ) |
#include <drivers/inc/hpm_pwm_drv.h>
setup waveform
| [in] | pwm_x | PWM base address, HPM_PWMx(x=0..n) |
| [in] | pwm_index | pwm channel index (0..(PWM_SOC_PWM_MAX_COUNT-1)) |
| [in] | pwm_config | pwm_config_t |
| [in] | cmp_start_index | pwm cmp index (0..(PWM_SOC_PWM_MAX_COUNT-1)) |
| [in] | cmp | pwm_cmp_config_t |
| [in] | cmp_num | cmp num (1..PWM_SOC_CMP_MAX_COUNT), cmp[cmp_num-1] must not overflow |
| hpm_stat_t |
| hpm_stat_t pwm_setup_waveform_in_pair | ( | PWM_Type * | pwm_x, |
| uint8_t | pwm_index, | ||
| pwm_pair_config_t * | pwm_pair_config, | ||
| uint8_t | cmp_start_index, | ||
| pwm_cmp_config_t * | cmp, | ||
| uint8_t | cmp_num | ||
| ) |
#include <drivers/inc/hpm_pwm_drv.h>
setup pwm waveform in pair
| [in] | pwm_x | PWM base address, HPM_PWMx(x=0..n) |
| [in] | pwm_index | pwm channel index (0..(PWM_SOC_PWM_MAX_COUNT-1)) |
| [in] | pwm_pair_config | pwm_pair_config_t |
| [in] | cmp_start_index | pwm cmp index (0..(PWM_SOC_PWM_MAX_COUNT-1)) |
| [in] | cmp | pwm_cmp_config_t |
| [in] | cmp_num | cmp num (1..PWM_SOC_CMP_MAX_COUNT), cmp[cmp_num-1] must not overflow |
| hpm_stat_t | status_invalid_argument or status_success |
|
inlinestatic |
#include <drivers/inc/hpm_pwm_drv.h>
lock all shawdow register
| [in] | pwm_x | PWM base address, HPM_PWMx(x=0..n) |
|
inlinestatic |
#include <drivers/inc/hpm_pwm_drv.h>
unlock all shadow register
| [in] | pwm_x | PWM base address, HPM_PWMx(x=0..n) |
|
inlinestatic |
#include <drivers/inc/hpm_pwm_drv.h>
start pwm timer counter
| [in] | pwm_x | PWM base address, HPM_PWMx(x=0..n) |
|
inlinestatic |
#include <drivers/inc/hpm_pwm_drv.h>
stop the pwm timer counter
| [in] | pwm_x | PWM base address, HPM_PWMx(x=0..n) |
| hpm_stat_t pwm_update_raw_cmp_central_aligned | ( | PWM_Type * | pwm_x, |
| uint8_t | cmp1_index, | ||
| uint8_t | cmp2_index, | ||
| uint32_t | target_cmp1, | ||
| uint32_t | target_cmp2 | ||
| ) |
#include <drivers/inc/hpm_pwm_drv.h>
update raw compare value for central aligned waveform
| [in] | pwm_x | PWM base address, HPM_PWMx(x=0..n) |
| [in] | cmp1_index | index of cmp1 to be adjusted (cmp1_index must be even number) |
| [in] | cmp2_index | index of cmp2 to be adjusted (cmp2_index must be odd number) |
| [in] | target_cmp1 | target compare value for cmp1 |
| [in] | target_cmp2 | target compare value for cmp2 |
| hpm_stat_t | status_invalid_argument or status_success cmp1_index |
| hpm_stat_t pwm_update_raw_cmp_edge_aligned | ( | PWM_Type * | pwm_x, |
| uint8_t | cmp_index, | ||
| uint32_t | target_cmp | ||
| ) |
#include <drivers/inc/hpm_pwm_drv.h>
update raw compare value for edge aligned waveform
| [in] | pwm_x | PWM base address, HPM_PWMx(x=0..n) |
| [in] | cmp_index | index of cmp to be adjusted (0..(PWM_SOC_PWM_MAX_COUNT-1)) |
| [in] | target_cmp | target compare value |
| hpm_stat_t | status_invalid_argument or status_success |