Skip to content

[LIS2MDL] Removed constructor from config struct

Alberto Nidasio requested to merge lis2mdl into main

Since the other drivers have a configuration struct without constructor I'd like if also the LIS2MDL would be the same. This allows to define the configuration in the same clear way for each sensor in the OBSW SensorsConfig.h file.

Like:

Boardcore::LSM6DSRXConfig LSM6_SENSOR_CONFIG{
    .bdu       = Boardcore::LSM6DSRXConfig::BDU::CONTINUOUS_UPDATE,
    .odrAcc    = Boardcore::LSM6DSRXConfig::ACC_ODR::HZ_1660,
    .opModeAcc = Boardcore::LSM6DSRXConfig::OPERATING_MODE::NORMAL,
    .fsAcc     = Boardcore::LSM6DSRXConfig::ACC_FULLSCALE::G16,
    .odrGyr    = Boardcore::LSM6DSRXConfig::GYR_ODR::HZ_1660,
    .opModeGyr = Boardcore::LSM6DSRXConfig::OPERATING_MODE::NORMAL,
    .fsGyr     = Boardcore::LSM6DSRXConfig::GYR_FULLSCALE::DPS_1000,
    .fifoMode  = Boardcore::LSM6DSRXConfig::FIFO_MODE::CONTINUOUS,
    .fifoTimestampDecimation =
        Boardcore::LSM6DSRXConfig::FIFO_TIMESTAMP_DECIMATION::DEC_1,
    .fifoTemperatureBdr =
        Boardcore::LSM6DSRXConfig::FIFO_TEMPERATURE_BDR::DISABLED,
    .int1InterruptSelection = Boardcore::LSM6DSRXConfig::INTERRUPT::NOTHING,
    .int2InterruptSelection =
        Boardcore::LSM6DSRXConfig::INTERRUPT::FIFO_THRESHOLD,
    .fifoWatermark = 170,
};

Boardcore::LIS2MDL::Config LIS2_SENSOR_CONFIG{
    .odr                = Boardcore::LIS2MDL::ODR_100_HZ,
    .deviceMode         = Boardcore::LIS2MDL::MD_CONTINUOUS,
    .temperatureDivider = 100,
};

Boardcore::LPS22DF::Config LPS22_SENSOR_CONFIG{
    .odr = Boardcore::LPS22DF::ODR_100,
    .avg = Boardcore::LPS22DF::AVG_512,
};

Merge request reports

Loading