Skip to content

Commit

Permalink
Add support for additional baud rates
Browse files Browse the repository at this point in the history
  • Loading branch information
SMorettini committed Aug 18, 2023
1 parent 99420c9 commit ed966a5
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
24 changes: 24 additions & 0 deletions Drv/LinuxUartDriver/LinuxUartDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,30 @@ bool LinuxUartDriver::open(const char* const device,
case BAUD_921K:
relayRate = B921600;
break;
case BAUD_1000K:
relayRate = B1000000;
break;
case BAUD_1152K:
relayRate = B1152000;
break;
case BAUD_1500K:
relayRate = B1500000;
break;
case BAUD_2000K:
relayRate = B2000000;
break;
case BAUD_2500K:
relayRate = B2500000;
break;
case BAUD_3000K:
relayRate = B3000000;
break;
case BAUD_3500K:
relayRate = B3500000;
break;
case BAUD_4000K:
relayRate = B4000000;
break;
#endif
default:
FW_ASSERT(0, baud);
Expand Down
19 changes: 18 additions & 1 deletion Drv/LinuxUartDriver/LinuxUartDriver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,24 @@ class LinuxUartDriver : public LinuxUartDriverComponentBase {
);

//! Configure UART parameters
enum UartBaudRate { BAUD_9600=9600, BAUD_19200=19200, BAUD_38400=38400, BAUD_57600=57600, BAUD_115K=115200, BAUD_230K=230400, BAUD_460K=460800, BAUD_921K=921600};
enum UartBaudRate {
BAUD_9600=9600,
BAUD_19200=19200,
BAUD_38400=38400,
BAUD_57600=57600,
BAUD_115K=115200,
BAUD_230K=230400,
BAUD_460K=460800,
BAUD_921K=921600,
BAUD_1000K=1000000000,
BAUD_1152K=1152000000,
BAUD_1500K=1500000000,
BAUD_2000K=2000000000,
BAUD_2500K=2500000000,
BAUD_3000K=3000000000,
BAUD_3500K=3500000000,
BAUD_4000K=4000000000
};

enum UartFlowControl { NO_FLOW, HW_FLOW };

Expand Down

0 comments on commit ed966a5

Please sign in to comment.