Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
led_driver_api Struct Reference

Driver Operations LED driver operations More...

#include <zephyr/drivers/led.h>

Data Fields

led_api_on on
  OPT Turn on an LED.
led_api_off off
  OPT Turn off an LED.
led_api_set_brightness set_brightness
  OPT Set LED brightness.
led_api_blink blink
  OPT Blink an LED.
led_api_get_info get_info
  OPT Get LED information.
led_api_set_color set_color
  OPT Set LED color.
led_api_write_channels write_channels
  OPT Write/update a strip of LED channels.

Detailed Description

Driver Operations LED driver operations

This is the driver API structure any LED driver needs to define. It contains function pointers to the operations the driver implements, as well as any other driver-specific constant data.

Members marked with REQ MUST be set by the driver, whereas those marked with OPT are optional.

See also
DEVICE_DT_INST_DEFINE()
DEVICE_DT_DEFINE()
DEVICE_API()
Note
A driver must implement at least led_driver_api::set_brightness, or both led_driver_api::on and led_driver_api::off. The subsystem emulates each of these operations with the other(s) when it is not provided.

Field Documentation

◆ blink

led_api_blink led_driver_api::blink

OPT Blink an LED.

◆ get_info

led_api_get_info led_driver_api::get_info

OPT Get LED information.

◆ off

led_api_off led_driver_api::off

OPT Turn off an LED.

Mandatory if led_driver_api::set_brightness is not implemented.

◆ on

led_api_on led_driver_api::on

OPT Turn on an LED.

Mandatory if led_driver_api::set_brightness is not implemented.

◆ set_brightness

led_api_set_brightness led_driver_api::set_brightness

OPT Set LED brightness.

Mandatory if led_driver_api::on and led_driver_api::off are not implemented.

◆ set_color

led_api_set_color led_driver_api::set_color

OPT Set LED color.

◆ write_channels

led_api_write_channels led_driver_api::write_channels

OPT Write/update a strip of LED channels.


The documentation for this struct was generated from the following file: