Class hal::lpc40::pwm
pwm driver for the lpc40xx series of micro controllers More...
#include <pwm.hpp>
Inherits the following classes: hal::pwm
Classes
Type | Name |
---|---|
struct | channel Channel specific information. |
Public Functions inherited from hal::pwm
See hal::pwm
Type | Name |
---|---|
result< duty_cycle_t > | duty_cycle (float p_duty_cycle) Set the pwm waveform duty cycle. |
result< frequency_t > | frequency (hertz p_frequency) Set the pwm waveform frequency. |
virtual | ~pwm () = default |
Public Static Functions
Type | Name |
---|---|
result< pwm > | get (std::uint8_t p_peripheral, std::uint8_t p_channel) Get a pwm driver. |
Detailed Description
This driver uses the dedicated PWM peripherals, PWM0, and PWM1 for generating pwm signals. Other methods would include using timers and the MotorPWM peripherals.
NOTE: Channels within a PWM peripheral device are NOT independent. Meaning that changing the frequency of one channel changes the frequency for all channels within the peripheral block.
Public Static Functions Documentation
function get
Get a pwm driver.
static result< pwm > hal::lpc40::pwm::get (
std::uint8_t p_peripheral,
std::uint8_t p_channel
)
Parameters:
p_peripheral
- Peripheral block, either 0 or 1p_channel
- PWM output channel within the peripheral block, from 1 to 6.
Returns:
result<pwm&> - reference to the pwm driver
The documentation for this class was generated from the following file libraries/include/libhal-lpc40/pwm.hpp