2016-02-17 21:25:44 -04:00
|
|
|
#pragma once
|
2015-07-06 16:24:06 -03:00
|
|
|
|
|
|
|
#include "RangeFinder.h"
|
|
|
|
#include "RangeFinder_Backend.h"
|
|
|
|
|
|
|
|
|
|
|
|
#define PRU0_CTRL_BASE 0x4a322000
|
|
|
|
|
|
|
|
#define PRU0_IRAM_BASE 0x4a334000
|
|
|
|
#define PRU0_IRAM_SIZE 0x2000
|
|
|
|
|
|
|
|
#define PRU0_DRAM_BASE 0x4a300000
|
2016-01-18 15:54:43 -04:00
|
|
|
#define PRU0_DRAM_SIZE 0x2000
|
2015-07-06 16:24:06 -03:00
|
|
|
|
|
|
|
struct range {
|
|
|
|
uint32_t distance;
|
|
|
|
uint32_t status;
|
|
|
|
};
|
|
|
|
|
|
|
|
class AP_RangeFinder_BBB_PRU : public AP_RangeFinder_Backend
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
// constructor
|
2018-07-04 11:22:17 -03:00
|
|
|
AP_RangeFinder_BBB_PRU(RangeFinder::RangeFinder_State &_state, AP_RangeFinder_Params &_params);
|
2015-07-06 16:24:06 -03:00
|
|
|
|
|
|
|
// static detection function
|
2017-08-07 00:41:01 -03:00
|
|
|
static bool detect();
|
2015-07-06 16:24:06 -03:00
|
|
|
|
|
|
|
// update state
|
2018-11-07 07:01:51 -04:00
|
|
|
void update(void) override;
|
2015-07-06 16:24:06 -03:00
|
|
|
|
2017-08-08 04:32:53 -03:00
|
|
|
protected:
|
|
|
|
|
|
|
|
MAV_DISTANCE_SENSOR _get_mav_distance_sensor_type() const override {
|
|
|
|
return MAV_DISTANCE_SENSOR_ULTRASOUND;
|
|
|
|
}
|
|
|
|
|
2015-07-06 16:24:06 -03:00
|
|
|
private:
|
|
|
|
|
|
|
|
};
|