AP_SBusOut.h 735 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * AP_SBusOut.h
  3. *
  4. * Created on: Aug 19, 2017
  5. * Author: Mark Whitehorn
  6. */
  7. #pragma once
  8. #include <AP_HAL/AP_HAL.h>
  9. #include <AP_Param/AP_Param.h>
  10. class AP_SBusOut {
  11. public:
  12. AP_SBusOut();
  13. /* Do not allow copies */
  14. AP_SBusOut(const AP_SBusOut &other) = delete;
  15. AP_SBusOut &operator=(const AP_SBusOut&) = delete;
  16. static const struct AP_Param::GroupInfo var_info[];
  17. void update();
  18. // public format function for use by IOMCU
  19. static void sbus_format_frame(uint16_t *channels, uint8_t num_channels, uint8_t buffer[25]);
  20. private:
  21. AP_HAL::UARTDriver *sbus1_uart;
  22. void init(void);
  23. uint16_t sbus_frame_interval; // microseconds
  24. AP_Int16 sbus_rate;
  25. bool initialised;
  26. };