dRonin
adbada4
dRonin firmware
|
Packs UAVObjects into FrSKY Smart Port frames. More...
#include "frsky_packing.h"
#include "modulesettings.h"
#include "misc_math.h"
#include "physical_constants.h"
#include "attitudeactual.h"
#include "baroaltitude.h"
#include "positionactual.h"
#include "velocityactual.h"
#include "flightbatterystate.h"
#include "flightbatterysettings.h"
#include "gpstime.h"
#include "homelocation.h"
#include "accels.h"
#include "flightstatus.h"
#include "airspeedactual.h"
#include "nedaccel.h"
Go to the source code of this file.
Functions | |
bool | frsky_encode_altitude (struct frsky_settings *frsky, uint32_t *value, bool test_presence_only, uint32_t arg) |
bool | frsky_encode_gps_course (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.c.
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.