Go to the documentation of this file.
28 #if (HAL_USE_PWM == TRUE) || defined(__DOXYGEN__)
41 #define PWM_OUTPUT_MASK 0x0FU
46 #define PWM_OUTPUT_DISABLED 0x00U
51 #define PWM_OUTPUT_ACTIVE_HIGH 0x01U
56 #define PWM_OUTPUT_ACTIVE_LOW 0x02U
116 #define PWM_FRACTION_TO_WIDTH(pwmp, denominator, numerator) \
117 ((pwmcnt_t)((((pwmcnt_t)(pwmp)->period) * \
118 (pwmcnt_t)(numerator)) / (pwmcnt_t)(denominator)))
133 #define PWM_DEGREES_TO_WIDTH(pwmp, degrees) \
134 PWM_FRACTION_TO_WIDTH(pwmp, 36000, degrees)
149 #define PWM_PERCENTAGE_TO_WIDTH(pwmp, percentage) \
150 PWM_FRACTION_TO_WIDTH(pwmp, 10000, percentage)
172 #define pwmChangePeriodI(pwmp, value) { \
173 (pwmp)->period = (value); \
174 pwm_lld_change_period(pwmp, value); \
191 #define pwmEnableChannelI(pwmp, channel, width) do { \
192 (pwmp)->enabled |= ((pwmchnmsk_t)1U << (pwmchnmsk_t)(channel)); \
193 pwm_lld_enable_channel(pwmp, channel, width); \
210 #define pwmDisableChannelI(pwmp, channel) do { \
211 (pwmp)->enabled &= ~((pwmchnmsk_t)1U << (pwmchnmsk_t)(channel)); \
212 pwm_lld_disable_channel(pwmp, channel); \
224 #define pwmIsChannelEnabledI(pwmp, channel) \
225 (((pwmp)->enabled & ((pwmchnmsk_t)1U << (pwmchnmsk_t)(channel))) != 0U)
236 #define pwmEnablePeriodicNotificationI(pwmp) \
237 pwm_lld_enable_periodic_notification(pwmp)
248 #define pwmDisablePeriodicNotificationI(pwmp) \
249 pwm_lld_disable_periodic_notification(pwmp)
262 #define pwmEnableChannelNotificationI(pwmp, channel) \
263 pwm_lld_enable_channel_notification(pwmp, channel)
276 #define pwmDisableChannelNotificationI(pwmp, channel) \
277 pwm_lld_disable_channel_notification(pwmp, channel)
void pwmStart(PWMDriver *pwmp, const PWMConfig *config)
Configures and activates the PWM peripheral.
void pwmObjectInit(PWMDriver *pwmp)
Initializes the standard part of a PWMDriver structure.
void(* pwmcallback_t)(PWMDriver *pwmp)
Type of a PWM notification callback.
uint8_t pwmchannel_t
Type of a PWM channel.
void pwmDisableChannelNotification(PWMDriver *pwmp, pwmchannel_t channel)
Disables a channel de-activation edge notification.
Type of a PWM driver configuration structure.
Structure representing a PWM driver.
void pwmEnablePeriodicNotification(PWMDriver *pwmp)
Enables the periodic activation edge notification.
pwmcnt_t period
Current PWM period in ticks.
pwmstate_t
Driver state machine possible states.
void pwmChangePeriod(PWMDriver *pwmp, pwmcnt_t period)
Changes the period the PWM peripheral.
const PWMConfig * config
Current driver configuration data.
void pwmStop(PWMDriver *pwmp)
Deactivates the PWM peripheral.
void pwmDisableChannel(PWMDriver *pwmp, pwmchannel_t channel)
Disables a PWM channel and its notification.
void pwmDisablePeriodicNotification(PWMDriver *pwmp)
Disables the periodic activation edge notification.
void pwmInit(void)
PWM Driver initialization.
void pwmEnableChannel(PWMDriver *pwmp, pwmchannel_t channel, pwmcnt_t width)
Enables a PWM channel.
PLATFORM PWM subsystem low level driver header.
uint32_t pwmcnt_t
Type of a PWM counter.
void pwmEnableChannelNotification(PWMDriver *pwmp, pwmchannel_t channel)
Enables a channel de-activation edge notification.