![]() |
M480 BSP
V3.05.001
The Board Support Package for M480 Series
|
#include <usbd_reg.h>
Data Fields | |
| __IO uint32_t | INTEN |
| __IO uint32_t | INTSTS |
| __IO uint32_t | FADDR |
| __I uint32_t | EPSTS |
| __IO uint32_t | ATTR |
| __I uint32_t | VBUSDET |
| __IO uint32_t | STBUFSEG |
| __I uint32_t | EPSTS0 |
| __I uint32_t | EPSTS1 |
| __I uint32_t | LPMATTR |
| __I uint32_t | FN |
| __IO uint32_t | SE0 |
| USBD_EP_T | EP [12] |
Definition at line 186 of file usbd_reg.h.
| USBD_T::ATTR |
[0x0010] USB Device Bus Status and Attribution Register
| Bits | Field | Descriptions |
| [0] | USBRST | USB Reset Status
0 = Bus no reset. 1 = Bus reset when SE0 (single-ended 0) more than 2.5us. Note: This bit is read only. |
| [1] | SUSPEND | Suspend Status
0 = Bus no suspend. 1 = Bus idle more than 3ms, either cable is plugged off or host is sleeping. Note: This bit is read only. |
| [2] | RESUME | Resume Status
0 = No bus resume. 1 = Resume from suspend. Note: This bit is read only. |
| [3] | TOUT | Time-out Status
0 = No time-out. 1 = No Bus response more than 18 bits time. Note: This bit is read only. |
| [4] | PHYEN | PHY Transceiver Function Enable Bit
0 = PHY transceiver function Disabled. 1 = PHY transceiver function Enabled. |
| [5] | RWAKEUP | Remote Wake-up
0 = Release the USB bus from K state. 1 = Force USB bus to K (USB_D+ low, USB_D-: high) state, used for remote wake-up. |
| [7] | USBEN | USB Controller Enable Bit
0 = USB Controller Disabled. 1 = USB Controller Enabled. |
| [8] | DPPUEN | Pull-up Resistor on USB_DP Enable Bit
0 = Pull-up resistor in USB_D+ bus Disabled. 1 = Pull-up resistor in USB_D+ bus Active. |
| [10] | BYTEM | CPU Access USB SRAM Size Mode Selection
0 = Word mode: The size of the transfer from CPU to USB SRAM can be Word only. 1 = Byte mode: The size of the transfer from CPU to USB SRAM can be Byte only. |
| [11] | LPMACK | LPM Token Acknowledge Enable Bit
The NYET/ACK will be returned only on a successful LPM transaction if no errors in both the EXT token and the LPM token and a valid bLinkState = 0001 (L1) is received, else ERROR and STALL will be returned automatically, respectively. 0= the valid LPM Token will be NYET. 1= the valid LPM Token will be ACK. |
| [12] | L1SUSPEND | LPM L1 Suspend
0 = Bus no L1 state suspend. 1 = This bit is set by the hardware when LPM command to enter the L1 state is successfully received and acknowledged. Note: This bit is read only. |
| [13] | L1RESUME | LPM L1 Resume
0 = Bus no LPM L1 state resume. 1 = LPM L1 state Resume from LPM L1 state suspend. Note: This bit is read only. |
Definition at line 894 of file usbd_reg.h.
| USBD_EP_T USBD_T::EP[12] |
[0x500~0x5bc] USB End Point 0 ~ 11 Configuration Register
Definition at line 911 of file usbd_reg.h.
| USBD_T::EPSTS |
[0x000c] USB Device Endpoint Status Register
| Bits | Field | Descriptions |
| [7] | OV | Overrun
It indicates that the received data is over the maximum payload number or not. 0 = No overrun. 1 = Out Data is more than the Max Payload in MXPLD register or the Setup Data is more than 8 Bytes. |
Definition at line 893 of file usbd_reg.h.
| USBD_T::EPSTS0 |
[0x0020] USB Device Endpoint Status Register 0
| Bits | Field | Descriptions |
| [03:00] | EPSTS0 | Endpoint 0 Status
These bits are used to indicate the current status of this endpoint 0000 = In ACK. 0001 = In NAK. 0010 = Out Packet Data0 ACK. 0011 = Setup ACK. 0110 = Out Packet Data1 ACK. 0111 = Isochronous transfer end. |
| [07:04] | EPSTS1 | Endpoint 1 Status
These bits are used to indicate the current status of this endpoint 0000 = In ACK. 0001 = In NAK. 0010 = Out Packet Data0 ACK. 0011 = Setup ACK. 0110 = Out Packet Data1 ACK. 0111 = Isochronous transfer end. |
| [11:08] | EPSTS2 | Endpoint 2 Status
These bits are used to indicate the current status of this endpoint 0000 = In ACK. 0001 = In NAK. 0010 = Out Packet Data0 ACK. 0011 = Setup ACK. 0110 = Out Packet Data1 ACK. 0111 = Isochronous transfer end. |
| [15:12] | EPSTS3 | Endpoint 3 Status
These bits are used to indicate the current status of this endpoint 0000 = In ACK. 0001 = In NAK. 0010 = Out Packet Data0 ACK. 0011 = Setup ACK. 0110 = Out Packet Data1 ACK. 0111 = Isochronous transfer end. |
| [19:16] | EPSTS4 | Endpoint 4 Status
These bits are used to indicate the current status of this endpoint 0000 = In ACK. 0001 = In NAK. 0010 = Out Packet Data0 ACK. 0011 = Setup ACK. 0110 = Out Packet Data1 ACK. 0111 = Isochronous transfer end. |
| [23:20] | EPSTS5 | Endpoint 5 Status
These bits are used to indicate the current status of this endpoint 0000 = In ACK. 0001 = In NAK. 0010 = Out Packet Data0 ACK. 0011 = Setup ACK. 0110 = Out Packet Data1 ACK. 0111 = Isochronous transfer end. |
| [27:24] | EPSTS6 | Endpoint 6 Status
These bits are used to indicate the current status of this endpoint 0000 = In ACK. 0001 = In NAK. 0010 = Out Packet Data0 ACK. 0011 = Setup ACK. 0110 = Out Packet Data1 ACK. 0111 = Isochronous transfer end. |
| [31:28] | EPSTS7 | Endpoint 7 Status
These bits are used to indicate the current status of this endpoint 0000 = In ACK. 0001 = In NAK. 0010 = Out Packet Data0 ACK. 0011 = Setup ACK. 0110 = Out Packet Data1 ACK. 0111 = Isochronous transfer end. |
Definition at line 900 of file usbd_reg.h.
| USBD_T::EPSTS1 |
[0x0024] USB Device Endpoint Status Register 1
| Bits | Field | Descriptions |
| [3:0] | EPSTS8 | Endpoint 8 Status
These bits are used to indicate the current status of this endpoint 0000 = In ACK. 0001 = In NAK. 0010 = Out Packet Data0 ACK. 0011 = Setup ACK. 0110 = Out Packet Data1 ACK. 0111 = Isochronous transfer end. |
| [7:4] | EPSTS9 | Endpoint 9 Status
These bits are used to indicate the current status of this endpoint 0000 = In ACK. 0001 = In NAK. 0010 = Out Packet Data0 ACK. 0011 = Setup ACK. 0110 = Out Packet Data1 ACK. 0111 = Isochronous transfer end. |
| [11:8] | EPSTS10 | Endpoint 10 Status
These bits are used to indicate the current status of this endpoint 0000 = In ACK. 0001 = In NAK. 0010 = Out Packet Data0 ACK. 0011 = Setup ACK. 0110 = Out Packet Data1 ACK. 0111 = Isochronous transfer end. |
| [15:12] | EPSTS11 | Endpoint 11 Status
These bits are used to indicate the current status of this endpoint 0000 = In ACK. 0001 = In NAK. 0010 = Out Packet Data0 ACK. 0011 = Setup ACK. 0110 = Out Packet Data1 ACK. 0111 = Isochronous transfer end. |
Definition at line 901 of file usbd_reg.h.
| USBD_T::FADDR |
[0x0008] USB Device Function Address Register
| Bits | Field | Descriptions |
| [6:0] | FADDR | USB Device Function Address
|
Definition at line 892 of file usbd_reg.h.
| USBD_T::FN |
[0x008c] USB Frame number Register
| Bits | Field | Descriptions |
| [10:0] | FN | Frame Number
These bits contain the 11-bits frame number in the last received SOF packet. |
Definition at line 906 of file usbd_reg.h.
| USBD_T::INTEN |
[0x0000] USB Device Interrupt Enable Register
| Bits | Field | Descriptions |
| [0] | BUSIEN | Bus Event Interrupt Enable Bit
0 = BUS event interrupt Disabled. 1 = BUS event interrupt Enabled. |
| [1] | USBIEN | USB Event Interrupt Enable Bit
0 = USB event interrupt Disabled. 1 = USB event interrupt Enabled. |
| [2] | VBDETIEN | VBUS Detection Interrupt Enable Bit
0 = VBUS detection Interrupt Disabled. 1 = VBUS detection Interrupt Enabled. |
| [3] | NEVWKIEN | USB No-event-wake-up Interrupt Enable Bit
0 = No-event-wake-up Interrupt Disabled. 1 = No-event-wake-up Interrupt Enabled. |
| [4] | SOFIEN | Start of Frame Interrupt Enable Bit
0 = SOF Interrupt Disabled. 1 = SOF Interrupt Enabled. |
| [8] | WKEN | Wake-up Function Enable Bit
0 = USB wake-up function Disabled. 1 = USB wake-up function Enabled. |
| [15] | INNAKEN | Active NAK Function and Its Status in IN Token
0 = When device responds NAK after receiving IN token, IN NAK status will not be updated to USBD_EPSTS0 and USBD_EPSTS1register, so that the USB interrupt event will not be asserted. 1 = IN NAK status will be updated to USBD_EPSTS0 and USBD_EPSTS1 register and the USB interrupt event will be asserted, when the device responds NAK after receiving IN token. |
Definition at line 890 of file usbd_reg.h.
| USBD_T::INTSTS |
[0x0004] USB Device Interrupt Event Status Register
| Bits | Field | Descriptions |
| [0] | BUSIF | BUS Interrupt Status
The BUS event means that there is one of the suspense or the resume function in the bus. 0 = No BUS event occurred. 1 = Bus event occurred; check USBD_ATTR[3:0] to know which kind of bus event was occurred, cleared by write 1 to USBD_INTSTS[0]. |
| [1] | USBIF | USB Event Interrupt Status
The USB event includes the SETUP Token, IN Token, OUT ACK, ISO IN, or ISO OUT events in the bus. 0 = No USB event occurred. 1 = USB event occurred, check EPSTS0~5[2:0] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[1] or EPSTS0~11 and SETUP (USBD_INTSTS[31]). |
| [2] | VBDETIF | VBUS Detection Interrupt Status
0 = There is not attached/detached event in the USB. 1 = There is attached/detached event in the USB bus and it is cleared by write 1 to USBD_INTSTS[2]. |
| [3] | NEVWKIF | No-event-wake-up Interrupt Status
0 = NEVWK event does not occur. 1 = No-event-wake-up event occurred, cleared by write 1 to USBD_INTSTS[3]. |
| [4] | SOFIF | Start of Frame Interrupt Status
0 = SOF event does not occur. 1 = SOF event occurred, cleared by write 1 to USBD_INTSTS[4]. |
| [16] | EPEVT0 | Endpoint 0's USB Event Status
0 = No event occurred in endpoint 0. 1 = USB event occurred on Endpoint 0, check USBD_EPSTS0[3:0] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[16] or USBD_INTSTS[1]. |
| [17] | EPEVT1 | Endpoint 1's USB Event Status
0 = No event occurred in endpoint 1. 1 = USB event occurred on Endpoint 1, check USBD_EPSTS0[7:4] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[17] or USBD_INTSTS[1]. |
| [18] | EPEVT2 | Endpoint 2's USB Event Status
0 = No event occurred in endpoint 2. 1 = USB event occurred on Endpoint 2, check USBD_EPSTS0[11:8] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[18] or USBD_INTSTS[1]. |
| [19] | EPEVT3 | Endpoint 3's USB Event Status
0 = No event occurred in endpoint 3. 1 = USB event occurred on Endpoint 3, check USBD_EPSTS0[15:12] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[19] or USBD_INTSTS[1]. |
| [20] | EPEVT4 | Endpoint 4's USB Event Status
0 = No event occurred in endpoint 4. 1 = USB event occurred on Endpoint 4, check USBD_EPSTS0[19:16] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[20] or USBD_INTSTS[1]. |
| [21] | EPEVT5 | Endpoint 5's USB Event Status
0 = No event occurred in endpoint 5. 1 = USB event occurred on Endpoint 5, check USBD_EPSTS0[23:20] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[21] or USBD_INTSTS[1]. |
| [22] | EPEVT6 | Endpoint 6's USB Event Status
0 = No event occurred in endpoint 6. 1 = USB event occurred on Endpoint 6, check USBD_EPSTS0[27:24] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[22] or USBD_INTSTS[1]. |
| [23] | EPEVT7 | Endpoint 7's USB Event Status
0 = No event occurred in endpoint 7. 1 = USB event occurred on Endpoint 7, check USBD_EPSTS0[31:28] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[23] or USBD_INTSTS[1]. |
| [24] | EPEVT8 | Endpoint 8's USB Event Status
0 = No event occurred in endpoint 8. 1 = USB event occurred on Endpoint 8, check USBD_EPSTS1[3 :0] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[24] or USBD_INTSTS[1]. |
| [25] | EPEVT9 | Endpoint 9's USB Event Status
0 = No event occurred in endpoint 9. 1 = USB event occurred on Endpoint 9, check USBD_EPSTS1[7 :4] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[25] or USBD_INTSTS[1]. |
| [26] | EPEVT10 | Endpoint 10's USB Event Status
0 = No event occurred in endpoint 10. 1 = USB event occurred on Endpoint 10, check USBD_EPSTS1[11 :8] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[26] or USBD_INTSTS[1]. |
| [27] | EPEVT11 | Endpoint 11's USB Event Status
0 = No event occurred in endpoint 11. 1 = USB event occurred on Endpoint 11, check USBD_EPSTS1[ 15:12] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[27] or USBD_INTSTS[1]. |
| [31] | SETUP | Setup Event Status
0 = No Setup event. 1 = Setup event occurred, cleared by write 1 to USBD_INTSTS[31]. |
Definition at line 891 of file usbd_reg.h.
| USBD_T::LPMATTR |
[0x0088] USB LPM Attribution Register
| Bits | Field | Descriptions |
| [3:0] | LPMLINKSTS | LPM Link State
These bits contain the bLinkState received with last ACK LPM Token |
| [7:4] | LPMBESL | LPM Best Effort Service Latency
These bits contain the BESL value received with last ACK LPM Token |
| [8] | LPMRWAKUP | LPM Remote Wakeup
This bit contains the bRemoteWake value received with last ACK LPM Token |
Definition at line 905 of file usbd_reg.h.
| USBD_T::SE0 |
[0x0090] USB Device Drive SE0 Control Register
| Bits | Field | Descriptions |
| [0] | SE0 | Drive Single Ended Zero in USB Bus
The Single Ended Zero (SE0) is when both lines (USB_D+ and USB_D-) are being pulled low. 0 = Normal operation. 1 = Force USB PHY transceiver to drive SE0. |
Definition at line 907 of file usbd_reg.h.
| USBD_T::STBUFSEG |
[0x0018] SETUP Token Buffer Segmentation Register
| Bits | Field | Descriptions |
| [8:3] | STBUFSEG | SETUP Token Buffer Segmentation
It is used to indicate the offset address for the SETUP token with the USB Device SRAM starting address The effective starting address is USBD_SRAM address + {STBUFSEG, 3'b000} Where the USBD_SRAM address = USBD_BA+0x100h. Note: It is used for SETUP token only. |
Definition at line 896 of file usbd_reg.h.
| USBD_T::VBUSDET |
[0x0014] USB Device VBUS Detection Register
| Bits | Field | Descriptions |
| [0] | VBUSDET | Device VBUS Detection
0 = Controller is not attached to the USB host. 1 = Controller is attached to the USB host. |
Definition at line 895 of file usbd_reg.h.
1.8.15