MotionTL Software Library: Middlewares/ST/STM32_MotionTL_Library/Inc/motion_tl.h Source File

Middlewares Motion TL

MotionTL Software Library
MotionTL Software Library Documentation
motion_tl.h
Go to the documentation of this file.
1 
38 /* Define to prevent recursive inclusion -------------------------------------*/
39 #ifndef _MOTION_TL_H_
40 #define _MOTION_TL_H_
41 
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45 
46 /* Includes ------------------------------------------------------------------*/
47 #include <stdint.h>
48 
61 /* Exported constants --------------------------------------------------------*/
62 
63 /* Exported types ------------------------------------------------------------*/
64  typedef struct
65 {
66  float AccX; /* Acceleration in X axis in [g] */
67  float AccY; /* Acceleration in Y axis in [g] */
68  float AccZ; /* Acceleration in Z axis in [g] */
69  float deltatime_s; /* Time between 2 library calls in [s] */
70 } MTL_input_t;
71 
72 typedef struct
73 {
74  float Angles_Array[3]; /* Either pitch, roll and gravity inclination or theta, psi and phi */
75 } MTL_output_t;
76 
77 typedef struct
78 {
79  float offset[3];
80  float gain[3];
81 } MTL_AccCal_t;
82 
83 typedef enum
84 {
85  MODE_PITCH_ROLL_GRAVITY_INCLINATION, /* pitch, roll and gravity inclination */
86  MODE_THETA_PSI_PHI /* theta, psi and phi */
88 
89 typedef enum
90 {
98 
99 typedef enum
100 {
101  CAL_PASS, /* Calibration passed */
102  CAL_NONE, /* Calibration not finished or not performed at all */
103  CAL_FAIL /* Calibration failed */
105 
110 /* Exported variables --------------------------------------------------------*/
111 /* Exported macro ------------------------------------------------------------*/
112 
117 /* Exported functions ------------------------------------------------------- */
118 
124 void MotionTL_Initialize(void);
125 
131 void MotionTL_SetOrientation_Acc(const char *acc_orientation);
132 
138 void MotionTL_Update(MTL_input_t *data_in);
139 
146 void MotionTL_GetAngles(MTL_output_t *data_out, MTL_AngleMode_t angleMode);
147 
153 uint8_t MotionTL_GetLibVersion(char *version);
154 
162 void MotionTL_CalibratePosition(float calData[][3], uint32_t nRecords, MTL_CalPosition_t calPosition);
163 
170 
177 
190 #ifdef __cplusplus
191 }
192 #endif
193 
194 #endif /* _MOTION_TL_H_ */
195 
196 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
void MotionTL_Initialize(void)
Initialize the MotionTL engine.
Definition: motion_tl.h:91
Definition: motion_tl.h:95
MTL_CalResult_t
Definition: motion_tl.h:99
void MotionTL_GetAngles(MTL_output_t *data_out, MTL_AngleMode_t angleMode)
Get angles.
MTL_CalPosition_t
Definition: motion_tl.h:89
float AccZ
Definition: motion_tl.h:68
float AccX
Definition: motion_tl.h:66
void MotionTL_SetOrientation_Acc(const char *acc_orientation)
Set the MotionTL accelerometer data orientation.
MTL_CalResult_t MotionTL_GetCalValues(MTL_AccCal_t *accCal)
Get accelerometer calibration values.
void MotionTL_CalibratePosition(float calData[][3], uint32_t nRecords, MTL_CalPosition_t calPosition)
Calibrate accelerometer in specific position.
Definition: motion_tl.h:93
MTL_AngleMode_t
Definition: motion_tl.h:83
void MotionTL_Update(MTL_input_t *data_in)
Run tilt algorithm.
MTL_CalResult_t MotionTL_SetCalValues(MTL_AccCal_t *accCal)
Set accelerometer calibration values.
float deltatime_s
Definition: motion_tl.h:69
uint8_t MotionTL_GetLibVersion(char *version)
Get the library version.
float AccY
Definition: motion_tl.h:67
Generated on Fri Aug 25 2017 11:05:08 for MotionTL Software Library by   doxygen 1.8.9.1