Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
<strong>STM32W108C8</strong><br />
Serial interfaces<br />
9.4.3 DMA<br />
The SPI slave controller must guarantee that there is time to move new transmit data from<br />
the transmit FIFO into the hardware serializer. To provide sufficient time, the SPI slave<br />
controller inserts a byte of padding at the start of every new string of transmit data. After<br />
slave select asserts and the SC_SPIRXVAL bit in the SCx_SPISTAT register gets set at<br />
least once, the following operation holds true until slave select deasserts. Whenever the<br />
transmit FIFO is empty and data is placed into the transmit FIFO, either manually or through<br />
DMA, the SPI hardware inserts a byte of padding onto the front of the transmission as if this<br />
byte was placed there by software. The value of the byte of padding that is inserted is<br />
selected by the SC_SPIRPT bit in the SCx_SPICFG register.<br />
The DMA Channels section describes how to configure and use the serial receive and<br />
transmit DMA channels.<br />
When using the receive DMA channel and nSSEL transitions to the high (deasserted) state,<br />
the active buffer's receive DMA count register (SCx_RXCNTA/B) is saved in the<br />
SCx_RXCNTSAVED register. SCx_RXCNTSAVED is only written the first time nSSEL goes<br />
high after a buffer has been loaded. Subsequent rising edges set a status bit but are<br />
otherwise ignored. The 3-bit field SC_RXSSEL in the SCx_DMASTAT register records what,<br />
if anything, was saved to the SCx_RXCNTSAVED register, and whether or not another<br />
rising edge occurred on nSSEL.<br />
9.4.4 Interrupts<br />
SPI slave controller second level interrupts are generated on the following events:<br />
● Transmit FIFO empty and last character shifted out (depending on SCx_INTMODE,<br />
either the 0 to 1 transition or the high level of SC_SPITXIDLE)<br />
● Transmit FIFO changed from full to not full (depending on SCx_INTMODE, either the 0<br />
to 1 transition or the high level of SC_SPITXFREE)<br />
● Receive FIFO changed from empty to not empty (depending on SCx_INTMODE, either<br />
the 0 to 1 transition or the high level of SC_SPIRXVAL)<br />
● Transmit DMA buffer A/B complete (1 to 0 transition of SC_TXACTA/B)<br />
● Receive DMA buffer A/B complete (1 to 0 transition of SC_RXACTA/B)<br />
●<br />
Received and lost character while receive FIFO was full (receive overrun error)<br />
● Transmitted character while transmit FIFO was empty (transmit underrun error)<br />
To enable CPU interrupts, set desired interrupt bits in the second level INT_SCxCFG<br />
register, and also enable the top level SCx interrupt in the NVIC by writing the INT_SCx bit<br />
in the INT_CFGSET register.<br />
9.5 Inter-integrated circuit interfaces (I 2 C)<br />
Both <strong>STM32W108C8</strong> serial controllers SC1 and SC2 include an Inter-integrated circuit<br />
interface (I 2 C) master controller with the following features:<br />
● Uses only two bidirectional GPIO pins<br />
● Programmable clock frequency (up to 400 kHz)<br />
● Supports both 7-bit and 10-bit addressing<br />
● Compatible with Philips' I 2 C-bus slave devices<br />
Doc ID 018587 Rev 2 80/215