| v_sdirx Vitis Drivers API Documentation

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

Functions
xv_sdirx_intr.c File Reference

## Overview

This file contains interrupt related functions for Xilinx SDI RX core.

Please see xv_sdirx.h for more details of the driver.

    MODIFICATION HISTORY:

    Ver     Who        Date         Changes

    1.0     jsr    07/17/17 Initial release.
    1.3   jsr    07/03/18 corrected XVIDC_VM_720x480_60_I as XVIDC_VM_720x486_60_I
          jsr    10/05/18 Moved 3GB specific video modes timing
                    parameters from video common library
                    to SDI common driver
    1.4     jb     03/26/20 Added HFR support.
                            96Hz and 96/1.001 Hz resolution is not supported.
                            12G 12bit and 6G 10bit is not supported for HFR

## Functions
u32 | XV_SdiRx_GetIntrEnable (XV_SdiRx *InstancePtr)
| This function will get the interrupt mask set (enabled) in the SDI Rx core. More...
u32 | XV_SdiRx_GetIntrStatus (XV_SdiRx *InstancePtr)
| This function will get the list of interrupts pending in the Interrupt Status Register of the SDI Rx core. More...
void | XV_SdiRx_InterruptClear (XV_SdiRx *InstancePtr, u32 Mask)
| This function will clear the interrupts set in the Interrupt Status Register of the SDI Rx core. More...
void | XV_SdiRx_IntrHandler (void *InstancePtr)
| This function is the interrupt handler for the SDI RX driver. More...
int | XV_SdiRx_SetCallback (XV_SdiRx *InstancePtr, u32 HandlerType, void *CallbackFunc, void *CallbackRef)
| This function installs an asynchronous callback function for the given HandlerType: More...
void | XV_SdiRx_IntrEnable (XV_SdiRx *InstancePtr, u32 Mask)
| This function enables the selected interrupt. More...
void | XV_SdiRx_IntrDisable (XV_SdiRx *InstancePtr, u32 Mask)
| This function disables the selected interrupt. More...

## Function Documentation

u32 XV_SdiRx_GetIntrEnable | ( | XV_SdiRx * | InstancePtr | ) |

This function will get the interrupt mask set (enabled) in the SDI Rx core.

Parameters

  InstancePtr | is the XV_SdiRx instance to operate on

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

Note
  None

References XV_SdiRx_Config::BaseAddress, XV_SdiRx::Config, and XV_SdiRx_ReadReg.

u32 XV_SdiRx_GetIntrStatus | ( | XV_SdiRx * | InstancePtr | ) |

This function will get the list of interrupts pending in the Interrupt Status Register of the SDI Rx core.

Parameters

  InstancePtr | is the XV_SdiRx instance to operate on

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

Note
  None

References XV_SdiRx_Config::BaseAddress, XV_SdiRx::Config, and XV_SdiRx_ReadReg.

Referenced by XV_SdiRx_IntrHandler().

void XV_SdiRx_InterruptClear | ( | XV_SdiRx * | InstancePtr,
|  | u32 | Mask
| ) |  |

This function will clear the interrupts set in the Interrupt Status Register of the SDI Rx core.

Parameters

  InstancePtr | is the XV_SdiRx 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 XV_SdiRx_Config::BaseAddress, XV_SdiRx::Config, XV_SdiRx_ReadReg, and XV_SdiRx_WriteReg.

Referenced by XV_SdiRx_IntrHandler().

void XV_SdiRx_IntrDisable | ( | XV_SdiRx * | InstancePtr,
|  | u32 | Mask
| ) |  |

This function disables the selected interrupt.

Parameters

  InstancePtr | is a pointer to the XV_SdiRx core instance.
  Mask | is the interrupt mask which need to be disabled in core.

Returns
  None.

Note
  None.

References XV_SdiRx_Config::BaseAddress, XV_SdiRx::Config, and XV_SdiRx_WriteReg.

Referenced by XV_SdiRx_CfgInitialize().

void XV_SdiRx_IntrEnable | ( | XV_SdiRx * | InstancePtr,
|  | u32 | Mask
| ) |  |

This function enables the selected interrupt.

Parameters

  InstancePtr | is a pointer to the XV_SdiRx core instance.
  Mask | is the interrupt mask which need to be enabled in core.

Returns
  None.

Note
  None.

References XV_SdiRx_Config::BaseAddress, XV_SdiRx::Config, XV_SdiRx_ReadReg, and XV_SdiRx_WriteReg.

void XV_SdiRx_IntrHandler | ( | void * | InstancePtr | ) |

This function is the interrupt handler for the SDI RX driver.

This handler reads the pending interrupt for video lock or video unlock interrupts, determines the source of the interrupts, clears the interrupts and calls callbacks accordingly.

The application is responsible for connecting this function to the interrupt system. Application beyond this driver is also responsible for providing callbacks to handle interrupts and installing the callbacks using XV_SdiRx_SetCallback() during initialization phase. An example delivered with this driver demonstrates how this could be done.

Parameters

  InstancePtr | is a pointer to the XV_SdiRx instance that just interrupted.

Returns
  None.

Note
  None.

References XV_SdiRx::IsReady, XV_SdiRx_GetIntrStatus(), and XV_SdiRx_InterruptClear().

int XV_SdiRx_SetCallback | ( | XV_SdiRx * | InstancePtr,
|  | u32 | HandlerType,
|  | void * | CallbackFunc,
|  | void * | CallbackRef
| ) |  |

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

    HandlerType                             Callback Function Type
    -------------------------               ---------------------------------------
    (XV_SDIRX_HANDLER_STREAM_DOWN)  StreamDownCallback
    (XV_SDIRX_HANDLER_STREAM_UP)            StreamUpCallback
    (XV_SDIRX_HANDLER_OVERFLOW)             OverFlowCallback
    (XV_SDIRX_HANDLER_UNDERFLOW)            UnderFlowCallback
    (XV_SDIRX_HANDLER_VSYNC)                VsyncCallback

Parameters

  InstancePtr | is a pointer to the SDI RX core instance.
  HandlerType | specifies the type of handler.
  CallbackFunc | is the address of the callback function.
  CallbackRef | is a user data item that will be passed to the callback function when it is invoked.

Returns
  - XST_SUCCESS if callback function installed successfully.
  - 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 XV_SdiRx::OverFlowCallback, XV_SdiRx::OverFlowRef, XV_SdiRx::StreamDownCallback, XV_SdiRx::StreamDownRef, XV_SdiRx::StreamUpCallback, XV_SdiRx::StreamUpRef, XV_SdiRx::UnderFlowCallback, XV_SdiRx::UnderFlowRef, XV_SdiRx::VsyncCallback, and XV_SdiRx::VsyncRef.