I’ve done some research, but not probably not enough, as I’m still confused some.
First of all, I’ve got a Pi rev 1 Model B (with the 26 pin connector) and two devices: The Waveshare AD/DA board and e-ink display HAT form factors. They share the MOSI and SCLK pins, but the AD/DA board appears to use gpio pins 15 and 16 for CS0 and CS1, whereas the display uses spi pin 24. If I understand correctly, should I be able to get both devices to work as long as I get the timing on the chip selects right? I saw one post that specifically mentioned not using pin 24 (CEO) when trying to get more than 2 devices working together. Is there a reason for that???
Lastly, the devices also share pin 11, but I have a free gpio, pin 7. The next question is, via wiringPi (or something else?), can I reassign that pin for the display while not confusing the AD/DA board? I can easily physically wire that (pin 7) to the pin position that the HAT expects it, but I’m not sure if assigning a different pin via software is universal or can be done for a particular instance (ie display and not the ad/da board).
I know I’ve got to read up more on this, but it’d be nice to know if I’m trying something impossible.
You can use any spare GPIO as a chip select as far as the Linux kernel SPI driver on the Pi is concerned.
Whether a HAT or other device can use that GPIO as a chip select depends on several things.
- Is the GPIO used by the HAT or other device hard wired by the HAT or other device
- Have you got access to the HAT or other device software to make the needed change
You will need to investigate on a case by case basis.