dRonin
adbada4
dRonin firmware
|
Packs UAVObjects into FrSKY Smart Port frames. More...
#include "pios.h"
#include "openpilot.h"
#include "flightbatterysettings.h"
#include "gpsposition.h"
Go to the source code of this file.
Data Structures | |
struct | frsky_settings |
struct | frsky_value_item |
Enumerations | |
enum | frsky_value_id { FRSKY_ALT_ID = 0x0100, FRSKY_VARIO_ID = 0x110, FRSKY_CURR_ID = 0x0200, FRSKY_VFAS_ID = 0x0210, FRSKY_CELLS_ID = 0x0300, FRSKY_T1_ID = 0x0400, FRSKY_T2_ID = 0x0410, FRSKY_RPM_ID = 0x0500, FRSKY_FUEL_ID = 0x0600, FRSKY_ACCX_ID = 0x0700, FRSKY_ACCY_ID = 0x0710, FRSKY_ACCZ_ID = 0x0720, FRSKY_GPS_LON_LAT_ID = 0x0800, FRSKY_GPS_ALT_ID = 0x0820, FRSKY_GPS_SPEED_ID = 0x0830, FRSKY_GPS_COURSE_ID = 0x0840, FRSKY_GPS_TIME_ID = 0x0850, FRSKY_ADC3_ID = 0x0900, FRSKY_ADC4_ID = 0x0910, FRSKY_AIR_SPEED_ID = 0x0a00, FRSKY_RSSI_ID = 0xf101, FRSKY_ADC1_ID = 0xf102, FRSKY_ADC2_ID = 0xf103, FRSKY_BATT_ID = 0xf104, FRSKY_SWR_ID = 0xf105 } |
Functions | |
bool | frsky_encode_gps_course (struct frsky_settings *frsky, uint32_t *value, bool test_presence_only, uint32_t arg) |
bool | frsky_encode_altitude (struct frsky_settings *frsky, uint32_t *value, bool test_presence_only, uint32_t arg) |
bool | frsky_encode_vario (struct frsky_settings *frsky, uint32_t *value, bool test_presence_only, uint32_t arg) |
bool | frsky_encode_current (struct frsky_settings *frsky, uint32_t *value, bool test_presence_only, uint32_t arg) |
bool | frsky_encode_cells (struct frsky_settings *frsky, uint32_t *value, bool test_presence_only, uint32_t arg) |
bool | frsky_encode_t1 (struct frsky_settings *frsky, uint32_t *value, bool test_presence_only, uint32_t arg) |
bool | frsky_encode_t2 (struct frsky_settings *frsky, uint32_t *value, bool test_presence_only, uint32_t arg) |
bool | frsky_encode_fuel (struct frsky_settings *frsky, uint32_t *value, bool test_presence_only, uint32_t arg) |
bool | frsky_encode_acc (struct frsky_settings *frsky, uint32_t *value, bool test_presence_only, uint32_t arg) |
bool | frsky_encode_gps_coord (struct frsky_settings *frsky, uint32_t *value, bool test_presence_only, uint32_t arg) |
bool | frsky_encode_gps_alt (struct frsky_settings *frsky, uint32_t *value, bool test_presence_only, uint32_t arg) |
bool | frsky_encode_gps_speed (struct frsky_settings *frsky, uint32_t *value, bool test_presence_only, uint32_t arg) |
bool | frsky_encode_gps_time (struct frsky_settings *frsky, uint32_t *value, bool test_presence_only, uint32_t arg) |
bool | frsky_encode_rpm (struct frsky_settings *frsky, uint32_t *value, bool test_presence_only, uint32_t arg) |
bool | frsky_encode_airspeed (struct frsky_settings *frsky, uint32_t *value, bool test_presence_only, uint32_t arg) |
uint8_t | frsky_insert_byte (uint8_t *obuff, uint16_t *chk, uint8_t byte) |
int32_t | frsky_send_frame (uintptr_t com, enum frsky_value_id id, uint32_t value, bool send_prelude) |
Packs UAVObjects into FrSKY Smart Port frames.
Definition in file frsky_packing.h.
enum frsky_value_id |
Definition at line 53 of file frsky_packing.h.
bool frsky_encode_acc | ( | struct frsky_settings * | frsky, |
uint32_t * | value, | ||
bool | test_presence_only, | ||
uint32_t | arg | ||
) |
Encode configured values
[out] | value | encoded value |
[in] | test_presence_only | true when function should only test for availability of this value |
[in] | arg | argument specified in frsky_value_items[]; 0=X, 1=Y, 2=Z |
Definition at line 296 of file frsky_packing.c.
bool frsky_encode_airspeed | ( | struct frsky_settings * | frsky, |
uint32_t * | value, | ||
bool | test_presence_only, | ||
uint32_t | arg | ||
) |
Encode true airspeed(TAS)
[out] | value | encoded value |
[in] | test_presence_only | true when function should only test for availability of this value |
[in] | arg | argument specified in frsky_value_items[] |
Definition at line 559 of file frsky_packing.c.
bool frsky_encode_altitude | ( | struct frsky_settings * | frsky, |
uint32_t * | value, | ||
bool | test_presence_only, | ||
uint32_t | arg | ||
) |
Encode baro altitude value
[out] | value | encoded value |
[in] | test_presence_only | true when function should only test for availability of this value |
[in] | arg | argument specified in frsky_value_items[] |
Definition at line 62 of file frsky_packing.c.
bool frsky_encode_cells | ( | struct frsky_settings * | frsky, |
uint32_t * | value, | ||
bool | test_presence_only, | ||
uint32_t | arg | ||
) |
Encode battery cells voltage
[out] | value | encoded value |
[in] | test_presence_only | true when function should only test for availability of this value |
[in] | arg | argument specified in frsky_value_items[], index of battery cell pair |
Definition at line 153 of file frsky_packing.c.
bool frsky_encode_current | ( | struct frsky_settings * | frsky, |
uint32_t * | value, | ||
bool | test_presence_only, | ||
uint32_t | arg | ||
) |
Encode battery current value
[out] | value | encoded value |
[in] | test_presence_only | true when function should only test for availability of this value |
[in] | arg | argument specified in frsky_value_items[] |
Definition at line 131 of file frsky_packing.c.
bool frsky_encode_fuel | ( | struct frsky_settings * | frsky, |
uint32_t * | value, | ||
bool | test_presence_only, | ||
uint32_t | arg | ||
) |
Encode consumed battery energy as fuel
[out] | value | encoded value |
[in] | test_presence_only | true when function should only test for availability of this value |
[in] | arg | argument specified in frsky_value_items[] |
Definition at line 271 of file frsky_packing.c.
bool frsky_encode_gps_alt | ( | struct frsky_settings * | frsky, |
uint32_t * | value, | ||
bool | test_presence_only, | ||
uint32_t | arg | ||
) |
Encode gps altitude
[out] | value | encoded value |
[in] | test_presence_only | true when function should only test for availability of this value |
[in] | arg | argument specified in frsky_value_items[] |
Definition at line 448 of file frsky_packing.c.
bool frsky_encode_gps_coord | ( | struct frsky_settings * | frsky, |
uint32_t * | value, | ||
bool | test_presence_only, | ||
uint32_t | arg | ||
) |
Encode gps coordinates
[out] | value | encoded value |
[in] | test_presence_only | true when function should only test for availability of this value |
[in] | arg | argument specified in frsky_value_items[]; 0=lattitude, 1=longitude |
Definition at line 407 of file frsky_packing.c.
bool frsky_encode_gps_course | ( | struct frsky_settings * | frsky, |
uint32_t * | value, | ||
bool | test_presence_only, | ||
uint32_t | arg | ||
) |
Encode heading value
[out] | value | encoded value |
[in] | test_presence_only | true when function should only test for availability of this value |
[in] | arg | argument specified in frsky_value_items[] |
Definition at line 85 of file frsky_packing.c.
bool frsky_encode_gps_speed | ( | struct frsky_settings * | frsky, |
uint32_t * | value, | ||
bool | test_presence_only, | ||
uint32_t | arg | ||
) |
Encode gps speed
[out] | value | encoded value |
[in] | test_presence_only | true when function should only test for availability of this value |
[in] | arg | argument specified in frsky_value_items[] |
Definition at line 471 of file frsky_packing.c.
bool frsky_encode_gps_time | ( | struct frsky_settings * | frsky, |
uint32_t * | value, | ||
bool | test_presence_only, | ||
uint32_t | arg | ||
) |
Encode GPS UTC time
[out] | value | encoded value |
[in] | test_presence_only | true when function should only test for availability of this value |
[in] | arg | argument specified in frsky_value_items[]; 0=date, 1=time |
Definition at line 493 of file frsky_packing.c.
bool frsky_encode_rpm | ( | struct frsky_settings * | frsky, |
uint32_t * | value, | ||
bool | test_presence_only, | ||
uint32_t | arg | ||
) |
Encodes ARM status and flight mode number as RPM value Since there is no RPM information in any UAVO available, we will intentionaly misuse this item to encode another useful information. It will encode flight status as three-digit number as follow: most left digit encodes arm status (1=armed, 0=disarmed) two most right digits encodes flight mode number (see FlightStatus UAVO FlightMode enum) To work this propperly on Taranis, you have to set Blades to "1" in telemetry setting
[out] | value | encoded value |
[in] | test_presence_only | true when function should only test for availability of this value |
[in] | arg | argument specified in frsky_value_items[] |
Definition at line 536 of file frsky_packing.c.
bool frsky_encode_t1 | ( | struct frsky_settings * | frsky, |
uint32_t * | value, | ||
bool | test_presence_only, | ||
uint32_t | arg | ||
) |
Encode GPS status as T1 value Right-most two digits means visible satellite count, left-most digit has following meaning: 1 - no GPS connected 2 - no fix 3 - 2D fix 4 - 3D fix 5 - 3D fix and HomeLocation is SET - should be safe for navigation
[out] | value | encoded value |
[in] | test_presence_only | true when function should only test for availability of this value |
[in] | arg | argument specified in frsky_value_items[] |
Definition at line 192 of file frsky_packing.c.
bool frsky_encode_t2 | ( | struct frsky_settings * | frsky, |
uint32_t * | value, | ||
bool | test_presence_only, | ||
uint32_t | arg | ||
) |
Encode GPS hDop and vDop as T2 Bits 0-7 = hDop * 100, max 255 (hDop = 2.55) Bits 8-15 = vDop * 100, max 255 (vDop = 2.55)
[out] | value | encoded value |
[in] | test_presence_only | true when function should only test for availability of this value |
[in] | arg | argument specified in frsky_value_items[] |
Definition at line 241 of file frsky_packing.c.
bool frsky_encode_vario | ( | struct frsky_settings * | frsky, |
uint32_t * | value, | ||
bool | test_presence_only, | ||
uint32_t | arg | ||
) |
Encode vertical speed value
[out] | value | encoded value |
[in] | test_presence_only | true when function should only test for availability of this value |
[in] | arg | argument specified in frsky_value_items[] |
Definition at line 108 of file frsky_packing.c.
uint8_t frsky_insert_byte | ( | uint8_t * | obuff, |
uint16_t * | chk, | ||
uint8_t | byte | ||
) |
Performs byte stuffing and checksum calculation
[out] | obuff | buffer where byte stuffed data will came in |
[in,out] | chk | checksum byte to update |
[in] | byte |
Definition at line 581 of file frsky_packing.c.
int32_t frsky_send_frame | ( | uintptr_t | com, |
enum frsky_value_id | id, | ||
uint32_t | value, | ||
bool | send_prelude | ||
) |
Send u32 value dataframe to FrSky SmartPort bus
[in] | id | FrSky value ID |
[in] | value | value |
Definition at line 603 of file frsky_packing.c.