Programming Examples
10-48
ADSP-BF537 Blackfin Processor Hardware Reference
R0 = W[P1++](z); /* Get next data to be transmitted */
W[P0] = R0.l; /* Write that data to SPI_TDBR */
Kick_Off_Next:
P0.H = hi(SPI_RDBR); /* SPI receive register */
P0.L = lo(SPI_RDBR);
R0 = W[P0] (z); /* Read SPI receive register (also kicks off
next transfer) */
W[P2++] = R0; /* Store received data to memory */
RTI; /* Exit interrupt handler */
Stopping
In order for a data transfer to end after the user has transferred all data,
the following code can be used to stop the SPI. Note that this is typically
done in the interrupt handler to ensure the final data has been sent in its
entirety.
Listing 10-4. Stopping SPI
Stopping_SPI:
P0.H = hi(SPI_CTL);
P0.L = lo(SPI_CTL);
R0 = W[P0];
BITCLR(R0, 14); /* Clear SPI enable bit */
W[P0] = R0.L; ssync; /* Disable SPI */
DMA Transfer
The following DMA-driven master-mode SPI autobuffer example shows
how to initialize DMA, initialize SPI, signal the start of a transfer, and
generate a stop condition.
Summary of Contents for Blackfin ADSP-BF537
Page 42: ...Contents xlii ADSP BF537 Blackfin Processor Hardware Reference ...
Page 90: ...Development Tools 1 32 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 138: ...Programming Examples 4 26 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 340: ...SDC Programming Examples 6 84 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 606: ...Programming Examples 9 94 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 660: ...Programming Examples 10 54 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 720: ...Electrical Specifications 11 60 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 840: ...Programming Examples 13 42 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 876: ...Programming Examples 14 36 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 938: ...Programming Examples 15 62 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 958: ...Programming Examples 17 12 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 986: ...Programming Examples 18 28 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 1162: ...G 26 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 1218: ...Index I 56 ADSP BF537 Blackfin Processor Hardware Reference ...