The Initialization functions provide an API to begin the USBFS driver operation (configure and enable) and to stop operation (disable and de-initialize).
|
cy_en_usbfs_dev_drv_status_t | Cy_USBFS_Dev_Drv_Init (USBFS_Type *base, cy_stc_usbfs_dev_drv_config_t const *config, cy_stc_usbfs_dev_drv_context_t *context) |
| Initializes the USBFS in device mode. More...
|
|
void | Cy_USBFS_Dev_Drv_DeInit (USBFS_Type *base, cy_stc_usbfs_dev_drv_context_t *context) |
| De-initializes the USBFS Device hardware (returns the register values to default) and removes all registered callbacks. More...
|
|
void | Cy_USBFS_Dev_Drv_Enable (USBFS_Type *base, cy_stc_usbfs_dev_drv_context_t const *context) |
| Enables the USBFS Device operation. More...
|
|
void | Cy_USBFS_Dev_Drv_Disable (USBFS_Type *base, cy_stc_usbfs_dev_drv_context_t *context) |
| Disables the USBFS Device operation. More...
|
|
__STATIC_INLINE void | Cy_USBFS_Dev_Drv_SetAddress (USBFS_Type *base, uint8_t address, cy_stc_usbfs_dev_drv_context_t *context) |
| Posts a request to set the device address after the completion status stage of the control transfer. More...
|
|
__STATIC_INLINE void | Cy_USBFS_Dev_Drv_SetDeviceAddress (USBFS_Type *base, uint8_t address) |
| Sets the device address (writes the address directly into the register). More...
|
|
__STATIC_INLINE uint32_t | Cy_USBFS_Dev_Drv_GetDeviceAddress (USBFS_Type const *base) |
| Returns the device address (reads the address directly from the register). More...
|
|
__STATIC_INLINE void | Cy_USBFS_Dev_Drv_SetDevContext (USBFS_Type const *base, void *devContext, cy_stc_usbfs_dev_drv_context_t *context) |
| Stores a pointer to the USB Device context in the driver context. More...
|
|
__STATIC_INLINE void * | Cy_USBFS_Dev_Drv_GetDevContext (USBFS_Type const *base, cy_stc_usbfs_dev_drv_context_t *context) |
| Returns a pointer to the USB Device context. More...
|
|
void | Cy_USBFS_Dev_Drv_ConfigDevice (USBFS_Type *base, cy_stc_usbfs_dev_drv_context_t *context) |
| Sets the basic device configuration (clears previous configuration). More...
|
|
void | Cy_USBFS_Dev_Drv_UnConfigureDevice (USBFS_Type *base, cy_stc_usbfs_dev_drv_context_t *context) |
| Clears device configuration. More...
|
|
◆ Cy_USBFS_Dev_Drv_Init()
Initializes the USBFS in device mode.
If DMAs are used, initialize the DMAs.
- Parameters
-
base | The pointer to the USBFS instance. |
config | The pointer to the configuration structure cy_stc_usbfs_dev_drv_config_t. |
context | The pointer to the context structure cy_stc_usbfs_dev_drv_context_t allocated by the user. The structure is used during the USBFS Device operation for internal configuration and data retention. The user must not modify anything in this structure. |
- Returns
- The status code of the function execution cy_en_usbfs_dev_drv_status_t.
◆ Cy_USBFS_Dev_Drv_DeInit()
De-initializes the USBFS Device hardware (returns the register values to default) and removes all registered callbacks.
- Parameters
-
base | The pointer to the USBFS instance. |
context | The pointer to the context structure cy_stc_usbfs_dev_drv_context_t allocated by the user. The structure is used during the USBFS Device operation for internal configuration and data retention. The user must not modify anything in this structure. |
◆ Cy_USBFS_Dev_Drv_Enable()
Enables the USBFS Device operation.
- Parameters
-
base | The pointer to the USBFS instance. |
context | The pointer to the context structure cy_stc_usbfs_dev_drv_context_t allocated by the user. The structure is used during the USBFS Device operation for internal configuration and data retention. The user must not modify anything in this structure. |
◆ Cy_USBFS_Dev_Drv_Disable()
Disables the USBFS Device operation.
If DMAs are used, disables the DMAs.
- Parameters
-
base | The pointer to the USBFS instance. |
context | The pointer to the context structure cy_stc_usbfs_dev_drv_context_t allocated by the user. The structure is used during the USBFS Device operation for internal configuration and data retention. The user must not modify anything in this structure. |
◆ Cy_USBFS_Dev_Drv_SetAddress()
Posts a request to set the device address after the completion status stage of the control transfer.
This function must be used if a higher level requests to set an address before the status stage of the control transfer.
- Parameters
-
base | The pointer to the USBFS instance. |
address | The device address. |
context | The pointer to the context structure cy_stc_usbfs_dev_drv_context_t allocated by the user. The structure is used during the USBFS Device operation for internal configuration and data retention. The user must not modify anything in this structure. |
◆ Cy_USBFS_Dev_Drv_SetDeviceAddress()
__STATIC_INLINE void Cy_USBFS_Dev_Drv_SetDeviceAddress |
( |
USBFS_Type * |
base, |
|
|
uint8_t |
address |
|
) |
| |
Sets the device address (writes the address directly into the register).
- Parameters
-
base | The pointer to the USBFS instance. |
address | Device address. |
◆ Cy_USBFS_Dev_Drv_GetDeviceAddress()
__STATIC_INLINE uint32_t Cy_USBFS_Dev_Drv_GetDeviceAddress |
( |
USBFS_Type const * |
base | ) |
|
Returns the device address (reads the address directly from the register).
- Parameters
-
base | The pointer to the USBFS instance. |
- Returns
- The device address. The device address is assigned by the Host during device enumeration. Zero means that the device address is not assigned.
◆ Cy_USBFS_Dev_Drv_SetDevContext()
Stores a pointer to the USB Device context in the driver context.
- Parameters
-
base | The pointer to the USBFS instance |
devContext | The pointer to the USB Device context structure. |
context | The pointer to the context structure cy_stc_usbfs_dev_drv_context_t allocated by the user. The structure is used during the USBFS Device operation for internal configuration and data retention. The user must not modify anything in this structure. |
- Note
- This function is intended for the USB Device middleware operation.
◆ Cy_USBFS_Dev_Drv_GetDevContext()
Returns a pointer to the USB Device context.
- Parameters
-
base | The pointer to the USBFS instance. |
context | The pointer to the context structure cy_stc_usbfs_dev_drv_context_t allocated by the user. The structure is used during USBFS Device operation for internal configuration and data retention. The user must not modify anything in this structure. |
- Returns
- The pointer to the USB Device context.
- Note
- This function is intended for the USB Device middleware operation.
◆ Cy_USBFS_Dev_Drv_ConfigDevice()
Sets the basic device configuration (clears previous configuration).
Call this function after the endpoints were configured to complete the device configuration.
- Parameters
-
base | The pointer to the USBFS instance. |
context | The pointer to the context structure cy_stc_usbfs_dev_drv_context_t allocated by the user. The structure is used during the USBFS Device operation for internal configuration and data retention. The user must not modify anything in this structure. |
◆ Cy_USBFS_Dev_Drv_UnConfigureDevice()
Clears device configuration.
Call this function before setting a configuration or a configuration failure to set the configuration into the default state. Alternately, call Cy_USBFS_Dev_Drv_RemoveEndpoint for each active endpoint.
- Parameters
-
base | The pointer to the USBFS instance. |
context | The pointer to the context structure cy_stc_usbfs_dev_drv_context_t allocated by the user. The structure is used during the USBFS Device operation for internal configuration and data retention. The user must not modify anything in this structure. |