/* Read from a single register. NOTE: The memory and FIFO read/write registers cannot be accessed.  */
int mpu_read_reg(unsigned char reg, unsigned char *data)
/* Read from a single register. NOTE: The memory and FIFO read/write registers cannot be accessed.  */
int mpu_read_reg(unsigned char reg, unsigned char *data)
{
    if (reg == st.reg->fifo_r_w || reg == st.reg->mem_r_w)
        return -1;
    if (reg >= st.hw->num_reg)
        return -1;
    return i2c_read(st.hw->addr, reg, 1, data);
}