summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorStefan Kerkmann <karlk90@pm.me>2024-02-20 11:34:24 +0100
committerGitHub <noreply@github.com>2024-02-20 11:34:24 +0100
commit61fa6949fbb537f54d48a4fc0218ff2b6873e940 (patch)
tree400f8f4920888097c0e22c68cb5fa742b0e340c8 /docs
parent865a8f42a6128dfc09a24fe749b0d78d8c69b70e (diff)
[Core] Allow ChibiOS `SIO` driver for `UART` driver (#22839)
* onekey: stm32f3_disco: add usart pins and activate peripheral Signed-off-by: Stefan Kerkmann <karlk90@pm.me> * chibios: uart: change SD1 prefix to UART Signed-off-by: Stefan Kerkmann <karlk90@pm.me> * chibios: uart: add SIO driver and RP2040 compatibility Signed-off-by: Stefan Kerkmann <karlk90@pm.me> Co-authored-by: Sergey Vlasov <sigprof@gmail.com> * Update platforms/chibios/drivers/uart.h Co-authored-by: Joel Challis <git@zvecr.com> --------- Signed-off-by: Stefan Kerkmann <karlk90@pm.me> Co-authored-by: Sergey Vlasov <sigprof@gmail.com> Co-authored-by: Joel Challis <git@zvecr.com>
Diffstat (limited to 'docs')
-rw-r--r--docs/platformdev_rp2040.md15
-rw-r--r--docs/uart_driver.md30
2 files changed, 25 insertions, 20 deletions
diff --git a/docs/platformdev_rp2040.md b/docs/platformdev_rp2040.md
index 890dadb6f0..593a8198eb 100644
--- a/docs/platformdev_rp2040.md
+++ b/docs/platformdev_rp2040.md
@@ -2,7 +2,7 @@
The following table shows the current driver status for peripherals on RP2040 MCUs:
-| System | Support |
+| System | Support |
| ---------------------------------------------------------------- | ---------------------------------------------- |
| [ADC driver](adc_driver.md) | :heavy_check_mark: |
| [Audio](audio_driver.md#pwm-hardware) | :heavy_check_mark: |
@@ -13,7 +13,7 @@ The following table shows the current driver status for peripherals on RP2040 MC
| [External EEPROMs](eeprom_driver.md) | :heavy_check_mark: using `I2C` or `SPI` driver |
| [EEPROM emulation](eeprom_driver.md#wear_leveling-configuration) | :heavy_check_mark: |
| [serial driver](serial_driver.md) | :heavy_check_mark: using `SIO` or `PIO` driver |
-| [UART driver](uart_driver.md) | Support planned (no ETA) |
+| [UART driver](uart_driver.md) | :heavy_check_mark: using `SIO` driver |
## GPIO
@@ -52,6 +52,13 @@ To configure the I2C driver please read the [ChibiOS/ARM](i2c_driver.md#arm-conf
To configure the SPI driver please read the [ChibiOS/ARM](spi_driver.md#chibiosarm-configuration) section.
+### UART Driver
+
+| RP2040 Peripheral | `mcuconf.h` values | `UART_DRIVER` |
+| ----------------- | ------------------ | ------------- |
+| `UART0` | `RP_SIO_USE_UART0` | `SIOD0` |
+| `UART1` | `RP_SIO_USE_UART1` | `SIOD1` |
+
## Double-tap reset boot-loader entry :id=double-tap
The double-tap reset mechanism is an alternate way in QMK to enter the embedded mass storage UF2 boot-loader of the RP2040. It enables bootloader entry by a fast double-tap of the reset pin on start up, which is similar to the behavior of AVR Pro Micros. This feature activated by default for the Pro Micro RP2040 board, but has to be configured for other boards. To activate it, add the following options to your keyboards `config.h` file:
@@ -87,6 +94,10 @@ This is the default board that is chosen, unless any other RP2040 board is selec
| `SOFT_SERIAL_PIN` | undefined, use `SERIAL_USART_TX_PIN` |
| `SERIAL_USART_TX_PIN` | `GP0` |
| `SERIAL_USART_RX_PIN` | `GP1` |
+| **UART driver** | |
+| `UART_DRIVER` | `SIOD0` |
+| `UART_TX_PIN` | `GP0` |
+| `UART_RX_PIN` | `GP1` |
?> The pin-outs of Adafruit's KB2040 and Boardsource's Blok both deviate from the Sparkfun Pro Micro RP2040. Lookup the pin-out of these boards and adjust your keyboards pin definition accordingly if you want to use these boards.
diff --git a/docs/uart_driver.md b/docs/uart_driver.md
index a88278d543..9b0a92d23d 100644
--- a/docs/uart_driver.md
+++ b/docs/uart_driver.md
@@ -32,13 +32,7 @@ No special setup is required - just connect the `RX` and `TX` pins of your UART
You'll need to determine which pins can be used for UART -- as an example, STM32 parts generally have multiple UART peripherals, labeled USART1, USART2, USART3 etc.
-To enable UART, modify your board's `halconf.h` to enable the serial driver:
-
-```c
-#define HAL_USE_SERIAL TRUE
-```
-
-Then, modify your board's `mcuconf.h` to enable the peripheral you've chosen, for example:
+To enable UART, modify your board's `mcuconf.h` to enable the peripheral you've chosen, for example:
```c
#undef STM32_SERIAL_USE_USART2
@@ -47,17 +41,17 @@ Then, modify your board's `mcuconf.h` to enable the peripheral you've chosen, fo
Configuration-wise, you'll need to set up the peripheral as per your MCU's datasheet -- the defaults match the pins for a Proton-C, i.e. STM32F303.
-|`config.h` override |Description |Default Value|
-|--------------------------|---------------------------------------------------------------|-------------|
-|`#define SERIAL_DRIVER` |USART peripheral to use - USART1 -> `SD1`, USART2 -> `SD2` etc.|`SD1` |
-|`#define SD1_TX_PIN` |The pin to use for TX |`A9` |
-|`#define SD1_TX_PAL_MODE` |The alternate function mode for TX |`7` |
-|`#define SD1_RX_PIN` |The pin to use for RX |`A10` |
-|`#define SD1_RX_PAL_MODE` |The alternate function mode for RX |`7` |
-|`#define SD1_CTS_PIN` |The pin to use for CTS |`A11` |
-|`#define SD1_CTS_PAL_MODE`|The alternate function mode for CTS |`7` |
-|`#define SD1_RTS_PIN` |The pin to use for RTS |`A12` |
-|`#define SD1_RTS_PAL_MODE`|The alternate function mode for RTS |`7` |
+| `config.h` override | Description | Default Value |
+| --------------------------- | --------------------------------------------------------------- | ------------- |
+| `#define UART_DRIVER` | USART peripheral to use - USART1 -> `SD1`, USART2 -> `SD2` etc. | `SD1` |
+| `#define UART_TX_PIN` | The pin to use for TX | `A9` |
+| `#define UART_TX_PAL_MODE` | The alternate function mode for TX | `7` |
+| `#define UART_RX_PIN` | The pin to use for RX | `A10` |
+| `#define UART_RX_PAL_MODE` | The alternate function mode for RX | `7` |
+| `#define UART_CTS_PIN` | The pin to use for CTS | `A11` |
+| `#define UART_CTS_PAL_MODE` | The alternate function mode for CTS | `7` |
+| `#define UART_RTS_PIN` | The pin to use for RTS | `A12` |
+| `#define UART_RTS_PAL_MODE` | The alternate function mode for RTS | `7` |
## API :id=api