Paparazzi UAS  v4.0.4_stable-3-gf39211a
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
rc_datalink.h File Reference
#include "std.h"
+ Include dependency graph for rc_datalink.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define RC_DL_NB_CHANNEL   5
 
#define RADIO_CONTROL_NB_CHANNEL   RC_DL_NB_CHANNEL
 
#define RADIO_ROLL   0
 Redefining RADIO_* Do not use with radio.h (ppm rc) More...
 
#define RADIO_PITCH   1
 
#define RADIO_YAW   2
 
#define RADIO_THROTTLE   3
 
#define RADIO_MODE   4
 
#define NormalizeRcDl(_in, _out)
 Macro that normalize rc_dl_values to radio values. More...
 
#define RadioControlEvent(_received_frame_handler)
 Event macro with handler callback. More...
 

Functions

void parse_rc_3ch_datalink (uint8_t throttle_mode, int8_t roll, int8_t pitch)
 Decode datalink message to get rc values with RC_3CH message Mode and throttle are merge in the same byte. More...
 
void parse_rc_4ch_datalink (uint8_t mode, uint8_t throttle, int8_t roll, int8_t pitch, int8_t yaw)
 Decode datalink message to get rc values with RC_4CH message. More...
 

Variables

int8_t rc_dl_values [RC_DL_NB_CHANNEL]
 
volatile bool_t rc_dl_frame_available
 

Macro Definition Documentation

#define NormalizeRcDl (   _in,
  _out 
)
Value:
{ \
_out[RADIO_ROLL] = (MAX_PPRZ/128) * _in[RADIO_ROLL]; \
Bound(_out[RADIO_ROLL], MIN_PPRZ, MAX_PPRZ); \
_out[RADIO_PITCH] = (MAX_PPRZ/128) * _in[RADIO_PITCH]; \
Bound(_out[RADIO_PITCH], MIN_PPRZ, MAX_PPRZ); \
_out[RADIO_YAW] = (MAX_PPRZ/128) * _in[RADIO_YAW]; \
Bound(_out[RADIO_YAW], MIN_PPRZ, MAX_PPRZ); \
_out[RADIO_THROTTLE] = ((MAX_PPRZ/128) * _in[RADIO_THROTTLE]); \
Bound(_out[RADIO_THROTTLE], 0, MAX_PPRZ); \
_out[RADIO_MODE] = MAX_PPRZ * (_in[RADIO_MODE] - 1); \
Bound(_out[RADIO_MODE], MIN_PPRZ, MAX_PPRZ); \
}
#define MIN_PPRZ
Definition: paparazzi.h:9
#define MAX_PPRZ
Definition: paparazzi.h:8

Macro that normalize rc_dl_values to radio values.

Definition at line 67 of file rc_datalink.h.

#define RADIO_CONTROL_NB_CHANNEL   RC_DL_NB_CHANNEL

Definition at line 30 of file rc_datalink.h.

#define RADIO_MODE   4

Definition at line 40 of file rc_datalink.h.

#define RADIO_PITCH   1

Definition at line 37 of file rc_datalink.h.

#define RADIO_ROLL   0

Redefining RADIO_* Do not use with radio.h (ppm rc)

Definition at line 36 of file rc_datalink.h.

#define RADIO_THROTTLE   3

Definition at line 39 of file rc_datalink.h.

#define RADIO_YAW   2

Definition at line 38 of file rc_datalink.h.

#define RadioControlEvent (   _received_frame_handler)
Value:
{ \
radio_control.frame_cpt++; \
radio_control.time_since_last_frame = 0; \
radio_control.radio_ok_cpt = 0; \
radio_control.status = RC_OK; \
_received_frame_handler(); \
} \
}
#define FALSE
Definition: imu_chimu.h:141
struct RadioControl radio_control
Definition: radio_control.c:27

Event macro with handler callback.

Definition at line 83 of file rc_datalink.h.

#define RC_DL_NB_CHANNEL   5

Definition at line 29 of file rc_datalink.h.

Function Documentation

void parse_rc_3ch_datalink ( uint8_t  throttle_mode,
int8_t  roll,
int8_t  pitch 
)

Decode datalink message to get rc values with RC_3CH message Mode and throttle are merge in the same byte.

Definition at line 36 of file rc_datalink.c.

References RADIO_MODE, RADIO_PITCH, RADIO_ROLL, RADIO_THROTTLE, RADIO_YAW, rc_dl_frame_available, rc_dl_values, and TRUE.

Referenced by dl_parse_msg().

+ Here is the caller graph for this function:

void parse_rc_4ch_datalink ( uint8_t  mode,
uint8_t  throttle,
int8_t  roll,
int8_t  pitch,
int8_t  yaw 
)

Decode datalink message to get rc values with RC_4CH message.

Definition at line 52 of file rc_datalink.c.

References RADIO_MODE, RADIO_PITCH, RADIO_ROLL, RADIO_THROTTLE, RADIO_YAW, rc_dl_frame_available, rc_dl_values, and TRUE.

Referenced by dl_parse_msg().

+ Here is the caller graph for this function:

Variable Documentation

volatile bool_t rc_dl_frame_available
int8_t rc_dl_values[RC_DL_NB_CHANNEL]

Definition at line 27 of file rc_datalink.c.

Referenced by parse_rc_3ch_datalink(), and parse_rc_4ch_datalink().