![Logo](ti_logo.svg) |
AM273x MCU+ SDK
08.02.00
|
|
Go to the documentation of this file.
66 #include <drivers/hw_include/cslr_soc.h>
67 #include <drivers/hw_include/cslr_cbuff.h>
69 #include <drivers/hw_include/hw_types.h>
77 #define CBUFF_ERRNO_BASE (-3300)
83 #define CBUFF_MAX_USER_BUFFER (3U)
94 #define CBUFF_STATUS_SUCCESS ((int32_t)0)
98 #define CBUFF_EINVAL (CBUFF_ERRNO_BASE-1)
103 #define CBUFF_ENOMEM (CBUFF_ERRNO_BASE-2)
109 #define CBUFF_EINUSE (CBUFF_ERRNO_BASE-3)
115 #define CBUFF_ENOTSUP (CBUFF_ERRNO_BASE-4)
121 #define CBUFF_EDMA_FAIL (CBUFF_ERRNO_BASE-5)
126 #define CBUFF_ELIMIT (CBUFF_ERRNO_BASE-6)
137 #define CBUFF_MAX_NUM_SESSION (7U)
143 #define CBUFF_EDMA_MAX_NUM_CHANNELS (32U)
152 #define CBUFF_MAX_LINKED_LIST_SIZE (32U)
160 #define CBUFF_LL_READ_THRESHOLD (0x4U)
168 #define CBUFF_LL_WRITE_THRESHOLD (0x40U)
175 #define CBUFF_MAX_TRANSFER_SIZE_CBUFF_UNITS (0x3FFFU)
187 #define CBUFF_MIN_TRANSFER_SIZE_CBUFF_UNITS ((CBUFF_LL_READ_THRESHOLD * 16U) / 2U)
214 #define CBUFF_Interface_MDO ((uint32_t) 1)
215 #define CBUFF_Interface_LVDS ((uint32_t) 2)
227 typedef uint32_t CBUFF_Command;
229 #define CBUFF_Command_GET_CBUFF_STATS ((uint32_t) 1)
230 #define CBUFF_Command_CLEAR_CBUFF_STATS ((uint32_t) 2)
231 #define CBUFF_Command_GET_ACTIVE_SESSION ((uint32_t) 3)
241 typedef uint32_t CBUFF_OutputDataFmt;
243 #define CBUFF_OutputDataFmt_12bit ((uint32_t) 0)
244 #define CBUFF_OutputDataFmt_14bit ((uint32_t) 1)
245 #define CBUFF_OutputDataFmt_16bit ((uint32_t) 2)
255 typedef uint32_t CBUFF_DataType;
257 #define CBUFF_DataType_REAL ((uint32_t) 0)
258 #define CBUFF_DataType_COMPLEX ((uint32_t) 1)
269 typedef uint32_t CBUFF_LVDSLaneFmtMap;
271 #define CBUFF_LVDSLaneFmtMapLANEx_FMT_0_y ((uint32_t) 0)
272 #define CBUFF_LVDSLaneFmtMapLANEx_FMT_1_y ((uint32_t) 1)
281 typedef uint32_t CBUFF_LLType;
286 #define CBUFF_LLType_UNUSED ((uint32_t) 0)
287 #define CBUFF_LLType_USER ((uint32_t) 1)
288 #define CBUFF_LLType_HEADER ((uint32_t) 2)
303 typedef struct CBUFF_Stats_t
357 typedef struct CBUFF_BufferCfg_t
382 typedef struct CBUFF_LinkListParams_t
488 typedef struct CBUFF_LVDSCfg_t
533 typedef struct CBUFF_EDMAChannelCfg_t
555 typedef struct CBUFF_EDMAInfo_t
665 typedef struct CBUFF_SwSessionCfg_t
681 typedef struct CBUFF_SessionCfg_t
738 typedef struct CBUFF_InitCfg_t
800 typedef struct CBUFF_EDMATrackingEntry_t
828 typedef struct CBUFF_Session_t
911 typedef struct CBUFF_Driver_t
1089 typedef struct CBUFF_InterfaceFxn_t
CSL_CbuffRegs * ptrCBUFFReg
CBUFF register space.
Definition: cbuff/v1/cbuff.h:922
CBUFF_SessionCfg sessionCfg
Configuration used to create the session.
Definition: cbuff/v1/cbuff.h:843
#define CBUFF_MAX_USER_BUFFER
Maximum number of user supplied data buffers which can be configured and sent over the interface.
Definition: cbuff/v1/cbuff.h:83
uint32_t numFrameDone
Number of frame done interrupts received: This is available only in the following cases: (a) Enable d...
Definition: cbuff/v1/cbuff.h:315
CBUFF_EDMAChannelAllocateFxn allocateEDMAChannelFxn
Application provided EDMA Channel allocation function.
Definition: cbuff/v1/cbuff.h:704
CBUFF Driver.
Definition: cbuff/v1/cbuff.h:912
CBUFF EDMA Information block.
Definition: cbuff/v1/cbuff.h:556
uint8_t numActiveADCChannels
Number of active ADC Channels.
Definition: cbuff/v1/cbuff.h:853
HwiP_Object hwiErrorISRHandle
Registered interrupt handler for the CBUFF Module.
Definition: cbuff/v1/cbuff.h:937
CBUFF_EDMAChannelFreeFxn freeEDMAChannelFxn
Application provided EDMA Channel free function.
Definition: cbuff/v1/cbuff.h:709
CBUFF instance attributes - used during init time.
Definition: cbuff/v1/cbuff.h:458
uint8_t msbFirst
Set the flag to 1 to indicate that the MSB is sent first or LSB.
Definition: cbuff/v1/cbuff.h:507
void * CBUFF_SessionHandle
A handle that is returned from a CBUFF Session.
Definition: cbuff/v1/cbuff.h:201
CBUFF_Session * ptrSessionTable
This is the table which tracks all the sessions which can be created by the CBUFF Driver.
Definition: cbuff/v1/cbuff.h:943
CBUFF Software Triggered Session configuration.
Definition: cbuff/v1/cbuff.h:666
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.
Definition: cbuff/v1/cbuff.h:997
CBUFF_closeFxn closeFxn
This is the function which is used to close the high speed interface.
Definition: cbuff/v1/cbuff.h:1117
CBUFF Initialization Configuration.
Definition: cbuff/v1/cbuff.h:739
bool isValid
Status flag which indicates if the session is active or not.
Definition: cbuff/v1/cbuff.h:833
uint8_t linkListIndex
Link Index which tracks the linked list entries being added.
Definition: cbuff/v1/cbuff.h:863
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 se...
Definition: cbuff/v1/cbuff.h:1031
uint8_t ddrClockMode
Set the flag to 1 for DDR Clock Mode and 0 for SDR.
Definition: cbuff/v1/cbuff.h:512
uint16_t transferSize
Transfer size.
Definition: cbuff/v1/cbuff.h:412
uint32_t gCbuffConfigNum
Externally defined driver configuration array size.
CBUFF_Attrs const * hwAttrs
HWA Hardware related params.
Definition: cbuff/v1/cbuff.h:959
volatile uint32_t numChirpDone
Number of chirp done interrupts received.
Definition: cbuff/v1/cbuff.h:900
CBUFF_Object gCbuffObject[]
Externally defined driver object.
uint32_t address
Address of the Buffer: Please be aware that the address should be in a memory range which is accessib...
Definition: cbuff/v1/cbuff.h:371
uint32_t numErrorInterrupts
Number of error interrupts received. This is always available.
Definition: cbuff/v1/cbuff.h:332
uint32_t numChirpDone
Number of chirp done interrupts received: This is available only in the following cases: (a) Enable d...
Definition: cbuff/v1/cbuff.h:327
uint32_t srcAddress
Source address of the EDMA Transfer.
Definition: cbuff/v1/cbuff.h:811
uint8_t dmaNum
DMA number associated with the session.
Definition: cbuff/v1/cbuff.h:848
uint8_t numActiveLVDSLanes
Number of active LVDS lanes configured.
Definition: cbuff/v1/cbuff.h:954
void * CBUFF_Handle
A handle that is returned from a CBUFF_open() call.
Definition: cbuff/v1/cbuff.h:196
uint8_t frameStartError
Flag which indicated if a frame start error was detected. This is always available.
Definition: cbuff/v1/cbuff.h:338
uint32_t maxLVDSLanesSupported
Definition: cbuff/v1/cbuff.h:466
CBUFF_OutputDataFmt outputDataFmt
This is used to specify the LVDS/CSI2 output format.
Definition: cbuff/v1/cbuff.h:744
int32_t CBUFF_deinit(CBUFF_Handle cBuffHandle, int32_t *errCode)
Description The function is used to deinitialize and shutdown the CBUFF driver.
CBUFF_Session * ptrCurrentActiveSession
This is the pointer to the currently active session. This can be NULL to indicate that no session is ...
Definition: cbuff/v1/cbuff.h:949
struct CBUFF_Driver_t * ptrDriverMCB
This is the back pointer to the CBUFF Driver MCB.
Definition: cbuff/v1/cbuff.h:838
int32_t CBUFF_close(CBUFF_SessionHandle sessionHandle, int32_t *errCode)
Description The function deletes the specific session.
uint32_t chainChannelsId
EDMA Chain Channels Identifier.
Definition: cbuff/v1/cbuff.h:538
#define CBUFF_MAX_LINKED_LIST_SIZE
Maximum number of linked list entries which can be tracked by the driver.
Definition: cbuff/v1/cbuff.h:152
uint8_t chirpError
Flag which indicated if a chirp error was detected. This is always available.
Definition: cbuff/v1/cbuff.h:344
uint8_t maxSessions
This is the maximum number of sessions which can be supported for the CBUFF Instance....
Definition: cbuff/v1/cbuff.h:763
CBUFF_LLType type
Type of data being stored in the linked list entry.
Definition: cbuff/v1/cbuff.h:387
uint32_t CBUFF_Command
CBUFF Command.
Definition: cbuff/v1/cbuff.h:227
EDMA_Handle edmaHandle
EDMA Instance handle: This is the configuration which was passed by the application....
Definition: cbuff/v1/cbuff.h:562
CBUFF_InitCfg initCfg
Initialization configuration used to setup the driver. This is valid once the driver has been INITIAL...
Definition: cbuff/v1/cbuff.h:917
uint16_t adcTransferSize
Number of ADC Sample per chirp * [Complex(2) or Real(1)].
Definition: cbuff/v1/cbuff.h:858
volatile uint32_t totalNumFrameDone
Total number of frame done interrupts received.
Definition: cbuff/v1/cbuff.h:964
uint32_t CBUFF_Interface
High Speed Interface.
Definition: cbuff/v1/cbuff.h:212
HwiP_Object hwiISRHandle
Registered interrupt handler for the CBUFF Module.
Definition: cbuff/v1/cbuff.h:932
uint32_t transferSize
Size of the data being transferred by the EDMA. This is stored in CBUFF Units.
Definition: cbuff/v1/cbuff.h:817
CBUFF_SessionHandle CBUFF_createSession(CBUFF_Handle cbuffHandle, CBUFF_SessionCfg *ptrSessionCfg, int32_t *errCode)
Description The function creates a session with the specified configuration.
int32_t CBUFF_deactivateSession(CBUFF_SessionHandle sessionHandle, int32_t *errCode)
Description The function deactivates the specific CBUFF session.
CBUFF_deinitFxn deinitFxn
This is the function which is used to deinitialize and shutdown the high speed interface.
Definition: cbuff/v1/cbuff.h:1106
uint8_t align96
96 byte transfer mode
Definition: cbuff/v1/cbuff.h:423
CBUFF LVDS Initialization configuration.
Definition: cbuff/v1/cbuff.h:489
CBUFF_BufferCfg header
This is the header which needs to be added to the stream. If the size in the header is set to 0 then ...
Definition: cbuff/v1/cbuff.h:721
CBUFF Buffer configuration.
Definition: cbuff/v1/cbuff.h:358
CBUFF Session.
Definition: cbuff/v1/cbuff.h:829
uint8_t crcEnable
CRC Enable: Only ADC Buffers have CRC and these need to be verified.
Definition: cbuff/v1/cbuff.h:393
EDMA_Handle edmaHandle
EDMA Instance Handle: The session will allocate EDMA channels.
Definition: cbuff/v1/cbuff.h:699
CBUFF_initFxn initFxn
This is the function which is used to initialize the high speed interface.
Definition: cbuff/v1/cbuff.h:1100
uint8_t ddrClockModeMux
Set the flag to 1 for DDR Mode Clock Mux and 0 for SDR Mode Clock Mux.
Definition: cbuff/v1/cbuff.h:517
uint32_t CBUFF_OutputDataFmt
Output Data Format.
Definition: cbuff/v1/cbuff.h:241
CBUFF Interface Function.
Definition: cbuff/v1/cbuff.h:1090
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 s...
Definition: cbuff/v1/cbuff.h:1048
int32_t CBUFF_activateSession(CBUFF_SessionHandle sessionHandle, int32_t *errCode)
Description The function activates the specific CBUFF session.
uint32_t CBUFF_LLType
CBUFF Linked List Type.
Definition: cbuff/v1/cbuff.h:281
CBUFF_Interface interface
High speed interface for which the interface functions are defined.
Definition: cbuff/v1/cbuff.h:1094
volatile uint32_t numFrameDone
Number of frame done interrupts received.
Definition: cbuff/v1/cbuff.h:895
CBUFF_initLinkListParamsFxn initLinkListParamsFxn
This is the function which is used to initialize the linked list parameters to the default values for...
Definition: cbuff/v1/cbuff.h:1123
uint32_t CBUFF_DataType
Data Type.
Definition: cbuff/v1/cbuff.h:255
uint8_t lvdsLaneEnable
LVDS Lane configuration: The bit mask here is used to indicate the active LVDS lanes i....
Definition: cbuff/v1/cbuff.h:502
CBUFF EDMA channel resource configuration.
Definition: cbuff/v1/cbuff.h:534
uint32_t lpHeaderValue
Long Packet Header Value.
Definition: cbuff/v1/cbuff.h:448
CBUFF_FrameDoneCallbackFxn frameDoneCallbackFxn
This is the callback function which is triggered once the frame has been sent over the HSI....
Definition: cbuff/v1/cbuff.h:694
CBUFF_SwSessionCfg swCfg
Configuration used if the session is executing in software trigerred mode.
Definition: cbuff/v1/cbuff.h:727
uint8_t crcEnable
Enable/Disable CRC on LVDS.
Definition: cbuff/v1/cbuff.h:493
int32_t CBUFF_control(CBUFF_Handle cBuffHandle, CBUFF_Command cmd, void *arg, uint32_t argLen, int32_t *errCode)
Description The function is used to get/set information from the CBUFF Driver.
void(* CBUFF_FrameDoneCallbackFxn)(CBUFF_SessionHandle sessionHandle)
Definition: cbuff/v1/cbuff.h:655
uint32_t errorIntrNum
Definition: cbuff/v1/cbuff.h:468
struct CBUFF_InterfaceFxn_t * interfaceFxn
High speed interface function table to be used by the CBUFF Driver.
Definition: cbuff/v1/cbuff.h:927
uint8_t dataFmtMap
Data Format mapping.
Definition: cbuff/v1/cbuff.h:428
uint32_t baseAddr
Definition: cbuff/v1/cbuff.h:462
void(* CBUFF_EDMAChannelFreeFxn)(CBUFF_EDMAChannelCfg *ptrEDMAChannelCfg)
Definition: cbuff/v1/cbuff.h:637
CBUFF configuration.
Definition: cbuff/v1/cbuff.h:682
CBUFF_openFxn openFxn
This is the function which is used to open and setup the high speed interface.
Definition: cbuff/v1/cbuff.h:1112
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...
Definition: cbuff/v1/cbuff.h:1079
uint8_t vcNum
Virtual channel.
Definition: cbuff/v1/cbuff.h:433
uint32_t intrNum
Definition: cbuff/v1/cbuff.h:470
Opaque Hwi object used with the Hwi APIs.
Definition: HwiP.h:91
CBUFF_DataType dataType
Type of Data: Real or Complex which is going to be streamed out via the CBUFF High speed interface.
Definition: cbuff/v1/cbuff.h:715
uint8_t enableECC
Enable/Disable the ECC in the CBUFF module.
Definition: cbuff/v1/cbuff.h:749
uint16_t size
Size of the Buffer: This can be set to 0 to indicate that no buffer is specified. The size is specifi...
Definition: cbuff/v1/cbuff.h:364
bool enableDebugMode
This is a flag which if set to true will register the ISR to track Frame Start/Done and Chirp done.
Definition: cbuff/v1/cbuff.h:777
void * EDMA_Handle
A handle that is returned from a EDMA_open() call.
Definition: edma/v0/edma.h:469
uint32_t CBUFF_LVDSLaneFmtMap
LVDS Lane Format Map.
Definition: cbuff/v1/cbuff.h:269
#define CBUFF_EDMA_MAX_NUM_CHANNELS
Maximum number of EDMA channels which can be used by the CBUFF driver.
Definition: cbuff/v1/cbuff.h:143
uint32_t fifoBaseAddr
Definition: cbuff/v1/cbuff.h:464
CBUFF EDMA Tracking Entry.
Definition: cbuff/v1/cbuff.h:801
CBUFF_Object * gCbuffObjectPtr[]
Externally defined driver object pointer.
void CBUFF_init(void)
Description This function initializes the CBUFF module. This function must be called before any oth...
CBUFF_Attrs gCbuffAttrs[]
Externally defined driver configuration array.
CBUFF_Handle CBUFF_open(CBUFF_InitCfg *ptrInitCfg, int32_t *errCode)
Description The function Configures CBUFF peripheral with user provided configuration.
uint16_t totalTransferSize
Cumulative Transfer Size for all linked entries. This is applicable only if the HSI is CSI.
Definition: cbuff/v1/cbuff.h:418
uint8_t hsyncEnd
Horizontal sync end.
Definition: cbuff/v1/cbuff.h:443
CBUFF_LVDSLaneFmtMap laneFormat
LVDS Lane Format:
Definition: cbuff/v1/cbuff.h:522
uint32_t dmaNum
DMA Number: There are multiple DMA in the CBUFF driver. There exists a mapping between the CBUFF DMA ...
Definition: cbuff/v1/cbuff.h:598
volatile uint32_t totalNumChirpDone
Total number of chirp done interrupts received.
Definition: cbuff/v1/cbuff.h:969
uint8_t crcEnable
In order to ensure data integrity of data transfer from ADC buffer to CBUFF there is a CRC computed a...
Definition: cbuff/v1/cbuff.h:756
CBUFF Linked List parameters.
Definition: cbuff/v1/cbuff.h:383
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 interfac...
Definition: cbuff/v1/cbuff.h:1014
uint8_t edmaChannelCount
Counter which tracks the EDMA channels.
Definition: cbuff/v1/cbuff.h:874
CBUFF_finalizeLinkListParamsFxn finalizeLinkListParamsFxn
This is the function which is used to finalize and setup the linked list parameters after which they ...
Definition: cbuff/v1/cbuff.h:1129
int32_t(* CBUFF_EDMAChannelAllocateFxn)(CBUFF_EDMAInfo *ptrEDMAInfo, CBUFF_EDMAChannelCfg *ptrEDMAChannelCfg)
Definition: cbuff/v1/cbuff.h:623
uint8_t hsyncStart
Horizontal sync start.
Definition: cbuff/v1/cbuff.h:438
uint32_t totalNumNonActiveSessionInterrupts
Number of interrupts received when there is no active session.
Definition: cbuff/v1/cbuff.h:974
uint32_t shadowLinkChannelsId
EDMA Shadow link channels Identifier.
Definition: cbuff/v1/cbuff.h:543
#define CBUFF_MAX_NUM_SESSION
Maximum number of sessions which can be supported by the CBUFF Driver.
Definition: cbuff/v1/cbuff.h:137
CBUFF_LVDSCfg lvdsCfg
LVDS Initialization configuration: This needs to be specified if the interface is configured to be LV...
Definition: cbuff/v1/cbuff.h:788
uint8_t outputDataFmt
Output data format: 00 - 16bit 01 - 14bit 10 - 12bit.
Definition: cbuff/v1/cbuff.h:407
bool isFirstEDMAChannel
Flag which if set indicates that this is the first EDMA channel which is being allocated....
Definition: cbuff/v1/cbuff.h:569
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 f...
Definition: cbuff/v1/cbuff.h:1063
CBUFF Statistics.
Definition: cbuff/v1/cbuff.h:304
CBUFF_Interface interface
The interface over which the CBUFF module will send out the data.
Definition: cbuff/v1/cbuff.h:782
uint32_t numChirpsPerFrame
This is the number of chirps per frame.
Definition: cbuff/v1/cbuff.h:890
uint8_t lpHdrEn
Long packet header enable: This is to be 1 for the first entry in the group.
Definition: cbuff/v1/cbuff.h:399
uint32_t threshold
Thresholds to be configured.
Definition: cbuff/v1/cbuff.h:453
CBUFF_EDMAChannelCfg cbuffEDMAChannelCfg
EDMA Channel Configuration allocated by the application and which is used to program the CBUFF Transf...
Definition: cbuff/v1/cbuff.h:806
volatile uint32_t totalNumErrorInterrupts
Total number of error interrupts received.
Definition: cbuff/v1/cbuff.h:979