Zephyr API Documentation 4.3.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
pwm_utils.h File Reference
#include <stdbool.h>
#include <stdint.h>
#include <errno.h>
#include <zephyr/devicetree.h>
#include <zephyr/drivers/pwm.h>
#include <zephyr/sys/__assert.h>
#include <zephyr/sys/slist.h>

Go to the source code of this file.

Functions

static int pwm_manage_event_callback (sys_slist_t *callbacks, struct pwm_event_callback *callback, bool set)
 Generic function to insert or remove a callback from a callback list.
static void pwm_fire_event_callbacks (sys_slist_t *list, const struct device *dev, uint32_t channel, pwm_events_t events)
 Generic function to go through and fire callback from a callback lists.

Function Documentation

◆ pwm_fire_event_callbacks()

void pwm_fire_event_callbacks ( sys_slist_t * list,
const struct device * dev,
uint32_t channel,
pwm_events_t events )
inlinestatic

Generic function to go through and fire callback from a callback lists.

Parameters
listA pointer on the pwm event callback list.
devA pointer on the pwm driver instance.
channelThe channel that fired the interrupt.
eventsThe event that fired the interrupt.

◆ pwm_manage_event_callback()

int pwm_manage_event_callback ( sys_slist_t * callbacks,
struct pwm_event_callback * callback,
bool set )
inlinestatic

Generic function to insert or remove a callback from a callback list.

Parameters
callbacksA pointer to the original list of callbacks (can be NULL).
callbackA pointer of the callback to insert or remove from the list.
setA boolean indicating insertion or removal of the callback.
Return values
0on success.
negateerrno on failure.