WB_SPI - Host to Controller Communications
Communications between a 32-bit host processor and the WB_SPI are carried out over a standard Wishbone bus interface. For a generic summary of the communication cycles involved between Host and Controller for writing to/reading from the accessible internal registers, see Wishbone Communications - 32-bit Processor to Slave Peripheral.
Table 1 summarizes how the 32-bit data word from the host processor is used by each of the internal registers.
Writing to... | Results in... |
---|---|
DATA8 | DAT_I(7..0) loaded into bits 31..24 of the TX_DATA register |
DATA16 | If the
DAT_I(15..0) is loaded into bits 31..16 of the TX_DATA register
If the
DAT_I(7..0) is loaded into bits 31..24 of the TX_DATA register |
DATA32 | If the
DAT_I(31..0) is loaded into bits 31..0 of the TX_DATA register
If the
DAT_I(7..0) is loaded into bits 31..24 of the TX_DATA register |
CTRL | DAT_I(5..1) loaded into bits 5..1 of the Control register. |
CDIV | DAT_I(15..0) loaded into bits 15..0 of the Clock Divisor register |
Table 2 summarizes the 'make-up' of the 32-bit data word that is read back from each register.
Reading from... | Presents (to host processor)... |
---|---|
DATA8 | "000000000000000000000000" & RX_DATA(7..0) |
DATA16 | If the
"0000000000000000" & RX_DATA(15..0)
If the
"0000000000000000" & RX_DATA(7..0) & RX_DATA(15..8) |
DATA32 | If the
32-bit value from the RX_DATA register
If the
RX_DATA(7..0) & RX_DATA(15..8) & RX_DATA(23..16) & RX_DATA(31..24) |
CTRL | 32-bit value from the Control register |
STATUS | 32-bit value from the Status register |
CDIV | 32-bit value from the Clock Divisor register |