v_hdmirx: xv_hdmirx_intr.c File Reference

| v_hdmirx Xilinx SDK Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List

Functions
xv_hdmirx_intr.c File Reference

## Overview

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

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

    MODIFICATION HISTORY:

    Ver   Who    Date     Changes

    1.00  gm, mg 11/03/15 Initial release.
    1.01  yh     14/01/16 Set AxisEnable PIO to high when RX stream locked
    1.03  MG     18/02/16 Added Link Check callback
    1.04  MG     08/03/16 Added pixel clock calculation to HdmiRx_TmrIntrHandler
    1.05  MH     08/03/16 Added support for read not complete DDC event
    1.06  MG     27/05/16 Updated HdmiRx_VtdIntrHandler
    1.07  MG     27/05/16 Updated HdmiRx_TmrIntrHandler
    1.08  MG     30/05/16 Fixed issue with pixel clock adjustment for YUV422 colorspace
    1.09  MH     26/07/16 Added DDC HDCP protocol event.
    1.10  YH     18/08/16 squash unused variable compiler warning
    1.11  MG     03/03/17 Updated function HdmiRx_TmrIntrHandler with
                              GetVideoPropertiesTries
    1.12  YH     22/08/17 Update AudFormat when servicing Aud Interrupt
    1.13  MH     31/08/17 Update Reset sequence for Video_Bridge
    2.00  EB     16/01/18 Added clearing of XV_HDMIRX_AUX_STA_GCP_CD_EVT flag
                              after servicing it
          YH     16/11/17 Added bridge overflow interrupt
                 16/11/17 Update Reset sequence with dedicated reset for
                              each clock domain
          MMO    08/02/18 Adding proper handling for Sync Loss/Sync Recover
    2.10  YH     13/04/18 Fixed a bug in PioIntrHandler
    2.20  EB     16/08/18 Replaced TIME_10MS, TIME_16MS, TIME_200MS with
                              XV_HdmiRx_GetTime10Ms, XV_HdmiRx_GetTime16Ms
                              XV_HdmiRx_GetTime200Ms
                          Added TMDS Clock Ratio callback support
          YB     15/08/18 Added new cases for HDCP 1.4 & 2.2 protocol events in
                              XV_HdmiRx_SetCallback function.
                          Updated the HdmiRx_DdcIntrHandler() function.

## Functions
void | XV_HdmiRx_IntrHandler (void *InstancePtr)
| This function is the interrupt handler for the HDMI RX driver. More...
int | XV_HdmiRx_SetCallback (XV_HdmiRx *InstancePtr, XV_HdmiRx_HandlerType HandlerType, void *CallbackFunc, void *CallbackRef)
| This function installs an asynchronous callback function for the given HandlerType: More...

## Function Documentation

void XV_HdmiRx_IntrHandler | ( | void * | InstancePtr | ) |

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

This handler reads the pending interrupt from PIO, DDC, TIMDET, AUX, AUD and LNKSTA peripherals, 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_HdmiRx_SetCallback() during initialization phase. An example delivered with this driver demonstrates how this could be done.

Parameters

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

Returns
  None.

Note
  None.

References XV_HdmiRx_Config::BaseAddress, XV_HdmiRx::Config, XV_HdmiRx::IsReady, XV_HDMIRX_AUD_STA_IRQ_MASK, XV_HDMIRX_AUD_STA_OFFSET, XV_HDMIRX_AUX_STA_IRQ_MASK, XV_HDMIRX_AUX_STA_OFFSET, XV_HDMIRX_DDC_STA_IRQ_MASK, XV_HDMIRX_DDC_STA_OFFSET, XV_HDMIRX_LNKSTA_STA_IRQ_MASK, XV_HDMIRX_LNKSTA_STA_OFFSET, XV_HDMIRX_PIO_STA_IRQ_MASK, XV_HDMIRX_PIO_STA_OFFSET, XV_HdmiRx_ReadReg, XV_HDMIRX_TMR_STA_IRQ_MASK, XV_HDMIRX_TMR_STA_OFFSET, XV_HDMIRX_VTD_STA_IRQ_MASK, and XV_HDMIRX_VTD_STA_OFFSET.

int XV_HdmiRx_SetCallback | ( | XV_HdmiRx * | InstancePtr,
|  | XV_HdmiRx_HandlerType | HandlerType,
|  | void * | CallbackFunc,
|  | void * | CallbackRef
| ) |  |

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

    HandlerType                 Callback Function Type
    -------------------------   -----------------------------------------------
    (XV_HDMIRX_HANDLER_VTD)         VtdCallback
    (XV_HDMIRX_HANDLER_AUX)      AuxCallback
    (XV_HDMIRX_HANDLER_AUD)      AudCallback
    (XV_HDMIRX_HANDLER_LNKSTA)   LnkStaCallback
    (XV_HDMIRX_HANDLER_PIO)      PioCallback

Parameters

  InstancePtr | is a pointer to the HDMI 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_HdmiRx::AudCallback, XV_HdmiRx::AudRef, XV_HdmiRx::AuxCallback, XV_HdmiRx::AuxRef, XV_HdmiRx::BrdgOverflowCallback, XV_HdmiRx::BrdgOverflowRef, XV_HdmiRx::ConnectCallback, XV_HdmiRx::ConnectRef, XV_HdmiRx::DdcCallback, XV_HdmiRx::DdcRef, XV_HdmiRx::Hdcp14ProtEvtCallback, XV_HdmiRx::Hdcp14ProtEvtRef, XV_HdmiRx::Hdcp22ProtEvtCallback, XV_HdmiRx::Hdcp22ProtEvtRef, XV_HdmiRx::HdcpCallback, XV_HdmiRx::HdcpRef, XV_HdmiRx::IsAudCallbackSet, XV_HdmiRx::IsAuxCallbackSet, XV_HdmiRx::IsBrdgOverflowCallbackSet, XV_HdmiRx::IsConnectCallbackSet, XV_HdmiRx::IsDdcCallbackSet, XV_HdmiRx::IsHdcp14ProtEvtCallbackSet, XV_HdmiRx::IsHdcp22ProtEvtCallbackSet, XV_HdmiRx::IsHdcpCallbackSet, XV_HdmiRx::IsLinkErrorCallbackSet, XV_HdmiRx::IsLnkStaCallbackSet, XV_HdmiRx::IsModeCallbackSet, XV_HdmiRx::IsStreamDownCallbackSet, XV_HdmiRx::IsStreamInitCallbackSet, XV_HdmiRx::IsStreamUpCallbackSet, XV_HdmiRx::IsSyncLossCallbackSet, XV_HdmiRx::IsTmdsClkRatioCallbackSet, XV_HdmiRx::IsVicErrorCallbackSet, XV_HdmiRx::LinkErrorCallback, XV_HdmiRx::LinkErrorRef, XV_HdmiRx::LnkStaCallback, XV_HdmiRx::LnkStaRef, XV_HdmiRx::ModeCallback, XV_HdmiRx::ModeRef, XV_HdmiRx::StreamDownCallback, XV_HdmiRx::StreamDownRef, XV_HdmiRx::StreamInitCallback, XV_HdmiRx::StreamInitRef, XV_HdmiRx::StreamUpCallback, XV_HdmiRx::StreamUpRef, XV_HdmiRx::SyncLossCallback, XV_HdmiRx::SyncLossRef, XV_HdmiRx::TmdsClkRatioCallback, XV_HdmiRx::TmdsClkRatioRef, XV_HdmiRx::VicErrorCallback, XV_HdmiRx::VicErrorRef, XV_HDMIRX_HANDLER_AUD, XV_HDMIRX_HANDLER_AUX, XV_HDMIRX_HANDLER_BRDG_OVERFLOW, XV_HDMIRX_HANDLER_CONNECT, XV_HDMIRX_HANDLER_DDC, XV_HDMIRX_HANDLER_DDC_HDCP_14_PROT, XV_HDMIRX_HANDLER_DDC_HDCP_22_PROT, XV_HDMIRX_HANDLER_HDCP, XV_HDMIRX_HANDLER_LINK_ERROR, XV_HDMIRX_HANDLER_LNKSTA, XV_HDMIRX_HANDLER_MODE, XV_HDMIRX_HANDLER_STREAM_DOWN, XV_HDMIRX_HANDLER_STREAM_INIT, XV_HDMIRX_HANDLER_STREAM_UP, XV_HDMIRX_HANDLER_SYNC_LOSS, XV_HDMIRX_HANDLER_TMDS_CLK_RATIO, and XV_HDMIRX_HANDLER_VIC_ERROR.