How do I switch between being SPIS/SPIM with the Zephyr library?
I am using ncs v1.9.1. I have code that works separately as a slave or master but I need to make it dynamic. Is there any way to do this?
How do I switch between being SPIS/SPIM with the Zephyr library?
I am using ncs v1.9.1. I have code that works separately as a slave or master but I need to make it dynamic. Is there any way to do this?
Hello,
Can you please clarify a thing for me. Are you trying to connect to two different devices? One SPI slave and one SPI master? Do you want to/need to use the same GPIOs for the SPI slave and the SPI master?
The only reason that I can think of to have both SPIS and SPIM is that you are talking to two different devices, so wouldn't it be easier just to set up both (on different GPIOs)?
Best regards,
Edvin
In that case, that is not possible. In Zephyr, the support to disable peripherals is in general a bit bad. The workaround is typically to use the nrfx drivers directly, instead of the zephyr drivers. That way, you can enable and disable on the fly. You can't have both active at the same time, howerver, so you need to pick one at the time.
Best regards,
Edvin