ST STM32L4x6 Reference Manual page 1374

Table of Contents

Advertisement

Single Wire Protocol Master Interface (SWPMI)
Single software buffer mode
This mode allows to receive a complete SWP frame without any CPU intervention using the
DMA. The DMA transfers received data from the 32-bit SWPMI_RDR register to the RAM
memory, and the software can poll the end of the frame reception using the SWPMI_RBFF
flag.
The Single software buffer mode is selected by setting RXDMA bit and clearing RXMODE
bit in the SWPMI_CR register.
The DMA must be configured as follows:
The DMA channel or stream must be configured in following mode (refer to DMA section):
memory to memory mode disabled,
memory increment mode enabled,
memory size set to 32-bit,
peripheral size set to 32-bit,
peripheral increment mode disabled,
circular mode disabled,
data transfer direction set to read from peripheral,
the number of words to be transfered must be set to 8,
the source address is the SWPMI_RDR register,
the destination address is the SWP frame buffer in RAM.
Then the user must:
1.
Set RXDMA bit in the SWPMI_CR register
2.
Set RXBFIE bit in the SWPMI_IER register
3.
Enable stream or channel in DMA module.
A DMA request is issued by SWPMI when RXNE flag is set in SWPMI_ISR. The RXNE flag
is cleared automatically when the DMA is reading the SWPMI_RDR register.
In the SWPMI interrupt routine, the user must check RXBFF bit in the SWPMI_ISR register.
If it is set, the user must:
1.
Disable stream or channel in DMA module
2.
Read the number of bytes in the received frame payload in the SWPMI_RFL register
3.
Read the frame payload in the RAM buffer
4.
Enable stream or channel in DMA module
5.
Set CRXBFF bit in the SWPMI_ICR register to clear RXBFF flag (refer to
SWPMI single software buffer mode
1374/1685
reception).
DocID024597 Rev 3
RM0351
Figure 461:

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