petrockblog / ControlBlockService2

This is the driver for the ControlBlock re.v 2.X, a power switch and input/output/gameapd gadget for the Raspberry Pi

Home Page:https://controlblock.petrockblock.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GPIO-CS

mortaca opened this issue · comments

commented

Any GPIO pin can be used as CS in the latest RPi versions, but I tried to make an Overlay by moving CS0 from pin 7 to 25 but ControlBlock does not recognize it.
I have recompiled bcm2835.c by changing the CS pins and also mcp23s17pi.cpp by adding the address of the new CS in pin 25 but nothing.
Could it be possible to explain what changes are necessary to be able to move CS to any GPIO?
Many thanks.

The access to the port expanders in completely implemented in https://github.com/petrockblog/ControlBlockService2/blob/master/src/controlblock/mcp23s17pi.cpp, which relies on the bcm2835 library.

commented

Yes but only allows to use BCM2835_SPI_CS0 or BCM2835_SPI_CS1 (GPIO 8 or 7) and i need to use GPIO 25 to free 8 and 7 for diferent purpose.
I found another library with this is simple to make.

https://www.bayceer.uni-bayreuth.de/bayeos/en/sensor_net/107622/BayEOS-Arduino/group__constants.html#ga29bba154633d37d07fa130a86e4a1f2a

But I have not been able to use it

commented

Please, can you showme the way to move the CS to another GPIO?

I do not know that library, sorry.