Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion include/simulation/Serial_Sim.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 25 additions & 0 deletions include/simulation/Serial_Sim_LIS2MDL.h
Original file line number Diff line number Diff line change
@@ -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