2015-12-09 16:39:29 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "AP_Baro_Backend.h"
|
|
|
|
|
|
|
|
#if CONFIG_HAL_BOARD == HAL_BOARD_QURT
|
2017-12-21 13:02:20 -04:00
|
|
|
#include <AP_HAL_QURT/Semaphores.h>
|
2015-12-09 16:39:29 -04:00
|
|
|
extern "C" {
|
|
|
|
#include "bmp280_api.h"
|
|
|
|
}
|
|
|
|
|
|
|
|
class AP_Baro_QURT : public AP_Baro_Backend
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
// Constructor
|
|
|
|
AP_Baro_QURT(AP_Baro &baro);
|
|
|
|
|
|
|
|
/* AP_Baro public interface: */
|
|
|
|
void update() override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
void timer(void);
|
|
|
|
|
|
|
|
uint32_t instance;
|
|
|
|
uint32_t handle;
|
|
|
|
uint32_t last_timer_ms;
|
|
|
|
uint64_t last_counter;
|
|
|
|
|
|
|
|
uint32_t count;
|
|
|
|
float temp_sum;
|
|
|
|
float press_sum;
|
|
|
|
QURT::Semaphore lock;
|
|
|
|
};
|
|
|
|
#endif // CONFIG_HAL_BOARD
|