RCInput.h 603 B

123456789101112131415161718192021222324252627
  1. #pragma once
  2. #include <AP_HAL/AP_HAL.h>
  3. #if CONFIG_HAL_BOARD == HAL_BOARD_SITL
  4. #define SITL_RC_INPUT_CHANNELS 16
  5. #include "AP_HAL_SITL.h"
  6. class HALSITL::RCInput : public AP_HAL::RCInput {
  7. public:
  8. explicit RCInput(SITL_State *sitlState): _sitlState(sitlState) {}
  9. void init() override;
  10. bool new_input() override;
  11. uint8_t num_channels() override;
  12. uint16_t read(uint8_t ch) override;
  13. uint8_t read(uint16_t* periods, uint8_t len) override;
  14. const char *protocol() const override { return "SITL"; }
  15. private:
  16. SITL_State *_sitlState;
  17. bool using_rc_protocol;
  18. };
  19. #endif