golemparts / rppal

A Rust library that provides access to the Raspberry Pi's GPIO, I2C, PWM, SPI and UART peripherals.
MIT License
1.24k stars 98 forks source link

Add support for MODE_NO_CS to SPI devices #162

Open dbartussek opened 1 month ago

dbartussek commented 1 month ago

I am communicating with a device that needs a few milliseconds to register that CS has been asserted and must therefore manually control the CS pin.

In Python, this can be achieved with spidev by setting the no_cs member on an SpiDev instance to true and manually driving the CS pin. I've now tried to port this code to Rust but found that the MODE_NO_CS flag exists as a constant, but it isn't exposed.

golemparts commented 3 weeks ago

When I initially wrote the SPI code, SPI_NO_CS wasn't fully supported by either the underlying drivers or hardware. See this section of the documentation for a possible workaround.

Since it's been a while since I last checked, it's possible support for NO_CS has been added in the mean time. On which Pi device were you able to get it to work in Python?