Merge pull request #10313 from P-I-Engineer/patch-1
[inav.git] / src / main / telemetry / sbus2_sensors.h
blob53ffb07adedec797c0814f598110bfbceceb5008
1 /*
2 * This file is part of INAV.
4 * INAV is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * INAV is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with INAV. If not, see <http://www.gnu.org/licenses/>.
19 #pragma once
21 #include <stdint.h>
23 #include "platform.h"
25 #ifdef USE_TELEMETRY_SBUS2
27 // Sensor code from https://github.com/BrushlessPower/SBUS2-Telemetry
28 // SBUS2 telemetry: 2ms deadtime after rc package
29 // One new slot every 700us
32 * ++++++++++++++++++++++++++++++++
33 * Temperature Sensors
34 * ++++++++++++++++++++++++++++++++
36 void send_temp125(uint8_t port, int16_t temp);
37 void send_alarm_as_temp125(uint8_t port, int16_t alarm);
38 void send_SBS01TE(uint8_t port, int16_t temp);
39 void send_SBS01T(uint8_t port, int16_t temp);
40 void send_F1713(uint8_t port, int16_t temp);
43 * ++++++++++++++++++++++++++++++++
44 * RPM Sensors
45 * ++++++++++++++++++++++++++++++++
47 void send_RPM(uint8_t port, uint32_t RPM);
48 void send_SBS01RB(uint8_t port, uint32_t RPM);
49 void send_SBS01RM(uint8_t port, uint32_t RPM);
50 void send_SBS01RO(uint8_t port, uint32_t RPM);
51 void send_SBS01R(uint8_t port, uint32_t RPM);
54 * ++++++++++++++++++++++++++++++++
55 * Voltage/Current Sensors
56 * ++++++++++++++++++++++++++++++++
58 void send_voltage(uint8_t port,uint16_t voltage1, uint16_t voltage2);
59 void send_voltagef(uint8_t port,float voltage1, float voltage2);
60 void send_s1678_current(uint8_t port, uint16_t current, uint16_t capacity, uint16_t voltage);
61 void send_s1678_currentf(uint8_t port, float current, uint16_t capacity, float voltage);
62 void send_SBS01C(uint8_t port, uint16_t current, uint16_t capacity, uint16_t voltage);
63 void send_SBS01Cf(uint8_t port, float current, uint16_t capacity, float voltage);
64 void send_F1678(uint8_t port, uint16_t current, uint16_t capacity, uint16_t voltage);
65 void send_F1678f(uint8_t port, float current, uint16_t capacity, float voltage);
66 void send_SBS01V(uint8_t port,uint16_t voltage1, uint16_t voltage2);
67 void send_SBS01Vf(uint8_t port,float voltage1, float voltage2);
71 * ++++++++++++++++++++++++++++++++
72 * Vario Sensors
73 * ++++++++++++++++++++++++++++++++
75 void send_f1712_vario(uint8_t port, int16_t altitude, int16_t vario);
76 void send_f1712_variof(uint8_t port, int16_t altitude, float vario);
77 void send_f1672_vario(uint8_t port, int16_t altitude, int16_t vario);
78 void send_f1672_variof(uint8_t port, int16_t altitude, float vario);
79 void send_F1712(uint8_t port, int16_t altitude, int16_t vario);
80 void send_F1712f(uint8_t port, int16_t altitude, float vario);
81 void send_F1672(uint8_t port, int16_t altitude, int16_t vario);
82 void send_F1672f(uint8_t port, int16_t altitude, float vario);
85 * ++++++++++++++++++++++++++++++++
86 * GPS Sensors
87 * Note the different Input Types!
88 * Example:
89 * Position Berlin Fernsehturm
90 * https://www.koordinaten-umrechner.de/decimal/52.520832,13.409430?karte=OpenStreetMap&zoom=19
91 * Degree Minutes 52° 31.2499 and 13° 24.5658
92 * Decimal Degree 52.520832 and 13.409430
93 * ++++++++++++++++++++++++++++++++
95 // Degree Minutes as Integer -> 52312499
96 void send_f1675_gps(uint8_t port, uint16_t speed, int16_t hight, int16_t vario, int32_t latitude, int32_t longitude);
97 // Degree Minutes as Integer -> 52 and 312499
98 void send_F1675min(uint8_t port, uint16_t speed, int16_t hight, int16_t vario, int8_t lat_deg, int32_t lat_min, int8_t lon_deg, int32_t lon_min);
99 // Degree Minutes as Float -> 52 and 31.2499
100 void send_F1675minf(uint8_t port, uint16_t speed, int16_t hight, int16_t vario, int8_t lat_deg, float lat_min, int8_t lon_deg, float lon_min);
101 // Decimal Degrees as Float -> 52.520832
102 void send_F1675f(uint8_t port, uint16_t speed, int16_t hight, int16_t vario, float latitude, float longitude);
103 // Decimal Degrees as Integer -> 52520832
104 void send_F1675(uint8_t port, uint16_t speed, int16_t hight, int16_t vario, int32_t latitude, int32_t longitude);
105 void send_SBS10G(uint8_t port, uint16_t hours, uint16_t minutes, uint16_t seconds, float latitude, float longitude, float altitudeMeters, uint16_t speed, float gpsVario);
108 * ++++++++++++++++++++++++++++++++
109 * ESC Sensors
110 * Note These sensors only exists on the newer Futaba Radios 18SZ, 16IZ, etc
111 * ++++++++++++++++++++++++++++++++
114 void send_kontronik(uint8_t port, uint16_t voltage, uint16_t capacity, uint32_t rpm, uint16_t current, uint16_t temp, uint16_t becTemp, uint16_t becCurrent, uint16_t pwm);
115 void send_scorpion(uint8_t port, uint16_t voltage, uint16_t capacity, uint32_t rpm, uint16_t current, uint16_t temp, uint16_t becTemp, uint16_t becCurrent, uint16_t pwm);
117 void send_jetcat(uint8_t port, uint32_t rpm, uint16_t egt, uint16_t pump_volt, uint32_t setrpm, uint16_t thrust, uint16_t fuel, uint16_t fuelflow, uint16_t altitude, uint16_t quality, uint16_t volt, uint16_t current, uint16_t speed, uint16_t status, uint32_t secondrpm);
119 void SBUS2_transmit_telemetry_data(uint8_t slotId , const uint8_t *bytes);
121 #endif