summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorStefan Kerkmann <karlk90@pm.me>2021-07-02 00:24:08 +0200
committerGitHub <noreply@github.com>2021-07-02 08:24:08 +1000
commit117bff17ba89a70dd85163b499c262b879f52afd (patch)
tree055d7704c28711bd3c30ba8f55a2b3524395578b /docs
parent47b12470e762732638a79e6752069564d6fb9649 (diff)
[Core] Unite half-duplex and full-duplex serial drivers (#13081)
* Unite half-duplex and full-duplex serial driver. * Add full duplex operation mode to the interrupt based driver * Delete DMA UART based full duplex driver * The new driver targets #11930 * Fix freezes with failing transactions in half-duplex * Increase default serial TX/RX buffer size to 128 bytes * Correctly use bool instead of size_t Co-authored-by: Nick Brassel <nick@tzarc.org>
Diffstat (limited to 'docs')
-rw-r--r--docs/serial_driver.md15
1 files changed, 8 insertions, 7 deletions
diff --git a/docs/serial_driver.md b/docs/serial_driver.md
index 359fc59551..ed989b0a15 100644
--- a/docs/serial_driver.md
+++ b/docs/serial_driver.md
@@ -73,7 +73,7 @@ You must also enable the ChibiOS `SERIAL` feature:
Do note that the configuration required is for the `SERIAL` peripheral, not the `UART` peripheral.
### USART Full-duplex
-Targeting STM32 boards where communication is offloaded to a USART hardware device. The advantage over bitbang is that this provides fast and accurate timings. USART Full-Duplex requires two conductors **without** pull-up resistors instead of one conductor with a pull-up resistor unlike the Half-duplex driver, but it is more efficent as it uses DMA transfers, which can result in even faster transmission speeds.
+Targeting STM32 boards where communication is offloaded to a USART hardware device. The advantage over bitbang is that this provides fast and accurate timings. USART Full-Duplex requires two conductors **without** pull-up resistors instead of one conductor with a pull-up resistor unlike the Half-duplex driver. Due to its internal design it is more efficent, which can result in even faster transmission speeds.
#### Pin configuration
@@ -86,12 +86,13 @@ Please note that `TX` of the master half has to be connected with the `RX` pin o
To use the driver, add this to your rules.mk:
```make
-SERIAL_DRIVER = usart_duplex
+SERIAL_DRIVER = usart
```
Next configure the hardware via your config.h:
```c
+#define SERIAL_USART_FULL_DUPLEX // Enable full duplex operation mode.
#define SERIAL_USART_TX_PIN B6 // USART TX pin
#define SERIAL_USART_RX_PIN B7 // USART RX pin
//#define USART1_REMAP // Remap USART TX and RX pins on STM32F103 MCUs, see table below.
@@ -104,17 +105,17 @@ Next configure the hardware via your config.h:
// 3: 57600 baud
// 4: 38400 baud
// 5: 19200 baud
-#define SERIAL_USART_DRIVER UARTD1 // USART driver of TX and RX pin. default: UARTD1
+#define SERIAL_USART_DRIVER SD1 // USART driver of TX and RX pin. default: SD1
#define SERIAL_USART_TX_PAL_MODE 7 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 7
#define SERIAL_USART_RX_PAL_MODE 7 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 7
#define SERIAL_USART_TIMEOUT 100 // USART driver timeout. default 100
```
-You must also enable the ChibiOS `UART` with blocking api feature:
-* In your board's halconf.h: `#define HAL_USE_UART TRUE` and `#define UART_USE_WAIT TRUE`
-* In your board's mcuconf.h: `#define STM32_UART_USE_USARTn TRUE` (where 'n' matches the peripheral number of your selected USART on the MCU)
+You must also enable the ChibiOS `SERIAL` feature:
+* In your board's halconf.h: `#define HAL_USE_SERIAL TRUE`
+* In your board's mcuconf.h: `#define STM32_SERIAL_USE_USARTn TRUE` (where 'n' matches the peripheral number of your selected USART on the MCU)
-Do note that the configuration required is for the `UART` peripheral, not the `SERIAL` peripheral.
+Do note that the configuration required is for the `SERIAL` peripheral, not the `UART` peripheral.
#### Pins for USART Peripherals with Alternate Functions for selected STM32 MCUs