37 #include "hal_platform.h" 39 #ifdef HAL_PWM_MODULE_ENABLED 76 #ifdef HAL_PWM_FEATURE_ADVANCED_CONFIG 246 #ifdef HAL_PWM_FEATURE_ADVANCED_CONFIG 254 HAL_PWM_CLOCK_DIVISION_2 = 1,
255 HAL_PWM_CLOCK_DIVISION_4 = 2,
256 HAL_PWM_CLOCK_DIVISION_8 = 3
257 } hal_pwm_advanced_config_t;
267 #ifdef HAL_PWM_FEATURE_SINGLE_SOURCE_CLOCK 442 #ifdef HAL_PWM_FEATURE_ADVANCED_CONFIG hal_pwm_status_t hal_pwm_init(hal_pwm_source_clock_t source_clock)
This function initializes the PWM hardware source clock.
A wrong PWM channel is given.
Definition: hal_pwm.h:228
The PWM status is idle.
Definition: hal_pwm.h:238
hal_pwm_source_clock_t
pwm clock source seletion
Definition: hal_platform.h:814
hal_pwm_status_t hal_pwm_get_duty_cycle(hal_pwm_channel_t pwm_channel, uint32_t *duty_cycle)
This function gets the current duty cycle of the PWM.
hal_pwm_status_t
This enum defines the API return type.
Definition: hal_pwm.h:226
hal_pwm_status_t hal_pwm_set_frequency(hal_pwm_channel_t pwm_channel, uint32_t frequency, uint32_t *total_count)
This function sets the PWM frequency and retrieves total count of the PWM hardware at the specified f...
An error occurred during the function call.
Definition: hal_pwm.h:227
A wrong parameter is given.
Definition: hal_pwm.h:229
hal_pwm_status_t hal_pwm_start(hal_pwm_channel_t pwm_channel)
This function starts the PWM execution.
hal_pwm_running_status_t
This enum defines the PWM running status.
Definition: hal_pwm.h:237
No error during the function call.
Definition: hal_pwm.h:231
The PWM status is busy.
Definition: hal_pwm.h:239
hal_pwm_status_t hal_pwm_deinit(void)
This function deinitializes the PWM hardware.
hal_pwm_status_t hal_pwm_get_frequency(hal_pwm_channel_t pwm_channel, uint32_t *frequency)
This function gets current frequency of the PWM, the unit of frequency is Hz.
hal_pwm_status_t hal_pwm_set_duty_cycle(hal_pwm_channel_t pwm_channel, uint32_t duty_cycle)
This function sets the PWM duty cycle.
A smaller frequency is given.
Definition: hal_pwm.h:230
hal_pwm_status_t hal_pwm_stop(hal_pwm_channel_t pwm_channel)
This function stops the PWM execution.
hal_pwm_status_t hal_pwm_get_running_status(hal_pwm_channel_t pwm_channel, hal_pwm_running_status_t *running_status)
This function gets the current status of PWM.
hal_pwm_channel_t
pwm channel
Definition: hal_platform.h:781