Zephyr API Documentation 4.0.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
pwm.h File Reference

Go to the source code of this file.

Macros

PWM period set helpers

The period cell in the PWM specifier needs to be provided in nanoseconds.

However, in some applications it is more convenient to use another scale.

#define PWM_NSEC(x)
 Specify PWM period in nanoseconds.
 
#define PWM_USEC(x)
 Specify PWM period in microseconds.
 
#define PWM_MSEC(x)
 Specify PWM period in milliseconds.
 
#define PWM_SEC(x)
 Specify PWM period in seconds.
 
#define PWM_HZ(x)
 Specify PWM frequency in hertz.
 
#define PWM_KHZ(x)
 Specify PWM frequency in kilohertz.
 
PWM polarity flags

The PWM_POLARITY_* flags are used with pwm_set_cycles(), pwm_set() or pwm_configure_capture() to specify the polarity of a PWM channel.

The flags are on the lower 8bits of the pwm_flags_t

#define PWM_POLARITY_NORMAL   (0 << 0)
 PWM pin normal polarity (active-high pulse).
 
#define PWM_POLARITY_INVERTED   (1 << 0)
 PWM pin inverted polarity (active-low pulse).