Path: blob/master/libraries/AP_Baro/AP_Baro_SPL06.h
9784 views
#pragma once12#include "AP_Baro_Backend.h"34#if AP_BARO_SPL06_ENABLED56#include <AP_HAL/AP_HAL.h>7#include <AP_HAL/Device.h>89#ifndef HAL_BARO_SPL06_I2C_ADDR10#define HAL_BARO_SPL06_I2C_ADDR (0x76)11#endif12#ifndef HAL_BARO_SPL06_I2C_ADDR213#define HAL_BARO_SPL06_I2C_ADDR2 (0x77)14#endif1516class AP_Baro_SPL06 : public AP_Baro_Backend17{18public:19enum class Type {20UNKNOWN,21SPL06,22SPA06,23};24AP_Baro_SPL06(AP_Baro &baro, AP_HAL::Device &dev);2526/* AP_Baro public interface: */27void update() override;2829static AP_Baro_Backend *probe(AP_Baro &baro, AP_HAL::Device &dev);3031private:3233bool _init(void);34void _timer(void);35void _update_temperature(int32_t);36void _update_pressure(int32_t);3738int32_t raw_value_scale_factor(uint8_t);3940AP_HAL::Device *_dev;4142int8_t _timer_counter;43uint8_t _instance;44float _temp_raw;45float _pressure_sum;46uint32_t _pressure_count;47float _temperature;4849// Internal calibration registers50int32_t _c00, _c10;51int16_t _c0, _c1, _c01, _c11, _c20, _c21, _c30, _c31, _c40;5253Type type;54};5556#endif // AP_BARO_SPL06_ENABLED575859