MTB CAT1 Peripheral driver library
Data Endpoint Configuration Functions

General Description

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). More...
 
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). More...
 
__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: More...
 

Function Documentation

◆ Cy_USBFS_Dev_Drv_AddEndpoint()

__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
baseThe pointer to the USBFS instance.
configThe pointer to data endpoint configuration cy_stc_usb_dev_ep_config_t.
contextThe 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_RemoveEndpoint()

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
baseThe pointer to the USBFS instance.
endpointAddrThe data endpoint address (7 bit - direction, 3-0 bits - endpoint number).
contextThe 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.

◆ Cy_USBFS_Dev_Drv_OverwriteMemcpy()

__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
baseThe pointer to the USBFS instance.
endpointThe data endpoint number.
memcpyFuncThe pointer to the function that copies data.
contextThe 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.