Figure 460. Swpmi No Software Buffer Mode Reception - ST STM32L4x6 Reference Manual

Table of Contents

Advertisement

RM0351
If the SWP bus is already in the ACTIVATED state (for example because a frame
transmission is ongoing), the SWPMI core does not need any RESUME by slave state, and
the reception can take place immediately.
There are several possible software implementations for a frame reception:
No software buffer mode,
Single software buffer mode,
Multi software buffer mode.
The software buffer usage requires the use of a DMA channel to transfer data from the
receive data register in the SWPMI peripheral to the software buffer in the RAM memory.
No software buffer mode
This mode does not require the use of DMA. The SWP frame reception handling is done by
polling status flags in the main loop or inside the SWPMI interrupt routine. There is a 32-bit
receive data register (SWPMI_RDR) in the SWPMI, allowing to receive up to 4 bytes before
reading this register.
The No software buffer mode is selected by resetting RXDMA bit in the SWPMI_CR register.
Once a Start of frame (SOF) is received, the following bytes (payload) are stored in the
SWPMI_RDR register. Once the SWPMI_RDR is full, the RXNE flag is set in SWPMI_ISR
and an interrupt is generated if RIE bit is set in SWPMI_IER register. The user can read the
SWPMI_RDR register and the RXNE flag is cleared automatically when the software is
reading the SWPMI_RDR register.
Once the complete frame has been received, including the CRC and the End of frame
(EOF), both RXNE and RXBFF flags are set in the SWPMI_ISR register. The user must
read the last byte(s) of the payload in the SWPMI_RDR register and set CRXBFF flag in
SWPMI_ICR in order to clear the RXBFF flag. The number of data bytes in the payload is
available in the SWPMI_RFL register. Again, the RXNE flag is reset automatically when the
software is reading the SWPMI_RDR register (refer to
buffer mode
Reading the SWPMI_RDR register while RXNE is cleared will return 0.
reception).

Figure 460. SWPMI No software buffer mode reception

DocID024597 Rev 3
Single Wire Protocol Master Interface (SWPMI)
Figure 460: SWPMI No software
1373/1685
1392

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the STM32L4x6 and is the answer not in the manual?

Questions and answers

Table of Contents

Save PDF