Closed laanwj closed 5 years ago
You can choose any of 4 hw-controlled chip selects as well as sw-controlled one. If you want to use sw-controlled chip-select, you should pass only 3 pins to Spi::spi1
and setup your CS pin as regular GPIO.
For your case I'd recommend configuring CS pin as regular GPIO and using another pin as hw/sw-controlled slave-select.
Ok, that would deviate from the C code I'm porting (which changes the CSID
on the fly) but I'll give it a try to keep as as GPIO, thanks!
I got this to work in the suggested fashion, thanks.
I'm trying to use
spi
in the HAL. However, my board is wired such that the CS pin is used to switch between command and data mode between transfers. I don't think this is currently possible asspi.csid
is only written in the constructor. Or is there something I'm missing?