How to write a software library for Grove - I2C Motor Driver (TB6612FNG) in stm32 cube ide?

Hello,

I’m doing a project where I control a DC/Stepper motor with an stm32 MCU. I’m using an I2C Motor Driver to connect between the controller and the motor.

The Motor Driver isn’t compatible with stm32, therefore I need to write a software library for it.

If you know any literature that can help me write a software library to control a motor that would be very helpful

Thank you