libyggdrasil  v1.0.0
six_axis_sensor.h
Go to the documentation of this file.
1  /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2  * _____.___. .___ .__.__ *
3  * \__ | | ____ ____ __| _/___________ _____|__| | *
4  * / | |/ ___\ / ___\ / __ |\_ __ \__ \ / ___/ | | *
5  * \____ / /_/ > /_/ > /_/ | | | \// __ \_\___ \| | |__ *
6  * / ______\___ /\___ /\____ | |__| (____ /____ >__|____/ *
7  * \/ /_____//_____/ \/ \/ \/ *
8  * - Yggdrasil - *
9  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
10  * This software can be used by students and other personal of the *
11  * Bern University of Applied Sciences under the terms of the MIT *
12  * license. *
13  * For other persons this software is under the terms of the GNU *
14  * General Public License version 2. *
15  * *
16  * Copyright © 2021, Bern University of Applied Sciences. *
17  * All rights reserved. *
18  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
26 #pragma once
27 
28 #include <c/yggdrasil/types.h>
29 
33 struct Coordinate {
34  float x, y, z;
35 };
36 
40 struct Orientation {
41  float roll;
42  float pitch;
43 };
44 
53 };
54 
68 };
69 
87 };
88 
103 };
104 
116 
123 
130 
137 
145 
146 
yggdrasil_SixAxisSensor_GetAcceleration
C_LINKAGE struct Coordinate yggdrasil_SixAxisSensor_GetAcceleration(void)
Get yggdrasil's current acceleration from the accelerometer.
SixAxisSensorGyroOutputDataRange_500Hz
@ SixAxisSensorGyroOutputDataRange_500Hz
500 measurements per second
Definition: six_axis_sensor.h:97
SixAxisSensorGyroFullScaleRange_31_25DPS
@ SixAxisSensorGyroFullScaleRange_31_25DPS
Range from -31.25DPS to 31.25DPS.
Definition: six_axis_sensor.h:66
SixAxisSensorGyroFullScaleRange_2000DPS
@ SixAxisSensorGyroFullScaleRange_2000DPS
Range from -2000DPS to 2000DPS with lowest precision.
Definition: six_axis_sensor.h:60
SixAxisSensorGyroFullScaleRange_15_125DPS
@ SixAxisSensorGyroFullScaleRange_15_125DPS
Range from -15.125DPS to 15.125DPS with highest precision.
Definition: six_axis_sensor.h:67
Coordinate::x
float x
Definition: six_axis_sensor.h:34
SixAxisSensorGyroOutputDataRange
SixAxisSensorGyroOutputDataRange
Gyroscope data rate.
Definition: six_axis_sensor.h:92
SixAxisSensorAccelOutputDataRange_200Hz
@ SixAxisSensorAccelOutputDataRange_200Hz
200 measurements per second
Definition: six_axis_sensor.h:79
SixAxisSensorAccelOutputDataRange_3_125Hz
@ SixAxisSensorAccelOutputDataRange_3_125Hz
3.125 measurements per second
Definition: six_axis_sensor.h:85
SixAxisSensorAccelFullScaleRange_8G
@ SixAxisSensorAccelFullScaleRange_8G
Range from -8G to 8G.
Definition: six_axis_sensor.h:51
SixAxisSensorAccelOutputDataRange_25Hz
@ SixAxisSensorAccelOutputDataRange_25Hz
25 measurements per second
Definition: six_axis_sensor.h:82
Coordinate::z
float z
Definition: six_axis_sensor.h:34
SixAxisSensorGyroOutputDataRange_200Hz
@ SixAxisSensorGyroOutputDataRange_200Hz
200 measurements per second
Definition: six_axis_sensor.h:98
yggdrasil_SixAxisSensor_GetRotation
C_LINKAGE struct Coordinate yggdrasil_SixAxisSensor_GetRotation(void)
Get yggdrasil's current orientation from the gyroscope.
Orientation::roll
float roll
Rotation around x-axis.
Definition: six_axis_sensor.h:41
SixAxisSensorGyroFullScaleRange_62_5DPS
@ SixAxisSensorGyroFullScaleRange_62_5DPS
Range from -62.5DPS to 65.5DPS.
Definition: six_axis_sensor.h:65
SixAxisSensorAccelFullScaleRange_2G
@ SixAxisSensorAccelFullScaleRange_2G
Range from -2G to 2G with highest precision.
Definition: six_axis_sensor.h:49
SixAxisSensorAccelOutputDataRange_12_5Hz
@ SixAxisSensorAccelOutputDataRange_12_5Hz
12.5 measurements per second
Definition: six_axis_sensor.h:83
SixAxisSensorAccelOutputDataRange_1_5625Hz
@ SixAxisSensorAccelOutputDataRange_1_5625Hz
1.5625 measurements per second
Definition: six_axis_sensor.h:86
SixAxisSensorAccelOutputDataRange_4000Hz
@ SixAxisSensorAccelOutputDataRange_4000Hz
4000 measurements per second
Definition: six_axis_sensor.h:75
SixAxisSensorGyroOutputDataRange_25Hz
@ SixAxisSensorGyroOutputDataRange_25Hz
25 measurements per second
Definition: six_axis_sensor.h:101
SixAxisSensorGyroFullScaleRange_500DPS
@ SixAxisSensorGyroFullScaleRange_500DPS
Range from -500DPS to 500DPS.
Definition: six_axis_sensor.h:62
SixAxisSensorGyroFullScaleRange
SixAxisSensorGyroFullScaleRange
Gyroscope range.
Definition: six_axis_sensor.h:59
SixAxisSensorAccelFullScaleRange_16G
@ SixAxisSensorAccelFullScaleRange_16G
Range from -16G to 16G with lowest precision.
Definition: six_axis_sensor.h:52
SixAxisSensorGyroOutputDataRange_4000Hz
@ SixAxisSensorGyroOutputDataRange_4000Hz
4000 measurements per second
Definition: six_axis_sensor.h:94
SixAxisSensorAccelOutputDataRange_100Hz
@ SixAxisSensorAccelOutputDataRange_100Hz
100 measurements per second
Definition: six_axis_sensor.h:80
types.h
SixAxisSensorGyroFullScaleRange_1000DPS
@ SixAxisSensorGyroFullScaleRange_1000DPS
Range from -1000DPS to 1000DPS.
Definition: six_axis_sensor.h:61
SixAxisSensorGyroFullScaleRange_125DPS
@ SixAxisSensorGyroFullScaleRange_125DPS
Range from -125DPS to 125DPS.
Definition: six_axis_sensor.h:64
SixAxisSensorAccelOutputDataRange_1000Hz
@ SixAxisSensorAccelOutputDataRange_1000Hz
1000 measurements per second
Definition: six_axis_sensor.h:77
SixAxisSensorGyroOutputDataRange_2000Hz
@ SixAxisSensorGyroOutputDataRange_2000Hz
2000 measurements per second
Definition: six_axis_sensor.h:95
SixAxisSensorAccelOutputDataRange_6_25Hz
@ SixAxisSensorAccelOutputDataRange_6_25Hz
6.25 measurements per second
Definition: six_axis_sensor.h:84
Coordinate::y
float y
Definition: six_axis_sensor.h:34
SixAxisSensorGyroFullScaleRange_250DPS
@ SixAxisSensorGyroFullScaleRange_250DPS
Range from -250DPS to 250DPS.
Definition: six_axis_sensor.h:63
SixAxisSensorGyroOutputDataRange_8000Hz
@ SixAxisSensorGyroOutputDataRange_8000Hz
8000 measurements per second
Definition: six_axis_sensor.h:93
SixAxisSensorAccelOutputDataRange_8000Hz
@ SixAxisSensorAccelOutputDataRange_8000Hz
8000 measurements per second
Definition: six_axis_sensor.h:74
Orientation::pitch
float pitch
Rotation around y-axis.
Definition: six_axis_sensor.h:42
SixAxisSensorAccelOutputDataRange
SixAxisSensorAccelOutputDataRange
Accelerometer data rate.
Definition: six_axis_sensor.h:73
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.
SixAxisSensorGyroOutputDataRange_50Hz
@ SixAxisSensorGyroOutputDataRange_50Hz
50 measurements per second
Definition: six_axis_sensor.h:100
SixAxisSensorGyroOutputDataRange_100Hz
@ SixAxisSensorGyroOutputDataRange_100Hz
100 measurements per second
Definition: six_axis_sensor.h:99
SixAxisSensorAccelFullScaleRange_4G
@ SixAxisSensorAccelFullScaleRange_4G
Range from -4G to 4G.
Definition: six_axis_sensor.h:50
SixAxisSensorAccelOutputDataRange_500Hz
@ SixAxisSensorAccelOutputDataRange_500Hz
500 measurements per second
Definition: six_axis_sensor.h:78
SixAxisSensorGyroOutputDataRange_12_5Hz
@ SixAxisSensorGyroOutputDataRange_12_5Hz
12.5 measurements per second
Definition: six_axis_sensor.h:102
SixAxisSensorGyroOutputDataRange_1000Hz
@ SixAxisSensorGyroOutputDataRange_1000Hz
1000 measurements per second
Definition: six_axis_sensor.h:96
Orientation
Absolute board orientation.
Definition: six_axis_sensor.h:40
yggdrasil_SixAxisSensor_GetTemperature
C_LINKAGE float yggdrasil_SixAxisSensor_GetTemperature(void)
Get the internal temperature of the ICM-42605 sensor.
SixAxisSensorAccelOutputDataRange_2000Hz
@ SixAxisSensorAccelOutputDataRange_2000Hz
2000 measurements per second
Definition: six_axis_sensor.h:76
SixAxisSensorAccelFullScaleRange
SixAxisSensorAccelFullScaleRange
Accelerometer range.
Definition: six_axis_sensor.h:48
Coordinate
Coordinates.
Definition: six_axis_sensor.h:33
C_LINKAGE
#define C_LINKAGE
Definition: attributes.h:43
SixAxisSensorAccelOutputDataRange_50Hz
@ SixAxisSensorAccelOutputDataRange_50Hz
50 measurements per second
Definition: six_axis_sensor.h:81
yggdrasil_SixAxisSensor_GetBoardOrientation
C_LINKAGE struct Orientation yggdrasil_SixAxisSensor_GetBoardOrientation(void)
Get yggdrasil's current orientation.