10 SPI
87
CW6632B Bluetooth 3.0 Audio Player SOC
Version 1.0.0
Copyright ©2015, www.appotech.com. All Rights Reserved.
6.
Enable SPI0 module by setting SPI0EN „1‟
7.
Set SPI0IE „1‟ if needed
8.
Write data to SPI0BUF to kick-start the process
9.
Wai
t for SPI0PND to change to „1‟, or wait for interrupt
10. Read received data from SPI0BUF if needed
11. Go to Step 8 to start another process if needed or turn off SPI0 by clearing SPI0IE and SPI0EN
SPI0 DMA Mode Operation Flow:
1.
Set IO in the correct direction.
2.
Select SPI0RT for DMA direction
3.
Select master mode or slave mode
4.
Configure clock frequency when master mode is selected in step 3
5.
Select one of the four timing modes (refer to
6.
Enable SPI0 module by setting SPI0EN to „1‟
7.
Set SPI0IE „1‟ if needed
8.
Write the start address to SPI0DMASP
9.
Write data to SPI0DMACNT to kick-start a DMA process
10.
Wait for SPI0PND to change to „1‟, or wait for interrupt
11. Go to Step 8 to start another DMA process if needed or turn off SPI0 by clearing SPI0IE and SPI0EN
10.2
SPI1
CW6632B SPI1 is an accelerated SPI. It can serve as master only. It can operate in normal or DMA mode. Please
see PMUXCON0 bit 5 descriptions
SPI1 uses 2 pins for 2 wire mode:
Serial Data (SPIDIDO1)
–
P04
Serial Clock (SPICLK1)
–
P05
SPI1 uses 3 pins for 3 wire mode:
When SPI1_MAP = 0,
Serial Data Out (SPIDO1)
–
P04
Serial Data In (SPIDI1)
–
P06
Serial Clock (SPICLK1)
–
P05
When SPI1_MAP = 1,
Serial Data Out (SPIDO0)
–
P04
Serial Data In (SPIDI0)
–
P42
Serial Clock (SPICLK0)
–
05