📄 mcu.lst
字号:
889 1 port |= RDPC_REG;
890 1 port &= ~PC1;
891 1 PTC_REG = port;
892 1 }
893
894 void LED_RedOff(void)
895 {
896 1 unsigned char port;
897 1 port = PTC_REG;
898 1 port |= RDPC_REG;
899 1 port |= PC0;
900 1 PTC_REG = port;
901 1 }
902
903 void LED_RedOn(void)
904 {
905 1 unsigned char port;
906 1 port = PTC_REG;
907 1 port |= RDPC_REG;
908 1 port &= ~PC0;
909 1 PTC_REG = port;
910 1 }
911 void PowNavOn()
912 {
913 1 Byte Port;
914 1 Port = PTB_REG;
915 1 Port |= RDPB_REG;
916 1 Port |= PB0;
917 1 PTB_REG = Port;
918 1 }
919 void PowNavOff()
920 {
921 1 Byte Port;
C51 COMPILER V7.06 MCU 12/11/2007 11:28:42 PAGE 16
922 1 Port = PTB_REG;
923 1 Port |= RDPB_REG;
924 1 Port &= ~PB0;
925 1 PTB_REG = Port;
926 1 }
927 void PowDvdOn()
928 {
929 1 Byte Port;
930 1 Port = PTC_REG;
931 1 Port |= RDPC_REG;
932 1 Port &= ~PC5;
933 1 PTC_REG = Port;
934 1 }
935 void PowDvdOff()
936 {
937 1 Byte Port;
938 1 Port = PTC_REG;
939 1 Port |= RDPC_REG;
940 1 Port |= PC5;
941 1 PTC_REG = Port;
942 1 }
943
944 void Pow5150On()
945 {
946 1 Byte Port;
947 1 Port = PTC_REG;
948 1 Port |= RDPC_REG;
949 1 Port |= PC2;
950 1 PTC_REG = Port;
951 1 }
952 void Pow5150Off()
953 {
954 1 Byte Port;
955 1 Port = PTC_REG;
956 1 Port |= RDPC_REG;
957 1 Port &= ~PC2;
958 1 PTC_REG = Port;
959 1 }
960 void ResetVideoOn()
961 {
962 1 Byte Port;
963 1 Port = PTB_REG;
964 1 Port |= RDPB_REG;
965 1 Port &= ~PB1;
966 1 PTB_REG = Port;
967 1 }
968 void ResetVideoOff()
969 {
970 1 Byte Port;
971 1 Port = PTB_REG;
972 1 Port |= RDPB_REG;
973 1 Port |= PB1;
974 1 PTB_REG = Port;
975 1 }
976 void DrivePowOn()
977 {
978 1 Byte Port;
979 1 Port = PTA_REG;
980 1 Port |= RDPA_REG;
981 1 Port |= PA5;
982 1 PTA_REG = Port;
983 1 }
C51 COMPILER V7.06 MCU 12/11/2007 11:28:42 PAGE 17
984 void DrivePowOff()
985 {
986 1 Byte Port;
987 1 Port = PTA_REG;
988 1 Port |= RDPA_REG;
989 1 Port &= ~PA5;
990 1 PTA_REG = Port;
991 1 }
992 void RestScalOn()
993 {
994 1 Byte Port;
995 1 Port = PTC_REG;
996 1 Port |= RDPC_REG;
997 1 Port &= ~PC4;
998 1 PTC_REG = Port;
999 1 }
1000 void RestScalOff()
1001 {
1002 1 Byte Port;
1003 1 Port = PTC_REG;
1004 1 Port |= RDPC_REG;
1005 1 Port |= PC4;
1006 1 PTC_REG = Port;
1007 1 }
1008 void SetMenu()
1009 {
1010 1 Byte Port;
1011 1 Port = PTA_REG;
1012 1 Port |= RDPA_REG;
1013 1 Port &= ~PA7;
1014 1 PTA_REG = Port;
1015 1 }
1016 void ResetMenu()
1017 {
1018 1 Byte Port;
1019 1 Port = PTA_REG;
1020 1 Port |= RDPA_REG;
1021 1 Port |= PA7;
1022 1 PTA_REG = Port;
1023 1 }
1024 bit NavMcu()
1025 {
1026 1 bit m;
1027 1 Byte Port;
1028 1 RDPA_REG |=0x80;
1029 1 Port = PTA_REG;
1030 1 if((Port & PA7)!=0)
1031 1 {
1032 2 m=1;
1033 2 }
1034 1 else
1035 1 {
1036 2 m=0;
1037 2 }
1038 1 return m;
1039 1 }
1040
1041 void BackLightOn(void)
1042 {
1043 1 Byte Port;
1044 1 Port = PTE_REG;
1045 1 Port |= RDPE_REG;
C51 COMPILER V7.06 MCU 12/11/2007 11:28:42 PAGE 18
1046 1 Port |= PE1;
1047 1 PTE_REG = Port;
1048 1 }
1049
1050 void BackLightOff(void)
1051 {
1052 1 Byte Port;
1053 1 Port = PTE_REG;
1054 1 Port |= RDPE_REG;
1055 1 Port &= ~PE1;
1056 1 PTE_REG = Port;
1057 1 }
1058 void MuteStby0ff(void)
1059 {
1060 1 Byte Port;
1061 1 Port = PTD_REG;
1062 1 Port |= RDPD_REG;
1063 1 Port |= PD6;
1064 1 PTD_REG = Port;
1065 1 }
1066 void MuteStbyOn(void)
1067 {
1068 1 Byte Port;
1069 1 Port = PTD_REG;
1070 1 Port |= RDPD_REG;
1071 1 Port &= ~PD6;
1072 1 PTD_REG = Port;
1073 1 }
1074 void NavIIC(void)
1075 {
1076 1 Byte Port;
1077 1 Port = PTB_REG;
1078 1 Port |= RDPB_REG;
1079 1 Port &= ~PB3;
1080 1 PTB_REG = Port;
1081 1 }
1082 void DvdIIC(void)
1083 {
1084 1 Byte Port;
1085 1 Port = PTB_REG;
1086 1 Port |= RDPB_REG;
1087 1 Port |= PB3;
1088 1 PTB_REG = Port;
1089 1 }
1090 void PowAudioOn(void)
1091 {
1092 1 Byte Port;
1093 1 Port = PTC_REG;
1094 1 Port |= RDPC_REG;
1095 1 Port |= PC6;
1096 1 PTC_REG = Port;
1097 1 }
1098 void PowAudioOff(void)
1099 {
1100 1 Byte Port;
1101 1 Port = PTC_REG;
1102 1 Port |= RDPC_REG;
1103 1 Port &= ~PC6;
1104 1 PTC_REG = Port;
1105 1 }
1106 void MenuClr(void)
1107 {
C51 COMPILER V7.06 MCU 12/11/2007 11:28:42 PAGE 19
1108 1 Byte Port;
1109 1 Port = PTC_REG;
1110 1 Port |= RDPC_REG;
1111 1 Port |= PC7;
1112 1 PTC_REG = Port;
1113 1 }
1114 void MenuSet(void)
1115 {
1116 1 Byte Port;
1117 1 Port = PTC_REG;
1118 1 Port |= RDPC_REG;
1119 1 Port &= ~PC7;
1120 1 PTC_REG = Port;
1121 1 }
1122 void Delay2m(void) using 3
1123 {
1124 1 unsigned char temp1,temp2,temp3;
1125 1 for(temp1=0;temp1<=0x0f;temp1++)
1126 1 {
1127 2 CLRWDT = 0x55;
1128 2 for(temp2=0;temp2<0xff;temp2++)
1129 2 {
1130 3
1131 3 for(temp3=0;temp3<0xff;temp3++)
1132 3 {
1133 4 CLRWDT = 0x55;
1134 4 }
1135 3 // if(ScrnCount == 0)
1136 3 // break;
1137 3 }
1138 2 if(ScrnCount == 0)
1139 2 break;
1140 2 }
1141 1 INTEXT_EN = 0x02;
1142 1 // set timer 0
1143 1 SCON = 0x52;
1144 1 TMOD = 0x22; //timer0 /timer1 8 bits auto reload
1145 1 // TMOD = 0x21; //timer0 16 bits/timer1 8 bits auto reload
1146 1 PCON = 0x80;
1147 1 // timer0 8 bits auto reload
1148 1 TL0 = -200;
1149 1 TH0 =-200;
1150 1 // TL0 = 256-(CPU_CLK/1000*100/12000); //time base 100us
1151 1 // TH0 = 256-(CPU_CLK/1000*100/12000);
1152 1
1153 1 // timer0 16 bits
1154 1 // TL0 = (65536-CPU_CLK/1200)%256; //time base 10ms
1155 1 // TH0 = (65536-CPU_CLK/1200)/256;
1156 1
1157 1 // For 12.000 MHz
1158 1 TL1 = 256-(2*CPU_CLK/384/9600);
1159 1 TH1 = 256-(2*CPU_CLK/384/9600);
1160 1 // For 14.318 MHz
1161 1 //TL1 = 256-(2*CPU_CLK/384/4800);
1162 1 //TH1 = 256-(2*CPU_CLK/384/4800);
1163 1 TR0 = 1; //start timer0
1164 1 TR1 = 1; //start timer1
1165 1 // set interrupt
1166 1 // EX1 = 1; //enable External interrupt1
1167 1 ET0 = 1; //enable timer0 interrupt
1168 1 EA = 1; //enable all interrupt
1169 1 T0_INT_CNT = 0;
C51 COMPILER V7.06 MCU 12/11/2007 11:28:42 PAGE 20
1170 1 T0_10ms_Cnt = 0;
1171 1 // Sleep(50);
1172 1 }
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 1892 ----
CONSTANT SIZE = 13 ----
XDATA SIZE = ---- 13
PDATA SIZE = ---- ----
DATA SIZE = ---- ----
IDATA SIZE = ---- ----
BIT SIZE = ---- 4
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -