STSW-STLKT01: Projects/SensorTile/Applications/DataLog/Inc/datalog_application.h Source File

STSW-STLKT01

datalog_application.h
Go to the documentation of this file.
1 
28 /* Define to prevent recursive inclusion -------------------------------------*/
29 #ifndef __DATALOG_APPLICATION_H
30 #define __DATALOG_APPLICATION_H
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 #include "cube_hal.h"
37 
38 //#define SAMPLING_25Hz
39 //#define SAMPLING_50Hz
40 #define SAMPLING_100Hz
41 
42 #if defined( SAMPLING_25Hz)
43  #define DEFAULT_uhCCR1_Val 390
44  #define ACCELERO_ODR 25.0f
45  #define GYRO_ODR 26.0f
46  #define MAGNETO_ODR 20.0f
47  #define PRESSURE_ODR 25.0f
48  #define DATA_PERIOD_MS (40)
49 
50 #elif defined( SAMPLING_50Hz)
51  #define DEFAULT_uhCCR1_Val 190
52  #define ACCELERO_ODR 50.0f
53  #define GYRO_ODR 52.0f
54  #define MAGNETO_ODR 50.0f
55  #define PRESSURE_ODR 50.0f
56  #define DATA_PERIOD_MS (20)
57 
58 #elif defined( SAMPLING_100Hz)
59  #define DEFAULT_uhCCR1_Val 100
60  #define ACCELERO_ODR 100.0f
61  #define GYRO_ODR 104.0f
62  #define MAGNETO_ODR 100.0f
63  #define PRESSURE_ODR 50.0f
64  #define DATA_PERIOD_MS (10)
65 #endif
66 
67 #define TEMPERATURE_ODR 12.5f
68 #define HUMIDITY_ODR 12.5f
69 
70 typedef enum
71 {
72  USB_Datalog = 0,
73  SDCARD_Datalog
74 } LogInterface_TypeDef;
75 
76 
77 typedef struct
78 {
79  uint32_t ms_counter;
80  float pressure;
81  float humidity;
82  float temperature;
83  SensorAxes_t acc;
84  SensorAxes_t gyro;
85  SensorAxes_t mag;
87 
88 extern LogInterface_TypeDef LoggingInterface;
89 extern volatile uint8_t SD_Log_Enabled;
90 
91 void floatToInt( float in, int32_t *out_int, int32_t *out_dec, int32_t dec_prec );
92 
93 void DATALOG_SD_Init(void);
94 uint8_t DATALOG_SD_Log_Enable(void);
95 uint8_t DATALOG_SD_writeBuf(char *s, uint32_t size);
96 void DATALOG_SD_Log_Disable(void);
97 void DATALOG_SD_DeInit(void);
98 void DATALOG_SD_NewLine(void);
99 DrvStatusTypeDef getSensorsData( T_SensorsData *mptr);
100 
101 #ifdef __cplusplus
102 }
103 #endif
104 
105 #endif /* __DATALOG_APPLICATION_H */
106 
107 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
void floatToInt(float in, int32_t *out_int, int32_t *out_dec, int32_t dec_prec)
Splits a float into two integer values.
void DATALOG_SD_NewLine(void)
Write New Line to file.
uint8_t DATALOG_SD_Log_Enable(void)
Start SD-Card demo.
void DATALOG_SD_Log_Disable(void)
Disable SDCard Log.
Header for cube_hal_l4.c.
void DATALOG_SD_Init(void)
Start SD-Card demo.
Generated by   doxygen 1.8.13