27 #ifndef RC_HOTT_COMMON_H
28 #define RC_HOTT_COMMON_H
35 #include "generated/airframe.h"
43 #define RC_PPM_TICKS_OF_USEC(_v) ((_v) * 8 ) // USEC IN HOTT OUT
44 #define RC_PPM_SIGNED_TICKS_OF_USEC(_v) ((_v) * 8 ) // usec -1000 + 1000 in, HOTT out
45 #define USEC_OF_RC_PPM_TICKS(_v) ((_v) / 8) // HOTT IN USEC OUT
51 #include "generated/radio.h"
60 #define HOTT_NB_CHANNEL 32
61 #define HOTT_BUF_LENGTH (HOTT_NB_CHANNEL*2+3+2) // 2 bytes per chennel 3 bytes header, 2 bytes CRC
66 #ifndef RADIO_CONTROL_NB_CHANNEL
67 #define RADIO_CONTROL_NB_CHANNEL HOTT_NB_CHANNEL
70 #if RADIO_CONTROL_NB_CHANNEL > HOTT_NB_CHANNEL
71 #error "RADIO_CONTROL_NB_CHANNEL mustn't be higher than 32."
106 #define RadioControlEvent(_received_frame_handler) radio_control_impl_event(_received_frame_handler)
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
uint16_t ppm[HOTT_NB_CHANNEL]
decoded and converted values
uint8_t buffer[HOTT_BUF_LENGTH]
input buffer
Some architecture independent helper functions for GPIOs.
bool frame_available
new frame available
#define HOTT_NB_CHANNEL
Generated code holding the description of a given transmitter.
uint8_t status
decoder state machine status
uint8_t expected_channels
expected number of channels send in header
void hott_common_init(struct SHott *hott, struct uart_periph *dev)
Init function.
uint16_t pulses[HOTT_NB_CHANNEL]
decoded values
static const struct usb_device_descriptor dev
void radio_control_impl_event(void(*_received_frame_handler)(void))
RC event function with handler callback.
struct SHott hott
HOTT struct.
void hott_common_decode_event(struct SHott *hott, struct uart_periph *dev)
Decoding event function.