dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
frsky_packing.h
Go to the documentation of this file.
1 
17 /*
18  * This program is free software; you can redistribute it and/or modify
19  * it under the terms of the GNU General Public License as published by
20  * the Free Software Foundation; either version 3 of the License, or
21  * (at your option) any later version.
22  *
23  * This program is distributed in the hope that it will be useful, but
24  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
25  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
26  * for more details.
27  *
28  * You should have received a copy of the GNU General Public License along
29  * with this program; if not, see <http://www.gnu.org/licenses/>
30  *
31  * Additional note on redistribution: The copyright and license notices above
32  * must be maintained in each individual source file that is a derivative work
33  * of this source file; otherwise redistribution is prohibited.
34  */
35 
36 #ifndef FRSKY_PACKING_H
37 #define FRSKY_PACKING_H
38 
39 #include "pios.h"
40 #include "openpilot.h"
41 
42 #include "flightbatterysettings.h"
43 #include "gpsposition.h"
44 
47  uint8_t batt_cell_count;
49  FlightBatterySettingsData battery_settings;
50  GPSPositionData gps_position;
51 };
52 
54  FRSKY_ALT_ID = 0x0100,
55  FRSKY_VARIO_ID = 0x110,
56  FRSKY_CURR_ID = 0x0200,
57  FRSKY_VFAS_ID = 0x0210,
58  FRSKY_CELLS_ID = 0x0300,
59  FRSKY_T1_ID = 0x0400,
60  FRSKY_T2_ID = 0x0410,
61  FRSKY_RPM_ID = 0x0500,
62  FRSKY_FUEL_ID = 0x0600,
63  FRSKY_ACCX_ID = 0x0700,
64  FRSKY_ACCY_ID = 0x0710,
65  FRSKY_ACCZ_ID = 0x0720,
67  FRSKY_GPS_ALT_ID = 0x0820,
71  FRSKY_ADC3_ID = 0x0900,
72  FRSKY_ADC4_ID = 0x0910,
74  FRSKY_RSSI_ID = 0xf101,
75  FRSKY_ADC1_ID = 0xf102,
76  FRSKY_ADC2_ID = 0xf103,
77  FRSKY_BATT_ID = 0xf104,
78  FRSKY_SWR_ID = 0xf105,
79 };
80 
83  uint16_t period_ms;
84  bool (*encode_value)(struct frsky_settings *sport, uint32_t *value, bool test_presence_only, uint32_t arg);
85  uint32_t fn_arg;
86 };
87 
88 bool frsky_encode_gps_course(struct frsky_settings *frsky, uint32_t *value, bool test_presence_only, uint32_t arg);
89 bool frsky_encode_altitude(struct frsky_settings *frsky, uint32_t *value, bool test_presence_only, uint32_t arg);
90 bool frsky_encode_vario(struct frsky_settings *frsky, uint32_t *value, bool test_presence_only, uint32_t arg);
91 bool frsky_encode_current(struct frsky_settings *frsky, uint32_t *value, bool test_presence_only, uint32_t arg);
92 bool frsky_encode_cells(struct frsky_settings *frsky, uint32_t *value, bool test_presence_only, uint32_t arg);
93 bool frsky_encode_t1(struct frsky_settings *frsky, uint32_t *value, bool test_presence_only, uint32_t arg);
94 bool frsky_encode_t2(struct frsky_settings *frsky, uint32_t *value, bool test_presence_only, uint32_t arg);
95 bool frsky_encode_fuel(struct frsky_settings *frsky, uint32_t *value, bool test_presence_only, uint32_t arg);
96 bool frsky_encode_acc(struct frsky_settings *frsky, uint32_t *value, bool test_presence_only, uint32_t arg);
97 bool frsky_encode_gps_coord(struct frsky_settings *frsky, uint32_t *value, bool test_presence_only, uint32_t arg);
98 bool frsky_encode_gps_alt(struct frsky_settings *frsky, uint32_t *value, bool test_presence_only, uint32_t arg);
99 bool frsky_encode_gps_speed(struct frsky_settings *frsky, uint32_t *value, bool test_presence_only, uint32_t arg);
100 bool frsky_encode_gps_time(struct frsky_settings *frsky, uint32_t *value, bool test_presence_only, uint32_t arg);
101 bool frsky_encode_rpm(struct frsky_settings *frsky, uint32_t *value, bool test_presence_only, uint32_t arg);
102 bool frsky_encode_airspeed(struct frsky_settings *frsky, uint32_t *value, bool test_presence_only, uint32_t arg);
103 uint8_t frsky_insert_byte(uint8_t *obuff, uint16_t *chk, uint8_t byte);
104 int32_t frsky_send_frame(uintptr_t com, enum frsky_value_id id, uint32_t value,
105  bool send_prelude);
106 
107 #endif /* FRSKY_PACKING_H */
108 
uint8_t batt_cell_count
Definition: frsky_packing.h:47
bool frsky_encode_cells(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)
Definition: frsky_packing.c:85
Main PiOS header to include all the compiled in PiOS options.
int32_t frsky_send_frame(uintptr_t com, enum frsky_value_id id, uint32_t value, bool send_prelude)
bool frsky_encode_t1(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)
Definition: frsky_packing.c:62
uint8_t frsky_insert_byte(uint8_t *obuff, uint16_t *chk, uint8_t byte)
bool frsky_encode_gps_alt(struct frsky_settings *frsky, uint32_t *value, bool test_presence_only, uint32_t arg)
uint16_t period_ms
Definition: frsky_packing.h:83
enum frsky_value_id id
Definition: frsky_packing.h:82
bool frsky_encode_vario(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)
bool frsky_encode_t2(struct frsky_settings *frsky, uint32_t *value, bool test_presence_only, uint32_t arg)
FlightBatterySettingsData battery_settings
Definition: frsky_packing.h:49
uint16_t value
Definition: storm32bgc.c:155
bool frsky_encode_current(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(* encode_value)(struct frsky_settings *sport, uint32_t *value, bool test_presence_only, uint32_t arg)
Definition: frsky_packing.h:84
Includes PiOS and core architecture components.
GPSPositionData gps_position
Definition: frsky_packing.h:50
bool frsky_encode_acc(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_coord(struct frsky_settings *frsky, uint32_t *value, bool test_presence_only, uint32_t arg)
bool use_current_sensor
Definition: frsky_packing.h:46
bool frsky_encode_gps_time(struct frsky_settings *frsky, uint32_t *value, bool test_presence_only, uint32_t arg)
frsky_value_id
Definition: frsky_packing.h:53