M5Unified
m5::IMU_Class Class Reference

#include <IMU_Class.hpp>

Classes

struct  imu_3d_t
 
struct  imu_data_t
 

Public Types

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
}
 
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 }
 

Public Member Functions

bool begin (I2C_Class *i2c=nullptr, board_t board=board_t::board_unknown)
 
bool init (I2C_Class *i2c=nullptr)
 
sensor_mask_t update (void)
 
void getImuData (imu_data_t *imu_data)
 
const imu_data_tgetImuData (void)
 
bool setAxisOrder (axis_t axis0, axis_t axis1, axis_t axis2)
 
bool setAxisOrderRightHanded (axis_t axis0, axis_t axis1)
 
bool setAxisOrderLeftHanded (axis_t axis0, axis_t axis1)
 
bool getAccel (float *ax, float *ay, float *az)
 
bool getGyro (float *gx, float *gy, float *gz)
 
bool getMag (float *mx, float *my, float *mz)
 
bool getAccelData (float *ax, float *ay, float *az)
 
bool getGyroData (float *gx, float *gy, float *gz)
 
bool getGyroMag (float *mx, float *my, float *mz)
 
bool getTemp (float *t)
 
bool isEnabled (void) const
 
imu_t getType (void) const
 
bool setINTPinActiveLogic (bool level)
 
void setCalibration (uint8_t accel_strength, uint8_t gyro_strength, uint8_t mag_strength)
 
bool saveOffsetToNVS (void)
 
bool loadOffsetFromNVS (void)
 
void clearOffsetData (void)
 
void setOffsetData (size_t index, int32_t value)
 
int32_t getOffsetData (size_t index)
 
int16_t getRawData (size_t index)
 

Detailed Description

Definition at line 23 of file IMU_Class.hpp.

Member Enumeration Documentation

◆ axis_t

Enumerator
axis_x_pos 
axis_x_neg 
axis_y_pos 
axis_y_neg 
axis_z_pos 
axis_z_neg 

Definition at line 57 of file IMU_Class.hpp.

◆ sensor_index_t

Enumerator
sensor_index_accel 
sensor_index_gyro 
sensor_index_mag 

Definition at line 67 of file IMU_Class.hpp.

◆ sensor_mask_t

Enumerator
sensor_mask_none 
sensor_mask_accel 
sensor_mask_gyro 
sensor_mask_mag 

Definition at line 74 of file IMU_Class.hpp.

Member Function Documentation

◆ begin()

bool m5::IMU_Class::begin ( I2C_Class i2c = nullptr,
m5::board_t  board = board_t::board_unknown 
)

Definition at line 28 of file IMU_Class.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clearOffsetData()

void m5::IMU_Class::clearOffsetData ( void  )

Definition at line 319 of file IMU_Class.cpp.

◆ getAccel()

bool m5::IMU_Class::getAccel ( float *  ax,
float *  ay,
float *  az 
)

Definition at line 412 of file IMU_Class.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAccelData()

bool m5::IMU_Class::getAccelData ( float *  ax,
float *  ay,
float *  az 
)
inline

Definition at line 103 of file IMU_Class.hpp.

Here is the call graph for this function:

◆ getGyro()

bool m5::IMU_Class::getGyro ( float *  gx,
float *  gy,
float *  gz 
)

Definition at line 428 of file IMU_Class.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getGyroData()

bool m5::IMU_Class::getGyroData ( float *  gx,
float *  gy,
float *  gz 
)
inline

Definition at line 104 of file IMU_Class.hpp.

Here is the call graph for this function:

◆ getGyroMag()

bool m5::IMU_Class::getGyroMag ( float *  mx,
float *  my,
float *  mz 
)
inline

Definition at line 105 of file IMU_Class.hpp.

Here is the call graph for this function:

◆ getImuData() [1/2]

void m5::IMU_Class::getImuData ( imu_data_t imu_data)

Definition at line 391 of file IMU_Class.cpp.

◆ getImuData() [2/2]

const imu_data_t& m5::IMU_Class::getImuData ( void  )
inline

Definition at line 89 of file IMU_Class.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getMag()

bool m5::IMU_Class::getMag ( float *  mx,
float *  my,
float *  mz 
)

Definition at line 444 of file IMU_Class.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getOffsetData()

int32_t m5::IMU_Class::getOffsetData ( size_t  index)

Definition at line 338 of file IMU_Class.cpp.

◆ getRawData()

int16_t m5::IMU_Class::getRawData ( size_t  index)

Definition at line 343 of file IMU_Class.cpp.

◆ getTemp()

bool m5::IMU_Class::getTemp ( float *  t)

Definition at line 460 of file IMU_Class.cpp.

◆ getType()

imu_t m5::IMU_Class::getType ( void  ) const
inline

Definition at line 110 of file IMU_Class.hpp.

◆ init()

bool m5::IMU_Class::init ( I2C_Class i2c = nullptr)
inline

Definition at line 83 of file IMU_Class.hpp.

Here is the call graph for this function:

◆ isEnabled()

bool m5::IMU_Class::isEnabled ( void  ) const
inline

Definition at line 108 of file IMU_Class.hpp.

◆ loadOffsetFromNVS()

bool m5::IMU_Class::loadOffsetFromNVS ( void  )

Definition at line 295 of file IMU_Class.cpp.

Here is the caller graph for this function:

◆ saveOffsetToNVS()

bool m5::IMU_Class::saveOffsetToNVS ( void  )

Definition at line 272 of file IMU_Class.cpp.

◆ setAxisOrder()

bool m5::IMU_Class::setAxisOrder ( axis_t  axis0,
axis_t  axis1,
axis_t  axis2 
)

Definition at line 193 of file IMU_Class.cpp.

Here is the caller graph for this function:

◆ setAxisOrderLeftHanded()

bool m5::IMU_Class::setAxisOrderLeftHanded ( axis_t  axis0,
axis_t  axis1 
)

Definition at line 265 of file IMU_Class.cpp.

Here is the call graph for this function:

◆ setAxisOrderRightHanded()

bool m5::IMU_Class::setAxisOrderRightHanded ( axis_t  axis0,
axis_t  axis1 
)

Definition at line 260 of file IMU_Class.cpp.

Here is the call graph for this function:

◆ setCalibration()

void m5::IMU_Class::setCalibration ( uint8_t  accel_strength,
uint8_t  gyro_strength,
uint8_t  mag_strength 
)

Definition at line 183 of file IMU_Class.cpp.

Here is the caller graph for this function:

◆ setINTPinActiveLogic()

bool m5::IMU_Class::setINTPinActiveLogic ( bool  level)

Definition at line 472 of file IMU_Class.cpp.

◆ setOffsetData()

void m5::IMU_Class::setOffsetData ( size_t  index,
int32_t  value 
)

Definition at line 331 of file IMU_Class.cpp.

◆ update()

IMU_Class::sensor_mask_t m5::IMU_Class::update ( void  )

Definition at line 348 of file IMU_Class.cpp.

Here is the caller graph for this function:

The documentation for this class was generated from the following files: