📄 t515.c
字号:
#include <reg51.h>
#include "math.h"
#include "common.h"
#include "system.h"
#include "T803_Util.h"
#include "TW803Reg.h"
#include "twowire.h"
#define __GLOBAL_H__
#include "Global.h"
#include "src_ctrl.h"
#ifdef TW515
#include "T515.h"
#define __INIT_H__
#include "init.h"
void Init_T515(void)
{
I2CWriteByte(TW515, 0xE0, 0xB0);
I2CWriteByte(TW515, 0x00, 0x00);
I2CWriteByte(TW515, 0x01, 0x00);
I2CWriteByte(TW515, 0x0A, 0x60);
I2CWriteByte(TW515, 0x0B, 0x60);
I2CWriteByte(TW515, 0x0D, 0x20);
I2CWriteByte(TW515, 0x1A, 0x87);
I2CWriteByte(TW515, 0x0F, 0x02);
I2CWriteByte(TW515, 0x11, 0x02);
I2CWriteByte(TW515, 0x28, 0x50);
I2CWriteByte(TW515, 0x29, 0x20); //0x50 0x20 2005 02 23 if too high color will blind
I2CWriteByte(TW515, 0x2A, 0x78); //0x50 0x78 2005 02 23
I2CWriteByte(TW515, 0x2B, 0x00);
I2CWriteByte(TW515, 0x2c, 0x80); //0x50 0x80 2005 02 23 if too high color will blind
I2CWriteByte(TW515, 0x2f, 0x0c);
I2CWriteByte(TW515, 0xD1, 0xc8);
I2CWriteByte(TW515, 0xD2, 0x27);
I2CWriteByte(TW515, 0x04, 0x2f);
I2CWriteByte(TW515, 0xa0, 0x05);
I2CWriteByte(TW515, 0x5f, 0x00);
I2CWriteByte(TW515, 0x30, 0x27);
I2CWriteByte(TW515, 0x1A, 0x87);
I2CWriteByte(TW515, 0x22, 0x4B);
I2CWriteByte(TW515, 0x27, 0x22);
I2CWriteByte(TW515, 0x1C, 0xe7);
}
void SRC_656(void)
{
Init_T515();
I2CWriteByte(TW803_P0, 0x30, 0x02);
I2CWriteByte(TW803_P0, 0x31, 0x10);
I2CWriteByte(TW803_P0, 0x40, 0x00);
I2CWriteByte(TW803_P1, 0xdf, 0x0c);
switch_T515();
I2CWriteByte(TW803_P0,0xc2, 00);
I2CWriteByte(TW803_P0,0x88, 00);
I2CWriteByte(TW803_P0,0x89, 00);
I2CWriteByte(TW803_P0,0x8a, 00);
I2CWriteByte(TW803_P0,0x8b, 00);
}
void switch_T515()
{
T515_NTSC_PAL();
if((uiaSrcMux1[EepPublic.cSource].Ext_VD_Type==itypeCVBS))
{
I2CWriteByte(TW515, 0x18, 0x00);
I2CWriteByte(TW515, 0x19, 0x04);
I2CWriteByte(TW515, 0x11, 0x00);
I2CWriteByte(TW515, 0x23, 0x00);
I2CWriteByte(TW515, 0x27, 0x21);
I2CWriteByte(TW515, 0x20,I2CReadByte(TW515, 0x20)&0xFE);
}
else if((uiaSrcMux1[EepPublic.cSource].Ext_VD_Type==itypeSVIDEO))
{
I2CWriteByte(TW515, 0x18, 0x05);
I2CWriteByte(TW515, 0x19, 0x01);
I2CWriteByte(TW515, 0x11, 0x02);
I2CWriteByte(TW515, 0x20,I2CReadByte(TW515, 0x20)|0x01);
I2CWriteByte(TW515, 0x23, 0x03);
I2CWriteByte(TW515, 0x27, 0x25);
I2CWriteByte(TW515, 0x21,I2CReadByte(TW515, 0x21)|0x10);
}
}
void T515_NTSC_PAL(void)
{
if(m_cStandard==S_NTSC){//NTSC
I2CWriteByte(TW803_P1, 0xDb, 0xf4);//0xf0); // change by Sherman 06'01'03
I2CWriteByte(TW803_P1, 0xDc, 0x00);
I2CWriteByte(TW515, 0x38, 0x21);
I2CWriteByte(TW515, 0x39, 0xf0);
I2CWriteByte(TW515, 0x3a, 0x7c);
I2CWriteByte(TW515, 0x3b, 0x1f);
I2CWriteByte(TW515, 0x44, 0x00);
I2CWriteByte(TW515, 0x45, 0x08);
I2CWriteByte(TW515, 0x4e, 0x88);
I2CWriteByte(TW515, 0xa2, 0x46);
I2CWriteByte(TW515, 0xC1, 0x2a);
I2CWriteByte(TW515, 0xC2, 0x03);
I2CWriteByte(TW515, 0x50, 0x26);
I2CWriteByte(TW515, 0x51, 0x61);
I2CWriteByte(TW515, 0x20,I2CReadByte(TW515, 0x20)&0x01|0x00);
//I2CWriteByte(TW515, 0x20, 0x00);
I2CWriteByte(TW515, 0x21, 0x09);
}else{
I2CWriteByte(TW803_P1, 0xDb, 0x28);//0x20); // change by Sherman 06'01'03
I2CWriteByte(TW803_P1, 0xDc, 0x01);
I2CWriteByte(TW515, 0x38, 0x2a);
I2CWriteByte(TW515, 0x39, 0x09);
I2CWriteByte(TW515, 0x3a, 0x8a);
I2CWriteByte(TW515, 0x3b, 0xcb);
I2CWriteByte(TW515, 0x44, 0xe9);
I2CWriteByte(TW515, 0x45, 0x0f);
I2CWriteByte(TW515, 0x4e, 0x88);
I2CWriteByte(TW515, 0xa2, 0x52);
I2CWriteByte(TW515, 0xC1, 0x2f);
I2CWriteByte(TW515, 0xC2, 0x03);
I2CWriteByte(TW515, 0x50, 0x2A);
I2CWriteByte(TW515, 0x51, 0xc1);
I2CWriteByte(TW515, 0x20,I2CReadByte(TW515, 0x20)&0x01|0x32);
//I2CWriteByte(TW515, 0x20, 0x32);
I2CWriteByte(TW515, 0x21, 0x08);
}
}
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -