]> Vexing Labs - forthdeck.git/commitdiff
Begin instructions to enable hardware flow control on a turnkey system
authorAdam Shamblin <adam@vexingworkshop.com>
Sun, 10 Jul 2022 22:46:49 +0000 (16:46 -0600)
committerAdam Shamblin <adam@vexingworkshop.com>
Sun, 10 Jul 2022 22:46:49 +0000 (16:46 -0600)
doc/README.md
src/init.fs [new file with mode: 0644]
src/uart.fs

index a6ad8b0896c8452e5b4c7dfbf8b141fbb8e3e932..b98bdeba256c14cb36a2ad4e9be9af7418e08383 100644 (file)
@@ -1,5 +1,8 @@
 ---
 title: Documentation
+keywords:
+- docs
+- system
 ---
 
 # Documentation
@@ -11,3 +14,29 @@ available using the `forthdeck` project.
 * [Terminal](terminal.md)
 * [UART](uart.md)
 * [Wordle](wordle.fs)
+
+## System
+
+A certain number of words may be loaded into the system to greatly improve
+quality of life when using `forthdeck` interactively. These words may be
+compiled to flash and saved in the first image stored to the MCU.
+
+At the time of this writing I have chosen to include the [GPIO](gpio.md) and
+[UART](uart.md) collections in the first image of my own system and to enable
+hardware flow control.
+
+### Enabling Hardware Flow Control
+
+In order to enable hardware flow control and to increase the speed of serial
+uploads **greatly**, I have chosen to include the [GPIO](gpio.md),
+[UART](uart.md) and [INIT](init.md) collections in the first image of my own
+system.
+
+```forth
+compiletoflash
+\...ctrl-a ctrl-s, load files...
+save
+```
+
+`init.fs` contains an `INIT` word that will be run on system startup, and that
+includes code to enable hardware flow control on UART0.
diff --git a/src/init.fs b/src/init.fs
new file mode 100644 (file)
index 0000000..c6ee60f
--- /dev/null
@@ -0,0 +1,2 @@
+\ Init function for turnkey system
+: INIT UART0 hfc-enable ;
index c74e4c6e4a21779ffb702fe88a819b549e6b6be8..36078f7b08f228721e5d7730cdd1c0014c22b279 100644 (file)
@@ -35,6 +35,8 @@ UART1_BASE UARTCR + constant UART1_CR
 : loopback-enable ( addr -- ) DUP @ 1 7 lshift OR SWAP ! ;
 
 \ Enable hardware flow control
+\ Given the address of a UART control register, enable hardware flow control
+\ example: UART0 hfc-enable
 : hfc-enable ( addr -- )
   2 pin UART funcsel! DUP cts-enable
   3 pin UART funcsel! rts-enable ;