Here linked an application note about an i2c driver based on interrupt and blocking mechanism for MQX.
This application note implements an i2c driver on MQX, which masked the details of the i2c operations and simplifies the application code to a great extent. It covers both the master and slave modes. The code is validated on the K60n512-TWR board. unfortunately I don't have code for K21F120.