Low-level PWM peripheral driver interface definitions. More...
Low-level PWM peripheral driver interface definitions.
Definition in file pwm.h.
#include <stdint.h>#include <limits.h>#include "periph_cpu.h"#include "periph_conf.h"
Include dependency graph for pwm.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Macros | |
| #define | PWM_DEV(x) (x) |
| Default PWM access macro. | |
| #define | PWM_UNDEF (UINT_FAST8_MAX) |
| Default PWM undefined value. | |
Typedefs | |
| typedef uint_fast8_t | pwm_t |
| Default PWM type definition. | |
Enumerations | |
| enum | pwm_mode_t { PWM_LEFT = (TPM_CnSC_MSB_MASK | TPM_CnSC_ELSB_MASK) , PWM_RIGHT = (TPM_CnSC_MSB_MASK | TPM_CnSC_ELSA_MASK) , PWM_CENTER = (TPM_CnSC_MSB_MASK) , PWM_LEFT , PWM_RIGHT , PWM_CENTER } |
| Default PWM mode definition. More... | |
Functions | |
| uint32_t | pwm_init (pwm_t dev, pwm_mode_t mode, uint32_t freq, uint16_t res) |
| Initialize a PWM device. More... | |
| uint8_t | pwm_channels (pwm_t dev) |
| Get the number of available channels. More... | |
| void | pwm_set (pwm_t dev, uint8_t channel, uint16_t value) |
| Set the duty-cycle for a given channel of the given PWM device. More... | |
| void | pwm_poweron (pwm_t dev) |
| Resume PWM generation on the given device. More... | |
| void | pwm_poweroff (pwm_t dev) |
| Stop PWM generation on the given device. More... | |