wayne roberts
/
CB-LORA-MR_utility
test sending sensor results over lora radio. Accelerometer and temp/pressure.
Embed:
(wiki syntax)
Show/hide line numbers
demo.h
00001 #include "x_nucleo_iks01a2.h" 00002 #include "x_nucleo_iks01a2_accelero.h" 00003 #include "x_nucleo_iks01a2_pressure.h" 00004 #include "x_nucleo_iks01a2_temperature.h" 00005 00006 #define SAMPLE_LIST_MAX 10 /*!< Max. number of acceleration values (X,Y,Z) to be printed to UART */ 00007 #define FIFO_INDICATION_DELAY 100 /*!< When FIFO event ocurs, LED is ON for at least this period [ms] */ 00008 00009 #define LIS2DH_MAIN_NONE 0 00010 #define LIS2DH_BSP_FAIL 1 00011 #define LIS2DH_FAIL 2 00012 #define LIS2DH_FAIL_STATE 3 00013 #define LIS2DH_MAIN_SLEEP 4 00014 #define LIS2DH_MAIN_READ_FIFO 5 00015 00016 #ifdef __cplusplus 00017 extern "C" { 00018 #endif 00019 00020 typedef struct displayFloatToInt_s 00021 { 00022 int8_t sign; /* 0 means positive, 1 means negative */ 00023 uint32_t out_int; 00024 uint32_t out_dec; 00025 } displayFloatToInt_t; 00026 00027 int demo_start(void); 00028 00029 int lis2dh_mainloop(void); 00030 00031 uint8_t accel_get_num_samples(void); 00032 int lis2dh_set_fifo_bypass(void); 00033 DrvStatusTypeDef lis2dh12_get_axes(SensorAxes_t *); 00034 00035 void lis2dh_int1(void); // irq callback 00036 00037 void c_log_printf(const char* format, ...); // from main.cpp 00038 void demo_sample_temp(displayFloatToInt_t*); 00039 void demo_sample_pressure(displayFloatToInt_t*); 00040 int lis2dh_set_fifo_mode(void); 00041 int accel_enable(uint8_t); 00042 int accel_is_enabled(uint8_t* status); 00043 00044 #ifdef __cplusplus 00045 } 00046 #endif
Generated on Tue Jul 12 2022 16:29:49 by 1.7.2