The CBUFF (Common Buffer Controller) is responsible for the transfer of user data to the LVDS Tx Module. The application initializes the CBUFF driver by calling CBUFF_init() and then it is ready to open CBUFF instance with the Session configuration (SW) provided by application.
Sub Modules | |
CBUFF Driver External Functions | |
The section has a list of all the exported API which the applications need to invoke in order to use the driver. | |
Files | |
file | cbuff/v1/cbuff.h |
This file contains the prototypes of the APIs present in the device abstraction layer file of CBUFF. This also contains some related macros. | |
Data Structures | |
struct | CBUFF_Stats |
CBUFF Statistics. More... | |
struct | CBUFF_BufferCfg |
CBUFF Buffer configuration. More... | |
struct | CBUFF_LinkListParams |
CBUFF Linked List parameters. More... | |
struct | CBUFF_Attrs |
CBUFF instance attributes - used during init time. More... | |
struct | CBUFF_LVDSCfg |
CBUFF LVDS Initialization configuration. More... | |
struct | CBUFF_EDMAChannelCfg |
CBUFF EDMA channel resource configuration. More... | |
struct | CBUFF_EDMAInfo |
CBUFF EDMA Information block. More... | |
struct | CBUFF_SwSessionCfg |
CBUFF Software Triggered Session configuration. More... | |
struct | CBUFF_SessionCfg |
CBUFF configuration. More... | |
struct | CBUFF_InitCfg |
CBUFF Initialization Configuration. More... | |
struct | CBUFF_EDMATrackingEntry |
CBUFF EDMA Tracking Entry. More... | |
struct | CBUFF_Session |
CBUFF Session. More... | |
struct | CBUFF_Object |
CBUFF Driver. More... | |
struct | CBUFF_InterfaceFxn |
CBUFF Interface Function. More... | |
Typedefs | |
typedef void * | CBUFF_Handle |
A handle that is returned from a CBUFF_open() call. More... | |
typedef void * | CBUFF_SessionHandle |
A handle that is returned from a CBUFF Session. More... | |
typedef uint32_t | CBUFF_Interface |
High Speed Interface. More... | |
typedef uint32_t | CBUFF_Command |
CBUFF Command. More... | |
typedef uint32_t | CBUFF_OutputDataFmt |
Output Data Format. More... | |
typedef uint32_t | CBUFF_DataType |
Data Type. More... | |
typedef uint32_t | CBUFF_LVDSLaneFmtMap |
LVDS Lane Format Map. More... | |
typedef uint32_t | CBUFF_LLType |
CBUFF Linked List Type. More... | |
typedef int32_t(* | CBUFF_EDMAChannelAllocateFxn) (CBUFF_EDMAInfo *ptrEDMAInfo, CBUFF_EDMAChannelCfg *ptrEDMAChannelCfg) |
typedef void(* | CBUFF_EDMAChannelFreeFxn) (CBUFF_EDMAChannelCfg *ptrEDMAChannelCfg) |
typedef void(* | CBUFF_FrameDoneCallbackFxn) (CBUFF_SessionHandle sessionHandle) |
typedef int32_t(* | CBUFF_initFxn) (CBUFF_Object *ptrDriverMCB, int32_t *errCode) |
This is the function invoked by the CBUFF driver to initialize the high speed interface. More... | |
typedef int32_t(* | CBUFF_deinitFxn) (CBUFF_Object *ptrDriverMCB, int32_t *errCode) |
This is the function invoked by the CBUFF driver to deinitialize and shutdown the high speed interface. More... | |
typedef int32_t(* | CBUFF_openFxn) (CBUFF_Session *ptrSession, int32_t *errCode) |
This is the function invoked by the CBUFF driver to open the high speed interface for the specific session. More... | |
typedef int32_t(* | CBUFF_closeFxn) (CBUFF_Session *ptrSession, int32_t *errCode) |
This is the function invoked by the CBUFF driver to close the high speed interface for the specific session. More... | |
typedef void(* | CBUFF_initLinkListParamsFxn) (CBUFF_Session *ptrSession, CBUFF_LinkListParams *ptrLinkListParams) |
This is the function prototype invoked by the CBUFF Driver to initialize the linked list parameters for each high speed interface. More... | |
typedef void(* | CBUFF_finalizeLinkListParamsFxn) (CBUFF_Session *ptrSession, CBUFF_LinkListParams *ptrLinkListParams) |
This is the function prototype invoked by the CBUFF Driver to finalize the linked list parameters for the high speed interface. Once the parameters have been finalized they can be written to the CBUFF IP. More... | |
Macros | |
#define | CBUFF_ERRNO_BASE (-3300) |
CBUFF driver error base. More... | |
#define | CBUFF_MAX_USER_BUFFER (3U) |
Maximum number of user supplied data buffers which can be configured and sent over the interface. More... | |
#define | CBUFF_MAX_NUM_SESSION (7U) |
Maximum number of sessions which can be supported by the CBUFF Driver. More... | |
#define | CBUFF_EDMA_MAX_NUM_CHANNELS (32U) |
Maximum number of EDMA channels which can be used by the CBUFF driver. More... | |
#define | CBUFF_MAX_LINKED_LIST_SIZE (32U) |
Maximum number of linked list entries which can be tracked by the driver. More... | |
#define | CBUFF_LL_READ_THRESHOLD (0x4U) |
Read threshold configured in the Linked List Entries. This is used by the CBUFF 128bit FIFO. More... | |
#define | CBUFF_LL_WRITE_THRESHOLD (0x40U) |
Write threshold configured in the Linked List Entries. This is used by the CBUFF 128bit FIFO. More... | |
#define | CBUFF_MAX_TRANSFER_SIZE_CBUFF_UNITS (0x3FFFU) |
Maximum transfer size in CBUFF Units. More... | |
#define | CBUFF_MIN_TRANSFER_SIZE_CBUFF_UNITS ((CBUFF_LL_READ_THRESHOLD * 16U) / 2U) |
Minimum transfer size in CBUFF Units. More... | |
#define | CBUFF_Interface_MDO ((uint32_t) 1) /*! The CBUFF driver will send out the packets using the MDO/Aurora Interface */ |
#define | CBUFF_Interface_LVDS ((uint32_t) 2) /*! The CBUFF driver will send out the packets using the LVDS Interface */ |
#define | CBUFF_Command_GET_CBUFF_STATS ((uint32_t) 1) /*! get the statistics associated with the CBUFF driver */ |
#define | CBUFF_Command_CLEAR_CBUFF_STATS ((uint32_t) 2) /*! clear the statistics associated with the CBUFF driver */ |
#define | CBUFF_Command_GET_ACTIVE_SESSION ((uint32_t) 3) /*! Get the current active session in the CBUFF */ |
#define | CBUFF_OutputDataFmt_12bit ((uint32_t) 0) /*! 12bit output format */ |
#define | CBUFF_OutputDataFmt_14bit ((uint32_t) 1) /*! 14bit output format */ |
#define | CBUFF_OutputDataFmt_16bit ((uint32_t) 2) /*! 16bit output format */ |
#define | CBUFF_DataType_REAL ((uint32_t) 0) /*! Real Data */ |
#define | CBUFF_DataType_COMPLEX ((uint32_t) 1) /*! Complex Data */ |
#define | CBUFF_LVDSLaneFmtMapLANEx_FMT_0_y ((uint32_t) 0) /*! Use the LVDS Lane Format-0. */ |
#define | CBUFF_LVDSLaneFmtMapLANEx_FMT_1_y ((uint32_t) 1) /*! Use the LVDS Lane Format-1. */ |
#define | CBUFF_LLType_UNUSED ((uint32_t) 0) /*! CBUFF Linked List Entry is not being used */ |
CBUFF_LLType type of data transfer. More... | |
#define | CBUFF_LLType_USER ((uint32_t) 1) /*! CBUFF Linked List Entry holds a user buffer */ |
#define | CBUFF_LLType_HEADER ((uint32_t) 2) /*! CBUFF Linked List Entry holds a header */ |
CBUFF driver error codes | |
#define | CBUFF_STATUS_SUCCESS ((int32_t)0) |
No Error. More... | |
#define | CBUFF_EINVAL (CBUFF_ERRNO_BASE-1) |
Error Code: Invalid argument. More... | |
#define | CBUFF_ENOMEM (CBUFF_ERRNO_BASE-2) |
Error Code: Out of memory. More... | |
#define | CBUFF_EINUSE (CBUFF_ERRNO_BASE-3) |
Error Code: Operation cannot be implemented because the CBUFF driver is in use. More... | |
#define | CBUFF_ENOTSUP (CBUFF_ERRNO_BASE-4) |
Error Code: Operation cannot be implemented because the CBUFF driver is not supporting this currently. More... | |
#define | CBUFF_EDMA_FAIL (CBUFF_ERRNO_BASE-5) |
Error Code: The application failed to provide the EDMA resources which are required by the CBUFF driver to support the application use case. More... | |
#define | CBUFF_ELIMIT (CBUFF_ERRNO_BASE-6) |
Error Code: Limit exceeded. More... | |
#define CBUFF_ERRNO_BASE (-3300) |
CBUFF driver error base.
#define CBUFF_MAX_USER_BUFFER (3U) |
Maximum number of user supplied data buffers which can be configured and sent over the interface.
#define CBUFF_STATUS_SUCCESS ((int32_t)0) |
No Error.
#define CBUFF_EINVAL (CBUFF_ERRNO_BASE-1) |
Error Code: Invalid argument.
#define CBUFF_ENOMEM (CBUFF_ERRNO_BASE-2) |
Error Code: Out of memory.
#define CBUFF_EINUSE (CBUFF_ERRNO_BASE-3) |
Error Code: Operation cannot be implemented because the CBUFF driver is in use.
#define CBUFF_ENOTSUP (CBUFF_ERRNO_BASE-4) |
Error Code: Operation cannot be implemented because the CBUFF driver is not supporting this currently.
#define CBUFF_EDMA_FAIL (CBUFF_ERRNO_BASE-5) |
Error Code: The application failed to provide the EDMA resources which are required by the CBUFF driver to support the application use case.
#define CBUFF_ELIMIT (CBUFF_ERRNO_BASE-6) |
Error Code: Limit exceeded.
#define CBUFF_MAX_NUM_SESSION (7U) |
Maximum number of sessions which can be supported by the CBUFF Driver.
NOTE: This is limited to the number of DMA channels available to the CBUFF IP.
#define CBUFF_EDMA_MAX_NUM_CHANNELS (32U) |
Maximum number of EDMA channels which can be used by the CBUFF driver.
#define CBUFF_MAX_LINKED_LIST_SIZE (32U) |
Maximum number of linked list entries which can be tracked by the driver.
NOTE: This is limited to the number Linked list entries available to the CBUFF IP.
#define CBUFF_LL_READ_THRESHOLD (0x4U) |
Read threshold configured in the Linked List Entries. This is used by the CBUFF 128bit FIFO.
NOTE: This is the recommended value as per the Application Note
#define CBUFF_LL_WRITE_THRESHOLD (0x40U) |
Write threshold configured in the Linked List Entries. This is used by the CBUFF 128bit FIFO.
NOTE: This is the recommended value as per the Application Note
#define CBUFF_MAX_TRANSFER_SIZE_CBUFF_UNITS (0x3FFFU) |
Maximum transfer size in CBUFF Units.
NOTE: This is the maximum size of the transfer as per the CBUFF IP
#define CBUFF_MIN_TRANSFER_SIZE_CBUFF_UNITS ((CBUFF_LL_READ_THRESHOLD * 16U) / 2U) |
Minimum transfer size in CBUFF Units.
NOTE: This is the minimum frame size which can be transferred by the CBUFF IP. The Frame size is defined to the sum of the transfer size of all the linked list entries
The CBUFF FIFO Width for Read Threshold of 4 will imply that 4*128bits i.e. 64 bytes or 32CBUFF Units
#define CBUFF_Interface_MDO ((uint32_t) 1) /*! The CBUFF driver will send out the packets using the MDO/Aurora Interface */ |
#define CBUFF_Interface_LVDS ((uint32_t) 2) /*! The CBUFF driver will send out the packets using the LVDS Interface */ |
#define CBUFF_Command_GET_CBUFF_STATS ((uint32_t) 1) /*! get the statistics associated with the CBUFF driver */ |
#define CBUFF_Command_CLEAR_CBUFF_STATS ((uint32_t) 2) /*! clear the statistics associated with the CBUFF driver */ |
#define CBUFF_Command_GET_ACTIVE_SESSION ((uint32_t) 3) /*! Get the current active session in the CBUFF */ |
#define CBUFF_OutputDataFmt_12bit ((uint32_t) 0) /*! 12bit output format */ |
#define CBUFF_OutputDataFmt_14bit ((uint32_t) 1) /*! 14bit output format */ |
#define CBUFF_OutputDataFmt_16bit ((uint32_t) 2) /*! 16bit output format */ |
#define CBUFF_DataType_REAL ((uint32_t) 0) /*! Real Data */ |
#define CBUFF_DataType_COMPLEX ((uint32_t) 1) /*! Complex Data */ |
#define CBUFF_LVDSLaneFmtMapLANEx_FMT_0_y ((uint32_t) 0) /*! Use the LVDS Lane Format-0. */ |
#define CBUFF_LVDSLaneFmtMapLANEx_FMT_1_y ((uint32_t) 1) /*! Use the LVDS Lane Format-1. */ |
#define CBUFF_LLType_UNUSED ((uint32_t) 0) /*! CBUFF Linked List Entry is not being used */ |
CBUFF_LLType type of data transfer.
#define CBUFF_LLType_USER ((uint32_t) 1) /*! CBUFF Linked List Entry holds a user buffer */ |
#define CBUFF_LLType_HEADER ((uint32_t) 2) /*! CBUFF Linked List Entry holds a header */ |
typedef void* CBUFF_Handle |
A handle that is returned from a CBUFF_open() call.
typedef void* CBUFF_SessionHandle |
A handle that is returned from a CBUFF Session.
typedef uint32_t CBUFF_Interface |
High Speed Interface.
Describes the high speed interface which is to be used by the CBUFF to send out the data
typedef uint32_t CBUFF_Command |
CBUFF Command.
Describes commands which are used to get/set information from the CBUFF Driver
CBUFF_control
typedef uint32_t CBUFF_OutputDataFmt |
Output Data Format.
Describes the LVDS output data format.
typedef uint32_t CBUFF_DataType |
Data Type.
Describes the data type
typedef uint32_t CBUFF_LVDSLaneFmtMap |
LVDS Lane Format Map.
Describes the LVDS Lane Format maps which are available and which need to be used.
typedef uint32_t CBUFF_LLType |
CBUFF Linked List Type.
Each linked list in the CBUFF holds information about one of the following types
typedef int32_t(* CBUFF_EDMAChannelAllocateFxn) (CBUFF_EDMAInfo *ptrEDMAInfo, CBUFF_EDMAChannelCfg *ptrEDMAChannelCfg) |
Description
This is the function which is registered with the CBUFF driver and is invoked by the driver whenever it needs to allocate and use an EDMA channel.
[in] | ptrEDMAInfo | Pointer to the EDMA informational block which needs to be used by the application to perform the EDMA channel allocation |
[out] | ptrEDMAChannelCfg | Pointer to the EDMA Channel configuration which is to be populated |
Success | - 0 |
Error | - <0 [Implies that the application is unable to allocate a channel] |
NOTE: The EDMA transfer completion codes are identical to the CBUFF Physical & chain channel resources therefore these transfer completion codes are considered to be reserved for CBUFF Usage.
typedef void(* CBUFF_EDMAChannelFreeFxn) (CBUFF_EDMAChannelCfg *ptrEDMAChannelCfg) |
Description
This is the function which is registered with the CBUFF driver and is invoked by the driver whenever it needs to free an allocated EDMA channel.
[in] | ptrEDMAChannelCfg | Pointer to the EDMA chnanel configuration which is to be released |
Not | applicable |
typedef void(* CBUFF_FrameDoneCallbackFxn) (CBUFF_SessionHandle sessionHandle) |
Description
Sessions can register for Frame Done interrupts. This callback function is invoked if the session is currently active and the CBUFF Driver receives a frame done interrupt. Application should use this to activate another session. Switching between active sessions while the frame is not done can lead to unexpected results.
[in] | sessionHandle | Session Handle which was active for which the Frame done interrupt was received |
Not | applicable |
typedef int32_t(* CBUFF_initFxn) (CBUFF_Object *ptrDriverMCB, int32_t *errCode) |
This is the function invoked by the CBUFF driver to initialize the high speed interface.
[in] | ptrDriverMCB | Pointer to the CBUFF Driver MCB |
[out] | errCode | Error code populated on error |
Success | - 0 |
Error | - <0 |
typedef int32_t(* CBUFF_deinitFxn) (CBUFF_Object *ptrDriverMCB, int32_t *errCode) |
This is the function invoked by the CBUFF driver to deinitialize and shutdown the high speed interface.
[in] | ptrDriverMCB | Pointer to the CBUFF Driver MCB |
[out] | errCode | Error code populated on error |
Success | - 0 |
Error | - <0 |
typedef int32_t(* CBUFF_openFxn) (CBUFF_Session *ptrSession, int32_t *errCode) |
This is the function invoked by the CBUFF driver to open the high speed interface for the specific session.
[in] | ptrSession | Pointer to the session |
[out] | errCode | Error code populated on error |
Success | - 0 |
Error | - <0 |
typedef int32_t(* CBUFF_closeFxn) (CBUFF_Session *ptrSession, int32_t *errCode) |
This is the function invoked by the CBUFF driver to close the high speed interface for the specific session.
[in] | ptrSession | Pointer to the session |
[out] | errCode | Error code populated on error |
Success | - 0 |
Error | - <0 |
typedef void(* CBUFF_initLinkListParamsFxn) (CBUFF_Session *ptrSession, CBUFF_LinkListParams *ptrLinkListParams) |
This is the function prototype invoked by the CBUFF Driver to initialize the linked list parameters for each high speed interface.
[in] | ptrSession | Pointer to the CBUFF Session |
[out] | ptrLinkListParams | Pointer to the linked list configuration populated by the API |
Not | applicable |
typedef void(* CBUFF_finalizeLinkListParamsFxn) (CBUFF_Session *ptrSession, CBUFF_LinkListParams *ptrLinkListParams) |
This is the function prototype invoked by the CBUFF Driver to finalize the linked list parameters for the high speed interface. Once the parameters have been finalized they can be written to the CBUFF IP.
[in] | ptrSession | Pointer to the CBUFF Session |
[in] | ptrLinkListParams | Pointer to the linked list configuration |
Not | applicable |