Go to the documentation of this file.
52 #ifndef __GR55xx_HAL_PWM_H__
53 #define __GR55xx_HAL_PWM_H__
177 uint32_t retention[12];
220 #define PWM_MODE_FLICKER LL_PWM_FLICKER_MODE
221 #define PWM_MODE_BREATH LL_PWM_BREATH_MODE
227 #define PWM_ALIGNED_EDGE LL_PWM_EDGE_ALIGNED
228 #define PWM_ALIGNED_CENTER LL_PWM_CENTER_ALIGNED
234 #define PWM_STOP_LVL_LOW LL_PWM_STOP_LVL_LOW
235 #define PWM_STOP_LVL_HIGH LL_PWM_STOP_LVL_HIGH
241 #define PWM_DRIVEPOLARITY_NEGATIVE LL_PWM_DRIVEPOLARITY_NEGATIVE
242 #define PWM_DRIVEPOLARITY_POSITIVE LL_PWM_DRIVEPOLARITY_POSITIVE
255 #define __HAL_PWM_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->state = HAL_PWM_STATE_RESET)
261 #define __HAL_PWM_ENABLE(__HANDLE__) SET_BITS((__HANDLE__)->p_instance->MODE, PWM_MODE_EN)
267 #define __HAL_PWM_DISABLE(__HANDLE__) CLEAR_BITS((__HANDLE__)->p_instance->MODE, PWM_MODE_EN)
273 #define __HAL_PWM_ENABLE_BREATH(__HANDLE__) SET_BITS((__HANDLE__)->p_instance->MODE, PWM_MODE_BREATHEN)
279 #define __HAL_PWM_DISABLE_BREATH(__HANDLE__) CLEAR_BITS((__HANDLE__)->p_instance->MODE, PWM_MODE_BREATHEN)
293 #define IS_PWM_MODE(__MODE__) (((__MODE__) == PWM_MODE_FLICKER) || \
294 ((__MODE__) == PWM_MODE_BREATH))
301 #define IS_PWM_ALIGNMENT_MODE(__MODE__) (((__MODE__) == PWM_ALIGNED_EDGE) || \
302 ((__MODE__) == PWM_ALIGNED_CENTER))
309 #define IS_PWM_STOP_LVL(__MODE__) (((__MODE__) == PWM_STOP_LVL_LOW) || \
310 ((__MODE__) == PWM_STOP_LVL_HIGH))
317 #define IS_PWM_DRIVEPOLARITY(__POLARITY__) (((__POLARITY__) == PWM_DRIVEPOLARITY_NEGATIVE) || \
318 ((__POLARITY__) == PWM_DRIVEPOLARITY_POSITIVE))
hal_lock_t
HAL Lock structures definition.
PWM init Structure definition.
hal_status_t hal_pwm_suspend_reg(pwm_handle_t *p_pwm)
Suspend some registers related to PWM configuration before sleep.
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...
HAL_PWM Callback function definition.
PWM Channel init Structure definition.
void hal_pwm_msp_deinit(pwm_handle_t *p_pwm)
De-initialize the PWM MSP.
hal_pwm_state_t
HAL PWM State Enumerations definition.
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
pwm_channel_init_t channel_c
@ HAL_PWM_ACTIVE_CHANNEL_B
hal_status_t hal_pwm_stop(pwm_handle_t *p_pwm)
Stops the PWM signal generation on the output.
hal_status_t hal_pwm_resume_reg(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
HAL PWM active channel Enumerations definition.
Header file containing functions prototypes of PWM LL library.
PWM handle Structure definition.
pwm_channel_init_t channel_b
@ HAL_PWM_ACTIVE_CHANNEL_ALL
hal_status_t
HAL Status structures definition.
hal_status_t hal_pwm_start(pwm_handle_t *p_pwm)
Starts the PWM signal generation on the output.
__IO hal_pwm_state_t state
@ HAL_PWM_ACTIVE_CHANNEL_A
hal_pwm_state_t hal_pwm_get_state(pwm_handle_t *p_pwm)
Return the PWM handle state.
void(* pwm_msp_init)(pwm_handle_t *p_pwm)
void hal_pwm_msp_init(pwm_handle_t *p_pwm)
Initialize the PWM MSP.
hal_status_t hal_pwm_config_channel(pwm_handle_t *p_pwm, pwm_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.
hal_status_t hal_pwm_inactive_channel(pwm_handle_t *p_pwm, hal_pwm_active_channel_t channel)
Set the specified PWM channel inactive.
@ HAL_PWM_ACTIVE_CHANNEL_CLEARED
hal_status_t hal_pwm_update_freq(pwm_handle_t *p_pwm, uint32_t freq)
Update the PWM frequency on the output.
This file contains HAL common definitions, enumeration, macros and structures definitions.
pwm_channel_init_t channel_a
hal_pwm_active_channel_t active_channel
void(* pwm_msp_deinit)(pwm_handle_t *p_pwm)