Data Endpoint Configuration Functions

group group_usbfs_dev_hal_functions_endpoint_config

The Data Endpoint Configuration Functions provide an API to allocate and release hardware resources and override the memcpy function for the data endpoints.

Functions

__STATIC_INLINE cy_en_usbfs_dev_drv_status_t Cy_USBFS_Dev_Drv_AddEndpoint (USBFS_Type *base, cy_stc_usb_dev_ep_config_t const *config, cy_stc_usbfs_dev_drv_context_t *context)

Configures a data endpoint for the following operation (allocates hardware resources for data endpoint).

Parameters
  • base – The pointer to the USBFS instance.

  • config – The pointer to data endpoint configuration cy_stc_usb_dev_ep_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_en_usbfs_dev_drv_status_t Cy_USBFS_Dev_Drv_RemoveEndpoint(USBFS_Type *base, uint32_t endpointAddr, cy_stc_usbfs_dev_drv_context_t *context)

Removes a data endpoint (release hardware resources allocated by data endpoint).

Parameters
  • base – The pointer to the USBFS instance.

  • endpointAddr – The data endpoint address (7 bit - direction, 3-0 bits - endpoint number).

  • 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

Status code of the function execution cy_en_usbfs_dev_drv_status_t.

__STATIC_INLINE void Cy_USBFS_Dev_Drv_OverwriteMemcpy (USBFS_Type const *base, uint32_t endpoint, cy_fn_usbfs_dev_drv_memcpy_ptr_t memcpyFunc, cy_stc_usbfs_dev_drv_context_t *context)

Overwrites the memory copy (memcpy) function used to copy data with the user- implemented:

Parameters
  • base – The pointer to the USBFS instance.

  • endpoint – The data endpoint number.

  • memcpyFunc – The pointer to the function that copies data.

  • 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.