Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
#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>
Go to the source code of this file.
Typedefs | |
typedef rx_spi_received_e | 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 handlePacketFn * | handlePacket |
static processFrameFn * | processFrame |
static setRcDataFn * | setRcData |
typedef rx_spi_received_e 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.
Definition at line 78 of file cc2500_frsky_shared.c.
rx_spi_received_e frSkySpiDataReceived | ( | uint8_t * | packet | ) |
Definition at line 327 of file cc2500_frsky_shared.c.
References CC2500_SIDLE, cc2500Strobe(), delay, getBind1(), getBind2(), handlePacket, initGetBind(), initialise(), initialiseData(), initTuneRx(), millis, protocolState, RX_SPI_RECEIVED_BIND, RX_SPI_RECEIVED_NONE, rxCc2500SpiConfig(), rxSpiCheckBindRequested(), rxSpiLedOn(), rxSpiLedToggle(), start_time, STATE_BIND, STATE_BIND_BINDING1, STATE_BIND_BINDING2, STATE_BIND_COMPLETE, STATE_BIND_TUNING, STATE_INIT, STATE_STARTING, tuneRx(), and writeEEPROM.
Referenced by rxSpiSetProtocol().
bool frSkySpiInit | ( | const rxSpiConfig_t * | rxSpiConfig, |
rxRuntimeConfig_t * | rxRuntimeConfig | ||
) |
Definition at line 433 of file cc2500_frsky_shared.c.
References cc2500SpiInit(), rxRuntimeConfig_s::channelCount, frSkyDHandlePacket(), frSkyDInit(), frSkyDSetRcData(), frSkyXHandlePacket(), frSkyXInit(), frSkyXProcessFrame(), frSkyXSetRcData(), handlePacket, millis, missingPackets, processFrame, protocolState, RC_CHANNEL_COUNT_FRSKY_D, RC_CHANNEL_COUNT_FRSKY_X, RSSI_SOURCE_NONE, RSSI_SOURCE_RX_PROTOCOL, rssiSource, RX_SPI_FRSKY_D, RX_SPI_FRSKY_X, RX_SPI_FRSKY_X_LBT, rxSpiConfig_s::rx_spi_protocol, rxRuntimeConfig, rxSpiCommonIOInit(), rxSpiConfig(), setRcData, spiProtocol, start_time, STATE_INIT, and timeoutUs.
Referenced by rxSpiSetProtocol().
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().
Definition at line 407 of file cc2500_frsky_shared.c.
References rcData, and setRcData.
Referenced by rxSpiSetProtocol().
|
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().
|
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().
|
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().
|
static |
Definition at line 84 of file cc2500_frsky_shared.c.
References calData, CC2500_02_IOCFG0, CC2500_03_FIFOTHR, CC2500_06_PKTLEN, CC2500_07_PKTCTRL1, CC2500_08_PKTCTRL0, CC2500_09_ADDR, CC2500_0A_CHANNR, CC2500_0B_FSCTRL1, CC2500_0C_FSCTRL0, CC2500_0D_FREQ2, CC2500_0E_FREQ1, CC2500_0F_FREQ0, CC2500_10_MDMCFG4, CC2500_11_MDMCFG3, CC2500_12_MDMCFG2, CC2500_13_MDMCFG1, CC2500_14_MDMCFG0, CC2500_15_DEVIATN, CC2500_17_MCSM1, CC2500_18_MCSM0, CC2500_19_FOCCFG, CC2500_1A_BSCFG, CC2500_1B_AGCCTRL2, CC2500_1C_AGCCTRL1, CC2500_1D_AGCCTRL0, CC2500_21_FREND1, CC2500_22_FREND0, CC2500_23_FSCAL3, CC2500_24_FSCAL2, CC2500_25_FSCAL1, CC2500_26_FSCAL0, CC2500_29_FSTEST, CC2500_2C_TEST2, CC2500_2D_TEST1, CC2500_2E_TEST0, CC2500_3E_PATABLE, CC2500_SCAL, CC2500_SIDLE, cc2500ReadReg(), cc2500Reset(), cc2500Strobe(), cc2500WriteReg(), delayMicroseconds, RX_SPI_FRSKY_D, RX_SPI_FRSKY_X, RX_SPI_FRSKY_X_LBT, and spiProtocol.
Referenced by frSkySpiDataReceived().
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().
|
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().
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().
|
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().
|
static |
Definition at line 73 of file cc2500_frsky_shared.c.
Referenced by getBind2(), and initGetBind().
|
static |
Definition at line 74 of file cc2500_frsky_shared.c.
Referenced by initialiseData(), initTuneRx(), and tuneRx().
|
static |
Definition at line 70 of file cc2500_frsky_shared.c.
Referenced by initGetBind(), initialise(), initTuneRx(), and nextChannel().
|
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().
|
static |
Definition at line 81 of file cc2500_frsky_shared.c.
Referenced by frSkySpiInit(), and frSkySpiProcessFrame().
|
static |
Definition at line 65 of file cc2500_frsky_shared.c.
Referenced by frSkyDHandlePacket(), frSkySpiDataReceived(), frSkySpiInit(), and frSkyXHandlePacket().
|
static |
Definition at line 82 of file cc2500_frsky_shared.c.
Referenced by frSkySpiInit(), and frSkySpiSetRcData().
|
static |
Definition at line 62 of file cc2500_frsky_shared.c.
Referenced by frSkySpiInit(), frSkyXInit(), initialise(), and nextChannel().
|
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 dshotRpmCatchErps(), frSkySpiInit(), and frSkyXHandlePacket().
|
static |
Definition at line 71 of file cc2500_frsky_shared.c.
Referenced by initTuneRx(), and tuneRx().