Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
#include "cc2500_compat.h"
#include "cc2500_rx.h"
#include "cc2500_settings.h"
#include "cc2500_smartport.h"
#include "modules/datalink/downlink.h"
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
Go to the source code of this file.
Data Structures | |
struct | frSkyTableInfo_s |
Macros | |
#define | FSSP_DATAID_DOWNLINK 0x5015 |
#define | FSSP_DATAID_UPLINK 0x5016 |
#define | MAX_DATAIDS 18 |
#define | ADD_SENSOR(dataId) frSkyDataIdTableInfo.table[frSkyDataIdTableInfo.index++] = dataId |
#define | ADD_ESC_SENSOR(dataId) frSkyEscDataIdTableInfo.table[frSkyEscDataIdTableInfo.index++] = dataId |
Typedefs | |
typedef struct frSkyTableInfo_s | frSkyTableInfo_t |
Functions | |
smartPortPayload_t * | smartPortDataReceive (uint16_t c, bool *clearToSend, smartPortCheckQueueEmptyFn *checkQueueEmpty, bool useChecksum) |
static void | smartPortSendPackage (uint16_t id, uint32_t val) |
static void | initSmartPortSensors (void) |
bool | initSmartPortTelemetryExternal (smartPortWriteFrameFn *smartPortWriteFrameExternal) |
void | processSmartPortTelemetry (smartPortPayload_t *payload, volatile bool *clearToSend, const timeUs_t *requestTimeout) |
Variables | |
smartPortDownlinkFn * | smartPortDownlink = NULL |
smartPortUplinkFn * | smartPortUplink = NULL |
static uint16_t | frSkyDataIdTable [MAX_DATAIDS] |
static frSkyTableInfo_t | frSkyDataIdTableInfo = { frSkyDataIdTable, 0, 0 } |
static uint8_t | telemetryState = TELEMETRY_STATE_UNINITIALIZED |
static smartPortWriteFrameFn * | smartPortWriteFrame |
struct frSkyTableInfo_s |
Definition at line 195 of file cc2500_smartport.c.
Data Fields | ||
---|---|---|
uint8_t | index | |
uint8_t | size | |
uint16_t * | table |
#define ADD_ESC_SENSOR | ( | dataId | ) | frSkyEscDataIdTableInfo.table[frSkyEscDataIdTableInfo.index++] = dataId |
Definition at line 348 of file cc2500_smartport.c.
#define ADD_SENSOR | ( | dataId | ) | frSkyDataIdTableInfo.table[frSkyDataIdTableInfo.index++] = dataId |
Definition at line 347 of file cc2500_smartport.c.
#define FSSP_DATAID_DOWNLINK 0x5015 |
Definition at line 19 of file cc2500_smartport.c.
#define FSSP_DATAID_UPLINK 0x5016 |
Definition at line 20 of file cc2500_smartport.c.
#define MAX_DATAIDS 18 |
Definition at line 181 of file cc2500_smartport.c.
typedef struct frSkyTableInfo_s frSkyTableInfo_t |
anonymous enum |
Definition at line 116 of file cc2500_smartport.c.
anonymous enum |
Enumerator | |
---|---|
TELEMETRY_STATE_UNINITIALIZED | |
TELEMETRY_STATE_INITIALIZED_SERIAL | |
TELEMETRY_STATE_INITIALIZED_EXTERNAL |
Definition at line 215 of file cc2500_smartport.c.
|
static |
Definition at line 350 of file cc2500_smartport.c.
References ADD_ESC_SENSOR, ADD_SENSOR, ESC_SENSOR_CURRENT, ESC_SENSOR_RPM, ESC_SENSOR_TEMPERATURE, ESC_SENSOR_VOLTAGE, featureIsEnabled, frSkyDataIdTableInfo, FSSP_DATAID_A4, FSSP_DATAID_ALTITUDE, FSSP_DATAID_CURRENT, FSSP_DATAID_DOWNLINK, FSSP_DATAID_FUEL, FSSP_DATAID_GPS_ALT, FSSP_DATAID_HEADING, FSSP_DATAID_HOME_DIST, FSSP_DATAID_LATLONG, FSSP_DATAID_RPM, FSSP_DATAID_SPEED, FSSP_DATAID_T1, FSSP_DATAID_T11, FSSP_DATAID_T2, FSSP_DATAID_TEMP, FSSP_DATAID_VARIO, FSSP_DATAID_VFAS, frSkyTableInfo_s::index, isAmperageConfigured, isBatteryVoltageConfigured, SENSOR_ACC_X, SENSOR_ACC_Y, SENSOR_ACC_Z, SENSOR_ALTITUDE, SENSOR_CURRENT, SENSOR_DISTANCE, SENSOR_FUEL, SENSOR_GROUND_SPEED, SENSOR_HEADING, SENSOR_LAT_LONG, SENSOR_MODE, SENSOR_TEMPERATURE, SENSOR_VARIO, SENSOR_VOLTAGE, sensors, frSkyTableInfo_s::size, and telemetryIsSensorEnabled().
Referenced by initSmartPortTelemetryExternal().
bool initSmartPortTelemetryExternal | ( | smartPortWriteFrameFn * | smartPortWriteFrameExternal | ) |
Definition at line 480 of file cc2500_smartport.c.
References initSmartPortSensors(), smartPortWriteFrame, TELEMETRY_STATE_INITIALIZED_EXTERNAL, TELEMETRY_STATE_UNINITIALIZED, and telemetryState.
Referenced by frSkyXInit().
void processSmartPortTelemetry | ( | smartPortPayload_t * | payload, |
volatile bool * | clearToSend, | ||
const timeUs_t * | requestTimeout | ||
) |
Definition at line 533 of file cc2500_smartport.c.
References ARMING_FLAG, attitude, cmpTimeUs(), currentControlRateProfile, currentPidProfile, pidGains_s::D, FD_PITCH, FD_ROLL, FD_YAW, featureIsEnabled, FLIGHT_MODE, frSkyDataIdTableInfo, FSSP_DATAID_A4, FSSP_DATAID_ALTITUDE, FSSP_DATAID_CURRENT, FSSP_DATAID_CURRENT1, FSSP_DATAID_CURRENT2, FSSP_DATAID_CURRENT3, FSSP_DATAID_CURRENT4, FSSP_DATAID_CURRENT5, FSSP_DATAID_CURRENT6, FSSP_DATAID_CURRENT7, FSSP_DATAID_CURRENT8, FSSP_DATAID_DOWNLINK, FSSP_DATAID_FUEL, FSSP_DATAID_GPS_ALT, FSSP_DATAID_HEADING, FSSP_DATAID_HOME_DIST, FSSP_DATAID_LATLONG, FSSP_DATAID_RPM, FSSP_DATAID_RPM1, FSSP_DATAID_RPM2, FSSP_DATAID_RPM3, FSSP_DATAID_RPM4, FSSP_DATAID_RPM5, FSSP_DATAID_RPM6, FSSP_DATAID_RPM7, FSSP_DATAID_RPM8, FSSP_DATAID_SPEED, FSSP_DATAID_T1, FSSP_DATAID_T11, FSSP_DATAID_T2, FSSP_DATAID_TEMP, FSSP_DATAID_TEMP1, FSSP_DATAID_TEMP2, FSSP_DATAID_TEMP3, FSSP_DATAID_TEMP4, FSSP_DATAID_TEMP5, FSSP_DATAID_TEMP6, FSSP_DATAID_TEMP7, FSSP_DATAID_TEMP8, FSSP_DATAID_UPLINK, FSSP_DATAID_VARIO, FSSP_DATAID_VFAS, FSSP_DATAID_VFAS1, FSSP_DATAID_VFAS2, FSSP_DATAID_VFAS3, FSSP_DATAID_VFAS4, FSSP_DATAID_VFAS5, FSSP_DATAID_VFAS6, FSSP_DATAID_VFAS7, FSSP_DATAID_VFAS8, getAmperage, getBatteryCellCount, getBatteryVoltage, getEstimatedAltitudeCm, getEstimatedVario, getMAhDrawn, pidGains_s::I, frSkyTableInfo_s::index, isArmingDisabled, micros, pidGains_s::P, pidProfile_s::pid, PID_PITCH, PID_ROLL, PID_YAW, controlRateConfig_t::rates, sensors, frSkyTableInfo_s::size, smartPortDownlink, smartPortSendPackage(), smartPortUplink, frSkyTableInfo_s::table, telemetryConfig(), UNUSED, smartPortPayload_s::valueId, mesonh.mesonh_atmosphere::X, mesonh.mesonh_atmosphere::Y, and mesonh.mesonh_atmosphere::Z.
Referenced by frSkyXProcessFrame().
smartPortPayload_t* smartPortDataReceive | ( | uint16_t | c, |
bool * | clearToSend, | ||
smartPortCheckQueueEmptyFn * | checkQueueEmpty, | ||
bool | useChecksum | ||
) |
Definition at line 238 of file cc2500_smartport.c.
References checksum, FSSP_DLE, FSSP_DLE_XOR, FSSP_SENSOR_ID1, FSSP_SENSOR_ID2, and FSSP_START_STOP.
Referenced by frSkyXProcessFrame().
Definition at line 337 of file cc2500_smartport.c.
References smartPortPayload_s::data, smartPortPayload_s::frameId, FSSP_DATA_FRAME, smartPortWriteFrame, val, and smartPortPayload_s::valueId.
Referenced by processSmartPortTelemetry().
|
static |
Definition at line 183 of file cc2500_smartport.c.
|
static |
Definition at line 201 of file cc2500_smartport.c.
Referenced by initSmartPortSensors(), and processSmartPortTelemetry().
smartPortDownlinkFn* smartPortDownlink = NULL |
Definition at line 22 of file cc2500_smartport.c.
Referenced by datalink_frsky_x_init(), and processSmartPortTelemetry().
smartPortUplinkFn* smartPortUplink = NULL |
Definition at line 23 of file cc2500_smartport.c.
Referenced by datalink_frsky_x_init(), and processSmartPortTelemetry().
|
static |
Definition at line 232 of file cc2500_smartport.c.
Referenced by initSmartPortTelemetryExternal(), and smartPortSendPackage().
|
static |
Definition at line 222 of file cc2500_smartport.c.
Referenced by initSmartPortTelemetryExternal().