STSW-STLKT01: Drivers/BSP/SensorTile/SensorTile_accelero.h Source File

STSW-STLKT01

STSW-STLKT01
SensorTile_accelero.h
Go to the documentation of this file.
1 
38 /* Define to prevent recursive inclusion -------------------------------------*/
39 #ifndef __SENSORTILE_ACCELERO_H
40 #define __SENSORTILE_ACCELERO_H
41 
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45 
46 
47 
48 /* Includes ------------------------------------------------------------------*/
49 
50 #include "LSM6DSM_ACC_GYRO_driver_HL.h"
51 #include "LSM303AGR_ACC_driver_HL.h"
52 #include "SensorTile.h"
53 
54 
55 
72 typedef enum
73 {
74  ACCELERO_SENSORS_AUTO = -1, /* Always first element and equal to -1 */
75  LSM6DSM_X_0, /* . */
76  LSM303AGR_X_0 /* . */
77 } ACCELERO_ID_t;
78 
87 #define ACCELERO_SENSORS_MAX_NUM 2
88 
97 /* Sensor Configuration Functions */
98 DrvStatusTypeDef BSP_ACCELERO_Init( ACCELERO_ID_t id, void **handle );
99 DrvStatusTypeDef BSP_ACCELERO_DeInit( void **handle );
100 DrvStatusTypeDef BSP_ACCELERO_Sensor_Enable( void *handle );
101 DrvStatusTypeDef BSP_ACCELERO_Sensor_Disable( void *handle );
102 DrvStatusTypeDef BSP_ACCELERO_IsInitialized( void *handle, uint8_t *status );
103 DrvStatusTypeDef BSP_ACCELERO_IsEnabled( void *handle, uint8_t *status );
104 DrvStatusTypeDef BSP_ACCELERO_IsCombo( void *handle, uint8_t *status );
105 DrvStatusTypeDef BSP_ACCELERO_Get_Instance( void *handle, uint8_t *instance );
106 DrvStatusTypeDef BSP_ACCELERO_Get_WhoAmI( void *handle, uint8_t *who_am_i );
107 DrvStatusTypeDef BSP_ACCELERO_Check_WhoAmI( void *handle );
108 DrvStatusTypeDef BSP_ACCELERO_Get_Axes( void *handle, SensorAxes_t *acceleration );
109 DrvStatusTypeDef BSP_ACCELERO_Get_AxesRaw( void *handle, SensorAxesRaw_t *value );
110 DrvStatusTypeDef BSP_ACCELERO_Get_Sensitivity( void *handle, float *sensitivity );
111 DrvStatusTypeDef BSP_ACCELERO_Get_ODR( void *handle, float *odr );
112 DrvStatusTypeDef BSP_ACCELERO_Set_ODR( void *handle, SensorOdr_t odr );
113 DrvStatusTypeDef BSP_ACCELERO_Set_ODR_Value( void *handle, float odr );
114 DrvStatusTypeDef BSP_ACCELERO_Get_FS( void *handle, float *fullScale );
115 DrvStatusTypeDef BSP_ACCELERO_Set_FS( void *handle, SensorFs_t fullScale );
116 DrvStatusTypeDef BSP_ACCELERO_Set_FS_Value( void *handle, float fullScale );
117 DrvStatusTypeDef BSP_ACCELERO_Get_Axes_Status( void *handle, uint8_t *xyz_enabled );
118 DrvStatusTypeDef BSP_ACCELERO_Set_Axes_Status( void *handle, uint8_t *enable_xyz );
119 DrvStatusTypeDef BSP_ACCELERO_Read_Reg( void *handle, uint8_t reg, uint8_t *data );
120 DrvStatusTypeDef BSP_ACCELERO_Write_Reg( void *handle, uint8_t reg, uint8_t data );
121 DrvStatusTypeDef BSP_ACCELERO_Get_DRDY_Status( void *handle, uint8_t *status );
122 
123 DrvStatusTypeDef BSP_ACCELERO_Enable_Free_Fall_Detection_Ext( void *handle );
124 DrvStatusTypeDef BSP_ACCELERO_Disable_Free_Fall_Detection_Ext( void *handle );
125 DrvStatusTypeDef BSP_ACCELERO_Get_Free_Fall_Detection_Status_Ext( void *handle, uint8_t *status );
126 DrvStatusTypeDef BSP_ACCELERO_Set_Free_Fall_Threshold_Ext( void *handle, LSM6DSM_ACC_GYRO_FF_THS_t thr );
127 
128 DrvStatusTypeDef BSP_ACCELERO_Enable_Pedometer_Ext( void *handle );
129 DrvStatusTypeDef BSP_ACCELERO_Disable_Pedometer_Ext( void *handle );
130 DrvStatusTypeDef BSP_ACCELERO_Get_Pedometer_Status_Ext( void *handle, uint8_t *status );
131 DrvStatusTypeDef BSP_ACCELERO_Get_Step_Count_Ext( void *handle, uint16_t *step_count );
132 DrvStatusTypeDef BSP_ACCELERO_Reset_Step_Counter_Ext( void *handle );
133 DrvStatusTypeDef BSP_ACCELERO_Set_Pedometer_Threshold_Ext( void *handle, uint8_t thr );
134 
135 DrvStatusTypeDef BSP_ACCELERO_Enable_Tilt_Detection_Ext( void *handle );
136 DrvStatusTypeDef BSP_ACCELERO_Disable_Tilt_Detection_Ext( void *handle );
137 DrvStatusTypeDef BSP_ACCELERO_Get_Tilt_Detection_Status_Ext( void *handle, uint8_t *status );
138 
139 DrvStatusTypeDef BSP_ACCELERO_Enable_Wake_Up_Detection_Ext( void *handle );
140 DrvStatusTypeDef BSP_ACCELERO_Disable_Wake_Up_Detection_Ext( void *handle );
141 DrvStatusTypeDef BSP_ACCELERO_Get_Wake_Up_Detection_Status_Ext( void *handle, uint8_t *status );
142 DrvStatusTypeDef BSP_ACCELERO_Set_Wake_Up_Threshold_Ext( void *handle, uint8_t thr );
143 
144 DrvStatusTypeDef BSP_ACCELERO_Enable_Single_Tap_Detection_Ext( void *handle );
145 DrvStatusTypeDef BSP_ACCELERO_Disable_Single_Tap_Detection_Ext( void *handle );
146 DrvStatusTypeDef BSP_ACCELERO_Get_Single_Tap_Detection_Status_Ext( void *handle, uint8_t *status );
147 DrvStatusTypeDef BSP_ACCELERO_Enable_Double_Tap_Detection_Ext( void *handle );
148 DrvStatusTypeDef BSP_ACCELERO_Disable_Double_Tap_Detection_Ext( void *handle );
149 DrvStatusTypeDef BSP_ACCELERO_Get_Double_Tap_Detection_Status_Ext( void *handle, uint8_t *status );
150 DrvStatusTypeDef BSP_ACCELERO_Set_Tap_Threshold_Ext( void *handle, uint8_t thr );
151 DrvStatusTypeDef BSP_ACCELERO_Set_Tap_Shock_Time_Ext( void *handle, uint8_t time );
152 DrvStatusTypeDef BSP_ACCELERO_Set_Tap_Quiet_Time_Ext( void *handle, uint8_t time );
153 DrvStatusTypeDef BSP_ACCELERO_Set_Tap_Duration_Time_Ext( void *handle, uint8_t time );
154 
155 DrvStatusTypeDef BSP_ACCELERO_Enable_6D_Orientation_Ext( void *handle );
156 DrvStatusTypeDef BSP_ACCELERO_Disable_6D_Orientation_Ext( void *handle );
157 DrvStatusTypeDef BSP_ACCELERO_Get_6D_Orientation_Status_Ext( void *handle, uint8_t *status );
158 DrvStatusTypeDef BSP_ACCELERO_Get_6D_Orientation_XL_Ext( void *handle, uint8_t *xl );
159 DrvStatusTypeDef BSP_ACCELERO_Get_6D_Orientation_XH_Ext( void *handle, uint8_t *xh );
160 DrvStatusTypeDef BSP_ACCELERO_Get_6D_Orientation_YL_Ext( void *handle, uint8_t *yl );
161 DrvStatusTypeDef BSP_ACCELERO_Get_6D_Orientation_YH_Ext( void *handle, uint8_t *yh );
162 DrvStatusTypeDef BSP_ACCELERO_Get_6D_Orientation_ZL_Ext( void *handle, uint8_t *zl );
163 DrvStatusTypeDef BSP_ACCELERO_Get_6D_Orientation_ZH_Ext( void *handle, uint8_t *zh );
164 
181 #ifdef __cplusplus
182 }
183 #endif
184 
185 #endif /* __SENSORTILE_ACCELERO_H */
186 
187 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
DrvStatusTypeDef BSP_ACCELERO_Get_Sensitivity(void *handle, float *sensitivity)
Get the accelerometer sensor sensitivity.
DrvStatusTypeDef BSP_ACCELERO_Get_ODR(void *handle, float *odr)
Get the accelerometer sensor output data rate.
DrvStatusTypeDef BSP_ACCELERO_Get_Instance(void *handle, uint8_t *instance)
Get the accelerometer sensor instance.
DrvStatusTypeDef BSP_ACCELERO_Get_6D_Orientation_ZL_Ext(void *handle, uint8_t *zl)
Get the 6D orientation ZL axis (available only for LSM6DS3 sensor)
DrvStatusTypeDef BSP_ACCELERO_Init(ACCELERO_ID_t id, void **handle)
Initialize an accelerometer sensor.
DrvStatusTypeDef BSP_ACCELERO_Get_6D_Orientation_YH_Ext(void *handle, uint8_t *yh)
Get the 6D orientation YH axis (available only for LSM6DS3 sensor)
DrvStatusTypeDef BSP_ACCELERO_Get_Step_Count_Ext(void *handle, uint16_t *step_count)
Get the step counter (available only for LSM6DS3 sensor)
DrvStatusTypeDef BSP_ACCELERO_Get_6D_Orientation_XH_Ext(void *handle, uint8_t *xh)
Get the 6D orientation XH axis (available only for LSM6DS3 sensor)
DrvStatusTypeDef BSP_ACCELERO_Get_Double_Tap_Detection_Status_Ext(void *handle, uint8_t *status)
Get the double tap detection status (available only for LSM6DS3 sensor)
DrvStatusTypeDef BSP_ACCELERO_IsInitialized(void *handle, uint8_t *status)
Check if the accelerometer sensor is initialized.
DrvStatusTypeDef BSP_ACCELERO_Get_Pedometer_Status_Ext(void *handle, uint8_t *status)
Get the pedometer status (available only for LSM6DS3 sensor)
DrvStatusTypeDef BSP_ACCELERO_Write_Reg(void *handle, uint8_t reg, uint8_t data)
Write the data to register.
DrvStatusTypeDef BSP_ACCELERO_Get_AxesRaw(void *handle, SensorAxesRaw_t *value)
Get the accelerometer sensor raw axes.
DrvStatusTypeDef BSP_ACCELERO_Disable_Tilt_Detection_Ext(void *handle)
Disable the tilt detection (available only for LSM6DS3 sensor)
DrvStatusTypeDef BSP_ACCELERO_Get_Wake_Up_Detection_Status_Ext(void *handle, uint8_t *status)
Get the status of the wake up detection (available only for LSM6DS3 sensor)
DrvStatusTypeDef BSP_ACCELERO_Set_FS(void *handle, SensorFs_t fullScale)
Set the accelerometer sensor full scale.
DrvStatusTypeDef BSP_ACCELERO_Reset_Step_Counter_Ext(void *handle)
Reset of the step counter (available only for LSM6DS3 sensor)
DrvStatusTypeDef BSP_ACCELERO_Set_Free_Fall_Threshold_Ext(void *handle, LSM6DSM_ACC_GYRO_FF_THS_t thr)
Set the free fall detection threshold (available only for LSM6DS3 sensor)
DrvStatusTypeDef BSP_ACCELERO_Enable_Wake_Up_Detection_Ext(void *handle)
Enable the wake up detection (available only for LSM6DS3 sensor)
DrvStatusTypeDef BSP_ACCELERO_Set_Tap_Quiet_Time_Ext(void *handle, uint8_t time)
Set the tap quiet time window (available only for LSM6DS3 sensor)
DrvStatusTypeDef BSP_ACCELERO_Check_WhoAmI(void *handle)
Check the WHO_AM_I ID of the accelerometer sensor.
DrvStatusTypeDef BSP_ACCELERO_Enable_Single_Tap_Detection_Ext(void *handle)
Enable the single tap detection (available only for LSM6DS3 sensor)
DrvStatusTypeDef BSP_ACCELERO_Enable_Tilt_Detection_Ext(void *handle)
Enable the tilt detection (available only for LSM6DS3 sensor)
DrvStatusTypeDef BSP_ACCELERO_Enable_Pedometer_Ext(void *handle)
Enable the pedometer feature (available only for LSM6DS3 sensor)
DrvStatusTypeDef BSP_ACCELERO_Disable_6D_Orientation_Ext(void *handle)
Disable the 6D orientation detection (available only for LSM6DS3 sensor)
DrvStatusTypeDef BSP_ACCELERO_Read_Reg(void *handle, uint8_t reg, uint8_t *data)
Read the data from register.
DrvStatusTypeDef BSP_ACCELERO_Enable_Free_Fall_Detection_Ext(void *handle)
Enable the free fall detection (available only for LSM6DS3 sensor)
DrvStatusTypeDef BSP_ACCELERO_Get_Axes(void *handle, SensorAxes_t *acceleration)
Get the accelerometer sensor axes.
This file contains definitions for SensorTile.c file.
DrvStatusTypeDef BSP_ACCELERO_Disable_Wake_Up_Detection_Ext(void *handle)
Disable the wake up detection (available only for LSM6DS3 sensor)
DrvStatusTypeDef BSP_ACCELERO_Disable_Free_Fall_Detection_Ext(void *handle)
Disable the free fall detection (available only for LSM6DS3 sensor)
DrvStatusTypeDef BSP_ACCELERO_Get_Tilt_Detection_Status_Ext(void *handle, uint8_t *status)
Get the tilt detection status (available only for LSM6DS3 sensor)
DrvStatusTypeDef BSP_ACCELERO_Get_Free_Fall_Detection_Status_Ext(void *handle, uint8_t *status)
Get the status of the free fall detection (available only for LSM6DS3 sensor)
DrvStatusTypeDef BSP_ACCELERO_Get_6D_Orientation_XL_Ext(void *handle, uint8_t *xl)
Get the 6D orientation XL axis (available only for LSM6DS3 sensor)
DrvStatusTypeDef BSP_ACCELERO_Set_Axes_Status(void *handle, uint8_t *enable_xyz)
Set the enabled/disabled status of the accelerometer sensor axes.
DrvStatusTypeDef BSP_ACCELERO_Disable_Pedometer_Ext(void *handle)
Disable the pedometer feature (available only for LSM6DS3 sensor)
DrvStatusTypeDef BSP_ACCELERO_DeInit(void **handle)
Deinitialize accelerometer sensor.
DrvStatusTypeDef BSP_ACCELERO_Sensor_Enable(void *handle)
Enable accelerometer sensor.
DrvStatusTypeDef BSP_ACCELERO_IsCombo(void *handle, uint8_t *status)
Check if the accelerometer sensor is combo.
DrvStatusTypeDef BSP_ACCELERO_Set_ODR_Value(void *handle, float odr)
Set the accelerometer sensor output data rate.
DrvStatusTypeDef BSP_ACCELERO_Set_Pedometer_Threshold_Ext(void *handle, uint8_t thr)
Set the pedometer threshold (available only for LSM6DS3 sensor)
DrvStatusTypeDef BSP_ACCELERO_IsEnabled(void *handle, uint8_t *status)
Check if the accelerometer sensor is enabled.
DrvStatusTypeDef BSP_ACCELERO_Get_WhoAmI(void *handle, uint8_t *who_am_i)
Get the WHO_AM_I ID of the accelerometer sensor.
DrvStatusTypeDef BSP_ACCELERO_Get_6D_Orientation_YL_Ext(void *handle, uint8_t *yl)
Get the 6D orientation YL axis (available only for LSM6DS3 sensor)
DrvStatusTypeDef BSP_ACCELERO_Set_Tap_Threshold_Ext(void *handle, uint8_t thr)
Set the tap threshold (available only for LSM6DS3 sensor)
DrvStatusTypeDef BSP_ACCELERO_Get_6D_Orientation_Status_Ext(void *handle, uint8_t *status)
Get the status of the 6D orientation detection (available only for LSM6DS3 sensor) ...
DrvStatusTypeDef BSP_ACCELERO_Get_FS(void *handle, float *fullScale)
Get the accelerometer sensor full scale.
DrvStatusTypeDef BSP_ACCELERO_Enable_6D_Orientation_Ext(void *handle)
Enable the 6D orientation detection (available only for LSM6DS3 sensor)
DrvStatusTypeDef BSP_ACCELERO_Set_FS_Value(void *handle, float fullScale)
Set the accelerometer sensor full scale.
DrvStatusTypeDef BSP_ACCELERO_Set_Tap_Shock_Time_Ext(void *handle, uint8_t time)
Set the tap shock time window (available only for LSM6DS3 sensor)
DrvStatusTypeDef BSP_ACCELERO_Get_Single_Tap_Detection_Status_Ext(void *handle, uint8_t *status)
Get the single tap detection status (available only for LSM6DS3 sensor)
DrvStatusTypeDef BSP_ACCELERO_Get_Axes_Status(void *handle, uint8_t *xyz_enabled)
Get the accelerometer sensor axes status.
DrvStatusTypeDef BSP_ACCELERO_Get_DRDY_Status(void *handle, uint8_t *status)
Get accelerometer data ready status.
DrvStatusTypeDef BSP_ACCELERO_Get_6D_Orientation_ZH_Ext(void *handle, uint8_t *zh)
Get the 6D orientation ZH axis (available only for LSM6DS3 sensor)
DrvStatusTypeDef BSP_ACCELERO_Set_ODR(void *handle, SensorOdr_t odr)
Set the accelerometer sensor output data rate.
DrvStatusTypeDef BSP_ACCELERO_Sensor_Disable(void *handle)
Disable accelerometer sensor.
DrvStatusTypeDef BSP_ACCELERO_Disable_Double_Tap_Detection_Ext(void *handle)
Disable the double tap detection (available only for LSM6DS3 sensor)
DrvStatusTypeDef BSP_ACCELERO_Enable_Double_Tap_Detection_Ext(void *handle)
Enable the double tap detection (available only for LSM6DS3 sensor)
DrvStatusTypeDef BSP_ACCELERO_Disable_Single_Tap_Detection_Ext(void *handle)
Disable the single tap detection (available only for LSM6DS3 sensor)
DrvStatusTypeDef BSP_ACCELERO_Set_Tap_Duration_Time_Ext(void *handle, uint8_t time)
Set the tap duration of the time window (available only for LSM6DS3 sensor)
DrvStatusTypeDef BSP_ACCELERO_Set_Wake_Up_Threshold_Ext(void *handle, uint8_t thr)
Set the wake up threshold (available only for LSM6DS3 sensor)
Generated by   doxygen 1.8.13