Syntax:
bool begin(I2C_Class* i2c = nullptr, board_t board = board_t::board_unknown);
Description:
Parameters:
Return:
Syntax:
bool init(I2C_Class* i2c = nullptr) { return begin(i2c); }
Description:
Parameters:
Return:
Syntax:
bool sleep(void);
Description:
Parameters:
Return:
Syntax:
void setClock(std::uint32_t freq);
Description:
Parameters:
Return:
Syntax:
sensor_mask_t update(void);
Description:
Parameters:
Return:
0000
0001
0010
0100
enum sensor_index_t
{
sensor_index_accel = 0,
sensor_index_gyro = 1,
sensor_index_mag = 2,
};
enum sensor_mask_t
{
sensor_mask_none = 0,
sensor_mask_accel = 1 << sensor_index_accel,
sensor_mask_gyro = 1 << sensor_index_gyro,
sensor_mask_mag = 1 << sensor_index_mag,
};
Syntax:
void getImuData(imu_data_t* imu_data);
const imu_data_t& getImuData(void) { getImuData(&_last_data); return _last_data; }
Description:
Parameters:
Return:
data.accel.x
: accel x-axis value.data.accel.y
: accel y-axis value.data.accel.z
: accel z-axis value.data.accel.value
: accel 3values array [0]=x / [1]=y / [2]=z.data.gyro.x
: gyro x-axis value.data.gyro.y
: gyro y-axis value.data.gyro.z
: gyro z-axis value.data.gyro.value
: gyro 3values array [0]=x / [1]=y / [2]=z.data.mag.x
: mag x-axis value.data.mag.y
: mag y-axis value.data.mag.z
: mag z-axis value.data.mag.value
: mag 3values array [0]=x / [1]=y / [2]=z.data.value
: all sensor 9values array [0-2]=accel / [3-5]=gyro / [6-8]=magSyntax:
bool setAxisOrder(axis_t axis0, axis_t axis1, axis_t axis2);
Description:
Parameters:
enum axis_t
{
axis_x_pos = 0,
axis_x_neg = 1,
axis_y_pos = 2,
axis_y_neg = 3,
axis_z_pos = 4,
axis_z_neg = 5,
};
Return:
Syntax:
bool setAxisOrderRightHanded(axis_t axis0, axis_t axis1);
Description:
Parameters:
Return:
Syntax:
bool setAxisOrderLeftHanded(axis_t axis0, axis_t axis1);
Syntax:
bool getAccel(float* ax, float* ay, float* az);
Description:
Parameters:
Return:
Syntax:
bool getGyro(float* gx, float* gy, float* gz);
Description:
Parameters:
Return:
Syntax:
bool getMag(float* mx, float* my, float* mz);
Description:
Parameters:
Return:
Syntax:
bool getTemp(float *t);
Description:
Parameters:
Return:
Syntax:
bool isEnabled(void) const { return _imu != imu_none; }
Description:
Parameters:
Return:
Syntax:
imu_t getType(void) const { return _imu; }
Description:
Parameters:
Return:
enum imu_t
{ imu_none,
imu_unknown,
imu_sh200q,
imu_mpu6050,
imu_mpu6886,
imu_mpu9250,
imu_bmi270,
};
Syntax:
bool setINTPinActiveLogic(bool level);
Description:
Parameters:
Return:
Syntax:
void setCalibration(uint8_t accel_strength, uint8_t gyro_strength, uint8_t mag_strength);
Description:
Parameters:
Return:
Syntax:
bool saveOffsetToNVS(void);
Description:
Parameters:
Return:
Syntax:
bool loadOffsetFromNVS(void);
Description:
Parameters:
Return:
Syntax:
void clearOffsetData(void);
Description:
Parameters:
Return:
Syntax:
void setOffsetData(size_t index, int32_t value);
Description:
Parameters:
Return:
Syntax:
int32_t getOffsetData(size_t index);
Description:
Parameters:
Return:
Syntax:
int16_t getRawData(size_t index);
Description:
Parameters:
Return:
Syntax:
IMU_Base* getImuInstancePtr(int idx) const { return _imu_instance[idx].get(); }
Description:
Parameters:
Return: