Skip to content

Commit ba127f6

Browse files
committed
drivers: led: Add a new callback to get software blinking data
Blinking data are expected to be attached to led device. In order to have a as much as possible generic implementation, we need a way to retreive the data from the drivers. This adds a new callback that will be used in that purpose. Signed-off-by: Alexandre Bailon <abailon@baylibre.com>
1 parent 692ba2e commit ba127f6

File tree

1 file changed

+13
-0
lines changed
  • include/zephyr/drivers

1 file changed

+13
-0
lines changed

include/zephyr/drivers/led.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,18 @@ struct led_info {
6060
typedef int (*led_api_blink)(const struct device *dev, uint32_t led,
6161
uint32_t delay_on, uint32_t delay_off);
6262

63+
/**
64+
* @typedef led_api_get_blink_data()
65+
* @brief Callback API for getting data used by software blinking
66+
*
67+
* @param dev LED device
68+
* @param led LED number
69+
* @return Pointer to the software blinking data structure for the specified LED,
70+
* or NULL if not supported or in case of an error.
71+
*/
72+
typedef struct led_blink_software_data *(*led_api_get_blink_data)(const struct device *dev,
73+
uint32_t led);
74+
6375
/**
6476
* @typedef led_api_get_info()
6577
* @brief Optional API callback to get LED information
@@ -123,6 +135,7 @@ __subsystem struct led_driver_api {
123135
led_api_set_brightness set_brightness;
124136
/* Optional callbacks. */
125137
led_api_blink blink;
138+
led_api_get_blink_data get_blink_data;
126139
led_api_get_info get_info;
127140
led_api_set_color set_color;
128141
led_api_write_channels write_channels;

0 commit comments

Comments
 (0)