PDK API Guide for J721E
CSITX Transmit APIs

Introduction

This modules define APIs to capture video data using video ports in CSITX. This module can be used for single channel capture as well as multi-channel capture.

Data Structures

struct  dataTypeInfo
 This structure contains information about data type and bpp. More...
 
struct  CsitxDrv_EventObj
 CSITX event object. More...
 
struct  CsitxDrv_QueObj
 Structure defining the queue object used in queue/dequeue operation. Instead of creating frame objects, this is used so that any other information could be queued/dequeued along with the frame. Already qElem is added to avoid dynamic allocation of Queue nodes. More...
 
struct  CsitxDrv_ChBufManObj
 Structure to store the buffer management functionality variables for a channel. If serialized multi-channel transitions is disabled through 'serialMultiChanEnable', then following is the association of the Q's freeQ -> per channel and is part of channel buffer management object curQ -> per channel and is part of channel buffer management object doneQ -> per instance and is part of instance buffer management object txQObj -> Queue elements are defined in the channel buffer management object. More...
 
struct  CsitxDrv_InstBufManObj
 Structure to store the buffer management functionality variables for a instance. More...
 
struct  CsitxDrv_ChObj
 CSITX Driver Channel Object. More...
 
struct  CsitxDrv_CslObj
 CSITX CSL-FL instance Object. More...
 
struct  CsitxDrv_InstObj
 CSITX Driver Instance Object. More...
 
struct  CsitxDrv_CommonObj
 

Macros

#define CSITX_DRV_TRPD_SIZE   ((sizeof(CSL_UdmapTR15) * 2U) + 4U)
 UDMA TR packet descriptor memory. This contains the CSL_UdmapCppi5TRPD + Padding to sizeof(CSL_UdmapTR15) + one Type_15 TR (CSL_UdmapTR15) + one TR response of 4 bytes. Since CSL_UdmapCppi5TRPD is less than CSL_UdmapTR15, size is just two times CSL_UdmapTR15 for alignment. More...
 
#define CSITX_DRV_RING_ENTRY_SIZE   (sizeof(uint64_t))
 Size (in bytes) of each ring entry (Size of pointer - 64-bit) More...
 
#define CSITX_DRV_RING_MEM_SIZE
 Total ring memory. More...
 
#define CSITX_DRV_RING_MEM_SIZE_ALIGN   ((CSITX_DRV_RING_MEM_SIZE + UDMA_CACHELINE_ALIGNMENT) & ~(UDMA_CACHELINE_ALIGNMENT - 1U))
 This ensures every channel memory is aligned. More...
 
#define CSITX_DRV_TRPD_SIZE_ALIGN   ((CSITX_DRV_TRPD_SIZE + UDMA_CACHELINE_ALIGNMENT) & ~(UDMA_CACHELINE_ALIGNMENT - 1U))
 This ensures every channel memory is aligned. More...
 
#define CSITX_DRV_DEF_PSIL_THREAD_ID   ((uint32_t) 0xFFU)
 PSIL Default thread ID. More...
 
#define CSITX_DRV_TR_LOG_CNT   (1000U)
 Number of entries to log for TR Submit debug. More...
 

CSITX DRV State

Represents the state of the CSITX Driver state.

#define CSITX_DRV_STATE_IDLE   ((uint32_t)0U)
 Driver is not open and is idle. More...
 
#define CSITX_DRV_STATE_CREATED   ((uint32_t)1U)
 Driver is created. More...
 
#define CSITX_DRV_STATE_DO_START   ((uint32_t)2U)
 Driver is requesting a start. More...
 
#define CSITX_DRV_STATE_RUNNING   ((uint32_t)3U)
 Driver is running. More...
 
#define CSITX_DRV_STATE_DO_STOP   ((uint32_t)4U)
 Driver is requesting a stop. More...
 
#define CSITX_DRV_STATE_STOPPED   ((uint32_t)5U)
 Driver is stopped. More...
 
#define CSITX_DRV_STATE_UNINIT   ((uint32_t)6U)
 Driver is un-initialized. More...
 

CSITX DRV Channel State

Represents the state of the CSITX channel state.

#define CSITX_DRV_CH_STATE_IDLE   ((uint32_t)0U)
 Channel is not open and is idle. More...
 
#define CSITX_DRV_CH_STATE_CREATED   ((uint32_t)1U)
 Channel is created. More...
 
#define CSITX_DRV_CH_STATE_RUNNING   ((uint32_t)2U)
 Channel is running. More...
 
#define CSITX_DRV_CH_STATE_STOPPED   ((uint32_t)3U)
 Channel is stopped. More...
 
#define CSITX_DRV_CH_STATE_STOPPING   ((uint32_t)4U)
 Channel is stopping. More...
 

CSITX Usage status

Usage status for module of CSI TX DRV.

#define CSITX_DRV_USAGE_STATUS_NOT_USED   ((uint32_t) 0xDEADBABEU)
 Usage Status: Not used. More...
 
#define CSITX_DRV_USAGE_STATUS_IN_USE   ((uint32_t) 0xABCDEF01U)
 Usage Status: In use. More...
 

CSITX Bits per pixel

Number of bits per pixel for a given format.

Fdrv_Handle CsitxDrv_create (uint32_t drvId, uint32_t instId, void *createArgs, void *createStatusArgs, const Fvid2_DrvCbParams *fdmCbParams)
 
int32_t CsitxDrv_delete (Fdrv_Handle handle, void *reserved)
 
int32_t CsitxDrv_queue (Fdrv_Handle handle, Fvid2_FrameList *frmList, uint32_t streamId)
 
int32_t CsitxDrv_dequeue (Fdrv_Handle handle, Fvid2_FrameList *frmList, uint32_t streamId, uint32_t timeout)
 
int32_t CsitxDrv_control (Fdrv_Handle handle, uint32_t cmd, void *cmdArgs, void *cmdStatusArgs)
 
int32_t CsitxDrv_eventGroupRegister (CsitxDrv_InstObj *instObj, Csitx_EventPrms *eventPrms)
 CSITX event group registration. More...
 
int32_t CsitxDrv_eventGroupUnRegister (CsitxDrv_InstObj *instObj, uint32_t eventGroup)
 CSITX unregister group event. More...
 
uint32_t CsitxDrv_getBpp (uint32_t dt)
 
uint32_t CsitxDrv_getStorageBpp (uint32_t dt)
 
int32_t CsitxDrv_dphytxSetLaneState (CsitxDrv_InstObj *instObj, uint32_t newState)
 CSITX DPHY lane state set function. More...
 
#define CSITX_BITS_PER_PIXEL_8_BITS   ((uint32_t) 8U)
 Bit/pixel: 8 bits/pixel. More...
 
#define CSITX_BITS_PER_PIXEL_12_BITS   ((uint32_t) 12U)
 Bit/pixel: 12 bits/pixel. More...
 
#define CSITX_BITS_PER_PIXEL_16_BITS   ((uint32_t) 16U)
 Bit/pixel: 16 bits/pixel. More...
 
#define CSITX_BITS_PER_PIXEL_32_BITS   ((uint32_t) 32U)
 Bit/pixel: 32 bits/pixel. More...
 
#define CSITX_BITS_PER_PIXEL_64_BITS   ((uint32_t) 64U)
 Bit/pixel: 64 bits/pixel. More...
 

Macro Definition Documentation

◆ CSITX_DRV_STATE_IDLE

#define CSITX_DRV_STATE_IDLE   ((uint32_t)0U)

Driver is not open and is idle.

◆ CSITX_DRV_STATE_CREATED

#define CSITX_DRV_STATE_CREATED   ((uint32_t)1U)

Driver is created.

◆ CSITX_DRV_STATE_DO_START

#define CSITX_DRV_STATE_DO_START   ((uint32_t)2U)

Driver is requesting a start.

◆ CSITX_DRV_STATE_RUNNING

#define CSITX_DRV_STATE_RUNNING   ((uint32_t)3U)

Driver is running.

◆ CSITX_DRV_STATE_DO_STOP

#define CSITX_DRV_STATE_DO_STOP   ((uint32_t)4U)

Driver is requesting a stop.

◆ CSITX_DRV_STATE_STOPPED

#define CSITX_DRV_STATE_STOPPED   ((uint32_t)5U)

Driver is stopped.

◆ CSITX_DRV_STATE_UNINIT

#define CSITX_DRV_STATE_UNINIT   ((uint32_t)6U)

Driver is un-initialized.

◆ CSITX_DRV_CH_STATE_IDLE

#define CSITX_DRV_CH_STATE_IDLE   ((uint32_t)0U)

Channel is not open and is idle.

◆ CSITX_DRV_CH_STATE_CREATED

#define CSITX_DRV_CH_STATE_CREATED   ((uint32_t)1U)

Channel is created.

◆ CSITX_DRV_CH_STATE_RUNNING

#define CSITX_DRV_CH_STATE_RUNNING   ((uint32_t)2U)

Channel is running.

◆ CSITX_DRV_CH_STATE_STOPPED

#define CSITX_DRV_CH_STATE_STOPPED   ((uint32_t)3U)

Channel is stopped.

◆ CSITX_DRV_CH_STATE_STOPPING

#define CSITX_DRV_CH_STATE_STOPPING   ((uint32_t)4U)

Channel is stopping.

◆ CSITX_DRV_TRPD_SIZE

#define CSITX_DRV_TRPD_SIZE   ((sizeof(CSL_UdmapTR15) * 2U) + 4U)

UDMA TR packet descriptor memory. This contains the CSL_UdmapCppi5TRPD + Padding to sizeof(CSL_UdmapTR15) + one Type_15 TR (CSL_UdmapTR15) + one TR response of 4 bytes. Since CSL_UdmapCppi5TRPD is less than CSL_UdmapTR15, size is just two times CSL_UdmapTR15 for alignment.

◆ CSITX_DRV_RING_ENTRY_SIZE

#define CSITX_DRV_RING_ENTRY_SIZE   (sizeof(uint64_t))

Size (in bytes) of each ring entry (Size of pointer - 64-bit)

◆ CSITX_DRV_RING_MEM_SIZE

#define CSITX_DRV_RING_MEM_SIZE
Value:
CSITX_DRV_RING_ENTRY_SIZE)
#define CSITX_TX_QUEUE_DEPTH_PER_CH
Default max number of frames that can be queued per capture driver instance.
Definition: csitx_cfg.h:97

Total ring memory.

◆ CSITX_DRV_RING_MEM_SIZE_ALIGN

#define CSITX_DRV_RING_MEM_SIZE_ALIGN   ((CSITX_DRV_RING_MEM_SIZE + UDMA_CACHELINE_ALIGNMENT) & ~(UDMA_CACHELINE_ALIGNMENT - 1U))

This ensures every channel memory is aligned.

◆ CSITX_DRV_TRPD_SIZE_ALIGN

#define CSITX_DRV_TRPD_SIZE_ALIGN   ((CSITX_DRV_TRPD_SIZE + UDMA_CACHELINE_ALIGNMENT) & ~(UDMA_CACHELINE_ALIGNMENT - 1U))

This ensures every channel memory is aligned.

◆ CSITX_DRV_DEF_PSIL_THREAD_ID

#define CSITX_DRV_DEF_PSIL_THREAD_ID   ((uint32_t) 0xFFU)

PSIL Default thread ID.

◆ CSITX_DRV_USAGE_STATUS_NOT_USED

#define CSITX_DRV_USAGE_STATUS_NOT_USED   ((uint32_t) 0xDEADBABEU)

Usage Status: Not used.

◆ CSITX_DRV_USAGE_STATUS_IN_USE

#define CSITX_DRV_USAGE_STATUS_IN_USE   ((uint32_t) 0xABCDEF01U)

Usage Status: In use.

◆ CSITX_DRV_TR_LOG_CNT

#define CSITX_DRV_TR_LOG_CNT   (1000U)

Number of entries to log for TR Submit debug.

◆ CSITX_BITS_PER_PIXEL_8_BITS

#define CSITX_BITS_PER_PIXEL_8_BITS   ((uint32_t) 8U)

Bit/pixel: 8 bits/pixel.

◆ CSITX_BITS_PER_PIXEL_12_BITS

#define CSITX_BITS_PER_PIXEL_12_BITS   ((uint32_t) 12U)

Bit/pixel: 12 bits/pixel.

◆ CSITX_BITS_PER_PIXEL_16_BITS

#define CSITX_BITS_PER_PIXEL_16_BITS   ((uint32_t) 16U)

Bit/pixel: 16 bits/pixel.

◆ CSITX_BITS_PER_PIXEL_32_BITS

#define CSITX_BITS_PER_PIXEL_32_BITS   ((uint32_t) 32U)

Bit/pixel: 32 bits/pixel.

◆ CSITX_BITS_PER_PIXEL_64_BITS

#define CSITX_BITS_PER_PIXEL_64_BITS   ((uint32_t) 64U)

Bit/pixel: 64 bits/pixel.

Function Documentation

◆ CsitxDrv_create()

Fdrv_Handle CsitxDrv_create ( uint32_t  drvId,
uint32_t  instId,
void *  createArgs,
void *  createStatusArgs,
const Fvid2_DrvCbParams *  fdmCbParams 
)

◆ CsitxDrv_delete()

int32_t CsitxDrv_delete ( Fdrv_Handle  handle,
void *  reserved 
)

◆ CsitxDrv_queue()

int32_t CsitxDrv_queue ( Fdrv_Handle  handle,
Fvid2_FrameList frmList,
uint32_t  streamId 
)

◆ CsitxDrv_dequeue()

int32_t CsitxDrv_dequeue ( Fdrv_Handle  handle,
Fvid2_FrameList frmList,
uint32_t  streamId,
uint32_t  timeout 
)

◆ CsitxDrv_control()

int32_t CsitxDrv_control ( Fdrv_Handle  handle,
uint32_t  cmd,
void *  cmdArgs,
void *  cmdStatusArgs 
)

◆ CsitxDrv_eventGroupRegister()

int32_t CsitxDrv_eventGroupRegister ( CsitxDrv_InstObj instObj,
Csitx_EventPrms eventPrms 
)

CSITX event group registration.

Register event based on CSITX channel based and event parameters.

Parameters
instObjCSITX instance object pointer
eventPrmsCSITX event parameters.
Returns
FVID2_SOK on success, error otherwise

◆ CsitxDrv_eventGroupUnRegister()

int32_t CsitxDrv_eventGroupUnRegister ( CsitxDrv_InstObj instObj,
uint32_t  eventGroup 
)

CSITX unregister group event.

Unregister the event and frees all associated resources.

Parameters
instObjCSITX instance object pointer
eventGroupCSITX event group to un-register.
Returns
FVID2_SOK on success, error otherwise

◆ CsitxDrv_getBpp()

uint32_t CsitxDrv_getBpp ( uint32_t  dt)

◆ CsitxDrv_getStorageBpp()

uint32_t CsitxDrv_getStorageBpp ( uint32_t  dt)

◆ CsitxDrv_dphytxSetLaneState()

int32_t CsitxDrv_dphytxSetLaneState ( CsitxDrv_InstObj instObj,
uint32_t  newState 
)

CSITX DPHY lane state set function.

Parameters
instObj[IN] Pointer to CsitxDrv_InstObj structure.
newState[IN] New lane state. See Csitx_DphyMode for details
Returns
FVID2_SOK on success, error otherwise