Configure I2C in MCC Once you Generate the MCC code it will have dealt with initialising the I2C port ready for you to use it. In your code Other UART functions MCC will have created a few useful functions you can call – see the file it generated in: /config/default/peripheral/i2c/