Zephyr API Documentation 4.4.0-rc1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
PWM Driver Backend API

Data Structures

struct  pwm_driver_api
  Driver Operations PWM driver operations More...

Typedefs

typedef int(* pwm_set_cycles_t) (const struct device *dev, uint32_t channel, uint32_t period_cycles, uint32_t pulse_cycles, pwm_flags_t flags)
 Callback API to configure PWM pin period and pulse width.
typedef int(* pwm_get_cycles_per_sec_t) (const struct device *dev, uint32_t channel, uint64_t *cycles)
 Callback API to obtain PWM cycles per second (frequency).
typedef int(* pwm_configure_capture_t) (const struct device *dev, uint32_t channel, pwm_flags_t flags, pwm_capture_callback_handler_t cb, void *user_data)
 Callback API to configure PWM capture.
typedef int(* pwm_enable_capture_t) (const struct device *dev, uint32_t channel)
 Callback API to enable PWM capture.
typedef int(* pwm_disable_capture_t) (const struct device *dev, uint32_t channel)
 Callback API to disable PWM capture.
typedef int(* pwm_manage_event_callback_t) (const struct device *dev, struct pwm_event_callback *callback, bool set)
 Callback API to manage event callbacks.
typedef int(* pwm_enable_dma_t) (const struct device *dev, uint32_t channel)
 Callback API to enable PWM DMA requests.
typedef int(* pwm_disable_dma_t) (const struct device *dev, uint32_t channel)
 Callback API to disable PWM DMA requests.

Detailed Description

This group contains the API type definitions, callback signatures, and other helpers required to implement a PWM driver.

Typedef Documentation

◆ pwm_configure_capture_t

typedef int(* pwm_configure_capture_t) (const struct device *dev, uint32_t channel, pwm_flags_t flags, pwm_capture_callback_handler_t cb, void *user_data)

#include <zephyr/drivers/pwm.h>

Callback API to configure PWM capture.

See pwm_configure_capture() for argument description.

◆ pwm_disable_capture_t

typedef int(* pwm_disable_capture_t) (const struct device *dev, uint32_t channel)

#include <zephyr/drivers/pwm.h>

Callback API to disable PWM capture.

See pwm_disable_capture() for argument description.

◆ pwm_disable_dma_t

typedef int(* pwm_disable_dma_t) (const struct device *dev, uint32_t channel)

#include <zephyr/drivers/pwm.h>

Callback API to disable PWM DMA requests.

See pwm_disable_dma() for argument description.

◆ pwm_enable_capture_t

typedef int(* pwm_enable_capture_t) (const struct device *dev, uint32_t channel)

#include <zephyr/drivers/pwm.h>

Callback API to enable PWM capture.

See pwm_enable_capture() for argument description.

◆ pwm_enable_dma_t

typedef int(* pwm_enable_dma_t) (const struct device *dev, uint32_t channel)

#include <zephyr/drivers/pwm.h>

Callback API to enable PWM DMA requests.

See pwm_enable_dma() for argument description.

◆ pwm_get_cycles_per_sec_t

typedef int(* pwm_get_cycles_per_sec_t) (const struct device *dev, uint32_t channel, uint64_t *cycles)

#include <zephyr/drivers/pwm.h>

Callback API to obtain PWM cycles per second (frequency).

See pwm_get_cycles_per_sec() for argument description.

◆ pwm_manage_event_callback_t

typedef int(* pwm_manage_event_callback_t) (const struct device *dev, struct pwm_event_callback *callback, bool set)

#include <zephyr/drivers/pwm.h>

Callback API to manage event callbacks.

See pwm_add_event_callback() and pwm_remove_event_callback() for argument description.

◆ pwm_set_cycles_t

typedef int(* pwm_set_cycles_t) (const struct device *dev, uint32_t channel, uint32_t period_cycles, uint32_t pulse_cycles, pwm_flags_t flags)

#include <zephyr/drivers/pwm.h>

Callback API to configure PWM pin period and pulse width.

See pwm_set_cycles() for argument description.