![]() |
USB Component
Version 6.5
MDK-Professional Middleware for USB Device and Host
|
Initialize and manage the USB Device Core. More...
Functions | |
usbStatus | USBD_Initialize (uint8_t device) |
Initialize USB Device stack and controller. | |
usbStatus | USBD_Uninitialize (uint8_t device) |
De-initialize USB Device stack and controller. | |
usbStatus | USBD_Connect (uint8_t device) |
Activate pull-up on D+ or D- line to signal USB Device connection on USB Bus. | |
usbStatus | USBD_Disconnect (uint8_t device) |
Disconnect USB Device from USB Bus. | |
bool | USBD_Configured (uint8_t device) |
Return USB Device configuration status. | |
Initialize and manage the USB Device Core.
The functions initialize and start the USB Device Core along with the related device classes. Use these functions prior to using any other class specific function. The two most important functions of the USB Device Core are:
bool USBD_Configured | ( | uint8_t | device | ) |
Return USB Device configuration status.
[in] | device | index of USB Device. |
The function USBD_Configured retrieves the configuration status of the USB Device. It determines whether the USB Device has been configured and is ready to communicate.
The argument device specifies the instance of the USB Device.
usbStatus USBD_Connect | ( | uint8_t | device | ) |
Activate pull-up on D+ or D- line to signal USB Device connection on USB Bus.
[in] | device | index of USB Device. |
The function USBD_Connect connects the USB Device to the USB Bus. This typically initiates the enumeration on the USB Host side for the USB Device.
The argument device specifies the instance of the USB Device.
Code Example
usbStatus USBD_Disconnect | ( | uint8_t | device | ) |
Disconnect USB Device from USB Bus.
[in] | device | index of USB Device. |
The function USBD_Disconnect disconnects the USB Device from the USB Bus. After executing this function the USB Device can no longer be accessed from the USB Host.
The argument device specifies the instance of the USB Device.
usbStatus USBD_Initialize | ( | uint8_t | device | ) |
Initialize USB Device stack and controller.
[in] | device | index of USB Device. |
The function USBD_Initialize initializes the USB Device Controller Core and Hardware Driver (such as the USB clock and pins). It starts all the tasks and sets up the main USB interrupt service routine. In any application, the USBD_Initialize function must be called before invoking any other USB Device function. The function does not initialize any non-USB hardware features.
The argument device specifies the instance of the USB Device.
Code Example
usbStatus USBD_Uninitialize | ( | uint8_t | device | ) |
De-initialize USB Device stack and controller.
[in] | device | index of USB Device. |
De-initialize the USB Device Controller Core and Hardware Driver. Invoke this function when USB is not to be used any more.
The argument device specifies the instance of the USB Device.