LCOV - code coverage report
Current view: top level - SITL - SIM_MS5525.h (source / functions) Hit Total Coverage
Test: lcov.info Lines: 3 3 100.0 %
Date: 2026-09-09 11:02:08 Functions: 1 1 100.0 %

          Line data    Source code
       1             : #include "SIM_config.h"
       2             : 
       3             : #if AP_SIM_MS5525_ENABLED
       4             : 
       5             : #include "SIM_MS5XXX.h"
       6             : 
       7             : #include <AP_Common/Bitmask.h>
       8             : 
       9             : namespace SITL {
      10             : 
      11             : class MS5525 : public MS5XXX
      12             : {
      13             : public:
      14             : 
      15             : protected:
      16             : 
      17             :     void get_pressure_temperature_readings(float &P_Pa, float &Temp_C) override;
      18             : 
      19             :     void convert(float P_Pa, float Temp_C, uint32_t &D1, uint32_t &D2) override;
      20             :     void convert_forward(int32_t D1, int32_t D2, float &P_Pa, float &Temp_C) override;
      21             :     void check_conversion_accuracy(float P_Pa, float Temp_C, uint32_t D1, uint32_t D2) override;
      22             : 
      23           3 :     void load_prom(uint16_t *_loaded_prom, uint8_t len) const override {
      24           3 :         memcpy(_loaded_prom, prom, len);
      25           3 :     }
      26             : 
      27             : private:
      28             : 
      29             :     // this data comes from the datasheet page 7
      30             :     const uint16_t prom[8] {
      31             :         0xFFFF,  // reserved
      32             :         36402, // C1, pressure sensitivity
      33             :         39473, // C2, pressure offset
      34             :         40393, // C3, temperature coeff of press sensit
      35             :         29523, // C4, temperature cofff of press offs
      36             :         29854, // C5, ref temperature
      37             :         21917,  // C6, temperature coeff of temperature
      38             :         0x000c  // checksum
      39             :     };
      40             : 
      41             :     // for 5525DSO-pp001DS
      42             :     const uint8_t Qx_coeff[6] {
      43             :         15, 17, 7, 5, 7, 21
      44             :     };
      45             : 
      46             : 
      47             : };
      48             : 
      49             : } // namespace SITL
      50             : 
      51             : #endif  // AP_SIM_MS5525_ENABLED

Generated by: LCOV version 1.14