Paparazzi UAS  v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
hott_common.h File Reference

Common hott structs and defines. More...

#include "std.h"
#include "mcu_periph/uart.h"
#include "mcu_periph/gpio.h"
#include "generated/airframe.h"
#include "generated/radio.h"
+ Include dependency graph for hott_common.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  SHott
 HOTT structure. More...
 

Macros

#define RC_PPM_TICKS_OF_USEC(_v)   ((_v) * 8 )
 Macro to use radio.h file. More...
 
#define RC_PPM_SIGNED_TICKS_OF_USEC(_v)   ((_v) * 8 )
 
#define USEC_OF_RC_PPM_TICKS(_v)   ((_v) / 8)
 
#define HOTT_NB_CHANNEL   32
 Generated code holding the description of a given transmitter. More...
 
#define HOTT_BUF_LENGTH   (HOTT_NB_CHANNEL*2+3+2)
 
#define RADIO_CONTROL_NB_CHANNEL   HOTT_NB_CHANNEL
 Default number of channels to actually use. More...
 
#define RadioControlEvent(_received_frame_handler)   radio_control_impl_event(_received_frame_handler)
 Event macro with handler callback. More...
 

Functions

void hott_common_init (struct SHott *hott, struct uart_periph *dev)
 Init function. More...
 
void hott_common_decode_event (struct SHott *hott, struct uart_periph *dev)
 Decoding event function. More...
 
void radio_control_impl_event (void(*_received_frame_handler)(void))
 RC event function with handler callback. More...
 

Detailed Description

Common hott structs and defines.

Definition in file hott_common.h.


Data Structure Documentation

struct SHott

HOTT structure.

Definition at line 77 of file hott_common.h.

Data Fields
uint8_t buffer[HOTT_BUF_LENGTH] input buffer
uint8_t expected_channels expected number of channels send in header
bool frame_available new frame available
uint8_t idx input index
uint16_t ppm[HOTT_NB_CHANNEL] decoded and converted values
uint16_t pulses[HOTT_NB_CHANNEL] decoded values
uint8_t status decoder state machine status

Macro Definition Documentation

#define HOTT_BUF_LENGTH   (HOTT_NB_CHANNEL*2+3+2)

Definition at line 61 of file hott_common.h.

#define HOTT_NB_CHANNEL   32

Generated code holding the description of a given transmitter.

Define number of channels.

HOTT SUMD frame has between 2 and 32 channels The radio XML file is used to assign the input values to RC channels.

Definition at line 60 of file hott_common.h.

Referenced by decode_hott_buffer(), hott_common_decode_event(), and send_hott().

#define RADIO_CONTROL_NB_CHANNEL   HOTT_NB_CHANNEL

Default number of channels to actually use.

Definition at line 67 of file hott_common.h.

#define RadioControlEvent (   _received_frame_handler)    radio_control_impl_event(_received_frame_handler)

Event macro with handler callback.

Definition at line 106 of file hott_common.h.

#define RC_PPM_SIGNED_TICKS_OF_USEC (   _v)    ((_v) * 8 )

Definition at line 44 of file hott_common.h.

#define RC_PPM_TICKS_OF_USEC (   _v)    ((_v) * 8 )

Macro to use radio.h file.

HOTT: 7040..12000..16800 PPM: 880..1500..2100

Definition at line 43 of file hott_common.h.

#define USEC_OF_RC_PPM_TICKS (   _v)    ((_v) / 8)

Definition at line 45 of file hott_common.h.

Function Documentation

void hott_common_decode_event ( struct SHott hott,
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,
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:

void radio_control_impl_event ( void(*)(void)  _received_frame_handler)

RC event function with handler callback.

Definition at line 66 of file hott.c.