Requesting Sample I2C Master Example

Hello,

We are using the twi master with twi slave example to confirm out device is working as a I2C master.

First question is there another I2C sample as a master ?

In the sdk_config.h there are pull ups for NRF_TWIS and TWIS pins, but we are not using the slave portion of the example.

How do we pull up the I2C Master Pins ?

In the twi_master_init , is there a way to configure the pullups ? We would like to test this being able to pull up and pull down.

static ret_code_t twi_master_init(void)
{
    ret_code_t ret;
    const nrf_drv_twi_config_t config =
    {
       .scl                = TWI_SCL_M,
       .sda                = TWI_SDA_M,
       .frequency          = NRF_DRV_TWI_FREQ_400K,
       .interrupt_priority = APP_IRQ_PRIORITY_HIGH,
       .clear_bus_init     = false
    };

    
    ret = nrf_drv_twi_init(&m_twi_master, &config, NULL, NULL);

    if (NRF_SUCCESS == ret)
    {
        nrf_drv_twi_enable(&m_twi_master);
    }

    return ret;
}

Thanks

Related