libyggdrasil  v1.0.0
six_axis_sensor.h File Reference

Driver to use the ICM-42605 Six Axis Sensor. More...

Include dependency graph for six_axis_sensor.h:

Go to the source code of this file.

Classes

struct  Coordinate
 Coordinates. More...
 
struct  Orientation
 Absolute board orientation. More...
 

Enumerations

enum  SixAxisSensorAccelFullScaleRange { SixAxisSensorAccelFullScaleRange_2G = 0x03, SixAxisSensorAccelFullScaleRange_4G = 0x02, SixAxisSensorAccelFullScaleRange_8G = 0x01, SixAxisSensorAccelFullScaleRange_16G = 0x00 }
 Accelerometer range. More...
 
enum  SixAxisSensorGyroFullScaleRange {
  SixAxisSensorGyroFullScaleRange_2000DPS = 0x00, SixAxisSensorGyroFullScaleRange_1000DPS = 0x01, SixAxisSensorGyroFullScaleRange_500DPS = 0x02, SixAxisSensorGyroFullScaleRange_250DPS = 0x03,
  SixAxisSensorGyroFullScaleRange_125DPS = 0x04, SixAxisSensorGyroFullScaleRange_62_5DPS = 0x05, SixAxisSensorGyroFullScaleRange_31_25DPS = 0x06, SixAxisSensorGyroFullScaleRange_15_125DPS = 0x07
}
 Gyroscope range. More...
 
enum  SixAxisSensorAccelOutputDataRange {
  SixAxisSensorAccelOutputDataRange_8000Hz = 0x03, SixAxisSensorAccelOutputDataRange_4000Hz = 0x04, SixAxisSensorAccelOutputDataRange_2000Hz = 0x05, SixAxisSensorAccelOutputDataRange_1000Hz = 0x06,
  SixAxisSensorAccelOutputDataRange_500Hz = 0x0F, SixAxisSensorAccelOutputDataRange_200Hz = 0x07, SixAxisSensorAccelOutputDataRange_100Hz = 0x08, SixAxisSensorAccelOutputDataRange_50Hz = 0x09,
  SixAxisSensorAccelOutputDataRange_25Hz = 0x0A, SixAxisSensorAccelOutputDataRange_12_5Hz = 0x0B, SixAxisSensorAccelOutputDataRange_6_25Hz = 0x0C, SixAxisSensorAccelOutputDataRange_3_125Hz = 0x0D,
  SixAxisSensorAccelOutputDataRange_1_5625Hz = 0x0E
}
 Accelerometer data rate. More...
 
enum  SixAxisSensorGyroOutputDataRange {
  SixAxisSensorGyroOutputDataRange_8000Hz = 0x03, SixAxisSensorGyroOutputDataRange_4000Hz = 0x04, SixAxisSensorGyroOutputDataRange_2000Hz = 0x05, SixAxisSensorGyroOutputDataRange_1000Hz = 0x06,
  SixAxisSensorGyroOutputDataRange_500Hz = 0x0F, SixAxisSensorGyroOutputDataRange_200Hz = 0x07, SixAxisSensorGyroOutputDataRange_100Hz = 0x08, SixAxisSensorGyroOutputDataRange_50Hz = 0x09,
  SixAxisSensorGyroOutputDataRange_25Hz = 0x0A, SixAxisSensorGyroOutputDataRange_12_5Hz = 0x0B
}
 Gyroscope data rate. More...
 

Functions

C_LINKAGE bool yggdrasil_SixAxisSensor_Init (enum SixAxisSensorAccelFullScaleRange accelScale, enum SixAxisSensorGyroFullScaleRange gyroScale, enum SixAxisSensorAccelOutputDataRange accelOdr, enum SixAxisSensorGyroOutputDataRange gyroOdr)
 Initializes the ICM-42605 Six Axis Sensor. More...
 
C_LINKAGE struct Coordinate yggdrasil_SixAxisSensor_GetRotation (void)
 Get yggdrasil's current orientation from the gyroscope. More...
 
C_LINKAGE struct Coordinate yggdrasil_SixAxisSensor_GetAcceleration (void)
 Get yggdrasil's current acceleration from the accelerometer. More...
 
C_LINKAGE float yggdrasil_SixAxisSensor_GetTemperature (void)
 Get the internal temperature of the ICM-42605 sensor. More...
 
C_LINKAGE struct Orientation yggdrasil_SixAxisSensor_GetBoardOrientation (void)
 Get yggdrasil's current orientation. More...
 

Detailed Description

Driver to use the ICM-42605 Six Axis Sensor.

Author
Fabian Weber, Nikolaij Saegesser

Enumeration Type Documentation

◆ SixAxisSensorAccelFullScaleRange

Accelerometer range.

Enumerator
SixAxisSensorAccelFullScaleRange_2G 

Range from -2G to 2G with highest precision.

SixAxisSensorAccelFullScaleRange_4G 

Range from -4G to 4G.

SixAxisSensorAccelFullScaleRange_8G 

Range from -8G to 8G.

SixAxisSensorAccelFullScaleRange_16G 

Range from -16G to 16G with lowest precision.

◆ SixAxisSensorAccelOutputDataRange

Accelerometer data rate.

Enumerator
SixAxisSensorAccelOutputDataRange_8000Hz 

8000 measurements per second

SixAxisSensorAccelOutputDataRange_4000Hz 

4000 measurements per second

SixAxisSensorAccelOutputDataRange_2000Hz 

2000 measurements per second

SixAxisSensorAccelOutputDataRange_1000Hz 

1000 measurements per second

SixAxisSensorAccelOutputDataRange_500Hz 

500 measurements per second

SixAxisSensorAccelOutputDataRange_200Hz 

200 measurements per second

SixAxisSensorAccelOutputDataRange_100Hz 

100 measurements per second

SixAxisSensorAccelOutputDataRange_50Hz 

50 measurements per second

SixAxisSensorAccelOutputDataRange_25Hz 

25 measurements per second

SixAxisSensorAccelOutputDataRange_12_5Hz 

12.5 measurements per second

SixAxisSensorAccelOutputDataRange_6_25Hz 

6.25 measurements per second

SixAxisSensorAccelOutputDataRange_3_125Hz 

3.125 measurements per second

SixAxisSensorAccelOutputDataRange_1_5625Hz 

1.5625 measurements per second

◆ SixAxisSensorGyroFullScaleRange

Gyroscope range.

Note
DPS = degree per second
Enumerator
SixAxisSensorGyroFullScaleRange_2000DPS 

Range from -2000DPS to 2000DPS with lowest precision.

SixAxisSensorGyroFullScaleRange_1000DPS 

Range from -1000DPS to 1000DPS.

SixAxisSensorGyroFullScaleRange_500DPS 

Range from -500DPS to 500DPS.

SixAxisSensorGyroFullScaleRange_250DPS 

Range from -250DPS to 250DPS.

SixAxisSensorGyroFullScaleRange_125DPS 

Range from -125DPS to 125DPS.

SixAxisSensorGyroFullScaleRange_62_5DPS 

Range from -62.5DPS to 65.5DPS.

SixAxisSensorGyroFullScaleRange_31_25DPS 

Range from -31.25DPS to 31.25DPS.

SixAxisSensorGyroFullScaleRange_15_125DPS 

Range from -15.125DPS to 15.125DPS with highest precision.

◆ SixAxisSensorGyroOutputDataRange

Gyroscope data rate.

Enumerator
SixAxisSensorGyroOutputDataRange_8000Hz 

8000 measurements per second

SixAxisSensorGyroOutputDataRange_4000Hz 

4000 measurements per second

SixAxisSensorGyroOutputDataRange_2000Hz 

2000 measurements per second

SixAxisSensorGyroOutputDataRange_1000Hz 

1000 measurements per second

SixAxisSensorGyroOutputDataRange_500Hz 

500 measurements per second

SixAxisSensorGyroOutputDataRange_200Hz 

200 measurements per second

SixAxisSensorGyroOutputDataRange_100Hz 

100 measurements per second

SixAxisSensorGyroOutputDataRange_50Hz 

50 measurements per second

SixAxisSensorGyroOutputDataRange_25Hz 

25 measurements per second

SixAxisSensorGyroOutputDataRange_12_5Hz 

12.5 measurements per second

Function Documentation

◆ yggdrasil_SixAxisSensor_GetAcceleration()

C_LINKAGE struct Coordinate yggdrasil_SixAxisSensor_GetAcceleration ( void  )

Get yggdrasil's current acceleration from the accelerometer.

Returns
X, Y and Z acceleration axis values

◆ yggdrasil_SixAxisSensor_GetBoardOrientation()

C_LINKAGE struct Orientation yggdrasil_SixAxisSensor_GetBoardOrientation ( void  )

Get yggdrasil's current orientation.

Note
When the board is flat on a plain surface this function returns approximately 0 0
Returns
orientation (roll and pitch) in the range from -180 to 180

◆ yggdrasil_SixAxisSensor_GetRotation()

C_LINKAGE struct Coordinate yggdrasil_SixAxisSensor_GetRotation ( void  )

Get yggdrasil's current orientation from the gyroscope.

Returns
X, Y and Z rotation axis values

◆ yggdrasil_SixAxisSensor_GetTemperature()

C_LINKAGE float yggdrasil_SixAxisSensor_GetTemperature ( void  )

Get the internal temperature of the ICM-42605 sensor.

Returns
Temperature value

◆ yggdrasil_SixAxisSensor_Init()

C_LINKAGE bool yggdrasil_SixAxisSensor_Init ( enum SixAxisSensorAccelFullScaleRange  accelScale,
enum SixAxisSensorGyroFullScaleRange  gyroScale,
enum SixAxisSensorAccelOutputDataRange  accelOdr,
enum SixAxisSensorGyroOutputDataRange  gyroOdr 
)

Initializes the ICM-42605 Six Axis Sensor.

Parameters
accelScaleScaling factor of the Accelerometer
gyroScaleScaling factor of the Gyroscope
accelOdrOutput data rate of the Accelerometer
gyroOdrOutput data rate of the Gyroscope
Returns
Success