/* Reads the I2C register and returns its value.  */
uint16_t I2C_ReadRegister(I2C_T *i2c, I2C_REGISTER_T i2cRegister)
/* Reads the I2C register and returns its value.  */
uint16_t I2C_ReadRegister(I2C_T *i2c, I2C_REGISTER_T i2cRegister)
{
    switch (i2cRegister)
    {
        case I2C_REGISTER_CTRL1:
            return i2c->CTRL1;
        case I2C_REGISTER_CTRL2:
            return i2c->CTRL2;
        case I2C_REGISTER_SADDR1:
            return i2c->SADDR1;
        case I2C_REGISTER_SADDR2:
            return i2c->SADDR2;
        case I2C_REGISTER_DATA:
            return i2c->DATA;
        case I2C_REGISTER_STS1:
            return i2c->STS1;
        case I2C_REGISTER_STS2:
            return i2c->STS2;
        case I2C_REGISTER_CLKCTRL:
            return i2c->CLKCTRL;
        case I2C_REGISTER_RISETMAX:
            return i2c->RISETMAX;
        case I2C_REGISTER_SWITCH:
            return i2c->I2C_SWITCH;
        default:
            return 0;
    }
}