Programming Examples
18-52
ADSP-BF50x Blackfin Processor Hardware Reference
empty. If there is data in the SPI Transmit FIFO, it is loaded as soon as
the
TXS
bit clears. A second consecutive read with the
TXS
bit clear indi-
cates the FIFO is empty and the last word is in the shift register. Finally,
polling for the
SPIF
bit determines when the last bit of the last word has
been shifted out. At that point, it is safe to shut down the SPI port and the
DMA engine.
Listing 18-8. Stopping a Transfer
SPI_DMA_INTERRUPT_HANDLER:
P0.L = lo(DMA7_IRQ_STATUS);
P0.H = hi(DMA7_IRQ_STATUS);
R0 = 1 ;
W[P0] = R0 ;
/* Clear DMA interrupt */
/* Wait for DMA to complete */
P0.L = lo(DMA7_IRQ_STATUS);
P0.H = hi(DMA7_IRQ_STATUS);
R0 = DMA_RUN;
/* 0x08 */
CHECK_DMA_COMPLETE:
/* Poll for DMA_RUN bit to clear */
R3 = W[P0] (Z);
R1 = R3 & R0;
CC = R1 == 0;
IF !CC JUMP CHECK_DMA_COMPLETE;
/* Wait for TXS to clear */
P0.L = lo(SPI_STAT);
P0.H = hi(SPI_STAT);
R1 = TXS;
/* 0x08 */
Check_TXS:
/* Poll for TXS = 0 */
R2 = W[P0] (Z);
R2 = R2 & R1;
Summary of Contents for EZ-KIT Lite ADSP-BF506F
Page 50: ...Contents l ADSP BF50x Blackfin Processor Hardware Reference ...
Page 92: ...Development Tools 1 30 ADSP BF50x Blackfin Processor Hardware Reference ...
Page 110: ...Interface Overview 3 12 ADSP BF50x Blackfin Processor Hardware Reference ...
Page 236: ...Internal Flash Memory Control Registers 6 92 ADSP BF50x Blackfin Processor Hardware Reference ...
Page 650: ...Programming Examples 15 56 ADSP BF50x Blackfin Processor Hardware Reference ...
Page 804: ...Programming Examples 17 92 ADSP BF50x Blackfin Processor Hardware Reference ...
Page 1194: ...Programming Examples 24 90 ADSP BF50x Blackfin Processor Hardware Reference ...
Page 1256: ...ACM Registers A 50 ADSP BF50x Blackfin Processor Hardware Reference ...
Page 1264: ...Boundary Scan Architecture B 8 ADSP BF50x Blackfin Processor Hardware Reference ...