Browse Source

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
Verne Roberts 7 years ago
parent
commit
cad1632e40
3 changed files with 4 additions and 1 deletions
  1. 1 0
      app/include/driver/uart.h
  2. 2 0
      app/platform/platform.c
  3. 1 1
      docs/en/modules/uart.md

+ 1 - 0
app/include/driver/uart.h

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

+ 2 - 0
app/platform/platform.c

@@ -40,6 +40,7 @@ static const int uart_bitrates[] = {
     BIT_RATE_4800,
     BIT_RATE_9600,
     BIT_RATE_19200,
+    BIT_RATE_31250,
     BIT_RATE_38400,
     BIT_RATE_57600,
     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_9600:
     case BIT_RATE_19200:
+    case BIT_RATE_31250:
     case BIT_RATE_38400:
     case BIT_RATE_57600:
     case BIT_RATE_74880:

+ 1 - 1
docs/en/modules/uart.md

@@ -74,7 +74,7 @@ end, 0)
 
 #### Parameters
 - `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
 - `parity` `uart.PARITY_NONE`, `uart.PARITY_ODD`, or `uart.PARITY_EVEN`
 - `stopbits` `uart.STOPBITS_1`, `uart.STOPBITS_1_5`, or `uart.STOPBITS_2`