1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-06 02:10:57 +11:00
collapseos/blk/588
Virgil Dupras 9424770caa rc2014: add a declaration part to ACIA drivers
Driver configuration don't need their own words at runtime, we only
need to compile them as literals when compiling words.

Now that we have this "declaration blocks" pattern emerging, it
seems like a good idea to take advantage of this in drivers, both
for simplifying the xcomp unit and to make final binary slimmer.
2020-06-28 17:30:01 -04:00

13 lines
400 B
Plaintext

: ACIA$
H@ DUP DUP [ ACIA( LITN ] ! [ ACIAR> LITN ] !
1+ [ ACIAW> LITN ] ! ( write index starts one pos later )
0x20 ( buffer size ) ALLOT
H@ [ ACIA) LITN ] !
( setup ACIA
CR7 (1) - Receive Interrupt enabled
CR6:5 (00) - RTS low, transmit interrupt disabled.
CR4:2 (101) - 8 bits + 1 stop bit
CR1:0 (10) - Counter divide: 64 )
0b10010110 [ ACIA_CTL LITN ] PC!
(im1) ;