2017-11-22 00:11:49 -04:00
|
|
|
/*
|
|
|
|
* AP_SBusOut.h
|
|
|
|
*
|
|
|
|
* Created on: Aug 19, 2017
|
|
|
|
* Author: Mark Whitehorn
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <AP_HAL/AP_HAL.h>
|
|
|
|
#include <AP_Param/AP_Param.h>
|
|
|
|
|
|
|
|
class AP_SBusOut {
|
|
|
|
public:
|
2017-12-12 21:06:14 -04:00
|
|
|
AP_SBusOut();
|
2017-11-22 00:11:49 -04:00
|
|
|
|
|
|
|
/* Do not allow copies */
|
|
|
|
AP_SBusOut(const AP_SBusOut &other) = delete;
|
|
|
|
AP_SBusOut &operator=(const AP_SBusOut&) = delete;
|
|
|
|
|
2017-12-12 21:06:14 -04:00
|
|
|
static const struct AP_Param::GroupInfo var_info[];
|
|
|
|
|
2017-11-22 00:11:49 -04:00
|
|
|
void update();
|
|
|
|
|
2018-10-29 02:51:22 -03:00
|
|
|
// public format function for use by IOMCU
|
|
|
|
static void sbus_format_frame(uint16_t *channels, uint8_t num_channels, uint8_t buffer[25]);
|
|
|
|
|
2017-11-22 00:11:49 -04:00
|
|
|
private:
|
2018-10-29 02:51:22 -03:00
|
|
|
|
2017-11-22 00:11:49 -04:00
|
|
|
AP_HAL::UARTDriver *sbus1_uart;
|
|
|
|
|
|
|
|
void init(void);
|
|
|
|
|
|
|
|
uint16_t sbus_frame_interval; // microseconds
|
|
|
|
|
|
|
|
AP_Int16 sbus_rate;
|
|
|
|
bool initialised;
|
|
|
|
};
|