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

nrfx and twis samples

I wasn't able to find sample code showing how to use the nrfx sdk to perform TWI slave.

Can you point me to some examples ?

Parents Reply
  • I can't find a clear procedure to do this in the driver or in the peripheral documentation. You will have to handle this in the application, but since the TWIS peripheral use EasyDMA to read/write directly from/to RAM, there is no way to intercept the transfer between the register-address being written and the ACK being generated. You can stop a read operation if the slave does not support the register-address after the address-write, by stopping the peripheral, using the following function:

    nrf_twis_task_trigger(m_twis.p_reg,NRF_TWIS_TASK_STOP);

    Note that this does not prevent the master from performing the read, the master will have to detect and react to the NACKs and stop the transfer itself. This is a capture I did with the TWIS example:

Children
No Data
Related