AM273x MCU+ SDK  09.02.00
csirx/v0/csirx.h File Reference

Go to the source code of this file.

Data Structures

struct  CSIRX_DphyConfig
 DPHY configuration. More...
 
struct  CSIRX_ComplexioLaneConfig
 Lane configuration. More...
 
struct  CSIRX_ComplexioLaneIntr
 Complex IO per lane interrupt. More...
 
struct  CSIRX_ComplexioLanesIntr
 Complex IO all (logical) lanes interrupts. More...
 
struct  CSIRX_ComplexioLanesConfig
 All lanes configuration. More...
 
struct  CSIRX_ComplexioConfig
 Complex IO configuration. More...
 
struct  CSIRX_CommonIntr
 Common (across contexts) interrupts. More...
 
struct  CSIRX_CommonIntrCallbacks
 Callbacks and callback arguments for various common interrupt event. More...
 
struct  CSIRX_CommonConfig
 Common to all context configuration. More...
 
struct  CSIRX_ContextPingPongConfig
 ping-pong related configuration for each context. Note specified ping and pong addresses can be identical which will effectively disable double buffering. More...
 
struct  CSIRX_ContextCropConfig
 Cropping configuration. More...
 
struct  CSIRX_ContextTranscodeConfig
 Transcoding configuration. More...
 
struct  CSIRX_ContextIntr
 Context interrupts. More...
 
struct  CSIRX_ContextConfig
 Context configuration. More...
 
struct  CSIRX_Info
 CSIRX Instance information. More...
 
struct  CSIRX_ContextObject
 Context specific state information, not to be used by end users. More...
 
struct  CSIRX_Object
 CSIRX Instance Object. Used internally, not to be used by end users. More...
 
struct  CSIRX_HwAttrs
 CSIRX HW Attributes. Generated when using sysconfig. More...
 
struct  CSIRX_Config
 CSIRX Instance Config Object. More...
 

Macros

#define CSIRX_DATA_LANES_MAX   (4U)
 Max possible data lanes. More...
 
#define CSIRX_STOP_STATE_FSM_TIMEOUT_MAX   (200000U)
 Special value of CSIRX_CommonConfig::stopStateFsmTimeoutInNanoSecs for setting maximum timeout, this is also the CSIRX IP reset state. More...
 
#define CSIRX_CONTEXTS_MAX   (8U)
 Max possible CSIRX contexts. More...
 
#define CSIRX_PING_PONG_ADDRESS_LINEOFFSET_ALIGNMENT_IN_BYTES   (32U)
 Ping-pong addresses and line offset alignment. Can be used for aligning ping-pong buffers and enforcing line offset alignment in bytes. More...
 
#define CSIRX_LINEOFFSET_CONTIGUOUS_STORAGE   (0U)
 Special value for contiguous storage. More...
 
#define CSIRX_NUM_FRAMES_TO_ACQUIRE_INFINITE   (0U)
 Special value of CSIRX_ContextConfig::numFramesToAcquire for setting infinite frames, this is also the CSIRX IP reset state. More...
 
#define CSIRX_INTERRUPT_NOT_CONNECTED_ID   (0xFFFFU)
 Interrupt number ID to indicate, this interrupt line is not connected in this CPU. More...
 
Complex IO power commands

#define CSIRX_COMPLEXIO_POWER_COMMAND_OFF   (0U)
 Power off ComplexIO. More...
 
#define CSIRX_COMPLEXIO_POWER_COMMAND_ON   (1U)
 Power on ComplexIO. More...
 
#define CSIRX_COMPLEXIO_POWER_COMMAND_ULP   (2U)
 Put ComplexIO in ULP (Ultra Low Power) state. More...
 
Complex IO power status

#define CSIRX_COMPLEXIO_POWER_STATUS_OFF   (0U)
 Complex IO power status OFF. More...
 
#define CSIRX_COMPLEXIO_POWER_STATUS_ON   (1U)
 Complex IO power status ON. More...
 
#define CSIRX_COMPLEXIO_POWER_STATUS_ULP   (2U)
 Complex IO power status ULP (Ultra Low Power) More...
 
Lane polarity

#define CSIRX_LANE_POLARITY_PLUS_MINUS   (0U)
 Lane polarity +/-. More...
 
#define CSIRX_LANE_POLARITY_MINUS_PLUS   (1U)
 Lane polarity -/+. More...
 
Lane position

#define CSIRX_LANE_POSITION_LANE_NOT_USED   (0U)
 Lane not used. More...
 
#define CSIRX_LANE_POSITION_1   (1U)
 Physical lane position #1. More...
 
#define CSIRX_LANE_POSITION_2   (2U)
 Physical lane position #2. More...
 
#define CSIRX_LANE_POSITION_3   (3U)
 Physical lane position #3. More...
 
#define CSIRX_LANE_POSITION_4   (4U)
 Physical lane position #4. More...
 
#define CSIRX_LANE_POSITION_5   (5U)
 Physical lane position #5. More...
 
Data endianess

#define CSIRX_ENDIANNESS_NATIVE_MIPI_CSI2   (0U)
 All little endian except legacy YUV422 8b and YUV420, which are big endian. More...
 
#define CSIRX_ENDIANNESS_LITTLE_ENDIAN   (1U)
 All little endian. More...
 
#define CSIRX_ENDIANNESS_MAX   (1U)
 Endianness max for error checking purposes. More...
 
Burst size defines

#define CSIRX_BURST_SIZE_1X64   (0U)
 Burst size 1x64 OCP writes. More...
 
#define CSIRX_BURST_SIZE_2X64   (1U)
 Burst size 2x64 OCP writes. More...
 
#define CSIRX_BURST_SIZE_4X64   (2U)
 Burst size 4x64 OCP writes. More...
 
#define CSIRX_BURST_SIZE_8X64   (3U)
 Burst size 8x64 OCP writes. More...
 
#define CSIRX_BURST_SIZE_MAX   (3U)
 Burst size max. More...
 
Ping or Pong done status

#define CSIRX_CONTEXT_PINGPONG_STATUS_PING_DONE   (0U)
 Ping is done. More...
 
#define CSIRX_CONTEXT_PINGPONG_STATUS_PONG_DONE   (1U)
 Pong is done. More...
 
Ping pong switching mode

#define CSIRX_PING_PONG_FRAME_SWITCHING   (0U)
 Switch ping pong address on end of frame. More...
 
#define CSIRX_PING_PONG_LINE_SWITCHING   (1U)
 Switch ping pong address on end of line. More...
 
Transcode format

#define CSIRX_TRANSCODE_FORMAT_NO_TRANSCODE   (0U)
 Transcoding disabled. More...
 
#define CSIRX_TRANSCODE_FORMAT_IN_RAW10_ALAW_OUT_RAW8   (3U)
 Compress input RAW10 using A-law. Output is regular RAW8. More...
 
#define CSIRX_TRANSCODE_FORMAT_IN_RAW8_OUT_RAW8   (4U)
 Regular RAW8 input and regular RAW8 output. More...
 
#define CSIRX_TRANSCODE_FORMAT_IN_RAW10_OUT_RAW10_EXP16   (5U)
 Input uncompressed RAW10, output RAW10 + EXP16. More...
 
#define CSIRX_TRANSCODE_FORMAT_IN_RAW10_OUT_RAW10_PACKED   (6U)
 Input uncompressed RAW10, output regular packed RAW10. More...
 
#define CSIRX_TRANSCODE_FORMAT_IN_RAW12_OUT_RAW12_EXP16   (7U)
 Input uncompressed RAW12, output RAW12 + EXP16. More...
 
#define CSIRX_TRANSCODE_FORMAT_IN_RAW12_OUT_RAW12_PACKED   (8U)
 Input uncompressed RAW12, output regular packed RAW12. More...
 
#define CSIRX_TRANSCODE_FORMAT_IN_RAW14_OUT_RAW14   (9U)
 Input uncompressed RAW14, output uncompressed RAW14. More...
 
Data format

#define CSIRX_FORMAT_OTHERS_EXCEPT_NULL_AND_BLANKING   (0x000U)
 Others except NULL and BLANKING. More...
 
#define CSIRX_FORMAT_EMBEDDED_8_BIT_NON_IMAGE   (0x012U)
 Embedded 8-bit non image (for example JPEG) as per MIPI spec. More...
 
#define CSIRX_FORMAT_YUV420_8_BIT   (0x018U)
 YUV420 8-bit as per MIPI spec. More...
 
#define CSIRX_FORMAT_YUV420_10_BIT   (0x019U)
 YUV420 10-bit as per MIPI spec. More...
 
#define CSIRX_FORMAT_YUV420_8_BIT_LEGACY   (0x01AU)
 YUV420 8-bit legacy as per MIPI spec. More...
 
#define CSIRX_FORMAT_YUV420_8_BIT_CSPS   (0x01CU)
 YUV420 8-bit CSPS (Chroma Shifted Pixel Sampling) as per MIPI spec. More...
 
#define CSIRX_FORMAT_YUV420_10_BIT_CSPS   (0x01DU)
 YUV420 10-bit CSPS (Chroma Shifted Pixel Sampling) as per MIPI spec. More...
 
#define CSIRX_FORMAT_YUV422_8_BIT   (0x01EU)
 YUV422 8-bit as per MIPI spec. More...
 
#define CSIRX_FORMAT_YUV422_10_BIT   (0x01FU)
 YUV422 10-bit as per MIPI spec. More...
 
#define CSIRX_FORMAT_RGB565   (0x022U)
 RGB565 as per MIPI spec. More...
 
#define CSIRX_FORMAT_RGB888   (0x024U)
 RGB888 as per MIPI spec. More...
 
#define CSIRX_FORMAT_RAW6   (0x028U)
 RAW6 as per MIPI spec. More...
 
#define CSIRX_FORMAT_RAW7   (0x029U)
 RAW7 as per MIPI spec. More...
 
#define CSIRX_FORMAT_RAW8   (0x02AU)
 RAW8 as per MIPI spec. More...
 
#define CSIRX_FORMAT_RAW10   (0x02BU)
 RAW19 as per MIPI spec. More...
 
#define CSIRX_FORMAT_RAW12   (0x02CU)
 RAW12 as per MIPI spec. More...
 
#define CSIRX_FORMAT_RAW14   (0x02DU)
 RAW14 as per MIPI spec. More...
 
#define CSIRX_FORMAT_RGB666_EXP32_24   (0x033U)
 RGB666 EXP32_24: EXP32 = Data expansion to 32 bits, padding with CSIRX_ContextConfig::alpha. Most significant 8-bits of output 32-bit will be equal to the least significant 8-bits of CSIRX_ContextConfig::alpha. More...
 
#define CSIRX_FORMAT_USER_DEFINED_8_BIT_DATA_TYPE_1   (0x040U)
 User Defined 8-bit data type 1. More...
 
#define CSIRX_FORMAT_USER_DEFINED_8_BIT_DATA_TYPE_2   (0x041U)
 User Defined 8-bit data type 2. More...
 
#define CSIRX_FORMAT_USER_DEFINED_8_BIT_DATA_TYPE_3   (0x042U)
 User Defined 8-bit data type 3. More...
 
#define CSIRX_FORMAT_USER_DEFINED_8_BIT_DATA_TYPE_4   (0x043U)
 User Defined 8-bit data type 4. More...
 
#define CSIRX_FORMAT_USER_DEFINED_8_BIT_DATA_TYPE_5   (0x044U)
 User Defined 8-bit data type 5. More...
 
#define CSIRX_FORMAT_USER_DEFINED_8_BIT_DATA_TYPE_6   (0x045U)
 User Defined 8-bit data type 6. More...
 
#define CSIRX_FORMAT_USER_DEFINED_8_BIT_DATA_TYPE_7   (0x046U)
 User Defined 8-bit data type 7. More...
 
#define CSIRX_FORMAT_USER_DEFINED_8_BIT_DATA_TYPE_8   (0x047U)
 User Defined 8-bit data type 8. More...
 
#define CSIRX_FORMAT_RAW6_EXP8   (0x068U)
 RAW6 with data expansion to 8-bits, padding with zeros. More...
 
#define CSIRX_FORMAT_RAW7_EXP8   (0x069U)
 RAW7 with data expansion to 8-bits, padding with zeros. More...
 
#define CSIRX_FORMAT_USER_DEFINED_8_BIT_DATA_TYPE_1_EXP8   (0x080U)
 User Defined 8-bit data type 1 with data expansion to 8-bits, padding with zeros. More...
 
#define CSIRX_FORMAT_USER_DEFINED_8_BIT_DATA_TYPE_2_EXP8   (0x081U)
 User Defined 8-bit data type 2 with data expansion to 8-bits, padding with zeros. More...
 
#define CSIRX_FORMAT_USER_DEFINED_8_BIT_DATA_TYPE_3_EXP8   (0x082U)
 User Defined 8-bit data type 3 with data expansion to 8-bits, padding with zeros. More...
 
#define CSIRX_FORMAT_USER_DEFINED_8_BIT_DATA_TYPE_4_EXP8   (0x083U)
 User Defined 8-bit data type 4 with data expansion to 8-bits, padding with zeros. More...
 
#define CSIRX_FORMAT_USER_DEFINED_8_BIT_DATA_TYPE_5_EXP8   (0x084U)
 User Defined 8-bit data type 5 with data expansion to 8-bits, padding with zeros. More...
 
#define CSIRX_FORMAT_USER_DEFINED_8_BIT_DATA_TYPE_6_EXP8   (0x085U)
 User Defined 8-bit data type 6 with data expansion to 8-bits, padding with zeros. More...
 
#define CSIRX_FORMAT_USER_DEFINED_8_BIT_DATA_TYPE_7_EXP8   (0x086U)
 User Defined 8-bit data type 7 with data expansion to 8-bits, padding with zeros. More...
 
#define CSIRX_FORMAT_USER_DEFINED_8_BIT_DATA_TYPE_8_EXP8   (0x087U)
 User Defined 8-bit data type 8 with data expansion to 8-bits, padding with zeros. More...
 
#define CSIRX_FORMAT_RGB444_EXP16   (0x0A0U)
 RGB444 with data expansion to 16-bits. Most significant 4-bits of 16-bit output will be equal to the least significant 4-bits of CSIRX_ContextConfig::alpha. More...
 
#define CSIRX_FORMAT_RGB555_EXP16   (0x0A1U)
 RGB555 with data expansion to 16-bits. Most significant 1-bit of 16-bit output will be equal to the least significant 1-bit of CSIRX_ContextConfig::alpha. More...
 
#define CSIRX_FORMAT_RAW10_EXP16   (0x0ABU)
 RAW10 with data expansion to 16-bits. Most significant 6-bits of 16-bit output will be equal to the least significant 6-bits of CSIRX_ContextConfig::alpha. More...
 
#define CSIRX_FORMAT_RAW12_EXP16   (0x0ACU)
 RAW12 with data expansion to 16-bits. Most significant 4-bits of 16-bit output will be equal to the least significant 4-bits of CSIRX_ContextConfig::alpha. More...
 
#define CSIRX_FORMAT_RAW14_EXP16   (0x0ADU)
 RAW14 with data expansion to 16-bits. Most significant 2-bits of 16-bit output will be equal to the least significant 2-bits of CSIRX_ContextConfig::alpha. More...
 
#define CSIRX_FORMAT_RGB666_EXP32   (0x0E3U)
 RGB666 with data expansion to 32-bits. Most significant 14-bits of 32-bit output will be equal to the least significant 14-bits of CSIRX_ContextConfig::alpha. More...
 
#define CSIRX_FORMAT_RGB888_EXP32   (0x0E4U)
 RGB888 with data expansion to 32-bits. Most significant 8-bits of 32-bit output will be equal to the least significant 8-bits of CSIRX_ContextConfig::alpha. More...
 
User defined data format

#define CSIRX_USER_DEFINED_FORMAT_RAW6   (0U)
 RAW6. More...
 
#define CSIRX_USER_DEFINED_FORMAT_RAW7   (1U)
 RAW8. More...
 
#define CSIRX_USER_DEFINED_FORMAT_RAW8   (2U)
 RAW8, not valid if CSIRX_ContextConfig::format is any of the defines CSIRX_FORMAT_USER_DEFINED_8_BIT_DATA_TYPE_x_EXP8 (x=1..8) in CSIRX_DATA_FORMAT. More...
 
FIFO depth

#define CSIRX_FIFODEPTH_8X68   (2U)
 FIFO depth is 8 times 68-bits. More...
 
#define CSIRX_FIFODEPTH_16X68   (3U)
 FIFO depth is 16 times 68-bits. More...
 
#define CSIRX_FIFODEPTH_32X68   (4U)
 FIFO depth is 32 times 68-bits. More...
 
#define CSIRX_FIFODEPTH_64X68   (5U)
 FIFO depth is 64 times 68-bits. More...
 
#define CSIRX_FIFODEPTH_128X68   (6U)
 FIFO depth is 128 times 68-bits. More...
 
#define CSIRX_FIFODEPTH_256X68   (7U)
 FIFO depth is 256 times 68-bits. More...
 

Typedefs

typedef struct CSIRX_Config_s * CSIRX_Handle
 CSIRX driver handle. More...
 
typedef void(* CSIRX_CommonCallback) (CSIRX_Handle handle, void *arg, struct CSIRX_CommonIntr_s *irq)
 Common interrupt callback. More...
 
typedef void(* CSIRX_Callback) (CSIRX_Handle handle, void *arg)
 Generic Interrupt callback. More...
 
typedef void(* CSIRX_ContextCallback) (CSIRX_Handle handle, void *arg, uint8_t contextId)
 Context interrupt callback. More...
 

Functions

int32_t CSIRX_init (void)
 Initialize CSIRX driver. More...
 
int32_t CSIRX_deinit (void)
 De-Initialize CSIRX driver. More...
 
CSIRX_Handle CSIRX_open (uint32_t instanceId)
 Open CSIRX driver. More...
 
int32_t CSIRX_getInfo (CSIRX_Handle handle, CSIRX_Info *info)
 Get CSIRX instance info. More...
 
int32_t CSIRX_reset (CSIRX_Handle handle)
 Reset CSIRX instance. More...
 
int32_t CSIRX_close (CSIRX_Handle handle)
 Close CSIRX instance. More...
 
void CSIRX_DphyConfig_init (CSIRX_DphyConfig *config)
 Sets default values for configuration. More...
 
int32_t CSIRX_dphySetConfig (CSIRX_Handle handle, CSIRX_DphyConfig *config)
 Configure DPHY. More...
 
int32_t CSIRX_dphyIsControlClockResetDone (CSIRX_Handle handle, bool *isDone)
 Check if DPHY control clock reset is done. More...
 
int32_t CSIRX_dphyIsByteClockResetDone (CSIRX_Handle handle, bool *isDone)
 Check if DPHY byte clock reset is done. More...
 
int32_t CSIRX_dphyIsClockMissingDetectorError (CSIRX_Handle handle, bool *isError)
 Check if DPHY clock missing detector error. More...
 
void CSIRX_ComplexioConfig_init (CSIRX_ComplexioConfig *config)
 Sets default values for configuration. More...
 
int32_t CSIRX_complexioSetConfig (CSIRX_Handle handle, CSIRX_ComplexioConfig *config)
 Configure Complex IO. More...
 
int32_t CSIRX_complexioClearAllIntr (CSIRX_Handle handle)
 Celar all pending complex IO interrupts. More...
 
int32_t CSIRX_complexioGetPendingIntr (CSIRX_Handle handle, CSIRX_ComplexioLanesIntr *intrStatus)
 Get all pending complex IO interrupts. More...
 
int32_t CSIRX_complexioGetPowerStatus (CSIRX_Handle handle, uint8_t *powerStatus)
 Query about ComplexIO power status. More...
 
int32_t CSIRX_complexioSetPowerCommand (CSIRX_Handle handle, uint8_t powerCommand)
 Set Complex IO power command. More...
 
int32_t CSIRX_complexioDeassertReset (CSIRX_Handle handle)
 Deaasert complex IO reset. More...
 
int32_t CSIRX_complexioAssertForceRxModeOn (CSIRX_Handle handle)
 Assert Force Rx Mode on complex IO. More...
 
int32_t CSIRX_complexioDeassertForceRxModeOn (CSIRX_Handle handle)
 De-assert Force Rx Mode on complex IO. More...
 
int32_t CSIRX_complexioIsResetDone (CSIRX_Handle handle, bool *isDone)
 Check if complex IO reset is done. More...
 
int32_t CSIRX_complexioIsDeassertForceRxModeOn (CSIRX_Handle handle, bool *isDeasserted)
 Check if force RX mode on is deasserted. More...
 
static int32_t CSIRX_complexioPowerOn (CSIRX_Handle handle)
 Power ON complex IO. More...
 
static int32_t CSIRX_complexioPowerOff (CSIRX_Handle handle)
 Power OFF complex IO. More...
 
static int32_t CSIRX_complexioUltraLowPower (CSIRX_Handle handle)
 Put complex IO in ULP (Ultra Low Power) state. More...
 
void CSIRX_CommonConfig_init (CSIRX_CommonConfig *config)
 Sets default values for configuration. More...
 
int32_t CSIRX_commonSetConfig (CSIRX_Handle handle, CSIRX_CommonConfig *config)
 Configure common to all context settings. More...
 
int32_t CSIRX_commonClearAllIntr (CSIRX_Handle handle)
 Clear all pending common to all context interrupts. More...
 
int32_t CSIRX_commonGetPendingIntr (CSIRX_Handle handle, CSIRX_CommonIntr *intrStatus)
 Get all pending common to all context interrupts. More...
 
int32_t CSIRX_commonGetGenericShortPacket (CSIRX_Handle handle, uint32_t *shortPacket)
 Get generic short packet header. More...
 
int32_t CSIRX_commonEnable (CSIRX_Handle handle)
 Enable CSIRX interface. More...
 
int32_t CSIRX_commonDisable (CSIRX_Handle handle)
 Disable CSIRX interface. More...
 
void CSIRX_ContextConfig_init (CSIRX_ContextConfig *config)
 Sets default values for configuration. More...
 
int32_t CSIRX_contextSetConfig (CSIRX_Handle handle, uint8_t contextId, CSIRX_ContextConfig *config)
 Configure context. More...
 
int32_t CSIRX_contextSetPingPongAddress (CSIRX_Handle handle, uint8_t contextId, uint32_t pingAddress, uint32_t pongAddress)
 Set context ping and pong address. More...
 
int32_t CSIRX_contextSetLineOffset (CSIRX_Handle handle, uint8_t contextId, int32_t lineOffset)
 Set context line offset. More...
 
int32_t CSIRX_contextEnable (CSIRX_Handle handle, uint8_t contextId)
 Enable context. More...
 
int32_t CSIRX_contextDisable (CSIRX_Handle handle, uint8_t contextId)
 Disable context. More...
 
int32_t CSIRX_contextClearAllIntr (CSIRX_Handle handle, uint8_t contextId)
 Clear all pending context interrupts. More...
 
int32_t CSIRX_contextGetPendingIntr (CSIRX_Handle handle, uint8_t contextId, CSIRX_ContextIntr *intrStatus)
 Get all pending context interrupts. More...
 
int32_t CSIRX_contextGetFrameNumber (CSIRX_Handle handle, uint8_t contextId, uint16_t *frameNumber)
 Get current frame number as decoded from within CSIRX long packet. More...
 
int32_t CSIRX_contextGetRecvAddress (CSIRX_Handle handle, uint8_t contextId, uint32_t *bufAddress)
 Get current completed receive address. More...
 
int32_t CSIRX_contextGetPingPongStatus (CSIRX_Handle handle, uint8_t contextId, uint8_t *pingPongStatus)
 Get status if ping or pong buffer write is done. More...
 
int32_t CSIRX_debugModeSetShortPacket (CSIRX_Handle handle, uint32_t shortPacket)
 Set short packet header. More...
 
int32_t CSIRX_debugModeSetLongPacketHeader (CSIRX_Handle handle, uint32_t longPacketHeader)
 Set long packet header. More...
 
int32_t CSIRX_debugModeSetLongPacketPayload (CSIRX_Handle handle, uint32_t payload)
 Set long packet payload. More...
 
int32_t CSIRX_debugModeEnable (CSIRX_Handle handle)
 Enable debug mode. More...
 
int32_t CSIRX_debugModeDisable (CSIRX_Handle handle)
 Disable debug mode. More...
 
void CSIRX_debugModeGenerateFrames (CSIRX_Handle handle, uint16_t txFormat, uint8_t virtualChannelId, uint32_t numOfFrames, uint32_t numLinesPerFrame, uint32_t numBytesPerLine)
 Generate frames in debug mode. More...
 

Variables

CSIRX_Config gCsirxConfig []
 Array of CSIRX instance enabled via SysConfig. More...
 
uint32_t gCsirxConfigNum
 Number of CSIRX instances enabled via SysConfig. More...