📄 video_switch.c
字号:
/***************************************************************************
Project : Car two ting dvd System
Compiler : ST7 HiCross C (HiWARE)
Module : autos.c
Version : V 1.0
Created : 24 11, 2005
Author : tomi / SA
Description
- Use the M52795 to selete the video input source.
- Use the NJM2245 to selete the AV1/AV2/CAM video input source
Modified
- tomi
***************************************************************************/
#include "Video_switch.h"
#include "Libr.h"
#include "St72321.h"
#include "IOport.h"
#include "Sys_config.h"
#include "i2c_drv.h"
#include "System_operation.h"
static unsigned char Video_sw_data1 = 0xc0; //default state:aduio is normal and D4/D5 are hi
static unsigned char Video_sw_data2 = 0xc0; //default state:aduio is normal and D4/D5 are hi
void Select_video_input_source(unsigned char Input_source);
void Selete_AV1_AV2_CAM_video_input_source(unsigned char Input_source);
void Select_video_input_source(unsigned char Input_source)
{
Video_sw_data1 = Video_sw_data1 & 0xfc;
Video_sw_data2 = Video_sw_data2 & 0xfc;
Video_sw_data1 = Video_sw_data1 |Input_source;
Video_sw_data2 = Video_sw_data2 |Input_source;
if(ValBit(System_flag,Video_gain_6db_flag))
{ //Video gain 6db
SetBit(Video_sw_data1,3);
SetBit(Video_sw_data2,3);
}
else
{ //Video gain 0db
ClrBit(Video_sw_data1,3);
ClrBit(Video_sw_data2,3);
}
I2CWriteByte(Video_sw_address,Video_sw_data1,Video_sw_data2);
}
/*****************************************************************
Function:Use the NJM2245 to selete the AV1/AV2/CAM video input source
*****************************************************************/
void Selete_AV1_AV2_CAM_video_input_source(unsigned char Input_source)
{
switch(Input_source)
{
case AV1_video_input:
Set_SEL_2533_1_low;
Set_SEL_2533_2_low;
break;
case AV2_video_input:
Set_SEL_2533_1_high;
Set_SEL_2533_2_low;
break;
case CAM_video_input:
Set_SEL_2533_1_low;
Set_SEL_2533_2_high;
break;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -