读赛灵思IP手册,HDMI 1.4/2.0 Receiver Subsystem v2.0 Product Guide,即HDMI接受器系统的手册。本期介绍附录C应用软件开发。
Appendix C
Application Software Development
附录C
应用软件开发
Device Drivers
The HDMI 1.4/2.0 Receiver Subsystem driver abstracts the included supporting elements and provides you with an API for control. The API can be easily integrated into your application thereby providing an out-of-the-box solution.
The subsystem driver is a bare-metal driver, which provides an abstracted view of the feature set provided by each sub-core. It dynamically manages the data and control flow through the processing elements, based on the input/output stream configuration set at run time. Internally, it relies on sub-core drivers to configure the sub-core IP blocks.
设备驱动程序
HDMI 1.4/2.0接收器子系统驱动程序抽象了所包含的支持元素,并为您提供了一个用于控制的API。API可以轻松集成到应用程序中,从而提供现成的解决方案。
子系统驱动程序是一个裸机驱动程序,它提供了每个子核心提供的功能集的抽象视图。它根据运行时设置的输入/输出流配置,动态管理通过处理元素的数据和控制流。在内部,它依赖子核心驱动程序来配置子核心IP块。
Architecture
The subsystem driver provides an easy-to-use, well-defined API to help integrate the subsystem in an application without having to understand the underlying complexity of configuring each and every sub-core.
The subsystem driver consists of the following:
• Subsystem layer: Queries exported hardware to determine the subsystem hardware configuration and pull-in sub-core drivers, at build time. It abstracts sub-core drivers, which interface with hardware at register level, into a set of functional APIs. The subsystem driver uses these APIs to dynamically manage the data flow through processing elements.
• Sub-core drivers: Every included sub-core has a driver associated with it that provides APIs to interface with the core hardware.
Figure C-1 shows the HDMI 1.4/2.0 Receiver Subsystem architecture.
结构
子系统驱动程序提供了一个易于使用、定义良好的API,帮助将子系统集成到应用程序中,而无需了解配置每个子核心的底层复杂性。
子系统驱动程序由以下部分组成:
•子系统层:在构建时查询导出的硬件,以确定子系统硬件配置和拉入子核心驱动程序。它将在寄存器级与硬件接口的子核心驱动程序抽象为一组功能API。子系统驱动程序使用这些API动态管理通过处理元素的数据流。
•子核心驱动程序:每个包含的子核心都有一个与其关联的驱动程序,该驱动程序提供API来与核心硬件接口。
图C-1显示了HDMI 1.4/2.0接收机子系统架构。
The HDMI 1.4/2.0 Receiver Subsystem is a MAC subsystem which works with a Video PHY Controller (PHY) to create a video connectivity system. The HDMI 1.4/2.0 Receiver Subsystem is tightly coupled with the Xilinx Video PHY Controller, which itself is independent and offer flexible architecture with multiple-protocol support. Both MAC and PHY are dynamically programmable through the AXI4-Lite interface.
HDMI 1.4/2.0接收器子系统是一个MAC子系统,它与视频PHY控制器(PHY)一起创建视频连接系统。HDMI 1.4/2.0接收器子系统与Xilinx Video PHY Controller紧密耦合,后者本身是独立的,提供灵活的体系结构和多协议支持。MAC和PHY都可以通过AXI4 Lite接口动态编程。
Usage
The HDMI 1.4/2.0 Receiver Subsystem provides a set of API functions for application code to use. On top of that, when HDMI 1.4/2.0 Receiver Subsystem hardware interrupts are generated, the subsystem driver is invoked to configure the system accordingly. HDMI 1.4/2.0 Receiver Subsystem provides callback structure to hook up your own callback functions.
用法
HDMI 1.4/2.0接收器子系统为应用程序代码提供了一组API函数。除此之外,当HDMI 1.4/2.0接收器子系统硬件中断生成时,会调用子系统驱动程序来相应地配置系统。HDMI 1.4/2.0接收器子系统提供回调结构来连接您自己的回调函数。
Ensure that the video stream has started. Then, valid AUX data and audio data can be inserted after the video is locked. However, because the application knows what video format will be sent and what audio format will be embedded. With this information, the ACR number can be calculated and set before audio stream is ready to be sent.
确保视频流已启动。然后,可以在视频锁定后插入有效的AUX数据和音频数据。但是,因为应用程序知道将发送什么视频格式以及将嵌入什么音频格式。有了这些信息,可以在音频流准备好发送之前计算和设置ACR编号。
In the following sections, only HDMI related modules are covered. The user application needs to take care of system peripheral, such as timer, UART, external system clock generator, etc.
在以下章节中,仅介绍HDMI相关模块。用户应用程序需要处理系统外围设备,如定时器、UART、外部系统时钟发生器等。
Application Integration
Figure C-3 shows an example code on how an HDMI 1.4/2.0 Receiver Subsystem can be used in your application.
应用程序集成
图C-3显示了如何在应用程序中使用HDMI 1.4/2.0接收器子系统的示例代码。
P80
To integrate and use the HDMI 1.4/2.0 Receiver Subsystem driver in your application, the following steps must be followed:
1. Include the subsystem header file xv_hdmirxss.h that defines the subsystem object.
2. Provide the storage for a subsystem driver instance in your application code. For example:
XV_HdmiRxSs HdmiRxSs;
3. In the subsystem driver instance, there is a metadata structure to store the subsystem hardware configuration. Declare a pointer variable in the application code to point to the instance:
XV_HdmiRxSs_Config *XV_HdmiRxSs_ConfigPtr;
4. Set EDID parameter for HDMI 1.4/2.0 Receiver Subsystem Subsystem.
要在应用程序中集成和使用HDMI 1.4/2.0接收器子系统驱动程序,必须遵循以下步骤:
1.包括子系统头文件xv_hdmirxss.h定义子系统对象。
2.在应用程序代码中为子系统驱动程序实例提供存储。例如:
XV_HdmiRxSs HdmiRxSs;
3.在子系统驱动程序实例中,有一个元数据结构来存储子系统硬件配置。在应用程序代码中声明指向实例的指针变量:
XV_AdmiRxSs_Config*XV_admiRxs_ConfigPtr;
4.设置HDMI 1.4/2.0接收器子系统子系统的EDID参数。
void XV_HdmiRxSs_SetEdidParam(XV_HdmiRxSs *InstancePtr,
u8 *EdidDataPtr,
u16 Length);
5. For each subsystem instance, the data structures declared in steps 2 and 3 need to be initialized based on its hardware configuration, which is passed through metadata structure from xparameters.h uniquely identified by device ID.
To initialize the subsystem, call the following two API functions:
5.对于每个子系统实例,步骤2和3中声明的数据结构需要根据其硬件配置进行初始化,该配置通过xparameters的元数据结构传递。h由设备ID唯一标识。
要初始化子系统,请调用以下两个API函数:
XV_HdmiRxSs_Config* XV_HdmiRxSs_LookupConfig(u32 DeviceId);
int XV_HdmiRxSs_CfgInitialize(XV_HdmiRxSs *InstancePtr,
XV_HdmiRxSs_Config *CfgPtr,
u32 EffectiveAddr);
The Device ID can be found in xparameters.h:
可以在xparameters.h中找到设备ID:
XPAR_[HDMI RX Subsystem Instance Name in IPI]_DEVICE_ID
6. Each interrupt source has an associated ISR defined in the subsystem. Register the ISR with the system interrupt controller and enable the interrupt.
6.每个中断源都有子系统中定义的相关ISR。向系统中断控制器注册ISR并启用中断。
int XIntc_Connect(XIntc *InstancePtr,
u8 Id,
XInterruptHandler Handler,
void *CallBackRef);
void XIntc_Enable(XIntc *InstancePtr,
u8 Id);
Where ID can be found in xparameters.h.
Note:
1. Prepare the 256 bytes of EDID data and store in an array before calling the mentioned API function.
2. The EDID data is loaded into the HDMI 1.4/2.0 Receiver Subsystem during initialization. This is handled by the subsystem driver, no user intervention is needed.
注:
1.在调用上述API函数之前,准备256字节的EDID数据并存储在数组中。
2.EDID数据在初始化期间加载到HDMI 1.4/2.0接收器子系统。这由子系统驱动程序处理,不需要用户干预。
P81
HDCP RX Overview
The HDMI 1.4/2.0 Receiver Subsystem driver is responsible for combining HDCP 1.4 and HDCP 2.2 drivers APIs into a single common API for use by the user level application. The common HDCP driver API is able to handle the following HDCP configurations: HDCP 1.4 only, HDCP 2.2 only, and both. When both protocols are enabled, the common HDCP driver ensures that only one is active at any given time.
HDCP RX概述
HDMI 1.4/2.0接收器子系统驱动程序负责将HDCP 1.4和HDCP 2.2驱动程序API组合成一个通用API,供用户级应用程序使用。通用HDCP驱动程序API能够处理以下HDCP配置:仅HDCP 1.4,仅HDCP 2.2,以及两者。当两个协议都启用时,通用HDCP驱动程序确保在任何给定时间只有一个处于活动状态。
HDCP RX Driver Integration
This section describes the steps required to initialize and run the HDCP RX. The application should call the functions roughly in the order specified to ensure that the driver operates properly. When only a single HDCP protocol is enabled, either 1.4 or 2.2, a subset of the function calls might be needed.
HDCP RX驱动程序集成
本节介绍初始化和运行HDCP RX所需的步骤。应用程序应大致按照指定的顺序调用函数,以确保驱动程序正常运行。当仅启用单个HDCP协议(1.4或2.2)时,可能需要函数调用的子集。
1. Load the HDCP production keys into the HDMI subsystem. This function needs to be called for each key that is loaded. If HDCP 1.4 and 2.2 are enabled all the keys must be loaded, otherwise a subset of the keys are loaded. Note that the byte arrays used to store the key octet strings for HDCP are defined in big endian byte order.
1.将HDCP生产密钥加载到HDMI子系统中。需要为加载的每个键调用此函数。如果启用了HDCP 1.4和2.2,则必须加载所有密钥,否则将加载密钥的子集。请注意,用于存储HDCP的关键八位字节字符串的字节数组是按大端字节顺序定义的。
° XV_HdmiRxSs_HdcpSetKey
– XV_HDMIRXSS_KEY_HDCP14
– XV_HDMIRXSS_KEY_HDCP22_LC128 (128-bit DCP Licensed Constant)
– XV_HDMIRXSS_KEY_HDCP22_PRIVATE (902-byte DCP Receiver Device Key Set)
Position in Bytes |
Size in Bytes |
Description |
0–39 |
40 |
Reserved |
40–561 |
522 |
Device Public Certificate |
562–901 |
340 |
Device Private Key |
2. Initialize the HDMI 1.4/2.0 Receiver Subsystem driver after the HDCP keys have been loaded. Initializing the subsystem begins the HDCP 1.4/2.2 drivers internally.
3. Connect the HDCP interrupt handlers to the interrupt controller interrupt ID:
2.加载HDCP密钥后,初始化HDMI 1.4/2.0接收器子系统驱动程序。初始化子系统将在内部启动HDCP 1.4/2.2驱动程序。
3.将HDCP中断处理程序连接到中断控制器中断ID:
° XV_HdmiRxSS_HdcpIntrHandler
° XV_HdmiRxSS_HdcpTimerIntrHandler
4. Set the HDCP authenticated user callback. This callback is executed when the HDCP authentication state machine has reached the authenticated state. If there is no use for this function at the application level, then leave this callback undefined.
4.设置HDCP认证用户回调。当HDCP身份验证状态机达到身份验证状态时,将执行此回调。如果在应用程序级别没有使用此函数,则保留此回调未定义。
° XV_HdmiRxSs_SetCallback
– XV_HDMIRXSS_HANDLER_HDCP_AUTHENTICATE
5. Execute the poll function to run the HDCP state machine. This function checks to see which HDCP protocol is enabled, and then execute only the active protocol. The call to this function can be inserted in the main loop of the user application and should execute continuously. Because the HDCP RX state machine is run using this poll function, it is important to ensure that this function is given adequate CPU runtime, especially during authentication attempts.
5.执行轮询功能以运行HDCP状态机。此函数检查启用了哪个HDCP协议,然后仅执行活动协议。对该函数的调用可以插入到用户应用程序的主循环中,并且应该连续执行。由于HDCP RX状态机是使用此轮询函数运行的,因此确保此函数有足够的CPU运行时间非常重要,尤其是在身份验证尝试期间。
° XV_HdmiRxSs_HdcpPoll
6. Set the HDCP protocol to either HDCP 1.4, HDCP 2.2, or none. Setting the HDCP protocol is required to inform the HDMI subsystem which protocol is active thus avoiding collisions between protocols. Also, check which protocol has been activated.
6.将HDCP协议设置为HDCP 1.4、HDCP 2.2或无。需要设置HDCP协议来通知HDMI子系统哪个协议处于活动状态,从而避免协议之间的冲突。同时,检查已激活的协议。
° XV_HdmiRxSs_HdcpSetProtocol
– XV_HDMIRXSS_HDCP_NONE
– XV_HDMIRXSS_HDCP_14
– XV_HDMIRXSS_HDCP_22
° XV_HdmiRxSs_HdcpGetProtocol
7. Check the status of authentication.
7.检查身份验证状态。
° XV_HdmiRxSs_HdcpIsAuthenticated
8. Check the status of the cipher encryption. This is the instantaneous encryption status of the cipher and can change between subsequent frames.
8.检查密码加密的状态。这是密码的瞬时加密状态,可以在后续帧之间更改。
° XV_HdmiRxSs_HdcpIsEncrypted
9. Check the overall HDCP protocol status and log data. You can also set the level of detail for log information reported.
9.检查整体HDCP协议状态和日志数据。您还可以设置报告的日志信息的详细级别。
° XV_HdmiRxSs_HdcpInfo
° XV_HdmiRxSs_SetInfoDetail
P83
Integrate Video PHY Controller Driver for HDMI RX Subsystem Usage
Because the HDMI 1.4/2.0 Receiver Subsystem is closely coupled with the Video PHY Controller, the following example code demonstrates how a Video PHY Controller can be used in your application.
集成HDMI RX子系统使用的视频PHY控制器驱动程序
由于HDMI 1.4/2.0接收器子系统与视频PHY控制器紧密耦合,下面的示例代码演示了如何在应用程序中使用视频PHY控件。
To integrate and use the Video PHY Controller for HDMI 1.4/2.0 Receiver Subsystem in the application code, the following steps must be followed:
1. Include the subsystem header file xvphy.h that defines the subsystem object.
2. Declare and allocate space for a Video PHY Controller instance in your application code.
Example:
要在应用程序代码中集成和使用HDMI 1.4/2.0接收机子系统的视频PHY控制器,必须遵循以下步骤:
1.包括子系统头文件xvphy.h定义子系统对象。
2.在应用程序代码中声明和分配视频PHY控制器实例的空间。
例子:
XVphy Vphy;
3. In the Video PHY Controller instance, there is a metadata structure to store its hardware configuration. Declare a pointer variable in the application code to point to the instance:
3.在Video PHY Controller实例中,有一个元数据结构来存储其硬件配置。在应用程序代码中声明指向实例的指针变量:
XVphy_Config *XVphyCfgPtr;
4. For each Video PHY Controller instance, the above data structure needs to be initialized based on its hardware configuration, which is passed through meta-structure from xparameters.h uniquely identified by device ID.
To initialize the Video PHY Controller, call the following two API functions:
4.对于每个Video PHY Controller实例,上述数据结构需要根据其硬件配置进行初始化,通过xparameters.h的元结构传递设备ID唯一标识。
要初始化视频PHY控制器,请调用以下两个API函数:
XVphy_Config *XVphy_LookupConfig(u16 DeviceId);
u32 XVphy_HdmiInitialize(XVphy *InstancePtr,
u8 QuadId,
XVphy_Config *CfgPtr,
u32 SystemFrequency);
The Device ID can be found in xparameters.h:
可以在xparameters.h中找到设备ID:
XPAR_[Video PHY Controller Instance Name in IPI]_DEVICE_ID
Similarly, SystemFrequency is the system frequency, which can also be found in xparameters.h
类似地,SystemFrequency是系统频率,也可以在xparameters.h中找到
Note:
• Xilinx recommends initializing the Video PHY controller after the HDMI 1.4/2.0 Receiver Subsystem initialization is completed.
• Registering the Video PHY Controller interrupts are part of system application integration. Steps are shown in the previous section and not repeated here.
注:
•Xilinx建议在HDMI 1.4/2.0接收器子系统初始化完成后初始化视频PHY控制器。
•注册视频PHY控制器中断是系统应用程序集成的一部分。步骤如前一节所示,此处不再重复。
Interrupts
All interrupts generated by the HDMI 1.4/2.0 Receiver Subsystem are listed here:
1. HPD – Peripheral I/O to detect HDMI cable 5.0V signal
a. Rising edge – Cable connected
b. Falling edge – Cable disconnected
2. Link Ready – Every time when Video PHY Controller is reconfigured, the link_clk is regenerated. An HDMI RX sub-core register bit (link status bit) reflects the change of link_clk status. When stable link_clk is detected, it is set to 1. When link_clk becomes unstable, it is set to 0. The Link Ready is an interrupt to detect the change of the link status bit.
a. Rising edge – Link is up
b. Falling edge – Link is down
3. Video Ready – This interrupt is generated by HDMI RX sub-core to reflect the status of received video stream.
a. Rising edge – Video Stream is stable (StreamUp)
b. Falling edge – Video Stream is not stable (StreamDown)
中断
HDMI 1.4/2.0接收器子系统生成的所有中断如下所示:
1.HPD–用于检测HDMI电缆5.0V信号的外围I/O
a、 上升沿–电缆连接
b、 下降边缘–电缆断开
2.链接就绪–每次重新配置视频PHY控制器时,都会重新生成Link_clk。HDMI RX子核心寄存器位(链路状态位)反映了link_clk状态的变化。当检测到稳定的link_clk时,它设置为1。当link_clk变得不稳定时,它被设置为0。link Ready是一个中断,用于检测链路状态位的变化。
a、 上升沿–链接向上
b、 下降边缘–链接已下降
3.视频就绪–此中断由HDMI RX子核心生成,以反映接收视频流的状态。
a、 上升趋势–视频流稳定(StreamUp)
b、 下降边缘–视频流不稳定(StreamDown)
4. HDMI Receiver Auxiliary Infoframe Interrupt – This interrupt is generated when an Auxiliary Infoframe is received.
5. HDMI Receiver Audio Infoframe Interrupt – This interrupt is generated when an Audio Infoframe is received.
6. HDCP 1.4 Interrupt (only available when HDCP 1.4 is enabled in hardware)
7. HDCP 1.4 Timer Interrupt (only available when HDCP 1.4 is enabled in hardware)
4.HDMI接收器辅助信息帧中断–当接收到辅助信息帧时生成此中断。
5.HDMI接收器音频信息帧中断–此中断在接收到音频信息帧时生成。
6.HDCP 1.4中断(仅当硬件中启用HDCP 1.4时可用)
7.HDCP 1.4定时器中断(仅当硬件中启用HDCP 1.4时可用)
表C-1:中断源和应用程序回调函数之间的映射
Table C‐1: Mapping between Interrupt Sources and Application Callback Functions
Interrupts |
Callback |
HPD |
XV_HDMIRXSS_HANDLER_CONNECT |
Link Ready |
|
Video Ready 视频就绪 注:它是边缘触发的。 |
XV_HDMIRXSS_HANDLER_STREAM_UP |
XV_HDMIRXSS_HANDLER_STREAM_INIT 注意:此回调函数不直接映射到任何中断源。 相反,它是在检测到流并且视频PHY控制器稳定以便HDMI RX子系统启动流锁定时执行的。 |
|
HDMI Receiver Auxiliary Infoframe Interrupt |
XV_HDMIRXSS_HANDLER_AUX |
HDMI Receiver Audio Infoframe Interrupt |
XV_HDMIRXSS_HANDLER_AUD |
HDCP 1.4 Interrupt |
|
HDCP 1.4 Timer Interrupt |
|
HDCP 2.2 Timer Interrupt (only available when HDCP 2.2 is enabled in hardware) |
|
XV_HDMIRXSS_HANDLER_HDCP_AUTHENTICATE 注意:此回调函数不直接映射到任何中断源。 而是在HDCP身份验证状态机达到身份验证状态时执行。 |
Application Callback Functions
Subsystem driver provides a mechanism for the application to register a user-defined function that gets called within an interrupt context.
Callback functions defined in the application code must be registered with provided handlers, using the following defined API:
应用程序回调函数
子系统驱动程序为应用程序提供了一种机制,用于注册在中断上下文中调用的用户定义函数。
应用程序代码中定义的回调函数必须使用以下定义的API向提供的处理程序注册:
int XV_HdmiRxSs_SetCallback(XV_HdmiRxSs *InstancePtr,
u32 HandlerType,
void *CallbackFuncPtr,
void *CallbackRef);
Available handlers are defined in xv_hdmirxss.h:
xv_hdmirxss.h中定义了可用的处理程序:
• XV_HDMIRXSS_HANDLER_CONNECT
• XV_HDMIRXSS_HANDLER_AUX
• XV_HDMIRXSS_HANDLER_AUD
• XV_HDMIRXSS_HANDLER_STREAM_UP
• XV_HDMIRXSS_HANDLER_STREAM_DOWN
• XV_HDMIRXSS_HANDLER_STREAM_INIT
• XV_HDMIRXSS_HANDLER_HDCP_AUTHENTICATE
XV_HDMIRXSS_HANDLER_CONNECT
This interrupt is triggered every time when an HDMI RX cable connection or disconnection (HPD level transition) occurs.
The callback function needs to perform the following:
1. Enable or disable the differential input clock buffer depending on if cable connection or disconnection occurs, respectively.
每次HDMI RX电缆连接或断开(HPD电平转换)时,都会触发此中断。
回调函数需要执行以下操作:
1.根据电缆连接或断开分别启用或禁用差分输入时钟缓冲器。
void XVphy_IBufDsEnable(XVphy *InstancePtr,
u8 QuadId,
XVphy_DirectionType Dir,
u8 Enable);
2. Clear Video PHY RX TMDS Clock ratio when cable is disconnected:
2.当电缆断开时,清除视频PHY RX TMDS时钟比率:
Vphy.HdmiRxTmdsClockRatio = 0;
XV_HDMIRXSS_HANDLER_AUX
This interrupt is triggered every time when an Auxiliary InfoFrame packet is received.
The callback function needs to retrieve the InfoFrame packet data for system application to use.
每次收到辅助信息帧数据包时,都会触发此中断。
回调函数需要检索InfoFrame数据包数据,以便系统应用程序使用。
XV_HDMIRXSS_HANDLER_AUD
This interrupt is triggered every time when an active audio stream is detected or the number of active audio channels changes.
The callback function can update the audio information to the application software.
每次检测到活动音频流或活动音频通道数发生变化时,都会触发此中断。
回调函数可以将音频信息更新到应用软件。
XV_HDMIRXSS_HANDLER_STREAM_UP
This interrupt is triggered every time when an HDMI video stream becomes locked. The callback function can update stream up information to the application software.
每次HDMI视频流被锁定时,都会触发此中断。回调函数可以将流信息更新到应用软件。
XV_HDMIRXSS_HANDLER_STREAM_DOWN
This interrupt is triggered when an HDMI video stream turns unlocked. The callback function can update stream down information to the application software. The application software might start a timer and put the system into standby mode if the HDMI 1.4/2.0 Receiver Subsystem remains unlocked for a certain time.
当HDMI视频流解锁时,会触发此中断。回调函数可以将流式信息更新到应用软件。如果HDMI 1.4/2.0接收器子系统保持解锁状态一段时间,应用软件可能会启动计时器并将系统置于待机模式。
XV_HDMIRXSS_HANDLER_STREAM_INIT
This interrupt is triggered every time a stream is detected and the Video PHY Controller is stabilized for the HDMI 1.4/2.0 Receiver Subsystem to start stream locking.
The callback function needs to perform the following steps:
每次检测到流时都会触发此中断,并且视频PHY控制器稳定,以便HDMI 1.4/2.0接收器子系统启动流锁定。
回调函数需要执行以下步骤:
1. Check the event is for cable connected or cable disconnected.
1.检查事件是否为电缆连接或电缆断开。
XV_HdmiRxSs *HdmiRxSsPtr = (XV_HdmiRxSs *)CallbackRef;
HdmiRxSsPtr->IsStreamConnected
1 – Connected
0 – Disconnected
2. Retrieve the video stream information.
2.检索视频流信息。
XVidC_VideoStream *XV_HdmiRxSs_GetVideoStream(
XV_HdmiRxSs *InstancePtr);
3. Calculate HDMI MMCM parameter based on the video stream information received.
3.根据接收到的视频流信息计算HDMI MMCM参数。
u32 XVphy_HdmiCfgCalcMmcmParam(XVphy *InstancePtr,
u8 QuadId,
XVphy_ChannelId ChId,
XVphy_DirectionType Dir,
XVidC_PixelsPerClock Ppc,
XVidC_ColorDepth Bpc);
4. Enable the Video PHY Controller to start MMCM.
4.启用视频PHY控制器以启动MMCM。
XVphy_MmcmStart(&Vphy, 0, XVPHY_DIR_RX);
XV_HDMIRXSS_HANDLER_HDCP_AUTHENTICATE
If HDCP 1.4 or HDCP 2.2 is enabled in the HDMI 1.4/2.0 Receiver Subsystem hardware, this interrupt is triggered when HDCP passes its authentication state.
The callback function can update HDCP authentication status to the application software.
如果HDMI 1.4/2.0接收器子系统硬件中启用了HDCP 1.4或HDCP 2.2,则当HDCP通过其身份验证状态时会触发此中断。
回调函数可以更新应用软件的HDCP身份验证状态。
Video PHY Controller Interrupt Handlers for HDMI 1.4/2.0 Receiver Subsystem
There are several interrupt handlers available in the Video PHY Controller driver to hook up with user-defined callback functions to support HDMI 1.4/2.0 Receiver Subsystem functionality. These interrupt handlers are defined in xvphy.h:
HDMI 1.4/2.0接收机子系统的视频PHY控制器中断处理器
视频PHY控制器驱动程序中有几个中断处理程序可用于连接用户定义的回调函数,以支持HDMI 1.4/2.0接收器子系统功能。这些中断处理程序在xvphy.h中定义:
• XVPHY_HDMI_HANDLER_RXINIT
• XVPHY_HDMI_HANDLER_RXREADY
Callback functions need to be defined in the application code and hooked up with these interrupt handlers.
回调函数需要在应用程序代码中定义,并与这些中断处理程序连接。
void XVphy_SetHdmiCallback(XVphy *InstancePtr,
XVphy_HdmiHandlerType HandlerType,
void *CallbackFunc,
void *CallbackRef);
XVPHY_HDMI_HANDLER_RXINIT
This interrupt is triggered every time the Video PHY Controller detects an HDMI RX reference clock changes.
The callback function needs to perform the following:
每当视频PHY控制器检测到HDMI RX参考时钟改变时,就会触发此中断。
回调函数需要执行以下操作:
1.初始化HDMI 1.4/2.0接收机子系统的基准时钟更改过程。
1. Initialize a reference clock change process for an HDMI 1.4/2.0 Receiver Subsystem.
void XV_HdmiRxSs_RefClockChangeInit(XV_HdmiRxSs *InstancePtr);
2. Set Video PHY Controller HDMI RX reference TMDS clock ratio.
2.设置视频PHY控制器HDMI RX参考TMDS时钟比率。
VphyPtr->HdmiRxTmdsClockRatio = HdmiRxSs.TMDSClockRatio;
XVPHY_HDMI_HANDLER_RXREADY
This interrupt is triggered every time the Video PHY Controller RX reset lock is done.
The callback function needs to perform the following:
每次完成视频PHY控制器RX重置锁定时,都会触发此中断。
回调函数需要执行以下操作:
1.检查视频PHY控制器PLL类型。
1. Check the Video PHY Controller PLL Type.
XVphy_PllType XVphy_GetPllType(XVphy *InstancePtr,
u8 QuadId,
XVphy_DirectionType Dir,
XVphy_ChannelId ChId);
2. Set the HDMI 1.4/2.0 Receiver Subsystem Video Stream according to the PLL type.
2.根据PLL类型设置HDMI 1.4/2.0接收机子系统视频流。
XV_HdmiRxSs_SetStream(XV_HdmiRxSs *InstancePtr,
u32 Clock,
u32 LineRate);
Where both Clock and LineRate are from Video PHY Controller data structure.
其中Clock和LineRate都来自Video PHY Controller数据结构。
Follow the steps in Chapter 5, Example Design to create an example design, which contains all the procedures implemented and can serve as a reference for integrating the HDMI 1.4/2.0 Receiver Subsystem into your system.
按照第5章“示例设计”中的步骤创建一个示例设计,其中包含所有实现的程序,可以作为将HDMI 1.4/2.0接收机子系统集成到您的系统中的参考。
Example Use Cases
In this section, some typical use cases are illustrated with how system reacts at run time to certain events and what is expected for you to perform. For actions expected in the callback functions, see Application Callback Functions for more information.
示例用例
在本节中,一些典型的用例演示了系统在运行时如何对某些事件作出反应,以及期望您执行什么。有关回调函数中预期的操作,请参阅应用程序回调函数以获取更多信息。
Use Case 1: Cable Plug In
HPD interrupt is received indicating Cable Connection.
• Callback function registered to XV_HDMIRXSS_HANDLER_CONNECT Interrupt type is called.
用例1:电缆插件
收到HPD中断,指示电缆连接。
•调用注册到XV_HDMIRXSS_HANDLER_CONNECT中断类型的回调函数。
Use Case 2: Cable Plug Out
1. RX Stream Down interrupt is received.
° Callback function registered to XV_HDMIRXSS_HANDLER_STREAM_DOWN interrupt type is called.
2. HPD interrupt is received indicating Cable Disconnection.
° Callback function registered to XV_HDMIRXSS_HANDLER_CONNECT Interrupt type is called.
用例2:电缆插头
1.接收到RX Stream Down中断。
°调用注册到XV_HDMIRXSS_HANDLER_STREAM_DOWN中断类型的回调函数。
2.收到HPD中断,指示电缆断开。
°调用注册到XV_HDMIRXSS_HANDLER_CONNECT中断类型的回调函数。
Use Case 3: Received Video Stream
1. Video PHY Controller HDMI RX Init interrupt is received.
° Callback function registered to XVPHY_HDMI_HANDLER_RXINIT Interrupt type is called.
2. Video PHY Controller HDMI RX Ready interrupt is received.
° Callback function registered to XVPHY_HDMI_HANDLER_RXREADY Interrupt type is called.
3. RX Audio Interrupt is received.
° Callback function registered to XV_HDMIRXSS_HANDLER_AUD Interrupt type is called.
4. RX Stream Initialization Interrupt is received.
用例3:接收的视频流
1.接收到视频PHY控制器HDMI RX初始化中断。
°调用注册到XVPHY_HDMI_HANDLER_RXINIT中断类型的回调函数。
2.接收到视频PHY控制器HDMI RX Ready中断。
°调用注册到XVPHY_HDMI_HANDLER_RXREADY中断类型的回调函数。
3.接收到RX音频中断。
°调用注册到XV_HDMIRXSS_HANDLER_AUD中断类型的回调函数。
4.接收到RX流初始化中断。
° Callback function registered to XV_HDMIRXSS_HANDLER_STREAM_INIT Interrupt type is called.
5. When Video stream is locked, the RX stream up interrupt is received.
° Callback function registered to XV_HDMIRXSS_HANDLER_STREAM_UP Interrupt type is called.
Now, the video stream has been detected and you can retrieve the stream information using the provided API:
XVidC_VideoStream *XV_HdmiRxSs_GetVideoStream(
XV_HdmiRxSs *InstancePtr);
Use Case 4: Video Stream Change
1. RX Stream Down interrupt is received.
° Callback function registered to XV_HDMIRXSS_HANDLER_STREAM_DOWN interrupt type is called.
2. Video PHY Controller HDMI RX Init interrupt is received.
° Callback function registered to XVPHY_HDMI_HANDLER_RXINIT Interrupt type is called.
3. Video PHY Controller HDMI RX Ready interrupt is received.
° Callback function registered to XVPHY_HDMI_HANDLER_RXREADY Interrupt type is called.
4. RX Audio Interrupt is received.
° Callback function registered to XV_HDMIRXSS_HANDLER_AUD Interrupt type is called.
5. RX Stream Initialization Interrupt is received.
° Callback function registered to XV_HDMIRXSS_HANDLER_STREAM_INIT Interrupt type is called.
6. When Video stream is locked, the RX stream up interrupt is received.
° Callback function registered to XV_HDMIRXSS_HANDLER_STREAM_UP Interrupt type is called.
Now, the video stream has been detected and you can retrieve the stream information using the provided API:
XVidC_VideoStream *XV_HdmiRxSs_GetVideoStream(
XV_HdmiRxSs *InstancePtr);
Use Case 5: Receive Infoframe
The Auxiliary InfoFrame received interrupt is received.
°调用注册到XV_HDMIRXSS_HANDLER_STREAM_INIT中断类型的回调函数。
5.当视频流被锁定时,接收到RX流上行中断。
°调用注册到XV_HDMIRXSS_HANDLER_STREAM_UP中断类型的回调函数。
现在,已检测到视频流,您可以使用提供的API检索流信息:
XVidC_VideoStream*XV_AdmiRxSs_获取视频流(
XV_AdmiRxSs*实例Ptr);
用例4:视频流更改
1.接收到RX Stream Down中断。
°调用注册到XV_HDMIRXSS_HANDLER_STREAM_DOWN中断类型的回调函数。
2.接收到视频PHY控制器HDMI RX初始化中断。
°调用注册到XVPHY_HDMI_HANDLER_RXINIT中断类型的回调函数。
3.接收到视频PHY控制器HDMI RX Ready中断。
°调用注册到XVPHY_HDMI_HANDLER_RXREADY中断类型的回调函数。
4.接收到RX音频中断。
°调用注册到XV_HDMIRXSS_HANDLER_AUD中断类型的回调函数。
5.接收到RX流初始化中断。
°调用注册到XV_HDMIRXSS_HANDLER_STREAM_INIT中断类型的回调函数。
6.当视频流被锁定时,接收到RX流上行中断。
°调用注册到XV_HDMIRXSS_HANDLER_STREAM_UP中断类型的回调函数。
现在,已检测到视频流,您可以使用提供的API检索流信息:
XVidC_VideoStream*XV_AdmiRxSs_获取视频流(
XV_AdmiRxSs*实例Ptr);
用例5:接收信息帧
接收到辅助信息帧接收的中断。
Callback function registered to XV_HDMIRXSS_HANDLER_AUX Interrupt type is called.
Use Case 6: How to Disable Internal EDID
If you do not want to enable the internal EDID support, you can comment out the function XV_HdmiRx_DdcLoadEdid in xv_hdmirxss_coreinit.c, under function call.
调用注册到XV_HDMIRXSS_HANDLER_AUX中断类型的回调函数。
用例6:如何禁用内部EDID
如果不想启用内部EDID支持,可以注释掉XV_hdmirxss_coreinit中的函数XV_AdmiRx_DdcLoadEdid。c、在函数调用下。
int XV_HdmiRxSs_SubcoreInitHdmiRx(XV_HdmiRxSs *HdmiRxSsPtr)
Example:
// Load EDID
// XV_HdmiRx_DdcLoadEdid(HdmiRxSsPtr->HdmiRxPtr, HdmiRxSsPtr->EdidPtr,
// HdmiRxSsPtr->EdidLength);
没有回复内容