3b5a401594
* **New Features** * Added native display support for ST7796, ILI9341, and ST7789 panels across supported boards. * Added FT5x06 and FT6x36 touchscreen support. * Generic PWM driver * ESP32 PWM driver * Generic RGB LED driver * RGB PWM LED driver * RGB GPIO LED driver * Implementation of RGB LED for various boards * **Improvements** * Updated board hardware descriptions to use explicit display/touch/backlight device-tree bindings and disabled deprecated HAL usage. * Improved display and touch-driver cleanup to prevent stale resources and improve shutdown reliability. * Pinned esp-hosted library to a fixed version * **Deletions** * Obsolete placeholder display * Legacy ILI9488 support. * ESP32-specific LEDC PWM implementation
34 lines
921 B
C++
34 lines
921 B
C++
// SPDX-License-Identifier: Apache-2.0
|
|
#include <tactility/drivers/rgb_led.h>
|
|
#include <tactility/device.h>
|
|
|
|
#define RGB_LED_DRIVER_API(driver) ((struct RgbLedApi*)driver->api)
|
|
|
|
extern "C" {
|
|
|
|
error_t rgb_led_set_color(Device* device, RgbLedColor color) {
|
|
const auto* driver = device_get_driver(device);
|
|
return RGB_LED_DRIVER_API(driver)->set_color(device, color);
|
|
}
|
|
|
|
error_t rgb_led_get_color(Device* device, RgbLedColor* out_color) {
|
|
const auto* driver = device_get_driver(device);
|
|
return RGB_LED_DRIVER_API(driver)->get_color(device, out_color);
|
|
}
|
|
|
|
error_t rgb_led_enable(Device* device) {
|
|
const auto* driver = device_get_driver(device);
|
|
return RGB_LED_DRIVER_API(driver)->enable(device);
|
|
}
|
|
|
|
void rgb_led_disable(Device* device) {
|
|
const auto* driver = device_get_driver(device);
|
|
RGB_LED_DRIVER_API(driver)->disable(device);
|
|
}
|
|
|
|
const DeviceType RGB_LED_TYPE {
|
|
.name = "rgb_led"
|
|
};
|
|
|
|
}
|