46676547d9
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.
16 lines
576 B
Plaintext
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".
|