Go to the documentation of this file.
46 #define PWM_MAX_NUMBER 4
203 #endif // _NO_OS_PWM_H_
void * mutex
Definition: no_os_pwm.h:95
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:79
uint32_t duty_cycle_ns
Definition: no_os_pwm.h:101
Structure containing the init parameters needed by the PWM generator.
Definition: no_os_pwm.h:66
int32_t no_os_pwm_remove(struct no_os_pwm_desc *desc)
Free the resources allocated by no_os_pwm_init().
Definition: no_os_pwm.c:79
uint32_t id
Definition: no_os_pwm.h:97
uint32_t period_ns
Definition: no_os_pwm.h:70
int32_t no_os_pwm_set_polarity(struct no_os_pwm_desc *desc, enum no_os_pwm_polarity polarity)
Set the PWM polarity.
Definition: no_os_pwm.c:243
uint32_t phase_ns
Definition: no_os_pwm.h:103
uint32_t id
Definition: no_os_pwm.h:68
no_os_pwm_polarity
Possible polarities of the PWM signal.
Definition: no_os_pwm.h:55
int32_t no_os_pwm_set_period(struct no_os_pwm_desc *desc, uint32_t period_ns)
Set the PWM period value.
Definition: no_os_pwm.c:133
uint32_t period_ns
Definition: no_os_pwm.h:99
int32_t no_os_pwm_get_phase(struct no_os_pwm_desc *desc, uint32_t *phase_ns)
Get the PWM phase value.
Definition: no_os_pwm.c:223
int32_t no_os_pwm_get_period(struct no_os_pwm_desc *desc, uint32_t *period_ns)
Get the PWM period value.
Definition: no_os_pwm.c:151
struct no_os_gpio_desc * pwm_gpio
Definition: no_os_pwm.h:109
int32_t no_os_pwm_enable(struct no_os_pwm_desc *desc)
Enable PWM signal generation.
Definition: no_os_pwm.c:98
uint32_t irq_id
Definition: no_os_pwm.h:80
enum no_os_pwm_polarity polarity
Definition: no_os_pwm.h:76
int32_t no_os_pwm_disable(struct no_os_pwm_desc *desc)
Disable PWM signal generation.
Definition: no_os_pwm.c:115
int32_t no_os_pwm_set_phase(struct no_os_pwm_desc *desc, uint32_t phase_ns)
Set the PWM phase value.
Definition: no_os_pwm.c:205
enum no_os_pwm_polarity polarity
Definition: no_os_pwm.h:105
uint32_t irq_id
Definition: no_os_pwm.h:111
bool enabled
Definition: no_os_pwm.h:107
void * extra
Definition: no_os_pwm.h:86
int32_t no_os_pwm_get_polarity(struct no_os_pwm_desc *desc, enum no_os_pwm_polarity *polarity)
Get the PWM polarity.
Definition: no_os_pwm.c:263
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
@ NO_OS_PWM_POLARITY_HIGH
Definition: no_os_pwm.h:57
void(* pwm_callback)(void *arg)
Definition: no_os_pwm.h:82
int32_t no_os_pwm_set_duty_cycle(struct no_os_pwm_desc *desc, uint32_t duty_cycle_ns)
Set the PWM duty cycle.
Definition: no_os_pwm.c:169
Structure representing an PWM generator device.
Definition: no_os_pwm.h:93
uint32_t duty_cycle_ns
Definition: no_os_pwm.h:72
int32_t no_os_pwm_init(struct no_os_pwm_desc **desc, const struct no_os_pwm_init_param *param)
Initialize the PWM peripheral.
Definition: no_os_pwm.c:51
void * extra
Definition: no_os_pwm.h:117
void(* pwm_callback)(void *arg)
Definition: no_os_pwm.h:113
struct no_os_gpio_init_param * pwm_gpio
Definition: no_os_pwm.h:78
int32_t no_os_pwm_get_duty_cycle(struct no_os_pwm_desc *desc, uint32_t *duty_cycle_ns)
Get the PWM duty cycle.
Definition: no_os_pwm.c:187
uint32_t phase_ns
Definition: no_os_pwm.h:74
const struct no_os_pwm_platform_ops * platform_ops
Definition: no_os_pwm.h:84
@ NO_OS_PWM_POLARITY_LOW
Definition: no_os_pwm.h:59
const struct no_os_pwm_platform_ops * platform_ops
Definition: no_os_pwm.h:115