海思CEA-861时序配置

配置时序
在sample中只需要设置为User时序即可,如下图:

用户时序的结构体:

typedef struct tagVO_SYNC_INFO_S

{

HI_BOOL  bSynm;     /* sync mode(0:timing,as BT.656; 1:signal,as LCD) */

HI_BOOL  bIop;      /* interlaced or progressive display(0:i; 1:p) */

HI_U8    u8Intfb;   /* interlace bit width while output */



HI_U16   u16Vact ;  /* vertical active area */

HI_U16   u16Vbb;    /* vertical back blank porch */

HI_U16   u16Vfb;    /* vertical front blank porch */



HI_U16   u16Hact;   /* herizontal active area */

HI_U16   u16Hbb;    /* herizontal back blank porch */

HI_U16   u16Hfb;    /* herizontal front blank porch */



HI_U16   u16Hmid;   /* bottom herizontal active area */



HI_U16   u16Bvact;  /* bottom vertical active area */

HI_U16   u16Bvbb;   /* bottom vertical back blank porch */

HI_U16   u16Bvfb;   /* bottom vertical front blank porch */



HI_U16   u16Hpw;    /* horizontal pulse width */

HI_U16   u16Vpw;    /* vertical pulse width */



HI_BOOL  bIdv;      /* inverse data valid of output */

HI_BOOL  bIhs;      /* inverse horizontal synch signal */

HI_BOOL  bIvs;      /* inverse vertical synch signal */

} VO_SYNC_INFO_S;

如SDK中默认的PAL时序:

{0,0,0, 288,22,2 ,720,132,12, 1, 288,23,2, 126,3, 0,0,0}

上面部分属性,与显示通道的总体控制寄存器DHDCTRL(0x205ca000)是对应的。

常用到的属性是如下:

这里u16Vbb在隔行输出时是指顶场垂直消隐后肩,逐行输出时:垂直消隐后肩加垂直脉冲的宽度,单位是行。u16Vfb与u16Vbb对应,指的是前肩,两者加在一起的和应该一个定值的。u16Hbb是水平消隐后肩,u16Hfb是水平消隐前肩,单位为像素,两者加起来的和也应该是为一定的值。所以我们一般可以通过修改这两对值,来实现画面在一定的范围内,在显示器上的上下左右移动。可以通过接口配置,也可以直接修改寄存器(Vbb和Vfb与DHDVSYNC寄存器0x205ca004对应,Hbb和Hfb与DHDHSYNC1寄存器0x205ca008和DHDHSYNC2寄存器0x205ca00c对应)。

u16Bvbb指隔行输出时,底场垂直消隐后肩,u16Bvfb指隔行输出时,底场垂直消隐前肩,单位为行。这里注意,如果是隔行输出,修改了顶场图像的前后肩,则应该对应修改底场图像的前后肩,否则可能出现图像抖动。

以1080i0HZ为例说明个别参数:
在这里插入图片描述
在这里插入图片描述

底场垂直消隐后肩为垂直消隐+1,底场垂直消隐前肩为垂直消隐前肩,如下图:
在这里插入图片描述

垂直的有效行数等于垂直后肩有效行数,水平有效像素数为1920,底场水平有效像素数为 == 水平像素数-空白像素数)/2 + 偏移像素数, 即((1920-280)/2 +88),如下图

在这里插入图片描述

2、配置时钟

我们以3531为例,在一些特殊分辨率,像640x480@60,在vo设备中没有支持这个时序,但是HDMI有支持这个时序,所以可以用vo的用户时序来实现,只需要配置好上吗的User 时序和HDMI后,配置相应的vo的时钟。就可以正常输出。

表3-3 Hi3531 PLL 与各功能模块对应关系

这里可以看到,对于VDP模块,是由VPLL0或VPLL1来分配时钟。其中注意的是VPLL1会2分频后作为VDP HD/HDMI源时钟

一、这里,首先需要确认的是,当前的芯片,HDMI 时钟源选择。

例如,跑./sample_vio 0 读取寄存器0x20030038,结果如下:

值为:0x02017cfe

对应的第22位的值为0,所以此HDMI时钟选择,为HD0

对应的第17到19位的值为000,所以此HD0的时钟选择为VPLL1 DIV2时钟

所以如果需要配置的时钟为VPLL1。

二,计算VPLL1各个寄存器的值

Hi3531芯片手册中,表3-4列出了方法,这里我举一个例子

以配置VPLL1 为例,VPLL1 输出FOUTPOSTDIV 的2 分频给VDP 模块。

最终的VO时钟是FOUTPOSTDIV = FOUTVCO / (pstdiv1 x pstdiv2);

FOUTVCO = 24 x (fbdiv + frac / 2^24) /refdiv

pstdiv1、pstdiv2、fbdiv、frac和refdiv的值,都将通过配置进寄存器。

这里,refdiv为分频系数,像在配置VPLL1的时候,文档中写到二分频后作为VDP HD/HDMI源时钟。所以refdiv为2.

FOUTVCO的值有要求,应该大于等于800MHz,小于等于2.4GHz。

而frac一般都配置为0

所以需要进行凑的数,就是fbdiv、pstdiv1 和 pstdiv2。

这三个变量的意义如下:

PERI_CRG4(0x20030010)寄存器的

和PERI_CRG5(0x20030014)寄存器的

由上面的值得知,我们在搭配的时候,pstdiv1 和 pstdiv2的取值范围是0到7.

例如当HDMI需要输出640x480@60的时候,需要的时钟是50.4M,

FOUTPOSTDIV = (24 x (fbdiv + frac / 2^24) / refdiv) / (pstdiv1 x pstdiv2)

50.4M = (24 x (84 + 0 / 2^24) / 2) / (4 x 5)

所以fbdiv = 84、frac = 0、refdiv = 2、pstdiv1 = 4,pstdiv2 = 5.

综上,修改的寄存器值为:

将地址为0x20031010的值修改为0x25000000,

地址为0x20030014的值修改为0x006C2054。

这样就配置出了640x480的时钟。

详细见网址:

https://blog.csdn.net/huangyangquan/article/details/77487626

https://www.cnblogs.com/kongqiweiliang/p/3243610.html

https://wenku.baidu.com/view/331f712ca22d7375a417866fb84ae45c3b35c208.html

  • 0
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
This standard was developed under the auspices of the Consumer Electronics Association (CEA) R4.8 DTV Interface Subcommittee. CEA-861-D supersedes CEA-861-C. CEA-861-D establishes protocols, requirements, and recommendations for the utilization of uncompressed digital interfaces by consumer electronics devices such as digital televisions (DTVs), digital cable, satellite or terrestrial set-top boxes (STBs), and related peripheral devices including, but not limited to DVD players/recorders, and other related source or sink devices. CEA-861-D is applicable to a variety of standard DTV-related high-speed digital physical interfaces - such as Digital Visual Interface (DVI) 1.0 [3], Open LVDS Display Interface (LDI) [7], and High-Definition Multimedia Interface (HDMI) [29] specifications. Protocols, requirements, and recommendations that are defined include video formats and waveforms; colorimetry and quantization; transport of compressed and uncompressed, as well as Linear Pulse Code Modulation (LPCM), audio; carriage of auxiliary data; and implementations of the Video Electronics Standards Association (VESA) Enhanced Extended Display Identification Data Standard (E-EDID) [9], which is used by sink devices to declare display capabilities and characteristics. CEA-861-D adopters are strongly encouraged to implement High-bandwidth Digital Content Protection (HDCP) [2] content protection defined by the Digital Content Protection (DCP), LLC) method, in order to be compatible with digital cable STBs as authorized by 47 C.F.R. § 76.602 [27] and 47 C.F.R. §76.640 [28]. HDCP [29] permits viewing of high-value content that may be available from other video sources in a home network.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值