mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-15 04:15:38 +03:00
There's a number of changes in this commit, all related. Improved efficiency of preparing HoTT messages. All HoTT message data is no-longer reset each time, going forward old data is re-used unless it is updated. This should help with GPS co-ordinates too since they were erased from subsequent responses when ideally the last-known co-ordinates should be transmitted each time. The previous update was sending one too many bytes due to the aligned/padded uint16_t values in the HoTT data structures. There were two solutions, use #pragma to pack the structure or avoid larger types in the structures, the latter made sense and results in more portable code since it's a wire format. Updated HoTT structures to use latest message structure from Ardupilot. Currently the variables are in underscore_format, that will likely change in future. Cleaned up and deleted old ported code that was #ifdef'd out. Some test code still remains for now. This will be deleted in due course. Introduced bitmask for EAM alarm flags. Corrected documentation.
155 lines
3.3 KiB
Markdown
155 lines
3.3 KiB
Markdown
## Serial port functions and scenarios
|
|
|
|
### Serial port scenarios
|
|
|
|
```
|
|
0 UNUSED
|
|
1 MSP, CLI, TELEMETRY, GPS-PASTHROUGH
|
|
2 GPS ONLY
|
|
3 RX SERIAL ONLY
|
|
4 TELEMETRY ONLY
|
|
5 MSP, CLI, GPS-PASTHROUGH
|
|
6 CLI ONLY
|
|
7 GPS-PASSTHROUGH ONLY
|
|
8 MSP ONLY
|
|
```
|
|
|
|
### Contraints
|
|
|
|
* There must always be a port available to use for MSP
|
|
* There must always be a port available to use for CLI
|
|
* To use a port for a function, the function's corresponding feature must be enabled first.
|
|
e.g. to use GPS enable the GPS feature.
|
|
* If the configuration is invalid the serial port configuration will reset to it's defaults and features may be disabled.
|
|
|
|
### Examples
|
|
|
|
All examples assume default configuration (via cli `defaults` command)
|
|
|
|
a) GPS and FrSky TELEMETRY (when armed)
|
|
|
|
- TELEMETRY,MSP,CLI,GPS PASSTHROUGH on UART1
|
|
- GPS on UART2
|
|
|
|
```
|
|
feature TELEMETRY
|
|
feature GPS
|
|
save
|
|
```
|
|
|
|
b) RX SERIAL and FrSky TELEMETRY (when armed)
|
|
|
|
- TELEMETRY,MSP,CLI,GPS PASSTHROUGH on UART1
|
|
- RX SERIAL on UART2
|
|
|
|
```
|
|
feature -RX_PARALLEL_PWM
|
|
feature RX_SERIAL
|
|
feature TELEMETRY
|
|
set serial_port_2_scenario = 3
|
|
save
|
|
```
|
|
|
|
b) RX SERIAL and FrSky TELEMETRY via softserial
|
|
|
|
- MSP,CLI,GPS PASSTHROUGH on UART1
|
|
- RX SERIAL on UART2
|
|
- TELEMETRY on SOFTSERIAL1
|
|
|
|
```
|
|
feature -RX_PARALLEL_PWM
|
|
feature RX_SERIAL
|
|
feature TELEMETRY
|
|
feature SOFTSERIAL
|
|
set serial_port_2_scenario = 3
|
|
set serial_port_3_scenario = 4
|
|
save
|
|
```
|
|
|
|
c) GPS and FrSky TELEMETRY via softserial
|
|
|
|
- MSP,CLI,GPS PASSTHROUGH on UART1
|
|
- GPS on UART2
|
|
- TELEMETRY on SOFTSERIAL1
|
|
|
|
```
|
|
feature -RX_PARALLEL_PWM
|
|
feature RX_PPM
|
|
feature TELEMETRY
|
|
feature GPS
|
|
feature SOFTSERIAL
|
|
set serial_port_3_scenario = 4
|
|
save
|
|
```
|
|
d) RX SERIAL, GPS and TELEMETRY (when armed) MSP/CLI via softserial
|
|
|
|
- GPS on UART1
|
|
- RX SERIAL on UART2
|
|
- TELEMETRY,MSP,CLI,GPS PASSTHROUGH on SOFTSERIAL1
|
|
|
|
```
|
|
feature -RX_PARALLEL_PWM
|
|
feature TELEMETRY
|
|
feature GPS
|
|
feature RX_SERIAL
|
|
feature SOFTSERIAL
|
|
set serial_port_1_scenario = 2
|
|
set serial_port_2_scenario = 3
|
|
set serial_port_3_scenario = 1
|
|
set msp_baudrate = 19200
|
|
set cli_baudrate = 19200
|
|
set gps_passthrough_baudrate = 19200
|
|
save
|
|
```
|
|
|
|
e) HoTT Telemetry via UART2
|
|
|
|
- MSP,CLI,GPS PASSTHROUGH on UART1
|
|
- HoTT telemetry on UART2
|
|
|
|
```
|
|
feature -RX_PARALLEL_PWM
|
|
feature RX_PPM
|
|
feature TELEMETRY
|
|
set serial_port_2_scenario = 4
|
|
set telemetry_provider = 1
|
|
```
|
|
|
|
f) GPS, HoTT Telemetry via SoftSerial 1
|
|
|
|
- MSP,CLI,GPS PASSTHROUGH on UART1
|
|
- GPS on UART2
|
|
- HoTT telemetry on SOFTSERIAL1
|
|
|
|
```
|
|
feature -RX_PARALLEL_PWM
|
|
feature RX_PPM
|
|
feature TELEMETRY
|
|
feature GPS
|
|
feature SOFTSERIAL
|
|
set serial_port_3_scenario = 4
|
|
set telemetry_provider = 1
|
|
save
|
|
```
|
|
|
|
## CLI command differences from baseflight
|
|
|
|
### gps_type
|
|
reason: renamed to `gps_provider` for consistency
|
|
|
|
### serialrx_type
|
|
reason: renamed to `serialrx_provider` for consistency
|
|
|
|
### rssi_aux_channel
|
|
reason: improved functionality
|
|
|
|
Cleanflight supports using any RX channel for rssi. Baseflight only supports AUX1 to 4.
|
|
|
|
In Cleanflight a value of 0 disables the feature, a higher value indicates the channel number to read RSSI information from.
|
|
|
|
Example, to use RSSI on AUX1 in Cleanflight set the value to 5, since 5 is the first AUX channel.
|
|
|
|
### failsafe_detect_threshold
|
|
reason: improved functionality
|
|
|
|
See failsafe_min_usec and failsafe_max_usec in Failsafe documentation.
|