pwm.h File Reference

Low-level PWM peripheral driver interface definitions. More...

Detailed Description

#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.


#define PWM_DEV(x)   (x)
 Default PWM access macro.
#define PWM_UNDEF   (UINT_MAX)
 Default PWM undefined value.


typedef unsigned int pwm_t
 Default PWM type definition.


enum  pwm_mode_t { PWM_LEFT, PWM_RIGHT, PWM_CENTER }
 Default PWM mode definition.


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...