/* Reads the specified I2C register and returns its value.  */
u16 I2C_ReadRegister(I2C_TypeDef *i2c, u8 reg)
/* Reads the specified I2C register and returns its value.  */
u16 I2C_ReadRegister(I2C_TypeDef *i2c, u8 reg)
{
    return (*(vu16*)(*((u32*)&i2c) + reg));
}