csi2tx: Csi2tx_v1_0

| csi2tx Xilinx SDK Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List
- Examples

Data Structures | Macros | Typedefs | Enumerations | Functions
Csi2tx_v1_0

## Data Structures
struct | XCsi2Tx_SPktData
| This typedef contains the Short Packet information from the Generic Short Packet Register. More...
struct | XCsi2Tx_Config
| The configuration structure for CSI Controller. More...
struct | XCsi2Tx
| The XCsi2Tx driver instance data. More...

## Macros
#define | XCSI2TX_H_
| Prevent circular inclusions by using protection macros. More...
#define | XCSI2TX_ENABLE 1
| Flag denoting enabling of CSI. More...
#define | XCSI2TX_DISABLE 0
| Flag denoting disabling of CSI. More...
#define | XCSI2TX_MAX_LANES 4
| Max Lanes supported by CSI. More...
#define | XCSI2TX_MAX_VC 4
| Max number of Virtual Channels. More...
#define | XCSI2TX_HW_H_
| Prevent circular inclusions by using protection macros. More...
#define | XCSI2TX_GSP_MASK 0x00000001F
| Number of GSPs can be safely written to GSP FIFO, before it goes full. More...

## Typedefs
typedef void(* | XCsi2Tx_CallBack )(void *CallBackRef, u32 Mask)
| Callback type for all interrupts defined. More...

## Enumerations
enum | XCsi2Tx_LCStatus { XCSI2TX_LC_LESS_LINES = 1, XCSI2TX_LC_MORE_LINES }
| This typedef defines the different errors codes for Line Count status for a Virtual Channel when Frame End Generation is enabled. More...

## Functions
u32 | XCsi2Tx_CfgInitialize (XCsi2Tx *InstancePtr, XCsi2Tx_Config *CfgPtr, UINTPTR EffectiveAddr)
| Initialize the XCsi2Tx instance provided by the caller based on the given Config structure. More...
u32 | XCsi2Tx_Reset (XCsi2Tx *InstancePtr)
| This function will do a reset of the IP. More...
u32 | XCsi2Tx_Activate (XCsi2Tx *InstancePtr, u8 Flag)
| Thsi function will enable/disable the IP Core to start processing. More...
u32 | XCsi2Tx_Configure (XCsi2Tx *InstancePtr)
| This function will configure the core with proper number of Active Lanes. More...
void | XCsi2Tx_GetShortPacket (XCsi2Tx *InstancePtr, XCsi2Tx_SPktData *ShortPacketStruct)
| This function will get the short packet received in the FIFO from the Generic Short Packet Register and fill up the structure passed from caller. More...
u8 | XCsi2Tx_IsActiveLaneCountValid (XCsi2Tx *InstancePtr, u8 ActiveLanesCount)
| This function checks the validity of the active lanes parameter. More...
u32 | XCsi2Tx_SetLineCountForVC (XCsi2Tx *InstancePtr, u8 VC, u16 LineCount)
| This function sets the Line Count for virtual Channel if Frame End Generation feature is enabled. More...
u32 | XCsi2Tx_GetLineCountForVC (XCsi2Tx *InstancePtr, u8 VC, u16 *LineCount)
| This function gets the Line Count for virtual Channel if Frame End Generation feature is enabled. More...
XCsi2Tx_Config * | XCsi2Tx_LookupConfig (u32 DeviceId)
| Look up the hardware configuration for a device instance. More...
u32 | XCsi2Tx_SelfTest (XCsi2Tx *InstancePtr)
| Runs a self-test on the driver/device. More...
void | XCsi2Tx_IntrHandler (void *InstancePtr)
| This function is the interrupt handler for the CSI2 Tx core. More...
int | XCsi2Tx_SetCallBack (XCsi2Tx *InstancePtr, u32 HandleType, void *Callbackfunc, void *Callbackref)
| This routine installs an asynchronous callback function for the given HandlerType: More...
u32 | XCsi2Tx_GetIntrEnable (XCsi2Tx *InstancePtr)
| This function will get the interrupt mask set (enabled) in the CSI2 Tx core. More...
void | XCsi2Tx_IntrEnable (XCsi2Tx *InstancePtr, u32 Mask)
| This function will enable the interrupts present in the interrupt mask passed onto the function. More...
void | XCsi2Tx_IntrDisable (XCsi2Tx *InstancePtr, u32 Mask)
| This function will disable the interrupts present in the interrupt mask passed onto the function. More...
u32 | XCsi2Tx_GetIntrStatus (XCsi2Tx *InstancePtr)
| This function will get the list of interrupts pending in the Interrupt Status Register of the CSI2 Tx core. More...
void | XCsi2Tx_InterruptClear (XCsi2Tx *InstancePtr, u32 Mask)
| This function will clear the interrupts set in the Interrupt Status Register of the CSI2 Tx core. More...
u32 | Csi2TxSelfTestExample (u32 DeviceId)
| This function checks if the Max Lane count from the generated file matches the value present in the protocol configuration register. More...
int | main ()
| The entry point for this example. More...

## Interrupt Types for setting Callbacks
#define | XCSI2TX_HANDLER_WRG_LANE 1
#define | XCSI2TX_HANDLER_GSPFIFO_FULL 2
#define | XCSI2TX_HANDLER_ULPS 3
#define | XCSI2TX_HANDLER_LINEBUF_FULL 4
#define | XCSI2TX_HANDLER_WRG_DATATYPE 5
#define | XCSI2TX_HANDLER_UNDERRUN_PIXEL 6
#define | XCSI2TX_HANDLER_LCERRVC0 7
#define | XCSI2TX_HANDLER_LCERRVC1 8
#define | XCSI2TX_HANDLER_LCERRVC2 9
#define | XCSI2TX_HANDLER_LCERRVC3 10

## Device registers
Register sets of MIPI CSI2 Tx Core
#define | XCSI2TX_CCR_OFFSET 0x00000000
| Core Configuration Register. More...
#define | XCSI2TX_PCR_OFFSET
#define | XCSI2TX_GIER_OFFSET 0x00000020
| Global Interrupt Register. More...
#define | XCSI2TX_ISR_OFFSET 0x00000024
| Interrupt Status Register. More...
#define | XCSI2TX_IER_OFFSET 0x00000028
| Interrupt Enable Register. More...
#define | XCSI2TX_SPKTR_OFFSET 0x00000030
| Generic Short Packet Entry. More...
#define | XCSI2TX_LINE_COUNT_VC0 0x00000040
| Line Count for VC0. More...
#define | XCSI2TX_LINE_COUNT_VC1 0x00000044
| Line Count for VC1. More...
#define | XCSI2TX_LINE_COUNT_VC2 0x00000048
| Line Count for VC2. More...
#define | XCSI2TX_LINE_COUNT_VC3 0x0000004C
| Line Count for VC3. More...
#define | XCSI2TX_GSP_OFFSET 0x00000078 /* < GSP Status*/

## Bitmasks and offsets of XCSI_GIER_OFFSET register
This register contains the global interrupt enable bit.
#define | XCSI2TX_GIER_GIE_MASK 0x00000001
| Global Interrupt Enable bit. More...
#define | XCSI2TX_GIER_GIE_SHIFT 0
| Shift bits for Global Interrupt Enable. More...
#define | XCSI2TX_GIER_SET 1
| Enable the Global Interrupts. More...
#define | XCSI2TX_GIER_RESET 0
| Disable the Global Interrupts. More...

## Bitmasks and offsets of XCSI_CCR_OFFSET register
This register is used for the enabling/disabling and resetting the core of CSI2 Tx Controller
#define | XCSI2TX_CCR_COREENB_MASK 0x00000001 /* Enable/Disable core */
#define | XCSI2TX_CCR_SOFTRESET_MASK 0x00000002 /* Soft Reset the core */
#define | XCSI2TX_CSR_RIPCD_MASK 0x00000004 /* Core ready */
#define | XCSI2TX_CCR_ULPS_MASK 0x00000008 /* ULPS */
#define | XCSI2TX_CCR_CLKMODE_MASK 0x00000010 /* Clock Mode */
#define | XCSI2TX_CCR_COREENB_SHIFT 0 /* Shift bit for Core Enable*/
#define | XCSI2TX_CCR_SOFTRESET_SHIFT 1 /* Shift bit for Soft reset */
#define | XCSI2TX_CSR_RIPCD_SHIFT 2 /* Bit Shift for Core Ready */
#define | XCSI2TX_CCR_ULPS_SHIFT 3 /* Shift bits for ulps */
#define | XCSI2TX_CCR_CLKMODE_SHIFT 4 /* Shift bits for clock mode */

## Bitmasks and offset of XCSI2TX_PCR_OFFSET register
This register reports the number of lanes configured during core generation and number of lanes actively used.
#define | XCSI2TX_PCR_LINEGEN_MASK 0x00008000 /* Line generation Mode */
#define | XCSI2TX_PCR_PIXEL_MASK 0x00006000 /* Pixel Mode */
#define | XCSI2TX_PCR_MAXLANES_MASK 0x00000018 /* Maximum lanes in core */
#define | XCSI2TX_PCR_ACTLANES_MASK 0x00000003 /* Active lanes in core */
#define | XCSI2TX_PCR_LINEGEN_SHIFT 15 /* Line generation */
#define | XCSI2TX_PCR_PIXEL_SHIFT 13 /* Pixel Mode */
#define | XCSI2TX_PCR_MAXLANES_SHIFT 3 /* Max Lanes */
#define | XCSI2TX_PCR_ACTLANES_SHIFT 0 /* Active Lanes */

## BitMasks interrupts
#define | XCSI2TX_IER_ALLINTR_MASK 0x0000003F /* All interrupts mask */
#define | XCSI2TX_ISR_ALLINTR_MASK 0x0000003F /* All interrupts mask */
#define | XCSI2TX_UNDERRUN_PIXEL_MASK (1<<0) /* Underrun Pixel */
#define | XCSI2TX_WRONG_DATATYPE_MASK (1<<1) /* Wrong data type */
#define | XCSI2TX_LINE_BUFF_FULL_MASK (1<<2) /* Line buffer full */
#define | XCSI2TX_DPHY_ULPS_MASK (1<<3) /* Dphy ulps */
#define | XCSI_GPSFIFO_MASK (1<<4) /* GPS fifo full */
#define | XCSI_INCORT_LANE_MASK (1<<5) /* Wrong lane configuration */
#define | XCSITX_LCSTAT_VC0_IER_MASK (1<<8)
| Line Count Status for VC0 IER. More...
#define | XCSITX_LCSTAT_VC1_IER_MASK (1<<10)
| Line Count Status for VC1 IER. More...
#define | XCSITX_LCSTAT_VC2_IER_MASK (1<<12)
| Line Count Status for VC2 IER. More...
#define | XCSITX_LCSTAT_VC3_IER_MASK (1<<14)
| Line Count Status for VC3 IER. More...
#define | XCSITX_LCSTAT_VC0_IER_OFFSET (8)
| Line Count Status for VC0 IER Offset. More...
#define | XCSITX_LCSTAT_VC1_IER_OFFSET (10)
| Line Count Status for VC1 IER Offset. More...
#define | XCSITX_LCSTAT_VC2_IER_OFFSET (12)
| Line Count Status for VC2 IER Offset. More...
#define | XCSITX_LCSTAT_VC3_IER_OFFSET (14)
| Line Count Status for VC3 IER Offset. More...
#define | XCSITX_LCSTAT_VC0_ISR_MASK (0x3<<8)
| Line Count Status for VC0 ISR. More...
#define | XCSITX_LCSTAT_VC1_ISR_MASK (0x3<<10)
| Line Count Status for VC1 ISR. More...
#define | XCSITX_LCSTAT_VC2_ISR_MASK (0x3<<12)
| Line Count Status for VC2 ISR. More...
#define | XCSITX_LCSTAT_VC3_ISR_MASK (0x3<<14)
| Line Count Status for VC3 ISR. More...
#define | XCSITX_LCSTAT_VC0_ISR_OFFSET (8)
| Line Count Status for VC0 ISR Offset. More...
#define | XCSITX_LCSTAT_VC1_ISR_OFFSET (10)
| Line Count Status for VC1 ISR Offset. More...
#define | XCSITX_LCSTAT_VC2_ISR_OFFSET (12)
| Line Count Status for VC2 ISR Offset. More...
#define | XCSITX_LCSTAT_VC3_ISR_OFFSET (14)
| Line Count Status for VC3 ISR Offset. More...

## BitMasks Short Packets
#define | XCSI2TX_SPKTR_DATA_MASK 0x00FFFF00 /* Short Packet byte0 and 1*/
#define | XCSI2TX_SPKTR_DATA_SHIFT 8
#define | XCSI2TX_SPKTR_VC_MASK
#define | XCSI2TX_SPKTR_VC_SHIFT 6
#define | XCSI2TX_SPKTR_DT_MASK 0x0000003F /* Short Packet Data type*/
#define | XCSI2TX_SPKTR_DT_SHIFT 0

## Macro Definition Documentation

#define XCSI2TX_CCR_OFFSET 0x00000000

Core Configuration Register.

Referenced by XCsi2Tx_SelfTest(), and XCsi2Tx_SetLineCountForVC().

#define XCSI2TX_DISABLE 0

Flag denoting disabling of CSI.

Referenced by XCsi2Tx_Activate().

#define XCSI2TX_ENABLE 1

Flag denoting enabling of CSI.

Referenced by XCsi2Tx_Activate().

#define XCSI2TX_GIER_GIE_MASK 0x00000001

Global Interrupt Enable bit.

#define XCSI2TX_GIER_GIE_SHIFT 0

Shift bits for Global Interrupt Enable.

#define XCSI2TX_GIER_OFFSET 0x00000020

Global Interrupt Register.

Referenced by XCsi2Tx_Configure(), and XCsi2Tx_SelfTest().

#define XCSI2TX_GIER_RESET 0

Disable the Global Interrupts.

#define XCSI2TX_GIER_SET 1

Enable the Global Interrupts.

#define XCSI2TX_GSP_MASK 0x00000001F

Number of GSPs can be safely written to GSP FIFO, before it goes full.

#define XCSI2TX_H_

Prevent circular inclusions by using protection macros.

#define XCSI2TX_HW_H_

Prevent circular inclusions by using protection macros.

#define XCSI2TX_IER_OFFSET 0x00000028

Interrupt Enable Register.

Referenced by XCsi2Tx_GetIntrEnable(), XCsi2Tx_IntrDisable(), XCsi2Tx_IntrEnable(), and XCsi2Tx_SelfTest().

#define XCSI2TX_ISR_OFFSET 0x00000024

Interrupt Status Register.

Referenced by XCsi2Tx_GetIntrStatus(), XCsi2Tx_InterruptClear(), and XCsi2Tx_SelfTest().

#define XCSI2TX_LINE_COUNT_VC0 0x00000040

Line Count for VC0.

Referenced by XCsi2Tx_GetLineCountForVC(), and XCsi2Tx_SetLineCountForVC().

#define XCSI2TX_LINE_COUNT_VC1 0x00000044

Line Count for VC1.

#define XCSI2TX_LINE_COUNT_VC2 0x00000048

Line Count for VC2.

#define XCSI2TX_LINE_COUNT_VC3 0x0000004C

Line Count for VC3.

#define XCSI2TX_MAX_LANES 4

Max Lanes supported by CSI.

#define XCSI2TX_MAX_VC 4

Max number of Virtual Channels.

Referenced by XCsi2Tx_GetLineCountForVC(), and XCsi2Tx_SetLineCountForVC().

#define XCSI2TX_SPKTR_OFFSET 0x00000030

Generic Short Packet Entry.

Referenced by XCsi2Tx_GetShortPacket(), and XCsi2Tx_SelfTest().

#define XCSITX_LCSTAT_VC0_IER_MASK (1<<8)

Line Count Status for VC0 IER.

Referenced by XCsi2Tx_IntrDisable(), and XCsi2Tx_IntrEnable().

#define XCSITX_LCSTAT_VC0_IER_OFFSET (8)

Line Count Status for VC0 IER Offset.

#define XCSITX_LCSTAT_VC0_ISR_MASK (0x3<<8)

Line Count Status for VC0 ISR.

Referenced by XCsi2Tx_InterruptClear(), and XCsi2Tx_IntrHandler().

#define XCSITX_LCSTAT_VC0_ISR_OFFSET (8)

Line Count Status for VC0 ISR Offset.

Referenced by XCsi2Tx_IntrHandler().

#define XCSITX_LCSTAT_VC1_IER_MASK (1<<10)

Line Count Status for VC1 IER.

Referenced by XCsi2Tx_IntrDisable(), and XCsi2Tx_IntrEnable().

#define XCSITX_LCSTAT_VC1_IER_OFFSET (10)

Line Count Status for VC1 IER Offset.

#define XCSITX_LCSTAT_VC1_ISR_MASK (0x3<<10)

Line Count Status for VC1 ISR.

Referenced by XCsi2Tx_InterruptClear(), and XCsi2Tx_IntrHandler().

#define XCSITX_LCSTAT_VC1_ISR_OFFSET (10)

Line Count Status for VC1 ISR Offset.

Referenced by XCsi2Tx_IntrHandler().

#define XCSITX_LCSTAT_VC2_IER_MASK (1<<12)

Line Count Status for VC2 IER.

Referenced by XCsi2Tx_IntrDisable(), and XCsi2Tx_IntrEnable().

#define XCSITX_LCSTAT_VC2_IER_OFFSET (12)

Line Count Status for VC2 IER Offset.

#define XCSITX_LCSTAT_VC2_ISR_MASK (0x3<<12)

Line Count Status for VC2 ISR.

Referenced by XCsi2Tx_InterruptClear(), and XCsi2Tx_IntrHandler().

#define XCSITX_LCSTAT_VC2_ISR_OFFSET (12)

Line Count Status for VC2 ISR Offset.

Referenced by XCsi2Tx_IntrHandler().

#define XCSITX_LCSTAT_VC3_IER_MASK (1<<14)

Line Count Status for VC3 IER.

Referenced by XCsi2Tx_IntrDisable(), and XCsi2Tx_IntrEnable().

#define XCSITX_LCSTAT_VC3_IER_OFFSET (14)

Line Count Status for VC3 IER Offset.

#define XCSITX_LCSTAT_VC3_ISR_MASK (0x3<<14)

Line Count Status for VC3 ISR.

Referenced by XCsi2Tx_InterruptClear(), and XCsi2Tx_IntrHandler().

#define XCSITX_LCSTAT_VC3_ISR_OFFSET (14)

Line Count Status for VC3 ISR Offset.

Referenced by XCsi2Tx_IntrHandler().

## Typedef Documentation

typedef void(* XCsi2Tx_CallBack)(void *CallBackRef, u32 Mask)

Callback type for all interrupts defined.

Parameters

  CallBackRef | is a callback reference passed in by the upper layer when setting the callback functions, and passed back to the upper layer when the callback is invoked.
  Mask | is a bit mask indicating the cause of the event. For current core version, this parameter is "OR" of 0 or more XCSI2TX_ISR_*_MASK constants defined in xcsi_hw.h.

Returns
  None

Note
  None

## Enumeration Type Documentation

enum XCsi2Tx_LCStatus

This typedef defines the different errors codes for Line Count status for a Virtual Channel when Frame End Generation is enabled.

Enumerator
XCSI2TX_LC_LESS_LINES | Less no of lines recvd.
XCSI2TX_LC_MORE_LINES | More no of lines recvd.

## Function Documentation

u32 Csi2TxSelfTestExample | ( | u32 | DeviceId | ) |

This function checks if the Max Lane count from the generated file matches the value present in the protocol configuration register.

Parameters

  DeviceId | is the CSI2Tx Controller Device id.

Returns
  - XST_SUCCESS if Lane Count match

- XST_FAILURE if Lane Count don't match.

Note
  None.

References XCsi2Tx_Config::BaseAddr, XCsi2Tx_CfgInitialize(), XCsi2Tx_LookupConfig(), and XCsi2Tx_SelfTest().

Referenced by main().

int main | ( |  | ) |

The entry point for this example.

It invokes the example function, and reports the execution status.

Parameters

  None. |

Returns
  - XST_SUCCESS if example finishes successfully
  - XST_FAILURE if example fails.

Note
  None.

References Csi2TxSelfTestExample().

u32 XCsi2Tx_Activate | ( | XCsi2Tx * | InstancePtr,
|  | u8 | Flag
| ) |  |

Thsi function will enable/disable the IP Core to start processing.

Parameters

  InstancePtr | is the XCsi2Tx instance to operate on.
  Flag | will be used to indicate Enable or Disable action

Returns
  - XST_SUCCESS on successful core enable or disable
  - XST_FAILURE if core disable times out.

Note
  None.

References XCsi2Tx::IsReady, XCSI2TX_DISABLE, and XCSI2TX_ENABLE.

u32 XCsi2Tx_CfgInitialize | ( | XCsi2Tx * | InstancePtr,
|  | XCsi2Tx_Config * | CfgPtr,
|  | UINTPTR | EffectiveAddr
| ) |  |

Initialize the XCsi2Tx instance provided by the caller based on the given Config structure.

Parameters

  InstancePtr | is the XCsi2Tx instance to operate on.
  CfgPtr | is the device configuration structure containing information about a specific CSI.
  EffectiveAddr | is the base address of the device. If address translation is being used, then this parameter must reflect the virtual base address. Otherwise, the physical address should be used.

Returns
  - XST_SUCCESS Initialization was successful.

Note
  None.

References XCsi2Tx_Config::BaseAddr, XCsi2Tx::Config, XCsi2Tx::DPhyUlpsCallBack, XCsi2Tx::GSPFIFOCallBack, XCsi2Tx::IncorrectLaneCallBack, and XCsi2Tx::IsReady.

Referenced by Csi2TxSelfTestExample().

u32 XCsi2Tx_Configure | ( | XCsi2Tx * | InstancePtr | ) |

This function will configure the core with proper number of Active Lanes.

Parameters

  InstancePtr | is the XCsi2Tx instance to operate on.

Returns
  - XST_SUCCESS On configuring the core.
  - XST_FAILURE if active lanes not set correctly

Note
  None.

References XCsi2Tx::ActiveLanes, XCsi2Tx_Config::BaseAddr, XCsi2Tx::Config, XCsi2Tx::IsReady, XCsi2Tx_GetIntrEnable(), XCSI2TX_GIER_OFFSET, XCsi2Tx_IntrEnable(), XCsi2Tx_IsActiveLaneCountValid(), and XCsi2Tx_Reset().

u32 XCsi2Tx_GetIntrEnable | ( | XCsi2Tx * | InstancePtr | ) |

This function will get the interrupt mask set (enabled) in the CSI2 Tx core.

Parameters

  InstancePtr | is the XCsi instance to operate on

Returns
  Interrupt Mask with bits set for corresponding interrupt in Interrupt enable register

Note
  None

References XCsi2Tx_Config::BaseAddr, XCsi2Tx::Config, and XCSI2TX_IER_OFFSET.

Referenced by XCsi2Tx_Configure().

u32 XCsi2Tx_GetIntrStatus | ( | XCsi2Tx * | InstancePtr | ) |

This function will get the list of interrupts pending in the Interrupt Status Register of the CSI2 Tx core.

Parameters

  InstancePtr | is the XCsi instance to operate on

Returns
  Interrupt Mask with bits set for corresponding interrupt in Interrupt Status register

Note
  None

References XCsi2Tx_Config::BaseAddr, XCsi2Tx::Config, and XCSI2TX_ISR_OFFSET.

Referenced by XCsi2Tx_IntrHandler().

u32 XCsi2Tx_GetLineCountForVC | ( | XCsi2Tx * | InstancePtr,
|  | u8 | VC,
|  | u16 * | LineCount
| ) |  |

This function gets the Line Count for virtual Channel if Frame End Generation feature is enabled.

Parameters

  InstancePtr | is a pointer to the Subsystem instance to be worked on.
  VC | is which Virtual channel to be configured for (0-3).
  LineCount | is pointer to variable to be filled with line count for the Virtual channel

Returns
  - XST_NO_FEATURE if Frame End generation is not enabled
  - XST_INVALID_PARAM if any param is invalid e.g. VC is always 0 to 3 and Line Count is 0 to 0xFFFF.
  - XST_SUCCESS otherwise

Note
  None.

References XCsi2Tx_Config::BaseAddr, XCsi2Tx::Config, XCsi2Tx_Config::FEGenEnabled, XCSI2TX_LINE_COUNT_VC0, and XCSI2TX_MAX_VC.

void XCsi2Tx_GetShortPacket | ( | XCsi2Tx * | InstancePtr,
|  | XCsi2Tx_SPktData * | ShortPacketStruct
| ) |  |

This function will get the short packet received in the FIFO from the Generic Short Packet Register and fill up the structure passed from caller.

Parameters

  InstancePtr | is the XCsi2Tx instance to operate on
  ShortPacketStruct | is going to be filled up by this function and returned to the caller.

Returns
  None

References XCsi2Tx_Config::BaseAddr, XCsi2Tx::Config, XCsi2Tx_SPktData::Data, XCsi2Tx_SPktData::DataType, XCsi2Tx_SPktData::VirtualChannel, and XCSI2TX_SPKTR_OFFSET.

void XCsi2Tx_InterruptClear | ( | XCsi2Tx * | InstancePtr,
|  | u32 | Mask
| ) |  |

This function will clear the interrupts set in the Interrupt Status Register of the CSI2 Tx core.

Parameters

  InstancePtr | is the XCsi instance to operate on
  Mask | is Interrupt Mask with bits set for corresponding interrupt to be cleared in the Interrupt Status register

Returns
  None

Note
  None

References XCsi2Tx_Config::BaseAddr, XCsi2Tx::Config, XCsi2Tx_Config::FEGenEnabled, XCSI2TX_ISR_OFFSET, XCSITX_LCSTAT_VC0_ISR_MASK, XCSITX_LCSTAT_VC1_ISR_MASK, XCSITX_LCSTAT_VC2_ISR_MASK, and XCSITX_LCSTAT_VC3_ISR_MASK.

Referenced by XCsi2Tx_IntrHandler().

void XCsi2Tx_IntrDisable | ( | XCsi2Tx * | InstancePtr,
|  | u32 | Mask
| ) |  |

This function will disable the interrupts present in the interrupt mask passed onto the function.

Parameters

  InstancePtr | is the XCsi instance to operate on
  Mask | is the interrupt mask which need to be enabled in core

Returns
  None

Note
  None

References XCsi2Tx_Config::BaseAddr, XCsi2Tx::Config, XCsi2Tx_Config::FEGenEnabled, XCSI2TX_IER_OFFSET, XCSITX_LCSTAT_VC0_IER_MASK, XCSITX_LCSTAT_VC1_IER_MASK, XCSITX_LCSTAT_VC2_IER_MASK, and XCSITX_LCSTAT_VC3_IER_MASK.

void XCsi2Tx_IntrEnable | ( | XCsi2Tx * | InstancePtr,
|  | u32 | Mask
| ) |  |

This function will enable the interrupts present in the interrupt mask passed onto the function.

Parameters

  InstancePtr | is the XCsi instance to operate on
  Mask | is the interrupt mask which need to be enabled in core

Returns
  None

Note
  None

References XCsi2Tx_Config::BaseAddr, XCsi2Tx::Config, XCsi2Tx_Config::FEGenEnabled, XCSI2TX_IER_OFFSET, XCSITX_LCSTAT_VC0_IER_MASK, XCSITX_LCSTAT_VC1_IER_MASK, XCSITX_LCSTAT_VC2_IER_MASK, and XCSITX_LCSTAT_VC3_IER_MASK.

Referenced by XCsi2Tx_Configure().

void XCsi2Tx_IntrHandler | ( | void * | InstancePtr | ) |

This function is the interrupt handler for the CSI2 Tx core.

This handler reads the pending interrupt from the Interrupt Status register, determines the source of the interrupts and calls the respective callbacks for the interrupts that are enabled in Interrupt Enable register, and finally clears the interrupts.

The application is responsible for connecting this function to the interrupt system. Application beyond this core is also responsible for providing callbacks to handle interrupts and installing the callbacks using XCsi2Tx_SetCallBack() during initialization phase.

Parameters

  InstancePtr | is a pointer to the XCsi2Tx core instance.

Returns
  None.

Note
  Interrupt should be enabled to execute interrupt handler.

References XCsi2Tx::Config, XCsi2Tx::DPhyUlpsCallBack, XCsi2Tx::DPhyUlpsRef, XCsi2Tx_Config::FEGenEnabled, XCsi2Tx::GSPFIFOCallBack, XCsi2Tx::IncorrectLaneCallBack, XCsi2Tx::IncorrectLaneRef, XCsi2Tx::IsReady, XCsi2Tx::LCErrVC0Ref, XCsi2Tx::LCErrVC1Ref, XCsi2Tx::LCErrVC2Ref, XCsi2Tx::LCErrVC3Ref, XCsi2Tx::LineBufferRef, XCsi2Tx::UnderrunPixelRef, XCsi2Tx_GetIntrStatus(), XCsi2Tx_InterruptClear(), XCSI2TX_LC_LESS_LINES, XCSI2TX_LC_MORE_LINES, XCSITX_LCSTAT_VC0_ISR_MASK, XCSITX_LCSTAT_VC0_ISR_OFFSET, XCSITX_LCSTAT_VC1_ISR_MASK, XCSITX_LCSTAT_VC1_ISR_OFFSET, XCSITX_LCSTAT_VC2_ISR_MASK, XCSITX_LCSTAT_VC2_ISR_OFFSET, XCSITX_LCSTAT_VC3_ISR_MASK, and XCSITX_LCSTAT_VC3_ISR_OFFSET.

u8 XCsi2Tx_IsActiveLaneCountValid | ( | XCsi2Tx * | InstancePtr,
|  | u8 | ActiveLanesCount
| ) |  |

This function checks the validity of the active lanes parameter.

Parameters

  InstancePtr | is a pointer to the Subsystem instance to be worked on.
  ActiveLanesCount | is the lane count to check if valid.

Returns
  - 1 if specified Active Lanes is valid.
  - 0 otherwise, if the Active Lanes specified isn't valid as per spec and design.

Note
  None.

References XCsi2Tx::Config, and XCsi2Tx_Config::MaxLanesPresent.

Referenced by XCsi2Tx_Configure().

XCsi2Tx_Config * XCsi2Tx_LookupConfig | ( | u32 | DeviceId | ) |

Look up the hardware configuration for a device instance.

Parameters

  DeviceId | is the unique device ID of the device to lookup for

Returns
  The reference to the configuration record in the configuration table (in xcsi2tx_g.c) corresponding to the Device ID or if not found,a NULL pointer is returned.

Note
  None

Referenced by Csi2TxSelfTestExample().

u32 XCsi2Tx_Reset | ( | XCsi2Tx * | InstancePtr | ) |

This function will do a reset of the IP.

This will reset the values of all regiters except Core Config and Protocol Config registers.

Parameters

  InstancePtr | is the XCsi2Tx instance to operate on.

Returns
  - XST_SUCCESS On proper reset.
  - XST_FAILURE on timeout and core being stuck in reset

Note
  None.

Referenced by XCsi2Tx_Configure(), and XCsi2Tx_SelfTest().

u32 XCsi2Tx_SelfTest | ( | XCsi2Tx * | InstancePtr | ) |

Runs a self-test on the driver/device.

This test checks if the LaneCount present in register matches the one from the generated file.

Parameters

  InstancePtr | is a pointer to the XCsi instance.

Returns
  - XST_SUCCESS if self-test was successful
  - XST_FAILURE if the read value was not equal to _g.c file

Note
  None

References XCsi2Tx_Config::BaseAddr, XCsi2Tx::Config, XCsi2Tx::IsReady, XCsi2Tx_Config::MaxLanesPresent, XCSI2TX_CCR_OFFSET, XCSI2TX_GIER_OFFSET, XCSI2TX_IER_OFFSET, XCSI2TX_ISR_OFFSET, XCsi2Tx_Reset(), and XCSI2TX_SPKTR_OFFSET.

Referenced by Csi2TxSelfTestExample().

int XCsi2Tx_SetCallBack | ( | XCsi2Tx * | InstancePtr,
|  | u32 | HandleType,
|  | void * | Callbackfunc,
|  | void * | Callbackref
| ) |  |

This routine installs an asynchronous callback function for the given HandlerType:

    HandlerType                             Callback Function Type
    ----------------------------  --------------------------------------------
    (XCSI2TX_HANDLER_WRG_LANE)              IncorrectLaneCallBack
    (XCSI2TX_HANDLER_GSPFIFO_FULL)  GSPFIFOCallBack
    (XCSI2TX_HANDLER_ULPS)          DPhyUlpsCallBack
    (XCSI2TX_HANDLER_LINEBUF_FULL)  LineBufferCallBack
    (XCSI2TX_HANDLER_WRG_DATATYPE)  WrgDataTypeCallBack
    (XCSI2TX_HANDLER_UNDERRUN_PIXEL)        UnderrunPixelCallBack
    (XCSI2TX_HANDLER_LCERRVC0)              LineCountErrVC0
    (XCSI2TX_HANDLER_LCERRVC1)              LineCountErrVC1
    (XCSI2TX_HANDLER_LCERRVC2)              LineCountErrVC2
    (XCSI2TX_HANDLER_LCERRVC3)              LineCountErrVC3

Parameters

  InstancePtr | is the XCsi2Tx instance to operate on
  HandleType | is the type of call back to be registered.
  Callbackfunc | is the pointer to a call back funtion which is called when a particular event occurs.
  Callbackref | is a void pointer to data to be referenced to by the Callbackfunc

Returns
  - XST_SUCCESS when handler is installed.
  - XST_INVALID_PARAM when HandlerType is invalid.

Note
  Invoking this function for a handler that already has been installed replaces it with the new handler.

References XCsi2Tx::DPhyUlpsCallBack, XCsi2Tx::DPhyUlpsRef, XCsi2Tx::GSPFIFOCallBack, XCsi2Tx::IncorrectLaneCallBack, XCsi2Tx::IncorrectLaneRef, XCsi2Tx::IsReady, XCsi2Tx::LCErrVC0Ref, XCsi2Tx::LCErrVC1Ref, XCsi2Tx::LCErrVC2Ref, XCsi2Tx::LCErrVC3Ref, XCsi2Tx::LineBufferRef, and XCsi2Tx::UnderrunPixelRef.

u32 XCsi2Tx_SetLineCountForVC | ( | XCsi2Tx * | InstancePtr,
|  | u8 | VC,
|  | u16 | LineCount
| ) |  |

This function sets the Line Count for virtual Channel if Frame End Generation feature is enabled.

This is to be called before starting the core.

Parameters

  InstancePtr | is a pointer to the Subsystem instance to be worked on.
  VC | is which Virtual channel to be configured for (0-3).
  LineCount | is valid line count for the Virtual channel.

Returns
  - XST_NO_FEATURE if Frame End generation is not enabled
  - XST_INVALID_PARAM if any param is invalid e.g. VC is always 0 to 3 and Line Count is 0 to 0xFFFF.
  - XST_FAILURE in case the core is already running.
  - XST_SUCCESS otherwise

Note
  None.

References XCsi2Tx_Config::BaseAddr, XCsi2Tx::Config, XCsi2Tx_Config::FEGenEnabled, XCSI2TX_CCR_OFFSET, XCSI2TX_LINE_COUNT_VC0, and XCSI2TX_MAX_VC.