Interrupts; Table 21-2. Usbfs Global Interrupt - GigaDevice Semiconductor GD32VF103 User Manual

Risc-v 32-bit mcu
Hide thumbs Also See for GD32VF103:
Table of Contents

Advertisement

1. Initialize USBFS global registers.
2. Initialize and enable the IN endpoint.
3. Write packets into the endpoint's Tx FIFO. Each time a data packet is written into the
FIFO, USBFS decreases the TLEN field in USBFS_DIEPxLEN register by the written
packet's size.
4. When an IN token received, USBFS transmits the data packet, and after the transaction
finishes on USB bus, PCNT in USBFS_DIEPxLEN register is decreased by 1. If the
transaction finishes successfully (ACK handshake received), the ACK flag is triggered.
Otherwise, the status flags reports the transaction result.
5. After all the data packets in a transfer are successfully sent on USB bus, USBFS
generates TF flag to indicate that the transfer successfully finishes and disables the IN
endpoint.
OUT transfers operation sequence
1. Initialize USBFS global registers.
2. Initialize the endpoint and enable the endpoint.
3. When an OUT token received, USBFS receives the data packet or response with an NAK
handshake based on the status of Rx FIFO and register configuration. If the transaction
finishes successfully (USBFS receives and saves the data packet into Rx FIFO
successfully and sends ACK handshake on USB bus), PCNT in USBFS_DOEPxLEN
register is decreased by 1 and the ACK flag is triggered, otherwise, the status flags report
the transaction result.
4. After all the data packets in a transfer are successfully received on USB bus, USBFS
pushes a TF status entry into the Rx FIFO on top of the last packet data. Thus after
reading and poping all the received data packet, the TF status entry is read, USBFS
generates TF flag to indicate that the transfer successfully finishes and disables the OUT
endpoint.
21.6.

Interrupts

USBFS has two interrupts: global interrupt and wake-up interrupt.
The source flags of the global interrupt are readable in USBFS_GINTF register and are listed
in
Table 21-2. USBFS global

Table 21-2. USBFS global interrupt

Interrupt Flag
SEIF
DISCIF
IDPSC
interrupt.
Description
Session interrupt
Disconnect interrupt flag
ID pin status change
GD32VF103 User Manual
Operation Mode
Host or device mode
Host Mode
Host or device mode
475

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Table of Contents