![]() |
v_hdmitx
Xilinx SDK Drivers API Documentation
|
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
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... | |
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_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... | |
u32 XV_HdmiTx_AuxSend | ( | XV_HdmiTx * | InstancePtr | ) |
This function transmits the infoframes generated by the processor.
InstancePtr | is a pointer to the XV_HdmiTx core instance. |
References XV_HdmiTx::Aux, XV_HdmiTx_Config::BaseAddress, XV_HdmiTx::Config, XV_HdmiTx_AuxHeader::Data, XV_HdmiTx_AuxData::Data, XV_HdmiTx_Aux::Data, XV_HdmiTx_Aux::Header, 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.
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. |
References XV_HdmiTx_Config::BaseAddress, XV_HdmiTx::Config, and XV_HdmiTx::ConnectCallback.
void XV_HdmiTx_Clear | ( | XV_HdmiTx * | InstancePtr | ) |
This function clear the HDMI TX variables and sets it to the defaults.
InstancePtr | is a pointer to the XV_HdmiTx core instance. |
int XV_HdmiTx_ClockRatio | ( | XV_HdmiTx * | InstancePtr | ) |
This function controls the TMDS clock ratio.
InstancePtr | is a pointer to the XV_HdmiTx core instance. |
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.
InstancePtr | is a pointer to the XV_HdmiTx core instance. |
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.
InstancePtr | is a pointer to the XV_HdmiTx core instance. |
Frequency | specifies the value that needs to be set. |
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.
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. |
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(), and XV_HdmiTx_DdcWriteCommand().
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.
InstancePtr | is a pointer to the XV_HdmiTx core instance. |
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.
InstancePtr | is a pointer to the XV_HdmiTx core instance. |
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.
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. |
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(), and XV_HdmiTx_DdcWriteCommand().
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.
InstancePtr | is a pointer to the XV_HdmiTx core instance. |
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.
InstancePtr | is a pointer to the XV_HdmiTx core instance. |
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.
InstancePtr | is a pointer to the XV_HdmiTx core instance. |
References XV_HdmiTx_Stream::IsHdmi20, XV_HdmiTx::Stream, and XV_HdmiTx_DdcWrite().
XV_HdmiTx_AudioFormatType XV_HdmiTx_GetAudioFormat | ( | XV_HdmiTx * | InstancePtr | ) |
This function gets the active audio format.
InstancePtr | is a pointer to the XV_HdmiTx core instance. |
References XV_HDMITX_AUD_CTRL_AUDFMT_MASK, XV_HDMITX_AUD_CTRL_AUDFMT_SHIFT, XV_HDMITX_AUD_CTRL_OFFSET, and XV_HdmiTx_ReadReg.
int XV_HdmiTx_IsStreamConnected | ( | XV_HdmiTx * | InstancePtr | ) |
This function provides the stream connected status.
InstancePtr | is a pointer to the XV_HdmiTx core instance. |
References XV_HdmiTx_Stream::IsConnected, and XV_HdmiTx::Stream.
int XV_HdmiTx_IsStreamScrambled | ( | XV_HdmiTx * | InstancePtr | ) |
This function provides status of the stream.
InstancePtr | is a pointer to the XV_HdmiTx core instance. |
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.
VideoMode | specifies resolution identifier. |
Referenced by XV_HdmiTx_SetStream().
int XV_HdmiTx_Scrambler | ( | XV_HdmiTx * | InstancePtr | ) |
This function controls the scrambler.
InstancePtr | is a pointer to the XV_HdmiTx core instance. |
References XV_HdmiTx_Stream::IsHdmi20, XV_HdmiTx_Stream::IsScrambled, 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.
InstancePtr | is a pointer to the XV_HdmiTx core instance. |
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, and XV_HdmiTx_WriteReg.
int XV_HdmiTx_SetAudioFormat | ( | XV_HdmiTx * | InstancePtr, |
XV_HdmiTx_AudioFormatType | Value | ||
) |
This function sets the active audio format.
InstancePtr | is a pointer to the XV_HdmiTx core instance. |
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.
InstancePtr | is a pointer to the XV_HdmiTx core instance. |
ClkFreq | specifies the value that needs to be set. |
References XV_HdmiTx_DdcInit().
void XV_HdmiTx_SetColorDepth | ( | XV_HdmiTx * | InstancePtr | ) |
This function sets the color depth.
InstancePtr | is a pointer to the XV_HdmiTx core instance. |
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.
InstancePtr | is a pointer to the XV_HdmiTx core instance. |
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.
InstancePtr | is a pointer to the XV_HdmiTx core instance. |
References XV_HdmiTx_Stream::IsHdmi, XV_HdmiTx::Stream, XV_HdmiTx_AudioDisable, XV_HdmiTx_AuxDisable, and XV_HdmiTx_ClearMode.
void XV_HdmiTx_SetHdmiMode | ( | XV_HdmiTx * | InstancePtr | ) |
This function sets the core into HDMI mode.
InstancePtr | is a pointer to the XV_HdmiTx core instance. |
References XV_HdmiTx_Stream::IsHdmi, XV_HdmiTx::Stream, and XV_HdmiTx_SetMode.
void XV_HdmiTx_SetPixelRate | ( | XV_HdmiTx * | InstancePtr | ) |
This function sets the pixel rate at output.
InstancePtr | is a pointer to the XV_HdmiTx core instance. |
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.
InstancePtr | is a pointer to the XV_HdmiTx core instance. |
SampleRate | specifies the value that needs to be set.
|
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.
InstancePtr | is a pointer to the XV_HdmiTx core instance. |
VideoMode | specifies resolution identifier. |
ColorFormat | specifies the type of color format.
|
Bpc | specifies the color depth/bits per color component.
|
Ppc | specifies the pixel per clock.
|
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::PixelClk, XV_HdmiTx::Stream, XV_HdmiTx_Stream::TMDSClock, XV_HdmiTx_Stream::TMDSClockRatio, XV_HdmiTx_Stream::Vic, XV_HdmiTx_Stream::Video, XV_HdmiTx_ClockRatio(), 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.
InstancePtr | is a pointer to the XV_HdmiTx core instance. |
References XV_HdmiTx_DdcRead(), and XV_HdmiTx_DdcWrite().