Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/master/libraries/AP_Baro/AP_Baro_BMP085.h
Views: 1798
#pragma once12#include "AP_Baro_Backend.h"34#if AP_BARO_BMP085_ENABLED56#include <AP_HAL/AP_HAL.h>7#include <AP_HAL/I2CDevice.h>8#include <AP_HAL/utility/OwnPtr.h>9#include <Filter/Filter.h>1011#ifndef HAL_BARO_BMP085_I2C_ADDR12#define HAL_BARO_BMP085_I2C_ADDR (0x77)13#endif1415class AP_Baro_BMP085 : public AP_Baro_Backend {16public:17AP_Baro_BMP085(AP_Baro &baro, AP_HAL::OwnPtr<AP_HAL::Device> dev);1819/* AP_Baro public interface: */20void update() override;2122static AP_Baro_Backend *probe(AP_Baro &baro, AP_HAL::OwnPtr<AP_HAL::Device> dev);232425private:26bool _init();2728void _cmd_read_pressure();29void _cmd_read_temp();30bool _read_pressure();31void _read_temp();32void _calculate();33bool _data_ready();3435void _timer(void);3637uint16_t _read_prom_word(uint8_t word);38bool _read_prom(uint16_t *prom);394041AP_HAL::OwnPtr<AP_HAL::Device> _dev;42AP_HAL::DigitalSource *_eoc;4344uint8_t _instance;45bool _has_sample;4647// Boards with no EOC pin: use times instead48uint32_t _last_press_read_command_time;49uint32_t _last_temp_read_command_time;5051// State machine52uint8_t _state;5354// Internal calibration registers55int16_t ac1, ac2, ac3, b1, b2, mb, mc, md;56uint16_t ac4, ac5, ac6;5758int32_t _raw_pressure;59int32_t _raw_temp;60int32_t _temp;61AverageIntegralFilter<int32_t, int32_t, 10> _pressure_filter;6263uint8_t _vers;64uint8_t _type;65};6667#endif // AP_BARO_BMP085_ENABLED686970