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"
Go to the source code of this file.
Macros | |
#define | PWM_DEV(x) (x) |
Default PWM access macro. | |
#define | PWM_UNDEF (UINT_MAX) |
Default PWM undefined value. | |
Typedefs | |
typedef unsigned int | pwm_t |
Default PWM type definition. | |
Enumerations | |
enum | pwm_mode_t { PWM_LEFT = PWM_MODE(0, 1), PWM_RIGHT = PWM_MODE(0, 0), PWM_CENTER = PWM_MODE(1, 1), PWM_CENTER_INV = PWM_MODE(1, 0), 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... | |