/* This function is used for initialize the bus read and bus write functions and assign the chip id and I2C address of the gyro chip id is read in the register 0x00 bit from 0 to 7.  */
BMG160_RETURN_FUNCTION_TYPE bmg160_init(struct bmg160_t *bmg160)
/* This function is used for initialize the bus read and bus write functions and assign the chip id and I2C address of the gyro chip id is read in the register 0x00 bit from 0 to 7.  */
BMG160_RETURN_FUNCTION_TYPE bmg160_init(struct bmg160_t *bmg160)
{
    BMG160_RETURN_FUNCTION_TYPE comres = ERROR;
    u8 v_data_u8  = BMG160_INIT_VALUE;
    p_bmg160 = bmg160;
    comres = p_bmg160->BMG160_BUS_READ_FUNC(p_bmg160->dev_addr,
                                            BMG160_CHIP_ID_ADDR, &v_data_u8, BMG160_GEN_READ_WRITE_DATA_LENGTH);
    p_bmg160->chip_id = v_data_u8;
    return comres;
}