TVP5150am1输入:制式:PAL(BGHIN)ITU-RBT601 interlaced扫描 CVBS(composite) AIP1A输入
输出:8bit ITU-R BT656 embeded sync output
一:TVP5150简单介绍
支持输入:两路CVBS 或 一路SVIDEO
支持输入格式:PAL NTSC SECAM
输出格式:内嵌同步:8bit ITU-RBT656 和8bit 4:2:2 YCbCr 分离同步:8bit 4:2:2YCbCr
注:5150和5146的差别还是挺大
二:TVP5150寄存器配置
1.datasheet参考如下
从上面可见CVBS输入只需要设置0x03寄存器即可,确实,最后我也只设置了这一个寄存器,其他都是default
寄存器对照datasheet详细的看了一番,下面简单介绍下几个重要的寄存器
1.0x01:选择CVBS 还是SVIDEO输入,选择1口还是2口输入
2.0x03:最重要的寄存器,设置输出口Y0-Y7输出,始终输出,不然后端没有视频数据输出
3.0x04和0x28:配合选择制式的,但是5150比5146先进就是可以auto选择制式格式,这里只要default就自动选择了
4.0x0d:设置输出格式的
三:需要修改TI camera driver的几处地方camera/pdd/tvpctrl.cpp
1.初始化,肯定的,一般寄存器setting放在单独的一个文件当中
BOOL CTvpCtrl::Init(PVOID MDDContext) { RETAILMSG(ZJKtvp_DEBUGMSG,(TEXT("ZJK:CTvpCtrl::Init--CAM_PDD_TvpCtrl.cpp\r\n")));//add by zjk // Read parameters from registry if (GetDeviceRegistryParams( (LPCTSTR)MDDContext, &m_pTvpConfig, dimof(s_deviceRegParams), s_deviceRegParams) != ERROR_SUCCESS) { DEBUGMSG(ZONE_ERROR, (TEXT("ERROR: CTvpCtrl::Init - Error reading from Registry.\r\n"))); return FALSE; } if (m_pTvpConfig.dwI2CAddr == 0) { DEBUGMSG(ZONE_ERROR, (TEXT("ERROR: CTvpCtrl::Init - Wrong I2C address read from registry\r\n"))); return FALSE; } /* add by zjk because tvp5140 reset connect by baseboard reset key if (m_pTvpConfig.dwResetGpio != (DWORD)-1) { HANDLE hGpio = GPIOOpen(); Sleep(20); GPIOClrBit(hGpio, m_pTvpConfig.dwResetGpio); GPIOSetMode(hGpio, m_pTvpConfig.dwResetGpio, GPIO_DIR_OUTPUT); Sleep(20); GPIOSetBit(hGpio, m_pTvpConfig.dwResetGpio); GPIOSetMode(hGpio, m_pTvpConfig.dwResetGpio, GPIO_DIR_OUTPUT); GPIOClose(hGpio); }*/ RETAILMSG(ZJKtvp_DEBUGMSG,(TEXT("ZJK:CTvpCtrl::Init--before I2CInit()\r\n")));//add by zjk I2CInit(); RETAILMSG(ZJKtvp_DEBUGMSG,(TEXT("ZJK:CTvpCtrl::Init--after I2CInit() \r\n")));//add by zjk if (m_hI2C != NULL) { for(UINT i=0;i<num_tvp_settings;i++) { WriteReg(tvpSettings[i].reg, tvpSettings[i].val); } } I2CDeinit(); return TRUE; }
BOOL CTvpCtrl::SetPowerState(BOOL PowerOn) { RETAILMSG(ZJKtvp_DEBUGMSG,(TEXT("ZJK:CTvpCtrl::SetPowerState--CAM_PDD_TvpCtrl.cpp\r\n")));//add by zjk I2CInit(); //WriteReg(REG_OPERATION_MODE, PowerOn ? 0x00 : 0x01); WriteReg(TVP5150_OP_MODE_CTL, PowerOn ? 0x00 : 0x01);//change bu zjk because the operate mode register of 5150 is 0x02,5146 is 0x03 I2CDeinit(); return TRUE; }
BOOL CTvpCtrl::SelectComposite() { RETAILMSG(ZJKtvp_DEBUGMSG,(TEXT("ZJK:CTvpCtrl::SelectComposite--CAM_PDD_TvpCtrl.cpp\r\n")));//add by zjk I2CInit(); WriteReg(REG_INPUT_SEL, (UINT8)m_pTvpConfig.dwSelComposite); I2CDeinit(); return TRUE; }