Go to the documentation of this file.
258 uint32_t retention[15];
302 #define HAL_PWM_ERROR_NONE (0x00000000U)
303 #define HAL_PWM_CHANNEL_A_ERROR (0x00000001U)
304 #define HAL_PWM_CHANNEL_B_ERROR (0x00000002U)
305 #define HAL_PWM_CHANNEL_C_ERROR (0x00000004U)
311 #define PWM_ALIGNED_EDGE LL_PWM_EDGE_ALIGNED
312 #define PWM_ALIGNED_CENTER LL_PWM_CENTER_ALIGNED
318 #define PWM_STOP_LVL_LOW LL_PWM_STOP_LVL_LOW
319 #define PWM_STOP_LVL_HIGH LL_PWM_STOP_LVL_HIGH
325 #define PWM_WAITING_TIME_LVL_LOW LL_PWM_WAITING_TIME_LVL_LOW
326 #define PWM_WAITING_TIME_LVL_HIGH LL_PWM_WAITING_TIME_LVL_HIGH
332 #define PWM_CODING_CHANNEL_ALL LL_PWM_CODING_CHANNEL_ALL
333 #define PWM_CODING_CHANNEL_A LL_PWM_CODING_CHANNEL_A
339 #define PWM_DRIVEPOLARITY_NEGATIVE LL_PWM_DRIVEPOLARITY_NEGATIVE
340 #define PWM_DRIVEPOLARITY_POSITIVE LL_PWM_DRIVEPOLARITY_POSITIVE
346 #define PWM_ACTIONEVENT_NONE LL_PWM_ACTIONEVENT_NONE
347 #define PWM_ACTIONEVENT_CLEAR LL_PWM_ACTIONEVENT_CLEAR
348 #define PWM_ACTIONEVENT_SET LL_PWM_ACTIONEVENT_SET
349 #define PWM_ACTIONEVENT_TOGGLE LL_PWM_ACTIONEVENT_TOGGLE
362 #define __HAL_PWM_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->state = HAL_PWM_STATE_RESET)
368 #define __HAL_PWM_ENABLE(__HANDLE__) SET_BITS((__HANDLE__)->p_instance->MODE, PWM_MODE_EN)
374 #define __HAL_PWM_DISABLE(__HANDLE__) CLEAR_BITS((__HANDLE__)->p_instance->MODE, PWM_MODE_EN)
380 #define __HAL_PWM_ENABLE_BREATH(__HANDLE__) SET_BITS((__HANDLE__)->p_instance->MODE, PWM_MODE_BREATHEN)
386 #define __HAL_PWM_DISABLE_BREATH(__HANDLE__) CLEAR_BITS((__HANDLE__)->p_instance->MODE, PWM_MODE_BREATHEN)
400 #define IS_PWM_MODE(__MODE__) (((__MODE__) == PWM_FLICKER_MODE) || \
401 ((__MODE__) == PWM_BREATH_MODE) || \
402 ((__MODE__) == PWM_CODING_MODE))
409 #define IS_PWM_ALIGNMENT_MODE(__MODE__) (((__MODE__) == PWM_ALIGNED_EDGE) || \
410 ((__MODE__) == PWM_ALIGNED_CENTER))
417 #define IS_PWM_STOP_LVL(__MODE__) (((__MODE__) == PWM_STOP_LVL_LOW) || \
418 ((__MODE__) == PWM_STOP_LVL_HIGH))
425 #define IS_PWM_WAITING_TIME_LVL(__MODE__) (((__MODE__) == PWM_WAITING_TIME_LVL_LOW) || \
426 ((__MODE__) == PWM_WAITING_TIME_LVL_HIGH))
433 #define IS_PWM_DRIVEPOLARITY(__POLARITY__) (((__POLARITY__) == PWM_DRIVEPOLARITY_NEGATIVE) || \
434 ((__POLARITY__) == PWM_DRIVEPOLARITY_POSITIVE))
hal_status_t hal_pwm_pause(pwm_handle_t *p_pwm)
Pause the PWM signal generation on the output.
PWM Init Structure definition.
pwm_coding_channel_init_t channel_c
hal_status_t hal_pwm_init(pwm_handle_t *p_pwm)
Initialize the PWM mode according to the specified parameters in the pwm_init_t and initialize the as...
pwm_coding_channel_init_t channel_a
HAL_PWM Callback function definition.
hal_status_t hal_pwm_resume(pwm_handle_t *p_pwm)
Resume the PWM signal generation on the output.
This file contains all the functions prototypes for the HAL module driver.
PWM COMP value init Structure definition.
pwm_none_coding_channel_init_t channel_c
void hal_pwm_msp_deinit(pwm_handle_t *p_pwm)
De-initialize the PWM MSP.
PWM None Coding Init Structure definition.
pwm_none_coding_init_t none_coding_mode_cfg
void hal_pwm_suspend_reg(pwm_handle_t *p_pwm)
Suspend some registers related to PWM configuration before sleep.
hal_status_t hal_pwm_deinit(pwm_handle_t *p_pwm)
De-initialize the PWM peripheral.
struct _hal_pwm_callback hal_pwm_callback_t
HAL_PWM Callback function definition.
@ HAL_PWM_ACTIVE_CHANNEL_C
hal_pwm_mode_t
HAL_PWM_MODE Enumerations definition.
hal_status_t hal_pwm_inactive_channel(const pwm_handle_t *p_pwm, hal_pwm_active_channel_t channel)
Set the specified PWM channel inactive.
hal_status_t hal_pwm_start_coding_in_three_channels(pwm_handle_t *p_pwm, uint32_t coding_data0, uint32_t coding_data1, uint32_t coding_data2)
Start generate three channels wave form in Interrupt mode.
@ HAL_PWM_ACTIVE_CHANNEL_B
hal_status_t hal_pwm_start_coding_with_dma(pwm_handle_t *p_pwm, uint32_t *p_data, uint16_t size)
Start generate wave form in DMA mode.
hal_pm_status_t hal_pm_pwm_suspend(pwm_handle_t *p_pwm)
Suspend the specified PWM.
PWM Coding Init Structure definition.
void hal_pm_pwm_resume(const pwm_handle_t *p_pwm)
Resume the specified PWM.
hal_status_t hal_pwm_stop(pwm_handle_t *p_pwm)
Stops the PWM signal generation on the output.
hal_pwm_active_channel_t
HAL PWM active channel Enumerations definition.
Header file containing functions prototypes of PWM LL library.
pwm_coding_init_t coding_mode_cfg
PWM handle Structure definition.
pwm_none_coding_channel_init_t channel_b
hal_status_t
HAL Status structures definition.
This file contains HAL common definitions, enumeration, macros and structures definitions.
@ HAL_PWM_ACTIVE_CHANNEL_ALL
uint8_t coding_channel_select
hal_status_t hal_pwm_start(pwm_handle_t *p_pwm)
Starts the PWM signal generation on the output.
hal_pwm_state_t
HAL PWM State Enumerations definition.
__IO hal_pwm_state_t state
@ HAL_PWM_ACTIVE_CHANNEL_A
void(* pwm_msp_init)(pwm_handle_t *p_pwm)
hal_pwm_state_t hal_pwm_get_state(const pwm_handle_t *p_pwm)
Return the PWM handle state.
Header file containing functions prototypes of DMA HAL library.
hal_status_t hal_pwm_start_coding_in_one_channel(pwm_handle_t *p_pwm, uint32_t coding_data)
Start generate one channel wave form in Interrupt mode.
pwm_none_coding_channel_init_t channel_a
void hal_pwm_msp_init(pwm_handle_t *p_pwm)
Initialize the PWM MSP.
pwm_coding_channel_init_t channel_b
PWM Coding Channel init Structure definition.
@ HAL_PWM_ACTIVE_CHANNEL_CLEARED
PWM None Coding Channel init Structure definition.
hal_status_t hal_pwm_set_coding_data_in_one_channel(const pwm_handle_t *p_pwm, uint32_t coding_data)
Set pwm coding data.
hal_status_t hal_pwm_set_coding_data_in_three_channels(const pwm_handle_t *p_pwm, uint32_t coding_data0, uint32_t coding_data1, uint32_t coding_data2)
Set pwm coding data.
hal_status_t hal_pwm_config_channel(pwm_handle_t *p_pwm, const pwm_none_coding_channel_init_t *p_config, hal_pwm_active_channel_t channel)
Initialize the PWM channels according to the specified parameters in the pwm_init_t.
DMA handle Structure definition.
hal_status_t hal_pwm_update_freq(pwm_handle_t *p_pwm, uint32_t freq)
Update the PWM frequency on the output.
void hal_pwm_irq_handler(pwm_handle_t *p_pwm)
PWM irq handler.
void hal_pwm_resume_reg(const pwm_handle_t *p_pwm)
Restore some registers related to PWM configuration after sleep. This function must be used in conjun...
hal_pwm_active_channel_t active_channel
void(* pwm_msp_deinit)(pwm_handle_t *p_pwm)