Avionics
Core avionics package for CURE flight computers
Loading...
Searching...
No Matches
Serial_Sim_BMP390.h
Go to the documentation of this file.
1#ifndef SERIAL_SIM_BMP3_H
2#define SERIAL_SIM_BMP3_H
3
4#include "Serial_Sim.h"
5
12public:
14
15 bool begin_SPI(int cs) { return true; } // Mock successful initialization
16 bool begin_I2C(int addr) { return true; } // Mock successful initialization
17 bool begin_I2C() { return true; } // Mock successful initialization
18
19 void setTemperatureOversampling(int oversampling) {}
20 void setPressureOversampling(int oversampling) {}
21 void setIIRFilterCoeff(int coeff) {}
22 void setOutputDataRate(int rate) {}
23 void setConversionDelay(int delay) {}
25 bool updateConversion(){return true;}
26
27 float temperature = 0;
28 float pressure = 0;
29
31 // Mock successful reading, update everthing from SerialSim
32 sensors_event_t temp;
33 float pressure;
34 float altitude;
38 this->temperature = temp.temperature;
39 this->pressure = pressure;
40 return true;
41 }
42
43
44 float getAlt(){
45 float alt;
47 return alt;
48 }
49
50 float readAltitude(float seaLevelPressure = 1013.25) {
51 // Mock altitude calculation
52 float alt;
54 return alt;
55 }
56
57 float getPressure(){
58 float pressure;
60 return pressure;
61 }
62
64 sensors_event_t temp;
65 float temp_f;
66
68 temp_f = temp.temperature;
69 return temp_f;
70 }
71
72
73};
74
75#endif // SERIAL_SIM_BMP3_H
void setTemperatureOversampling(int oversampling)
bool begin_I2C(int addr)
void setConversionDelay(int delay)
void setOutputDataRate(int rate)
bool begin_SPI(int cs)
void setPressureOversampling(int oversampling)
void setIIRFilterCoeff(int coeff)
float readAltitude(float seaLevelPressure=1013.25)
void updateTemp(sensors_event_t &temp)
Definition Serial_Sim.h:108
void updateAlt(float &alt)
Definition Serial_Sim.h:100
void updatePres(float &pres)
Definition Serial_Sim.h:104
static SerialSim & getInstance()
Definition Serial_Sim.h:32