Single Wire Protocol Master Interface (SWPMI)
Figure 458. SWPMI No software buffer mode transmission, consecutive frames
Single software buffer mode
This mode allows to transmit a complete SWP frame without a CPU intervention, using the
DMA. The DMA will refill the 32-bit SWPMI_TDR register, and the software can poll the end
of the frame transmission using the SWPMI_TXBEF flag.
The Single software buffer mode is selected by setting TXDMA bit and clearing TXMODE bit
in the SWPMI_CR register.
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 memory.
•
the number of words to be transfered must be set according to the SWP frame length,
•
the source address is the SWP frame buffer in RAM,
•
the destination address is the SWPMI_TDR register.
Then the user must:
1.
Set TXDMA bit in the SWPMI_CR register,
2.
Set TXBEIE bit in the SWPMI_IER register,
3.
Fill the buffer in the RAM memory (with the number of data bytes in the payload on the
least significant byte of the first word),
4.
Enable stream or channel in DMA module to start DMA transfer and frame
transmission.
A DMA request is issued by SWPMI when TXE flag in SWPMI_ISR is set. The TXE flag is
cleared automatically when the DMA is writing to the SWPMI_TDR register.
In the SWPMI interrupt routine, the user must check TXBEF bit in the SWPMI_ISR register.
If it is set, and if another frame needs to be transmitted, the user must:
1370/1685
DocID024597 Rev 3
RM0351
Need help?
Do you have a question about the STM32L4x6 and is the answer not in the manual?
Questions and answers