aboutsummaryrefslogtreecommitdiff
path: root/docs/serial_driver.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/serial_driver.md')
-rw-r--r--docs/serial_driver.md59
1 files changed, 59 insertions, 0 deletions
diff --git a/docs/serial_driver.md b/docs/serial_driver.md
new file mode 100644
index 000000000..395b3ec3f
--- /dev/null
+++ b/docs/serial_driver.md
@@ -0,0 +1,59 @@
1# 'serial' Driver
2This driver powers the [Split Keyboard](feature_split_keyboard.md) feature.
3
4!> Serial in this context should be read as **sending information one bit at a time**, rather than implementing UART/USART/RS485/RS232 standards.
5
6All drivers in this category have the following characteristics:
7* Provides data and signaling over a single conductor
8* Limited to single master, single slave
9
10## Supported Driver Types
11
12| | AVR | ARM |
13|-------------------|--------------------|--------------------|
14| bit bang | :heavy_check_mark: | Soon™ |
15| USART Half-duplex | | :heavy_check_mark: |
16
17## Driver configuration
18
19### Bitbang
20Default driver, the absence of configuration assumes this driver. To configure it, add this to your rules.mk:
21
22```make
23SERIAL_DRIVER = bitbang
24```
25
26Configure the driver via your config.h:
27```c
28#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6
29#define SELECT_SOFT_SERIAL_SPEED 1 // or 0, 2, 3, 4, 5
30 // 0: about 189kbps (Experimental only)
31 // 1: about 137kbps (default)
32 // 2: about 75kbps
33 // 3: about 39kbps
34 // 4: about 26kbps
35 // 5: about 20kbps
36```
37
38### USART Half-duplex
39Targeting STM32 boards where communication is offloaded to a USART hardware device. The advantage is that this provides fast and accurate timings. `SOFT_SERIAL_PIN` for this driver is the configured USART TX pin. **The TX pin must have appropriate pull-up resistors**. To configure it, add this to your rules.mk:
40
41```make
42SERIAL_DRIVER = usart
43```
44
45Configure the hardware via your config.h:
46```c
47#define SOFT_SERIAL_PIN B6 // USART TX pin
48#define SELECT_SOFT_SERIAL_SPEED 1 // or 0, 2, 3, 4, 5
49 // 0: about 460800 baud
50 // 1: about 230400 baud (default)
51 // 2: about 115200 baud
52 // 3: about 57600 baud
53 // 4: about 38400 baud
54 // 5: about 19200 baud
55#define SERIAL_USART_DRIVER SD1 // USART driver of TX pin. default: SD1
56#define SERIAL_USART_TX_PAL_MODE 7 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 7
57```
58
59You must also turn on the SERIAL feature in your halconf.h and mcuconf.h