// --========================== FOSVOS GMIC R&D Centre ====================-- // Information contained in this Confidential Proprietary work has been // obtained by FOSVOS CO.LTD // This Software may be used only as authorized by a licensing agreement // from Limited // COPYRIGHT (C) 2006 FOSVOS GMIC R&D Centre // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // www.fosvos.com // Project Information // ---- GM7113GM7221的NTSC配置主程序---- // Project Name :GM7111a // File :main.C // Author :Xiao ShuJian // Date :2007-07-05 // Version :1.0 // Abstract :GM7111a_Test programme. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // // Modification History // // Date By Version Change Description // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // 2007-07-05 Xiao ShuJian 1.0 Init // --===============================END===================================-- /******************************************************************************************** * FOSVOS GM7113\GM7221器件说明: GM7113 GM7221 由上海福跃电子科技有限公司提供芯片销售及免费样片,免费样片申请:Tech@fosvos.com 021-58998693、58994470 ********************************************************************************************/ // --===========================Header files Begin========================-- #include "config.h" #include "GM7111a.h" void IIC_Init(void); void Delay_Ns(uint32 dly); void Delay_Ns_Start(uint32 dly); void IIC_Start(void); void IIC_SendByte(uint8 Byte); uint8 IIC_ReceiveByte(void); void IIC_Stop(void); uint8 IIC_ReceiveByte_Last(void); // --===========================Header files End==========================-- // --=====================================================================-- // ** main function ** // --=====================================================================-- /*说明:每写一次寄存器的过程如下: IIC_Start(); //起动I2C Delay_Ns(2); IIC_SendByte(0x4A); //发7113子地址,Write flag Delay_Ns(2); IIC_SendByte(0x11); //发7113寄存器地址 Delay_Ns(2); IIC_SendByte(0x00); //向7113寄存器写入配置值 Delay_Ns(2); 依次类推 */ // --=====================================================================-- int main (void) { //uint8 i; IIC_Init(); Delay_Ns_Start(10); //Wait for IIC stup //-------------------GM7113 init------------------------------- IIC_Start(); //起动I2C Delay_Ns(2); IIC_SendByte(0x4A); //发7113子地址,Write flag Delay_Ns(2); IIC_SendByte(0x11); //发7113寄存器地址 Delay_Ns(2); IIC_SendByte(0x00); //向7113寄存器写入配置值 Delay_Ns(2); IIC_Start(); //Start Delay_Ns(2); IIC_SendByte(0x4A); //Slave adress,Write flag Delay_Ns(2); IIC_SendByte(0x08); //Sub adress Delay_Ns(2); IIC_SendByte(0x00); //PAL 50Hz IIC_Start(); //Start Delay_Ns(2); IIC_SendByte(0x4A); //Slave adress,Write flag Delay_Ns(2); IIC_SendByte(0x08); //Sub adress Delay_Ns(2); IIC_SendByte(0x98); //PAL 50Hz Delay_Ns(2); IIC_Stop(); //stop Delay_Ns(200000); //延时等待7113初始化 //-------------------GM7113 start------------------------------- IIC_Start(); //Start Delay_Ns(2); IIC_SendByte(0x4A); //Slave adress,Write flag Delay_Ns(2); IIC_SendByte(0x01); //Sub adress Delay_Ns(2); IIC_SendByte(0x08); //data Delay_Ns(2); IIC_Start(); //Start Delay_Ns(2); IIC_SendByte(0x4A); //Slave adress,Write flag Delay_Ns(2); IIC_SendByte(0x02); //Sub adress Delay_Ns(2); IIC_SendByte(0x80); // CVBS=AI11 Delay_Ns(2); IIC_Start(); //Start Delay_Ns(2); IIC_SendByte(0x4A); //Slave adress,Write flag Delay_Ns(2); IIC_SendByte(0x03); //Sub adress Delay_Ns(2); IIC_SendByte(0x33); //data auto gain Delay_Ns(2); IIC_Start(); //Start Delay_Ns(2); IIC_SendByte(0x4A); //Slave adress,Write flag Delay_Ns(2); IIC_SendByte(0x04); //Sub adress Delay_Ns(2); IIC_SendByte(0x00); //data min Delay_Ns(2); IIC_Stop(); IIC_Start(); //Start Delay_Ns(2); IIC_SendByte(0x4A); //Slave adress,Write flag Delay_Ns(2); IIC_SendByte(0x05); //Sub adress Delay_Ns(2); IIC_SendByte(0x00); //data Delay_Ns(2); IIC_Start(); //Start Delay_Ns(2); IIC_SendByte(0x4A); //Slave adress,Write flag Delay_Ns(2); IIC_SendByte(0x06); //Sub adress Delay_Ns(2); IIC_SendByte(0xE9); //data Delay_Ns(2); IIC_Start(); //Start Delay_Ns(2); IIC_SendByte(0x4A); //Slave adress,Write flag Delay_Ns(2); IIC_SendByte(0x07); //Sub adress Delay_Ns(2); IIC_SendByte(0x0D); //data Delay_Ns(2); IIC_Start(); //Start Delay_Ns(2); IIC_SendByte(0x4A); //Slave adress,Write flag Delay_Ns(2); IIC_SendByte(0x09); //Sub adress Delay_Ns(2); IIC_SendByte(0x01); //data Delay_Ns(2); IIC_Start(); //Start Delay_Ns(2); IIC_SendByte(0x4A); //Slave adress,Write flag Delay_Ns(2); IIC_SendByte(0x0A); //Sub adress Delay_Ns(2); IIC_SendByte(0x80); //data Delay_Ns(2); IIC_Start(); //Start Delay_Ns(2); IIC_SendByte(0x4A); //Slave adress,Write flag Delay_Ns(2); IIC_SendByte(0x0B); //Sub adress Delay_Ns(2); IIC_SendByte(0x47); //data Delay_Ns(2); IIC_Start(); //Start Delay_Ns(2); IIC_SendByte(0x4A); //Slave adress,Write flag Delay_Ns(2); IIC_SendByte(0x0C); //Sub adress Delay_Ns(2); IIC_SendByte(0x40); //data Delay_Ns(2); IIC_Start(); //Start Delay_Ns(2); IIC_SendByte(0x4A); //Slave adress,Write flag Delay_Ns(2); IIC_SendByte(0x0D); //Sub adress Delay_Ns(2); IIC_SendByte(0x00); //data Delay_Ns(2); IIC_Start(); //Start Delay_Ns(2); IIC_SendByte(0x4A); //Slave adress,Write flag Delay_Ns(2); IIC_SendByte(0x0E); //Sub adress Delay_Ns(2); IIC_SendByte(0x01); //data Delay_Ns(2); IIC_Start(); //Start Delay_Ns(2); IIC_SendByte(0x4A); //Slave adress,Write flag Delay_Ns(2); IIC_SendByte(0x0F); //Sub adress Delay_Ns(2); IIC_SendByte(0x2A); //data Delay_Ns(2); IIC_Start(); //Start Delay_Ns(2); IIC_SendByte(0x4A); //Slave adress,Write flag Delay_Ns(2); IIC_SendByte(0x10); //Sub adress Delay_Ns(2); IIC_SendByte(0x00); //data Delay_Ns(2); IIC_Start(); //Start Delay_Ns(2); IIC_SendByte(0x4A); //Slave adress,Write flag Delay_Ns(2); IIC_SendByte(0x11); //Sub adress Delay_Ns(2); //IIC_SendByte(0x0E); //ADOUT IIC_SendByte(0x0C); //VPO out Delay_Ns(2); IIC_Start(); //Start Delay_Ns(2); IIC_SendByte(0x4A); //Slave adress,Write flag Delay_Ns(2); IIC_SendByte(0x12); //Sub adress Delay_Ns(2); IIC_SendByte(0xEE); Delay_Ns(2); IIC_Start(); //Start Delay_Ns(2); IIC_SendByte(0x4A); //Slave adress,Write flag Delay_Ns(2); IIC_SendByte(0x13); //Sub adress Delay_Ns(2); IIC_SendByte(0x00); //AOUT connected to input AD1 xsj070914 Delay_Ns(2); IIC_Start(); //Start Delay_Ns(2); IIC_SendByte(0x4A); //Slave adress,Write flag Delay_Ns(2); IIC_SendByte(0x15); //Sub adress Delay_Ns(2); IIC_SendByte(0x00); //data Delay_Ns(2); IIC_Start(); //Start Delay_Ns(2); IIC_SendByte(0x4A); //Slave adress,Write flag Delay_Ns(2); IIC_SendByte(0x16); //Sub adress Delay_Ns(2); IIC_SendByte(0x01); //data Delay_Ns(2); IIC_Start(); //Start Delay_Ns(2); IIC_SendByte(0x4A); //Slave adress,Write flag Delay_Ns(2); IIC_SendByte(0x17); //Sub adress Delay_Ns(2); IIC_SendByte(0x00); //data Delay_Ns(2); IIC_Stop(); //stop //-------------------GM7113 end------------------------------- //-------------------GM7121 start------------------------------- IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x00); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x01); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x02); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x03); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x04); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x05); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x06); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x07); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x08); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x09); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x0A); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x0B); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x0C); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x0D); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x0E); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x0F); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x10); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x11); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x12); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x13); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x14); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x15); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x16); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x17); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x18); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x19); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x1A); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x1B); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x1C); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x1D); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x1E); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x1F); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x20); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x21); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x22); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x23); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x24); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x25); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x26); //Sub adress Delay_Ns(5); IIC_SendByte(0x1D); Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x27); //Sub adress Delay_Ns(5); IIC_SendByte(0x05); //0x85 wide enable Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x28); //Sub adress Delay_Ns(5); IIC_SendByte(0x21); //data HSL 07-08-25 //IIC_SendByte(0x19); //NTSC Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x29); //Sub adress Delay_Ns(5); IIC_SendByte(0x1D); //IIC_SendByte(0x1D); //NTSC Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x2A); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x2B); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x2C); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x2D); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x2E); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x2F); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x30); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x31); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x32); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x33); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x34); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x35); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x36); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x37); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x38); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x39); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x3A); //Sub adress Delay_Ns(5); //IIC_SendByte(0x93); //color strape IIC_SendByte(0x13); //data 主模式 //IIC_SendByte(0x03); //sync from rcv1 and rcv2 从模式 Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x5A); //Sub adress Delay_Ns(5); IIC_SendByte(0x69); //IIC_SendByte(0xFF); //NTSC Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x5B); //Sub adress Delay_Ns(5); IIC_SendByte(0x7D); //data //IIC_SendByte(0x76); //NTSC Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x5C); //Sub adress Delay_Ns(5); IIC_SendByte(0xAF); //data //IIC_SendByte(0xA5); //NTSC Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x5D); //Sub adress Delay_Ns(5); IIC_SendByte(0x3F); //data //IIC_SendByte(0x6A); //NTSC Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x5E); //Sub adress Delay_Ns(5); IIC_SendByte(0x3F); //data //IIC_SendByte(0x6E); //NTSC Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x5F); //Sub adress Delay_Ns(5); IIC_SendByte(0x35); //data //IIC_SendByte(0x2E); //NTSC Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x60); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x61); //Sub adress Delay_Ns(5); IIC_SendByte(0x06); //data //IIC_SendByte(0x15); //NTSC Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x62); //Sub adress Delay_Ns(5); IIC_SendByte(0x2F); //RTCI Enable //IIC_SendByte(0xBF); //NTSC Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x63); //Sub adress Delay_Ns(5); IIC_SendByte(0xCB); //data //IIC_SendByte(0xD6); //NTSC Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x64); //Sub adress Delay_Ns(5); IIC_SendByte(0x8A); //data //IIC_SendByte(0x7B); //NTSC Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x65); //Sub adress Delay_Ns(5); IIC_SendByte(0x09); //data //IIC_SendByte(0xF0); //NTSC Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x66); //Sub adress Delay_Ns(5); IIC_SendByte(0x2A); //data //IIC_SendByte(0x21); //NTSC Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x67); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x68); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x69); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x6A); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(2); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(2); IIC_SendByte(0x6B); //Sub adress Delay_Ns(2); IIC_SendByte(0x12); //data 主模式 //IIC_SendByte(0x20); // 从模式 Delay_Ns(2); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x6C); //Sub adress Delay_Ns(5); IIC_SendByte(0x01); //data HSL 07-08-25 主模式 // IIC_SendByte(0x96); //data 从模式 //IIC_SendByte(0x11); //NTSC Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x6D); //Sub adress Delay_Ns(5); IIC_SendByte(0x30); //data HSL 07-08-25 主模式 //IIC_SendByte(0x18); //从模式 //IIC_SendByte(0x31); //NTSC Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x6E); //Sub adress Delay_Ns(5); IIC_SendByte(0x80); //video with color Delay_Ns(5); IIC_Start(); //Start Delay_Ns(5); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(5); IIC_SendByte(0x6F); //Sub adress Delay_Ns(5); IIC_SendByte(0x00); //data Delay_Ns(5); IIC_Start(); //Start Delay_Ns(2); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(2); IIC_SendByte(0x70); //Sub adress Delay_Ns(2); IIC_SendByte(0x14); //data Delay_Ns(2); IIC_Start(); //Start Delay_Ns(2); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(2); IIC_SendByte(0x71); //Sub adress Delay_Ns(2); IIC_SendByte(0x00); //data Delay_Ns(2); IIC_Start(); //Start Delay_Ns(2); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(2); IIC_SendByte(0x72); //Sub adress Delay_Ns(2); IIC_SendByte(0x00); //data Delay_Ns(2); IIC_Start(); //Start Delay_Ns(2); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(2); IIC_SendByte(0x73); //Sub adress Delay_Ns(2); IIC_SendByte(0x00); //data Delay_Ns(2); IIC_Start(); //Start Delay_Ns(2); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(2); IIC_SendByte(0x74); //Sub adress Delay_Ns(2); IIC_SendByte(0x00); //data Delay_Ns(2); IIC_Start(); //Start Delay_Ns(2); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(2); IIC_SendByte(0x75); //Sub adress Delay_Ns(2); IIC_SendByte(0x00); //data Delay_Ns(2); IIC_Start(); //Start Delay_Ns(2); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(2); IIC_SendByte(0x76); //Sub adress Delay_Ns(2); IIC_SendByte(0x00); //data Delay_Ns(2); IIC_Start(); //Start Delay_Ns(2); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(2); IIC_SendByte(0x77); //Sub adress Delay_Ns(2); IIC_SendByte(0x00); //data Delay_Ns(2); IIC_Start(); //Start Delay_Ns(2); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(2); IIC_SendByte(0x78); //Sub adress Delay_Ns(2); IIC_SendByte(0x00); //data Delay_Ns(2); IIC_Start(); //Start Delay_Ns(2); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(2); IIC_SendByte(0x79); //Sub adress Delay_Ns(2); IIC_SendByte(0x00); //data Delay_Ns(2); IIC_Start(); //Start Delay_Ns(2); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(2); IIC_SendByte(0x7A); //Sub adress Delay_Ns(2); IIC_SendByte(0x16); //data Delay_Ns(2); IIC_Start(); //Start Delay_Ns(2); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(2); IIC_SendByte(0x7B); //Sub adress Delay_Ns(2); IIC_SendByte(0x36); //data Delay_Ns(2); IIC_Start(); //Start Delay_Ns(2); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(2); IIC_SendByte(0x7C); //Sub adress Delay_Ns(2); IIC_SendByte(0x40); //data Delay_Ns(2); IIC_Start(); //Start Delay_Ns(2); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(2); IIC_SendByte(0x7D); //Sub adress Delay_Ns(2); IIC_SendByte(0x00); //data Delay_Ns(2); IIC_Start(); //Start Delay_Ns(2); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(2); IIC_SendByte(0x7E); //Sub adress Delay_Ns(2); IIC_SendByte(0x00); //data Delay_Ns(2); IIC_Start(); //Start Delay_Ns(2); IIC_SendByte(0x88); //Slave adress,Write flag Delay_Ns(2); IIC_SendByte(0x7F); //Sub adress Delay_Ns(2); IIC_SendByte(0x00); //data Delay_Ns(2); IIC_Stop(); //stop //-------------------GM7121 end--------------------------------- //-------------------I2CTest end------------------------------- while(1) { ; } return 0; } // --==============================files End==============================--