dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
PiOS TBS Crossfire receiver driver

Receives and decodes CRSF protocol receiver packets. More...

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_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_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

union crsf_combo_payload __attribute__
 
const struct pios_rcvr_driver pios_crossfire_rcvr_driver
 

Detailed Description

Receives and decodes CRSF protocol receiver packets.

Macro Definition Documentation

#define CRSF_ADDRESS_LEN   1

Definition at line 43 of file pios_crossfire.h.

#define CRSF_CRC_LEN   1

Definition at line 45 of file pios_crossfire.h.

#define CRSF_FRAME_ATTITUDE   0x1e

Definition at line 56 of file pios_crossfire.h.

#define CRSF_FRAME_BATTERY   0x08

Definition at line 54 of file pios_crossfire.h.

#define CRSF_FRAME_GPS   0x02

Definition at line 53 of file pios_crossfire.h.

#define CRSF_FRAME_RCCHANNELS   0x16

Definition at line 55 of file pios_crossfire.h.

#define CRSF_LENGTH_LEN   1

Definition at line 44 of file pios_crossfire.h.

#define CRSF_MAX_FRAMELEN   sizeof(struct crsf_frame_t)

Definition at line 123 of file pios_crossfire.h.

#define CRSF_MAX_PAYLOAD   32

Definition at line 65 of file pios_crossfire.h.

#define CRSF_MAX_PAYLOAD   32

Definition at line 65 of file pios_crossfire.h.

#define CRSF_PAYLOAD_ATTITUDE   6

Definition at line 62 of file pios_crossfire.h.

#define CRSF_PAYLOAD_BATTERY   8

Definition at line 60 of file pios_crossfire.h.

#define CRSF_PAYLOAD_GPS   15

Definition at line 59 of file pios_crossfire.h.

#define CRSF_PAYLOAD_LEN (   x)    (CRSF_TYPE_LEN+(x)+CRSF_CRC_LEN)

Definition at line 126 of file pios_crossfire.h.

#define CRSF_PAYLOAD_RCCHANNELS   22

Definition at line 61 of file pios_crossfire.h.

#define CRSF_TIMING_FRAMEDISTANCE   4000

Definition at line 69 of file pios_crossfire.h.

#define CRSF_TIMING_MAXFRAME   1000

Definition at line 68 of file pios_crossfire.h.

#define CRSF_TYPE_LEN   1

Definition at line 46 of file pios_crossfire.h.

#define PIOS_CROSSFIRE_CHANNELS   16

Definition at line 40 of file pios_crossfire.h.

Function Documentation

struct crsf_payload_gps __attribute__ ( (packed)  )

Definition at line 38 of file serial_4way.h.

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.

Parameters
[out]crsf_idCrossfire receiver device handle
[in]driverPiOS COM driver for the serial port
[in]uart_idUART port driver handle
Return values
0on success, otherwise error
int PIOS_Crossfire_InitTelemetry ( uintptr_t  crsf_id)
bool PIOS_Crossfire_IsFailsafed ( )
int PIOS_Crossfire_SendTelemetry ( uintptr_t  crsf_id,
uint8_t *  buf,
uint8_t  bytes 
)

Variable Documentation

const struct pios_rcvr_driver pios_crossfire_rcvr_driver