11#ifndef __BMI088_DRIVER_H__
12#define __BMI088_DRIVER_H__
18#include "bmi088_middleware.h"
19#include "bmi088_reg.h"
23#define BMI088_TEMP_FACTOR 0.125f
24#define BMI088_TEMP_OFFSET 23.0f
26#define BMI088_WRITE_ACCEL_REG_NUM 6
27#define BMI088_WRITE_GYRO_REG_NUM 6
29#define BMI088_GYRO_DATA_READY_BIT 0
30#define BMI088_ACCEL_DATA_READY_BIT 1
31#define BMI088_ACCEL_TEMP_DATA_READY_BIT 2
33#define BMI088_LONG_DELAY_TIME 80
34#define BMI088_COM_WAIT_SENSOR_TIME 150
36#define BMI088_ACCEL_IIC_ADDRESSE (0x18 << 1)
37#define BMI088_GYRO_IIC_ADDRESSE (0x68 << 1)
39#define BMI088_ACCEL_RANGE_3G
44#define BMI088_GYRO_RANGE_2000
50#define BMI088_ACCEL_3G_SEN 0.000091552734375f
51#define BMI088_ACCEL_6G_SEN 0.00018310546875f
52#define BMI088_ACCEL_12G_SEN 0.0003662109375f
53#define BMI088_ACCEL_24G_SEN 0.000732421875f
55#define BMI088_GYRO_2000_SEN 0.06103515625f
56#define BMI088_GYRO_1000_SEN 0.030517578125f
57#define BMI088_GYRO_500_SEN 0.0152587890625f
58#define BMI088_GYRO_250_SEN 0.00762939453125f
59#define BMI088_GYRO_125_SEN 0.00381469726563f
61#define DEGREES_TO_RADIANS 0.0174532925199f
65#define G_TO_METERS_PER_SECOND_SQUARED 9.8115861
76 BMI088_NO_ERROR = 0x00,
77 BMI088_ACC_PWR_CTRL_ERROR = 0x01,
78 BMI088_ACC_PWR_CONF_ERROR = 0x02,
79 BMI088_ACC_CONF_ERROR = 0x03,
80 BMI088_ACC_SELF_TEST_ERROR = 0x04,
81 BMI088_ACC_RANGE_ERROR = 0x05,
82 BMI088_INT1_IO_CTRL_ERROR = 0x06,
83 BMI088_INT_MAP_DATA_ERROR = 0x07,
84 BMI088_GYRO_RANGE_ERROR = 0x08,
85 BMI088_GYRO_BANDWIDTH_ERROR = 0x09,
86 BMI088_GYRO_LPM1_ERROR = 0x0A,
87 BMI088_GYRO_CTRL_ERROR = 0x0B,
88 BMI088_GYRO_INT3_INT4_IO_CONF_ERROR = 0x0C,
89 BMI088_GYRO_INT3_INT4_IO_MAP_ERROR = 0x0D,
91 BMI088_SELF_TEST_ACCEL_ERROR = 0x80,
92 BMI088_SELF_TEST_GYRO_ERROR = 0x40,
93 BMI088_NO_SENSOR = 0xFF,
97uint8_t BMI088_init(
void);
98uint8_t bmi088_accel_init(
void);
99uint8_t bmi088_gyro_init(
void);
100uint8_t bmi088_accel_self_test(
void);
101uint8_t bmi088_gyro_self_test(
void);
102void BMI088_read_gyro_who_am_i(
void);
103uint8_t BMI088_read_accel_who_am_i(
void);
104void BMI088_accel_read(uint8_t* rx_buf,
float accel[3],
float* time);
105void BMI088_gyro_read(uint8_t* rx_buf,
float gyro[3]);
106void BMI088_temperature_read(uint8_t* rx_buf,
float* temperate);
107void BMI088_Read(
float gyro[3],
float accel[3],
float* temperate);
108float get_BMI088_temperature(
void);
109void get_BMI088_gyro(int16_t gyro[3]);
110void get_BMI088_accel(
float accel[3]);
112#define BMI088_ACCEL_Read_Single_Reg(reg, data) \
114 BMI088_ACCEL_NS_L(); \
115 BMI088_Read_Write_Byte((reg) | 0x80); \
116 BMI088_Read_Write_Byte(0x55); \
117 (data) = BMI088_Read_Write_Byte(0x55); \
118 BMI088_ACCEL_NS_H(); \
Definition bmi088_driver.h:67