dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
pios_crossfire.h File Reference
#include "pios.h"
#include "pios_rcvr.h"

Go to the source code of this file.

Data Structures

struct  crsf_payload_gps
 
struct  crsf_payload_battery
 
struct  crsf_payload_attitude
 
union  crsf_combo_payload
 
struct  crsf_frame_t
 

Macros

#define PIOS_CROSSFIRE_CHANNELS   16
 
#define CRSF_ADDRESS_LEN   1
 
#define CRSF_LENGTH_LEN   1
 
#define CRSF_CRC_LEN   1
 
#define CRSF_TYPE_LEN   1
 
#define CRSF_MAX_PAYLOAD   32
 
#define CRSF_FRAME_GPS   0x02
 
#define CRSF_FRAME_BATTERY   0x08
 
#define CRSF_FRAME_RCCHANNELS   0x16
 
#define CRSF_FRAME_ATTITUDE   0x1e
 
#define CRSF_PAYLOAD_GPS   15
 
#define CRSF_PAYLOAD_BATTERY   8
 
#define CRSF_PAYLOAD_RCCHANNELS   22
 
#define CRSF_PAYLOAD_ATTITUDE   6
 
#define CRSF_MAX_PAYLOAD   32
 
#define CRSF_TIMING_MAXFRAME   1000
 
#define CRSF_TIMING_FRAMEDISTANCE   4000
 
#define CRSF_MAX_FRAMELEN   sizeof(struct crsf_frame_t)
 
#define CRSF_PAYLOAD_LEN(x)   (CRSF_TYPE_LEN+(x)+CRSF_CRC_LEN)
 

Functions

struct crsf_payload_gps __attribute__ ((packed))
 
int PIOS_Crossfire_Init (uintptr_t *crsf_id, const struct pios_com_driver *driver, uintptr_t uart_id)
 Initialises the TBS Crossfire Rx driver with a serial port. More...
 
int PIOS_Crossfire_InitTelemetry (uintptr_t crsf_id)
 
int PIOS_Crossfire_SendTelemetry (uintptr_t crsf_id, uint8_t *buf, uint8_t bytes)
 
bool PIOS_Crossfire_IsFailsafed ()
 

Variables

int32_t latitude
 
int32_t longitude
 
uint16_t groundspeed
 
uint16_t heading
 
uint16_t altitude
 
uint8_t num_satellites
 
uint16_t voltage
 
uint16_t current
 
uint8_t capacity [3]
 
uint8_t batt_remaining
 
int16_t pitch
 
int16_t roll
 
int16_t yaw
 
union crsf_combo_payload __attribute__
 
uint8_t dev_addr
 
uint8_t length
 
uint8_t type
 
uint8_t payload [CRSF_MAX_PAYLOAD+CRSF_CRC_LEN]
 
const struct pios_rcvr_driver pios_crossfire_rcvr_driver
 

Variable Documentation

uint16_t altitude

Definition at line 45 of file pios_crossfire.h.

uint8_t batt_remaining

Definition at line 45 of file pios_crossfire.h.

uint8_t capacity[3]

Definition at line 44 of file pios_crossfire.h.

uint16_t current

Definition at line 43 of file pios_crossfire.h.

uint8_t dev_addr

Definition at line 43 of file pios_crossfire.h.

uint16_t groundspeed

Definition at line 43 of file pios_crossfire.h.

uint16_t heading

Definition at line 44 of file pios_crossfire.h.

int32_t latitude

Definition at line 42 of file pios_crossfire.h.

uint8_t length

Definition at line 47 of file pios_crossfire.h.

int32_t longitude

Definition at line 42 of file pios_crossfire.h.

uint8_t num_satellites

Definition at line 46 of file pios_crossfire.h.

uint8_t payload[CRSF_MAX_PAYLOAD+CRSF_CRC_LEN]

Definition at line 53 of file pios_crossfire.h.

int16_t pitch

Definition at line 42 of file pios_crossfire.h.

int16_t roll

Definition at line 43 of file pios_crossfire.h.

uint8_t type

Definition at line 50 of file pios_crossfire.h.

uint16_t voltage

Definition at line 42 of file pios_crossfire.h.

int16_t yaw

Definition at line 44 of file pios_crossfire.h.