I2C TWI Driver - legacy layer

Hi, 

    given "nrf_drv_twi_xfer" or its "nrfx_twim_xfer" younger brother is used to communicate over I2C, and its a TxTx tranfer, than what does "nrf_drv_flag_tx_no_stop" do? Does this mean that there is no stop after the second Tx? Or between Tx -Tx operations? 

Moreover, what exactly is the behavior of nrf_drv_twi_xfer_TXRX/TXTX/TX/RX? I assume TXRX means that N-bytes are sent, than M-bytes are received without a resending of the I2C address in-between? Likewise, I assume TxTx N-bytes are sent, than M-bytes are sent, without a resending of the I2C address in-between? 

Parents Reply Children
  • If you want a stop, then the driver seems to be sending a 0 as the flag based on the code in nrfx_twim.c

    nrfx_err_t nrfx_twim_tx(nrfx_twim_t const * p_instance,
                            uint8_t             address,
                            uint8_t     const * p_data,
                            size_t              length,
                            bool                no_stop)
    {
        nrfx_twim_xfer_desc_t xfer = NRFX_TWIM_XFER_DESC_TX(address, (uint8_t*)p_data, length);
    
        return nrfx_twim_xfer(p_instance, &xfer, no_stop ? NRFX_TWIM_FLAG_TX_NO_STOP : 0);
    }

Related