From 677a50744bf7e130a4f0bea67fba69e0af44ab27 Mon Sep 17 00:00:00 2001 From: Greg Chadwick Date: Wed, 16 Oct 2024 08:13:23 +0100 Subject: [PATCH] Update LCD to use new SPI CS control --- libraries/lcd.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libraries/lcd.cc b/libraries/lcd.cc index 19fb4e0..8582c3b 100644 --- a/libraries/lcd.cc +++ b/libraries/lcd.cc @@ -64,7 +64,15 @@ namespace sonata::lcd::internal }; lcdIntf->gpio_write = [](void *handle, bool csHigh, bool dcHigh) -> uint32_t { - set_gpio_output_bit(LcdCsPin, csHigh); + if (csHigh) + { + spi()->cs = 1; + } + else + { + spi()->cs = 0; + } + set_gpio_output_bit(LcdDcPin, dcHigh); return 0; };