Relocate LED driver init code (#22365)
This commit is contained in:
parent
eac8e67888
commit
b52aca0af8
100 changed files with 795 additions and 798 deletions
|
@ -126,6 +126,15 @@ static inline void aw20216s_auto_lowpower(pin_t cs_pin) {
|
|||
aw20216s_write_register(cs_pin, AW20216S_PAGE_FUNCTION, AW20216S_REG_MIXFUNCTION, AW20216S_MIXCR_DEFAULT | AW20216S_LPEN);
|
||||
}
|
||||
|
||||
void aw20216s_init_drivers(void) {
|
||||
spi_init();
|
||||
|
||||
aw20216s_init(AW20216S_CS_PIN_1, AW20216S_EN_PIN_1);
|
||||
#if defined(AW20216S_CS_PIN_2)
|
||||
aw20216s_init(AW20216S_CS_PIN_2, AW20216S_EN_PIN_2);
|
||||
#endif
|
||||
}
|
||||
|
||||
void aw20216s_init(pin_t cs_pin, pin_t en_pin) {
|
||||
setPinOutput(en_pin);
|
||||
writePinHigh(en_pin);
|
||||
|
@ -155,7 +164,7 @@ 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) {
|
||||
for (uint8_t i = 0; i < RGB_MATRIX_LED_COUNT; i++) {
|
||||
for (uint8_t i = 0; i < AW20216S_LED_COUNT; i++) {
|
||||
aw20216s_set_color(i, red, green, blue);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue