diff --git a/include/simulation/Serial_Sim.h b/include/simulation/Serial_Sim.h index 8b257d7..b00e965 100644 --- a/include/simulation/Serial_Sim.h +++ b/include/simulation/Serial_Sim.h @@ -9,11 +9,13 @@ #define LSM6DS_ACCEL_RANGE_16_G 0x03 #define LSM6DS_GYRO_RANGE_2000_DPS 0x03 #define LSM6DS_RATE_104_HZ 0x04 -// LIS3MDL (Magnetometer) Define +// LIS3MDL (Magnetometer 1.3) Define #define LIS3MDL_DATARATE_155_HZ 0x06 #define LIS3MDL_RANGE_4_GAUSS 0x01 #define LIS3MDL_CONTINUOUSMODE 0x00 #define LIS3MDL_MEDIUMMODE 0x01 +// LIS2MDL (Magnetometer 1.4) Define +#define LIS2MDL_RATE_100_HZ 0x06 // BMP3 (Barometric Pressure Sensor) Define #define BMP3_OVERSAMPLING_8X 0x03 #define BMP3_OVERSAMPLING_4X 0x02 diff --git a/include/simulation/Serial_Sim_LIS2MDL.h b/include/simulation/Serial_Sim_LIS2MDL.h new file mode 100644 index 0000000..0779836 --- /dev/null +++ b/include/simulation/Serial_Sim_LIS2MDL.h @@ -0,0 +1,25 @@ +#ifndef SERIAL_SIM_LIS2MDL_H +#define SERIAL_SIM_LIS2MDL_H + +#include "Serial_Sim.h" + +class Adafruit_LIS2MDL { +public: + Adafruit_LIS2MDL (){} + + bool begin_SPI(int cs) { return true; } // Mock successful initialization SPI + bool begin(int addr) { return true; } // Mock successful initialization I2C + + void setDataRate(int rate) {} + void enableInterrupts(bool a) {} + + int getDataRate() { return 100; } // Mock as 155 Hz + + void getEvent(sensors_event_t *mag) { + SerialSim::getInstance().updateMag(mag); + + } + +}; + +#endif // SERIAL_SIM_LIS2MDL_H