1
0
Fork 0

AW20216S: combine EN pin defines (#23067)

This commit is contained in:
Ryan 2024-02-15 18:05:08 +11:00 committed by GitHub
parent 75c6afaa7f
commit 0b7df03ab7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 32 additions and 44 deletions

View file

@ -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);

View file

@ -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);