1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-25 09:16:07 +03:00

Support UART3 and I2C on Paris Air Hero 32 Flex port (aka Naze32_SP).

This change also allows serial ports to be removed at runtime.  e.g.
UART3 on Naze32 and SoftSerial 1 & 2 when softserial is not enabled.
This commit is contained in:
Dominic Clifton 2015-05-22 20:48:39 +01:00
parent f2013ab863
commit a370d60595
5 changed files with 92 additions and 18 deletions

View file

@ -46,7 +46,7 @@ typedef enum {
BAUD_250000,
} baudRate_e;
extern uint32_t baudRates[];
extern const uint32_t const baudRates[];
// serial port identifiers are now fixed, these values are used by MSP commands.
typedef enum {
@ -61,7 +61,7 @@ typedef enum {
SERIAL_PORT_IDENTIFIER_MAX = SERIAL_PORT_SOFTSERIAL2
} serialPortIdentifier_e;
extern serialPortIdentifier_e serialPortIdentifiers[SERIAL_PORT_COUNT];
extern const serialPortIdentifier_e const serialPortIdentifiers[SERIAL_PORT_COUNT];
//
// runtime
@ -96,7 +96,11 @@ typedef struct serialConfig_s {
//
// configuration
//
void serialRemovePort(serialPortIdentifier_e identifier);
uint8_t serialGetAvailablePortCount(void);
bool serialIsPortAvailable(serialPortIdentifier_e identifier);
bool isSerialConfigValid(serialConfig_t *serialConfig);
serialPortConfig_t *serialFindPortConfiguration(serialPortIdentifier_e identifier);
bool doesConfigurationUsePort(serialPortIdentifier_e portIdentifier);
serialPortConfig_t *findSerialPortConfig(serialPortFunction_e function);
serialPortConfig_t *findNextSerialPortConfig(serialPortFunction_e function);
@ -123,6 +127,7 @@ void waitForSerialPortToFinishTransmitting(serialPort_t *serialPort);
baudRate_e lookupBaudRateIndex(uint32_t baudRate);
//
// msp/cli/bootloader
//