📄 saa7114.lst
字号:
C51 COMPILER V7.50 SAA7114 03/18/2008 22:04:58 PAGE 1
C51 COMPILER V7.50, COMPILATION OF MODULE SAA7114
OBJECT MODULE PLACED IN .\BIN\SAA7114.obj
COMPILER INVOKED BY: D:\设计软件\Keil\C51\BIN\C51.EXE SRC\SAA7114.C BROWSE DEBUG OBJECTEXTEND PRINT(.\LST\SAA7114.lst) O
-BJECT(.\BIN\SAA7114.obj)
line level source
1 #include "IIC.H"
2 #include "8051.H"
3 #include "stdio.h"
4 #include "SAA7114.H"
5 #include "RAM.H"
6 #include "F63REG.H"
7 #include "MyDef.H"
8 #include "MCU.H"
9 #include "OSD.H"
10 #include "Scaler.H"
11 #include "PANEL.H"
12 #include "sRGB.H"
13
14 idata unsigned char MuteFlag;
15 unsigned char code NTSC_AV[]={//register data
16 //0x01~0x0f
17 0x00,0x08,0xc5,0x10,0x90,0x90,0xeb,0xe0,
18 0xb8,0x40,0x80,0x44,0x40,0x00,0x89,0x2a,
19 //0x10~0x1f
20 0x0e,0x00,0x00,0x00,0x00,0x11,0xfe,0x40,
21 0x40,0x80,0x00,0x00,0x00,0x00,0x00,0x00,
22 //0x20~0x2f
23 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
24 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
25 //0x30~0x3f
26 0xbc,0xdf,0x02,0x00,0xcd,0xcc,0x3a,0x00,
27 0x03,0x20,0x03,0x00,0x00,0x00,0x00,0x00,
28 //0x40~0x4f
29 0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
30 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
31 //0x50~0x5f
32 0xff,0xff,0xff,0xff,0x5f,0xff,0xff,0xff,
33 0x00,0x47,0x06,0x83,0x00,0x3e,0x00,0x00,
34 //0x60~0x6f
35 0x00,0x05,0xa0,0x00,0x00,0x00,0x00,0x00,
36 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
37 //0x70~0x7f
38 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
39 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
40 //0x80~0x8f
41 0x12,0x00,0x00,0x01,0x01,0x04,0x45,0x01,
42 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
43 //0x90~0x9f
44 0x00,0x08,0x09,0x40,0x10,0x00,0xd0,0x02,
45 0x0a,0x00,0xf0,0x00,0xd0,0x02,0xf0,0x00,
46 //0xa0~0xaf
47 0x01,0x00,0x00,0x00,0x80,0x40,0x40,0x00,
48 0x00,0x04,0x00,0x00,0x00,0x02,0x00,0x00,
49 //0xb0~0xbf
50 0x00,0x04,0x00,0x04,0x00,0x00,0x00,0x00,
51 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
52 //0xc0~0xcf
53 0x00,0x08,0x10,0x81,0x10,0x00,0xd0,0x02,
54 0x0a,0x00,0x20,0x01,0xd0,0x02,0x20,0x01,
C51 COMPILER V7.50 SAA7114 03/18/2008 22:04:58 PAGE 2
55 //0xd0~0xdf
56 0x01,0x00,0x00,0x00,0x80,0x40,0x40,0x00,
57 0x00,0x04,0x00,0x00,0x00,0x02,0x00,0x00,
58 //0xe0~0xef
59 0x00,0x04,0x00,0x04,0x00,0x00,0x00,0x00,
60 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
61 };
62
63 void SAA7114Init(void)
64 {
65 1
66 1 unsigned char i;
67 1 //saa7114 load table
68 1 VideoEnable();
69 1 ScalerPowerUp();
70 1 Sleep(10);
71 1 flag1 &= ~BIT_1; //Clear fource to background
72 1 ForceToBackground(0);
73 1 for(i=0; i<0xf0; i=i+16){
74 2 WritePageSAA7114(i,i);
75 2 }
76 1 WriteIIC_HW(SAA7114,0x88,0xe0);
77 1 switch(PowerStatus)
78 1 {
79 2 case 0x81:
80 2 WriteIIC_HW(SAA7114,0x02,0xc5); //SAA7114 AV In
81 2 WriteIIC_HW(SAA7114,0x09,0x40); //SAA7114 no YCOMB
82 2 WriteIIC_HW(SAA7114,0x14,0x22); //aout=ad2
83 2 break;
84 2 case 0x82:
85 2 WriteIIC_HW(SAA7114,0x02,0xc6); //SAA7114 Y/C In
86 2 WriteIIC_HW(SAA7114,0x09,0x40); //SAA7114 no YCOMB
87 2 WriteIIC_HW(SAA7114,0x14,0x22); //aout=ad2
88 2 break;
89 2 case 0x83:
90 2 WriteIIC_HW(SAA7114,0x02,0xc4); //SAA7114 TV In
91 2 WriteIIC_HW(SAA7114,0x09,0xc0); //SAA7114 YCOMB
92 2 WriteIIC_HW(SAA7114,0x14,0x22); //aout=ad1
93 2 break;
94 2 }
95 1
96 1 WriteIIC_HW(Scaler_Addr,0x12,0x03);
97 1 WriteIIC_HW(Scaler_Addr,0x13,0x33);
98 1 WriteIIC_HW(Scaler_Addr,0x00,0x32);
99 1 WriteIIC_HW(Scaler_Addr,0xE8,0x00);
100 1
101 1 R_Gain = 80;
102 1 G_Gain = 80;
103 1 B_Gain = 80;
104 1 sRGB();
105 1
106 1 Brightness = Read24C16(0xd6); //0xd6 = brightness
107 1 Contrast = Read24C16(0xd7); //0xd7 = contrast
108 1 Saturation = Read24C16(0xd8); //0xd8 = video saturation
109 1 Tint = Read24C16(0xd9); //0xd6 = video hue
110 1 Sharpness = Read24C16(0xda); //0xda = Sharpness(video)
111 1 SetVideoBrightness();
112 1 SetVideoContrast();
113 1 SetVideoSaturation();
114 1 SetVideoTint();
115 1 SetVideoSharpness();
116 1
C51 COMPILER V7.50 SAA7114 03/18/2008 22:04:58 PAGE 3
117 1 ColorStatus = 0;
118 1 flag2 |= 0x07;
119 1 // NT68520PowerUp();
120 1 // Sleep(100);
121 1 // if(((PortC & BIT_0) == 0)&&(PowerStatus > 0x80)){
122 1 // Sleep(PowerUpInvTiming);
123 1 BackLightOn();
124 1 // }
125 1 SetVolume();
126 1 }
127 /*
128 void CheckVideo(void)
129 {
130 unsigned char value;
131 value = ReadIIC_HW(SAA7114,0x1f);
132 if(((value & 0x41) != 0x01) && ((flag2 & BIT_1) == 0)){
133 //change to unlocked
134 flag2 &= ~BIT_0;
135 flag2 |= BIT_1;
136 flag1 &= ~BIT_1; //Clear fource to background
137 ForceToBackground(1);
138 Timer3 = 100;
139 if(PowerStatus == 0x83){
140 AUDIO_MUTE();
141 }
142 if((flag3 & BIT_2) != 0x00){
143 printf("No Video\r\n");
144 }
145 }
146 if(((value & BIT_6) == 0) && ((flag2 & BIT_1) != 0)){
147 //change to locked
148 flag2 &= ~BIT_0;
149 flag2 &= ~BIT_1;
150 SetAV_System();
151 Timer3 = 100;
152 if(PowerStatus == 0x83){
153 if((flag3 & BIT_4) == 0)
154 AUDIO_On();
155 else
156 AUDIO_MUTE();
157 }
158 if((flag3 & BIT_2) != 0x00){
159 printf("Video again\r\n");
160 }
161 }
162 //check vertical
163 if(((value & BIT_5) == 0) && ((flag2 & 0x06) == 0x04)){
164 //change to 50Hz
165 flag2 &= ~BIT_0;
166 flag2 &= ~BIT_2;
167 SetAV_System();
168 Timer3 = 100;
169 }
170 if(((value & BIT_5) != 0) && ((flag2 & 0x06) == 0x00)){
171 //change to 60Hz
172 flag2 &= ~BIT_0;
173 flag2 |= BIT_2;
174 SetAV_System();
175 Timer3 = 100;
176 }
177 //check color system
178 if(((value & 0x41) == 0x00)&&((flag2 & BIT_1) == 0)){
C51 COMPILER V7.50 SAA7114 03/18/2008 22:04:58 PAGE 4
179 CheckColorSystem();
180 }
181 }
182 */
183 void CheckVideo(void)
184 {
185 1 unsigned char value;
186 1 // if(DecodeDelay==0)
187 1 // {
188 1 // DecodeDelay=50;
189 1 value = ReadIIC_HW(SAA7114,0x1f);
190 1 if(((value & BIT_6) != 0x00) && ((flag2 & BIT_1) == 0))
191 1 { //change to unlocked
192 2 AUDIO_MUTE(); //AUDIO MUTE
193 2 flag2 &= ~BIT_0;
194 2 flag2 |= BIT_1;
195 2 Timer3 = 100;
196 2 // flag1 &= ~BIT_1; //Clear force to background
197 2 // ForceToBackground(1);
198 2 }
199 1 else if(((value & BIT_6) == 0) && ((flag2 & BIT_1) != 0))
200 1 { //change to locked
201 2 if((value & BIT_5) == 0)
202 2 { //change to 50Hz
203 3 if(Volume !=0) //CANCEL AUDIO MUTE
204 3 { if(MuteFlag != 1)
205 4 AUDIO_On();
206 4 }
207 3 flag2 &= ~BIT_0;
208 3 flag2 &= ~BIT_1;
209 3 flag2 &= ~BIT_2;
210 3 SetAV_System();
211 3 Timer3 = 100;
212 3 }
213 2 if((value & BIT_5) != 0)
214 2 { //change to 60Hz
215 3 if(Volume !=0) //CANCEL AUDIO MUTE
216 3 { if(MuteFlag != 1)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -