diff options
Diffstat (limited to 'docs/serial_driver.md')
-rw-r--r-- | docs/serial_driver.md | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/docs/serial_driver.md b/docs/serial_driver.md index 359fc5955..ed989b0a1 100644 --- a/docs/serial_driver.md +++ b/docs/serial_driver.md | |||
@@ -73,7 +73,7 @@ You must also enable the ChibiOS `SERIAL` feature: | |||
73 | Do note that the configuration required is for the `SERIAL` peripheral, not the `UART` peripheral. | 73 | Do note that the configuration required is for the `SERIAL` peripheral, not the `UART` peripheral. |
74 | 74 | ||
75 | ### USART Full-duplex | 75 | ### USART Full-duplex |
76 | 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. | 76 | 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. |
77 | 77 | ||
78 | #### Pin configuration | 78 | #### Pin configuration |
79 | 79 | ||
@@ -86,12 +86,13 @@ Please note that `TX` of the master half has to be connected with the `RX` pin o | |||
86 | To use the driver, add this to your rules.mk: | 86 | To use the driver, add this to your rules.mk: |
87 | 87 | ||
88 | ```make | 88 | ```make |
89 | SERIAL_DRIVER = usart_duplex | 89 | SERIAL_DRIVER = usart |
90 | ``` | 90 | ``` |
91 | 91 | ||
92 | Next configure the hardware via your config.h: | 92 | Next configure the hardware via your config.h: |
93 | 93 | ||
94 | ```c | 94 | ```c |
95 | #define SERIAL_USART_FULL_DUPLEX // Enable full duplex operation mode. | ||
95 | #define SERIAL_USART_TX_PIN B6 // USART TX pin | 96 | #define SERIAL_USART_TX_PIN B6 // USART TX pin |
96 | #define SERIAL_USART_RX_PIN B7 // USART RX pin | 97 | #define SERIAL_USART_RX_PIN B7 // USART RX pin |
97 | //#define USART1_REMAP // Remap USART TX and RX pins on STM32F103 MCUs, see table below. | 98 | //#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: | |||
104 | // 3: 57600 baud | 105 | // 3: 57600 baud |
105 | // 4: 38400 baud | 106 | // 4: 38400 baud |
106 | // 5: 19200 baud | 107 | // 5: 19200 baud |
107 | #define SERIAL_USART_DRIVER UARTD1 // USART driver of TX and RX pin. default: UARTD1 | 108 | #define SERIAL_USART_DRIVER SD1 // USART driver of TX and RX pin. default: SD1 |
108 | #define SERIAL_USART_TX_PAL_MODE 7 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 7 | 109 | #define SERIAL_USART_TX_PAL_MODE 7 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 7 |
109 | #define SERIAL_USART_RX_PAL_MODE 7 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 7 | 110 | #define SERIAL_USART_RX_PAL_MODE 7 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 7 |
110 | #define SERIAL_USART_TIMEOUT 100 // USART driver timeout. default 100 | 111 | #define SERIAL_USART_TIMEOUT 100 // USART driver timeout. default 100 |
111 | ``` | 112 | ``` |
112 | 113 | ||
113 | You must also enable the ChibiOS `UART` with blocking api feature: | 114 | You must also enable the ChibiOS `SERIAL` feature: |
114 | * In your board's halconf.h: `#define HAL_USE_UART TRUE` and `#define UART_USE_WAIT TRUE` | 115 | * In your board's halconf.h: `#define HAL_USE_SERIAL TRUE` |
115 | * 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) | 116 | * 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) |
116 | 117 | ||
117 | Do note that the configuration required is for the `UART` peripheral, not the `SERIAL` peripheral. | 118 | Do note that the configuration required is for the `SERIAL` peripheral, not the `UART` peripheral. |
118 | 119 | ||
119 | #### Pins for USART Peripherals with Alternate Functions for selected STM32 MCUs | 120 | #### Pins for USART Peripherals with Alternate Functions for selected STM32 MCUs |
120 | 121 | ||