v_hdmitx: xv_hdmitx.c File Reference

| v_hdmitx Xilinx SDK Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List

Functions
xv_hdmitx.c File Reference

## Overview

This is the main file for Xilinx HDMI TX core.

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

    MODIFICATION HISTORY:

    Ver   Who    Date     Changes

    1.00         10/07/15 Initial release.
    1.01  yh     15/01/16 Add 3D Support
    1.02  MG     09/03/16 Added XV_HdmiTx_SetHdmiMode and XV_HdmiTx_SetDviMode
    1.03  YH     25/07/16 Used UINTPTR instead of u32 for BaseAddress
                          XV_HdmiTx_CfgInitialize
    1.04  YH     27/07/16 Remove checking VideoMode<(XVIDC_VM_NUM_SUPPORTED));
    1.05  YH     17/08/16 Add XV_HdmiTx_SetAxiClkFreq
                          Move XV_HdmiTx_DdcInit to XV_HdmiTx_SetAxiClkFreq
                          squash unused variable compiler warning
    1.06  MG     07/03/17 Updated XV_HdmiTx_Auxsend with packet ready check
    1.07  YH     19/07/17 Added Video Masking Check API
    1.08  YH     06/10/17 Added function XV_HdmiTx_SetAudioFormat and function
                              XV_HdmiTx_GetAudioFormat
          EB     10/10/17 Updated XV_HdmiTx_Scrambler to always enable scrambler
                              for HDMI 2.0 resolutions
    1.09  MMO    19/12/17 Added XV_HdmiTx_SetTmdsClk API
    2.00  YH     16/01/18 Added dedicated reset for each clock domain
                          Added bridge unlock interrupt
                          Added PIO_OUT to set GCP_AVMUTE
          EB     18/01/18 Moved VicTable to Hdmi Common library
                          Updated function XV_HdmiTx_SetTmdsClk and renamed to
                              XV_HdmiTx_GetTmdsClk
                          Updated function XV_HdmiTx_SetStream
                          Moved VicTable, XV_HdmiTx_Aux to Hdmi Common library
          EB     23/01/18 Updated XV_HdmiTx_SetAudioChannels to fix an issue
                              where setting audio channel value will unmute the
                              audio regardless of the current status
    2.02  MMO    11/08/18 Added Bridge Overflow and Bridge Underflow (PIO IN)
          EB     14/08/18 Updated XV_HdmiTx_CfgInitialize to initialize
                            HPD pulse periods
    2.03  EB     28/03/19 Disable PIO Interrupt for XV_HdmiTx_DdcWrite and
                              XV_HdmiTx_DdcRead APIs to prevent another DDC
                              transactions from happening in the middle of a DDC
                              transaction
          EB     16/07/19 Replaced sampling rate of 4 with 2 at the API
                              XV_HdmiTx_SetSampleRate

## Functions
int | XV_HdmiTx_CfgInitialize (XV_HdmiTx *InstancePtr, XV_HdmiTx_Config *CfgPtr, UINTPTR EffectiveAddr)
| This function initializes the HDMI TX core. More...
void | XV_HdmiTx_SetAxiClkFreq (XV_HdmiTx *InstancePtr, u32 ClkFreq)
| This function sets the AXI4-Lite Clock Frequency. More...
void | XV_HdmiTx_SetHdmiMode (XV_HdmiTx *InstancePtr)
| This function sets the core into HDMI mode. More...
void | XV_HdmiTx_SetDviMode (XV_HdmiTx *InstancePtr)
| This function sets the core into DVI mode. More...
void | XV_HdmiTx_Clear (XV_HdmiTx *InstancePtr)
| This function clear the HDMI TX variables and sets it to the defaults. More...
u8 | XV_HdmiTx_LookupVic (XVidC_VideoMode VideoMode)
| This function provides video identification code of video mode. More...
u32 | XV_HdmiTx_GetTmdsClk (XV_HdmiTx *InstancePtr, XVidC_VideoMode VideoMode, XVidC_ColorFormat ColorFormat, XVidC_ColorDepth Bpc)
| This function sets and return the TMDS Clock based on Video Parameter. More...
int | XV_HdmiTx_Scrambler (XV_HdmiTx *InstancePtr)
| This function controls the scrambler. More...
int | XV_HdmiTx_ClockRatio (XV_HdmiTx *InstancePtr)
| This function controls the TMDS clock ratio. More...
int | XV_HdmiTx_DetectHdmi20 (XV_HdmiTx *InstancePtr)
| This function detects connected sink is a HDMI 2.0/HDMI 1.4 sink device and sets appropriate flag in the TX stream. More...
void | XV_HdmiTx_ShowSCDC (XV_HdmiTx *InstancePtr)
| This function shows the sinks SCDC registers. More...
u32 | XV_HdmiTx_SetStream (XV_HdmiTx *InstancePtr, XVidC_VideoMode VideoMode, XVidC_ColorFormat ColorFormat, XVidC_ColorDepth Bpc, XVidC_PixelsPerClock Ppc, XVidC_3DInfo *Info3D)
| This function sets the HDMI TX stream parameters. More...
void | XV_HdmiTx_INT_VRST (XV_HdmiTx *InstancePtr, u8 Reset)
| This function asserts or releases the HDMI TX Internal VRST. More...
void | XV_HdmiTx_INT_LRST (XV_HdmiTx *InstancePtr, u8 Reset)
| This function asserts or releases the HDMI TX Internal LRST. More...
void | XV_HdmiTx_EXT_VRST (XV_HdmiTx *InstancePtr, u8 Reset)
| This function asserts or releases the HDMI TX External VRST. More...
void | XV_HdmiTx_EXT_SYSRST (XV_HdmiTx *InstancePtr, u8 Reset)
| This function asserts or releases the HDMI TX External SYSRST. More...
void | XV_HdmiTx_SetGcpAvmuteBit (XV_HdmiTx *InstancePtr)
| This function sets the HDMI TX AUX GCP register AVMUTE bit. More...
void | XV_HdmiTx_ClearGcpAvmuteBit (XV_HdmiTx *InstancePtr)
| This function clears the HDMI TX AUX GCP register AVMUTE bit. More...
void | XV_HdmiTx_SetGcpClearAvmuteBit (XV_HdmiTx *InstancePtr)
| This function sets the HDMI TX AUX GCP register CLEAR_AVMUTE bit. More...
void | XV_HdmiTx_ClearGcpClearAvmuteBit (XV_HdmiTx *InstancePtr)
| This function clears the HDMI TX AUX GCP register CLEAR_AVMUTE bit. More...
void | XV_HdmiTx_SetPixelRate (XV_HdmiTx *InstancePtr)
| This function sets the pixel rate at output. More...
void | XV_HdmiTx_SetSampleRate (XV_HdmiTx *InstancePtr, u8 SampleRate)
| This function sets the sample rate at output. More...
void | XV_HdmiTx_SetColorFormat (XV_HdmiTx *InstancePtr)
| This function sets the color format. More...
void | XV_HdmiTx_SetColorDepth (XV_HdmiTx *InstancePtr)
| This function sets the color depth. More...
void | XV_HdmiTx_DdcInit (XV_HdmiTx *InstancePtr, u32 Frequency)
| This function prepares TX DDC peripheral to use. More...
int | XV_HdmiTx_DdcGetAck (XV_HdmiTx *InstancePtr)
| This function gets the acknowledge flag. More...
int | XV_HdmiTx_DdcWaitForDone (XV_HdmiTx *InstancePtr)
| This function waits for the done flag to be set. More...
void | XV_HdmiTx_DdcWriteCommand (XV_HdmiTx *InstancePtr, u32 Cmd)
| This function writes data into the command fifo. More...
u8 | XV_HdmiTx_DdcReadData (XV_HdmiTx *InstancePtr)
| This function reads data from the data fifo. More...
int | XV_HdmiTx_DdcWrite (XV_HdmiTx *InstancePtr, u8 Slave, u16 Length, u8 *Buffer, u8 Stop)
| This function writes data from DDC peripheral from given slave address. More...
int | XV_HdmiTx_DdcRead (XV_HdmiTx *InstancePtr, u8 Slave, u16 Length, u8 *Buffer, u8 Stop)
| This function reads data from DDC peripheral from given slave address. More...
u32 | XV_HdmiTx_AuxSend (XV_HdmiTx *InstancePtr)
| This function transmits the infoframes generated by the processor. More...
void | XV_HdmiTx_DebugInfo (XV_HdmiTx *InstancePtr)
| This function prints stream and timing information on STDIO/Uart console. More...
int | XV_HdmiTx_IsStreamScrambled (XV_HdmiTx *InstancePtr)
| This function provides status of the stream. More...
int | XV_HdmiTx_IsStreamConnected (XV_HdmiTx *InstancePtr)
| This function provides the stream connected status. More...
int | XV_HdmiTx_SetAudioChannels (XV_HdmiTx *InstancePtr, u8 Value)
| This function sets the active audio channels. More...
int | XV_HdmiTx_SetAudioFormat (XV_HdmiTx *InstancePtr, XV_HdmiTx_AudioFormatType Value)
| This function sets the active audio format. More...
XV_HdmiTx_AudioFormatType | XV_HdmiTx_GetAudioFormat (XV_HdmiTx *InstancePtr)
| This function gets the active audio format. More...

## Function Documentation

u32 XV_HdmiTx_AuxSend | ( | XV_HdmiTx * | InstancePtr | ) |

This function transmits the infoframes generated by the processor.

Parameters

  InstancePtr | is a pointer to the XV_HdmiTx core instance.

Returns
  - XST_SUCCESS if infoframes transmitted successfully.
  - XST_FAILURE if AUX FIFO is full.

Note
  None.

References XV_HdmiTx::Aux, XV_HdmiTx_Config::BaseAddress, XV_HdmiTx::Config, XV_HDMITX_AUX_DAT_OFFSET, XV_HDMITX_AUX_STA_FIFO_FUL_MASK, XV_HDMITX_AUX_STA_OFFSET, XV_HDMITX_AUX_STA_PKT_RDY_MASK, XV_HdmiTx_ReadReg, and XV_HdmiTx_WriteReg.

int XV_HdmiTx_CfgInitialize | ( | XV_HdmiTx * | InstancePtr,
|  | XV_HdmiTx_Config * | CfgPtr,
|  | UINTPTR | EffectiveAddr
| ) |  |

This function initializes the HDMI TX core.

This function must be called prior to using the HDMI TX core. Initialization of the HDMI TX includes setting up the instance data and ensuring the hardware is in a quiescent state.

Parameters

  InstancePtr | is a pointer to the XV_HdmiTx core instance.
  CfgPtr | points to the configuration structure associated with the HDMI TX core.
  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 if XV_HdmiTx_CfgInitialize was successful.
  - XST_FAILURE if HDMI TX PIO ID mismatched.

Note
  None.

References XV_HdmiTx_Config::BaseAddress, XV_HdmiTx::Config, XV_HdmiTx::ConnectCallback, XV_HdmiTx::IsConnectCallbackSet, XV_HdmiTx_Stream::IsConnected, XV_HdmiTx::IsReady, XV_HdmiTx::IsStreamDownCallbackSet, XV_HdmiTx::IsStreamUpCallbackSet, XV_HdmiTx::IsToggleCallbackSet, XV_HdmiTx::IsVsCallbackSet, XV_HdmiTx_Stream::OverrideScrambler, XV_HdmiTx_Stream::State, XV_HdmiTx::Stream, XV_HdmiTx::StreamDownCallback, XV_HdmiTx::StreamUpCallback, XV_HdmiTx::ToggleCallback, XV_HdmiTx::VsCallback, XV_HdmiTx_AudioDisable, XV_HdmiTx_AuxDisable, XV_HdmiTx_Clear(), XV_HDMITX_CONNECT_CONF_OFFSET, XV_HdmiTx_DdcDisable, XV_HdmiTx_DdcIntrClear, XV_HdmiTx_GetTime1Ms, XV_HDMITX_HPD_TIMEGRID_OFFSET, XV_HDMITX_MASK_16, XV_HDMITX_PIO_ID, XV_HDMITX_PIO_ID_OFFSET, XV_HDMITX_PIO_IN_BRDG_LOCKED_MASK, XV_HDMITX_PIO_IN_BRDG_OVERFLOW_MASK, XV_HDMITX_PIO_IN_BRDG_UNDERFLOW_MASK, XV_HDMITX_PIO_IN_EVT_FE_OFFSET, XV_HDMITX_PIO_IN_EVT_RE_OFFSET, XV_HDMITX_PIO_IN_HPD_MASK, XV_HDMITX_PIO_IN_HPD_TOGGLE_MASK, XV_HDMITX_PIO_IN_LNK_RDY_MASK, XV_HDMITX_PIO_IN_VS_MASK, XV_HdmiTx_PioDisable, XV_HdmiTx_PioEnable, XV_HdmiTx_PioIntrClear, XV_HdmiTx_PioIntrEnable, XV_HdmiTx_ReadReg, XV_HdmiTx_SetHdmiMode(), XV_HDMITX_SHIFT_16, XV_HDMITX_TOGGLE_CONF_OFFSET, and XV_HdmiTx_WriteReg.

void XV_HdmiTx_Clear | ( | XV_HdmiTx * | InstancePtr | ) |

This function clear the HDMI TX variables and sets it to the defaults.

Parameters

  InstancePtr | is a pointer to the XV_HdmiTx core instance.

Returns

Note
  This is required after a reset or init.

Referenced by XV_HdmiTx_CfgInitialize().

void XV_HdmiTx_ClearGcpAvmuteBit | ( | XV_HdmiTx * | InstancePtr | ) |

This function clears the HDMI TX AUX GCP register AVMUTE bit.

Parameters

  InstancePtr | is a pointer to the XV_HdmiTx core instance.

Returns
  None.

Note
  None.

References XV_HDMITX_PIO_OUT_CLR_OFFSET, XV_HDMITX_PIO_OUT_GCP_AVMUTE_MASK, and XV_HdmiTx_WriteReg.

void XV_HdmiTx_ClearGcpClearAvmuteBit | ( | XV_HdmiTx * | InstancePtr | ) |

This function clears the HDMI TX AUX GCP register CLEAR_AVMUTE bit.

Parameters

  InstancePtr | is a pointer to the XV_HdmiTx core instance.

Returns
  None.

Note
  None.

References XV_HDMITX_PIO_OUT_CLR_OFFSET, XV_HDMITX_PIO_OUT_GCP_CLEARAVMUTE_MASK, and XV_HdmiTx_WriteReg.

int XV_HdmiTx_ClockRatio | ( | XV_HdmiTx * | InstancePtr | ) |

This function controls the TMDS clock ratio.

Parameters

  InstancePtr | is a pointer to the XV_HdmiTx core instance.

Returns
  - XST_SUCCESS if HDMI 2.0
  - XST_FAILURE if HDMI 1.4

Note
  None.

References XV_HdmiTx_Stream::IsHdmi20, XV_HdmiTx::Stream, XV_HdmiTx_Stream::TMDSClockRatio, XV_HdmiTx_DdcRead(), and XV_HdmiTx_DdcWrite().

Referenced by XV_HdmiTx_SetStream().

int XV_HdmiTx_DdcGetAck | ( | XV_HdmiTx * | InstancePtr | ) |

This function gets the acknowledge flag.

Parameters

  InstancePtr | is a pointer to the XV_HdmiTx core instance.

Note
  None.

References XV_HdmiTx_Config::BaseAddress, XV_HdmiTx::Config, XV_HDMITX_DDC_STA_ACK_MASK, XV_HDMITX_DDC_STA_OFFSET, and XV_HdmiTx_ReadReg.

Referenced by XV_HdmiTx_DdcRead(), and XV_HdmiTx_DdcWrite().

void XV_HdmiTx_DdcInit | ( | XV_HdmiTx * | InstancePtr,
|  | u32 | Frequency
| ) |  |

This function prepares TX DDC peripheral to use.

Parameters

  InstancePtr | is a pointer to the XV_HdmiTx core instance.
  Frequency | specifies the value that needs to be set.

Returns
  None.

Note
  None.

References XV_HdmiTx_Config::BaseAddress, XV_HdmiTx::Config, XV_HDMITX_DDC_CTRL_CLK_DIV_MASK, XV_HDMITX_DDC_CTRL_OFFSET, and XV_HdmiTx_WriteReg.

Referenced by XV_HdmiTx_SetAxiClkFreq().

int XV_HdmiTx_DdcRead | ( | XV_HdmiTx * | InstancePtr,
|  | u8 | Slave,
|  | u16 | Length,
|  | u8 * | Buffer,
|  | u8 | Stop
| ) |  |

This function reads data from DDC peripheral from given slave address.

Parameters

  InstancePtr | is a pointer to the XV_HdmiTx core instance.
  Slave | specifies the slave address from where data needs to be read.
  Length | specifies number of bytes to be read.
  Buffer | specifies a pointer to u8 variable that will be filled with data.
  Stop | specifies the stop flag which is either TRUE/FALSE.

Returns
  - XST_SUCCESS if an acknowledgement received and timeout.
  - XST_FAILURE if no acknowledgement received.

Note
  None.

References XV_HDMITX_DDC_CMD_RD_TOKEN, XV_HDMITX_DDC_CMD_STP_TOKEN, XV_HDMITX_DDC_CMD_STR_TOKEN, XV_HDMITX_DDC_CMD_WR_TOKEN, XV_HdmiTx_DdcDisable, XV_HdmiTx_DdcEnable, XV_HdmiTx_DdcGetAck(), XV_HdmiTx_DdcIntrDisable, XV_HdmiTx_DdcReadData(), XV_HdmiTx_DdcWaitForDone(), XV_HdmiTx_DdcWriteCommand(), XV_HdmiTx_PioIntrDisable, and XV_HdmiTx_PioIntrEnable.

Referenced by XV_HdmiTx_ClockRatio(), XV_HdmiTx_Scrambler(), and XV_HdmiTx_ShowSCDC().

u8 XV_HdmiTx_DdcReadData | ( | XV_HdmiTx * | InstancePtr | ) |

This function reads data from the data fifo.

Parameters

  InstancePtr | is a pointer to the XV_HdmiTx core instance.

Note
  None.

References XV_HdmiTx_Config::BaseAddress, XV_HdmiTx::Config, XV_HDMITX_DDC_CTRL_OFFSET, XV_HDMITX_DDC_CTRL_RUN_MASK, XV_HDMITX_DDC_DAT_OFFSET, XV_HDMITX_DDC_STA_DAT_EMPTY, XV_HDMITX_DDC_STA_OFFSET, and XV_HdmiTx_ReadReg.

Referenced by XV_HdmiTx_DdcRead().

int XV_HdmiTx_DdcWaitForDone | ( | XV_HdmiTx * | InstancePtr | ) |

This function waits for the done flag to be set.

Parameters

  InstancePtr | is a pointer to the XV_HdmiTx core instance.

Note
  None.

References XV_HdmiTx_Config::BaseAddress, XV_HdmiTx::Config, XV_HDMITX_DDC_CTRL_OFFSET, XV_HDMITX_DDC_CTRL_RUN_MASK, XV_HDMITX_DDC_STA_DONE_MASK, XV_HDMITX_DDC_STA_OFFSET, XV_HDMITX_DDC_STA_TIMEOUT_MASK, XV_HdmiTx_ReadReg, and XV_HdmiTx_WriteReg.

Referenced by XV_HdmiTx_DdcRead(), and XV_HdmiTx_DdcWrite().

int XV_HdmiTx_DdcWrite | ( | XV_HdmiTx * | InstancePtr,
|  | u8 | Slave,
|  | u16 | Length,
|  | u8 * | Buffer,
|  | u8 | Stop
| ) |  |

This function writes data from DDC peripheral from given slave address.

Parameters

  InstancePtr | is a pointer to the XV_HdmiTx core instance.
  Slave | specifies the slave address from where data needs to be read.
  Length | specifies number of bytes to be read.
  Buffer | specifies a pointer to u8 variable that will be filled with data.
  Stop | specifies the stop flag which is either TRUE/FALSE.

Returns
  - XST_SUCCESS if an acknowledgement received and timeout.
  - XST_FAILURE if no acknowledgement received.

Note
  None.

References XV_HDMITX_DDC_CMD_STP_TOKEN, XV_HDMITX_DDC_CMD_STR_TOKEN, XV_HDMITX_DDC_CMD_WR_TOKEN, XV_HdmiTx_DdcDisable, XV_HdmiTx_DdcEnable, XV_HdmiTx_DdcGetAck(), XV_HdmiTx_DdcIntrDisable, XV_HdmiTx_DdcWaitForDone(), XV_HdmiTx_DdcWriteCommand(), XV_HdmiTx_PioIntrDisable, and XV_HdmiTx_PioIntrEnable.

Referenced by XV_HdmiTx_ClockRatio(), XV_HdmiTx_DetectHdmi20(), XV_HdmiTx_Scrambler(), and XV_HdmiTx_ShowSCDC().

void XV_HdmiTx_DdcWriteCommand | ( | XV_HdmiTx * | InstancePtr,
|  | u32 | Cmd
| ) |  |

This function writes data into the command fifo.

Parameters

  InstancePtr | is a pointer to the XV_HdmiTx core instance.

Note
  None.

References XV_HdmiTx_Config::BaseAddress, XV_HdmiTx::Config, XV_HDMITX_DDC_CMD_OFFSET, XV_HDMITX_DDC_CTRL_OFFSET, XV_HDMITX_DDC_CTRL_RUN_MASK, XV_HDMITX_DDC_STA_CMD_FULL, XV_HDMITX_DDC_STA_OFFSET, XV_HdmiTx_ReadReg, and XV_HdmiTx_WriteReg.

Referenced by XV_HdmiTx_DdcRead(), and XV_HdmiTx_DdcWrite().

void XV_HdmiTx_DebugInfo | ( | XV_HdmiTx * | InstancePtr | ) |

This function prints stream and timing information on STDIO/Uart console.

Parameters

  InstancePtr | is a pointer to the XV_HdmiTx core instance.

Returns
  None.

Note
  None.

References XV_HdmiTx::Stream, and XV_HdmiTx_Stream::Video.

int XV_HdmiTx_DetectHdmi20 | ( | XV_HdmiTx * | InstancePtr | ) |

This function detects connected sink is a HDMI 2.0/HDMI 1.4 sink device and sets appropriate flag in the TX stream.

Parameters

  InstancePtr | is a pointer to the XV_HdmiTx core instance.

Returns
  - XST_SUCCESS if HDMI 2.0
  - XST_FAILURE if HDMI 1.4

Note
  None.

References XV_HdmiTx_Stream::IsHdmi20, XV_HdmiTx::Stream, and XV_HdmiTx_DdcWrite().

void XV_HdmiTx_EXT_SYSRST | ( | XV_HdmiTx * | InstancePtr,
|  | u8 | Reset
| ) |  |

This function asserts or releases the HDMI TX External SYSRST.

Parameters

  InstancePtr | is a pointer to the XV_HdmiTx core instance.
  Reset | specifies TRUE/FALSE value to either assert or release HDMI TX External SYSRST.

Returns
  None.

Note
  The reset output of the PIO is inverted. When the system is in reset, the PIO output is cleared and this will reset the HDMI TX. Therefore, clearing the PIO reset output will assert the HDMI External system reset. C-style signature: void XV_HdmiTx_EXT_SYSRST(XV_HdmiTx *InstancePtr, u8 Reset)

References XV_HDMITX_PIO_OUT_CLR_OFFSET, XV_HDMITX_PIO_OUT_EXT_SYSRST_MASK, XV_HDMITX_PIO_OUT_SET_OFFSET, and XV_HdmiTx_WriteReg.

void XV_HdmiTx_EXT_VRST | ( | XV_HdmiTx * | InstancePtr,
|  | u8 | Reset
| ) |  |

This function asserts or releases the HDMI TX External VRST.

Parameters

  InstancePtr | is a pointer to the XV_HdmiTx core instance.
  Reset | specifies TRUE/FALSE value to either assert or release HDMI TX External VRST.

Returns
  None.

Note
  The reset output of the PIO is inverted. When the system is in reset, the PIO output is cleared and this will reset the HDMI TX. Therefore, clearing the PIO reset output will assert the HDMI external video reset. C-style signature: void XV_HdmiTx_EXT_VRST(XV_HdmiTx *InstancePtr, u8 Reset)

References XV_HDMITX_PIO_OUT_CLR_OFFSET, XV_HDMITX_PIO_OUT_EXT_VRST_MASK, XV_HDMITX_PIO_OUT_SET_OFFSET, and XV_HdmiTx_WriteReg.

XV_HdmiTx_AudioFormatType XV_HdmiTx_GetAudioFormat | ( | XV_HdmiTx * | InstancePtr | ) |

This function gets the active audio format.

Parameters

  InstancePtr | is a pointer to the XV_HdmiTx core instance.

Returns
  Active audio format of HDMI Tx

Note
  None.

References XV_HDMITX_AUD_CTRL_AUDFMT_MASK, XV_HDMITX_AUD_CTRL_AUDFMT_SHIFT, XV_HDMITX_AUD_CTRL_OFFSET, and XV_HdmiTx_ReadReg.

u32 XV_HdmiTx_GetTmdsClk | ( | XV_HdmiTx * | InstancePtr,
|  | XVidC_VideoMode | VideoMode,
|  | XVidC_ColorFormat | ColorFormat,
|  | XVidC_ColorDepth | Bpc
| ) |  |

This function sets and return the TMDS Clock based on Video Parameter.

Parameters

  InstancePtr | is a pointer to the XV_HdmiTx core instance.
  VideoMode | specifies resolution identifier.
  ColorFormat | specifies the type of color format. 0 = XVIDC_CSF_RGB 1 = XVIDC_CSF_YCRCB_444 2 = XVIDC_CSF_YCRCB_422 3 = XVIDC_CSF_YCRCB_420
  Bpc | specifies the color depth/bits per color component. 6 = XVIDC_BPC_6 8 = XVIDC_BPC_8 10 = XVIDC_BPC_10 12 = XVIDC_BPC_12 16 = XVIDC_BPC_16

Returns
  - TMDS Clock

Note
  None.

References XV_HdmiTx_Stream::PixelClk, and XV_HdmiTx::Stream.

Referenced by XV_HdmiTx_SetStream().

void XV_HdmiTx_INT_LRST | ( | XV_HdmiTx * | InstancePtr,
|  | u8 | Reset
| ) |  |

This function asserts or releases the HDMI TX Internal LRST.

Parameters

  InstancePtr | is a pointer to the XV_HdmiTx core instance.
  Reset | specifies TRUE/FALSE value to either assert or release HDMI TX Internal LRST.

Returns
  None.

Note
  The reset output of the PIO is inverted. When the system is in reset, the PIO output is cleared and this will reset the HDMI TX. Therefore, clearing the PIO reset output will assert the HDMI Internal link reset. C-style signature: void XV_HdmiTx_INT_VRST(XV_HdmiTx *InstancePtr, u8 Reset)

References XV_HDMITX_PIO_OUT_CLR_OFFSET, XV_HDMITX_PIO_OUT_INT_LRST_MASK, XV_HDMITX_PIO_OUT_SET_OFFSET, and XV_HdmiTx_WriteReg.

void XV_HdmiTx_INT_VRST | ( | XV_HdmiTx * | InstancePtr,
|  | u8 | Reset
| ) |  |

This function asserts or releases the HDMI TX Internal VRST.

Parameters

  InstancePtr | is a pointer to the XV_HdmiTx core instance.
  Reset | specifies TRUE/FALSE value to either assert or release HDMI TX Internal VRST.

Returns
  None.

Note
  The reset output of the PIO is inverted. When the system is in reset, the PIO output is cleared and this will reset the HDMI TX. Therefore, clearing the PIO reset output will assert the HDMI Internal video reset. C-style signature: void XV_HdmiTx_INT_VRST(XV_HdmiTx *InstancePtr, u8 Reset)

References XV_HDMITX_PIO_OUT_CLR_OFFSET, XV_HDMITX_PIO_OUT_INT_VRST_MASK, XV_HDMITX_PIO_OUT_SET_OFFSET, and XV_HdmiTx_WriteReg.

int XV_HdmiTx_IsStreamConnected | ( | XV_HdmiTx * | InstancePtr | ) |

This function provides the stream connected status.

Parameters

  InstancePtr | is a pointer to the XV_HdmiTx core instance.

Returns
  - TRUE = Stream is connected.
  - FALSE = Stream is connected.

Note
  None.

References XV_HdmiTx_Stream::IsConnected, and XV_HdmiTx::Stream.

int XV_HdmiTx_IsStreamScrambled | ( | XV_HdmiTx * | InstancePtr | ) |

This function provides status of the stream.

Parameters

  InstancePtr | is a pointer to the XV_HdmiTx core instance.

Returns
  - TRUE = Scrambled.
  - FALSE = Not scrambled.

Note
  None.

References XV_HdmiTx_Stream::IsScrambled, and XV_HdmiTx::Stream.

u8 XV_HdmiTx_LookupVic | ( | XVidC_VideoMode | VideoMode | ) |

This function provides video identification code of video mode.

Parameters

  VideoMode | specifies resolution identifier.

Returns
  Video identification code defined in the VIC table.

Note
  None.

Referenced by XV_HdmiTx_SetStream().

int XV_HdmiTx_Scrambler | ( | XV_HdmiTx * | InstancePtr | ) |

This function controls the scrambler.

Requires TMDSClock to be up to date in order to force enable scrambler when TMDSClock > 340MHz.

Parameters

  InstancePtr | is a pointer to the XV_HdmiTx core instance.

Returns
  - XST_SUCCESS if HDMI 2.0
  - XST_FAILURE if HDMI 1.4

Note
  None.

References XV_HdmiTx_Stream::IsHdmi20, XV_HdmiTx_Stream::IsScrambled, XV_HdmiTx_Stream::OverrideScrambler, XV_HdmiTx::Stream, XV_HdmiTx_Stream::TMDSClock, XV_HdmiTx_DdcRead(), XV_HdmiTx_DdcWrite(), and XV_HdmiTx_SetScrambler.

Referenced by XV_HdmiTx_SetStream().

int XV_HdmiTx_SetAudioChannels | ( | XV_HdmiTx * | InstancePtr,
|  | u8 | Value
| ) |  |

This function sets the active audio channels.

Parameters

  InstancePtr | is a pointer to the XV_HdmiTx core instance.

Returns
  - XST_SUCCESS if active channels were set.
  - XST_FAILURE if no active channles were set.

Note
  None.

References XV_HDMITX_AUD_CTRL_CH_SHIFT, XV_HDMITX_AUD_CTRL_CLR_OFFSET, XV_HDMITX_AUD_CTRL_OFFSET, XV_HDMITX_AUD_CTRL_RUN_MASK, XV_HDMITX_AUD_CTRL_SET_OFFSET, XV_HdmiTx_ReadReg, and XV_HdmiTx_WriteReg.

int XV_HdmiTx_SetAudioFormat | ( | XV_HdmiTx * | InstancePtr,
|  | XV_HdmiTx_AudioFormatType | Value
| ) |  |

This function sets the active audio format.

Parameters

  InstancePtr | is a pointer to the XV_HdmiTx core instance.

Returns
  - XST_SUCCESS if active channels were set.
  - XST_FAILURE if no active channles were set.

Note
  None.

References XV_HDMITX_AUD_CTRL_AUDFMT_MASK, XV_HDMITX_AUD_CTRL_CLR_OFFSET, XV_HDMITX_AUD_CTRL_RUN_MASK, XV_HDMITX_AUD_CTRL_SET_OFFSET, and XV_HdmiTx_WriteReg.

void XV_HdmiTx_SetAxiClkFreq | ( | XV_HdmiTx * | InstancePtr,
|  | u32 | ClkFreq
| ) |  |

This function sets the AXI4-Lite Clock Frequency.

Parameters

  InstancePtr | is a pointer to the XV_HdmiTx core instance.
  ClkFreq | specifies the value that needs to be set.

Returns

Note
  This is required after a reset or init.

References XV_HdmiTx_DdcInit().

void XV_HdmiTx_SetColorDepth | ( | XV_HdmiTx * | InstancePtr | ) |

This function sets the color depth.

Parameters

  InstancePtr | is a pointer to the XV_HdmiTx core instance.

Returns
  None.

Note
  None.

References XV_HdmiTx_Config::BaseAddress, XV_HdmiTx::Config, XV_HdmiTx::Stream, XV_HdmiTx_Stream::Video, XV_HDMITX_PIO_OUT_COLOR_DEPTH_MASK, XV_HDMITX_PIO_OUT_COLOR_DEPTH_SHIFT, XV_HDMITX_PIO_OUT_MSK_OFFSET, XV_HDMITX_PIO_OUT_OFFSET, and XV_HdmiTx_WriteReg.

Referenced by XV_HdmiTx_SetStream().

void XV_HdmiTx_SetColorFormat | ( | XV_HdmiTx * | InstancePtr | ) |

This function sets the color format.

Parameters

  InstancePtr | is a pointer to the XV_HdmiTx core instance.

Returns
  None.

Note
  None.

References XV_HdmiTx_Config::BaseAddress, XV_HdmiTx::Config, XV_HdmiTx::Stream, XV_HdmiTx_Stream::Video, XV_HDMITX_PIO_OUT_COLOR_SPACE_MASK, XV_HDMITX_PIO_OUT_COLOR_SPACE_SHIFT, XV_HDMITX_PIO_OUT_MSK_OFFSET, XV_HDMITX_PIO_OUT_OFFSET, and XV_HdmiTx_WriteReg.

Referenced by XV_HdmiTx_SetStream().

void XV_HdmiTx_SetDviMode | ( | XV_HdmiTx * | InstancePtr | ) |

This function sets the core into DVI mode.

Parameters

  InstancePtr | is a pointer to the XV_HdmiTx core instance.

Returns

Note
  This is required after a reset or init.

References XV_HdmiTx_Stream::IsHdmi, XV_HdmiTx::Stream, XV_HdmiTx_AudioDisable, XV_HdmiTx_AuxDisable, and XV_HdmiTx_ClearMode.

void XV_HdmiTx_SetGcpAvmuteBit | ( | XV_HdmiTx * | InstancePtr | ) |

This function sets the HDMI TX AUX GCP register AVMUTE bit.

Parameters

  InstancePtr | is a pointer to the XV_HdmiTx core instance.

Returns
  None.

Note
  None.

References XV_HDMITX_PIO_OUT_GCP_AVMUTE_MASK, XV_HDMITX_PIO_OUT_SET_OFFSET, and XV_HdmiTx_WriteReg.

void XV_HdmiTx_SetGcpClearAvmuteBit | ( | XV_HdmiTx * | InstancePtr | ) |

This function sets the HDMI TX AUX GCP register CLEAR_AVMUTE bit.

Parameters

  InstancePtr | is a pointer to the XV_HdmiTx core instance.

Returns
  None.

Note
  None.

References XV_HDMITX_PIO_OUT_GCP_CLEARAVMUTE_MASK, XV_HDMITX_PIO_OUT_SET_OFFSET, and XV_HdmiTx_WriteReg.

void XV_HdmiTx_SetHdmiMode | ( | XV_HdmiTx * | InstancePtr | ) |

This function sets the core into HDMI mode.

Parameters

  InstancePtr | is a pointer to the XV_HdmiTx core instance.

Returns

Note
  This is required after a reset or init.

References XV_HdmiTx_Stream::IsHdmi, XV_HdmiTx::Stream, XV_HdmiTx_AudioEnable, XV_HdmiTx_AuxEnable, and XV_HdmiTx_SetMode.

Referenced by XV_HdmiTx_CfgInitialize().

void XV_HdmiTx_SetPixelRate | ( | XV_HdmiTx * | InstancePtr | ) |

This function sets the pixel rate at output.

Parameters

  InstancePtr | is a pointer to the XV_HdmiTx core instance.

Returns
  None.

Note
  None.

References XV_HdmiTx_Config::BaseAddress, XV_HdmiTx::Config, XV_HdmiTx::Stream, XV_HdmiTx_Stream::Video, XV_HDMITX_PIO_OUT_MSK_OFFSET, XV_HDMITX_PIO_OUT_OFFSET, XV_HDMITX_PIO_OUT_PIXEL_RATE_MASK, XV_HDMITX_PIO_OUT_PIXEL_RATE_SHIFT, and XV_HdmiTx_WriteReg.

Referenced by XV_HdmiTx_SetStream().

void XV_HdmiTx_SetSampleRate | ( | XV_HdmiTx * | InstancePtr,
|  | u8 | SampleRate
| ) |  |

This function sets the sample rate at output.

Parameters

  InstancePtr | is a pointer to the XV_HdmiTx core instance.
  SampleRate | specifies the value that needs to be set. 2 samples per clock 3 samples per clock. 5 samples per clock.

Returns
  None.

Note
  None.

References XV_HdmiTx_Config::BaseAddress, XV_HdmiTx::Config, XV_HdmiTx_Stream::SampleRate, XV_HdmiTx::Stream, XV_HDMITX_PIO_OUT_MSK_OFFSET, XV_HDMITX_PIO_OUT_OFFSET, XV_HDMITX_PIO_OUT_SAMPLE_RATE_MASK, XV_HDMITX_PIO_OUT_SAMPLE_RATE_SHIFT, and XV_HdmiTx_WriteReg.

u32 XV_HdmiTx_SetStream | ( | XV_HdmiTx * | InstancePtr,
|  | XVidC_VideoMode | VideoMode,
|  | XVidC_ColorFormat | ColorFormat,
|  | XVidC_ColorDepth | Bpc,
|  | XVidC_PixelsPerClock | Ppc,
|  | XVidC_3DInfo * | Info3D
| ) |  |

This function sets the HDMI TX stream parameters.

Parameters

  InstancePtr | is a pointer to the XV_HdmiTx core instance.
  VideoMode | specifies resolution identifier.
  ColorFormat | specifies the type of color format. 0 = XVIDC_CSF_RGB 1 = XVIDC_CSF_YCRCB_444 2 = XVIDC_CSF_YCRCB_422 3 = XVIDC_CSF_YCRCB_420
  Bpc | specifies the color depth/bits per color component. 6 = XVIDC_BPC_6 8 = XVIDC_BPC_8 10 = XVIDC_BPC_10 12 = XVIDC_BPC_12 16 = XVIDC_BPC_16
  Ppc | specifies the pixel per clock. 1 = XVIDC_PPC_1 2 = XVIDC_PPC_2 4 = XVIDC_PPC_4

Returns
  TmdsClock, reference clock calculated based on the input parameters.

Note
  None.

In HDMI the colordepth in YUV422 is always 12 bits, although on the link itself it is being transmitted as 8-bits. Therefore if the colorspace is YUV422, then force the colordepth to 12 bits.

References XV_HdmiTx_Stream::IsHdmi20, XV_HdmiTx_Stream::IsScrambled, XV_HdmiTx::Stream, XV_HdmiTx_Stream::TMDSClock, XV_HdmiTx_Stream::TMDSClockRatio, XV_HdmiTx_Stream::Vic, XV_HdmiTx_Stream::Video, XV_HdmiTx_ClockRatio(), XV_HdmiTx_GetTmdsClk(), XV_HdmiTx_LookupVic(), XV_HdmiTx_Scrambler(), XV_HdmiTx_SetColorDepth(), XV_HdmiTx_SetColorFormat(), and XV_HdmiTx_SetPixelRate().

void XV_HdmiTx_ShowSCDC | ( | XV_HdmiTx * | InstancePtr | ) |

This function shows the sinks SCDC registers.

Parameters

  InstancePtr | is a pointer to the XV_HdmiTx core instance.

Returns
  None.

Note
  None.

References XV_HdmiTx_DdcRead(), and XV_HdmiTx_DdcWrite().