SPIUARTDriver.h 516 B

12345678910111213141516171819202122232425262728
  1. #pragma once
  2. #include "AP_HAL_Linux.h"
  3. #include "UARTDriver.h"
  4. namespace Linux {
  5. class SPIUARTDriver : public UARTDriver {
  6. public:
  7. SPIUARTDriver();
  8. void begin(uint32_t b, uint16_t rxS, uint16_t txS) override;
  9. void _timer_tick(void) override;
  10. protected:
  11. int _write_fd(const uint8_t *buf, uint16_t n) override;
  12. int _read_fd(uint8_t *buf, uint16_t n) override;
  13. AP_HAL::OwnPtr<AP_HAL::SPIDevice> _dev;
  14. uint8_t *_buffer;
  15. uint32_t _last_update_timestamp;
  16. bool _external;
  17. };
  18. }