GD32F1x0
|
Functions | |
void | DR_Init (void) |
Device register initialization. More... | |
void | DR_StopDevice (void) |
Device register configure when stop device. More... | |
void | USB_EP_BufConfig (USB_CORE_HANDLE *pudev, uint8_t EpAddr, uint8_t EpKind, uint32_t BufAddr) |
Configure buffer for endpoint. More... | |
void | USB_EP_Init (USB_CORE_HANDLE *pudev, uint8_t EpAddr, uint8_t EpType, uint16_t EpMps) |
Endpoint initialization. More... | |
void | USB_EP_DeInit (USB_CORE_HANDLE *pudev, uint8_t EpAddr) |
Configure the endpoint when it is disabled. More... | |
void | USB_EP_Rx (USB_CORE_HANDLE *pudev, uint8_t EpAddr, uint8_t *pbuf, uint16_t BufLen) |
Endpoint prepare to receive data. More... | |
void | USB_EP_Tx (USB_CORE_HANDLE *pudev, uint8_t EpAddr, uint8_t *pbuf, uint16_t BufLen) |
Endpoint prepare to transmit data. More... | |
void | USB_EP_Stall (USB_CORE_HANDLE *pudev, uint8_t EpAddr) |
Set an endpoint to STALL status. More... | |
void | USB_EP_ClrStall (USB_CORE_HANDLE *pudev, uint8_t EpAddr) |
Clear endpoint stalled status. More... | |
void | USB_EP_SetAddress (USB_CORE_HANDLE *pudev, uint8_t Addr) |
Set USB device and endpoints address. More... | |
uint8_t | USB_EP_GetStatus (USB_CORE_HANDLE *pudev, uint8_t EpAddr) |
Get the endpoint status. More... | |
uint8_t | USB_CtlTx (USB_CORE_HANDLE *pudev, uint8_t *pbuf, uint16_t Len) |
Transmit data on the control pipe. More... | |
uint8_t | USB_CtlContinueTx (USB_CORE_HANDLE *pudev, uint8_t *pbuf, uint16_t Len) |
Continue transmitting data on the control pipe. More... | |
uint8_t | USB_CtlRx (USB_CORE_HANDLE *pudev, uint8_t *pbuf, uint16_t Len) |
Receive data on the control pipe. More... | |
uint8_t | USB_CtlContinueRx (USB_CORE_HANDLE *pudev, uint8_t *pbuf, uint16_t Len) |
Continue receive data on the contrl pipe. More... | |
uint8_t | USB_CtlTransmitStatus (USB_CORE_HANDLE *pudev) |
Transmit status stage on the control pipe. More... | |
uint8_t | USB_CtlReceiveStatus (USB_CORE_HANDLE *pudev) |
Receive status stage on the control pipe. More... | |
uint16_t | USB_GetRxCount (USB_CORE_HANDLE *pudev, uint8_t EpID) |
Get the received data length. More... | |
Detailed Description
Function Documentation
void DR_Init | ( | void | ) |
Device register initialization.
- Parameters
-
None
- Return values
-
None
Definition at line 44 of file usb_core.c.
void DR_StopDevice | ( | void | ) |
Device register configure when stop device.
- Parameters
-
None
- Return values
-
None
Definition at line 76 of file usb_core.c.
uint8_t USB_CtlContinueRx | ( | USB_CORE_HANDLE * | pudev, |
uint8_t * | pbuf, | ||
uint16_t | Len | ||
) |
Continue receive data on the contrl pipe.
- Parameters
-
pudev pointer to usb core instance pbuf data buffer pointer Len data length
- Return values
-
usb operation status
Definition at line 595 of file usb_core.c.
uint8_t USB_CtlContinueTx | ( | USB_CORE_HANDLE * | pudev, |
uint8_t * | pbuf, | ||
uint16_t | Len | ||
) |
Continue transmitting data on the control pipe.
- Parameters
-
pudev pointer to usb core instance pbuf data buffer pointer Len data length
- Return values
-
usb operation status
Definition at line 561 of file usb_core.c.
uint8_t USB_CtlReceiveStatus | ( | USB_CORE_HANDLE * | pudev | ) |
Receive status stage on the control pipe.
- Parameters
-
pudev pointer to usb core instance
- Return values
-
usb operation status
Definition at line 623 of file usb_core.c.
uint8_t USB_CtlRx | ( | USB_CORE_HANDLE * | pudev, |
uint8_t * | pbuf, | ||
uint16_t | Len | ||
) |
Receive data on the control pipe.
- Parameters
-
pudev pointer to usb core instance pbuf pointer to data buffer Len length of data to be received
- Return values
-
usb operation status
Definition at line 577 of file usb_core.c.
uint8_t USB_CtlTransmitStatus | ( | USB_CORE_HANDLE * | pudev | ) |
Transmit status stage on the control pipe.
- Parameters
-
pudev pointer to usb core instance
- Return values
-
usb operation status
Definition at line 609 of file usb_core.c.
uint8_t USB_CtlTx | ( | USB_CORE_HANDLE * | pudev, |
uint8_t * | pbuf, | ||
uint16_t | Len | ||
) |
Transmit data on the control pipe.
- Parameters
-
pudev pointer to usb core instance pbuf data buffer pointer Len data length
- Return values
-
usb operation status
Definition at line 543 of file usb_core.c.
void USB_EP_BufConfig | ( | USB_CORE_HANDLE * | pudev, |
uint8_t | EpAddr, | ||
uint8_t | EpKind, | ||
uint32_t | BufAddr | ||
) |
Configure buffer for endpoint.
- Parameters
-
pudev pointer to usb core instance EpAddr endpoint address In this parameter: bit0..bit6: endpoint number which is in (0..7) bit7: endpoint direction which can be IN(1) or OUT(0) EpKind endpoint kind This parameter can be any one of the following values: - USB_SNG_BUFTYPE: single buffer will be used
- USB_DBL_BUFTYPE: double buffer will be used
BufAddr endpoint address in the allocation buffer: If the endpoint use single buffer this parameter is a 16-bit value providing the bufaddress allocated to endpoint. If the endpoint use double buffer this parameter is a 32-bit value providing the endpoint buffer 0 address in the LSB part and endpoint buffer 1 address in the MSB part.
- Return values
-
None
Definition at line 107 of file usb_core.c.
void USB_EP_ClrStall | ( | USB_CORE_HANDLE * | pudev, |
uint8_t | EpAddr | ||
) |
Clear endpoint stalled status.
- Parameters
-
pudev pointer to usb core instance EpAddr endpoint address In this parameter: bit0..bit6: endpoint number which is in (0..7) bit7: endpoint direction which can be IN(1) or OUT(0)
- Return values
-
None
Definition at line 473 of file usb_core.c.
void USB_EP_DeInit | ( | USB_CORE_HANDLE * | pudev, |
uint8_t | EpAddr | ||
) |
Configure the endpoint when it is disabled.
- Parameters
-
pudev pointer to usb core instance EpAddr endpoint address In this parameter: bit0..bit6: endpoint number which is in (0..7) bit7: endpoint direction which can be IN(1) or OUT(0)
- Return values
-
None
Definition at line 275 of file usb_core.c.
uint8_t USB_EP_GetStatus | ( | USB_CORE_HANDLE * | pudev, |
uint8_t | EpAddr | ||
) |
Get the endpoint status.
- Parameters
-
pudev pointer to usb core instance EpAddr endpoint address In this parameter: bit0..bit6: endpoint number which is in (0..7) bit7: endpoint direction which can be IN(1) or OUT(0)
- Return values
-
Endpoint status
Definition at line 524 of file usb_core.c.
void USB_EP_Init | ( | USB_CORE_HANDLE * | pudev, |
uint8_t | EpAddr, | ||
uint8_t | EpType, | ||
uint16_t | EpMps | ||
) |
Endpoint initialization.
- Parameters
-
pudev pointer to usb core instance EpAddr endpoint address In this parameter: bit0..bit6: endpoint number which is in (0..7) bit7: endpoint direction which can be IN(1) or OUT(0) EpType endpoint type This parameter can be any one of the following values: - USB_EPTYPE_CONTROL: control transfer endpoint
- USB_EPTYPE_BULK: bulk transfer endpoint
- USB_EPTYPE_INT: interrupt transfer endpoint
- USB_EPTYPE_ISOC: isochronous transfer endpoint
EpMps endpoint max packet size
- Return values
-
None
Definition at line 169 of file usb_core.c.
void USB_EP_Rx | ( | USB_CORE_HANDLE * | pudev, |
uint8_t | EpAddr, | ||
uint8_t * | pbuf, | ||
uint16_t | BufLen | ||
) |
Endpoint prepare to receive data.
- Parameters
-
pudev pointer to usb core instance EpAddr endpoint address In this parameter: bit0..bit6: endpoint number which is in (0..7) bit7: endpoint direction which can be IN(1) or OUT(0) pbuf user buffer address pointer BufLen buffer length
- Return values
-
None
Definition at line 336 of file usb_core.c.
void USB_EP_SetAddress | ( | USB_CORE_HANDLE * | pudev, |
uint8_t | Addr | ||
) |
Set USB device and endpoints address.
- Parameters
-
pudev pointer to usb core instance Addr device address to set
- Return values
-
None
Definition at line 501 of file usb_core.c.
void USB_EP_Stall | ( | USB_CORE_HANDLE * | pudev, |
uint8_t | EpAddr | ||
) |
Set an endpoint to STALL status.
- Parameters
-
pudev pointer to usb core instance EpAddr endpoint address In this parameter: bit0..bit6: endpoint number which is in (0..7) bit7: endpoint direction which can be IN(1) or OUT(0)
- Return values
-
None
Definition at line 438 of file usb_core.c.
void USB_EP_Tx | ( | USB_CORE_HANDLE * | pudev, |
uint8_t | EpAddr, | ||
uint8_t * | pbuf, | ||
uint16_t | BufLen | ||
) |
Endpoint prepare to transmit data.
- Parameters
-
pudev pointer to usb core instance EpAddr endpoint address In this parameter: bit0..bit6: endpoint number which is in (0..7) bit7: endpoint direction which can be IN(1) or OUT(0) pbuf transmit buffer address pointer BufLen buffer length
- Return values
-
None
Definition at line 376 of file usb_core.c.
uint16_t USB_GetRxCount | ( | USB_CORE_HANDLE * | pudev, |
uint8_t | EpID | ||
) |
Get the received data length.
- Parameters
-
pudev pointer to usb core instance EpID endpoint identifier which is in (0..7)
- Return values
-
Received data length
Definition at line 640 of file usb_core.c.
Generated by
