summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorRyan <fauxpark@gmail.com>2024-02-15 18:05:08 +1100
committerGitHub <noreply@github.com>2024-02-15 07:05:08 +0000
commit0b7df03ab77552da806ed0b62d95fbf4199a534d (patch)
tree44b717212fc09ba8359085ac73d8f39afaca9f9e /drivers
parent75c6afaa7fd3cbd4e80e563c89b263f7f0057928 (diff)
AW20216S: combine EN pin defines (#23067)
Diffstat (limited to 'drivers')
-rw-r--r--drivers/led/aw20216s.c14
-rw-r--r--drivers/led/aw20216s.h8
2 files changed, 12 insertions, 10 deletions
diff --git a/drivers/led/aw20216s.c b/drivers/led/aw20216s.c
index 9a05d72ca9..fa4454b6b1 100644
--- a/drivers/led/aw20216s.c
+++ b/drivers/led/aw20216s.c
@@ -113,16 +113,18 @@ static inline void aw20216s_auto_lowpower(pin_t cs_pin) {
void aw20216s_init_drivers(void) {
spi_init();
- aw20216s_init(AW20216S_CS_PIN_1, AW20216S_EN_PIN_1);
+#if defined(AW20216S_EN_PIN)
+ setPinOutput(AW20216S_EN_PIN);
+ writePinHigh(AW20216S_EN_PIN);
+#endif
+
+ aw20216s_init(AW20216S_CS_PIN_1);
#if defined(AW20216S_CS_PIN_2)
- aw20216s_init(AW20216S_CS_PIN_2, AW20216S_EN_PIN_2);
+ aw20216s_init(AW20216S_CS_PIN_2);
#endif
}
-void aw20216s_init(pin_t cs_pin, pin_t en_pin) {
- setPinOutput(en_pin);
- writePinHigh(en_pin);
-
+void aw20216s_init(pin_t cs_pin) {
aw20216s_soft_reset(cs_pin);
wait_ms(2);
diff --git a/drivers/led/aw20216s.h b/drivers/led/aw20216s.h
index 4dd7f7949a..b2c097125f 100644
--- a/drivers/led/aw20216s.h
+++ b/drivers/led/aw20216s.h
@@ -42,10 +42,10 @@
# define AW20216S_CS_PIN_2 DRIVER_2_CS
#endif
#ifdef DRIVER_1_EN
-# define AW20216S_EN_PIN_1 DRIVER_1_EN
+# define AW20216S_EN_PIN DRIVER_1_EN
#endif
-#ifdef DRIVER_2_EN
-# define AW20216S_EN_PIN_2 DRIVER_2_EN
+#ifdef AW20216S_EN_PIN_1
+# define AW20216S_EN_PIN AW20216S_EN_PIN_1
#endif
#define aw_led aw20216s_led_t
@@ -94,7 +94,7 @@ typedef struct aw20216s_led_t {
extern const aw20216s_led_t PROGMEM g_aw20216s_leds[AW20216S_LED_COUNT];
void aw20216s_init_drivers(void);
-void aw20216s_init(pin_t cs_pin, pin_t en_pin);
+void aw20216s_init(pin_t cs_pin);
void aw20216s_set_color(int index, uint8_t red, uint8_t green, uint8_t blue);
void aw20216s_set_color_all(uint8_t red, uint8_t green, uint8_t blue);
void aw20216s_update_pwm_buffers(pin_t cs_pin, uint8_t index);