结构体的应用

来源:互联网 发布:淘宝宝贝详情怎么做的 编辑:程序博客网 时间:2024/05/16 14:41
typedef enum eExVideoInTypeTag{CH7026_480P_50,CH7026_480P_60}eExVideoInType;typedef struct tExVideoRegCfgListTag {BYTE addr;BYTE cont;}tExVideoRegCfgList;typedef struct tExVideoCfgIndexTag {tExVideoRegCfgList const * pRegCfgList;BYTE size;}tExVideoCfgIndex;static tExVideoRegCfgList const aCh7026_PAL_D[] = {{ 0x00, 0x54 },{ 0x01, 0x00 },{ 0x02, 0x03 },{ 0x03, 0x00 },{ 0x04, 0x00 },{ 0x05, 0x08 },{ 0x06, 0x70 },{ 0x07, 0x1F },{ 0x08, 0x00 },{ 0x09, 0x00 },{ 0x0A, 0x00 },{ 0x0B, 0x00 },{ 0x0C, 0x50 },{ 0x0D, 0x83 },};static tExVideoRegCfgList const aCh7026_PAL_M[] = {{ 0x02, 0x03},{ 0x03, 0x00},{ 0x04, 0x00},{ 0x05, 0x08},{ 0x06, 0x70},{ 0x07, 0x1F},{ 0x08, 0x00},{ 0x09, 0x00},{ 0x0A, 0x00},{ 0x0B, 0x00},{ 0x0C, 0x50},{ 0x0D, 0x83},};static tExVideoCfgIndex const aExVideoCfgTab[] = {{ aCh7026_PAL_M, sizeof(aCh7026_PAL_M)/sizeof(aCh7026_PAL_M[0]), },{ aCh7026_PAL_D,  sizeof(aCh7026_PAL_D)/sizeof(aCh7026_PAL_D[0]), },};#if 0static eExVideoInType eExVideoType = CH7026_480P_50;//for PAL_M#elsestatic eExVideoInType eExVideoType = CH7026_480P_60;//for PAL_D#endif#endiffor( ; i < aExVideoCfgTab[eExVideoType].size; ++i ){addr = aExVideoCfgTab[eExVideoType].pRegCfgList[i].addr;cont = aExVideoCfgTab[eExVideoType].pRegCfgList[i].cont;MDrv_IIC_WriteByte(EXVIDEO_CHIP_ID, addr, cont);}

0 0