67 explicit PWM(TIM_TypeDef*
const pulseTimer, uint16_t pulseFrequency = 50);
104 PWM& operator=(
const PWM&) =
delete;
105 PWM(
const PWM& p) =
delete;
107 void configureTimer();
111 uint16_t pulseFrequency;
112 uint16_t dutyCycleResolution = 10000;
Driver for easy access to the PWM capabilities of the general purpose timers.
void disableChannel(TimerUtils::Channel channel)
void setDutyCycle(TimerUtils::Channel channel, float dutyCycle)
Sets the duty cycle for the specified channel.
bool isChannelEnabled(TimerUtils::Channel channel)
float getDutyCycle(TimerUtils::Channel channel)
Return the channel's duty cycle in the range [0,1].
@ NORMAL
Signal is high for the duty cycle time.
@ REVERSED
Signal is low for the duty cycle time.
void setDutyCycleResolution(uint16_t dutyCycleResolution)
void enableChannel(TimerUtils::Channel channel, Polarity polarity=Polarity::NORMAL)
void setFrequency(uint16_t pulseFrequency)
PWM(TIM_TypeDef *const pulseTimer, uint16_t pulseFrequency=50)
Sets up and enables the PWM timer.
GP16bitTimer & getTimer()
Returns the timer used to generate the pwm signal.
This file includes all the types the logdecoder script will decode.