Avionics
Core avionics package for CURE flight computers
Loading...
Searching...
No Matches
Serial_Sim_LIS3MDL.h
Go to the documentation of this file.
1#ifndef SERIAL_SIM_LIS3MDL_H
2#define SERIAL_SIM_LIS3MDL_H
3
4#include "Serial_Sim.h"
5
6#ifndef LIS3MDL_DATARATE_155_HZ
7#define LIS3MDL_DATARATE_155_HZ 0x06
8#endif
9
10#ifndef LIS3MDL_RANGE_4_GAUSS
11#define LIS3MDL_RANGE_4_GAUSS 0x01
12#endif
13
14#ifndef LIS3MDL_CONTINUOUSMODE
15#define LIS3MDL_CONTINUOUSMODE 0x00
16#endif
17
18#ifndef LIS3MDL_MEDIUMMODE
19#define LIS3MDL_MEDIUMMODE 0x01
20#endif
21
28public:
30
31 bool begin_SPI(int cs) { return true; } // Mock successful initialization
32 bool begin_I2C(int addr) { return true; } // Mock successful initialization
33 bool begin_I2C() { return true; } // Mock successful initialization
34
35 void setDataRate(int rate) { dataRate_ = rate; }
36 void setRange(int range) { this->range_ = range; }
37 void setOperationMode(int mode) { operationMode_ = mode; }
38 void setPerformanceMode(int mode) { performanceMode_ = mode; }
39 void setIntThreshold(int threshold) { intThreshold_ = static_cast<uint16_t>(threshold); }
40 void configInterrupt(bool a, bool b, bool c) {}
41 void configInterrupt(bool a, bool b, bool c, bool d, bool e, bool f) {}
42 int getPerformanceMode() { return performanceMode_; }
43 int getOperationMode() { return operationMode_; }
44 int getRange() { return range_; }
45 uint16_t getIntThreshold() { return intThreshold_; }
46
47
48
49 int getDataRate() { return dataRate_; }
50
51 void getEvent(sensors_event_t *mag) {
53
54 }
55
56private:
57 int dataRate_ = LIS3MDL_DATARATE_155_HZ;
58 int range_ = LIS3MDL_RANGE_4_GAUSS;
59 int operationMode_ = LIS3MDL_CONTINUOUSMODE;
60 int performanceMode_ = LIS3MDL_MEDIUMMODE;
61 uint16_t intThreshold_ = 0;
62
63};
64
65#endif // SERIAL_SIM_LIS3MDL_H
#define LIS3MDL_DATARATE_155_HZ
#define LIS3MDL_MEDIUMMODE
#define LIS3MDL_RANGE_4_GAUSS
#define LIS3MDL_CONTINUOUSMODE
void configInterrupt(bool a, bool b, bool c, bool d, bool e, bool f)
void getEvent(sensors_event_t *mag)
void setDataRate(int rate)
void setIntThreshold(int threshold)
void setRange(int range)
void configInterrupt(bool a, bool b, bool c)
void setOperationMode(int mode)
void setPerformanceMode(int mode)
bool begin_I2C(int addr)
void updateMag(sensors_event_t *mag)
Definition Serial_Sim.h:76
static SerialSim & getInstance()
Definition Serial_Sim.h:16