90
10.2
SPI1
CW6632B Bluetooth 3.0 Audio Player SOC
Version 1.0.0
Copyright ©2015, www.appotech.com. All Rights Reserved.
Name
SPI1BAUD
Default
0
0
0
0
0
0
0
0
Access
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
SPI Baud Rate, from 0 to 255
SPI Clock is System Clock /
(
SP 1
)
, If SPI1BAUD is 0, then SPI Clock is same as System Clock.
10.2.2
SPI1 Operation Guide
Figure 2015-
SPI Normal Mode Operation Flow:
1.
Set IO in the correct direction.
2.
Select SPI1WS in 2-wire mode or 3 wire mode.
3.
Select SPI1RT for reception or transmission.
4.
Configure clock frequency using bit SPI1SP.
5.
Enable SPI module by setting SPI1EN „1‟
6.
Set SPI1IE „1‟ if needed
7.
Write data to SPI1BUF to kick-start the process
8.
Wait for SPI1PND change to „1‟, or wait for interrupt
9.
Read received data from SPI1BUF if needed
10. Go to Step 7 to start another process if needed or turn off SPI1 by clearing SPI1PND and SPI1EN
B. SPI DMA Mode Operation Flow:
1. Set IO in the correct direction.
2. Select SPI1RT for DMA direction
3. Select SPI1WS in 2-wire mode or 3 wire mode
4. Configure clock frequency using bit SPI1SP
5.
Enable SPI module by setting SPI1EN „1‟
6.
Set SPI1IE „1‟ if needed
7. Write the start address to SPI1DMASP
8. Write data to SPI1DMACNT to kick-start the DMA process.
9.
Wait for bit SPI1PND to change to „1‟, or wait for interrupt
10. Go to Step 7 to start another DMA process if needed or turn off SPI by clearing SPI1PND and SPI1EN