Mbed OS Reference
|
Modules | |
GPIO IRQ HAL tests | |
The Pwmout HAL tests ensure driver conformance to defined behaviour. | |
Functions | |
void | pwmout_init_direct (pwmout_t *obj, const PinMap *pinmap) |
Initialize the pwm out peripheral and configure the pin. More... | |
void | pwmout_init (pwmout_t *obj, PinName pin) |
Initialize the pwm out peripheral and configure the pin. More... | |
void | pwmout_free (pwmout_t *obj) |
Deinitialize the pwmout object. More... | |
void | pwmout_write (pwmout_t *obj, float percent) |
Set the output duty-cycle in range <0.0f, 1.0f> More... | |
float | pwmout_read (pwmout_t *obj) |
Read the current float-point output duty-cycle. More... | |
void | pwmout_period (pwmout_t *obj, float seconds) |
Set the PWM period specified in seconds, keeping the duty cycle the same. More... | |
void | pwmout_period_ms (pwmout_t *obj, int ms) |
Set the PWM period specified in miliseconds, keeping the duty cycle the same. More... | |
void | pwmout_period_us (pwmout_t *obj, int us) |
Set the PWM period specified in microseconds, keeping the duty cycle the same. More... | |
int | pwmout_read_period_us (pwmout_t *obj) |
Read the PWM period specified in microseconds. More... | |
void | pwmout_pulsewidth (pwmout_t *obj, float seconds) |
Set the PWM pulsewidth specified in seconds, keeping the period the same. More... | |
void | pwmout_pulsewidth_ms (pwmout_t *obj, int ms) |
Set the PWM pulsewidth specified in miliseconds, keeping the period the same. More... | |
void | pwmout_pulsewidth_us (pwmout_t *obj, int us) |
Set the PWM pulsewidth specified in microseconds, keeping the period the same. More... | |
int | pwmout_read_pulsewidth_us (pwmout_t *obj) |
Read the PWM pulsewidth specified in microseconds. More... | |
const PinMap * | pwmout_pinmap (void) |
Get the pins that support PWM. More... | |
Initialize the pwm out peripheral and configure the pin.
obj | The pwmout object to initialize |
pinmap | pointer to structure which holds static pinmap |
void pwmout_init | ( | pwmout_t * | obj, |
PinName | pin | ||
) |
Initialize the pwm out peripheral and configure the pin.
obj | The pwmout object to initialize |
pin | The pwmout pin to initialize |
void pwmout_free | ( | pwmout_t * | obj | ) |
Deinitialize the pwmout object.
obj | The pwmout object |
void pwmout_write | ( | pwmout_t * | obj, |
float | percent | ||
) |
Set the output duty-cycle in range <0.0f, 1.0f>
Value 0.0f represents 0 percentage, 1.0f represents 100 percent.
obj | The pwmout object |
percent | The floating-point percentage number |
float pwmout_read | ( | pwmout_t * | obj | ) |
Read the current float-point output duty-cycle.
obj | The pwmout object |
void pwmout_period | ( | pwmout_t * | obj, |
float | seconds | ||
) |
Set the PWM period specified in seconds, keeping the duty cycle the same.
Periods smaller than microseconds (the lowest resolution) are set to zero.
obj | The pwmout object |
seconds | The floating-point seconds period |
void pwmout_period_ms | ( | pwmout_t * | obj, |
int | ms | ||
) |
Set the PWM period specified in miliseconds, keeping the duty cycle the same.
obj | The pwmout object |
ms | The milisecond period |
void pwmout_period_us | ( | pwmout_t * | obj, |
int | us | ||
) |
Set the PWM period specified in microseconds, keeping the duty cycle the same.
obj | The pwmout object |
us | The microsecond period |
int pwmout_read_period_us | ( | pwmout_t * | obj | ) |
Read the PWM period specified in microseconds.
obj | The pwmout object |
void pwmout_pulsewidth | ( | pwmout_t * | obj, |
float | seconds | ||
) |
Set the PWM pulsewidth specified in seconds, keeping the period the same.
obj | The pwmout object |
seconds | The floating-point pulsewidth in seconds |
void pwmout_pulsewidth_ms | ( | pwmout_t * | obj, |
int | ms | ||
) |
Set the PWM pulsewidth specified in miliseconds, keeping the period the same.
obj | The pwmout object |
ms | The floating-point pulsewidth in miliseconds |
void pwmout_pulsewidth_us | ( | pwmout_t * | obj, |
int | us | ||
) |
Set the PWM pulsewidth specified in microseconds, keeping the period the same.
obj | The pwmout object |
us | The floating-point pulsewidth in microseconds |
int pwmout_read_pulsewidth_us | ( | pwmout_t * | obj | ) |
Read the PWM pulsewidth specified in microseconds.
obj | The pwmout object |