AM273x MCU+ SDK  08.02.00

Introduction

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

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...
 

Macro Definition Documentation

◆ CBUFF_ERRNO_BASE

#define CBUFF_ERRNO_BASE   (-3300)

CBUFF driver error base.

◆ CBUFF_MAX_USER_BUFFER

#define CBUFF_MAX_USER_BUFFER   (3U)

Maximum number of user supplied data buffers which can be configured and sent over the interface.

◆ CBUFF_STATUS_SUCCESS

#define CBUFF_STATUS_SUCCESS   ((int32_t)0)

No Error.

◆ CBUFF_EINVAL

#define CBUFF_EINVAL   (CBUFF_ERRNO_BASE-1)

Error Code: Invalid argument.

◆ CBUFF_ENOMEM

#define CBUFF_ENOMEM   (CBUFF_ERRNO_BASE-2)

Error Code: Out of memory.

◆ CBUFF_EINUSE

#define CBUFF_EINUSE   (CBUFF_ERRNO_BASE-3)

Error Code: Operation cannot be implemented because the CBUFF driver is in use.

◆ CBUFF_ENOTSUP

#define CBUFF_ENOTSUP   (CBUFF_ERRNO_BASE-4)

Error Code: Operation cannot be implemented because the CBUFF driver is not supporting this currently.

◆ CBUFF_EDMA_FAIL

#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.

◆ CBUFF_ELIMIT

#define CBUFF_ELIMIT   (CBUFF_ERRNO_BASE-6)

Error Code: Limit exceeded.

◆ CBUFF_MAX_NUM_SESSION

#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.

◆ CBUFF_EDMA_MAX_NUM_CHANNELS

#define CBUFF_EDMA_MAX_NUM_CHANNELS   (32U)

Maximum number of EDMA channels which can be used by the CBUFF driver.

◆ CBUFF_MAX_LINKED_LIST_SIZE

#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.

◆ CBUFF_LL_READ_THRESHOLD

#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

◆ CBUFF_LL_WRITE_THRESHOLD

#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

◆ CBUFF_MAX_TRANSFER_SIZE_CBUFF_UNITS

#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

◆ CBUFF_MIN_TRANSFER_SIZE_CBUFF_UNITS

#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

◆ CBUFF_Interface_MDO

#define CBUFF_Interface_MDO   ((uint32_t) 1) /*! The CBUFF driver will send out the packets using the MDO/Aurora Interface */

◆ CBUFF_Interface_LVDS

#define CBUFF_Interface_LVDS   ((uint32_t) 2) /*! The CBUFF driver will send out the packets using the LVDS Interface */

◆ CBUFF_Command_GET_CBUFF_STATS

#define CBUFF_Command_GET_CBUFF_STATS   ((uint32_t) 1) /*! get the statistics associated with the CBUFF driver */

◆ CBUFF_Command_CLEAR_CBUFF_STATS

#define CBUFF_Command_CLEAR_CBUFF_STATS   ((uint32_t) 2) /*! clear the statistics associated with the CBUFF driver */

◆ CBUFF_Command_GET_ACTIVE_SESSION

#define CBUFF_Command_GET_ACTIVE_SESSION   ((uint32_t) 3) /*! Get the current active session in the CBUFF */

◆ CBUFF_OutputDataFmt_12bit

#define CBUFF_OutputDataFmt_12bit   ((uint32_t) 0) /*! 12bit output format */

◆ CBUFF_OutputDataFmt_14bit

#define CBUFF_OutputDataFmt_14bit   ((uint32_t) 1) /*! 14bit output format */

◆ CBUFF_OutputDataFmt_16bit

#define CBUFF_OutputDataFmt_16bit   ((uint32_t) 2) /*! 16bit output format */

◆ CBUFF_DataType_REAL

#define CBUFF_DataType_REAL   ((uint32_t) 0) /*! Real Data */

◆ CBUFF_DataType_COMPLEX

#define CBUFF_DataType_COMPLEX   ((uint32_t) 1) /*! Complex Data */

◆ CBUFF_LVDSLaneFmtMapLANEx_FMT_0_y

#define CBUFF_LVDSLaneFmtMapLANEx_FMT_0_y   ((uint32_t) 0) /*! Use the LVDS Lane Format-0. */

◆ CBUFF_LVDSLaneFmtMapLANEx_FMT_1_y

#define CBUFF_LVDSLaneFmtMapLANEx_FMT_1_y   ((uint32_t) 1) /*! Use the LVDS Lane Format-1. */

◆ CBUFF_LLType_UNUSED

#define CBUFF_LLType_UNUSED   ((uint32_t) 0) /*! CBUFF Linked List Entry is not being used */

CBUFF_LLType type of data transfer.

◆ CBUFF_LLType_USER

#define CBUFF_LLType_USER   ((uint32_t) 1) /*! CBUFF Linked List Entry holds a user buffer */

◆ CBUFF_LLType_HEADER

#define CBUFF_LLType_HEADER   ((uint32_t) 2) /*! CBUFF Linked List Entry holds a header */

Typedef Documentation

◆ CBUFF_Handle

typedef void* CBUFF_Handle

A handle that is returned from a CBUFF_open() call.

◆ CBUFF_SessionHandle

typedef void* CBUFF_SessionHandle

A handle that is returned from a CBUFF Session.

◆ CBUFF_Interface

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

◆ CBUFF_Command

typedef uint32_t CBUFF_Command

CBUFF Command.

Describes commands which are used to get/set information from the CBUFF Driver

CBUFF_control

◆ CBUFF_OutputDataFmt

typedef uint32_t CBUFF_OutputDataFmt

Output Data Format.

Describes the LVDS output data format.

◆ CBUFF_DataType

typedef uint32_t CBUFF_DataType

Data Type.

Describes the data type

◆ CBUFF_LVDSLaneFmtMap

typedef uint32_t CBUFF_LVDSLaneFmtMap

LVDS Lane Format Map.

Describes the LVDS Lane Format maps which are available and which need to be used.

◆ CBUFF_LLType

typedef uint32_t CBUFF_LLType

CBUFF Linked List Type.

Each linked list in the CBUFF holds information about one of the following types

◆ CBUFF_EDMAChannelAllocateFxn

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.

Parameters
[in]ptrEDMAInfoPointer to the EDMA informational block which needs to be used by the application to perform the EDMA channel allocation
[out]ptrEDMAChannelCfgPointer to the EDMA Channel configuration which is to be populated
Return values
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.

◆ CBUFF_EDMAChannelFreeFxn

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.

Parameters
[in]ptrEDMAChannelCfgPointer to the EDMA chnanel configuration which is to be released
Return values
Notapplicable

◆ CBUFF_FrameDoneCallbackFxn

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.

Parameters
[in]sessionHandleSession Handle which was active for which the Frame done interrupt was received
Return values
Notapplicable

◆ CBUFF_initFxn

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.

Parameters
[in]ptrDriverMCBPointer to the CBUFF Driver MCB
[out]errCodeError code populated on error
Return values
Success- 0
Error- <0

◆ CBUFF_deinitFxn

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.

Parameters
[in]ptrDriverMCBPointer to the CBUFF Driver MCB
[out]errCodeError code populated on error
Return values
Success- 0
Error- <0

◆ CBUFF_openFxn

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.

Parameters
[in]ptrSessionPointer to the session
[out]errCodeError code populated on error
Return values
Success- 0
Error- <0

◆ CBUFF_closeFxn

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.

Parameters
[in]ptrSessionPointer to the session
[out]errCodeError code populated on error
Return values
Success- 0
Error- <0

◆ CBUFF_initLinkListParamsFxn

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.

Parameters
[in]ptrSessionPointer to the CBUFF Session
[out]ptrLinkListParamsPointer to the linked list configuration populated by the API
Return values
Notapplicable

◆ CBUFF_finalizeLinkListParamsFxn

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.

Parameters
[in]ptrSessionPointer to the CBUFF Session
[in]ptrLinkListParamsPointer to the linked list configuration
Return values
Notapplicable