This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to solve 'NRF_DRV_TWI_INSTANCE_1' was not declared in this scope, NRF_DRV_TWI_INSTANCE_0 works fine

I am modifying the twi_sensor project ( using Segger studio )  I want to add support for TWI 1, I have enabled it in the sdk_config.h file:

// <e> NRFX_TWI_ENABLED - nrfx_twi - TWI peripheral driver
//==========================================================
#ifndef NRFX_TWI_ENABLED
#define NRFX_TWI_ENABLED 1
#endif
// <q> NRFX_TWI0_ENABLED - Enable TWI0 instance

#ifndef NRFX_TWI0_ENABLED
#define NRFX_TWI0_ENABLED 1
#endif

// <q> NRFX_TWI1_ENABLED - Enable TWI1 instance

#ifndef NRFX_TWI1_ENABLED
#define NRFX_TWI1_ENABLED 1
#endif

TWI 0 works fine as expected, not sure why it won't compile with TWI 1 enabled.

Thanks,

John

Related