I have tried to integrate some hardware hat that uses the SPI bus. This device uses the CE0 line and to use that one would have to use the /dev/spidev0.0 device name when opening the device.
The Linx shared library for Raspberry Pi does however only open one SPI device and that is hardwired to /dev/spidev0.1.
Why does the shared library not provide both spi devices?
- It would seem as easy as updating the definition in the LinxRaspberryPi2B.cpp to add this second channel and also increase the number of SPI channels to 2.
Why does the LinxRaspberryPi::SpiWriteRead() insist on using a custom CE pin?
- The spidev0.0 and spidev0.1 devices will internally use the according CE0 and CE1 pin already. So it would be useful to only execute the custom CE pin handling if the csChan input is unequal to 0. With 0 as input just skip the custom CE handling.
//Set CS As Output And Make Sure CS Starts Idle
DigitalWrite(csChan, (~csLL & 0x01) );