I am attempting to design a device using a Pi Zero which needs to connect to both an ENC18J60 SPI ethernet controller, and a VGA monitor via Mode 3 DPI and the Mincepi Pi Zero pi2vga schematic. While pins GPIO9, GPIO10 and GPIO11 (physical pins 21, 19 and 23), used for SPI, are left open, the CS pins GPIO8 and GPIO7 are both used. Unfortunately, no other DPI modes free these pins. The SPI1 interface is also not fully accessible in any DPI mode.
As such, I have been looking into ways to reassign the CS pin for SPI0 to another, unused GPIO, such as GPIO19, which goes unused in DPI mode 3. In the /boot/overlays/README file, it mentions the ability to use spi0-cs, which "Allows the (software) CS pins for SPI0 to be changed".
Apparently, I could set the cs0_pin parameter of this to, for example, 19, and run my CS somewhere else. However, from what I can tell in the file, this is "software" CS, which presumably exists at a higher level than CS on pins GPIO7 and GPIO8.
As such, my two questions are as follow:
- How do I configure it to use CS for SPI0 on Pin GPIO19? Do I just set the spi0-cs parameter, or are there other details? It mentions "spi0-hw-cs", which "Re-enables hardware CS/CE (chip selects) for SPI0", so I presume that "Re-enables" means they are, by default, disabled when spi0-cs is configured? If not, how do I disable the hardware CS so as not to conflict with my DPI interface?
- Will the ENC18J60 function properly with "software" CS using a different pin? Are any changes needed to the kernel, drivers, etc (e.g. ENC18J60 driver somehow assumes it's at Pin 8 and needs to be modified), does changing the CS pin here mean it should work, or will it be completely broken because the ENC18J60 somehow operates at a lower level than wherever the "software" CS exists?