Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Ardupilot
GitHub Repository: Ardupilot/ardupilot
Path: blob/master/Tools/AP_Periph/serial_options_dev.cpp
9389 views
1
/*
2
This program is free software: you can redistribute it and/or modify
3
it under the terms of the GNU General Public License as published by
4
the Free Software Foundation, either version 3 of the License, or
5
(at your option) any later version.
6
7
This program is distributed in the hope that it will be useful,
8
but WITHOUT ANY WARRANTY; without even the implied warranty of
9
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
GNU General Public License for more details.
11
12
You should have received a copy of the GNU General Public License
13
along with this program. If not, see <http://www.gnu.org/licenses/>.
14
*/
15
/*
16
serial options support, for serial over DroneCAN
17
*/
18
19
#include "AP_Periph.h"
20
21
#if AP_PERIPH_SERIAL_OPTIONS_ENABLED
22
23
#include "serial_options.h"
24
25
SerialOptionsDev::SerialOptionsDev(void)
26
{
27
AP_Param::setup_object_defaults(this, var_info);
28
}
29
30
const AP_Param::GroupInfo SerialOptionsDev::var_info[] {
31
32
// @Param: OPTIONS
33
// @DisplayName: Serial options
34
// @Description: Control over UART options. The InvertRX option controls invert of the receive pin. The InvertTX option controls invert of the transmit pin. The HalfDuplex option controls half-duplex (onewire) mode, where both transmit and receive is done on the transmit wire. The Swap option allows the RX and TX pins to be swapped on STM32F7 based boards.
35
// @Bitmask: 0:InvertRX, 1:InvertTX, 2:HalfDuplex, 3:SwapTXRX, 4: RX_PullDown, 5: RX_PullUp, 6: TX_PullDown, 7: TX_PullUp, 8: RX_NoDMA, 9: TX_NoDMA, 10: Don't forward mavlink to/from, 11: DisableFIFO, 12: Ignore Streamrate
36
AP_GROUPINFO("OPTIONS", 1, SerialOptionsDev, options, 0),
37
38
// @Param: RTSCTS
39
// @DisplayName: Serial1 flow control
40
// @Description: Enable flow control. You must have the RTS and CTS pins available on the port. If this is set to 2 then flow control will be auto-detected by checking for the output buffer filling on startup.
41
// @Values: 0:Disabled,1:Enabled,2:Auto
42
AP_GROUPINFO("RTSCTS", 2, SerialOptionsDev, rtscts, float(AP_HAL::UARTDriver::FLOW_CONTROL_DISABLE)),
43
44
AP_GROUPEND
45
};
46
47
#endif // AP_PERIPH_SERIAL_OPTIONS_ENABLED
48
49