7#ifndef ZEPHYR_INCLUDE_DRIVERS_PWM_PWM_UTILS_H_
8#define ZEPHYR_INCLUDE_DRIVERS_PWM_PWM_UTILS_H_
36 __ASSERT_NO_MSG(callback !=
NULL);
Main header file for PWM (Pulse Width Modulation) driver API.
uint16_t pwm_events_t
Provides a type to hold PWM events.
Definition pwm.h:118
static bool sys_slist_find_and_remove(sys_slist_t *list, sys_snode_t *node)
Find and remove a node from a list.
Definition slist.h:448
struct _slist sys_slist_t
Single-linked list structure.
Definition slist.h:49
static void sys_slist_prepend(sys_slist_t *list, sys_snode_t *node)
Prepend a node to the given list.
Definition slist.h:305
#define SYS_SLIST_FOR_EACH_CONTAINER_SAFE(__sl, __cn, __cns, __n)
Provide the primitive to safely iterate on a list under a container Note: __cn can be detached,...
Definition slist.h:183
static bool sys_slist_is_empty(const sys_slist_t *list)
Test if the given list is empty.
Definition slist.h:268
#define EINVAL
Invalid argument.
Definition errno.h:60
#define NULL
Definition iar_missing_defs.h:20
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.
Definition pwm_utils.h:64
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.
Definition pwm_utils.h:33
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
Runtime device structure (in ROM) per driver instance.
Definition device.h:513
PWM event callback structure.
Definition pwm.h:465
uint32_t channel
Channel the callback is interested in.
Definition pwm.h:474
pwm_event_callback_handler_t handler
Actual callback function being called when relevant.
Definition pwm.h:471