继续中星微301驱动开发

xyxzh   2009-12-22 15:32 楼主
在网上下载了2个版本的中星微linux下的驱动,同样是HV7131b的sensor,两个版本格式却不一样。一个是:
static U16 hv7131bxx_start_data[][3] = {
    {0xA0, 0x01, 0x0000},
    {0xA0, 0x10, 0x0002},
    {0xA0, 0x00, 0x0010},
    {0xA0, 0x01, 0x0001},
    {0xA0, 0x77, 0x0101},
    {0xA0, 0x03, 0x0008},        //00
    {0xA0, 0x03, 0x0012},
    {0xA0, 0x01, 0x0012},
    {0xA0, 0x02, 0x0003},
    {0xA0, 0x80, 0x0004},
    {0xA0, 0x01, 0x0005},
    {0xA0, 0xE0, 0x0006},
    {0xA0, 0x00, 0x0098},
    {0xA0, 0x00, 0x009A},
    {0xA0, 0x00, 0x011A},
    {0xA0, 0x00, 0x011C},
    {0xA0, 0x30, 0x0092},
    {0xA0, 0x2D, 0x0093},
    {0xA0, 0x00, 0x0094},
    {0xA0, 0x01, 0x0090},
   .........
};
一种是
__u8 HV7131B_Initial[]={
        0x00,0x00,0x01,0xcc,0x00,0x02,0x00,0xcc,0x00,0x10,0x00,0xcc,0x00,0x01,0x01,0xcc,0x01,0x01,0x77,0xcc,
        0x00,0x08,0x03,0xcc,0x00,0x12,0x03,0xcc,0x00,0x12,0x01,0xcc,0x00,0x03,0x02,0xcc,0x00,0x04,0x80,0xcc,
        0x00,0x05,0x01,0xcc,0x00,0x06,0xe0,0xcc,0x00,0x98,0x00,0xcc,0x00,0x9a,0x00,0xcc,0x01,0x1a,0x00,0xcc,
        0x01,0x1c,0x00,0xcc,0x00,0x30,0x2d,0xaa,0x00,0x01,0x05,0xaa,0x00,0x02,0x80,0xaa,0x00,0x11,0x00,0xaa,
        0x00,0x13,0x00,0xaa,0x00,0x14,0x01,0xaa,0x00,0x15,0xe6,0xaa,0x00,0x16,0x02,0xaa,0x00,0x17,0x86,0xaa,
        0x00,0x31,0x38,0xaa,0x00,0x32,0x38,0xaa,0x00,0x33,0x38,0xaa,0x00,0x5b,0x01,0xaa,0x00,0x19,0x00,0xcc,
        0x00,0x12,0x05,0xcc,0x01,0x00,0x0d,0xcc,0x01,0x8d,0x70,0xcc,0x01,0xa8,0x60,0xcc,0x01,0x9b,0xc0,0xcc,
        0x01,0x9c,0xa0,0xcc,0x01,0x88,0x02,0xcc,0x01,0x89,0x06,0xcc,0x01,0xc5,0x03,0xcc,0x01,0xcb,0x13,0xcc,
        0x02,0x50,0x08,0xcc,0x03,0x01,0x08,0xcc
};



都是HV7131  CMOS图像传感器的初始化。谁能给解释一下两种格式啊?谢谢!

回复评论 (11)

帮顶下。
点赞  2009-12-22 18:53
谢谢楼上的
点赞  2009-12-23 09:08
没用过HV7131,姑且猜一下,是否也是I2C接口。第一种格式,看上去像I2C地址+寄存器地址+寄存器值,第二种有点诡异,一排0xCC、0xAA,分隔符?等待时间?还是要看明白相关的代码
点赞  2009-12-23 09:33
这两个的定义也不一样啊,会不会功能根本就不是同一回事?
static U16 hv7131bxx_start_data[][3]
__u8 HV7131B_Initial[]
从变量名称来看,一个是启动数据,一个是初始化数据,查查其对应的功能。
点赞  2009-12-24 12:51
我看了一下,两个实现的功能是一样的。就是不知道什么意思。O(∩_∩)O
点赞  2009-12-24 14:43
有没有datasheet之类的资料供参考?
点赞  2009-12-27 16:36
有中星微的datasheet,也有sensor的资料,呵呵,我看不懂。只好一点点的猜了
点赞  2009-12-28 16:03
还有个问题问大家:不知道下面这些表示什么意思?
enum {
    SensorId = 0,
    reg8d,
    val8d,
    SensorReg1,
    valSreg1L,
    valSreg1H,
    SensorReg2,
    valSreg2L,
    valSreg2H,
    totval,
};

static U8 zcxxi2cSensorSIF[1][totval] = {

{0x0f, 0x8d, 0x08, 0x03, 0xaa, 0x00, 0xff, 0xff, 0xff},
};

这些是linux下面摄像头的驱动。
zcxxi2cSensorSIF的意思是传感器的分辨率?那里面的值0x0f, 0x8d。。。又是什么那?
实在不明白。


点赞  2009-12-28 16:08
在zc3xx.h里有
enum {
    SensorId = 0,
    reg8d,
    val8d,
    SensorReg1,
    valSreg1L,
    valSreg1H,
    SensorReg2,
    valSreg2L,
    valSreg2H,
    totval,
};
#define VGATOT 9
static U8 zcxxi2cSensor[VGATOT][totval] = {
    {0x00, 0xff, 0xff, 0x01, 0xaa, 0x00, 0xff, 0xff, 0xff},        // HV7131B
    {0x04, 0xff, 0xff, 0x01, 0xaa, 0x00, 0xff, 0xff, 0xff},        // CS2102
    {0x06, 0x8d, 0x08, 0x11, 0xaa, 0x00, 0xff, 0xff, 0xff},
    {0x08, 0xff, 0xff, 0x1c, 0x00, 0x00, 0x15, 0xaa, 0x00},        // HDCS2020 ?
    {0x0a, 0xff, 0xff, 0x07, 0xaa, 0xaa, 0xff, 0xff, 0xff},        // MI330 PB330
    {0x0c, 0xff, 0xff, 0x01, 0xaa, 0x00, 0xff, 0xff, 0xff},        // ICM105
    {0x0e, 0x8d, 0x08, 0x03, 0xaa, 0x00, 0xff, 0xff, 0xff},        // pas102
    {0x02, 0xff, 0xff, 0x01, 0xaa, 0x00, 0xff, 0xff, 0xff},
    {0x06, 0x8b, 0xa1, 0x12, 0x80, 0x00, 0x0a, 0x0b, 0xff},        // OV7630c
};

#define SIFTOT 1
static U8 zcxxi2cSensorSIF[SIFTOT][totval] = {
#if 0
    {0x01, 0xff, 0xff, 0x01, 0xaa, 0x00, 0xff, 0xff, 0xff},        // corrupt with 0x00 hv7131b reg 0 return 0x01 readonly
    {0x05, 0xff, 0xff, 0x01, 0xaa, 0x00, 0xff, 0xff, 0xff},
    {0x07, 0x8d, 0x08, 0x11, 0xaa, 0x00, 0xff, 0xff, 0xff},
    {0x09, 0xff, 0xff, 0x1c, 0x00, 0x00, 0x15, 0xaa, 0x00},        // corrupt with 0x08 hdcs2020 reg 0 return 0x18 readonly
    {0x0b, 0xff, 0xff, 0x07, 0xaa, 0xaa, 0xff, 0xff, 0xff},
    {0x0d, 0xff, 0xff, 0x01, 0x11, 0x00, 0xff, 0xff, 0xff},        // corrupt with 0x0c ICM105 reg 0 is writable
#endif
    {0x0f, 0x8d, 0x08, 0x03, 0xaa, 0x00, 0xff, 0xff, 0xff},        // PAS106 reg3 did not write with 0x0e !conflict PAS102

};
static U8 zcxx3wrSensor[][5] = {   //3 wire bus
    {0x8b, 0xb3, 0x11, 0x12, 0xff},        // HV7131R
    {0x8b, 0x91, 0x14, 0x15, 0x16},
    {0x8b, 0xe0, 0x14, 0x15, 0x16},
    {0, 0, 0, 0, 0}
};
里面的值指的是cmos sensor的什么那???

点赞  2009-12-29 10:00
请问下楼主这个弄明白了吗?
点赞  2011-6-8 10:38
我想请教下HV7131怎么修改它的分辨率啊?把他设成SIF mode
点赞  2011-6-8 10:39
电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 京公网安备 11010802033920号
    写回复