LCOV - code coverage report
Current view: top level - SITL - SIM_MS5611.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_MS5611_ENABLED
       4             : 
       5             : #include "SIM_MS5XXX.h"
       6             : 
       7             : #include <AP_Common/Bitmask.h>
       8             : 
       9             : namespace SITL {
      10             : 
      11             : class MS5611 : public MS5XXX
      12             : {
      13             : public:
      14             : 
      15             :     using MS5XXX::MS5XXX;
      16             : 
      17             : protected:
      18             : 
      19             :     void get_pressure_temperature_readings(float &P_Pa, float &Temp_C) override;
      20             : 
      21             :     void convert(float P_Pa, float Temp_C, uint32_t &D1, uint32_t &D2) override;
      22             :     void convert_forward(int32_t D1, int32_t D2, float &P_Pa, float &Temp_C) override;
      23             :     void check_conversion_accuracy(float P_Pa, float Temp_C, uint32_t D1, uint32_t D2) override;
      24             : 
      25           1 :     void load_prom(uint16_t *_loaded_prom, uint8_t len) const override {
      26           1 :         memcpy(_loaded_prom, prom, len);
      27           1 :     }
      28             : 
      29             : private:
      30             : 
      31             :     // this data comes from the datasheet page 7
      32             :     const uint16_t prom[8] {
      33             :         0xFFFF,  // reserved
      34             :         40127, // C1, pressure sensitivity
      35             :         36924, // C2, pressure offset
      36             :         23317, // C3, temperature coeff of press sensit
      37             :         23282, // C4, temperature cofff of press offs
      38             :         33464, // C5, ref temperature
      39             :         28312,  // C6, temperature coeff of temperature
      40             :         0x0008  // checksum
      41             :     };
      42             : 
      43             :     const uint8_t Qx_coeff[6] {
      44             :         15, 16, 8, 7, 8, 23
      45             :     };
      46             : 
      47             : };
      48             : 
      49             : } // namespace SITL
      50             : 
      51             : #endif  // AP_SIM_MS5611_ENABLED

Generated by: LCOV version 1.14