stm32: serial use 115200 baud rate

115200 is a much more sane "default" than 38400.
Instead of a mix of 38400 and 115200, just use 115200 in all places.
There's no reason for modern 32bit cpus to be using such old slow
baudrates.

Tested on f1, f4, l1.  Replaced some old f1 code that predated some
library support code for this.
This commit is contained in:
Karl Palsson
2019-06-02 16:08:13 +00:00
parent e0f377fec0
commit be1d296e2f
32 changed files with 37 additions and 45 deletions

View File

@@ -8,4 +8,4 @@ ADC\_IN1 input, and prints it to the serial port.
| Port | Function | Description |
| ----- | ----------- | --------------------------------- |
| `PA1` | `(ADC_IN1)` | Analog input |
| `PA9` | `(USART1)` | TTL serial output `(38400,8,N,1)` |
| `PA9` | `(USART1)` | TTL serial output `(115200,8,N,1)` |

View File

@@ -68,7 +68,7 @@ static void usart_setup(void)
gpio_set_af(GPIOA, GPIO_AF1, GPIO9);
/* Setup UART parameters. */
usart_set_baudrate(USART1, 38400);
usart_set_baudrate(USART1, 115200);
usart_set_databits(USART1, 8);
usart_set_stopbits(USART1, USART_CR2_STOPBITS_1);
usart_set_mode(USART1, USART_MODE_TX);

View File

@@ -9,4 +9,4 @@ The sending is done in a blocking way.
| Port | Function | Description |
| ----- | ------------- | --------------------------------- |
| `PA9` | `(USART1_TX)` | TTL serial output `(38400,8,N,1)` |
| `PA9` | `(USART1_TX)` | TTL serial output `(115200,8,N,1)` |

View File

@@ -35,7 +35,7 @@ static void clock_setup(void)
static void usart_setup(void)
{
/* Setup USART2 parameters. */
usart_set_baudrate(USART1, 38400);
usart_set_baudrate(USART1, 115200);
usart_set_databits(USART1, 8);
usart_set_parity(USART1, USART_PARITY_NONE);
usart_set_stopbits(USART1, USART_CR2_STOPBITS_1);

View File

@@ -9,4 +9,4 @@ The sending is done using newlib library in a blocking way.
| Port | Function | Description |
| ----- | ------------- | --------------------------------- |
| `PA9` | `(USART1_TX)` | TTL serial output `(38400,8,N,1)` |
| `PA9` | `(USART1_TX)` | TTL serial output `(115200,8,N,1)` |

View File

@@ -55,7 +55,7 @@ static ssize_t _iowr(void *_cookie, const char *_buf, size_t _n)
static FILE *usart_setup(uint32_t dev)
{
/* Setup USART2 parameters. */
usart_set_baudrate(dev, 38400);
usart_set_baudrate(dev, 115200);
usart_set_databits(dev, 8);
usart_set_parity(dev, USART_PARITY_NONE);
usart_set_stopbits(dev, USART_CR2_STOPBITS_1);