1、nRF_Drivers目录下添加C文件:
\nRF5_SDK_17.1.0_ddde560\integration\nrfx\legacyc\nrf_drv_twi.c
\nRF5_SDK_17.1.0_ddde560\modules\nrfx\drivers\src\nrfx_twi.c
\nRF5_SDK_17.1.0_ddde560\modules\nrfx\drivers\src\nrfx_twim.c
2、添加文件路径
默认已有:..\..\..\..\..\..\integration\nrfx\legacy
新增添加:..\..\..\..\..\..\modules\nrfx\drivers\src
3、修改sdk_config.h文件
1)使能库功能
#ifndef NRFX_TWIM_ENABLED
#define NRFX_TWIM_ENABLED 1
#endif
#ifndef NRFX_TWI_ENABLED
#define NRFX_TWI_ENABLED 1
#endif
#ifndef TWI_ENABLED
#define TWI_ENABLED 1
#endif
#ifndef TWI0_ENABLED
#define TWI0_ENABLED 1
#endif