This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

SPI protocol configuration. How to change spi0(master) into spis0(slave) in running time?

Hi all

I use nRf52840 with SDK 15.0. It allows  SPI SPIS and TWI (i2c) ,but almost 3 items in the same time. I want to use spi0 as master to configurate my other mcu and change to spis 0 as a receiver to receive data from this mcu. but the macro can't change. If I define spi0 ,I can't use spis0 anymore.  How to implement my requirement ?

Parents Reply
  • You can change the pin configuration at runtime, and you can ENABLE and DISABLE peripherials.

    Not sure if NRF DRV functions work correctly in this case, I would just set those PSEL.XXX registers directly.

    I suggest using different instances (look at the base address in manual) for the master and the slave, this way you would only change the connect bit in the corresponding PSEL register.

Children
Related