Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
cc2500_smartport.c
Go to the documentation of this file.
1 #include "cc2500_compat.h"
2 
3 #include "cc2500_rx.h"
4 #include "cc2500_settings.h"
5 #include "cc2500_smartport.h"
6 
8 
9 #ifdef UNUSED
10 #undef UNUSED
11 #define UNUSED(x) (void)(x)
12 #endif
13 
14 #ifdef USE_GPS
15 #undef USE_GPS
16 #endif
17 
18 //#define FSSP_DATAID_DOWNLINK 0x0B71 // DEBUG
19 #define FSSP_DATAID_DOWNLINK 0x5015
20 #define FSSP_DATAID_UPLINK 0x5016
21 
24 
25 // CAUTION: added DOWNLINK sensor to code below!
26 // CAUTION: added payload handling to processSmartPortTelemetry
27 // CAUTION: LARGE PARTS OF THIS FILE ARE COMMENTED OUT!
28 // betaflight/src/main/telemetry/smartport.c @ 443869e
29 /*
30  * This file is part of Cleanflight and Betaflight.
31  *
32  * Cleanflight and Betaflight are free software. You can redistribute
33  * this software and/or modify this software under the terms of the
34  * GNU General Public License as published by the Free Software
35  * Foundation, either version 3 of the License, or (at your option)
36  * any later version.
37  *
38  * Cleanflight and Betaflight are distributed in the hope that they
39  * will be useful, but WITHOUT ANY WARRANTY; without even the implied
40  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
41  * See the GNU General Public License for more details.
42  *
43  * You should have received a copy of the GNU General Public License
44  * along with this software.
45  *
46  * If not, see <http://www.gnu.org/licenses/>.
47  */
48 
49 /*
50  * SmartPort Telemetry implementation by frank26080115
51  * see https://github.com/frank26080115/cleanflight/wiki/Using-Smart-Port
52  */
53 #include <stdbool.h>
54 #include <stdint.h>
55 #include <stdlib.h>
56 #include <string.h>
57 #include <math.h>
58 
59 //#include "platform.h"
60 //
61 //#if defined(USE_TELEMETRY_SMARTPORT)
62 //
63 //#include "common/axis.h"
64 //#include "common/color.h"
65 //#include "common/maths.h"
66 //#include "common/utils.h"
67 //
68 //#include "config/feature.h"
69 //
70 //#include "drivers/accgyro/accgyro.h"
71 //#include "drivers/compass/compass.h"
72 //#include "drivers/sensor.h"
73 //#include "drivers/time.h"
74 //
75 //#include "fc/config.h"
76 //#include "fc/controlrate_profile.h"
77 //#include "fc/rc_controls.h"
78 //#include "fc/runtime_config.h"
79 //
80 //#include "flight/failsafe.h"
81 //#include "flight/imu.h"
82 //#include "flight/mixer.h"
83 //#include "flight/pid.h"
84 //#include "flight/position.h"
85 //
86 //#include "io/beeper.h"
87 //#include "io/gps.h"
88 //#include "io/motors.h"
89 //#include "io/serial.h"
90 //
91 //#include "msp/msp.h"
92 //
93 //#include "rx/rx.h"
94 //
95 //#include "pg/pg.h"
96 //#include "pg/pg_ids.h"
97 //#include "pg/rx.h"
98 //
99 //#include "sensors/acceleration.h"
100 //#include "sensors/adcinternal.h"
101 //#include "sensors/barometer.h"
102 //#include "sensors/battery.h"
103 //#include "sensors/boardalignment.h"
104 //#include "sensors/compass.h"
105 //#include "sensors/esc_sensor.h"
106 //#include "sensors/gyro.h"
107 //#include "sensors/sensors.h"
108 //
109 //#include "telemetry/msp_shared.h"
110 //#include "telemetry/smartport.h"
111 //#include "telemetry/telemetry.h"
112 //
113 //#define SMARTPORT_MIN_TELEMETRY_RESPONSE_DELAY_US 500
114 
115 // these data identifiers are obtained from https://github.com/opentx/opentx/blob/master/radio/src/telemetry/frsky_hub.h
116 enum
117 {
118  FSSP_DATAID_SPEED = 0x0830 ,
119  FSSP_DATAID_VFAS = 0x0210 ,
120  FSSP_DATAID_VFAS1 = 0x0211 ,
121  FSSP_DATAID_VFAS2 = 0x0212 ,
122  FSSP_DATAID_VFAS3 = 0x0213 ,
123  FSSP_DATAID_VFAS4 = 0x0214 ,
124  FSSP_DATAID_VFAS5 = 0x0215 ,
125  FSSP_DATAID_VFAS6 = 0x0216 ,
126  FSSP_DATAID_VFAS7 = 0x0217 ,
127  FSSP_DATAID_VFAS8 = 0x0218 ,
137  FSSP_DATAID_RPM = 0x0500 ,
138  FSSP_DATAID_RPM1 = 0x0501 ,
139  FSSP_DATAID_RPM2 = 0x0502 ,
140  FSSP_DATAID_RPM3 = 0x0503 ,
141  FSSP_DATAID_RPM4 = 0x0504 ,
142  FSSP_DATAID_RPM5 = 0x0505 ,
143  FSSP_DATAID_RPM6 = 0x0506 ,
144  FSSP_DATAID_RPM7 = 0x0507 ,
145  FSSP_DATAID_RPM8 = 0x0508 ,
147  FSSP_DATAID_FUEL = 0x0600 ,
148  FSSP_DATAID_ADC1 = 0xF102 ,
149  FSSP_DATAID_ADC2 = 0xF103 ,
152  FSSP_DATAID_VARIO = 0x0110 ,
153  FSSP_DATAID_CELLS = 0x0300 ,
156 #if defined(USE_ACC)
157  FSSP_DATAID_ACCX = 0x0700 ,
158  FSSP_DATAID_ACCY = 0x0710 ,
159  FSSP_DATAID_ACCZ = 0x0720 ,
160 #endif
161  FSSP_DATAID_T1 = 0x0400 ,
162  FSSP_DATAID_T11 = 0x0401 ,
163  FSSP_DATAID_T2 = 0x0410 ,
166  FSSP_DATAID_ASPD = 0x0A00 ,
167  FSSP_DATAID_TEMP = 0x0B70 ,
168  FSSP_DATAID_TEMP1 = 0x0B71 ,
169  FSSP_DATAID_TEMP2 = 0x0B72 ,
170  FSSP_DATAID_TEMP3 = 0x0B73 ,
171  FSSP_DATAID_TEMP4 = 0x0B74 ,
172  FSSP_DATAID_TEMP5 = 0x0B75 ,
173  FSSP_DATAID_TEMP6 = 0x0B76 ,
174  FSSP_DATAID_TEMP7 = 0x0B77 ,
175  FSSP_DATAID_TEMP8 = 0x0B78 ,
176  FSSP_DATAID_A3 = 0x0900 ,
177  FSSP_DATAID_A4 = 0x0910
178 };
179 
180 // if adding more sensors then increase this value
181 #define MAX_DATAIDS 18
182 
184 
185 //#ifdef USE_ESC_SENSOR_TELEMETRY
187 //#define ESC_SENSOR_PERIOD 7
188 //
190 //#define MAX_ESC_DATAIDS 4
191 //
192 //static uint16_t frSkyEscDataIdTable[MAX_ESC_DATAIDS];
193 //#endif
194 
195 typedef struct frSkyTableInfo_s {
200 
202 //#ifdef USE_ESC_SENSOR_TELEMETRY
203 //static frSkyTableInfo_t frSkyEscDataIdTableInfo = {frSkyEscDataIdTable, 0, 0};
204 //#endif
205 //
206 //#define SMARTPORT_BAUD 57600
207 //#define SMARTPORT_UART_MODE MODE_RXTX
208 //#define SMARTPORT_SERVICE_TIMEOUT_US 1000 // max allowed time to find a value to send
209 //
210 //static serialPort_t *smartPortSerialPort = NULL; // The 'SmartPort'(tm) Port.
211 //static serialPortConfig_t *portConfig;
212 //
213 //static portSharing_e smartPortPortSharing;
214 
215 enum
216 {
220 };
221 
223 
224 //typedef struct smartPortFrame_s {
225 // uint8_t sensorId;
226 // smartPortPayload_t payload;
227 // uint8_t crc;
228 //} __attribute__((packed)) smartPortFrame_t;
229 //
230 //#define SMARTPORT_MSP_PAYLOAD_SIZE (sizeof(smartPortPayload_t) - sizeof(uint8_t))
231 
233 
234 //#if defined(USE_MSP_OVER_TELEMETRY)
235 //static bool smartPortMspReplyPending = false;
236 //#endif
237 
238 smartPortPayload_t *smartPortDataReceive(uint16_t c, bool *clearToSend, smartPortCheckQueueEmptyFn *checkQueueEmpty, bool useChecksum)
239 {
240  static uint8_t rxBuffer[sizeof(smartPortPayload_t)];
241  static uint8_t smartPortRxBytes = 0;
242  static bool skipUntilStart = true;
243  static bool awaitingSensorId = false;
244  static bool byteStuffing = false;
245  static uint16_t checksum = 0;
246 
247  if (c == FSSP_START_STOP) {
248  *clearToSend = false;
249  smartPortRxBytes = 0;
250  awaitingSensorId = true;
251  skipUntilStart = false;
252 
253  return NULL;
254  } else if (skipUntilStart) {
255  return NULL;
256  }
257 
258  if (awaitingSensorId) {
259  awaitingSensorId = false;
260  if ((c == FSSP_SENSOR_ID1) && checkQueueEmpty()) {
261  // our slot is starting, no need to decode more
262  *clearToSend = true;
263  skipUntilStart = true;
264  } else if (c == FSSP_SENSOR_ID2) {
265  checksum = 0;
266  } else {
267  skipUntilStart = true;
268  }
269  } else {
270  if (c == FSSP_DLE) {
271  byteStuffing = true;
272 
273  return NULL;
274  } else if (byteStuffing) {
275  c ^= FSSP_DLE_XOR;
276  byteStuffing = false;
277  }
278 
279  if (smartPortRxBytes < sizeof(smartPortPayload_t)) {
280  rxBuffer[smartPortRxBytes++] = (uint8_t)c;
281  checksum += c;
282 
283  if (!useChecksum && (smartPortRxBytes == sizeof(smartPortPayload_t))) {
284  skipUntilStart = true;
285 
286  return (smartPortPayload_t *)&rxBuffer;
287  }
288  } else {
289  skipUntilStart = true;
290 
291  checksum += c;
292  checksum = (checksum & 0xFF) + (checksum >> 8);
293  if (checksum == 0xFF) {
294  return (smartPortPayload_t *)&rxBuffer;
295  }
296  }
297  }
298 
299  return NULL;
300 }
301 
302 //void smartPortSendByte(uint8_t c, uint16_t *checksum, serialPort_t *port)
303 //{
304 // // smart port escape sequence
305 // if (c == FSSP_DLE || c == FSSP_START_STOP) {
306 // serialWrite(port, FSSP_DLE);
307 // serialWrite(port, c ^ FSSP_DLE_XOR);
308 // } else {
309 // serialWrite(port, c);
310 // }
311 //
312 // if (checksum != NULL) {
313 // *checksum += c;
314 // }
315 //}
316 //
317 //bool smartPortPayloadContainsMSP(const smartPortPayload_t *payload)
318 //{
319 // return payload->frameId == FSSP_MSPC_FRAME_SMARTPORT || payload->frameId == FSSP_MSPC_FRAME_FPORT;
320 //}
321 //
322 //void smartPortWriteFrameSerial(const smartPortPayload_t *payload, serialPort_t *port, uint16_t checksum)
323 //{
324 // uint8_t *data = (uint8_t *)payload;
325 // for (unsigned i = 0; i < sizeof(smartPortPayload_t); i++) {
326 // smartPortSendByte(*data++, &checksum, port);
327 // }
328 // checksum = 0xff - ((checksum & 0xff) + (checksum >> 8));
329 // smartPortSendByte((uint8_t)checksum, NULL, port);
330 //}
331 //
332 //static void smartPortWriteFrameInternal(const smartPortPayload_t *payload)
333 //{
334 // smartPortWriteFrameSerial(payload, smartPortSerialPort, 0);
335 //}
336 
338 {
339  smartPortPayload_t payload;
340  payload.frameId = FSSP_DATA_FRAME;
341  payload.valueId = id;
342  payload.data = val;
343 
344  smartPortWriteFrame(&payload);
345 }
346 
347 #define ADD_SENSOR(dataId) frSkyDataIdTableInfo.table[frSkyDataIdTableInfo.index++] = dataId
348 #define ADD_ESC_SENSOR(dataId) frSkyEscDataIdTableInfo.table[frSkyEscDataIdTableInfo.index++] = dataId
349 
350 static void initSmartPortSensors(void)
351 {
353 
357  }
358 
359 #if defined(USE_ADC_INTERNAL)
362  }
363 #endif
364 
366 #ifdef USE_ESC_SENSOR_TELEMETRY
368 #endif
369  {
371  }
372 
374  }
375 
377 #ifdef USE_ESC_SENSOR_TELEMETRY
379 #endif
380  {
382  }
383 
386  }
387  }
388 
391  }
392 
393 #if defined(USE_ACC)
394  if (sensors(SENSOR_ACC)) {
396  ADD_SENSOR(FSSP_DATAID_ACCX);
397  }
399  ADD_SENSOR(FSSP_DATAID_ACCY);
400  }
402  ADD_SENSOR(FSSP_DATAID_ACCZ);
403  }
404  }
405 #endif
406 
407  if (sensors(SENSOR_BARO)) {
410  }
413  }
414  }
415 
416 #ifdef USE_GPS
417  if (featureIsEnabled(FEATURE_GPS)) {
420  }
423  ADD_SENSOR(FSSP_DATAID_LATLONG); // twice (one for lat, one for long)
424  }
427  }
430  }
431  }
432 #endif
433 
435 
438 
439 #ifdef USE_ESC_SENSOR_TELEMETRY
440  frSkyEscDataIdTableInfo.index = 0;
441 
444  }
447  }
450  }
453  }
454 
455  frSkyEscDataIdTableInfo.size = frSkyEscDataIdTableInfo.index;
456  frSkyEscDataIdTableInfo.index = 0;
457 #endif
458 }
459 
460 //bool initSmartPortTelemetry(void)
461 //{
462 // if (telemetryState == TELEMETRY_STATE_UNINITIALIZED) {
463 // portConfig = findSerialPortConfig(FUNCTION_TELEMETRY_SMARTPORT);
464 // if (portConfig) {
465 // smartPortPortSharing = determinePortSharing(portConfig, FUNCTION_TELEMETRY_SMARTPORT);
466 //
467 // smartPortWriteFrame = smartPortWriteFrameInternal;
468 //
469 // initSmartPortSensors();
470 //
471 // telemetryState = TELEMETRY_STATE_INITIALIZED_SERIAL;
472 // }
473 //
474 // return true;
475 // }
476 //
477 // return false;
478 //}
479 
480 bool initSmartPortTelemetryExternal(smartPortWriteFrameFn *smartPortWriteFrameExternal)
481 {
483  smartPortWriteFrame = smartPortWriteFrameExternal;
484 
486 
488 
489  return true;
490  }
491 
492  return false;
493 }
494 
495 //static void freeSmartPortTelemetryPort(void)
496 //{
497 // closeSerialPort(smartPortSerialPort);
498 // smartPortSerialPort = NULL;
499 //}
500 //
501 //static void configureSmartPortTelemetryPort(void)
502 //{
503 // if (portConfig) {
504 // portOptions_e portOptions = (telemetryConfig()->halfDuplex ? SERIAL_BIDIR : SERIAL_UNIDIR) | (telemetryConfig()->telemetry_inverted ? SERIAL_NOT_INVERTED : SERIAL_INVERTED);
505 //
506 // smartPortSerialPort = openSerialPort(portConfig->identifier, FUNCTION_TELEMETRY_SMARTPORT, NULL, NULL, SMARTPORT_BAUD, SMARTPORT_UART_MODE, portOptions);
507 // }
508 //}
509 //
510 //void checkSmartPortTelemetryState(void)
511 //{
512 // if (telemetryState == TELEMETRY_STATE_INITIALIZED_SERIAL) {
513 // bool enableSerialTelemetry = telemetryDetermineEnabledState(smartPortPortSharing);
514 //
515 // if (enableSerialTelemetry && !smartPortSerialPort) {
516 // configureSmartPortTelemetryPort();
517 // } else if (!enableSerialTelemetry && smartPortSerialPort) {
518 // freeSmartPortTelemetryPort();
519 // }
520 // }
521 //}
522 //
523 //#if defined(USE_MSP_OVER_TELEMETRY)
524 //static void smartPortSendMspResponse(uint8_t *data) {
525 // smartPortPayload_t payload;
526 // payload.frameId = FSSP_MSPS_FRAME;
527 // memcpy(&payload.valueId, data, SMARTPORT_MSP_PAYLOAD_SIZE);
528 //
529 // smartPortWriteFrame(&payload);
530 //}
531 //#endif
532 
533 void processSmartPortTelemetry(smartPortPayload_t *payload, volatile bool *clearToSend, const timeUs_t *requestTimeout)
534 {
535  static uint8_t smartPortIdCycleCnt = 0;
536  static uint8_t t1Cnt = 0;
537  static uint8_t t2Cnt = 0;
538  static uint8_t skipRequests = 0;
539 #ifdef USE_ESC_SENSOR_TELEMETRY
540  static uint8_t smartPortIdOffset = 0;
541 #endif
542 
543 #if defined(USE_MSP_OVER_TELEMETRY)
544  if (skipRequests) {
545  skipRequests--;
546  } else if (payload && smartPortPayloadContainsMSP(payload)) {
547  // Do not check the physical ID here again
548  // unless we start receiving other sensors' packets
549  // Pass only the payload: skip frameId
550  uint8_t *frameStart = (uint8_t *)&payload->valueId;
551  smartPortMspReplyPending = handleMspFrame(frameStart, SMARTPORT_MSP_PAYLOAD_SIZE, &skipRequests);
552 
553  // Don't send MSP response after write to eeprom
554  // CPU just got out of suspended state after writeEEPROM()
555  // We don't know if the receiver is listening again
556  // Skip a few telemetry requests before sending response
557  if (skipRequests) {
558  *clearToSend = false;
559  }
560  }
561 #else
562  UNUSED(payload);
563 #endif
564 
565  if (smartPortUplink && payload && payload->valueId == FSSP_DATAID_UPLINK) {
566  smartPortUplink(payload);
567  }
568 
569  bool doRun = true;
570  while (doRun && *clearToSend && !skipRequests) {
571  // Ensure we won't get stuck in the loop if there happens to be nothing available to send in a timely manner - dump the slot if we loop in there for too long.
572  if (requestTimeout) {
573  if (cmpTimeUs(micros(), *requestTimeout) >= 0) {
574  *clearToSend = false;
575 
576  return;
577  }
578  } else {
579  doRun = false;
580  }
581 
582 #if defined(USE_MSP_OVER_TELEMETRY)
583  if (smartPortMspReplyPending) {
584  smartPortMspReplyPending = sendMspReply(SMARTPORT_MSP_PAYLOAD_SIZE, &smartPortSendMspResponse);
585  *clearToSend = false;
586 
587  return;
588  }
589 #endif
590 
591  // we can send back any data we want, our tables keep track of the order and frequency of each data type we send
592  frSkyTableInfo_t * tableInfo = &frSkyDataIdTableInfo;
593 
594 #ifdef USE_ESC_SENSOR_TELEMETRY
595  if (smartPortIdCycleCnt >= ESC_SENSOR_PERIOD) {
596  // send ESC sensors
597  tableInfo = &frSkyEscDataIdTableInfo;
598  if (tableInfo->index == tableInfo->size) { // end of ESC table, return to other sensors
599  tableInfo->index = 0;
600  smartPortIdCycleCnt = 0;
601  smartPortIdOffset++;
602  if (smartPortIdOffset == getMotorCount() + 1) { // each motor and ESC_SENSOR_COMBINED
603  smartPortIdOffset = 0;
604  }
605  }
606  }
607  if (smartPortIdCycleCnt < ESC_SENSOR_PERIOD) {
608  // send other sensors
609  tableInfo = &frSkyDataIdTableInfo;
610 #endif
611  if (tableInfo->index == tableInfo->size) { // end of table reached, loop back
612  tableInfo->index = 0;
613  }
614 #ifdef USE_ESC_SENSOR_TELEMETRY
615  }
616 #endif
617  uint16_t id = tableInfo->table[tableInfo->index];
618 #ifdef USE_ESC_SENSOR_TELEMETRY
619  if (smartPortIdCycleCnt >= ESC_SENSOR_PERIOD) {
620  id += smartPortIdOffset;
621  }
622 #endif
623  smartPortIdCycleCnt++;
624  tableInfo->index++;
625 
626  int32_t tmpi;
627  uint32_t tmp2 = 0;
628  uint16_t vfasVoltage;
629  uint8_t cellCount;
630 
631 #ifdef USE_ESC_SENSOR_TELEMETRY
632  escSensorData_t *escData;
633 #endif
634 
635  switch (id) {
636  case FSSP_DATAID_VFAS :
637  vfasVoltage = getBatteryVoltage();
638  if (telemetryConfig()->report_cell_voltage) {
639  cellCount = getBatteryCellCount();
640  vfasVoltage = cellCount ? getBatteryVoltage() / cellCount : 0;
641  }
642  smartPortSendPackage(id, vfasVoltage); // given in 0.01V, convert to volts
643  *clearToSend = false;
644  break;
645 #ifdef USE_ESC_SENSOR_TELEMETRY
646  case FSSP_DATAID_VFAS1 :
647  case FSSP_DATAID_VFAS2 :
648  case FSSP_DATAID_VFAS3 :
649  case FSSP_DATAID_VFAS4 :
650  case FSSP_DATAID_VFAS5 :
651  case FSSP_DATAID_VFAS6 :
652  case FSSP_DATAID_VFAS7 :
653  case FSSP_DATAID_VFAS8 :
654  escData = getEscSensorData(id - FSSP_DATAID_VFAS1);
655  if (escData != NULL) {
656  smartPortSendPackage(id, escData->voltage);
657  *clearToSend = false;
658  }
659  break;
660 #endif
661  case FSSP_DATAID_CURRENT :
662  smartPortSendPackage(id, getAmperage() / 10); // given in 10mA steps, unknown requested unit
663  *clearToSend = false;
664  break;
665 #ifdef USE_ESC_SENSOR_TELEMETRY
666  case FSSP_DATAID_CURRENT1 :
667  case FSSP_DATAID_CURRENT2 :
668  case FSSP_DATAID_CURRENT3 :
669  case FSSP_DATAID_CURRENT4 :
670  case FSSP_DATAID_CURRENT5 :
671  case FSSP_DATAID_CURRENT6 :
672  case FSSP_DATAID_CURRENT7 :
673  case FSSP_DATAID_CURRENT8 :
674  escData = getEscSensorData(id - FSSP_DATAID_CURRENT1);
675  if (escData != NULL) {
676  smartPortSendPackage(id, escData->current);
677  *clearToSend = false;
678  }
679  break;
680  case FSSP_DATAID_RPM :
681  escData = getEscSensorData(ESC_SENSOR_COMBINED);
682  if (escData != NULL) {
683  smartPortSendPackage(id, calcEscRpm(escData->rpm));
684  *clearToSend = false;
685  }
686  break;
687  case FSSP_DATAID_RPM1 :
688  case FSSP_DATAID_RPM2 :
689  case FSSP_DATAID_RPM3 :
690  case FSSP_DATAID_RPM4 :
691  case FSSP_DATAID_RPM5 :
692  case FSSP_DATAID_RPM6 :
693  case FSSP_DATAID_RPM7 :
694  case FSSP_DATAID_RPM8 :
695  escData = getEscSensorData(id - FSSP_DATAID_RPM1);
696  if (escData != NULL) {
697  smartPortSendPackage(id, calcEscRpm(escData->rpm));
698  *clearToSend = false;
699  }
700  break;
701  case FSSP_DATAID_TEMP :
702  escData = getEscSensorData(ESC_SENSOR_COMBINED);
703  if (escData != NULL) {
704  smartPortSendPackage(id, escData->temperature);
705  *clearToSend = false;
706  }
707  break;
708  case FSSP_DATAID_TEMP1 :
709  case FSSP_DATAID_TEMP2 :
710  case FSSP_DATAID_TEMP3 :
711  case FSSP_DATAID_TEMP4 :
712  case FSSP_DATAID_TEMP5 :
713  case FSSP_DATAID_TEMP6 :
714  case FSSP_DATAID_TEMP7 :
715  case FSSP_DATAID_TEMP8 :
716  escData = getEscSensorData(id - FSSP_DATAID_TEMP1);
717  if (escData != NULL) {
718  smartPortSendPackage(id, escData->temperature);
719  *clearToSend = false;
720  }
721  break;
722 #endif
723  case FSSP_DATAID_ALTITUDE :
724  smartPortSendPackage(id, getEstimatedAltitudeCm()); // unknown given unit, requested 100 = 1 meter
725  *clearToSend = false;
726  break;
727  case FSSP_DATAID_FUEL :
728  smartPortSendPackage(id, getMAhDrawn()); // given in mAh, unknown requested unit
729  *clearToSend = false;
730  break;
731  case FSSP_DATAID_VARIO :
732  smartPortSendPackage(id, getEstimatedVario()); // unknown given unit but requested in 100 = 1m/s
733  *clearToSend = false;
734  break;
735  case FSSP_DATAID_HEADING :
736  smartPortSendPackage(id, attitude.values.yaw * 10); // given in 10*deg, requested in 10000 = 100 deg
737  *clearToSend = false;
738  break;
739 #if defined(USE_ACC)
740  case FSSP_DATAID_ACCX :
741  smartPortSendPackage(id, lrintf(100 * acc.accADC[X] * acc.dev.acc_1G_rec)); // Multiply by 100 to show as x.xx g on Taranis
742  *clearToSend = false;
743  break;
744  case FSSP_DATAID_ACCY :
745  smartPortSendPackage(id, lrintf(100 * acc.accADC[Y] * acc.dev.acc_1G_rec));
746  *clearToSend = false;
747  break;
748  case FSSP_DATAID_ACCZ :
749  smartPortSendPackage(id, lrintf(100 * acc.accADC[Z] * acc.dev.acc_1G_rec));
750  *clearToSend = false;
751  break;
752 #endif
753  case FSSP_DATAID_T1 :
754  // we send all the flags as decimal digits for easy reading
755 
756  // the t1Cnt simply allows the telemetry view to show at least some changes
757  t1Cnt++;
758  if (t1Cnt == 4) {
759  t1Cnt = 1;
760  }
761  tmpi = t1Cnt * 10000; // start off with at least one digit so the most significant 0 won't be cut off
762  // the Taranis seems to be able to fit 5 digits on the screen
763  // the Taranis seems to consider this number a signed 16 bit integer
764 
765  if (!isArmingDisabled()) {
766  tmpi += 1;
767  } else {
768  tmpi += 2;
769  }
770  if (ARMING_FLAG(ARMED)) {
771  tmpi += 4;
772  }
773 
774  if (FLIGHT_MODE(ANGLE_MODE)) {
775  tmpi += 10;
776  }
777  if (FLIGHT_MODE(HORIZON_MODE)) {
778  tmpi += 20;
779  }
780  if (FLIGHT_MODE(PASSTHRU_MODE)) {
781  tmpi += 40;
782  }
783 
784  if (FLIGHT_MODE(MAG_MODE)) {
785  tmpi += 100;
786  }
787 
788  if (FLIGHT_MODE(HEADFREE_MODE)) {
789  tmpi += 4000;
790  }
791 
792  smartPortSendPackage(id, (uint32_t)tmpi);
793  *clearToSend = false;
794  break;
795  case FSSP_DATAID_T2 :
796 #ifdef USE_GPS
797  if (sensors(SENSOR_GPS)) {
798  // satellite accuracy HDOP: 0 = worst [HDOP > 5.5m], 9 = best [HDOP <= 1.0m]
799  uint16_t hdop = constrain(scaleRange(gpsSol.hdop, 100, 550, 9, 0), 0, 9) * 100;
800  smartPortSendPackage(id, (STATE(GPS_FIX) ? 1000 : 0) + (STATE(GPS_FIX_HOME) ? 2000 : 0) + hdop + gpsSol.numSat);
801  *clearToSend = false;
802  } else if (featureIsEnabled(FEATURE_GPS)) {
803  smartPortSendPackage(id, 0);
804  *clearToSend = false;
805  } else
806 #endif
807  if (telemetryConfig()->pidValuesAsTelemetry) {
808  switch (t2Cnt) {
809  case 0:
810  tmp2 = currentPidProfile->pid[PID_ROLL].P;
811  tmp2 += (currentPidProfile->pid[PID_PITCH].P<<8);
812  tmp2 += (currentPidProfile->pid[PID_YAW].P<<16);
813  break;
814  case 1:
815  tmp2 = currentPidProfile->pid[PID_ROLL].I;
816  tmp2 += (currentPidProfile->pid[PID_PITCH].I<<8);
817  tmp2 += (currentPidProfile->pid[PID_YAW].I<<16);
818  break;
819  case 2:
820  tmp2 = currentPidProfile->pid[PID_ROLL].D;
821  tmp2 += (currentPidProfile->pid[PID_PITCH].D<<8);
822  tmp2 += (currentPidProfile->pid[PID_YAW].D<<16);
823  break;
824  case 3:
827  tmp2 += (currentControlRateProfile->rates[FD_YAW]<<16);
828  break;
829  }
830  tmp2 += t2Cnt<<24;
831  t2Cnt++;
832  if (t2Cnt == 4) {
833  t2Cnt = 0;
834  }
835  smartPortSendPackage(id, tmp2);
836  *clearToSend = false;
837  }
838 
839  break;
840 #if defined(USE_ADC_INTERNAL)
841  case FSSP_DATAID_T11 :
842  smartPortSendPackage(id, getCoreTemperatureCelsius());
843  *clearToSend = false;
844  break;
845 #endif
846 #ifdef USE_GPS
847  case FSSP_DATAID_SPEED :
848  if (STATE(GPS_FIX)) {
849  //convert to knots: 1cm/s = 0.0194384449 knots
850  //Speed should be sent in knots/1000 (GPS speed is in cm/s)
851  uint32_t tmpui = gpsSol.groundSpeed * 1944 / 100;
852  smartPortSendPackage(id, tmpui);
853  *clearToSend = false;
854  }
855  break;
856  case FSSP_DATAID_LATLONG :
857  if (STATE(GPS_FIX)) {
858  uint32_t tmpui = 0;
859  // the same ID is sent twice, one for longitude, one for latitude
860  // the MSB of the sent uint32_t helps FrSky keep track
861  // the even/odd bit of our counter helps us keep track
862  if (tableInfo->index & 1) {
863  tmpui = abs(gpsSol.llh.lon); // now we have unsigned value and one bit to spare
864  tmpui = (tmpui + tmpui / 2) / 25 | 0x80000000; // 6/100 = 1.5/25, division by power of 2 is fast
865  if (gpsSol.llh.lon < 0) tmpui |= 0x40000000;
866  }
867  else {
868  tmpui = abs(gpsSol.llh.lat); // now we have unsigned value and one bit to spare
869  tmpui = (tmpui + tmpui / 2) / 25; // 6/100 = 1.5/25, division by power of 2 is fast
870  if (gpsSol.llh.lat < 0) tmpui |= 0x40000000;
871  }
872  smartPortSendPackage(id, tmpui);
873  *clearToSend = false;
874  }
875  break;
876  case FSSP_DATAID_HOME_DIST :
877  if (STATE(GPS_FIX)) {
878  smartPortSendPackage(id, GPS_distanceToHome);
879  *clearToSend = false;
880  }
881  break;
882  case FSSP_DATAID_GPS_ALT :
883  if (STATE(GPS_FIX)) {
884  smartPortSendPackage(id, gpsSol.llh.altCm); // given in 0.01m
885  *clearToSend = false;
886  }
887  break;
888 #endif
889  case FSSP_DATAID_A4 :
890  cellCount = getBatteryCellCount();
891  vfasVoltage = cellCount ? (getBatteryVoltage() / cellCount) : 0; // given in 0.01V, convert to volts
892  smartPortSendPackage(id, vfasVoltage);
893  *clearToSend = false;
894  break;
895  case FSSP_DATAID_DOWNLINK :
896  if (smartPortDownlink) {
897  uint32_t data;
898  if (smartPortDownlink(&data)) {
899  smartPortSendPackage(id, data);
900  *clearToSend = false;
901  }
902  }
903  break;
904  default:
905  break;
906  // if nothing is sent, hasRequest isn't cleared, we already incremented the counter, just loop back to the start
907  }
908  }
909 }
910 
911 //static bool serialCheckQueueEmpty(void)
912 //{
913 // return (serialRxBytesWaiting(smartPortSerialPort) == 0);
914 //}
915 //
916 //void handleSmartPortTelemetry(void)
917 //{
918 // const timeUs_t requestTimeout = micros() + SMARTPORT_SERVICE_TIMEOUT_US;
919 //
920 // if (telemetryState == TELEMETRY_STATE_INITIALIZED_SERIAL && smartPortSerialPort) {
921 // smartPortPayload_t *payload = NULL;
922 // bool clearToSend = false;
923 // while (serialRxBytesWaiting(smartPortSerialPort) > 0 && !payload) {
924 // uint8_t c = serialRead(smartPortSerialPort);
925 // payload = smartPortDataReceive(c, &clearToSend, serialCheckQueueEmpty, true);
926 // }
927 //
928 // processSmartPortTelemetry(payload, &clearToSend, &requestTimeout);
929 // }
930 //}
931 //#endif
c
VIC slots used for the LPC2148 define name e g gps UART1_VIC_SLOT e g modem SPI1_VIC_SLOT SPI1 in mcu_periph spi_arch c or spi_slave_hs_arch c(and some others not using the SPI peripheral yet..) I2C0_VIC_SLOT 8 mcu_periph/i2c_arch.c I2C1_VIC_SLOT 9 mcu_periph/i2c_arch.c USB_VIC_SLOT 10 usb
currentControlRateProfile
controlRateConfig_t * currentControlRateProfile
Definition: cc2500_compat.c:159
smartPortCheckQueueEmptyFn
bool smartPortCheckQueueEmptyFn(void)
Definition: cc2500_smartport.h:83
smartPortSendPackage
static void smartPortSendPackage(uint16_t id, uint32_t val)
Definition: cc2500_smartport.c:337
FSSP_START_STOP
@ FSSP_START_STOP
Definition: cc2500_smartport.h:57
FSSP_DATAID_T2
@ FSSP_DATAID_T2
Definition: cc2500_smartport.c:163
telemetryState
static uint8_t telemetryState
Definition: cc2500_smartport.c:222
uint16_t
unsigned short uint16_t
Definition: types.h:16
initSmartPortTelemetryExternal
bool initSmartPortTelemetryExternal(smartPortWriteFrameFn *smartPortWriteFrameExternal)
Definition: cc2500_smartport.c:480
SENSOR_GROUND_SPEED
@ SENSOR_GROUND_SPEED
Definition: cc2500_settings.h:174
val
uint16_t val[TCOUPLE_NB]
Definition: temp_tcouple_adc.c:49
smartPortPayload_s
Definition: cc2500_smartport.h:76
FSSP_DATAID_SPEED
@ FSSP_DATAID_SPEED
Definition: cc2500_smartport.c:118
cc2500_smartport.h
smartPortDownlinkFn
bool smartPortDownlinkFn(uint32_t *data)
Definition: cc2500_smartport.h:8
SENSOR_VOLTAGE
@ SENSOR_VOLTAGE
Definition: cc2500_settings.h:161
FSSP_DATAID_CELLS
@ FSSP_DATAID_CELLS
Definition: cc2500_smartport.c:153
ADD_ESC_SENSOR
#define ADD_ESC_SENSOR(dataId)
Definition: cc2500_smartport.c:348
PID_YAW
#define PID_YAW
Definition: cc2500_compat.h:121
SENSOR_MODE
@ SENSOR_MODE
Definition: cc2500_settings.h:164
FSSP_DATAID_CURRENT5
@ FSSP_DATAID_CURRENT5
Definition: cc2500_smartport.c:133
FSSP_DATAID_TEMP4
@ FSSP_DATAID_TEMP4
Definition: cc2500_smartport.c:171
getAmperage
#define getAmperage()
Definition: cc2500_compat.h:281
FSSP_DATAID_TEMP1
@ FSSP_DATAID_TEMP1
Definition: cc2500_smartport.c:168
FSSP_DATAID_RPM2
@ FSSP_DATAID_RPM2
Definition: cc2500_smartport.c:139
FD_ROLL
#define FD_ROLL
Definition: cc2500_compat.h:241
micros
#define micros()
Definition: cc2500_compat.h:174
FSSP_DATAID_VFAS3
@ FSSP_DATAID_VFAS3
Definition: cc2500_smartport.c:122
FSSP_DATAID_A3
@ FSSP_DATAID_A3
Definition: cc2500_smartport.c:176
FSSP_DATAID_CURRENT1
@ FSSP_DATAID_CURRENT1
Definition: cc2500_smartport.c:129
SENSOR_TEMPERATURE
@ SENSOR_TEMPERATURE
Definition: cc2500_settings.h:184
FSSP_DATAID_VFAS5
@ FSSP_DATAID_VFAS5
Definition: cc2500_smartport.c:124
FSSP_DATAID_VFAS1
@ FSSP_DATAID_VFAS1
Definition: cc2500_smartport.c:120
FSSP_DATAID_T1
@ FSSP_DATAID_T1
Definition: cc2500_smartport.c:161
FSSP_DATAID_ADC2
@ FSSP_DATAID_ADC2
Definition: cc2500_smartport.c:149
PID_ROLL
#define PID_ROLL
Definition: cc2500_compat.h:119
SENSOR_HEADING
@ SENSOR_HEADING
Definition: cc2500_settings.h:170
FSSP_SENSOR_ID2
@ FSSP_SENSOR_ID2
Definition: cc2500_smartport.h:69
uint32_t
unsigned long uint32_t
Definition: types.h:18
MAX_DATAIDS
#define MAX_DATAIDS
Definition: cc2500_smartport.c:181
telemetryConfig
const telemetryConfig_t * telemetryConfig(void)
Definition: cc2500_settings.c:105
UNUSED
uint8_t last_wp UNUSED
Definition: navigation.c:96
mesonh.mesonh_atmosphere.Z
int Z
Definition: mesonh_atmosphere.py:45
getMAhDrawn
#define getMAhDrawn()
Definition: cc2500_compat.h:283
timeUs_t
uint32_t timeUs_t
Definition: cc2500_compat.h:93
FSSP_DATAID_VFAS8
@ FSSP_DATAID_VFAS8
Definition: cc2500_smartport.c:127
ESC_SENSOR_CURRENT
@ ESC_SENSOR_CURRENT
Definition: cc2500_settings.h:176
frSkyTableInfo_s
Definition: cc2500_smartport.c:195
frSkyTableInfo_s::index
uint8_t index
Definition: cc2500_smartport.c:198
SENSOR_ACC_Z
@ SENSOR_ACC_Z
Definition: cc2500_settings.h:167
SENSOR_ALTITUDE
@ SENSOR_ALTITUDE
Definition: cc2500_settings.h:171
FD_YAW
#define FD_YAW
Definition: cc2500_compat.h:243
attitude
#define attitude
Definition: cc2500_compat.h:79
FD_PITCH
#define FD_PITCH
Definition: cc2500_compat.h:242
FSSP_DATAID_DOWNLINK
#define FSSP_DATAID_DOWNLINK
Definition: cc2500_smartport.c:19
ESC_SENSOR_VOLTAGE
@ ESC_SENSOR_VOLTAGE
Definition: cc2500_settings.h:177
isBatteryVoltageConfigured
#define isBatteryVoltageConfigured()
Definition: cc2500_compat.h:268
ADD_SENSOR
#define ADD_SENSOR(dataId)
Definition: cc2500_smartport.c:347
smartPortDataReceive
smartPortPayload_t * smartPortDataReceive(uint16_t c, bool *clearToSend, smartPortCheckQueueEmptyFn *checkQueueEmpty, bool useChecksum)
Definition: cc2500_smartport.c:238
FSSP_DATAID_CURRENT
@ FSSP_DATAID_CURRENT
Definition: cc2500_smartport.c:128
isArmingDisabled
#define isArmingDisabled()
Definition: cc2500_compat.h:235
getBatteryVoltage
#define getBatteryVoltage()
Definition: cc2500_compat.h:273
cmpTimeUs
static timeDelta_t cmpTimeUs(timeUs_t a, timeUs_t b)
Definition: cc2500_compat.h:96
smartPortDownlink
smartPortDownlinkFn * smartPortDownlink
Definition: cc2500_smartport.c:22
isAmperageConfigured
#define isAmperageConfigured()
Definition: cc2500_compat.h:279
FSSP_DATAID_CELLS_LAST
@ FSSP_DATAID_CELLS_LAST
Definition: cc2500_smartport.c:154
FSSP_DATAID_ADC1
@ FSSP_DATAID_ADC1
Definition: cc2500_smartport.c:148
FSSP_DATAID_VFAS2
@ FSSP_DATAID_VFAS2
Definition: cc2500_smartport.c:121
frSkyTableInfo_t
struct frSkyTableInfo_s frSkyTableInfo_t
FLIGHT_MODE
#define FLIGHT_MODE(...)
Definition: cc2500_compat.h:237
FSSP_DATAID_ASPD
@ FSSP_DATAID_ASPD
Definition: cc2500_smartport.c:166
FSSP_DATAID_VFAS6
@ FSSP_DATAID_VFAS6
Definition: cc2500_smartport.c:125
FSSP_DATAID_RPM5
@ FSSP_DATAID_RPM5
Definition: cc2500_smartport.c:142
controlRateConfig_t::rates
uint8_t rates[1]
Definition: cc2500_compat.h:245
FSSP_DATAID_TEMP7
@ FSSP_DATAID_TEMP7
Definition: cc2500_smartport.c:174
FSSP_DATAID_RPM3
@ FSSP_DATAID_RPM3
Definition: cc2500_smartport.c:140
cc2500_settings.h
TELEMETRY_STATE_UNINITIALIZED
@ TELEMETRY_STATE_UNINITIALIZED
Definition: cc2500_smartport.c:217
FSSP_SENSOR_ID1
@ FSSP_SENSOR_ID1
Definition: cc2500_smartport.h:68
frSkyTableInfo_s::size
uint8_t size
Definition: cc2500_smartport.c:197
FSSP_DATAID_RPM4
@ FSSP_DATAID_RPM4
Definition: cc2500_smartport.c:141
FSSP_DATAID_TEMP6
@ FSSP_DATAID_TEMP6
Definition: cc2500_smartport.c:173
uint8_t
unsigned char uint8_t
Definition: types.h:14
PID_PITCH
#define PID_PITCH
Definition: cc2500_compat.h:120
SENSOR_DISTANCE
@ SENSOR_DISTANCE
Definition: cc2500_settings.h:175
FSSP_DATAID_VFAS
@ FSSP_DATAID_VFAS
Definition: cc2500_smartport.c:119
FSSP_DATAID_HOME_DIST
@ FSSP_DATAID_HOME_DIST
Definition: cc2500_smartport.c:164
FSSP_DATAID_ALTITUDE
@ FSSP_DATAID_ALTITUDE
Definition: cc2500_smartport.c:146
ESC_SENSOR_RPM
@ ESC_SENSOR_RPM
Definition: cc2500_settings.h:178
smartPortPayload_s::data
uint32_t data
Definition: cc2500_smartport.h:79
FSSP_DATAID_VARIO
@ FSSP_DATAID_VARIO
Definition: cc2500_smartport.c:152
telemetryIsSensorEnabled
bool telemetryIsSensorEnabled(sensor_e sensor)
Definition: cc2500_settings.c:111
SENSOR_VARIO
@ SENSOR_VARIO
Definition: cc2500_settings.h:172
cc2500_rx.h
FSSP_DATAID_RPM6
@ FSSP_DATAID_RPM6
Definition: cc2500_smartport.c:143
FSSP_DATAID_A4
@ FSSP_DATAID_A4
Definition: cc2500_smartport.c:177
FSSP_DATAID_TEMP3
@ FSSP_DATAID_TEMP3
Definition: cc2500_smartport.c:170
frSkyDataIdTable
static uint16_t frSkyDataIdTable[MAX_DATAIDS]
Definition: cc2500_smartport.c:183
SENSOR_CURRENT
@ SENSOR_CURRENT
Definition: cc2500_settings.h:162
frSkyDataIdTableInfo
static frSkyTableInfo_t frSkyDataIdTableInfo
Definition: cc2500_smartport.c:201
TELEMETRY_STATE_INITIALIZED_SERIAL
@ TELEMETRY_STATE_INITIALIZED_SERIAL
Definition: cc2500_smartport.c:218
smartPortPayload_s::valueId
uint16_t valueId
Definition: cc2500_smartport.h:78
smartPortPayload_s::frameId
uint8_t frameId
Definition: cc2500_smartport.h:77
FSSP_DATAID_UPLINK
#define FSSP_DATAID_UPLINK
Definition: cc2500_smartport.c:20
FSSP_DATAID_VFAS4
@ FSSP_DATAID_VFAS4
Definition: cc2500_smartport.c:123
SENSOR_FUEL
@ SENSOR_FUEL
Definition: cc2500_settings.h:163
featureIsEnabled
#define featureIsEnabled(mask)
Definition: cc2500_compat.h:163
pidGains_s::D
uint8_t D
Definition: cc2500_compat.h:126
getBatteryCellCount
#define getBatteryCellCount()
Definition: cc2500_compat.h:276
ESC_SENSOR_TEMPERATURE
@ ESC_SENSOR_TEMPERATURE
Definition: cc2500_settings.h:179
FSSP_DATAID_RPM8
@ FSSP_DATAID_RPM8
Definition: cc2500_smartport.c:145
smartPortUplink
smartPortUplinkFn * smartPortUplink
Definition: cc2500_smartport.c:23
currentPidProfile
struct pidProfile_s * currentPidProfile
Definition: cc2500_compat.c:43
FSSP_DATAID_CAP_USED
@ FSSP_DATAID_CAP_USED
Definition: cc2500_smartport.c:151
FSSP_DATAID_TEMP8
@ FSSP_DATAID_TEMP8
Definition: cc2500_smartport.c:175
FSSP_DATAID_FUEL
@ FSSP_DATAID_FUEL
Definition: cc2500_smartport.c:147
int32_t
signed long int32_t
Definition: types.h:19
SENSOR_ACC_Y
@ SENSOR_ACC_Y
Definition: cc2500_settings.h:166
FSSP_DATAID_T11
@ FSSP_DATAID_T11
Definition: cc2500_smartport.c:162
smartPortPayload_t
struct smartPortPayload_s smartPortPayload_t
SENSOR_ACC_X
@ SENSOR_ACC_X
Definition: cc2500_settings.h:165
FSSP_DATAID_RPM1
@ FSSP_DATAID_RPM1
Definition: cc2500_smartport.c:138
FSSP_DATAID_CURRENT2
@ FSSP_DATAID_CURRENT2
Definition: cc2500_smartport.c:130
FSSP_DATA_FRAME
@ FSSP_DATA_FRAME
Definition: cc2500_smartport.h:62
ARMING_FLAG
#define ARMING_FLAG(...)
Definition: cc2500_compat.h:236
initSmartPortSensors
static void initSmartPortSensors(void)
Definition: cc2500_smartport.c:350
FSSP_DLE_XOR
@ FSSP_DLE_XOR
Definition: cc2500_smartport.h:60
FSSP_DATAID_VFAS7
@ FSSP_DATAID_VFAS7
Definition: cc2500_smartport.c:126
FSSP_DATAID_CURRENT7
@ FSSP_DATAID_CURRENT7
Definition: cc2500_smartport.c:135
FSSP_DATAID_CURRENT4
@ FSSP_DATAID_CURRENT4
Definition: cc2500_smartport.c:132
FSSP_DATAID_CURRENT8
@ FSSP_DATAID_CURRENT8
Definition: cc2500_smartport.c:136
TELEMETRY_STATE_INITIALIZED_EXTERNAL
@ TELEMETRY_STATE_INITIALIZED_EXTERNAL
Definition: cc2500_smartport.c:219
getEstimatedVario
#define getEstimatedVario()
Definition: cc2500_compat.h:255
FSSP_DATAID_GPS_ALT
@ FSSP_DATAID_GPS_ALT
Definition: cc2500_smartport.c:165
FSSP_DATAID_TEMP
@ FSSP_DATAID_TEMP
Definition: cc2500_smartport.c:167
SENSOR_LAT_LONG
@ SENSOR_LAT_LONG
Definition: cc2500_settings.h:173
pidGains_s::I
uint8_t I
Definition: cc2500_compat.h:125
FSSP_DATAID_HEADING
@ FSSP_DATAID_HEADING
Definition: cc2500_smartport.c:155
getEstimatedAltitudeCm
#define getEstimatedAltitudeCm()
Definition: cc2500_compat.h:252
FSSP_DATAID_TEMP2
@ FSSP_DATAID_TEMP2
Definition: cc2500_smartport.c:169
FSSP_DLE
@ FSSP_DLE
Definition: cc2500_smartport.h:59
checksum
static uint8_t checksum
Definition: airspeed_uADC.c:61
smartPortWriteFrameFn
void smartPortWriteFrameFn(const smartPortPayload_t *payload)
Definition: cc2500_smartport.h:82
frSkyTableInfo_s::table
uint16_t * table
Definition: cc2500_smartport.c:196
pidGains_s::P
uint8_t P
Definition: cc2500_compat.h:124
smartPortUplinkFn
void smartPortUplinkFn(struct smartPortPayload_s *payload)
Definition: cc2500_smartport.h:15
smartPortWriteFrame
static smartPortWriteFrameFn * smartPortWriteFrame
Definition: cc2500_smartport.c:232
mesonh.mesonh_atmosphere.Y
int Y
Definition: mesonh_atmosphere.py:44
FSSP_DATAID_CURRENT6
@ FSSP_DATAID_CURRENT6
Definition: cc2500_smartport.c:134
FSSP_DATAID_CURRENT3
@ FSSP_DATAID_CURRENT3
Definition: cc2500_smartport.c:131
cc2500_compat.h
sensors
#define sensors(...)
Definition: cc2500_compat.h:68
pidProfile_s::pid
struct pidGains_s pid[1]
Definition: cc2500_compat.h:129
FSSP_DATAID_TEMP5
@ FSSP_DATAID_TEMP5
Definition: cc2500_smartport.c:172
FSSP_DATAID_LATLONG
@ FSSP_DATAID_LATLONG
Definition: cc2500_smartport.c:150
mesonh.mesonh_atmosphere.X
int X
Definition: mesonh_atmosphere.py:43
FSSP_DATAID_RPM
@ FSSP_DATAID_RPM
Definition: cc2500_smartport.c:137
processSmartPortTelemetry
void processSmartPortTelemetry(smartPortPayload_t *payload, volatile bool *clearToSend, const timeUs_t *requestTimeout)
Definition: cc2500_smartport.c:533
FSSP_DATAID_RPM7
@ FSSP_DATAID_RPM7
Definition: cc2500_smartport.c:144