STC15系列头文件...

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

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

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

资源描述

//STC15系列头文件...#ifndef_STC15Fxxxx_H#define_STC15Fxxxx_H#includeintrins.h/*BYTERegisters*/sfrP0=0x80;sfrSP=0x81;sfrDPL=0x82;sfrDPH=0x83;sfrS4CON=0x84;sfrS4BUF=0x85;sfrPCON=0x87;sfrTCON=0x88;sfrTMOD=0x89;sfrTL0=0x8A;sfrTL1=0x8B;sfrTH0=0x8C;sfrTH1=0x8D;sfrAUXR=0x8E;sfrWAKE_CLKO=0x8F;sfrINT_CLKO=0x8F;sfrAUXR2=0x8F;sfrRL_TL0=0x8A;sfrRL_TL1=0x8B;sfrRL_TH0=0x8C;sfrRL_TH1=0x8D;sfrP1=0x90;sfrP1M1=0x91;//P1M1.n,P1M0.n=00---Standard,01---push-pull实际上1T的都一样sfrP1M0=0x92;//=10---pureinput,11---opendrainsfrP0M1=0x93;//P0M1.n,P0M0.n=00---Standard,01---push-pullsfrP0M0=0x94;//=10---pureinput,11---opendrainsfrP2M1=0x95;//P2M1.n,P2M0.n=00---Standard,01---push-pullsfrP2M0=0x96;//=10---pureinput,11---opendrainsfrCLK_DIV=0x97;sfrPCON2=0x97;sfrSCON=0x98;sfrSBUF=0x99;sfrS2CON=0x9A;//sfrS2BUF=0x9B;//sfrP1ASF=0x9D;//只写,模拟输入(AD或LVD)选择sfrP2=0xA0;sfrBUS_SPEED=0xA1;sfrAUXR1=0xA2;sfrP_SW1=0xA2;sfrIE=0xA8;sfrSADDR=0xA9;sfrWKTCL=0xAA;//唤醒定时器低字节sfrWKTCH=0xAB;//唤醒定时器高字节sfrS3CON=0xAC;sfrS3BUF=0xAD;sfrIE2=0xAF;//STC12C5A60S2系列sfrP3=0xB0;sfrP3M1=0xB1;//P3M1.n,P3M0.n=00---Standard,01---push-pullsfrP3M0=0xB2;//=10---pureinput,11---opendrainsfrP4M1=0xB3;//P4M1.n,P4M0.n=00---Standard,01---push-pullsfrP4M0=0xB4;//=10---pureinput,11---opendrainsfrIP2=0xB5;//STC12C5A60S2系列sfrIPH2=0xB6;//STC12C5A60S2系列sfrIPH=0xB7;sfrIP=0xB8;sfrSADEN=0xB9;sfrP_SW2=0xBA;sfrADC_CONTR=0xBC;//带AD系列sfrADC_RES=0xBD;//带AD系列sfrADC_RESL=0xBE;//带AD系列sfrP4=0xC0;sfrWDT_CONTR=0xC1;sfrIAP_DATA=0xC2;sfrIAP_ADDRH=0xC3;sfrIAP_ADDRL=0xC4;sfrIAP_CMD=0xC5;sfrIAP_TRIG=0xC6;sfrIAP_CONTR=0xC7;sfrISP_DATA=0xC2;sfrISP_ADDRH=0xC3;sfrISP_ADDRL=0xC4;sfrISP_CMD=0xC5;sfrISP_TRIG=0xC6;sfrISP_CONTR=0xC7;sfrP5=0xC8;//sfrP5M1=0xC9;//P5M1.n,P5M0.n=00---Standard,01---push-pullsfrP5M0=0xCA;//=10---pureinput,11---opendrainsfrP6M1=0xCB;//P5M1.n,P5M0.n=00---Standard,01---push-pullsfrP6M0=0xCC;//=10---pureinput,11---opendrainsfrSPSTAT=0xCD;//sfrSPCTL=0xCE;//sfrSPDAT=0xCF;//sfrPSW=0xD0;sfrT4T3M=0xD1;sfrT4H=0xD2;sfrT4L=0xD3;sfrT3H=0xD4;sfrT3L=0xD5;sfrT2H=0xD6;sfrT2L=0xD7;sfrTH4=0xD2;sfrTL4=0xD3;sfrTH3=0xD4;sfrTL3=0xD5;sfrTH2=0xD6;sfrTL2=0xD7;sfrRL_T4H=0xD2;sfrRL_T4L=0xD3;sfrRL_T3H=0xD4;sfrRL_T3L=0xD5;sfrRL_T2H=0xD6;sfrRL_T2L=0xD7;sfrCCON=0xD8;//sfrCMOD=0xD9;//sfrCCAPM0=0xDA;//PCA模块0的工作模式寄存器。sfrCCAPM1=0xDB;//PCA模块1的工作模式寄存器。sfrCCAPM2=0xDC;//PCA模块2的工作模式寄存器。sfrACC=0xE0;sfrP7M1=0xE1;sfrP7M0=0xE2;sfrCMPCR1=0xE6;sfrCMPCR2=0xE7;sfrP6=0xE8;sfrCL=0xE9;//sfrCCAP0L=0xEA;//PCA模块0的捕捉/比较寄存器低8位。sfrCCAP1L=0xEB;//PCA模块1的捕捉/比较寄存器低8位。sfrCCAP2L=0xEC;//PCA模块2的捕捉/比较寄存器低8位。sfrB=0xF0;sfrPCA_PWM0=0xF2;//PCA模块0PWM寄存器。sfrPCA_PWM1=0xF3;//PCA模块1PWM寄存器。sfrPCA_PWM2=0xF4;//PCA模块2PWM寄存器。sfrP7=0xF8;sfrCH=0xF9;sfrCCAP0H=0xFA;//PCA模块0的捕捉/比较寄存器高8位。sfrCCAP1H=0xFB;//PCA模块1的捕捉/比较寄存器高8位。sfrCCAP2H=0xFC;//PCA模块2的捕捉/比较寄存器高8位。/*BITRegisters*//*PSW*/sbitCY=PSW^7;sbitAC=PSW^6;sbitF0=PSW^5;sbitRS1=PSW^4;sbitRS0=PSW^3;sbitOV=PSW^2;sbitF1=PSW^1;sbitP=PSW^0;/*TCON*/sbitTF1=TCON^7;//定时器1溢出中断标志位sbitTR1=TCON^6;//定时器1运行控制位sbitTF0=TCON^5;//定时器0溢出中断标志位sbitTR0=TCON^4;//定时器0运行控制位sbitIE1=TCON^3;//外中断1标志位sbitIT1=TCON^2;//外中断1信号方式控制位,1:下降沿中断,0:上升下降均中断。sbitIE0=TCON^1;//外中断0标志位sbitIT0=TCON^0;//外中断0信号方式控制位,1:下降沿中断,0:上升下降均中断。/*P0*/sbitP00=P0^0;sbitP01=P0^1;sbitP02=P0^2;sbitP03=P0^3;sbitP04=P0^4;sbitP05=P0^5;sbitP06=P0^6;sbitP07=P0^7;/*P1*/sbitP10=P1^0;sbitP11=P1^1;sbitP12=P1^2;sbitP13=P1^3;sbitP14=P1^4;sbitP15=P1^5;sbitP16=P1^6;sbitP17=P1^7;sbitRXD2=P1^0;sbitTXD2=P1^1;sbitCCP1=P1^0;sbitCCP0=P1^1;sbitSPI_SS=P1^2;sbitSPI_MOSI=P1^3;sbitSPI_MISO=P1^4;sbitSPI_SCLK=P1^5;/*P2*/sbitP20=P2^0;sbitP21=P2^1;sbitP22=P2^2;sbitP23=P2^3;sbitP24=P2^4;sbitP25=P2^5;sbitP26=P2^6;sbitP27=P2^7;/*P3*/sbitP30=P3^0;sbitP31=P3^1;sbitP32=P3^2;sbitP33=P3^3;sbitP34=P3^4;sbitP35=P3^5;sbitP36=P3^6;sbitP37=P3^7;sbitRXD=P3^0;sbitTXD=P3^1;sbitINT0=P3^2;sbitINT1=P3^3;sbitT0=P3^4;sbitT1=P3^5;sbitWR=P3^6;sbitRD=P3^7;sbitCCP2=P3^7;sbitCLKOUT0=P3^5;sbitCLKOUT1=P3^4;/*P4*/sbitP40=P4^0;sbitP41=P4^1;sbitP42=P4^2;sbitP43=P4^3;sbitP44=P4^4;sbitP45=P4^5;sbitP46=P4^6;sbitP47=P4^7;/*P5*/sbitP50=P5^0;sbitP51=P5^1;sbitP52=P5^2;sbitP53=P5^3;sbitP54=P5^4;sbitP55=P5^5;sbitP56=P5^6;sbitP57=P5^7;/*SCON*/sbitSM0=SCON^7;//SM0/FESM0SM1=00~11:方式0~3sbitSM1=SCON^6;//sbitSM2=SCON^5;//多机通讯sbitREN=SCON^4;//接收允许sbitTB8=SCON^3;//发送数据第8位sbitRB8=SCON^2;//接收数据第8位sbitTI=SCON^1;//发送中断标志位sbitRI=SCON^0;//接收中断标志位/*IE*/sbitEA=IE^7;//中断允许总控制位sbitELVD=IE^6;//低压监测中断允许位sbitEADC=IE^5;//ADC中断允许位sbitES=IE^4;//串行中断允许控制位sbitET1=IE^3;//定时中断1允许控制位sbitEX1=IE^2;//外部中断1允许控制位sbitET0=IE^1;//定时中断0允许控制位sbitEX0=IE^0;//外部中断0允许控制位/*IP*//*sbitPPCA=IP^7;//PCA中断优先级设定位sbitPLVD=IP^6;//低压中断优先级设定位sbitPADC=IP^5;//ADC中断优先级设定位sbitPS=IP^4;//串行中断0优先级设定位sbitPT1=IP^3;//定时中断1优先级设定位sbitPX1=IP^2;//外部中断1优先级设定位sbitPT0=IP^1;//定时中断0优先级设定位sbitPX0=IP^0;//外部中断0优先级设定位*/sbitACC0=ACC^0;sbitACC1=ACC^1;sbitACC2=ACC^2;sbitACC3=ACC^3;sbitACC4=ACC^4;sbitACC5=ACC^5;sbitACC6=ACC^6;sbitACC7=ACC^7;sbitB0=B^0;sbitB1=B^1;sbitB2=B^2;sbitB3=B^3;sbitB4=B^4;sbitB5=B^5;sbitB6=B^6;sbitB7=B^7;//76543210ResetValue//sfrIE2=0xAF;------ESPIES20000,0000B//AuxiliaryInterrupt#defineSPI_INT_EN

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

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

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

×
保存成功