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... | |
| 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.
| lvds_base | Pointer to the LVDS IP control registers. |
| usbss_base | Pointer to the USB32DEV IP control registers. |
| pContext | Pointer to the HBDma driver context structure. |
| usb_egrs_fq_depth | Fetch queue depth setting to be set for the USB32DEV egress DMA adapter. |
| usb_egrs_rq_ctrl | Read queue empty threshold to be set for the USB32DEV egress DMA adapter. |
| 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.
| pContext | Pointer to the HBDma driver context structure. |
| 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.
| dscrIndex | Index of the DMA descriptor to be fetched. |
| dscr_p | Pointer to structure to be filled with the descriptor information. |
| 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.
| dscrIndex | DMA descriptor index. |
| dscr_p | Structure containing the values to be updated in the DMA descriptor. |
| 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.
| pContext | Pointer to the driver context structure. |
| sock_id | ID of the socket whose status is to be retrieved. |
| sckConf_p | Pointer to structure to be filled with the socket status. |
| 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.
| pContext | Pointer to the driver context structure. |
| sock_id | ID of the socket whose configuration is to be updated. |
| conf | Pointer to the desired socket configuration. |
| 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.
| pContext | Pointer to the HBDMA driver context structure. |
| sock_id | ID of the socket to be updated. |
| intrMap | Bit map specifying the interrupt mask bits to be updated. |
| enable | Whether the interrupts specified in intrMap are to be enabled or disabled. |
| 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.
| pContext | Pointer to HBDMA driver context structure. |
| sock_id | ID of the socket to be enabled. |
| 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.
| pContext | Pointer to HBDMA driver context structure. |
| sock_id | ID of the socket to be disabled. |
| 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.
| pContext | Pointer to HBDMA driver context structure. |
| sock_id | ID of the socket to be wraped up. |
| 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.
| pContext | Pointer to HBDMA driver context structure. |
| sock_id | ID of the socket to which the event is to be sent. |
| isProduceEvent | Set to true for sending a produce event, false for consume event. |
| 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.
| pContext | Pointer to HBDMA driver context structure. |
| src_sock | ID of the socket which generates the produce or consume event trigger. |
| dst_sock | ID of the socket which receives the event trigger. |
| trigNum | Index of the trigger input on the destination socket. Can be 0 or 1. |
| 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.
| pContext | Pointer to HBDMA driver context structure. |
| dst_sock | ID of the socket which receives the event trigger. |
| 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.
| pContext | Pointer to HBDMA driver context structure. |
| adapter | Identifies the adapter for which the interrupts are to be serviced. |
| 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.
| pContext | Pointer to HBDMA driver context structure. |
| cb_p | Callback function pointer. |
| cbContext | Opaque user data to be passed to the callback function. |
| 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.
| isCm4Access | Whether the read cache used by Cortex-M4 is to be cleared. Set to false for all other masters. |
| 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.
| dmaFreq | Desired DMA domain clock frequency. |
| 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.
| pDrvContext | Pointer to DMA driver context structure. |
| 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.
| pDrvContext | Pointer to DMA driver context structure. |
| gblDelayCycles | Number of delay cycles to be applied in the range of 0 to 15. |
| 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.
| pDrvContext | Pointer to DMA driver context structure. |
| isAdap0Ingress | Whether adapter 0 (sockets 0 to 15) is being used only in ingress direction. |
| isAdap1Ingress | Whether adapter 1 (sockets 16 to 31) is being used only in ingress direction. |
| 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.
| 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.
| list_p | Pointer to the descriptor list structure to be initialized. |
| maxDscrCount | Maximum number of descriptors to be allowed. |
| 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.
| list_p | Pointer to the descriptor list structure to be de-initialized. |
| 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.
| list_p | Pointer to the descriptor list structure. |
| dscrIndex_p | Return parameter through which the descriptor index is returned. |
| 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.
| list_p | Pointer to the descriptor list structure. |
| dscrIndex | Index of descriptor to be freed. |
| 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).
| mgr_p | Pointer to the buffer manager context structure. |
| baseAddr | Base address of the memory region reserved for DMA buffers. |
| regionSize | Size of the memory region reserved for DMA buffers. |
| 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.
| mgr_p | Pointer to the buffer manager context structure. |
| freeAll | Whether all memory buffers should be freed. |
| 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.
| mgr_p | Pointer to DMA buffer manager. |
| bufferSize | Size of the DMA buffer to be allocated (in bytes). |
| 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.
| mgr_p | Pointer to DMA buffer manager. |
| buffer_p | Pointer to the buffer to be freed. |
| 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.
| context_p | Pointer to the DMA manager context structure. |
| drvContext_p | Pointer to the HBDMA driver context structure. |
| dscrPool_p | Pointer to the HBDMA descriptor list. |
| bufMgr_p | Pointer to the HBDMA buffer manager context. |
| 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.
| context_p | Pointer to the DMA manager context structure. |
| 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.
| context_p | Pointer to the DMA manager context structure. |
| pUsbStackCtx | Pointer to USB stack context structure passed as an opaque pointer. |
| 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.
| pContext | Pointer to the DMA manager context structure. |
| endpNumber | USB endpoint index. |
| isEgressEp | Whether this is an Egress endpoint. |
| multEnable | Whether to enable the MULT feature. |
| 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.
| pDmaMgr | Pointer to the DMA manager context structure. |
| handle | Handle to the DMA channel structure. |
| config | Desired DMA channel configuration. |
| 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.
| handle | Handle to the DMA channel structure. |
| 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.
| handle | Handle to the DMA channel structure. |
| xferSize | Size of data to be transferred through the channel. |
| cy_en_hbdma_mgr_status_t Cy_HBDma_Channel_Disable | ( | cy_stc_hbdma_channel_t * | handle | ) |
Disable a High BandWidth DMA channel.
| handle | Handle to the DMA channel structure. |
| 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.
| handle | Handle to the DMA channel structure. |
| 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.
| pHandle | Handle to the DMA channel structure. |
| sckOffset | Socket id to wrapup. |
| 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.
| handle | Handle to the DMA channel structure. |
| bufStat_p | Return parameter to pass the buffer status through. |
| 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.
| handle | Handle to the DMA channel structure. |
| bufStat_p | Information about the buffer to be committed. |
| 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.
| handle | Handle to the DMA channel structure. |
| bufStat_p | Information about the buffer to be dropped. |
| 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.
| handle | Handle to the DMA channel structure. |
| sckIdx | Index of consumer socket through which data is to be sent. |
| dataBuf_p | Pointer to the buffer containing data to be sent. |
| dataSize | Size of data to be sent. |
| 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.
| handle | Handle to the DMA channel structure. |
| sckIdx | Index of consumer socket through which data is to be sent. |
| 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.
| handle | Handle to the DMA channel structure. |
| sckIdx | Index of the producer socket within the channel through which data will be received. |
| dataBuf_p | Pointer of buffer where the received data should be placed. |
| bufferSize | Maximum amount of data that may be received. |
| actualSize_p | Return parameter to get the actual received data size through (can be NULL). |
| 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.
| handle | Handle to the DMA channel structure. |
| sckIdx | Index of the producer socket in the channel to be used for data read. |
| actualSize_p | Optional return parameter to get the actual size of data received. |
| 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.
| pHandle | Handle to the DMA channel structure. |
| pBufPtrs | Return array to be filled with the DMA buffer pointers. |
| bufferCnt | Number of buffer pointers to be fetched. |
| 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.
| pHandle | Handle to the DMA channel structure. |
| 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.
| socketId | Socket on which interrupt was received. |
| intrType | Type of interrupt which was received. |
| curDscr | Active descriptor for the socket. |
| userCtx | User context for the callback. |
| void Cy_HBDma_Mgr_TaskHandler | ( | void * | pTaskParam | ) |
High BandWidth DMA manager task.
| pTaskParam | Pointer to the HBDma manager context structure. |
| 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.
| pDmaMgr | Pointer to the DMA manager context structure. |
| cb | Pointer to function callback. |
| cy_en_hbdma_chn_state_t Cy_HBDma_Channel_GetChannelState | ( | cy_stc_hbdma_channel_t * | pHandle | ) |
Retrieve the state of DMA channel.
| pHandle | Handle to the DMA channel structure. |
| 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.
| pDmaMgr | Pointer to DMA manager context structure. |
| callbackFromISREnable | Whether sending of DMA callbacks directly from ISR is enabled. |
| 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.
| pDmaMgr | Pointer to DMA manager context structure. |
| 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.
| pDmaMgr | Pointer to DMA manager context structure. |
| gblDelayCycles | Number of delay cycles to be applied in the range of 0 to 15. |
| 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.
| pDmaMgr | Pointer to DMA manager context structure. |
| isAdap0Ingress | Whether adapter 0 (sockets 0 to 15) is being used only in ingress direction. |
| isAdap1Ingress | Whether adapter 1 (sockets 16 to 31) is being used only in ingress direction. |
| 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.
| pHandle | Handle to the DMA channel. |
| enable | Whether trigger connections are to be enabled or disabled. |
| 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.
| pHandle | Handle to the DMA channel. |
| prodIndex | Index of the producer from which to read data. |
| pBuffer | Pointer to the data buffer to read data into. |
| dataSize | Size of data expected. This should be a multiple of the max packet size. |
| 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.
| pHandle | Handle to the DMA channel. |
| prodIndex | Index of the producer from which to read data. |
| shortPktSize | Size of the short packet received in bytes. |
| 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.
| pHandle | Handle to the DMA channel. |
| consIndex | Index of the consumer to write data into. |
| pBuffer | Pointer to the data buffer containing the data. |
| dataSize | Size of data to be transferred. |
| 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).
| pDmaMgr | Handle to the DMA manager context. |
| 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).
| pDmaMgr | Handle to the DMA manager context. |
| 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.
| pDmaMgr | Handle to the DMA manager context. |
| epNum | Endpoint number on which SLP/ZLP was received. |
| pktSize | Actual size (in bytes) of the packet received. |