Data Structures

group group_usbfs_dev_drv_data_structures

Typedefs

typedef void (*cy_cb_usbfs_dev_drv_callback_t)(USBFS_Type *base, struct cy_stc_usbfs_dev_drv_context *context)

Provides the typedef for the callback function called in the Cy_USBFS_Dev_Drv_Interrupt to notify the user interrupt events.

typedef void (*cy_cb_usbfs_dev_drv_ep_callback_t)(USBFS_Type *base, uint32_t endpointAddr, uint32_t errorType, struct cy_stc_usbfs_dev_drv_context *context)

Provides the typedef for the callback function called in the Cy_USBFS_Dev_Drv_Interrupt to notify the user about endpoint transfer completion event.

typedef uint8_t *(*cy_fn_usbfs_dev_drv_memcpy_ptr_t)(uint8_t *dest, const uint8_t *src, uint32_t size)

Provides the typedef for the user defined function to replace library provided memcpy function to copy data from endpoint buffer to the user buffer.

struct cy_stc_usb_dev_ep_config_t
#include <cy_usbfs_dev_drv.h>

Data Endpoint Configuration Structure.

Public Members

bool enableEndpoint

Defines if the endpoint becomes active after configuration.

bool allocBuffer

Defines if the endpoint needs buffer allocation.

uint16_t maxPacketSize

The endpoint max packet size.

uint16_t bufferSize

The endpoint buffer size (the biggest max packet size across all alternate for this endpoint)

uint8_t endpointAddr

The endpoint address (number plus direction bit)

uint8_t attributes

The endpoint attributes.

struct cy_stc_usbfs_dev_drv_dma_config_t
#include <cy_usbfs_dev_drv.h>

DMA Channel Configuration Structure.

Public Members

DW_Type *base

Pointer to the DMA base.

uint32_t chNum

Channel number.

uint32_t priority

Channel’s priority.

bool preemptable

Specifies whether the channel is preempt-able by another higher-priority channel.

uint32_t outTrigMux

DMA out trigger mux (applicable only when mode is CY_USBFS_DEV_DRV_EP_MANAGEMENT_DMA_AUTO)

cy_stc_dma_descriptor_t *descr0

The pointer to the 1st allocated DMA descriptor (required for DMA operation)

cy_stc_dma_descriptor_t *descr1

The pointer to the 2nd allocated DMA descriptor (required when mode is CY_USBFS_DEV_DRV_EP_MANAGEMENT_DMA_AUTO)

struct cy_stc_usbfs_dev_drv_config_t
#include <cy_usbfs_dev_drv.h>

Driver Configuration Structure.

Public Members

cy_en_usbfs_dev_drv_ep_management_mode_t mode

Endpoints management mode.

const cy_stc_usbfs_dev_drv_dma_config_t *dmaConfig[CY_USBFS_DEV_DRV_NUM_EPS_MAX]

DMA channels configuration for the endpoints.

Only DMChannels for active endpoints must be configured. Provide NULL pointer if endpoint is not used. Applicable when mode is CY_USBFS_DEV_DRV_EP_MANAGEMENT_DMA or CY_USBFS_DEV_DRV_EP_MANAGEMENT_DMA_AUTO.

uint8_t *epBuffer

The pointer to the buffer allocated for the OUT endpoints (applicable only when mode is CY_USBFS_DEV_DRV_EP_MANAGEMENT_DMA_AUTO)

uint16_t epBufferSize

The size of the buffer for the OUT endpoints (applicable only when mode is CY_USBFS_DEV_DRV_EP_MANAGEMENT_DMA_AUTO)

uint32_t intrLevelSel

The mask that assigns interrupt sources to trigger: Low, Medium, or High interrupt.

Use the macros provided in group_usbfs_dev_drv_macros_intr_level to initialize the intrLevelSel mask.

bool enableLpm

Enables LPM (Link Power Management) response.

cy_en_usbfs_dev_ep_access_t epAccess

Data endpoints access type.

struct cy_stc_usbfs_dev_drv_context_t
#include <cy_usbfs_dev_drv.h>

USBFS Device context structure.

All fields for the context structure are internal. The firmware never reads or writes these values. The firmware allocates a structure and provides the address of the structure to the middleware in HID function calls. The firmware must ensure that the defined instance of this structure remains in scope while the middleware is in use.