Paparazzi UAS  v5.17_devel-24-g2ae834f
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
cc2500_frsky_shared.c File Reference
#include "cc2500_compat.h"
#include "peripherals/cc2500.h"
#include "cc2500_settings.h"
#include "cc2500_rx_spi_common.h"
#include "cc2500_common.h"
#include "cc2500_frsky_common.h"
#include "cc2500_frsky_d.h"
#include "cc2500_frsky_x.h"
#include "cc2500_frsky_shared.h"
#include <stdbool.h>
+ Include dependency graph for cc2500_frsky_shared.c:

Go to the source code of this file.

Typedefs

typedef uint8_t handlePacketFn (uint8_t *const packet, uint8_t *const protocolState)
 
typedef rx_spi_received_e processFrameFn (uint8_t *const packet)
 
typedef void setRcDataFn (uint16_t *rcData, const uint8_t *payload)
 

Functions

static void initialise ()
 
void initialiseData (bool inBindState)
 
static void initTuneRx (void)
 
static bool tuneRx (uint8_t *packet)
 
static void initGetBind (void)
 
static bool getBind1 (uint8_t *packet)
 
static bool getBind2 (uint8_t *packet)
 
rx_spi_received_e frSkySpiDataReceived (uint8_t *packet)
 
rx_spi_received_e frSkySpiProcessFrame (uint8_t *packet)
 
void frSkySpiSetRcData (uint16_t *rcData, const uint8_t *payload)
 
void nextChannel (uint8_t skip)
 
bool frSkySpiInit (const rxSpiConfig_t *rxSpiConfig, rxRuntimeConfig_t *rxRuntimeConfig)
 

Variables

static rx_spi_protocol_e spiProtocol
 
static timeMs_t start_time
 
static uint8_t protocolState
 
uint32_t missingPackets
 
timeDelta_t timeoutUs
 
static uint8_t calData [255][3]
 
static timeMs_t timeTunedMs
 
uint8_t listLength
 
static uint8_t bindIdx
 
static int8_t bindOffset
 
static handlePacketFnhandlePacket
 
static processFrameFnprocessFrame
 
static setRcDataFnsetRcData
 

Typedef Documentation

typedef uint8_t handlePacketFn(uint8_t *const packet, uint8_t *const protocolState)

Definition at line 76 of file cc2500_frsky_shared.c.

typedef rx_spi_received_e processFrameFn(uint8_t *const packet)

Definition at line 77 of file cc2500_frsky_shared.c.

typedef void setRcDataFn(uint16_t *rcData, const uint8_t *payload)

Definition at line 78 of file cc2500_frsky_shared.c.

Function Documentation

rx_spi_received_e frSkySpiProcessFrame ( uint8_t packet)

Definition at line 398 of file cc2500_frsky_shared.c.

References processFrame, and RX_SPI_RECEIVED_NONE.

Referenced by rxSpiSetProtocol().

+ Here is the caller graph for this function:

void frSkySpiSetRcData ( uint16_t rcData,
const uint8_t payload 
)

Definition at line 407 of file cc2500_frsky_shared.c.

References setRcData.

Referenced by rxSpiSetProtocol().

+ Here is the caller graph for this function:

static bool getBind1 ( uint8_t packet)
static

Definition at line 245 of file cc2500_frsky_shared.c.

References rxCc2500SpiConfig_s::bindHopData, rxCc2500SpiConfig_s::bindTxId, CC2500_3B_RXBYTES, CC2500_READ_BURST, cc2500getGdo(), cc2500ReadFifo(), cc2500ReadReg(), rxCc2500SpiConfigMutable(), and rxCc2500SpiConfig_s::rxNum.

Referenced by frSkySpiDataReceived().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool getBind2 ( uint8_t packet)
static

Definition at line 276 of file cc2500_frsky_shared.c.

References rxCc2500SpiConfig_s::bindHopData, bindIdx, CC2500_3B_RXBYTES, CC2500_READ_BURST, cc2500getGdo(), cc2500ReadFifo(), cc2500ReadReg(), listLength, rxCc2500SpiConfig(), and rxCc2500SpiConfigMutable().

Referenced by frSkySpiDataReceived().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void initGetBind ( void  )
static

Definition at line 230 of file cc2500_frsky_shared.c.

References bindIdx, calData, CC2500_0A_CHANNR, CC2500_23_FSCAL3, CC2500_24_FSCAL2, CC2500_25_FSCAL1, CC2500_SFRX, CC2500_SIDLE, CC2500_SRX, cc2500Strobe(), cc2500WriteReg(), delayMicroseconds, and listLength.

Referenced by frSkySpiDataReceived().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void initialiseData ( bool  inBindState)

Definition at line 169 of file cc2500_frsky_shared.c.

References bindOffset, CC2500_03_FIFOTHR, CC2500_07_PKTCTRL1, CC2500_09_ADDR, CC2500_0C_FSCTRL0, CC2500_18_MCSM0, CC2500_19_FOCCFG, cc2500WriteReg(), delay, and rxCc2500SpiConfig().

Referenced by frSkySpiDataReceived(), and frSkyXHandlePacket().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void initTuneRx ( void  )
static

Definition at line 182 of file cc2500_frsky_shared.c.

References bindOffset, calData, CC2500_07_PKTCTRL1, CC2500_0A_CHANNR, CC2500_0C_FSCTRL0, CC2500_18_MCSM0, CC2500_19_FOCCFG, CC2500_23_FSCAL3, CC2500_24_FSCAL2, CC2500_25_FSCAL1, CC2500_SFRX, CC2500_SIDLE, CC2500_SRX, cc2500Strobe(), cc2500WriteReg(), millis, and timeTunedMs.

Referenced by frSkySpiDataReceived().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void nextChannel ( uint8_t  skip)

Definition at line 412 of file cc2500_frsky_shared.c.

References calData, CC2500_0A_CHANNR, CC2500_23_FSCAL3, CC2500_24_FSCAL2, CC2500_25_FSCAL1, CC2500_SFRX, CC2500_SIDLE, cc2500Strobe(), cc2500WriteReg(), listLength, RX_SPI_FRSKY_D, rxCc2500SpiConfig(), and spiProtocol.

Referenced by frSkyXHandlePacket().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool tuneRx ( uint8_t packet)
static

Definition at line 200 of file cc2500_frsky_shared.c.

References bindOffset, rxCc2500SpiConfig_s::bindOffset, CC2500_0C_FSCTRL0, CC2500_3B_RXBYTES, CC2500_READ_BURST, cc2500getGdo(), cc2500ReadFifo(), cc2500ReadReg(), cc2500WriteReg(), millis, rxCc2500SpiConfigMutable(), and timeTunedMs.

Referenced by frSkySpiDataReceived().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

uint8_t bindIdx
static

Definition at line 73 of file cc2500_frsky_shared.c.

Referenced by getBind2(), and initGetBind().

int8_t bindOffset
static

Definition at line 74 of file cc2500_frsky_shared.c.

Referenced by initialiseData(), initTuneRx(), and tuneRx().

uint8_t calData[255][3]
static

Definition at line 70 of file cc2500_frsky_shared.c.

Referenced by initGetBind(), initialise(), initTuneRx(), and nextChannel().

handlePacketFn* handlePacket
static

Definition at line 80 of file cc2500_frsky_shared.c.

Referenced by frSkySpiDataReceived(), and frSkySpiInit().

uint8_t listLength

Definition at line 72 of file cc2500_frsky_shared.c.

Referenced by frSkyXHandlePacket(), getBind2(), initGetBind(), and nextChannel().

uint32_t missingPackets

Definition at line 67 of file cc2500_frsky_shared.c.

Referenced by frSkySpiInit(), and frSkyXHandlePacket().

processFrameFn* processFrame
static

Definition at line 81 of file cc2500_frsky_shared.c.

Referenced by frSkySpiInit(), and frSkySpiProcessFrame().

uint8_t protocolState
static

Definition at line 65 of file cc2500_frsky_shared.c.

Referenced by frSkySpiDataReceived(), and frSkySpiInit().

setRcDataFn* setRcData
static

Definition at line 82 of file cc2500_frsky_shared.c.

Referenced by frSkySpiInit(), and frSkySpiSetRcData().

rx_spi_protocol_e spiProtocol
static

Definition at line 62 of file cc2500_frsky_shared.c.

Referenced by frSkySpiInit(), initialise(), and nextChannel().

timeMs_t start_time
static

Definition at line 64 of file cc2500_frsky_shared.c.

Referenced by frSkySpiDataReceived(), and frSkySpiInit().

timeDelta_t timeoutUs

Definition at line 68 of file cc2500_frsky_shared.c.

Referenced by frSkySpiInit(), and frSkyXHandlePacket().

timeMs_t timeTunedMs
static

Definition at line 71 of file cc2500_frsky_shared.c.

Referenced by initTuneRx(), and tuneRx().