Written for general use.

-I2C communication port setting is in .h file. (QMC5883L_I2C_PORT, default & hi2c1)

QMC5883L-stm32-hal