Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

NRF_DRV_TWI_INSTANCE error

hi,

       i test my project for i2c sensor module, the debug found have error what there are the following error tips.

..\..\..\swct_application\i2c_sensor_driver.c(14): error:  #20: identifier "NRF_DRV_TWI_INSTANCE_0" is undefined

please tell me set this macro definition where is it ? in sdk_config.h ?

and i have include nrf_drv_twi.c and #include "nrf_drv_twi.h"

my code :

/* TWI instance ID. */
#define TWI_INSTANCE_ID     0

/* Common addresses definition for temperature sensor. */
#define SENSOR_ADDR          (0x78U >> 1)


/* Indicates if operation on TWI has ended. */
static volatile bool m_xfer_done = false;

/* TWI instance. */
static const nrf_drv_twi_t m_twi = NRF_DRV_TWI_INSTANCE(TWI_INSTANCE_ID);

Related