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_shared.h"
#include "cc2500_frsky_x.h"
#include "cc2500_smartport.h"
#include <string.h>
Go to the source code of this file.
Data Structures | |
struct | telemetrySequenceMarkerData_s |
union | telemetrySequenceMarker_s |
struct | telemetryData_s |
struct | telemetryBuffer_s |
struct | telemetryPayload_s |
Macros | |
#define | UNUSED(x) (void)(x) |
#define | TELEMETRY_OUT_BUFFER_SIZE 64 |
#define | TELEMETRY_SEQUENCE_LENGTH 4 |
#define | A1_CONST_X 50 |
#define | SEQUENCE_MARKER_REMOTE_PART 0xf0 |
#define | TELEMETRY_DATA_SIZE 5 |
#define | TELEMETRY_FRAME_SIZE sizeof(telemetryData_t) |
Typedefs | |
typedef struct telemetrySequenceMarkerData_s | telemetrySequenceMarkerData_t |
typedef union telemetrySequenceMarker_s | telemetrySequenceMarker_t |
typedef struct telemetryData_s | telemetryData_t |
typedef struct telemetryBuffer_s | telemetryBuffer_t |
typedef struct telemetryPayload_s | telemetryPayload_t |
Functions | |
static uint16_t | calculateCrc (const uint8_t *data, uint8_t len) |
static uint8_t | appendSmartPortData (uint8_t *buf) |
static void | buildTelemetryFrame (uint8_t *packet) |
static bool | frSkyXCheckQueueEmpty (void) |
static void | frSkyXTelemetrySendByte (uint8_t c) |
static void | frSkyXTelemetryWriteFrame (const smartPortPayload_t *payload) |
void | frSkyXSetRcData (uint16_t *rcData, const uint8_t *packet) |
bool | isValidPacket (const uint8_t *packet) |
rx_spi_received_e | frSkyXHandlePacket (uint8_t *const packet, uint8_t *const protocolState) |
rx_spi_received_e | frSkyXProcessFrame (uint8_t *const packet) |
void | frSkyXInit (const rx_spi_protocol_e spiProtocol) |
Variables | |
const uint16_t | crcTable [] |
static telemetryData_t | telemetryTxBuffer [TELEMETRY_SEQUENCE_LENGTH] |
static telemetryBuffer_t | telemetryRxBuffer [TELEMETRY_SEQUENCE_LENGTH] |
static telemetrySequenceMarker_t | responseToSend |
static uint8_t | frame [20] |
static uint8_t | telemetryOutWriter |
static uint8_t | telemetryOutBuffer [TELEMETRY_OUT_BUFFER_SIZE] |
static bool | telemetryEnabled = false |
static uint8_t | remoteToProcessId = 0 |
static uint8_t | remoteToProcessIndex = 0 |
static uint8_t | packetLength |
static uint16_t | telemetryDelayUs |
struct telemetrySequenceMarkerData_s |
Definition at line 116 of file cc2500_frsky_x.c.
Data Fields | ||
---|---|---|
unsigned int | ackSequenceId: 2 | |
unsigned int | initRequest: 1 | |
unsigned int | initResponse: 1 | |
unsigned int | packetSequenceId: 2 | |
unsigned int | retransmissionRequested: 1 | |
unsigned int | unused: 1 |
union telemetrySequenceMarker_s |
Definition at line 125 of file cc2500_frsky_x.c.
Data Fields | ||
---|---|---|
telemetrySequenceMarkerData_t | data | |
uint8_t | raw |
struct telemetryData_s |
Definition at line 134 of file cc2500_frsky_x.c.
Data Fields | ||
---|---|---|
uint8_t | data[TELEMETRY_DATA_SIZE] | |
uint8_t | dataLength |
struct telemetryBuffer_s |
Definition at line 139 of file cc2500_frsky_x.c.
Data Fields | ||
---|---|---|
telemetryData_t | data | |
uint8_t | needsProcessing |
struct telemetryPayload_s |
Definition at line 146 of file cc2500_frsky_x.c.
Data Fields | ||
---|---|---|
uint8_t | crc[2] | |
telemetryData_t | data | |
uint8_t | packetConst | |
uint8_t | rssiA1 | |
telemetrySequenceMarker_t | sequence |
#define A1_CONST_X 50 |
Definition at line 114 of file cc2500_frsky_x.c.
#define SEQUENCE_MARKER_REMOTE_PART 0xf0 |
Definition at line 130 of file cc2500_frsky_x.c.
#define TELEMETRY_DATA_SIZE 5 |
Definition at line 132 of file cc2500_frsky_x.c.
#define TELEMETRY_FRAME_SIZE sizeof(telemetryData_t) |
Definition at line 144 of file cc2500_frsky_x.c.
#define TELEMETRY_OUT_BUFFER_SIZE 64 |
Definition at line 110 of file cc2500_frsky_x.c.
#define TELEMETRY_SEQUENCE_LENGTH 4 |
Definition at line 112 of file cc2500_frsky_x.c.
#define UNUSED | ( | x | ) | (void)(x) |
Definition at line 12 of file cc2500_frsky_x.c.
typedef struct telemetryBuffer_s telemetryBuffer_t |
typedef struct telemetryData_s telemetryData_t |
typedef struct telemetryPayload_s telemetryPayload_t |
typedef union telemetrySequenceMarker_s telemetrySequenceMarker_t |
typedef struct telemetrySequenceMarkerData_s telemetrySequenceMarkerData_t |
Definition at line 190 of file cc2500_frsky_x.c.
References TELEMETRY_DATA_SIZE, TELEMETRY_OUT_BUFFER_SIZE, telemetryOutBuffer, and telemetryOutWriter.
Referenced by buildTelemetryFrame().
|
static |
Definition at line 207 of file cc2500_frsky_x.c.
References A1_CONST_X, rxCc2500SpiConfig_s::a1Source, telemetrySequenceMarkerData_s::ackSequenceId, ADC_EXTERNAL1, adcGetChannel, appendSmartPortData(), rxCc2500SpiConfig_s::bindTxId, calculateCrc(), cc2500getRssiDbm(), telemetrySequenceMarker_s::data, frame, FRSKY_SPI_A1_SOURCE_CONST, FRSKY_SPI_A1_SOURCE_EXTADC, FRSKY_SPI_A1_SOURCE_VBAT, getLegacyBatteryVoltage, telemetrySequenceMarkerData_s::initRequest, telemetrySequenceMarkerData_s::initResponse, telemetrySequenceMarkerData_s::packetSequenceId, telemetrySequenceMarker_s::raw, responseToSend, telemetrySequenceMarkerData_s::retransmissionRequested, rxCc2500SpiConfig(), SEQUENCE_MARKER_REMOTE_PART, TELEMETRY_FRAME_SIZE, TELEMETRY_SEQUENCE_LENGTH, and telemetryTxBuffer.
Referenced by frSkyXHandlePacket().
Definition at line 180 of file cc2500_frsky_x.c.
References logger_uart_parse::crc, and crcTable.
Referenced by buildTelemetryFrame(), and isValidPacket().
|
static |
Definition at line 271 of file cc2500_frsky_x.c.
Referenced by frSkyXProcessFrame().
rx_spi_received_e frSkyXHandlePacket | ( | uint8_t *const | packet, |
uint8_t *const | protocolState | ||
) |
Definition at line 340 of file cc2500_frsky_x.c.
References telemetrySequenceMarkerData_s::ackSequenceId, buildTelemetryFrame(), CC2500_3B_RXBYTES, CC2500_READ_BURST, CC2500_SFRX, CC2500_SIDLE, CC2500_SRX, cc2500getGdo(), cc2500ReadFifo(), cc2500ReadReg(), cc2500SetPower(), cc2500setRssiDbm(), cc2500Strobe(), cc2500WriteFifo(), cmpTimeUs(), telemetrySequenceMarker_s::data, DEBUG_DATA_BAD_FRAME, DEBUG_DATA_MISSING_PACKETS, DEBUG_SET, delayMicroseconds, FALLTHROUGH, frame, initialiseData(), isValidPacket(), listLength, MAX_MISSING_PKT, micros, missingPackets, telemetryBuffer_s::needsProcessing, nextChannel(), packetLength, telemetrySequenceMarkerData_s::packetSequenceId, protocolState, telemetrySequenceMarker_s::raw, remoteToProcessId, remoteToProcessIndex, responseToSend, telemetrySequenceMarkerData_s::retransmissionRequested, RSSI_SOURCE_RX_PROTOCOL, RX_SPI_RECEIVED_DATA, RX_SPI_RECEIVED_NONE, RX_SPI_ROCESSING_REQUIRED, rxSpiCheckBindRequested(), rxSpiLedOn(), rxSpiLedToggle(), setRssiDirect(), STATE_DATA, STATE_INIT, STATE_RESUME, STATE_STARTING, STATE_TELEMETRY, STATE_UPDATE, SYNC_DELAY_MAX, TELEMETRY_FRAME_SIZE, TELEMETRY_SEQUENCE_LENGTH, telemetryDelayUs, telemetryEnabled, telemetryRxBuffer, and timeoutUs.
Referenced by frSkySpiInit().
void frSkyXInit | ( | const rx_spi_protocol_e | spiProtocol | ) |
Definition at line 582 of file cc2500_frsky_x.c.
References FEATURE_TELEMETRY, featureIsEnabled, frSkyXTelemetryWriteFrame(), initSmartPortTelemetryExternal(), packetLength, RX_SPI_FRSKY_X, RX_SPI_FRSKY_X_LBT, spiProtocol, telemetryDelayUs, and telemetryEnabled.
Referenced by frSkySpiInit().
rx_spi_received_e frSkyXProcessFrame | ( | uint8_t *const | packet | ) |
Definition at line 544 of file cc2500_frsky_x.c.
References telemetryBuffer_s::data, frSkyXCheckQueueEmpty(), millis, telemetryBuffer_s::needsProcessing, processSmartPortTelemetry(), remoteToProcessId, remoteToProcessIndex, RX_SPI_RECEIVED_NONE, smartPortDataReceive(), TELEMETRY_SEQUENCE_LENGTH, telemetryRxBuffer, and UNUSED.
Referenced by frSkySpiInit().
Definition at line 304 of file cc2500_frsky_x.c.
References rcData.
Referenced by frSkySpiInit().
|
static |
Definition at line 277 of file cc2500_frsky_x.c.
References FSSP_DLE, FSSP_DLE_XOR, FSSP_START_STOP, TELEMETRY_OUT_BUFFER_SIZE, telemetryOutBuffer, and telemetryOutWriter.
Referenced by frSkyXTelemetryWriteFrame().
|
static |
Definition at line 289 of file cc2500_frsky_x.c.
References frSkyXTelemetrySendByte(), FSSP_SENSOR_ID1, FSSP_START_STOP, TELEMETRY_OUT_BUFFER_SIZE, telemetryOutBuffer, and telemetryOutWriter.
Referenced by frSkyXInit().
bool isValidPacket | ( | const uint8_t * | packet | ) |
Definition at line 327 of file cc2500_frsky_x.c.
References calculateCrc(), packetLength, and rxCc2500SpiConfig().
Referenced by frSkyXHandlePacket().
const uint16_t crcTable[] |
Definition at line 75 of file cc2500_frsky_x.c.
Referenced by calculateCrc().
|
static |
Definition at line 163 of file cc2500_frsky_x.c.
Referenced by buildTelemetryFrame(), DictionaryTrainingYUV(), DistributionExtraction(), DshotErpsSetFromFrame(), eperiodDecode(), frSkyXHandlePacket(), get_object(), and texton_func().
|
static |
Definition at line 177 of file cc2500_frsky_x.c.
Referenced by frSkyXHandlePacket(), frSkyXInit(), and isValidPacket().
|
static |
Definition at line 172 of file cc2500_frsky_x.c.
Referenced by frSkyXHandlePacket(), and frSkyXProcessFrame().
|
static |
Definition at line 173 of file cc2500_frsky_x.c.
Referenced by frSkyXHandlePacket(), and frSkyXProcessFrame().
|
static |
Definition at line 160 of file cc2500_frsky_x.c.
Referenced by buildTelemetryFrame(), and frSkyXHandlePacket().
|
static |
Definition at line 178 of file cc2500_frsky_x.c.
Referenced by frSkyXHandlePacket(), and frSkyXInit().
|
static |
Definition at line 170 of file cc2500_frsky_x.c.
Referenced by frSkyXHandlePacket(), and frSkyXInit().
|
static |
Definition at line 168 of file cc2500_frsky_x.c.
Referenced by appendSmartPortData(), frSkyXTelemetrySendByte(), and frSkyXTelemetryWriteFrame().
|
static |
Definition at line 166 of file cc2500_frsky_x.c.
Referenced by appendSmartPortData(), frSkyXTelemetrySendByte(), and frSkyXTelemetryWriteFrame().
|
static |
Definition at line 158 of file cc2500_frsky_x.c.
Referenced by frSkyXHandlePacket(), and frSkyXProcessFrame().
|
static |
Definition at line 155 of file cc2500_frsky_x.c.
Referenced by buildTelemetryFrame().