1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-06 08:10:55 +11:00
collapseos/blk/595
Virgil Dupras 46676547d9 spi: add SPI_DELAY decl
AVR chips often run at less than z80's system clock. This means that
our SPI relay needs to have its own clock to properly communicate
with it. This means that the delay between OUT and IN can't be
hardcoded to 2 NOPs anymore. It needs to be configurable.
2020-08-23 07:55:17 -04:00

16 lines
576 B
Plaintext

SPI relay driver
This driver is designed for a ad-hoc adapter card that acts as a
SPI relay between the z80 bus and the SPI device. Sending any-
thing on SPI_CSLOW and SPI_CSHIGH is expected to select/deselect
the device, and writing to SPI_DATA is expected to initiate a
byte exchange. The result of the exchange is excpected to be re-
trieved by reading SPI_DATA.
You also need to define the exchange delay with SPI_DELAY. If
SPI clock is the same as system clock, 2 NOPs are enough:
: SPI_DELAY NOP, NOP, ;
Provides the SPI relay protocol. Load driver with "596 LOAD".