?? adv7180.c
字號(hào):
#include "adv7180.h"
#include "I2C.h"
//asm(".Section sdram_code_coreA;");
void init_adv7180(void)
{
long delay_time;
u8 temp;
int i = 0;
// configure RESET flag as output
//*pFIO0_DIR |= (1 << ADV7180_SCL) | (1 << ADV7180_SDATA);
//ssync();
//*********************************************************************//
bool ret = true;
// Init I2C for ADV7181 Indent addr.
if (I2C_Init(ADV7180_IDENT))
ret = EJ_ERR_UNKNOWN;
temp = 0x80;
I2C_Write(&temp, 0x0F,1);//RESET,第9個(gè)脈沖不會(huì)有ack
for (delay_time = 0; delay_time < (ADV7180_Reset_Delay); delay_time++)
asm("nop;");//復(fù)位需要延時(shí)2ms
/* temp = 0x24;
if (I2C_Write(&temp, 0x0F,1))//RESET置0
ret = EJ_ERR_UNKNOWN;
*/
temp = 0x00;
if (I2C_Write(&temp, 0x1D,1))
ret = EJ_ERR_UNKNOWN;
temp = 0x01;
if (I2C_Write(&temp, 0x00,1))//設(shè)置輸入為AIN1信號(hào)為cvbs,此為默認(rèn)狀態(tài),可不寫
ret = EJ_ERR_UNKNOWN;
temp = 0x57;
if (I2C_Write(&temp, 0x04,1))//enable SFL
ret = EJ_ERR_UNKNOWN;
temp = 0x41;
if (I2C_Write(&temp, 0x17,1))//select SH1
ret = EJ_ERR_UNKNOWN;
temp = 0x02;
if (I2C_Write(&temp, 0x31,1))//clear NEWAV_MODE,SAV/EAV to suit ADV video encodes
ret = EJ_ERR_UNKNOWN;
temp = 0xA2;
if (I2C_Write(&temp, 0x3D,1))//MWE enable manual windows,color kill threshold to 2
ret = EJ_ERR_UNKNOWN;
temp = 0x6A;
if (I2C_Write(&temp, 0x3E,1))//BLM optimization
ret = EJ_ERR_UNKNOWN;
temp = 0xA0;
if (I2C_Write(&temp, 0x3F,1))//BGB optimization
ret = EJ_ERR_UNKNOWN;
temp = 0x80;
if (I2C_Write(&temp, 0x0E,1))//Hidden space
ret = EJ_ERR_UNKNOWN;
temp = 0x81;
if (I2C_Write(&temp, 0x55,1))//ADC configuration
ret = EJ_ERR_UNKNOWN;
temp = 0x00;
if (I2C_Write(&temp, 0x0E,1))//user space
ret = EJ_ERR_UNKNOWN;
/* temp = 0x04;
if (I2C_Write(&temp, 0x0F,0x00))//RESET
ret = EJ_ERR_UNKNOWN;
*/
// If Error.
/*if (ret == EJ_ERR_UNKNOWN)
{
while(1)
{
idle();
}
}
*/
//延時(shí),以便在打開PPI之前鎖住信號(hào)
for (i = 0; i < (ADV7180_Lock*5); i++)
{
asm volatile("nop; nop; nop;");
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -