mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-24 02:38:05 +11:00
1a6a549857
Working on programming AVR chips exposes a glaring omission in my first design of the SPI Relay: not allowing multiple devices make this task hard. I constantly have to unplug my SD card before, plug the AVR chip holder, then play a bit, then unplug the AVR holder, then replug the SD card... My prototype for a SPI relay design is built, but I haven't tested it yet. I need to adapt the code first, which is what I do here. When the prototype is tested, I'll update the SDC recipe with a new schema.
14 lines
276 B
Plaintext
14 lines
276 B
Plaintext
CODE (spix) ( n -- n )
|
|
HL POP, chkPS, A L LDrr,
|
|
SPI_DATA OUTiA,
|
|
( wait until xchg is done )
|
|
BEGIN, SPI_CTL INAi, A ORr, JRNZ, AGAIN,
|
|
SPI_DATA INAi,
|
|
L A LDrr,
|
|
HL PUSH,
|
|
;CODE
|
|
CODE (spie) ( n -- )
|
|
HL POP, chkPS, A L LDrr,
|
|
SPI_CTL OUTiA,
|
|
;CODE
|