Single Wire Protocol Master Interface (SWPMI)
Several transitions are possible:
•
ACTIVATE: transition from DEACTIVATED to SUSPENDED state,
•
SUSPEND: transition from ACTIVATED to SUSPENDED state,
•
RESUME by master: transition from SUSPENDED to ACTIVATED state initiated by the
master,
•
RESUME by slave: transition from SUSPENDED to ACTIVATED state initiated by the
slave,
•
DEACTIVATE: transition from SUSPENDED to DEACTIVATED state.
ACTIVATE
During and just after reset, the SWPMI_IO is configured in analog mode. Refer to
Section 40.3.2: SWP initialization and activation
SUSPEND
The SWP bus stays in the ACTIVATED state as long as there is a communication with the
slave, either in transmission or in reception. The SWP bus switches back to the
SUSPENDED state as soon as there is no more transmission or reception activity, after 7
idle bits.
RESUME by master
Once the SWPMI is enabled, the user can request a SWPMI frame transmission. The
SWPMI first sends a transition sequence and 8 idle bits (RESUME by master) before
starting the frame transmission. The SWP moves from the SUSPENDED to ACTIVATED
state after the RESUME by master (refer to
RESUME by slave
Once the SWPMI is enabled, the SWP can also move from the SUSPENDED to
ACTIVATED state if the SWPMI receives a RESUME from the slave. The RESUME by slave
sets the SRF flag in the SWPMI_ISR register.
DEACTIVATE
Deactivate request
If no more communication is required, and if SWP is in the SUSPENDED mode, the user
can request to switch the SWP to the DEACTIVATED mode by disabling the SWPMI
peripheral. The software must set DEACT bit in the SWPMI_CR register in order to request
the DEACTIVATED mode. If no RESUME by slave is detected by SWPMI, the DEACTF flag
is set in the SWPMI_ISR register and the SWPACT bit is cleared in the SWPMI_ICR
register. In case a RESUME by slave is detected by the SWPMI while the software is setting
DEACT bit, the SRF flag is set in the SWPMI_ISR register, DEACTF is kept cleared,
SWPACT is kept set and DEACT bit is cleared.
In order to activate SWP again, the software must clear DEACT bit in the SWPMI_CR
register before setting SWPACT bit.
Deactivate
In order to switch the SWP to the DEACTIVATED mode immediately, ignoring any possible
incoming RESUME by slave, the user must clear SWPACT bit in the SWPMI_CR register.
1366/1685
to activate the SWP bus.
Figure 455: SWP bus
DocID024597 Rev 3
RM0351
states).
Need help?
Do you have a question about the STM32L4x6 and is the answer not in the manual?
Questions and answers