Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs

Accessing the nrf52820 pins

Hello all

I am porting the code from the nRF52DK to the nrf52820, and so far so good, however, I am having a question, when configuring the TWI, will this get me the right PINS, for instance, according to the module manufacturer I should be accessing the P0.02 for SDA, while P0.08 for the SCL , this is my code:

void twi_init (void)
{
    ret_code_t err_code;

    const nrf_drv_twi_config_t twi_config = {
       .scl                = NRF_GPIO_PIN_MAP(0, 8), // ARDUINO_SCL_PIN,   //Add you SCL Pin Here
       .sda                = NRF_GPIO_PIN_MAP(0, 2), // ARDUINO_SDA_PIN,   //Add you SDA Pin Here
       .frequency          = NRF_DRV_TWI_FREQ_100K,
       .interrupt_priority = APP_IRQ_PRIORITY_HIGH,
       .clear_bus_init     = false
    };

    err_code = nrf_drv_twi_init(&m_twi, &twi_config, twi_handler, NULL);
    APP_ERROR_CHECK(err_code);

    nrf_drv_twi_enable(&m_twi);
}

This part works on the nrf52dk, for example where I am directly using the P0.27 and P0.26, however, the numbers 26 and 27 are simply used, as 26 and 27... 

hence my question, if I am accessing the pins correctly?

best.

Parents Reply Children
Related