MiraOS PWM driver.
More...
#include <stdint.h>
Go to the source code of this file.
MiraOS PWM driver.
- Author
- LumenRadio AB
- Date
- 17 Jan 2016 The MiraOS library provides functions for controlling the Mira radio module, sending/receiving messages, controlling peripherals, etc.
- See also
- http://docs.lumenrad.io/mira
Supported PWM channels.
Enumerator |
---|
MIRA_PWM_A |
PWM channel A
|
MIRA_PWM_B |
PWM channel B
|
Supported PWM modes.
Enumerator |
---|
MIRA_PWM_NORMAL |
Normal: pulse is at the beginning of the period
|
MIRA_PWM_INVERT |
Inverted: pulse is at the end of the period
|
Initialize the PWM driver.
- Parameters
-
channel | PWM channel to set up |
mode | PWM mode: normal/inverted |
period_counts | Period cycle in 16MHz ticks |
active_counts | Active period in 16MHz ticks |
- Returns
- void
void mira_pwm_set |
( |
MiraPwmChannel |
channel, |
|
|
uint32_t |
period_counts, |
|
|
uint32_t |
active_counts |
|
) |
| |
Updates PWM for a channel.
- Parameters
-
channel | PWM channel to set up |
period_counts | Period cycle in 16MHz ticks |
active_counts | Active period in 16MHz ticks |
- Returns
- void
Start the PWM channel.
- Parameters
-
channel | PWM channel to start |
- Returns
- void
Stop the PWM channel.
- Parameters
-
channel | PWM channel to stop |
- Returns
- void