46 #include <px4_platform_common/px4_config.h> 47 #include <px4_platform_common/defines.h> 51 #define DSM_FRAME_SIZE 16 52 #define DSM_FRAME_CHANNELS 7 53 #define DSM_MAX_CHANNEL_COUNT 18 54 #define DSM_BUFFER_SIZE (DSM_FRAME_SIZE + DSM_FRAME_SIZE / 2) 73 uint8_t **bytes, int8_t *rssi,
unsigned max_values);
76 uint16_t *num_values,
bool *dsm_11_bit,
unsigned *frame_drops, int8_t *rssi_percent, uint16_t max_channels);
79 __EXPORT void dsm_bind(uint16_t cmd,
int pulses);
90 #define DSM2_BIND_PULSES 3 91 #define DSMX_BIND_PULSES 7 92 #define DSMX8_BIND_PULSES 9
struct dsm_decode_t dsm_decode_t
static int dsm_fd
File handle to the DSM UART.
uint8_t dsm_buf_t[DSM_FRAME_SIZE *2]
Namespace encapsulating all device framework classes, functions and data.
__EXPORT int dsm_config(int dsm_fd)
__EXPORT void dsm_deinit(void)
__EXPORT bool dsm_parse(const uint64_t now, const uint8_t *frame, const unsigned len, uint16_t *values, uint16_t *num_values, bool *dsm_11_bit, unsigned *frame_drops, int8_t *rssi_percent, uint16_t max_channels)
__EXPORT void dsm_proto_init(void)
#define DSM_FRAME_SIZE
DSM frame size in bytes.
uint8_t dsm_frame_t[DSM_BUFFER_SIZE]
DSM dsm frame receive buffer.
__EXPORT bool dsm_input(int dsm_fd, uint16_t *values, uint16_t *num_values, bool *dsm_11_bit, uint8_t *n_bytes, uint8_t **bytes, int8_t *rssi, unsigned max_values)
Called periodically to check for input data from the DSM UART.
__EXPORT int dsm_init(const char *device)
Initialize the DSM receive functionality.