Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
hott_common.c File Reference

Graupner HOTT SUMD decoder. More...

#include "modules/radio_control/radio_control.h"
#include "modules/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.
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.
void hott_common_decode_event (struct SHott *hott_p, struct uart_periph *dev)
 Decoding event function.

Detailed Description

Graupner HOTT SUMD decoder.

Definition in file hott_common.c.

Macro Definition Documentation

◆ HOTT_CRC_POLYNOME

#define HOTT_CRC_POLYNOME   0x1021

Definition at line 51 of file hott_common.c.

Referenced by hott_CRC16().

◆ HOTT_START_BYTE

#define HOTT_START_BYTE   0xa8

Definition at line 34 of file hott_common.c.

Referenced by hott_common_decode_event().

◆ HOTT_STATUS_DATA

#define HOTT_STATUS_DATA   3

Definition at line 39 of file hott_common.c.

Referenced by hott_common_decode_event().

◆ HOTT_STATUS_GOT_HEADER1

#define HOTT_STATUS_GOT_HEADER1   2

Definition at line 38 of file hott_common.c.

Referenced by hott_common_decode_event().

◆ HOTT_STATUS_GOT_START

#define HOTT_STATUS_GOT_START   1

Definition at line 37 of file hott_common.c.

Referenced by hott_common_decode_event().

◆ HOTT_STATUS_UNINIT

#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

◆ decode_hott_buffer()

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 70 of file hott_common.c.

References 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:

◆ hott_common_decode_event()

void hott_common_decode_event ( struct SHott * hott_p,
struct uart_periph * dev )

Decoding event function.

Definition at line 97 of file hott_common.c.

References SHott::buffer, decode_hott_buffer(), dev, 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_event().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hott_common_init()

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, dev, 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 hott_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hott_CRC16()

uint16_t hott_CRC16 ( uint16_t crc,
uint8_t value )
static

Definition at line 56 of file hott_common.c.

References HOTT_CRC_POLYNOME.

Referenced by decode_hott_buffer().

Here is the caller graph for this function: