ov9281

问题描述

我正在尝试编写一个裸机应用程序,以使用 ov9281 相机在 VGA 显示器上流式传输图像。 This is my Hardware design。 我对 ov5640 相机 (PCAM) 使用了相同的设计。 到目前为止,我能够使用裸机应用程序配置 ov5640 和 Steam 数据。我知道必须按照下面显示的方式配置寄存器。

static u32  cfg_init [][2]  = {
//[7]=0 Software reset; [6]=1 Software power down; Default=0x02
{0x3008,0x42},//[1]=1 System input clock from PLL; Default read = 0x11
{0x3103,0x03},//[3:0]=0000 MD2P,MD2N,MCP,MCN input; Default=0x00
{0x3017,0x00},//[7:2]=000000 MD1P,MD1N,D3:0 input; Default=0x00
{0x3018,//[6:4]=001 PLL charge pump,[3:0]=1000 MIPI 8-bit mode
{0x3034,0x18},//PLL1 configuration
//[7:4]=0001 System clock divider /1,[3:0]=0001 Scale divider for MIPI /1
{0x3035,0x11},//[7:0]=56 PLL multiplier
{0x3036,0x38},//[4]=1 PLL root divider /2,[3:0]=1 PLL pre-divider /1
{0x3037,//[5:4]=00 PCLK root divider /1,[3:2]=00 SCLK2x root divider /1,[1:0]=01 SCLK root divider /2
{0x3108,0x01},//PLL2 configuration
//[5:4]=01 PRE_DIV_SP /1.5,[2]=1 R_DIV_SP /1,[1:0]=00 DIV12_SP /1
{0x303D,0x10},//[4:0]=11001 PLL2 multiplier DIV_CNT5B = 25
{0x303B,0x19},{0x3630,0x2e},{0x3631,0x0e},{0x3632,0xe2},{0x3633,0x23},{0x3621,0xe0},{0x3704,0xa0},{0x3703,0x5a},{0x3715,0x78},{0x3717,{0x370b,0x60},{0x3705,0x1a},{0x3905,0x02},{0x3906,{0x3901,0x0a},{0x3731,//VCM debug mode
{0x3600,0x37},{0x3601,0x33},//System control register changing not recommended
{0x302d,//??
{0x3620,0x52},{0x371b,0x20},//?? DVP
{0x471c,0x50},{0x3a13,0x43},{0x3a18,{0x3a19,0xf8},{0x3635,0x13},{0x3636,0x06},{0x3634,0x44},{0x3622,{0x3c01,0x34},{0x3c04,0x28},{0x3c05,0x98},{0x3c06,{0x3c07,0x08},{0x3c08,{0x3c09,0x1c},{0x3c0a,0x9c},{0x3c0b,0x40},//[7]=1 color bar enable,[3:2]=00 eight color bar
{0x503d,//[2]=1 ISP vflip,[1]=1 sensor vflip
{0x3820,0x46},//[7:5]=010 Two lane mode,[4]=0 MIPI HS TX no power down,[3]=0 MIPI LP RX no power down,[2]=1 MIPI enable,[1:0]=10 Debug mode; Default=0x58
{0x300e,0x45},//[5]=0 Clock free running,[4]=1 Send line short packet,[3]=0 Use lane1 as default,[2]=1 MIPI bus LP11 when no packet; Default=0x04
{0x4800,0x14},{0x302e,//[7:4]=0x3 YUV422,[3:0]=0x0 YUYV
//{0x4300,0x30},//[7:4]=0x6 RGB565,[3:0]=0x0 {b[4:0],g[5:3],g[2:0],r[4:0]}
{0x4300,0x6f},{0x501f,{0x4713,{0x4407,0x04},{0x440e,{0x460b,0x35},//[1]=0 DVP PCLK divider manual control by 0x3824[4:0]
{0x460c,//[4:0]=1 SCALE_DIV=INT(3824[4:0]/2)
{0x3824,//MIPI timing
//      {0x4805,//LPX global timing select=auto
//      {0x4818,//hs_prepare + hs_zero_min ns
//      {0x4819,0x96},//      {0x482A,//hs_prepare + hs_zero_min UI
//
//      {0x4824,//lpx_p_min ns
//      {0x4825,0x32},//      {0x4830,//lpx_p_min UI
//
//      {0x4826,//hs_prepare_min ns
//      {0x4827,//      {0x4831,//hs_prepare_min UI

//[7]=1 LENC correction enabled,[5]=1 RAW gamma enabled,[2]=1 Black pixel cancellation enabled,[1]=1 White pixel cancellation enabled,[0]=1 Color interpolation enabled
{0x5000,0x07},//[7]=0 Special digital effects,[5]=0 scaling,[2]=0 UV average disabled,[1]=1 Color matrix enabled,[0]=1 Auto white balance enabled
{0x5001,0x03}};

    static u32  cfg_simple_awb[][2] = {
        // Disable Advanced AWB
        {0x518d,{0x518f,{0x518e,{0x5190,{0x518b,{0x518c,{0x5187,{0x5188,{0x5189,{0x518a,{0x5186,{0x5181,0x58},{0x5184,0x25},{0x5182,// Enable simple AWB
    {0x3406,{0x5183,0x80},{0x5191,0xff},{0x5192,{0x5001,0x03}
};


static u32  cfg_720p_60fps[][2] =
{//1280 x 720 binned,RAW10,MIPISCLK=280M,SCLK=56Mz,PCLK=56M
        //PLL1 configuration
        {0x3008,//[7:4]=0010 System clock divider /2,[3:0]=0001 Scale divider for MIPI /1
        {0x3035,0x21},//[7:0]=70 PLL multiplier
        {0x3036,//[4]=0 PLL root divider /1,[3:0]=5 PLL pre-divider /1.5
        {0x3037,0x05},//[5:4]=01 PCLK root divider /2,[1:0]=01 SCLK root divider /2
        {0x3108,[3:0]=1010 MIPI 10-bit mode
        {0x3034,0x1A},//[3:0]=0 X address start high byte
        {0x3800,(0 >> 8) & 0x0F},//[7:0]=0 X address start low byte
        {0x3801,0 & 0xFF},//[2:0]=0 Y address start high byte
        {0x3802,(8 >> 8) & 0x07},//[7:0]=0 Y address start low byte
        {0x3803,8 & 0xFF},//[3:0] X address end high byte
        {0x3804,(2619 >> 8) & 0x0F},//[7:0] X address end low byte
        {0x3805,2619 & 0xFF},//[2:0] Y address end high byte
        {0x3806,(1947 >> 8) & 0x07},//[7:0] Y address end low byte
        {0x3807,1947 & 0xFF},//[3:0]=0 timing hoffset high byte
        {0x3810,//[7:0]=0 timing hoffset low byte
        {0x3811,//[2:0]=0 timing voffset high byte
        {0x3812,(0 >> 8) & 0x07},//[7:0]=0 timing voffset low byte
        {0x3813,//[3:0] Output horizontal width high byte
        {0x3808,(1280 >> 8) & 0x0F},//[7:0] Output horizontal width low byte
        {0x3809,1280 & 0xFF},//[2:0] Output vertical height high byte
        {0x380a,(720 >> 8) & 0x7F},//[7:0] Output vertical height low byte
        {0x380b,720 & 0xFF},//HTS line exposure time in # of pixels
        {0x380c,(1896 >> 8) & 0x1F},{0x380d,1896 & 0xFF},//VTS frame exposure time in # lines
        {0x380e,(984 >> 8) & 0xFF},{0x380f,984 & 0xFF},//[7:4]=0x3 horizontal odd subsample increment,[3:0]=0x1 horizontal even subsample increment
        {0x3814,0x31},//[7:4]=0x3 vertical odd subsample increment,[3:0]=0x1 vertical even subsample increment
        {0x3815,//[2]=0 ISP mirror,[1]=0 sensor mirror,[0]=1 horizontal binning
        {0x3821,//little MIPI shit: global timing unit,period of PCLK in ns * 2(depends on # of lanes)
        {0x4837,36},// 1/56M*2

        //Undocumented anti-green settings
        {0x3618,// Removes vertical lines appearing under bright light
        {0x3612,0x59},{0x3708,0x64},{0x3709,{0x370c,//[7:4]=0x0 Formatter RAW,[3:0]=0x0 BGBG/GRGR
        {0x4300,//[2:0]=0x3 Format select ISP RAW (DPC)
        {0x501f,{0x3008,};

static u32  cfg_1080p_30fps[][2] =
{//1920 x 1080 @ 30fps,MIPISCLK=672,SCLK=67.2MHz,PCLK=134.4M
        //PLL1 configuration
        {0x3008,///PLL1 configuration
        //[7:4]=0010 System clock divider /2,// 30fps setting
        //[7:0]=105 PLL multiplier
        {0x3036,0x69},(336 >> 8) & 0x0F},336 & 0xFF},(426 >> 8) & 0x07},426 & 0xFF},(2287 >> 8) & 0x0F},2287 & 0xFF},(1529 >> 8) & 0x07},1529 & 0xFF},(16 >> 8) & 0x0F},16 & 0xFF},(12 >> 8) & 0x07},12 & 0xFF},(1920 >> 8) & 0x0F},1920 & 0xFF},(1080 >> 8) & 0x7F},1080 & 0xFF},//HTS line exposure time in # of pixels Tline=HTS/sclk
        {0x380c,(2500 >> 8) & 0x1F},2500 & 0xFF},(1120 >> 8) & 0xFF},1120 & 0xFF},//[7:4]=0x1 horizontal odd subsample increment,//[7:4]=0x1 vertical odd subsample increment,[0]=0 no horizontal binning
        {0x3821,24},// 1/84M*2

        //Undocumented anti-green settings
        {0x3618,0x02}

        /*[7:4]=0x0 Formatter RAW,0x03}*/
}

但是这个 ov5640 的驱动是可用的,我不知道如何为 ov9281 编写这个。

有人可以帮我吗?

非常感谢任何帮助,我已经在各种论坛上问过这个问题,但到目前为止没有任何帮助。 提前致谢!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...