I have to implement a custom I2C Bus communication. My Slave has to listen on all Addresses (eg. the Address 0x00 will be used as a Broadcast Address) and has to answer to some read / write requests with an ACK
I saw in the nRF52 documentation that in the TWIS Implementation, the Slave will only respond with an ACK, if one of the configured Addresses are matching.
Does someone has an idea, how to manually trigger an ACK withing the TWIS Event handler?
static void TwiInit( void ) { const nrf_drv_twis_config_t config = { .addr = {0, 0}, .scl = SCL_PIN, .sda = SDA_PIN, .interrupt_priority = TWIS_DEFAULT_CONFIG_IRQ_PRIORITY }; if(NRF_SUCCESS != nrf_drv_twis_init(&m_twis, &config, twis_event_handler)) { LOG_INFO("twis init failed!\n\r"); } else { } nrf_drv_twis_enable(&m_twis); }
/** * @brief TWI events handler. */ void twis_event_handler(nrf_drv_twis_evt_t const * const p_event){ switch(p_event->type) { case TWIS_EVT_WRITE_REQ: break; case TWIS_EVT_WRITE_DONE: /* TRIGGER AN ACK */ break; default: break; } }