Hi there!
I'm currently in a position where I'm using SPI0, SPI1 and SPI2 (for ST7735, WS2812 and SD-Card for FatFS) while I need to also be able to use I2C for the Adafruit NFC reader. I knew there was something named Peripheral Resource Sharing (PRS) that's used for sharing the common resources for peripherals that're sharing the same hardware and base address. Furthermore, I'm also aware of the fact that the peripherals that are sharing resources aren't able to be active at the same time.
That's where my question comes in; is this handled from within the SDK or does the user have to take care of this. The issue I'm currently facing is the following. When SPI0 for the WS2812's has been initialized and I try to initialize TWI0 for the NFC Reader, I get the output underneath.
<info> PRS: Function: nrfx_prs_acquire, error code: NRF_SUCCESS.
<info> PRS: Function: nrfx_prs_acquire, error code: NRF_SUCCESS.
<info> adafruit_pn532: Creating I2C
<warning> PRS: Function: nrfx_prs_acquire, error code: NRF_ERROR_BUSY.
This makes me think the SPI0 and TWI0 peripheral aren't allowed to be initialized at the same time. But then the question arises what the goal of the PRS is. Wasn't that the problem PRS was supposed to solve?
If the above really is true, and the peripherals in the PRS box aren't allowed to be active all at once, I don't think it's very useful for me. That rises another question; why doesn't the SPI bus support the CS (Chip Select) pin. Isn't that a core functionality of SPI? The way I see the bus now is that it can't be shared with 2 or more slaves. That's right, right?
Kind regards,
Jochem