tinygo-org / drivers

TinyGo drivers for sensors, displays, wireless adaptors, and other devices that use I2C, SPI, GPIO, ADC, and UART interfaces.
https://tinygo.org
BSD 3-Clause "New" or "Revised" License
587 stars 180 forks source link

Missing TFT_CS signal in st7735 driver #583

Open ivoszz opened 1 year ago

ivoszz commented 1 year ago

I have some problems with the ST7735 driver setup. I started to study the source code for this driver and I came across one thing I don't understand. In commit #89 @aykevl removed the code to work with csPin (TFT_CS). In my opinion this can work in simple cases with a single SPI device, but should not be in a generic driver. At the same time, csPin was left as a variable in the Device struct and Configuration method, even though it is no longer used anywhere, which is quite confusing. It's possible I'm missing something. What was the reason for removing the code to activate the TFT_CS signal?

aykevl commented 1 year ago

To be honest, I think I made #89 without fully understanding CS. It indeed appears to be somewhat broken: it should at least have kept CS at the start and end of the transaction like is done for the ST7789 (see #549).

There are a number of displays however that don't even expose CS.