ModusToolbox USBFXStack
Functions

General Description

Functions

cy_en_hbdma_status_t Cy_HBDma_Init (LVDSSS_LVDS_Type *lvds_base, USB32DEV_Type *usbss_base, cy_stc_hbdma_context_t *pContext, uint32_t usb_egrs_fq_depth, uint32_t usb_egrs_rq_ctrl)
 Initializes the High BandWidth DMA driver. More...
 
void Cy_HBDma_DeInit (cy_stc_hbdma_context_t *pContext)
 De-initialize the High BandWidth DMA adapter. More...
 
cy_en_hbdma_status_t Cy_HBDma_GetDescriptor (uint16_t dscrIndex, cy_stc_hbdma_desc_t *dscr_p)
 Reads and returns the contents of the High BandWidth DMA descriptor with the specified index. More...
 
cy_en_hbdma_status_t Cy_HBDma_SetDescriptor (uint16_t dscrIndex, cy_stc_hbdma_desc_t *dscr_p)
 Updates the High BandWidth DMA descriptor at a specified index with the desired values. More...
 
cy_en_hbdma_status_t Cy_HBDma_GetSocketStatus (cy_stc_hbdma_context_t *pContext, cy_hbdma_socket_id_t sock_id, cy_stc_hbdma_sock_t *sckConf_p)
 Read and return the contents of all control and status registers associated with a High BandWidth DMA socket. More...
 
cy_en_hbdma_status_t Cy_HBDma_SetSocketConfig (cy_stc_hbdma_context_t *pContext, cy_hbdma_socket_id_t sock_id, cy_stc_hbdma_sockconfig_t *conf)
 Updates the configuration of a HBDma socket with the desired fields from the config structure passed in as parameter. More...
 
cy_en_hbdma_status_t Cy_HBDma_UpdateSockIntrMask (cy_stc_hbdma_context_t *pContext, cy_hbdma_socket_id_t sock_id, uint32_t intrMap, bool enable)
 Special function provided to update only the interrupt mask associated with a HBDma socket. More...
 
cy_en_hbdma_status_t Cy_HBDma_SocketEnable (cy_stc_hbdma_context_t *pContext, cy_hbdma_socket_id_t sock_id)
 Function to enable a High BandWidth DMA socket after it has been configured using the Cy_HBDma_SetSocketConfig API. More...
 
cy_en_hbdma_status_t Cy_HBDma_SocketDisable (cy_stc_hbdma_context_t *pContext, cy_hbdma_socket_id_t sock_id)
 Function to disable a High BandWidth DMA socket. More...
 
cy_en_hbdma_status_t Cy_HBDma_SocketSetWrapUp (cy_stc_hbdma_context_t *pContext, cy_hbdma_socket_id_t sock_id)
 This function sets the bit that forces a socket with a partially filled buffer to wrap up the buffer. More...
 
cy_en_hbdma_status_t Cy_HBDma_SendSocketEvent (cy_stc_hbdma_context_t *pContext, cy_hbdma_socket_id_t sock_id, bool isProduceEvent)
 Function to send an event notification to the specified socket. More...
 
cy_en_hbdma_status_t Cy_HbDma_ConnectEventTrigger (cy_stc_hbdma_context_t *pContext, cy_hbdma_socket_id_t src_sock, cy_hbdma_socket_id_t dst_sock, uint8_t trigNum)
 Function to connect the event trigger output from one socket to the input of another socket. More...
 
cy_en_hbdma_status_t Cy_HbDma_DisconnectEventTriggers (cy_stc_hbdma_context_t *pContext, cy_hbdma_socket_id_t dst_sock)
 Function to break all event trigger connections coming to a socket. More...
 
cy_en_hbdma_status_t Cy_HBDma_HandleInterrupts (cy_stc_hbdma_context_t *pContext, cy_hbdma_adapter_id_t adapter)
 Function which handles the interrupts generated by any of the sockets associated with a High BandWidth DMA adapter. More...
 
cy_en_hbdma_status_t Cy_HBDma_SetInterruptCallback (cy_stc_hbdma_context_t *pContext, cy_cb_hbdma_intr_callback_t cb_p, void *cbContext)
 Function that registers a callback which can be called the HBDma driver to provide notification of socket interrupts. More...
 
void Cy_HBDma_EvictReadCache (bool isCm4Access)
 Evicts the read cache used while masters are using either the Fast AHB bus (Cortex-M4) or the Slow AHB bus (Cortex-M0+, DataWire, DMAC or Crypto) to read content from the High BandWidth RAM area. More...
 
cy_en_hbdma_status_t Cy_HBDma_SetClockFrequency (cy_en_hbdma_clk_freq_t dmaFreq)
 Sets the high bandwidth DMA clock frequency to the desired value. More...
 
bool Cy_HBDma_Is64KBufferEnabled (cy_stc_hbdma_context_t *pDrvContext)
 Check whether 64KB DMA buffer support is enabled on the device. More...
 
void Cy_HBDma_SetUsbEgressAdapterDelay (cy_stc_hbdma_context_t *pDrvContext, uint8_t gblDelayCycles)
 Update the number of cycles of delay to be applied between consecutive AXI data fetches made by the USB egress DMA adapter. More...
 
void Cy_HBDma_SetLvdsAdapterIngressMode (cy_stc_hbdma_context_t *pDrvContext, bool isAdap0Ingress, bool isAdap1Ingress)
 This function enables or disables the support for egress data transfers from RAM buffers which are not 16-byte aligned based on whether the specified LVDS DMA adapters are working in Ingress only mode or not. More...
 
uint32_t Cy_HBDma_Mgr_GetVersion (void)
 Returns the High BandWidth Manager Middleware version information in the form of a 32-bit word including the major, minor, patch and build numbers. More...
 
cy_en_hbdma_mgr_status_t Cy_HBDma_DscrList_Create (cy_stc_hbdma_dscr_list_t *list_p, uint16_t maxDscrCount)
 Initialize the allocator used to manage High BandWidth DMA descriptors. More...
 
cy_en_hbdma_mgr_status_t Cy_HBDma_DscrList_Destroy (cy_stc_hbdma_dscr_list_t *list_p)
 De-initialize the allocator used to manage High BandWidth DMA descriptors. More...
 
cy_en_hbdma_mgr_status_t Cy_HBDma_DscrList_Get (cy_stc_hbdma_dscr_list_t *list_p, uint16_t *dscrIndex_p)
 Obtain a free HBW DMA descriptor from the free list. More...
 
cy_en_hbdma_mgr_status_t Cy_HBDma_DscrList_Put (cy_stc_hbdma_dscr_list_t *list_p, uint16_t dscrIndex)
 Release a HBW DMA descriptor back to the free list. More...
 
cy_en_hbdma_mgr_status_t Cy_HBDma_BufMgr_Create (cy_stc_hbdma_buf_mgr_t *mgr_p, uint32_t *baseAddr, uint32_t regionSize)
 This function initializes the custom heap used for DMA buffer allocation. More...
 
cy_en_hbdma_mgr_status_t Cy_HBDma_BufMgr_Destroy (cy_stc_hbdma_buf_mgr_t *mgr_p, bool freeAll)
 This function frees up the custom heap used for DMA buffer allocation. More...
 
void * Cy_HBDma_BufMgr_Alloc (cy_stc_hbdma_buf_mgr_t *mgr_p, uint32_t bufferSize)
 This function allocates memory required for DMA buffers required by the firmware application. More...
 
cy_en_hbdma_mgr_status_t Cy_HBDma_BufMgr_Free (cy_stc_hbdma_buf_mgr_t *mgr_p, void *buffer_p)
 This function frees memory which was previously allocated using Cy_HBDma_BufMgr_Alloc. More...
 
cy_en_hbdma_mgr_status_t Cy_HBDma_Mgr_Init (cy_stc_hbdma_mgr_context_t *context_p, cy_stc_hbdma_context_t *drvContext_p, cy_stc_hbdma_dscr_list_t *dscrPool_p, cy_stc_hbdma_buf_mgr_t *bufMgr_p)
 Initialize the High BandWidth DMA manager library. More...
 
cy_en_hbdma_mgr_status_t Cy_HBDma_Mgr_DeInit (cy_stc_hbdma_mgr_context_t *context_p)
 De-initialize the High BandWidth DMA manager library. More...
 
void Cy_HBDma_Mgr_RegisterUsbContext (cy_stc_hbdma_mgr_context_t *context_p, void *pUsbStackCtx)
 Register the USB stack context pointer with the High BandWidth manager. More...
 
cy_en_hbdma_mgr_status_t Cy_HBDma_Mgr_UpdateMultEn (cy_stc_hbdma_mgr_context_t *pContext, uint32_t endpNumber, bool isEgressEp, bool multEnable)
 Update the MULT setting for sockets associated with USB endpoints. More...
 
cy_en_hbdma_mgr_status_t Cy_HBDma_Channel_Create (cy_stc_hbdma_mgr_context_t *pDmaMgr, cy_stc_hbdma_channel_t *handle, cy_stc_hbdma_chn_config_t *config)
 Create a High BandWidth DMA channel based on the parameters specified in the config structure. More...
 
cy_en_hbdma_mgr_status_t Cy_HBDma_Channel_Destroy (cy_stc_hbdma_channel_t *handle)
 Destroy a High BandWidth DMA channel. More...
 
cy_en_hbdma_mgr_status_t Cy_HBDma_Channel_Enable (cy_stc_hbdma_channel_t *handle, uint32_t xferSize)
 Enable a High BandWidth DMA channel for data transfer. More...
 
cy_en_hbdma_mgr_status_t Cy_HBDma_Channel_Disable (cy_stc_hbdma_channel_t *handle)
 Disable a High BandWidth DMA channel. More...
 
cy_en_hbdma_mgr_status_t Cy_HBDma_Channel_Reset (cy_stc_hbdma_channel_t *handle)
 Reset a High BandWidth DMA channel. More...
 
cy_en_hbdma_mgr_status_t Cy_HBDma_Channel_SetWrapUp (cy_stc_hbdma_channel_t *pHandle, uint8_t sckOffset)
 This API is used to forcibly commit a DMA buffer to the consumer, and is useful in the case where data transfer has abruptly stopped without the producer being able to commit the data buffer. More...
 
cy_en_hbdma_mgr_status_t Cy_HBDma_Channel_GetBuffer (cy_stc_hbdma_channel_t *handle, cy_stc_hbdma_buff_status_t *bufStat_p)
 Get the status of the active DMA buffer associated with the DMA channel. More...
 
cy_en_hbdma_mgr_status_t Cy_HBDma_Channel_CommitBuffer (cy_stc_hbdma_channel_t *handle, cy_stc_hbdma_buff_status_t *bufStat_p)
 Mark a DMA buffer occupied on the consumer side of the DMA channel. More...
 
cy_en_hbdma_mgr_status_t Cy_HBDma_Channel_DiscardBuffer (cy_stc_hbdma_channel_t *handle, cy_stc_hbdma_buff_status_t *bufStat_p)
 Mark a DMA buffer empty on the producer side of the DMA channel. More...
 
cy_en_hbdma_mgr_status_t Cy_HBDma_Channel_SendData (cy_stc_hbdma_channel_t *handle, uint16_t sckIdx, uint8_t *dataBuf_p, uint32_t dataSize)
 Prepares to send data through a DMA channel. More...
 
cy_en_hbdma_mgr_status_t Cy_HBDma_Channel_WaitForSendCplt (cy_stc_hbdma_channel_t *handle, uint16_t sckIdx)
 Waits until the DMA transfer requested using Cy_HBDma_Channel_SendData API has been completed. More...
 
cy_en_hbdma_mgr_status_t Cy_HBDma_Channel_ReceiveData (cy_stc_hbdma_channel_t *handle, uint16_t sckIdx, uint8_t *dataBuf_p, uint32_t bufferSize, uint32_t *actualSize_p)
 Prepare to receive a specific amount of data using a DMA channel. More...
 
cy_en_hbdma_mgr_status_t Cy_HBDma_Channel_WaitForReceiveCplt (cy_stc_hbdma_channel_t *handle, uint16_t sckIdx, uint32_t *actualSize_p)
 Wait until a HBW DMA operation initiated using Cy_HBDma_Channel_ReceiveData has been completed. More...
 
cy_en_hbdma_mgr_status_t Cy_HBDma_Channel_GetBufferInfo (cy_stc_hbdma_channel_t *pHandle, uint8_t **pBufPtrs, uint8_t bufferCnt)
 Retrieve the set of DMA buffers associated with a HBDma channel. More...
 
cy_en_hbdma_mgr_status_t Cy_HBDma_Channel_AutoDropData (cy_stc_hbdma_channel_t *pHandle)
 This function allows an active Auto DMA channel to be configured to drop all data that is being received on the producer side. More...
 
bool Cy_HBDma_Channel_Cb (cy_hbdma_socket_id_t socketId, cy_en_hbdma_sock_evt_t intrType, uint32_t curDscr, void *userCtx)
 High BandWidth DMA channel callback function implementation. More...
 
void Cy_HBDma_Mgr_TaskHandler (void *pTaskParam)
 High BandWidth DMA manager task. More...
 
void Cy_HBDma_Mgr_RegisterISRCtrlCallback (cy_stc_hbdma_mgr_context_t *pDmaMgr, cy_cb_hbdma_mgr_intr_ctrl_cb_t cb)
 Register a function callback that the DMA manager can call to dynamically enable or disable the HBDMA interrupts based on the state of the interrupt notification message queue. More...
 
cy_en_hbdma_chn_state_t Cy_HBDma_Channel_GetChannelState (cy_stc_hbdma_channel_t *pHandle)
 Retrieve the state of DMA channel. More...
 
void Cy_HBDma_Mgr_DmaCallbackConfigure (cy_stc_hbdma_mgr_context_t *pDmaMgr, bool callbackFromISREnable)
 Function to configure context from which DMA callback functions are generated. More...
 
uint32_t Cy_HBDma_Mgr_GetIntrDropCount (cy_stc_hbdma_mgr_context_t *pDmaMgr)
 Function to get count of DMA interrupt messages dropped due to message queue overflow. More...
 
void Cy_HBDma_Mgr_SetUsbEgressAdapterDelay (cy_stc_hbdma_mgr_context_t *pDmaMgr, uint8_t gblDelayCycles)
 Update the number of cycles of delay to be applied between consecutive AXI data fetches made by the USB egress DMA adapter. More...
 
void Cy_HBDma_Mgr_SetLvdsAdapterIngressMode (cy_stc_hbdma_mgr_context_t *pDmaMgr, bool isAdap0Ingress, bool isAdap1Ingress)
 This function enables or disables the support for egress data transfers from RAM buffers which are not 16-byte aligned based on whether the specified LVDS DMA adapters are working in Ingress only mode or not. More...
 
cy_en_hbdma_mgr_status_t Cy_HBDma_DW_Configure (cy_stc_hbdma_channel_t *pHandle, bool enable)
 Configure the trigger connections for the DataWire used for transfers through a USB High-Speed Endpoint. More...
 
cy_en_hbdma_mgr_status_t Cy_HBDma_DW_QueueRead (cy_stc_hbdma_channel_t *pHandle, uint8_t prodIndex, uint8_t *pBuffer, uint32_t dataSize)
 Function which queues read operation using DataWire DMA on USBHS OUT endpoint corresponding to a DMA channel. More...
 
cy_en_hbdma_mgr_status_t Cy_HBDma_DW_CompleteShortRead (cy_stc_hbdma_channel_t *pHandle, uint8_t prodIndex, uint16_t shortPktSize)
 Function which terminates ongoing USBHS ingress transfer when a short packet has been received on the endpoint. More...
 
cy_en_hbdma_mgr_status_t Cy_HBDma_DW_QueueWrite (cy_stc_hbdma_channel_t *pHandle, uint8_t consIndex, uint8_t *pBuffer, uint32_t dataSize)
 Function which queues write operation using DataWire DMA on USBHS IN endpoint corresponding to a DMA channel. More...
 
void Cy_HBDma_Mgr_HandleDW0Interrupt (cy_stc_hbdma_mgr_context_t *pDmaMgr)
 DMA manager function that handles transfer completion interrupt from any of the DataWire channels associated with non EP0 USB-HS OUT endpoints (channels 1 to 15). More...
 
void Cy_HBDma_Mgr_HandleDW1Interrupt (cy_stc_hbdma_mgr_context_t *pDmaMgr)
 DMA manager function that handles transfer completion interrupt from any of the DataWire channels associated with non EP0 USB-HS IN endpoints (channels 1 to 15). More...
 
void Cy_HBDma_Mgr_HandleUsbShortInterrupt (cy_stc_hbdma_mgr_context_t *pDmaMgr, uint8_t epNum, uint16_t pktSize)
 DMA manager function that handles SLP or ZLP interrupts from USB-HS OUT endpoints. More...
 

Function Documentation

◆ Cy_HBDma_Init()

cy_en_hbdma_status_t Cy_HBDma_Init ( LVDSSS_LVDS_Type *  lvds_base,
USB32DEV_Type *  usbss_base,
cy_stc_hbdma_context_t pContext,
uint32_t  usb_egrs_fq_depth,
uint32_t  usb_egrs_rq_ctrl 
)

Initializes the High BandWidth DMA driver.

Pointers to the USB32DEV and LVDS control register blocks need to be passed as parameters while initializing the driver.

Parameters
lvds_basePointer to the LVDS IP control registers.
usbss_basePointer to the USB32DEV IP control registers.
pContextPointer to the HBDma driver context structure.
usb_egrs_fq_depthFetch queue depth setting to be set for the USB32DEV egress DMA adapter.
usb_egrs_rq_ctrlRead queue empty threshold to be set for the USB32DEV egress DMA adapter.
Returns
CY_HBDMA_SUCCESS if driver initialization is successful. CY_HBDMA_BAD_PARAM if the parameters passed in are invalid.

◆ Cy_HBDma_DeInit()

void Cy_HBDma_DeInit ( cy_stc_hbdma_context_t pContext)

De-initialize the High BandWidth DMA adapter.

This function also disables the DMA adapters associated with the LVDS and USB32DEV IP blocks.

Parameters
pContextPointer to the HBDma driver context structure.

◆ Cy_HBDma_GetDescriptor()

cy_en_hbdma_status_t Cy_HBDma_GetDescriptor ( uint16_t  dscrIndex,
cy_stc_hbdma_desc_t dscr_p 
)

Reads and returns the contents of the High BandWidth DMA descriptor with the specified index.

Parameters
dscrIndexIndex of the DMA descriptor to be fetched.
dscr_pPointer to structure to be filled with the descriptor information.
Returns
CY_HBDMA_SUCCESS if descriptor fetch is successful. CY_HBDMA_BAD_PARAM if the parameters passed in are invalid.

◆ Cy_HBDma_SetDescriptor()

cy_en_hbdma_status_t Cy_HBDma_SetDescriptor ( uint16_t  dscrIndex,
cy_stc_hbdma_desc_t dscr_p 
)

Updates the High BandWidth DMA descriptor at a specified index with the desired values.

Parameters
dscrIndexDMA descriptor index.
dscr_pStructure containing the values to be updated in the DMA descriptor.
Returns
CY_HBDMA_SUCCESS if descriptor update is successful. CY_HBDMA_BAD_PARAM if the parameters passed in are invalid.

◆ Cy_HBDma_GetSocketStatus()

cy_en_hbdma_status_t Cy_HBDma_GetSocketStatus ( cy_stc_hbdma_context_t pContext,
cy_hbdma_socket_id_t  sock_id,
cy_stc_hbdma_sock_t sckConf_p 
)

Read and return the contents of all control and status registers associated with a High BandWidth DMA socket.

This function can be used to check the current socket status, and also as the first step during a read-modify-write update of the socket configuration.

Parameters
pContextPointer to the driver context structure.
sock_idID of the socket whose status is to be retrieved.
sckConf_pPointer to structure to be filled with the socket status.
Returns
CY_HBDMA_SUCCESS if socket status read is successful. CY_HBDMA_BAD_PARAM if the parameters passed in are invalid.

◆ Cy_HBDma_SetSocketConfig()

cy_en_hbdma_status_t Cy_HBDma_SetSocketConfig ( cy_stc_hbdma_context_t pContext,
cy_hbdma_socket_id_t  sock_id,
cy_stc_hbdma_sockconfig_t conf 
)

Updates the configuration of a HBDma socket with the desired fields from the config structure passed in as parameter.

This API can be used to update the current descriptor, the interrupt masks and the various config bits associated with the socket functionality.

Parameters
pContextPointer to the driver context structure.
sock_idID of the socket whose configuration is to be updated.
confPointer to the desired socket configuration.
Returns
CY_HBDMA_SUCCESS if socket update is successful. CY_HBDMA_BAD_PARAM if the parameters passed in are invalid.

◆ Cy_HBDma_UpdateSockIntrMask()

cy_en_hbdma_status_t Cy_HBDma_UpdateSockIntrMask ( cy_stc_hbdma_context_t pContext,
cy_hbdma_socket_id_t  sock_id,
uint32_t  intrMap,
bool  enable 
)

Special function provided to update only the interrupt mask associated with a HBDma socket.

This is a subset of the functionality provided by the Cy_HBDma_SetSocketConfig API.

Parameters
pContextPointer to the HBDMA driver context structure.
sock_idID of the socket to be updated.
intrMapBit map specifying the interrupt mask bits to be updated.
enableWhether the interrupts specified in intrMap are to be enabled or disabled.
Returns
CY_HBDMA_SUCCESS if socket update is successful. CY_HBDMA_BAD_PARAM if the parameters passed in are invalid.

◆ Cy_HBDma_SocketEnable()

cy_en_hbdma_status_t Cy_HBDma_SocketEnable ( cy_stc_hbdma_context_t pContext,
cy_hbdma_socket_id_t  sock_id 
)

Function to enable a High BandWidth DMA socket after it has been configured using the Cy_HBDma_SetSocketConfig API.

If the socket has not been configured properly before it is enabled, it can result in unexpected transfers or errors.

Parameters
pContextPointer to HBDMA driver context structure.
sock_idID of the socket to be enabled.
Returns
CY_HBDMA_SUCCESS if socket update is successful. CY_HBDMA_BAD_PARAM if the parameters passed in are invalid.

◆ Cy_HBDma_SocketDisable()

cy_en_hbdma_status_t Cy_HBDma_SocketDisable ( cy_stc_hbdma_context_t pContext,
cy_hbdma_socket_id_t  sock_id 
)

Function to disable a High BandWidth DMA socket.

This function causes any ongoing DMA transfer on the socket to be aborted and blocks until the socket has moved into the disabled state.

Parameters
pContextPointer to HBDMA driver context structure.
sock_idID of the socket to be disabled.
Returns
CY_HBDMA_SUCCESS if socket update is successful. CY_HBDMA_BAD_PARAM if the parameters passed in are invalid.

◆ Cy_HBDma_SocketSetWrapUp()

cy_en_hbdma_status_t Cy_HBDma_SocketSetWrapUp ( cy_stc_hbdma_context_t pContext,
cy_hbdma_socket_id_t  sock_id 
)

This function sets the bit that forces a socket with a partially filled buffer to wrap up the buffer.

The function does not wait for the socket to wrap up. This API should be called after ensuring that the socket in question is not actively receiving data. Otherwise, this can result in data loss.

Parameters
pContextPointer to HBDMA driver context structure.
sock_idID of the socket to be wraped up.
Returns
CY_HBDMA_SUCCESS if socket update is successful. CY_HBDMA_BAD_PARAM if the parameters passed in are invalid.

◆ Cy_HBDma_SendSocketEvent()

cy_en_hbdma_status_t Cy_HBDma_SendSocketEvent ( cy_stc_hbdma_context_t pContext,
cy_hbdma_socket_id_t  sock_id,
bool  isProduceEvent 
)

Function to send an event notification to the specified socket.

Either a produce event or a consume event can be sent based on the use case and type of the socket.

Parameters
pContextPointer to HBDMA driver context structure.
sock_idID of the socket to which the event is to be sent.
isProduceEventSet to true for sending a produce event, false for consume event.
Returns
CY_HBDMA_SUCCESS if sending the event is successful. CY_HBDMA_BAD_PARAM if the parameters passed in are invalid.

◆ Cy_HbDma_ConnectEventTrigger()

cy_en_hbdma_status_t Cy_HbDma_ConnectEventTrigger ( cy_stc_hbdma_context_t pContext,
cy_hbdma_socket_id_t  src_sock,
cy_hbdma_socket_id_t  dst_sock,
uint8_t  trigNum 
)

Function to connect the event trigger output from one socket to the input of another socket.

The same mechanism is used for sending produce events from an ingress socket to an egress socket as well as for sending consume events from an egress socket to an ingress socket.

If the DMA configuration used is a 1:2 or a 2:1 channel, trigger outputs from multiple sockets can be connected to the input of one socket. The trigNum parameter is used to specify the index of the event trigger input on the destination side.

Parameters
pContextPointer to HBDMA driver context structure.
src_sockID of the socket which generates the produce or consume event trigger.
dst_sockID of the socket which receives the event trigger.
trigNumIndex of the trigger input on the destination socket. Can be 0 or 1.
Returns
CY_HBDMA_SUCCESS if the trigger connection is successful. CY_HBDMA_BAD_PARAM if the parameters passed in are invalid.

◆ Cy_HbDma_DisconnectEventTriggers()

cy_en_hbdma_status_t Cy_HbDma_DisconnectEventTriggers ( cy_stc_hbdma_context_t pContext,
cy_hbdma_socket_id_t  dst_sock 
)

Function to break all event trigger connections coming to a socket.

Parameters
pContextPointer to HBDMA driver context structure.
dst_sockID of the socket which receives the event trigger.
Returns
CY_HBDMA_SUCCESS if the operation is successful. CY_HBDMA_BAD_PARAM if the parameters passed in are invalid.

◆ Cy_HBDma_HandleInterrupts()

cy_en_hbdma_status_t Cy_HBDma_HandleInterrupts ( cy_stc_hbdma_context_t pContext,
cy_hbdma_adapter_id_t  adapter 
)

Function which handles the interrupts generated by any of the sockets associated with a High BandWidth DMA adapter.

This function is expected to be called from the ISR for the corresponding interrupt vector.

The interrupt handling in the driver is only a top-half implementation which notifies the HBDma manager layer and then clears the interrupt.

Parameters
pContextPointer to HBDMA driver context structure.
adapterIdentifies the adapter for which the interrupts are to be serviced.
Returns
CY_HBDMA_SUCCESS if the adapter specified is valid. CY_HBDMA_BAD_PARAM if invalid parameters are passed in.

◆ Cy_HBDma_SetInterruptCallback()

cy_en_hbdma_status_t Cy_HBDma_SetInterruptCallback ( cy_stc_hbdma_context_t pContext,
cy_cb_hbdma_intr_callback_t  cb_p,
void *  cbContext 
)

Function that registers a callback which can be called the HBDma driver to provide notification of socket interrupts.

The callback will be registered by the HBDma manager layer and will be called when the socket interrupts are serviced through the Cy_HBDma_HandleInterrupts function.

Parameters
pContextPointer to HBDMA driver context structure.
cb_pCallback function pointer.
cbContextOpaque user data to be passed to the callback function.
Returns
CY_HBDMA_SUCCESS if callback registration is successful. CY_HBDMA_BAD_PARAM if the parameters passed in are invalid.

◆ Cy_HBDma_EvictReadCache()

void Cy_HBDma_EvictReadCache ( bool  isCm4Access)

Evicts the read cache used while masters are using either the Fast AHB bus (Cortex-M4) or the Slow AHB bus (Cortex-M0+, DataWire, DMAC or Crypto) to read content from the High BandWidth RAM area.

This operation is required whenever a master is reading from the RAM while there is a possibility of the corresponding memory having been modified by DMA operations.

Parameters
isCm4AccessWhether the read cache used by Cortex-M4 is to be cleared. Set to false for all other masters.

◆ Cy_HBDma_SetClockFrequency()

cy_en_hbdma_status_t Cy_HBDma_SetClockFrequency ( cy_en_hbdma_clk_freq_t  dmaFreq)

Sets the high bandwidth DMA clock frequency to the desired value.

Please note that parameters in the USB block need to be set based on the operating USB speed and selected clock frequency. Hence, this function is expected to be called from the USB stack and not expected to be called directly.

Parameters
dmaFreqDesired DMA domain clock frequency.
Returns
CY_HBDMA_SUCCESS if clock setup is successful CY_HBDMA_BAD_PARAM if the parameter passed in is invalid.

◆ Cy_HBDma_Is64KBufferEnabled()

bool Cy_HBDma_Is64KBufferEnabled ( cy_stc_hbdma_context_t pDrvContext)

Check whether 64KB DMA buffer support is enabled on the device.

This feature is not supported on A0 silicon revision of FX10.

Parameters
pDrvContextPointer to DMA driver context structure.
Returns
true if 64KB DMA buffers are supported. false if 64KB DMA buffers are not supported.

◆ Cy_HBDma_SetUsbEgressAdapterDelay()

void Cy_HBDma_SetUsbEgressAdapterDelay ( cy_stc_hbdma_context_t pDrvContext,
uint8_t  gblDelayCycles 
)

Update the number of cycles of delay to be applied between consecutive AXI data fetches made by the USB egress DMA adapter.

The function is meant to be used by the USB stack based on current USB speed.

Parameters
pDrvContextPointer to DMA driver context structure.
gblDelayCyclesNumber of delay cycles to be applied in the range of 0 to 15.

◆ Cy_HBDma_SetLvdsAdapterIngressMode()

void Cy_HBDma_SetLvdsAdapterIngressMode ( cy_stc_hbdma_context_t pDrvContext,
bool  isAdap0Ingress,
bool  isAdap1Ingress 
)

This function enables or disables the support for egress data transfers from RAM buffers which are not 16-byte aligned based on whether the specified LVDS DMA adapters are working in Ingress only mode or not.

For any ingress-only adapter, this support can be disabled to gain better DMA performance.

Parameters
pDrvContextPointer to DMA driver context structure.
isAdap0IngressWhether adapter 0 (sockets 0 to 15) is being used only in ingress direction.
isAdap1IngressWhether adapter 1 (sockets 16 to 31) is being used only in ingress direction.

◆ Cy_HBDma_Mgr_GetVersion()

uint32_t Cy_HBDma_Mgr_GetVersion ( void  )

Returns the High BandWidth Manager Middleware version information in the form of a 32-bit word including the major, minor, patch and build numbers.

Returns
Version information for this library in the format: b31:28 -> Major Version b27:24 -> Minor Version b23:16 -> Patch Version b15:00 -> Build Number

◆ Cy_HBDma_DscrList_Create()

cy_en_hbdma_mgr_status_t Cy_HBDma_DscrList_Create ( cy_stc_hbdma_dscr_list_t list_p,
uint16_t  maxDscrCount 
)

Initialize the allocator used to manage High BandWidth DMA descriptors.

It is assumed that all descriptors are free for use after this API has been called.

Parameters
list_pPointer to the descriptor list structure to be initialized.
maxDscrCountMaximum number of descriptors to be allowed.
Returns
CY_HBDMA_MGR_SUCCESS if the allocator initialization is successful. CY_HBDMA_MGR_BAD_PARAM if the parameters are invalid.

◆ Cy_HBDma_DscrList_Destroy()

cy_en_hbdma_mgr_status_t Cy_HBDma_DscrList_Destroy ( cy_stc_hbdma_dscr_list_t list_p)

De-initialize the allocator used to manage High BandWidth DMA descriptors.

Parameters
list_pPointer to the descriptor list structure to be de-initialized.
Returns
CY_HBDMA_MGR_SUCCESS if the allocator de-init is successful. CY_HBDMA_MGR_BAD_PARAM if the parameter is invalid.

◆ Cy_HBDma_DscrList_Get()

cy_en_hbdma_mgr_status_t Cy_HBDma_DscrList_Get ( cy_stc_hbdma_dscr_list_t list_p,
uint16_t *  dscrIndex_p 
)

Obtain a free HBW DMA descriptor from the free list.

Parameters
list_pPointer to the descriptor list structure.
dscrIndex_pReturn parameter through which the descriptor index is returned.
Returns
CY_HBDMA_MGR_SUCCESS if a free descriptor is available and is being returned. CY_HBDMA_MGR_BAD_PARAM if the parameters are invalid. CY_HBDMA_MGR_MEMORY_ERROR if no descriptors are available.

◆ Cy_HBDma_DscrList_Put()

cy_en_hbdma_mgr_status_t Cy_HBDma_DscrList_Put ( cy_stc_hbdma_dscr_list_t list_p,
uint16_t  dscrIndex 
)

Release a HBW DMA descriptor back to the free list.

Note
The function will succeed even if the descriptor being freed was already free.
Parameters
list_pPointer to the descriptor list structure.
dscrIndexIndex of descriptor to be freed.
Returns
CY_HBDMA_MGR_SUCCESS if the descriptor free operation is successful. CY_HBDMA_MGR_BAD_PARAM if the parameters are invalid.

◆ Cy_HBDma_BufMgr_Create()

cy_en_hbdma_mgr_status_t Cy_HBDma_BufMgr_Create ( cy_stc_hbdma_buf_mgr_t mgr_p,
uint32_t *  baseAddr,
uint32_t  regionSize 
)

This function initializes the custom heap used for DMA buffer allocation.

These functions use a home-grown allocator in order to ensure that all DMA buffers allocated are cache line aligned (multiple of 64 bytes).

Parameters
mgr_pPointer to the buffer manager context structure.
baseAddrBase address of the memory region reserved for DMA buffers.
regionSizeSize of the memory region reserved for DMA buffers.
Returns
CY_HBDMA_MGR_SUCCESS if the custom heap init is successful. CY_HBDMA_MGR_BAD_PARAM in case of invalid parameters.

◆ Cy_HBDma_BufMgr_Destroy()

cy_en_hbdma_mgr_status_t Cy_HBDma_BufMgr_Destroy ( cy_stc_hbdma_buf_mgr_t mgr_p,
bool  freeAll 
)

This function frees up the custom heap used for DMA buffer allocation.

Parameters
mgr_pPointer to the buffer manager context structure.
freeAllWhether all memory buffers should be freed.
Returns
CY_HBDMA_MGR_SUCCESS if the heap de-init is successful. CY_HBDMA_MGR_BAD_PARAM if the parameters are invalid.

◆ Cy_HBDma_BufMgr_Alloc()

void * Cy_HBDma_BufMgr_Alloc ( cy_stc_hbdma_buf_mgr_t mgr_p,
uint32_t  bufferSize 
)

This function allocates memory required for DMA buffers required by the firmware application.

The size parameter will be rounded up to the next multiple of 64 as the allocator only provides memory blocks in multiples of 64 bytes.

Parameters
mgr_pPointer to DMA buffer manager.
bufferSizeSize of the DMA buffer to be allocated (in bytes).
Returns
Pointer to the DMA buffer.

◆ Cy_HBDma_BufMgr_Free()

cy_en_hbdma_mgr_status_t Cy_HBDma_BufMgr_Free ( cy_stc_hbdma_buf_mgr_t mgr_p,
void *  buffer_p 
)

This function frees memory which was previously allocated using Cy_HBDma_BufMgr_Alloc.

Parameters
mgr_pPointer to DMA buffer manager.
buffer_pPointer to the buffer to be freed.
Returns
CY_HBDMA_MGR_SUCCESS if the free operation is successful. CY_HBDMA_MGR_BAD_PARAM if the parameters are invalid.

◆ Cy_HBDma_Mgr_Init()

cy_en_hbdma_mgr_status_t Cy_HBDma_Mgr_Init ( cy_stc_hbdma_mgr_context_t context_p,
cy_stc_hbdma_context_t drvContext_p,
cy_stc_hbdma_dscr_list_t dscrPool_p,
cy_stc_hbdma_buf_mgr_t bufMgr_p 
)

Initialize the High BandWidth DMA manager library.

Parameters
context_pPointer to the DMA manager context structure.
drvContext_pPointer to the HBDMA driver context structure.
dscrPool_pPointer to the HBDMA descriptor list.
bufMgr_pPointer to the HBDMA buffer manager context.
Returns
CY_HBDMA_MGR_SUCCESS if the DMA manager init was successful. CY_HBDMA_MGR_BAD_PARAM if the parameters are invalid.

◆ Cy_HBDma_Mgr_DeInit()

cy_en_hbdma_mgr_status_t Cy_HBDma_Mgr_DeInit ( cy_stc_hbdma_mgr_context_t context_p)

De-initialize the High BandWidth DMA manager library.

Parameters
context_pPointer to the DMA manager context structure.
Returns
CY_HBDMA_MGR_SUCCESS if the manager de-init is successful. CY_HBDMA_MGR_BAD_PARAM if the context structure passed is invalid.

◆ Cy_HBDma_Mgr_RegisterUsbContext()

void Cy_HBDma_Mgr_RegisterUsbContext ( cy_stc_hbdma_mgr_context_t context_p,
void *  pUsbStackCtx 
)

Register the USB stack context pointer with the High BandWidth manager.

A valid stack context is required to make use of USB-HS endpoints and DataWire channels with the High BandWidth channel API.

Parameters
context_pPointer to the DMA manager context structure.
pUsbStackCtxPointer to USB stack context structure passed as an opaque pointer.

◆ Cy_HBDma_Mgr_UpdateMultEn()

cy_en_hbdma_mgr_status_t Cy_HBDma_Mgr_UpdateMultEn ( cy_stc_hbdma_mgr_context_t pContext,
uint32_t  endpNumber,
bool  isEgressEp,
bool  multEnable 
)

Update the MULT setting for sockets associated with USB endpoints.

When the MULT feature is enabled at the socket level, the USB32DEV endpoint memory is allowed to combine the data from multiple DMA buffers into one transfer burst, thereby getting better data throughput in typical use cases.

Warning
This function is expected to be called from the USB32 device stack and not directly by the user.
Parameters
pContextPointer to the DMA manager context structure.
endpNumberUSB endpoint index.
isEgressEpWhether this is an Egress endpoint.
multEnableWhether to enable the MULT feature.
Returns
CY_HBDMA_MGR_SUCCESS if the MULT setting is updated correctly. CY_HBDMA_MGR_BAD_PARAM if the parameters are invalid.

◆ Cy_HBDma_Channel_Create()

cy_en_hbdma_mgr_status_t Cy_HBDma_Channel_Create ( cy_stc_hbdma_mgr_context_t pDmaMgr,
cy_stc_hbdma_channel_t handle,
cy_stc_hbdma_chn_config_t config 
)

Create a High BandWidth DMA channel based on the parameters specified in the config structure.

Parameters
pDmaMgrPointer to the DMA manager context structure.
handleHandle to the DMA channel structure.
configDesired DMA channel configuration.
Returns
CY_HBDMA_MGR_SUCCESS if the channel creation is successful. CY_HBDMA_MGR_BAD_PARAM if the parameters are invalid.

◆ Cy_HBDma_Channel_Destroy()

cy_en_hbdma_mgr_status_t Cy_HBDma_Channel_Destroy ( cy_stc_hbdma_channel_t handle)

Destroy a High BandWidth DMA channel.

The implementation makes sure that the DMA sockets associated with the channel are disabled in addition to cleaning up the data structures and freeing memory elements.

Parameters
handleHandle to the DMA channel structure.
Returns
CY_HBDMA_MGR_SUCCESS if the channel destroy operation is successful. CY_HBDMA_MGR_BAD_PARAM if the parameters are invalid.

◆ Cy_HBDma_Channel_Enable()

cy_en_hbdma_mgr_status_t Cy_HBDma_Channel_Enable ( cy_stc_hbdma_channel_t handle,
uint32_t  xferSize 
)

Enable a High BandWidth DMA channel for data transfer.

Any sockets associated with the DMA channel will be enabled. If a non-zero xferSize is specified, the channel gets disabled automatically after transferring the specified amount of data.

Parameters
handleHandle to the DMA channel structure.
xferSizeSize of data to be transferred through the channel.
Returns
CY_HBDMA_MGR_SUCCESS if the channel enable operation is successful. CY_HBDMA_MGR_BAD_PARAM if the parameters are invalid.

◆ Cy_HBDma_Channel_Disable()

cy_en_hbdma_mgr_status_t Cy_HBDma_Channel_Disable ( cy_stc_hbdma_channel_t handle)

Disable a High BandWidth DMA channel.

Parameters
handleHandle to the DMA channel structure.
Returns
CY_HBDMA_MGR_SUCCESS if the channel disable operation is successful. CY_HBDMA_MGR_BAD_PARAM if the parameters are invalid.

◆ Cy_HBDma_Channel_Reset()

cy_en_hbdma_mgr_status_t Cy_HBDma_Channel_Reset ( cy_stc_hbdma_channel_t handle)

Reset a High BandWidth DMA channel.

This leaves all the DMA buffers associated with the channel in the empty state and the channel itself in the disabled state.

Parameters
handleHandle to the DMA channel structure.
Returns
CY_HBDMA_MGR_SUCCESS if the channel reset operation is successful. CY_HBDMA_MGR_BAD_PARAM if the parameters are invalid.

◆ Cy_HBDma_Channel_SetWrapUp()

cy_en_hbdma_mgr_status_t Cy_HBDma_Channel_SetWrapUp ( cy_stc_hbdma_channel_t pHandle,
uint8_t  sckOffset 
)

This API is used to forcibly commit a DMA buffer to the consumer, and is useful in the case where data transfer has abruptly stopped without the producer being able to commit the data buffer.

Parameters
pHandleHandle to the DMA channel structure.
sckOffsetSocket id to wrapup.
Returns
CY_HBDMA_MGR_SUCCESS if the channel reset operation is successful. CY_HBDMA_MGR_BAD_PARAM if the parameters are invalid. CY_HBDMA_MGR_SEQUENCE_ERROR if the DMA channel is not in the required state.

◆ Cy_HBDma_Channel_GetBuffer()

cy_en_hbdma_mgr_status_t Cy_HBDma_Channel_GetBuffer ( cy_stc_hbdma_channel_t handle,
cy_stc_hbdma_buff_status_t bufStat_p 
)

Get the status of the active DMA buffer associated with the DMA channel.

Parameters
handleHandle to the DMA channel structure.
bufStat_pReturn parameter to pass the buffer status through.
Returns
CY_HBDMA_MGR_SUCCESS if the operation is successful. CY_HBDMA_MGR_BAD_PARAM if the parameters are invalid. CY_HBDMA_MGR_SEQUENCE_ERROR if the API is called when the descriptor is not in the expected state.

◆ Cy_HBDma_Channel_CommitBuffer()

cy_en_hbdma_mgr_status_t Cy_HBDma_Channel_CommitBuffer ( cy_stc_hbdma_channel_t handle,
cy_stc_hbdma_buff_status_t bufStat_p 
)

Mark a DMA buffer occupied on the consumer side of the DMA channel.

Parameters
handleHandle to the DMA channel structure.
bufStat_pInformation about the buffer to be committed.
Returns
CY_HBDMA_MGR_SUCCESS if the commit operation is successful. CY_HBDMA_MGR_BAD_PARAM if the parameters are invalid.

◆ Cy_HBDma_Channel_DiscardBuffer()

cy_en_hbdma_mgr_status_t Cy_HBDma_Channel_DiscardBuffer ( cy_stc_hbdma_channel_t handle,
cy_stc_hbdma_buff_status_t bufStat_p 
)

Mark a DMA buffer empty on the producer side of the DMA channel.

Parameters
handleHandle to the DMA channel structure.
bufStat_pInformation about the buffer to be dropped.
Returns
CY_HBDMA_MGR_SUCCESS if the discard operation is successful. CY_HBDMA_MGR_BAD_PARAM if the parameters are invalid.

◆ Cy_HBDma_Channel_SendData()

cy_en_hbdma_mgr_status_t Cy_HBDma_Channel_SendData ( cy_stc_hbdma_channel_t handle,
uint16_t  sckIdx,
uint8_t *  dataBuf_p,
uint32_t  dataSize 
)

Prepares to send data through a DMA channel.

This API should be called when the channel is in the disabled state, and will return after the DMA operation has been queued. The Cy_HBDma_Channel_WaitForSendCplt function can be called to wait until the transfer is completed.

Parameters
handleHandle to the DMA channel structure.
sckIdxIndex of consumer socket through which data is to be sent.
dataBuf_pPointer to the buffer containing data to be sent.
dataSizeSize of data to be sent.
Returns
CY_HBDMA_MGR_SUCCESS if the data to be sent is queued successfully. CY_HBDMA_MGR_BAD_PARAM if the parameters are invalid. CY_HBDMA_MGR_SEQUENCE_ERROR if the channel is not idle.

◆ Cy_HBDma_Channel_WaitForSendCplt()

cy_en_hbdma_mgr_status_t Cy_HBDma_Channel_WaitForSendCplt ( cy_stc_hbdma_channel_t handle,
uint16_t  sckIdx 
)

Waits until the DMA transfer requested using Cy_HBDma_Channel_SendData API has been completed.

Parameters
handleHandle to the DMA channel structure.
sckIdxIndex of consumer socket through which data is to be sent.
Returns
CY_HBDMA_MGR_SUCCESS if the send operation was completed. CY_HBDMA_MGR_BAD_PARAM if the parameters are invalid. CY_HBDMA_MGR_SEQUENCE_ERROR if SendData has not been called previously. CY_HBDMA_MGR_TIMEOUT if the operation times out on the consumer side.

◆ Cy_HBDma_Channel_ReceiveData()

cy_en_hbdma_mgr_status_t Cy_HBDma_Channel_ReceiveData ( cy_stc_hbdma_channel_t handle,
uint16_t  sckIdx,
uint8_t *  dataBuf_p,
uint32_t  bufferSize,
uint32_t *  actualSize_p 
)

Prepare to receive a specific amount of data using a DMA channel.

This API should be called while the channel is in the disabled state and will return as soon as channel is enabled for data transfer.

Parameters
handleHandle to the DMA channel structure.
sckIdxIndex of the producer socket within the channel through which data will be received.
dataBuf_pPointer of buffer where the received data should be placed.
bufferSizeMaximum amount of data that may be received.
actualSize_pReturn parameter to get the actual received data size through (can be NULL).
Returns
CY_HBDMA_MGR_SUCCESS if the receive operation is queued successfully. CY_HBDMA_MGR_BAD_PARAM if the parameters are invalid. CY_HBDMA_MGR_SEQUENCE_ERROR if the channel is not idle.

◆ Cy_HBDma_Channel_WaitForReceiveCplt()

cy_en_hbdma_mgr_status_t Cy_HBDma_Channel_WaitForReceiveCplt ( cy_stc_hbdma_channel_t handle,
uint16_t  sckIdx,
uint32_t *  actualSize_p 
)

Wait until a HBW DMA operation initiated using Cy_HBDma_Channel_ReceiveData has been completed.

The actual amount of data read is returned through the actualSize_p parameter.

Parameters
handleHandle to the DMA channel structure.
sckIdxIndex of the producer socket in the channel to be used for data read.
actualSize_pOptional return parameter to get the actual size of data received.
Returns
CY_HBDMA_MGR_SUCCESS if the data is received successfully. CY_HBDMA_MGR_BAD_PARAM if the parameters are invalid. CY_HBDMA_MGR_SEQUENCE_ERROR if a previous ReceiveData call is not pending.

◆ Cy_HBDma_Channel_GetBufferInfo()

cy_en_hbdma_mgr_status_t Cy_HBDma_Channel_GetBufferInfo ( cy_stc_hbdma_channel_t pHandle,
uint8_t **  pBufPtrs,
uint8_t  bufferCnt 
)

Retrieve the set of DMA buffers associated with a HBDma channel.

Parameters
pHandleHandle to the DMA channel structure.
pBufPtrsReturn array to be filled with the DMA buffer pointers.
bufferCntNumber of buffer pointers to be fetched.
Returns
CY_HBDMA_MGR_SUCCESS if the buffer query is successful. CY_HBDMA_MGR_BAD_PARAM if the parameters are invalid.

◆ Cy_HBDma_Channel_AutoDropData()

cy_en_hbdma_mgr_status_t Cy_HBDma_Channel_AutoDropData ( cy_stc_hbdma_channel_t pHandle)

This function allows an active Auto DMA channel to be configured to drop all data that is being received on the producer side.

The channel has to be reset and then enabled to restore normal operation.

Parameters
pHandleHandle to the DMA channel structure.
Returns
CY_HBDMA_MGR_SUCCESS if the channel has been set up to drop the incoming data. CY_HBDMA_MGR_BAD_PARAM if the channel is not valid or not an AUTO channel. CY_HBDMA_MGR_SEQUENCE_ERROR if the channel is not active.

◆ Cy_HBDma_Channel_Cb()

bool Cy_HBDma_Channel_Cb ( cy_hbdma_socket_id_t  socketId,
cy_en_hbdma_sock_evt_t  intrType,
uint32_t  curDscr,
void *  userCtx 
)

High BandWidth DMA channel callback function implementation.

Parameters
socketIdSocket on which interrupt was received.
intrTypeType of interrupt which was received.
curDscrActive descriptor for the socket.
userCtxUser context for the callback.
Returns
true if further interrupt processing is to be disabled.

◆ Cy_HBDma_Mgr_TaskHandler()

void Cy_HBDma_Mgr_TaskHandler ( void *  pTaskParam)

High BandWidth DMA manager task.

Parameters
pTaskParamPointer to the HBDma manager context structure.

◆ Cy_HBDma_Mgr_RegisterISRCtrlCallback()

void Cy_HBDma_Mgr_RegisterISRCtrlCallback ( cy_stc_hbdma_mgr_context_t pDmaMgr,
cy_cb_hbdma_mgr_intr_ctrl_cb_t  cb 
)

Register a function callback that the DMA manager can call to dynamically enable or disable the HBDMA interrupts based on the state of the interrupt notification message queue.

Parameters
pDmaMgrPointer to the DMA manager context structure.
cbPointer to function callback.

◆ Cy_HBDma_Channel_GetChannelState()

cy_en_hbdma_chn_state_t Cy_HBDma_Channel_GetChannelState ( cy_stc_hbdma_channel_t pHandle)

Retrieve the state of DMA channel.

Parameters
pHandleHandle to the DMA channel structure.
Returns
channel state.

◆ Cy_HBDma_Mgr_DmaCallbackConfigure()

void Cy_HBDma_Mgr_DmaCallbackConfigure ( cy_stc_hbdma_mgr_context_t pDmaMgr,
bool  callbackFromISREnable 
)

Function to configure context from which DMA callback functions are generated.

Parameters
pDmaMgrPointer to DMA manager context structure.
callbackFromISREnableWhether sending of DMA callbacks directly from ISR is enabled.

◆ Cy_HBDma_Mgr_GetIntrDropCount()

uint32_t Cy_HBDma_Mgr_GetIntrDropCount ( cy_stc_hbdma_mgr_context_t pDmaMgr)

Function to get count of DMA interrupt messages dropped due to message queue overflow.

If the count is non-zero at any stage, it indicates that DMA interrupts are being generated too fast for the CPU to handle. Either larger DMA buffers should be used to reduce interrupt frequency or the Cy_HBDma_Mgr_RegisterISRCtrlCallback() API should be used to dynamically throttle DMA interrupts.

Parameters
pDmaMgrPointer to DMA manager context structure.
Returns
Count of DMA interrupt messages which have been dropped so far.

◆ Cy_HBDma_Mgr_SetUsbEgressAdapterDelay()

void Cy_HBDma_Mgr_SetUsbEgressAdapterDelay ( cy_stc_hbdma_mgr_context_t pDmaMgr,
uint8_t  gblDelayCycles 
)

Update the number of cycles of delay to be applied between consecutive AXI data fetches made by the USB egress DMA adapter.

The function is meant to be used by the USB stack based on current USB speed.

Parameters
pDmaMgrPointer to DMA manager context structure.
gblDelayCyclesNumber of delay cycles to be applied in the range of 0 to 15.

◆ Cy_HBDma_Mgr_SetLvdsAdapterIngressMode()

void Cy_HBDma_Mgr_SetLvdsAdapterIngressMode ( cy_stc_hbdma_mgr_context_t pDmaMgr,
bool  isAdap0Ingress,
bool  isAdap1Ingress 
)

This function enables or disables the support for egress data transfers from RAM buffers which are not 16-byte aligned based on whether the specified LVDS DMA adapters are working in Ingress only mode or not.

For any ingress-only adapter, this support can be disabled to gain better DMA performance.

Parameters
pDmaMgrPointer to DMA manager context structure.
isAdap0IngressWhether adapter 0 (sockets 0 to 15) is being used only in ingress direction.
isAdap1IngressWhether adapter 1 (sockets 16 to 31) is being used only in ingress direction.

◆ Cy_HBDma_DW_Configure()

cy_en_hbdma_mgr_status_t Cy_HBDma_DW_Configure ( cy_stc_hbdma_channel_t pHandle,
bool  enable 
)

Configure the trigger connections for the DataWire used for transfers through a USB High-Speed Endpoint.

Parameters
pHandleHandle to the DMA channel.
enableWhether trigger connections are to be enabled or disabled.
Returns
CY_HBDMA_MGR_SUCCESS if function is successful, error code otherwise.

◆ Cy_HBDma_DW_QueueRead()

cy_en_hbdma_mgr_status_t Cy_HBDma_DW_QueueRead ( cy_stc_hbdma_channel_t pHandle,
uint8_t  prodIndex,
uint8_t *  pBuffer,
uint32_t  dataSize 
)

Function which queues read operation using DataWire DMA on USBHS OUT endpoint corresponding to a DMA channel.

Parameters
pHandleHandle to the DMA channel.
prodIndexIndex of the producer from which to read data.
pBufferPointer to the data buffer to read data into.
dataSizeSize of data expected. This should be a multiple of the max packet size.
Returns
CY_HBDMA_MGR_SUCCESS if function is successful, error code otherwise.

◆ Cy_HBDma_DW_CompleteShortRead()

cy_en_hbdma_mgr_status_t Cy_HBDma_DW_CompleteShortRead ( cy_stc_hbdma_channel_t pHandle,
uint8_t  prodIndex,
uint16_t  shortPktSize 
)

Function which terminates ongoing USBHS ingress transfer when a short packet has been received on the endpoint.

Parameters
pHandleHandle to the DMA channel.
prodIndexIndex of the producer from which to read data.
shortPktSizeSize of the short packet received in bytes.
Returns
CY_HBDMA_MGR_SUCCESS if function is successful, error code otherwise.

◆ Cy_HBDma_DW_QueueWrite()

cy_en_hbdma_mgr_status_t Cy_HBDma_DW_QueueWrite ( cy_stc_hbdma_channel_t pHandle,
uint8_t  consIndex,
uint8_t *  pBuffer,
uint32_t  dataSize 
)

Function which queues write operation using DataWire DMA on USBHS IN endpoint corresponding to a DMA channel.

Parameters
pHandleHandle to the DMA channel.
consIndexIndex of the consumer to write data into.
pBufferPointer to the data buffer containing the data.
dataSizeSize of data to be transferred.
Returns
CY_HBDMA_MGR_SUCCESS if function is successful, error code otherwise.

◆ Cy_HBDma_Mgr_HandleDW0Interrupt()

void Cy_HBDma_Mgr_HandleDW0Interrupt ( cy_stc_hbdma_mgr_context_t pDmaMgr)

DMA manager function that handles transfer completion interrupt from any of the DataWire channels associated with non EP0 USB-HS OUT endpoints (channels 1 to 15).

Parameters
pDmaMgrHandle to the DMA manager context.

◆ Cy_HBDma_Mgr_HandleDW1Interrupt()

void Cy_HBDma_Mgr_HandleDW1Interrupt ( cy_stc_hbdma_mgr_context_t pDmaMgr)

DMA manager function that handles transfer completion interrupt from any of the DataWire channels associated with non EP0 USB-HS IN endpoints (channels 1 to 15).

Parameters
pDmaMgrHandle to the DMA manager context.

◆ Cy_HBDma_Mgr_HandleUsbShortInterrupt()

void Cy_HBDma_Mgr_HandleUsbShortInterrupt ( cy_stc_hbdma_mgr_context_t pDmaMgr,
uint8_t  epNum,
uint16_t  pktSize 
)

DMA manager function that handles SLP or ZLP interrupts from USB-HS OUT endpoints.

This is expected to be triggered from interrupt callback provided by the USB stack.

Parameters
pDmaMgrHandle to the DMA manager context.
epNumEndpoint number on which SLP/ZLP was received.
pktSizeActual size (in bytes) of the packet received.