RTL8720DN I2C Slave Code

Alternatively, you may try to use API directly from the BSP (more specifically the i2c_api.h) which give you full control of I2C peripheral, more detailes can be found in this thread