2013-01-03 23:58:24 -04:00
|
|
|
/// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
|
|
|
|
|
|
|
|
#ifndef __AP_BARO_PX4_H__
|
|
|
|
#define __AP_BARO_PX4_H__
|
|
|
|
|
|
|
|
#include "AP_Baro.h"
|
|
|
|
|
|
|
|
class AP_Baro_PX4 : public AP_Baro
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
bool init();
|
|
|
|
uint8_t read();
|
|
|
|
float get_pressure();
|
|
|
|
float get_temperature();
|
|
|
|
int32_t get_raw_pressure();
|
|
|
|
int32_t get_raw_temp();
|
2013-01-20 07:11:58 -04:00
|
|
|
void accumulate(void);
|
2013-01-03 23:58:24 -04:00
|
|
|
|
|
|
|
private:
|
|
|
|
float _temperature;
|
|
|
|
float _pressure;
|
2013-01-21 03:20:05 -04:00
|
|
|
static float _pressure_sum;
|
|
|
|
static float _temperature_sum;
|
|
|
|
static uint32_t _sum_count;
|
|
|
|
static volatile bool _in_accumulate;
|
|
|
|
static void _accumulate(void);
|
|
|
|
static void _baro_timer(uint32_t now);
|
|
|
|
static uint64_t _last_timestamp;
|
2013-01-04 05:11:30 -04:00
|
|
|
// baro driver handle
|
2013-01-21 03:20:05 -04:00
|
|
|
static int _baro_fd;
|
|
|
|
static uint32_t _last_timer;
|
2013-01-03 23:58:24 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __AP_BARO_PX4_H__
|