USB Device Middleware Library 2.10
Initialization Functions

General Description

Functions

cy_en_usb_dev_status_t Cy_USB_Dev_Init (USBFS_Type *base, struct cy_stc_usbfs_dev_drv_config const *drvConfig, struct cy_stc_usbfs_dev_drv_context *drvContext, cy_stc_usb_dev_device_t const *device, cy_stc_usb_dev_config_t const *config, cy_stc_usb_dev_context_t *context)
 Initialize the USB Device stack and underneath USBFS hardware driver. More...
 
void Cy_USB_Dev_DeInit (cy_stc_usb_dev_context_t *context)
 De-initialize the USB Device stack and underneath hardware driver. More...
 
cy_en_usb_dev_status_t Cy_USB_Dev_Connect (bool blocking, int32_t timeout, cy_stc_usb_dev_context_t *context)
 Enables pull-up on D+ (hardware supports only full-speed device) line to signal USB Device connection on USB Bus. More...
 
void Cy_USB_Dev_Disconnect (cy_stc_usb_dev_context_t *context)
 Disables pull-up on D+ (hardware supports only full-speed device) line to signal USB Device disconnection on USB Bus. More...
 

Function Documentation

◆ Cy_USB_Dev_Init()

cy_en_usb_dev_status_t Cy_USB_Dev_Init ( USBFS_Type *  base,
struct cy_stc_usbfs_dev_drv_config const *  drvConfig,
struct cy_stc_usbfs_dev_drv_context *  drvContext,
cy_stc_usb_dev_device_t const *  device,
cy_stc_usb_dev_config_t const *  config,
cy_stc_usb_dev_context_t context 
)

Initialize the USB Device stack and underneath USBFS hardware driver.

Parameters
baseThe pointer to the USBFS instance.
drvConfigThe pointer to the USBFS driver configuration structure.
drvContextThe pointer to the USBFS driver context structure allocated by the user. The structure is used during the USBFS driver operation for internal configuration and data retention. The user must not modify anything in this structure.
deviceThe pointer to the device structure cy_stc_usb_dev_device_t.
configThe pointer to the driver configuration structure cy_stc_usb_dev_config_t.
contextThe pointer to the context structure cy_stc_usb_dev_context_t allocated by the user. The structure is used during the USB Device operation for internal configuration and data retention. The user must not modify anything in this structure.
Returns
Status code of the function execution cy_en_usb_dev_status_t.
Note
The configuration of USB clocks, pins, and interrupts is not handled by this function and must be done on the application level.

◆ Cy_USB_Dev_DeInit()

void Cy_USB_Dev_DeInit ( cy_stc_usb_dev_context_t context)

De-initialize the USB Device stack and underneath hardware driver.

Parameters
contextThe pointer to the context structure cy_stc_usb_dev_context_t allocated by the user. The structure is used during the USB Device operation for internal configuration and data retention. The user must not modify anything in this structure.

◆ Cy_USB_Dev_Connect()

cy_en_usb_dev_status_t Cy_USB_Dev_Connect ( bool  blocking,
int32_t  timeout,
cy_stc_usb_dev_context_t context 
)

Enables pull-up on D+ (hardware supports only full-speed device) line to signal USB Device connection on USB Bus.

Parameters
blockingWait until device is configured.
timeoutDefines in milliseconds the time for which this function can block. If that time expires, the USB Device is disconnected and the function returns. To wait forever, pass CY_USB_DEV_WAIT_FOREVER.
contextThe pointer to the context structure cy_stc_usb_dev_context_t allocated by the user. The structure is used during the USB Device operation for internal configuration and data retention. The user must not modify anything in this structure.

◆ Cy_USB_Dev_Disconnect()

void Cy_USB_Dev_Disconnect ( cy_stc_usb_dev_context_t context)

Disables pull-up on D+ (hardware supports only full-speed device) line to signal USB Device disconnection on USB Bus.

Parameters
contextThe pointer to the context structure cy_stc_usb_dev_context_t allocated by the user. The structure is used during the USB Device operation for internal configuration and data retention. The user must not modify anything in this structure.