RCInput_UART.h 465 B

12345678910111213141516171819202122232425262728293031
  1. #pragma once
  2. #include <AP_Common/AP_Common.h>
  3. #include "AP_HAL_Linux.h"
  4. #include "RCInput.h"
  5. #define CHANNELS 8
  6. namespace Linux {
  7. class RCInput_UART : public RCInput
  8. {
  9. public:
  10. RCInput_UART(const char *path);
  11. ~RCInput_UART();
  12. void init() override;
  13. void _timer_tick(void) override;
  14. private:
  15. int _fd;
  16. uint8_t *_pdata;
  17. ssize_t _remain;
  18. struct PACKED {
  19. uint16_t magic;
  20. uint16_t values[CHANNELS];
  21. } _data;
  22. };
  23. }