79F162_32 UART

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

79F162/32UART驱动例子双UART功能Uart0_Txd--P3.1口Uart0_Rxd--P3.0口Uart1_IRTxd--P2.7口Uart1_IRRxd--P2.6口两路UART,其中Uart1内部有红外硬件载波发生器,可以从Uart1_IRTxd直接发射调制的UART红外载波信号79F32系统寄存器#ifndef_CPU32_H#define_CPU32_HsfrACC=0xE0;sfrB=0xF0;sfrCRE=0xF1;/*Cregister*/sfrPSW=0xD0;sfrSP=0x81;sfrDPL=0x82;sfrDPH=0x83;sfrDPL1=0x84;/*Datapointer2Lowbyte*/sfrDPH1=0x85;/*Datapointer2Highbyte*/sfrINSCON=0x86;/*Datapointerselect*//**bit0--0:DPTR*bit0--1:DPTR1*bit2--0:8bitmode==(A*B)=B(HighByte)8+A(LowByte)*bit2--1:16bitmode==(CA)*B=C(HighByte)16+B(MiddleByte)8+A(LowByte)*bit3--0:8bitmode==(A/B)=A(Quotientlowbyte)+B(Remainer)*bit3--1:16bitmode==(CA/B)=C(QuotientHighByte)8+A(QuotientLowByte)+B(Remainer)*/sfrXPAGE=0xF7;/*Memorypage*/sfrPCON=0x87;/*powercontrol*/sfrSUSLO=0x8E;/*suspendmodecontrol*/sfrLPDCON=0xB3;/*LPDcontrol*/sfrIB_CLK0=0xF9;/*flashprogrammingclockregister0*/sfrIB_CLK1=0xFA;/*flashprogrammingclockregister1*/sfrIB_OFFSET=0xFB;/*Lowbyteoffsetofflashmemoryforprogramming*/sfrIB_DATA=0xFC;/*Dataregisterforprogrammingflashmemory*/sfrFOCON=0xFD;/*flashoptioncontrol*/sfrIB_CON1=0xF2;/*Flashmemorycontrolregister1*/sfrIB_CON2=0xF3;/*Flashmemorycontrolregister2*/sfrIB_CON3=0xF4;/*Flashmemorycontrolregister3*/sfrIB_CON4=0xF5;/*Flashmemorycontrolregister4*/sfrIB_CON5=0xF6;/*Flashmemorycontrolregister5*/sfrWDT=0xB1;/*watchdogtimercontrol*/sfrSCM=0xB2;/*systemclockselectandmonitor*/sfrIEN0=0xA8;/*Externalinterruptenablecontrol1*/sfrIEN1=0xA9;/*Externalinterruptenablecontrol2*/sfrIPL0=0xB8;/*InterruptprioritycontrolLow0*/sfrIPH0=0xB4;/*InterruptprioritycontrolHigh0*/sfrIPL1=0xB9;/*InterruptprioritycontrolLow1*/sfrIPH1=0xB5;/*InterruptprioritycontrolHigh1*/sfrP0=0x80;sfrP1=0x90;sfrP2=0xA0;sfrP3=0xB0;sfrP4=0xC0;sfrP0CR=0xE1;/*port0input/outputdirectioncontrol*/sfrP1CR=0xE2;/*port1input/outputdirectioncontrol*/sfrP2CR=0xE3;/*port2input/outputdirectioncontrol*/sfrP3CR=0xE4;/*port3input/outputdirectioncontrol*/sfrP4CR=0xE5;sfrPP0CR=0xE9;/*Internalpull-highenableforport0*/sfrPP1CR=0xEA;/*Internalpull-highenableforport1*/sfrPP2CR=0xEB;/*Internalpull-highenableforport2*/sfrPP3CR=0xEC;/*Internalpull-highenableforport3*/sfrPP4CR=0xED;sfrTCON=0x88;/*Timer/Counter0and1controlregister*/sfrTMOD=0x89;/*Timer/Counter0and1modes*/sfrT0L=0x8A;/*Timer/Counter0lowbyte*/sfrT0H=0x8C;/*Timer/Counter0highbyte*/sfrT1L=0x8B;/*Timer/Counter1lowbyte*/sfrT1H=0x8D;/*Timer/Counter1highbyte*/sfrT2CON=0xC8;/*Timer/Counter2control*/sfrT2MOD=0xC9;/*Timer/Counter2mode*/sfrRCAP2L=0xCA;/*Timer/Counter2reload/capturelowbyte*/sfrRCAP2H=0xCB;/*Timer/Counter2reload/capturehighbyte*/sfrT2L=0xCC;sfrT2H=0xCD;sfrSCON=0x98;/*serialcontrol*/sfrSBUF=0x99;/*serialdatabuffer*/sfrSADDR=0x9A;/*slaveaddress*/sfrSADEN=0x9B;/*slaveaddressmask*/sfrSCON1=0xD8;/*serial1control*/sfrSBUF1=0xD9;sfrSADDR1=0xDA;sfrSADEN1=0xDB;sfrIRCON=0xA1;/*IRcontrol*/sfrSPCON=0xF8;/*SPIcontrol*/sfrSPSTA=0xA2;/*SPIstatus*/sfrSPDAT=0xA3;/*SPIdata*/sfrI2CCON=0xA6;sfrI2CDAT=0xA7;sfrADCON=0x93;/*ADCcontrol*/sfrADCT=0x94;/*ADCtimeselect*/sfrADCH=0x95;/*ADCconfiguration*/sfrADDL=0x96;/*ADCdatabufferlownibble*/sfrADDH=0x97;sfrLCDCON=0xAB;/*LCDcontrol*/sfrLCDCLK=0xAC;sfrP1SS=0xAD;/*P1orsegmentselect*/sfrP0SS=0xAE;/*P0orsegmentselect*/sfrPLCON=0xAF;/*PWMLCDcontrol*/sfrRTCCON=0xBE;/*RTCcontrol*/sfrRTCDAT=0xBF;/*RTCcalibrationdata*/sfrSECOND=0xC1;/*second&halfsecond*/sfrMINUTE=0xC2;sfrHOUR=0xC3;sfrDAY=0xC4;sfrMONTH=0xC5;sfrYEAR=0xC6;sfrWEEK=0xC7;sfrPWMEN=0xCF;/*PWMtimerenable*/sfrPWMLO=0xE7;/*PWMclock*/sfrPWMC=0xD2;sfrPWMPL=0xD3;sfrPWMPH=0xD4;sfrPWMDL=0xD5;sfrPWMDH=0xD6;sfrPWMDT=0xD1;/*PWMdeadtimecontrol*/sfrEXF0=0xE8;/*externalinterrupt2control*//*Bitaddressable*/sbitP0_0=P0^0;sbitP0_1=P0^1;sbitP0_2=P0^2;sbitP0_3=P0^3;sbitP0_4=P0^4;sbitP0_5=P0^5;sbitP0_6=P0^6;sbitP0_7=P0^7;sbitP1_0=P1^0;sbitP1_1=P1^1;sbitP1_2=P1^2;sbitP1_3=P1^3;sbitP1_4=P1^4;sbitP1_5=P1^5;sbitP1_6=P1^6;sbitP1_7=P1^7;sbitP2_0=P2^0;sbitP2_1=P2^1;sbitP2_2=P2^2;sbitP2_3=P2^3;sbitP2_4=P2^4;sbitP2_5=P2^5;sbitP2_6=P2^6;sbitP2_7=P2^7;sbitP3_0=P3^0;sbitP3_1=P3^1;sbitP3_2=P3^2;sbitP3_3=P3^3;sbitP3_4=P3^4;sbitP3_5=P3^5;sbitP3_6=P3^6;sbitP3_7=P3^7;sbitP4_0=P4^0;sbitP4_1=P4^1;sbitP4_2=P4^2;sbitP4_3=P4^3;sbitP4_4=P4^4;sbitP4_5=P4^5;sbitP4_6=P4^6;sbitP4_7=P4^7;sbitCY=0xD7;/*carrybit*/sbitAC=0xD6;/*BCDcodecarrybit*/sbitF0=0xD5;/*TheF0flagisusedbyseveralarithmeticlibraryroutines.*/sbitRS1=0xD4;/*RS0(1)selectthecurrentworkregisterset*/sbitRS0=0xD3;sbitOV=0xD2;/*calculateresultoverflow*/sbitF1=0xD1;/*TheUD/F1flagisnotusedbyanyoftheKeildevelopmenttoolsandmaybeusedbyyoursoftware/hardware.*/sbitP=0xD0;/*ACCodd/Evencheckbit*/sbitTF1=0x8F;/*Timer1overflowflagbit*/sbitTR1=0x8E;/*Timer1start/stopcontrolbit*/sbitTF0=0x8D;/*Timer0overflowflagbit*/sbitTR0=0x8C;/*Timer0start/stopcontrolbit*/sbitIE1=0x8B;/*Externalinterrupt1requestflag*/sbitIT1=0x8A;/*Externalinterrupt1triggermode:0--leveltrigger;1--edgetrigger*/sbitIE0=0x89;/*Externalinterrupt0requestflag*/sbitIT0=0x88;/*Externalinterrupt0triggermode:0--leveltrigger;1--edgetrigger*/sbitEA=IEN0^7;//0xAF;/*allinterruptenablebit*/sbitEADC=0xAE

1 / 6
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功