2016-02-17 21:25:44 -04:00
|
|
|
#pragma once
|
2015-07-06 16:24:06 -03:00
|
|
|
|
2019-11-10 22:47:38 -04:00
|
|
|
#include "AP_RangeFinder.h"
|
|
|
|
#include "AP_RangeFinder_Backend.h"
|
2015-07-06 16:24:06 -03:00
|
|
|
|
|
|
|
|
|
|
|
#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:
|
2021-10-28 13:21:38 -03:00
|
|
|
/*
|
|
|
|
Constructor:
|
|
|
|
The constructor also initialises the rangefinder. Note that this
|
|
|
|
constructor is not called until detect() returns true, so we
|
|
|
|
already know that we should setup the rangefinder
|
|
|
|
*/
|
|
|
|
using AP_RangeFinder_Backend::AP_RangeFinder_Backend;
|
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:
|
|
|
|
|
|
|
|
};
|