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 ?
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 ?
Hi,
Do you mean nRF5 SDK? nrfx is the separate driver package, which is used both in nRF5 SDK and nRF Connect SDK (NCS).
TWI Slave example is available in the SDK. The example is using the legacy driver APIs, but if you want to use nrfx APIs you can follow the migration guide.
Best regards,
Jørgen.
I was looking for a callback for the i2c stop bit. as it doesn't seem possible to know which NRFX_TWIS_EVT_{READ,WRITE}_DONE is the last one in the i2c transaction (assuming repeated start).
Perhaps what I'm looking matches the driver STOPPED event? So if I understand you, in this case I need to patch the nrfx_twis_state_machine ?
I was looking for a callback for the i2c stop bit. as it doesn't seem possible to know which NRFX_TWIS_EVT_{READ,WRITE}_DONE is the last one in the i2c transaction (assuming repeated start).
Perhaps what I'm looking matches the driver STOPPED event? So if I understand you, in this case I need to patch the nrfx_twis_state_machine ?
Yes, the driver does not provide any STOPPED event to the application. If you want to do a lot of things that the driver is not written for supporting, you may be better off with writing your own driver or using HAL functions/writing directly to the peripheral registers.