Workaround needed for TWI driver (nrf_drv_twi) in SDK v8.1 (TWI_COUNT missing)

In SDK v8.1 we added the TWI driver (nrf_drv_twi.c). Unfortunately the nrf_drv_config.h file wasn't updated correctly with the new driver.

The symptom is the error with "TWI_COUNT is missing". Here is what should be added to nrf_drv_config.h:

/* TWI */
#define TWI0_ENABLED 0

#if (TWI0_ENABLED == 1)
#define TWI0_CONFIG_FREQUENCY NRF_TWI_FREQ_100K
#define TWI0_CONFIG_SCL 0
#define TWI0_CONFIG_SDA 1
#define TWI0_CONFIG_IRQ_PRIORITY APP_IRQ_PRIORITY_HIGH

#define TWI0_INSTANCE_INDEX 0
#endif

#define TWI1_ENABLED 0

#if (TWI1_ENABLED == 1)
#define TWI1_CONFIG_FREQUENCY NRF_TWI_FREQ_250K
#define TWI1_CONFIG_SCL 2
#define TWI1_CONFIG_SDA 3
#define TWI1_CONFIG_IRQ_PRIORITY APP_IRQ_PRIORITY_LOW

#define TWI1_INSTANCE_INDEX (TWI0_ENABLED)
#endif

#define TWI_COUNT (TWI0_ENABLED+TWI1_ENABLED)

You would need to select which TWI peripheral you want to enable.