33 #ifndef RC_POLARITY_GPIO_PORT
34 #define RC_POLARITY_GPIO_PORT 0
36 #ifndef RC_POLARITY_GPIO_PIN
37 #define RC_POLARITY_GPIO_PIN 0
40 #ifndef RC2_POLARITY_GPIO_PORT
41 #define RC2_POLARITY_GPIO_PORT RC_POLARITY_GPIO_PORT
43 #ifndef RC2_POLARITY_GPIO_PIN
44 #define RC2_POLARITY_GPIO_PIN RC_POLARITY_GPIO_PIN
51 #if PERIODIC_TELEMETRY
54 static void send_sbus(
struct transport_tx *trans,
struct link_device *
dev)
57 pprz_msg_send_PPM(trans, dev, AC_ID,
69 #if PERIODIC_TELEMETRY
91 _received_frame_handler();
95 if (sbus1.frame_available) {
103 _received_frame_handler();
105 sbus1.frame_available =
false;
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
void sbus_common_decode_event(struct Sbus *sbus_p, struct uart_periph *dev)
Decoding event function.
void radio_control_impl_event(void(*_received_frame_handler)(void))
RC event function with handler callback.
Periodic telemetry system header (includes downlink utility and generated code).
uint16_t pulses[SBUS_NB_CHANNEL]
Decoded values.
void radio_control_impl_init(void)
Radio control via two SBUS receivers.
#define RC2_POLARITY_GPIO_PORT
#define RC_POLARITY_GPIO_PORT
void sbus_common_init(struct Sbus *sbus_p, struct uart_periph *dev, gpio_port_t gpio_polarity_port, uint16_t gpio_polarity_pin)
Init function.
#define DefaultPeriodic
Set default periodic telemetry.
struct RadioControl radio_control
struct Sbus sbus1 sbus2
SBUS struct.
static const struct usb_device_descriptor dev
#define RC_POLARITY_GPIO_PIN
static void send_sbus(struct transport_tx *trans, struct link_device *dev)
uint8_t time_since_last_frame
bool frame_available
A data frame is available.
static void sbus_dual_decode_event(void)
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.
#define RC2_POLARITY_GPIO_PIN