diff options
author | trwnh <a@trwnh.com> | 2022-05-31 00:28:55 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-31 15:28:55 +1000 |
commit | 9e2fe4eff6d36d20aeeea57408216ff329b2bd31 (patch) | |
tree | bc943a591e8af6f7960d918b248ab4a2f13c933b /drivers/led | |
parent | e869d089b74ba7b1f9dba4b97470dc3f282f7861 (diff) |
Make SPI Mode configurable and change default mode to 3 (#17263)
Diffstat (limited to 'drivers/led')
-rw-r--r-- | drivers/led/aw20216.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/led/aw20216.c b/drivers/led/aw20216.c index 448accdcd3..299434f909 100644 --- a/drivers/led/aw20216.c +++ b/drivers/led/aw20216.c @@ -53,6 +53,10 @@ # define AW_GLOBAL_CURRENT_MAX 150 #endif +#ifndef AW_SPI_MODE +# define AW_SPI_MODE 3 +#endif + #ifndef AW_SPI_DIVISOR # define AW_SPI_DIVISOR 4 #endif @@ -63,7 +67,7 @@ bool g_pwm_buffer_update_required[DRIVER_COUNT] = {false}; bool AW20216_write(pin_t cs_pin, uint8_t page, uint8_t reg, uint8_t* data, uint8_t len) { static uint8_t s_spi_transfer_buffer[2] = {0}; - if (!spi_start(cs_pin, false, 3, AW_SPI_DIVISOR)) { + if (!spi_start(cs_pin, false, AW_SPI_MODE, AW_SPI_DIVISOR)) { spi_stop(); return false; } |