From 22854d39c0b37935e81afedd6c86dbdaca28d018 Mon Sep 17 00:00:00 2001 From: Carles Cufi Date: Tue, 17 Mar 2020 15:01:47 +0100 Subject: [PATCH] doc: reference: Add the LED and LED Strip APIs Add the LED (regular and strip) APIs to the doc. Signed-off-by: Carles Cufi --- doc/reference/peripherals/index.rst | 1 + doc/reference/peripherals/led.rst | 33 +++++++++++++++++++++++++++++ include/drivers/led.h | 15 +++++++++++-- include/drivers/led_strip.h | 17 ++++++++++++--- 4 files changed, 61 insertions(+), 5 deletions(-) create mode 100644 doc/reference/peripherals/led.rst diff --git a/doc/reference/peripherals/index.rst b/doc/reference/peripherals/index.rst index c58e4341256..9e7516334ee 100644 --- a/doc/reference/peripherals/index.rst +++ b/doc/reference/peripherals/index.rst @@ -20,6 +20,7 @@ Peripherals i2s.rst ipm.rst kscan.rst + led.rst pinmux.rst pwm.rst ps2.rst diff --git a/doc/reference/peripherals/led.rst b/doc/reference/peripherals/led.rst new file mode 100644 index 00000000000..334c8e442f8 --- /dev/null +++ b/doc/reference/peripherals/led.rst @@ -0,0 +1,33 @@ +.. _led_api: + +LED +### + +Overview +******** + +The LED API provides access to Light Emitting Diodes, both in individual and +stip form. + +Configuration Options +********************* + +Related configuration options: + +* :option:`CONFIG_LED` +* :option:`CONFIG_LED_STRIP` + +API Reference +************* + +LED +=== + +.. doxygengroup:: led_interface + :project: Zephyr + +LED Strip +========= + +.. doxygengroup:: led_strip_interface + :project: Zephyr diff --git a/include/drivers/led.h b/include/drivers/led.h index 3cfc7ce7a66..0cc318d3093 100644 --- a/include/drivers/led.h +++ b/include/drivers/led.h @@ -4,12 +4,19 @@ * SPDX-License-Identifier: Apache-2.0 */ +/** + * @file + * @brief Public LED driver APIs + */ + #ifndef ZEPHYR_INCLUDE_DRIVERS_LED_H_ #define ZEPHYR_INCLUDE_DRIVERS_LED_H_ /** - * @file - * @brief Public LED driver APIs + * @brief LED Interface + * @defgroup led_interface LED Interface + * @ingroup io_interfaces + * @{ */ #include @@ -144,6 +151,10 @@ static inline int z_impl_led_off(struct device *dev, u32_t led) return api->off(dev, led); } +/** + * @} + */ + #include #endif /* ZEPHYR_INCLUDE_DRIVERS_LED_H_ */ diff --git a/include/drivers/led_strip.h b/include/drivers/led_strip.h index a7bea65dcdc..7824bad739f 100644 --- a/include/drivers/led_strip.h +++ b/include/drivers/led_strip.h @@ -4,9 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -#ifndef ZEPHYR_INCLUDE_DRIVERS_LED_STRIP_H_ -#define ZEPHYR_INCLUDE_DRIVERS_LED_STRIP_H_ - /** * @file * @brief Public API for controlling linear strips of LEDs. @@ -15,6 +12,16 @@ * addressable strips of LEDs. */ +#ifndef ZEPHYR_INCLUDE_DRIVERS_LED_STRIP_H_ +#define ZEPHYR_INCLUDE_DRIVERS_LED_STRIP_H_ + +/** + * @brief LED Strip Interface + * @defgroup led_strip_interface LED Strip Interface + * @ingroup io_interfaces + * @{ + */ + #include #include @@ -126,4 +133,8 @@ static inline int led_strip_update_channels(struct device *dev, } #endif +/** + * @} + */ + #endif /* ZEPHYR_INCLUDE_DRIVERS_LED_STRIP_H_ */