AP_RangeFinder_BBB_PRU.h 759 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #pragma once
  2. #include "RangeFinder.h"
  3. #include "RangeFinder_Backend.h"
  4. #define PRU0_CTRL_BASE 0x4a322000
  5. #define PRU0_IRAM_BASE 0x4a334000
  6. #define PRU0_IRAM_SIZE 0x2000
  7. #define PRU0_DRAM_BASE 0x4a300000
  8. #define PRU0_DRAM_SIZE 0x2000
  9. struct range {
  10. uint32_t distance;
  11. uint32_t status;
  12. };
  13. class AP_RangeFinder_BBB_PRU : public AP_RangeFinder_Backend
  14. {
  15. public:
  16. // constructor
  17. AP_RangeFinder_BBB_PRU(RangeFinder::RangeFinder_State &_state, AP_RangeFinder_Params &_params);
  18. // static detection function
  19. static bool detect();
  20. // update state
  21. void update(void) override;
  22. protected:
  23. MAV_DISTANCE_SENSOR _get_mav_distance_sensor_type() const override {
  24. return MAV_DISTANCE_SENSOR_ULTRASOUND;
  25. }
  26. private:
  27. };