AP_SerialManager: added a new MSP DisplayPort serial backend

This commit is contained in:
yaapu 2021-07-02 11:21:39 +02:00 committed by Andrew Tridgell
parent 7f6fbe72e6
commit c1e50dc676
2 changed files with 6 additions and 4 deletions

View File

@ -524,6 +524,7 @@ void AP_SerialManager::init()
#if HAL_MSP_ENABLED
case SerialProtocol_MSP:
case SerialProtocol_DJI_FPV:
case SerialProtocol_MSP_DisplayPort:
// baudrate defaults to 115200
state[i].baud.set_default(AP_SERIALMANAGER_MSP_BAUD/1000);
uart->begin(map_baudrate(state[i].baud),

View File

@ -155,6 +155,7 @@ public:
SerialProtocol_Torqeedo = 39,
SerialProtocol_AIS = 40,
SerialProtocol_CoDevESC = 41,
SerialProtocol_MSP_DisplayPort = 42,
SerialProtocol_NumProtocols // must be the last value
};
@ -162,7 +163,7 @@ public:
static AP_SerialManager *get_singleton(void) {
return _singleton;
}
// init_console - initialise console at default baud rate
void init_console();
@ -181,7 +182,7 @@ public:
// find_portnum - find port number (SERIALn index) for a protocol and instance, -1 for not found
int8_t find_portnum(enum SerialProtocol protocol, uint8_t instance) const;
// get_mavlink_channel - provides the mavlink channel associated with a given protocol (and instance)
// instance should be zero if searching for the first instance, 1 for the second, etc
// returns true if a channel is found, false if not
@ -193,7 +194,7 @@ public:
// get_mavlink_protocol - provides the specific MAVLink protocol for a
// given channel, or SerialProtocol_None if not found
SerialProtocol get_mavlink_protocol(mavlink_channel_t mav_chan) const;
// set_blocking_writes_all - sets block_writes on or off for all serial channels
void set_blocking_writes_all(bool blocking);
@ -217,7 +218,7 @@ public:
private:
static AP_SerialManager *_singleton;
// array of uart info
struct UARTState {
AP_Int8 protocol;