User manual

Table Of Contents
Zynq-7000 AP SoC Technical Reference Manual www.xilinx.com 544
UG585 (v1.11) September 27, 2016
Chapter 17: SPI Controller
9. Interrupt handler: Transfer any additional data to the slave the required data to SPI slave using
the interrupt handler.
10. Disable interrupts: Write 0x27 to the spi.Intrpt_dis_reg to disable RxFIFO full, RxFIFO overlflow,
TxFIFO empty, and fault conditions.
11. Disable the controller: Set spi.En_reg0 [SPI_EN] = 0.
12. De-assert slave select: Set spi.Config_reg0 [CS] = 1111.
Example: Master Mode – Manual SS and Auto Start
1. Enable manual SS: Write 1 to spi.Config_reg [Manual_CS].
2. Assert slave select: Set spi.Config_reg [CS] = 1101 to use slave select 1.
3. Enable the controller: Write 1 to spi.EN_reg0 [SPI_EN].
4. Write bytes to the TxFIFO:
a. Write the data to the TxFIFO using the register spi.Tx_data_reg.
b. Continue to write data to the TxFIFO to its full depth or until no further data is needed to be
written.
c. Increment the data byte counter in the driver software after each byte is written to the
TxFIFO.
5. Enable the interrupts: Write 0x27 to spi.Intrpt_en_reg to enable RxFIFO full, RxFIFO overflow,
TxFIFO empty, and fault conditions.
6. Wait for interrupts.
7. Interrupt handler: Transfer any additional data to the slave the required data to SPI slave using
the interrupt handler.
8. Disable interrupts: Write 0x27 to the spi.Intrpt_dis_reg to disable RxFIFO full, RxFIFO overlflow,
TxFIFO empty and fault conditions.
9. Disable the controller: Set spi.En_reg0 [SPI_EN] = 0.
10. De-assert slave select: Set spi.Config_reg0 [CS] = 1111.
Example: Master Mode – Auto SS and Manual Start
1. Select manual start: Write 1 to spi.Config_reg0 [Man_start_en].
2. Assert slave select: Set spi.Config_reg0 [CS] = 1101 to use slave select 1.
3. Enable the controller: Write 1 to spi.EN_reg0 [SPI_EN].
4. Write bytes to the TxFIFO:
a. Write the data to the TxFIFO using the register spi.Tx_data_reg.
b. Continue to write data to the TxFIFO to its full depth or until no further data is needed to be
written.
c. Increment the data byte counter in the driver software after each byte is written to the
TxFIFO.
5. Set the FIFO threshold levels: Set spi.TX_thres_reg0 and spi.RX_thres_reg0 threshold levels.
Refer to the description at “automatic mode of operation” section.