From fb2002d84abe59ebdd66a5ff69da9450d081501e Mon Sep 17 00:00:00 2001 From: chrysn Date: Wed, 21 Feb 2024 15:44:00 +0100 Subject: [PATCH] drivers/rgbled: Remove driver The driver is largely unused, and redundant with the saul_pwm_rgb_params functionality of SAUL. --- drivers/Kconfig | 1 - drivers/include/rgbled.h | 65 ------------------------------------- drivers/rgbled/Kconfig | 11 ------- drivers/rgbled/Makefile | 3 -- drivers/rgbled/Makefile.dep | 1 - drivers/rgbled/rgbled.c | 47 --------------------------- 6 files changed, 128 deletions(-) delete mode 100644 drivers/include/rgbled.h delete mode 100644 drivers/rgbled/Kconfig delete mode 100644 drivers/rgbled/Makefile delete mode 100644 drivers/rgbled/Makefile.dep delete mode 100644 drivers/rgbled/rgbled.c diff --git a/drivers/Kconfig b/drivers/Kconfig index dd7cf9616c..c52180acb9 100644 --- a/drivers/Kconfig +++ b/drivers/Kconfig @@ -19,7 +19,6 @@ rsource "grove_ledbar/Kconfig" rsource "motor_driver/Kconfig" rsource "mcp47xx/Kconfig" rsource "my9221/Kconfig" -rsource "rgbled/Kconfig" rsource "servo/Kconfig" rsource "ws281x/Kconfig" endmenu # Actuator Device Drivers diff --git a/drivers/include/rgbled.h b/drivers/include/rgbled.h deleted file mode 100644 index 5995a7716b..0000000000 --- a/drivers/include/rgbled.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2014 Freie Universität Berlin - * - * This file is subject to the terms and conditions of the GNU Lesser General - * Public License v2.1. See the file LICENSE in the top level directory for more - * details. - */ - -/** - * @defgroup drivers_rgbled RGB-LED driver - * @ingroup drivers_actuators - * @brief High-level driver for RGB-LEDs - * @{ - * - * @file - * @brief High-level driver for easy handling of RGB-LEDs - * - * @author Hauke Petersen - */ - -#ifndef RGBLED_H -#define RGBLED_H - -#include "color.h" -#include "periph/pwm.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Descriptor struct for rgbleds - */ -typedef struct { - pwm_t device; /**< PWM device to use to control rgbleds */ - int channel_r; /**< set the R value in RGB */ - int channel_g; /**< set the G value in RGB */ - int channel_b; /**< set the B value in RGB */ -} rgbled_t; - -/** - * @brief Initialize the RGB LED by assigning PWM channels to colors - * - * @param[in] led Struct identifying the LED - * @param[in] pwm PWM device to drive the LED - * @param[in] channel_r PWM channel connected to red - * @param[in] channel_g PWM channel connected to green - * @param[in] channel_b PWM channel connected to blue - */ -void rgbled_init(rgbled_t *led, pwm_t pwm, int channel_r, int channel_g, int channel_b); - -/** - * @brief Set the RGB-LED to the given color value - * - * @param[in] led Struct identifying the LED to set - * @param[in] color Color to set the led to - */ -void rgbled_set(const rgbled_t *led, color_rgb_t *color); - -#ifdef __cplusplus -} -#endif - -#endif /* RGBLED_H */ -/** @} */ diff --git a/drivers/rgbled/Kconfig b/drivers/rgbled/Kconfig deleted file mode 100644 index f17674dac7..0000000000 --- a/drivers/rgbled/Kconfig +++ /dev/null @@ -1,11 +0,0 @@ -# Copyright (c) 2021 HAW Hamburg -# -# This file is subject to the terms and conditions of the GNU Lesser -# General Public License v2.1. See the file LICENSE in the top level -# directory for more details. -# - -config MODULE_RGBLED - bool "RGB-LED driver" - depends on TEST_KCONFIG - select MODULE_COLOR diff --git a/drivers/rgbled/Makefile b/drivers/rgbled/Makefile deleted file mode 100644 index e438a2f4eb..0000000000 --- a/drivers/rgbled/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -MODULE = rgbled - -include $(RIOTBASE)/Makefile.base diff --git a/drivers/rgbled/Makefile.dep b/drivers/rgbled/Makefile.dep deleted file mode 100644 index 568ef98033..0000000000 --- a/drivers/rgbled/Makefile.dep +++ /dev/null @@ -1 +0,0 @@ -USEMODULE += color diff --git a/drivers/rgbled/rgbled.c b/drivers/rgbled/rgbled.c deleted file mode 100644 index 8fbbd41c37..0000000000 --- a/drivers/rgbled/rgbled.c +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2014 Freie Universität Berlin - * - * This file is subject to the terms and conditions of the GNU Lesser General - * Public License v2.1. See the file LICENSE in the top level directory for more - * details. - */ - -/** - * @ingroup drivers_rgbled - * @{ - * - * @file - * @brief High-level driver for easy handling of RGB-LEDs - * - * @author Hauke Petersen - * - * @} - */ - -#include "rgbled.h" - -/** - * @name Drive the RGB-LED by default with 500Hz - */ -#define PWM_FREQU (500) - -/** - * @name Set the default resolution to 8-bit per color (for a 24-bit color space) - */ -#define PWM_RES (256) - -void rgbled_init(rgbled_t *led, pwm_t pwm, int channel_r, int channel_g, int channel_b) -{ - led->device = pwm; - led->channel_r = channel_r; - led->channel_g = channel_g; - led->channel_b = channel_b; - pwm_init(pwm, PWM_LEFT, PWM_FREQU, PWM_RES); -} - -void rgbled_set(const rgbled_t *led, color_rgb_t *color) -{ - pwm_set(led->device, led->channel_r, (unsigned int)color->r); - pwm_set(led->device, led->channel_g, (unsigned int)color->g); - pwm_set(led->device, led->channel_b, (unsigned int)color->b); -}