Hi,
I want to get the SPI data register status regarding if they are full or empty.!
Kindly guide me with relevant APIs i can use.
Thanks,
Hi,
I want to get the SPI data register status regarding if they are full or empty.!
Kindly guide me with relevant APIs i can use.
Thanks,
Hi
The SPI slave peripheral for instance uses two memory pointers RXD.PTR and TXD.PTR, that point to the RXD buffer and TXD buffer respectively. Since these buffers are located in RAM, it can be accessed by both the SPI slave and the CPU.
I'm afraid we don't have a specific code example doing this already, but you should be able to implement it by referring to the SPI slave operation description and registers in the product specification.
Best regards
Simon
Hi
The SPI slave peripheral for instance uses two memory pointers RXD.PTR and TXD.PTR, that point to the RXD buffer and TXD buffer respectively. Since these buffers are located in RAM, it can be accessed by both the SPI slave and the CPU.
I'm afraid we don't have a specific code example doing this already, but you should be able to implement it by referring to the SPI slave operation description and registers in the product specification.
Best regards
Simon
Hello Simon,
Thanks for the info, I am using nCS as in zephyr driver model,
So can I use something specific to zephyr..?
For example in spi_context.h, I noticed APIs like:
bool spi_context_tx_on(struct spi_context *ctx) { return !!(ctx->tx_len); } bool spi_context_rx_on(struct spi_context *ctx) { return !!(ctx->rx_len); } bool spi_context_rx_buf_on(struct spi_context *ctx) { return !!(ctx->rx_buf && ctx->rx_len); }
Is this SPI Context already pointing to RXD.PTR and TXD.PTR for nordic board..?
Can i use above APIs..?
Hello Simonr,
I think my question is not right,
Rather, If i need to get say nordic board SPI tx data address from device binding or device tree, so that i can check if buffer empty or full,
What can I do..?
Kindly suggest
Hi
To check your TX buffer for instance, you will need to use the p_tx_buffer which is the pointer to the TX buffer (or ctx->tx_buf) in the spi_nrfx files in the nRFConnect SDK. YOu then have to read the memory from this pointer to check whether the buffer is empty or filled. I'm afraid there's no specific "buffer status" check in the API.
Best regards,
Simon