Paparazzi UAS  v5.12_stable-4-g9b43e9b
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
hott_common.c File Reference

Graupner HOTT SUMD decoder. More...

#include "subsystems/radio_control.h"
#include "subsystems/radio_control/hott_common.h"
#include <BOARD_CONFIG>
#include <string.h>
+ Include dependency graph for hott_common.c:

Go to the source code of this file.

Macros

#define HOTT_START_BYTE   0xa8
 
#define HOTT_STATUS_UNINIT   0
 
#define HOTT_STATUS_GOT_START   1
 
#define HOTT_STATUS_GOT_HEADER1   2
 
#define HOTT_STATUS_DATA   3
 
#define HOTT_CRC_POLYNOME   0x1021
 

Functions

void hott_common_init (struct SHott *hott_p, struct uart_periph *dev)
 Init function. More...
 
static uint16_t hott_CRC16 (uint16_t crc, uint8_t value)
 
static void decode_hott_buffer (const uint8_t *src, uint16_t *dst, uint8_t channels, bool *available, uint16_t *dstppm)
 Decode the raw buffer. More...
 
void hott_common_decode_event (struct SHott *hott_p, struct uart_periph *dev)
 Decoding event function. More...
 

Detailed Description

Graupner HOTT SUMD decoder.

Definition in file hott_common.c.

Macro Definition Documentation

#define HOTT_CRC_POLYNOME   0x1021

Definition at line 51 of file hott_common.c.

Referenced by hott_CRC16().

#define HOTT_START_BYTE   0xa8

Definition at line 34 of file hott_common.c.

Referenced by hott_common_decode_event().

#define HOTT_STATUS_DATA   3

Definition at line 39 of file hott_common.c.

Referenced by hott_common_decode_event().

#define HOTT_STATUS_GOT_HEADER1   2

Definition at line 38 of file hott_common.c.

Referenced by hott_common_decode_event().

#define HOTT_STATUS_GOT_START   1

Definition at line 37 of file hott_common.c.

Referenced by hott_common_decode_event().

#define HOTT_STATUS_UNINIT   0

Definition at line 36 of file hott_common.c.

Referenced by hott_common_decode_event(), and hott_common_init().

Function Documentation

static void decode_hott_buffer ( const uint8_t src,
uint16_t dst,
uint8_t  channels,
bool *  available,
uint16_t dstppm 
)
static

Decode the raw buffer.

Definition at line 71 of file hott_common.c.

References channel, hott_CRC16(), HOTT_NB_CHANNEL, and USEC_OF_RC_PPM_TICKS.

Referenced by hott_common_decode_event().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void hott_common_decode_event ( struct SHott hott_p,
struct uart_periph dev 
)

Decoding event function.

Definition at line 98 of file hott_common.c.

References SHott::buffer, decode_hott_buffer(), SHott::expected_channels, SHott::frame_available, HOTT_NB_CHANNEL, HOTT_START_BYTE, HOTT_STATUS_DATA, HOTT_STATUS_GOT_HEADER1, HOTT_STATUS_GOT_START, HOTT_STATUS_UNINIT, SHott::idx, SHott::ppm, SHott::pulses, SHott::status, uart_char_available(), and uart_getch().

Referenced by hott_decode_event().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void hott_common_init ( struct SHott hott_p,
struct uart_periph dev 
)

Init function.

Definition at line 42 of file hott_common.c.

References B115200, SHott::frame_available, HOTT_STATUS_UNINIT, SHott::status, uart_periph_set_baudrate(), uart_periph_set_bits_stop_parity(), UBITS_8, UPARITY_NO, and USTOP_1.

Referenced by radio_control_impl_init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uint16_t hott_CRC16 ( uint16_t  crc,
uint8_t  value 
)
static

Definition at line 57 of file hott_common.c.

References crc, and HOTT_CRC_POLYNOME.

Referenced by decode_hott_buffer().

+ Here is the caller graph for this function: