Add 31250 baud rate for MIDI support (#1690)

* add 31250 baud rate for MIDI support
* add bitrate to uart_bitrates array for the get operation
This commit is contained in:
Verne Roberts 2017-01-05 00:31:47 +13:00 committed by Marcel Stör
parent 0a0c7c0637
commit cad1632e40
3 changed files with 4 additions and 1 deletions

View File

@ -41,6 +41,7 @@ typedef enum {
BIT_RATE_4800 = 4800, BIT_RATE_4800 = 4800,
BIT_RATE_9600 = 9600, BIT_RATE_9600 = 9600,
BIT_RATE_19200 = 19200, BIT_RATE_19200 = 19200,
BIT_RATE_31250 = 31250,
BIT_RATE_38400 = 38400, BIT_RATE_38400 = 38400,
BIT_RATE_57600 = 57600, BIT_RATE_57600 = 57600,
BIT_RATE_74880 = 74880, BIT_RATE_74880 = 74880,

View File

@ -40,6 +40,7 @@ static const int uart_bitrates[] = {
BIT_RATE_4800, BIT_RATE_4800,
BIT_RATE_9600, BIT_RATE_9600,
BIT_RATE_19200, BIT_RATE_19200,
BIT_RATE_31250,
BIT_RATE_38400, BIT_RATE_38400,
BIT_RATE_57600, BIT_RATE_57600,
BIT_RATE_74880, BIT_RATE_74880,
@ -361,6 +362,7 @@ uint32_t platform_uart_setup( unsigned id, uint32_t baud, int databits, int pari
case BIT_RATE_4800: case BIT_RATE_4800:
case BIT_RATE_9600: case BIT_RATE_9600:
case BIT_RATE_19200: case BIT_RATE_19200:
case BIT_RATE_31250:
case BIT_RATE_38400: case BIT_RATE_38400:
case BIT_RATE_57600: case BIT_RATE_57600:
case BIT_RATE_74880: case BIT_RATE_74880:

View File

@ -74,7 +74,7 @@ end, 0)
#### Parameters #### Parameters
- `id` always zero, only one uart supported - `id` always zero, only one uart supported
- `baud` one of 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 74880, 115200, 230400, 256000, 460800, 921600, 1843200, 3686400 - `baud` one of 300, 600, 1200, 2400, 4800, 9600, 19200, 31250, 38400, 57600, 74880, 115200, 230400, 256000, 460800, 921600, 1843200, 3686400
- `databits` one of 5, 6, 7, 8 - `databits` one of 5, 6, 7, 8
- `parity` `uart.PARITY_NONE`, `uart.PARITY_ODD`, or `uart.PARITY_EVEN` - `parity` `uart.PARITY_NONE`, `uart.PARITY_ODD`, or `uart.PARITY_EVEN`
- `stopbits` `uart.STOPBITS_1`, `uart.STOPBITS_1_5`, or `uart.STOPBITS_2` - `stopbits` `uart.STOPBITS_1`, `uart.STOPBITS_1_5`, or `uart.STOPBITS_2`