USB Type-C™ / USB Power Delivery interface (UCPD)
For each message:
•
Prepare the whole message in memory (starting with two header bytes)
•
Program the DMA operation with a length corresponding to the two header bytes plus
4*#data objects
•
Write TXSEND to initiate the message transfer
•
If TXMSGDISC then go back to previous line (TXSEND)
•
Wait for DMA transfer complete interrupt (i.e. when last Tx byte written to UCPD)
•
Double-check subsequent TXMSGSENT interrupt appears
Use of DMA for reception
DMA (Direct Memory Access) can be enabled for reception by setting the RXDMAEN bit in
the UCPD_CR register.
Whenever a Rx message may come
•
Program a DMA receive operation (and spare buffer) a little longer than the maximum
possible message (length depends on extended message support)
•
After receiving RXORDDET, DMA operation should start working in the background
•
On reception of RXMSGEND interrupt, read RXPAYSZ
•
Double-check RXPAYSZ vs. the # of DMA Rx bytes (should correspond but DMA read
of RXDR will be slightly after RXDR gets last byte)
•
Process the DMA Rx buffer
•
Prepare next Rx DMA buffer as soon as possible in order to be ready
45.5
UCPD low-power modes
A summary of low-power modes is shown below in
the
UCPD.
Mode
Sleep
Stop
Standby
Unpowered
The UCPD is able to wakeup the MCU from Stop mode when it recognizes a relevant event,
either:
–
–
2020/2083
Table 421. Effect of low power modes on the UCPD
Detection of events (Type-C, BMC Rx, FRS detection) remains operational and
UCPD is not operating, and cannot wake up the MCU. Pull-downs will remain
active if configured. Set the STDBY bit of the PWR_CR3 register just before
entering Standby mode, and clear it upon exiting the Standby mode as the very
Type-C event relating to a change in the voltage range seen on either of the CC
pins, visible in TYPEC_VSTATE_CCx
Power delivery receive message with an ordered set matching those filtered
according to RXORDSETEN[8:0], visible by reading RXORDSET
Table 421: Effect of low power modes on
Description
No effect
can wake up the MCU.
first action on UCPD.
Dead battery pull-downs will remain active.
RM0440 Rev 1
RM0440
Need help?
Do you have a question about the STM32G4 Series and is the answer not in the manual?
Questions and answers