diff options
| author | Ryan <fauxpark@gmail.com> | 2024-02-15 18:05:08 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-15 07:05:08 +0000 |
| commit | 0b7df03ab77552da806ed0b62d95fbf4199a534d (patch) | |
| tree | 44b717212fc09ba8359085ac73d8f39afaca9f9e /drivers/led | |
| parent | 75c6afaa7fd3cbd4e80e563c89b263f7f0057928 (diff) | |
AW20216S: combine EN pin defines (#23067)
Diffstat (limited to 'drivers/led')
| -rw-r--r-- | drivers/led/aw20216s.c | 14 | ||||
| -rw-r--r-- | drivers/led/aw20216s.h | 8 |
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) { | |||
| 113 | void aw20216s_init_drivers(void) { | 113 | void aw20216s_init_drivers(void) { |
| 114 | spi_init(); | 114 | spi_init(); |
| 115 | 115 | ||
| 116 | aw20216s_init(AW20216S_CS_PIN_1, AW20216S_EN_PIN_1); | 116 | #if defined(AW20216S_EN_PIN) |
| 117 | setPinOutput(AW20216S_EN_PIN); | ||
| 118 | writePinHigh(AW20216S_EN_PIN); | ||
| 119 | #endif | ||
| 120 | |||
| 121 | aw20216s_init(AW20216S_CS_PIN_1); | ||
| 117 | #if defined(AW20216S_CS_PIN_2) | 122 | #if defined(AW20216S_CS_PIN_2) |
| 118 | aw20216s_init(AW20216S_CS_PIN_2, AW20216S_EN_PIN_2); | 123 | aw20216s_init(AW20216S_CS_PIN_2); |
| 119 | #endif | 124 | #endif |
| 120 | } | 125 | } |
| 121 | 126 | ||
| 122 | void aw20216s_init(pin_t cs_pin, pin_t en_pin) { | 127 | void aw20216s_init(pin_t cs_pin) { |
| 123 | setPinOutput(en_pin); | ||
| 124 | writePinHigh(en_pin); | ||
| 125 | |||
| 126 | aw20216s_soft_reset(cs_pin); | 128 | aw20216s_soft_reset(cs_pin); |
| 127 | wait_ms(2); | 129 | wait_ms(2); |
| 128 | 130 | ||
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 @@ | |||
| 42 | # define AW20216S_CS_PIN_2 DRIVER_2_CS | 42 | # define AW20216S_CS_PIN_2 DRIVER_2_CS |
| 43 | #endif | 43 | #endif |
| 44 | #ifdef DRIVER_1_EN | 44 | #ifdef DRIVER_1_EN |
| 45 | # define AW20216S_EN_PIN_1 DRIVER_1_EN | 45 | # define AW20216S_EN_PIN DRIVER_1_EN |
| 46 | #endif | 46 | #endif |
| 47 | #ifdef DRIVER_2_EN | 47 | #ifdef AW20216S_EN_PIN_1 |
| 48 | # define AW20216S_EN_PIN_2 DRIVER_2_EN | 48 | # define AW20216S_EN_PIN AW20216S_EN_PIN_1 |
| 49 | #endif | 49 | #endif |
| 50 | 50 | ||
| 51 | #define aw_led aw20216s_led_t | 51 | #define aw_led aw20216s_led_t |
| @@ -94,7 +94,7 @@ typedef struct aw20216s_led_t { | |||
| 94 | extern const aw20216s_led_t PROGMEM g_aw20216s_leds[AW20216S_LED_COUNT]; | 94 | extern const aw20216s_led_t PROGMEM g_aw20216s_leds[AW20216S_LED_COUNT]; |
| 95 | 95 | ||
| 96 | void aw20216s_init_drivers(void); | 96 | void aw20216s_init_drivers(void); |
| 97 | void aw20216s_init(pin_t cs_pin, pin_t en_pin); | 97 | void aw20216s_init(pin_t cs_pin); |
| 98 | void aw20216s_set_color(int index, uint8_t red, uint8_t green, uint8_t blue); | 98 | void aw20216s_set_color(int index, uint8_t red, uint8_t green, uint8_t blue); |
| 99 | void aw20216s_set_color_all(uint8_t red, uint8_t green, uint8_t blue); | 99 | void aw20216s_set_color_all(uint8_t red, uint8_t green, uint8_t blue); |
| 100 | void aw20216s_update_pwm_buffers(pin_t cs_pin, uint8_t index); | 100 | void aw20216s_update_pwm_buffers(pin_t cs_pin, uint8_t index); |
