From 1cb608a9f422d1eb75cc8f39784a5017cc882382 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 9 Sep 2019 18:56:23 +1000 Subject: [PATCH] AP_HAL: allow neopixel LEDs to be set more flexibly allow for N leds per chain, with RGB control of each --- libraries/AP_HAL/RCOutput.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/libraries/AP_HAL/RCOutput.h b/libraries/AP_HAL/RCOutput.h index 1afab1f700..9d349549f9 100644 --- a/libraries/AP_HAL/RCOutput.h +++ b/libraries/AP_HAL/RCOutput.h @@ -193,5 +193,20 @@ public: */ virtual void set_telem_request_mask(uint16_t mask) {} - virtual void set_neopixel_rgb_data(const uint16_t i, const uint32_t rgb_data) {} + /* + setup neopixel (WS2812B) output for a given channel number, with + the given max number of LEDs in the chain. + */ + virtual bool set_neopixel_num_LEDs(const uint16_t chan, uint8_t num_leds) { return false; } + + /* + setup neopixel (WS2812B) output data for a given output channel + and mask of which LEDs in the chain + */ + virtual void set_neopixel_rgb_data(const uint16_t chan, uint32_t ledmask, uint8_t red, uint8_t green, uint8_t blue) {} + + /* + trigger send of neopixel data + */ + virtual void neopixel_send(void) {} };