TR1 byte "Please input the first 64-bit in hex:first - second",0dh,0ah,0 string byte "remener :use enter to tell high 32-bit from low 32-bit",0dh,0ah,0 examp1 byte "eg: 1234ecdf",0dh,0ah,0 examp2 byte " 03ab2543",0dh,0ah,0
上传时间: 2014-08-22
上传用户:huyiming139
新版本TR1的stl, 想学习的赶快
上传时间: 2016-02-16
上传用户:曹云鹏
"TR1 roughly doubles the size of the C++ standard library, and it introduces many new facilities and even new kinds of library components. TR1 has some classes, for example, where some nested types may or may not exist depending on the template arguments. To programmers whose experience stops with the standard library, this is strange and unfamiliar. This book is complete (it covers all TR1 facilities), it is easier to understand than TR1 itself, and it is technically accurate."
标签: introduces facilities and the
上传时间: 2016-07-20
上传用户:aappkkee
80C51 汇编指令集:TF1:计时器1溢出标志位,当计时器1溢出,时此位=1,发出中断请求,然后硬件自动清0.TR1:计时器1的控制位,TR1=1时,计时开始,TR1=1时则停止。TF0:计时器0溢出标志位,当计时器0溢出,时此位=1,发出中断请求,然后硬件自动清0。TR0:计时器0的控制位,TR0=1时,计时开始,TR0=1时则停止。IE1:外部中断1的请求标志位,当外部中断有请求时,此位=1,发出中断请求,然后硬件自动清0。IT1:外部中断1的中断类型控制,当IT1=1时,边沿触发方式,下降沿触发有效,当IT1=0时,电平触发方式,低电平触发有效。P3.3信号触发。IE0:外部中断0的请求标志位,当外部中断有请求时,此位=1,发出中断请求,然后硬件自动清0。IT0:外部中断0的中断类型控制,当IT0=1时,边沿触发方式,下降沿触发有效,当IT0=0时,电平触发方式,低电平触发有效。P3.2信号触发
上传时间: 2013-11-17
上传用户:kangqiaoyibie
51单片连tcs230的源程序,绝对原创,可以记忆颜色。 #define uchar unsigned char #include <reg52.h> #include<math.h> sbit S0=P1^7 sbit S1=P1^0 //端口定义 sbit S2=P1^1 sbit S3=P1^2 sbit OE=P1^3 sbit OUT=P3^4 //频率从TO口输入 sbit key0=P1^5 sbit LED=P1^6 sbit a=P3^0 sbit b=P3^1 uchar color //1:blue 2:green 3:red uchar T[4] //color timer uchar TH[4] uchar TL[4] uchar bizhi[4] void time1() interrupt 3 { TH[color]=TH0 TL[color]=TL0 T[color]=(TH[color]*0xff+TL[color]) TR0=0 //关定时器 TR1=0 TH1=0xB1 TL1=0xE0 //归0 TH0=0x00 TL0=0x00 //归0 }
上传时间: 2016-11-26
上传用户:秦莞尔w
Boost provides free peer-reviewed portable C++ source libraries. We emphasize libraries that work well with the C++ Standard Library. Boost libraries are intended to be widely useful, and usable across a broad spectrum of applications. The Boost license encourages both commercial and non-commercial use. We aim to establish "existing practice" and provide reference implementations so that Boost libraries are suitable for eventual standardization. Ten Boost libraries are already included in the C++ Standards Committee s Library Technical Report (TR1) as a step toward becoming part of a future C++ Standard. More Boost libraries are proposed for the upcoming TR2. Boost works on almost any modern operating system, including UNIX and Windows variants. Follow the Getting Started Guide to download and install Boost. Popular Linux and Unix distributions such as Fedora, Debian, and NetBSD include pre-built Boost packages. Boost may also already be available on your organization s internal web server.
标签: libraries peer-reviewed emphasize provides
上传时间: 2016-12-05
上传用户:semi1981
void UART_init() { //初始化串行口和波特率发生器 SCON =0x58 //选择串口工作方式,打开接收允许 TMOD =0x21 //定时器1工作在方式2,定时器0工作在方式1 TH1 =0xfd //实现波特率9600(系统时钟11.0592MHZ) TR1 =1 //启动定时器T1 ET1 =0 ES=1 //允许串行口中断 PS=1 //设计串行口中断优先级 EA =1 //单片机中断允许 }
上传时间: 2014-08-30
上传用户:彭玖华
PC与单片机双向通讯智能温控程序 #include <AT89X51.H> #include <intrins.h> #define Key_UP P1_0 #define Key_DOWN P1_1 #define Key_SET P1_2 #define RelayOutPort P2_0 #define LEDPort P0 #define DELPort P2_1 #define LEDTwoC P3_6 #define LEDThreeC P3_7 #define TMPort P2_7 #define INBUF_LEN 5 //数据长度 unsigned char inbuf1[INBUF_LEN]={ 0 , 0 , 0 , 0 , 0 } //发送缓冲区 unsigned char inbuf2[50] //接收缓冲区 unsigned char count3 void init_serialcomm( void ) { SCON = 0x50 //SCON: serail mode 1, 8-bit UART, enable ucvr TMOD |= 0x20 //TMOD: timer 1, mode 2, 8-bit reload PCON |= 0x80 //SMOD=1 TH1 = 0xFA //Baud:4800 fosc=11.0592MHz IE |= 0x90 //Enable Serial Interrupt TR1 = 1 // timer 1 run } //向串口发送一个字符 void send_char_com( unsigned char ch) { SBUF=ch while (TI== 0 ) TI= 0
标签: include intrins define Key_UP
上传时间: 2014-11-29
上传用户:风之骄子
Boost C++ Libraries Free peer-reviewed portable C++ source libraries Boost C++ Libraries 基本上是一個免費的 C++ 的跨平台函式庫集合,基本上應該可以把它視為 C++ STL 的功能再延伸;他最大的特色在於他是一個經過「同行評審」(peer review,可參考維基百科)、開放原始碼的函式庫,而且有許多 Boost 的函式庫是由 C++ 標準委員會的人開發的,同時部分函式庫的功能也已經成為 C++ TR1 (Technical Report 1,參考維基百科)、TR2、或是 C++ 0x 的標準了。 它的官方網站是:http://www.boost.org/,包含了 104 個不同的 library;由於他提供的函式庫非常地多,的內容也非常地多元,根據官方的分類,大致上可以分為下面這二十類: 字串和文字處理(String and text processing) 容器(Containers) Iterators 演算法(Algorithms) Function objects and higher-order programming 泛型(Generic Programming) Template Metaprogramming Preprocessor Metaprogramming Concurrent Programming 數學與數字(Math and numerics) 正確性與測試(Correctness and testing) 資料結構(Data structures) 影像處理(Image processing) 輸入、輸出(Input/Output) Inter-language support 記憶體(Memory) 語法分析(Parsing) 程式介面(Programming Interfaces) 其他雜項 Broken compiler workarounds 其中每一個分類,又都包含了一個或多個函式庫,可以說是功能相當豐富。
上传时间: 2015-05-15
上传用户:fangfeng
/****************temic*********t5557***********************************/ #include <at892051.h> #include <string.h> #include <intrins.h> #include <stdio.h> #define uchar unsigned char #define uint unsigned int #define ulong unsigned long //STC12C2051AD的SFR定义 sfr WDT_CONTR = 0xe1;//stc2051的看门狗?????? /**********全局常量************/ //写卡的命令 #define write_command0 0//写密码 #define write_command1 1//写配置字 #define write_command2 2//密码写数据 #define write_command3 3//唤醒 #define write_command4 4//停止命令 #define TRUE 1 #define FALSE 0 #define OK 0 #define ERROR 255 //读卡的时间参数us #define ts_min 250//270*11.0592/12=249//取近似的整数 #define ts_max 304//330*11.0592/12=304 #define t1_min 73//90*11.0592/12=83:-10调整 #define t1_max 156//180*11.0592/12=166 #define t2_min 184//210*11.0592/12=194 #define t2_max 267//300*11.0592/12=276 //***********不采用中断处理:采用查询的方法读卡时关所有中断****************/ sbit p_U2270B_Standby = P3^5;//p_U2270B_Standby PIN=13 sbit p_U2270B_CFE = P3^3;//p_U2270B_CFE PIN=6 sbit p_U2270B_OutPut = P3^7;//p_U2270B_OutPut PIN=2 sbit wtd_sck = P1^7;//SPI总线 sbit wtd_si = P1^3; sbit wtd_so = P1^2; sbit iic_data = P1^2;//lcd IIC sbit iic_clk = P1^7; sbit led_light = P1^6;//测试绿灯 sbit led_light1 = P1^5;//测试红灯 sbit led_light_ok = P1^1;//读卡成功标志 sbit fengmingqi = P1^5; /***********全局变量************************************/ uchar data Nkey_a[4] = {0xA0, 0xA1, 0xA2, 0xA3};//初始密码 //uchar idata card_snr[4]; //配置字 uchar data bankdata[28] = {1,2,3,4,5,6,7,1,2,3,4,5,6,7,1,2,3,4,5,6,7,1,2,3,4,5,6,7}; //存储卡上用户数据(1-7)7*4=28 uchar data cominceptbuff[6] = {1,2,3,4,5,6};//串口接收数组ram uchar command; //第一个命令 uchar command1;// //uint temp; uchar j,i; uchar myaddr = 8; //uchar ywqz_count,time_count; //ywqz jishu: uchar bdata DATA; sbit BIT0 = DATA^0; sbit BIT1 = DATA^1; sbit BIT2 = DATA^2; sbit BIT3 = DATA^3; sbit BIT4 = DATA^4; sbit BIT5 = DATA^5; sbit BIT6 = DATA^6; sbit BIT7 = DATA^7; uchar bdata DATA1; sbit BIT10 = DATA1^0; sbit BIT11 = DATA1^1; sbit BIT12 = DATA1^2; sbit BIT13 = DATA1^3; sbit BIT14 = DATA1^4; sbit BIT15 = DATA1^5; sbit BIT16 = DATA1^6; sbit BIT17 = DATA1^7; bit i_CurrentLevel;//i_CurrentLevel BIT 00H(Saves current level of OutPut pin of U2270B) bit timer1_end; bit read_ok = 0; //缓存定时值,因用同一个定时器 union HLint { uint W; struct { uchar H;uchar L; } B; };//union HLint idata a union HLint data a; //缓存定时值,因用同一个定时器 union HLint0 { uint W; struct { uchar H; uchar L; } B; };//union HLint idata a union HLint0 data b; /**********************函数原型*****************/ //读写操作 void f_readcard(void);//全部读出1~7 AOR唤醒 void f_writecard(uchar x);//根据命令写不同的内容和操作 void f_clearpassword(void);//清除密码 void f_changepassword(void);//修改密码 //功能子函数 void write_password(uchar data *data p);//写初始密码或数据 void write_block(uchar x,uchar data *data p);//不能用通用指针 void write_bit(bit x);//写位 /*子函数区*****************************************************/ void delay_2(uint x) //延时,时间x*10us@12mhz,最小20us@12mhz { x--; x--; while(x) { _nop_(); _nop_(); x--; } _nop_();//WDT_CONTR=0X3C;不能频繁的复位 _nop_(); } ///////////////////////////////////////////////////////////////////// void initial(void) { SCON = 0x50; //串口方式1,允许接收 //SCON =0x50; //01010000B:10位异步收发,波特率可变,SM2=0不用接收到有效停止位才RI=1, //REN=1允许接收 TMOD = 0x21; //定时器1 定时方式2(8位),定时器0 定时方式1(16位) TCON = 0x40; //设定时器1 允许开始计时(IT1=1) TH1 = 0xfD; //FB 18.432MHz 9600 波特率 TL1 = 0xfD; //fd 11.0592 9600 IE = 0X90; //EA=ES=1 TR1 = 1; //启动定时器 WDT_CONTR = 0x3c;//使能看门狗 p_U2270B_Standby = 0;//单电源 PCON = 0x00; IP = 0x10;//uart you xian XXXPS PT1 PX1 PT0 PX0 led_light1 = 1; led_light = 0; p_U2270B_OutPut = 1; } /************************************************/ void f_readcard()//读卡 { EA = 0;//全关,防止影响跳变的定时器计时 WDT_CONTR = 0X3C;//喂狗 p_U2270B_CFE = 1;// delay_2(232); //>2.5ms /* // aor 用唤醒功能来防碰撞 p_U2270B_CFE = 0; delay_2(18);//start gap>150us write_bit(1);//10=操作码读0页 write_bit(0); write_password(&bankdata[24]);//密码block7 p_U2270B_CFE =1 ;// delay_2(516);//编程及确认时间5.6ms */ WDT_CONTR = 0X3C;//喂狗 led_light = 0; b.W = 0; while(!(read_ok == 1)) { //while(p_U2270B_OutPut);//等一个稳定的低电平?超时判断? while(!p_U2270B_OutPut);//等待上升沿的到来同步信号检测1 TR0 = 1; //deng xia jiang while(p_U2270B_OutPut);//等待下降沿 TR0 = 0; a.B.H = TH0; a.B.L = TL0; TH0 = TL0 = 0; TR0 = 1;//定时器晚启动10个周期 //同步头 if((324 < a.W) && (a.W < 353)) ;//检测同步信号1 else { TR0 = 0; TH0 = TL0 = 0; goto read_error; } //等待上升沿 while(!p_U2270B_OutPut); TR0 = 0; a.B.H = TH0; a.B.L = TL0; TH0 = TL0 = 0; TR0 = 1;//b.N1<<=8; if(a.B.L < 195);//0.5p else { TR0 = 0; TH0 = TL0 = 0; goto read_error; } //读0~7块的数据 for(j = 0;j < 28;j++) { //uchar i; for(i = 0;i < 16;i++)//8个位 { //等待下降沿的到来 while(p_U2270B_OutPut); TR0 = 0; a.B.H = TH0; a.B.L = TL0; TH0 = TL0 = 0; TR0 = 1; if(t2_max < a.W/*)&&(a.W < t2_max)*/)//1P { b.W >>= 2;//先左移再赋值 b.B.L += 0xc0; i++; } else if(t1_min < a.B.L/*)&&(a.B.L < t1_max)*/)//0.5p { b.W >>= 1; b.B.L += 0x80; } else { TR0 = 0; TH0 = TL0 = 0; goto read_error; } i++; while(!p_U2270B_OutPut);//上升 TR0 = 0; a.B.H = TH0; a.B.L = TL0; TH0 = TL0 = 0; TR0 = 1; if(t2_min < a.W/*)&&(a.W < t2_max)*/)//1P { b.W >>= 2; i++; } else if(t1_min < a.B.L/*a.W)&&(a.B.L < t1_max)*/)//0.5P //else if(!(a.W==0)) { b.W >>= 1; //temp+=0x00; //led_light1=0;led_light=1;delay_2(40000); } else { TR0 = 0; TH0 = TL0 = 0; goto read_error; } i++; } //取出奇位 DATA = b.B.L; BIT13 = BIT7; BIT12 = BIT5; BIT11 = BIT3; BIT10 = BIT1; DATA = b.B.H; BIT17 = BIT7; BIT16 = BIT5; BIT15 = BIT3; BIT14 = BIT1; bankdata[j] = DATA1; } read_ok = 1;//读卡完成了 read_error: _nop_(); } } /***************************************************/ void f_writecard(uchar x)//写卡 { p_U2270B_CFE = 1; delay_2(232); //>2.5ms //psw=0 standard write if (x == write_command0)//写密码:初始化密码 { uchar i; uchar data *data p; p = cominceptbuff; p_U2270B_CFE = 0; delay_2(31);//start gap>330us write_bit(1);//写操作码1:10 write_bit(0);//写操作码0 write_bit(0);//写锁定位0 for(i = 0;i < 35;i++) { write_bit(1);//写数据位1 } p_U2270B_CFE = 1; led_light1 = 0; led_light = 1; delay_2(40000);//测试使用 //write_block(cominceptbuff[4],p); p_U2270B_CFE = 1; bankdata[20] = cominceptbuff[0];//密码存入 bankdata[21] = cominceptbuff[1]; bankdata[22] = cominceptbuff[2]; bankdata[23] = cominceptbuff[3]; } else if (x == write_command1)//配置卡参数:初始化 { uchar data *data p; p = cominceptbuff; write_bit(1);//写操作码1:10 write_bit(0);//写操作码0 write_bit(0);//写锁定位0 write_block(cominceptbuff[4],p); p_U2270B_CFE= 1; } //psw=1 pssword mode else if(x == write_command2) //密码写数据 { uchar data*data p; p = &bankdata[24]; write_bit(1);//写操作码1:10 write_bit(0);//写操作码0 write_password(p);//发口令 write_bit(0);//写锁定位0 p = cominceptbuff; write_block(cominceptbuff[4],p);//写数据 } else if(x == write_command3)//aor //唤醒 { //cominceptbuff[1]操作码10 X xxxxxB uchar data *data p; p = cominceptbuff; write_bit(1);//10 write_bit(0); write_password(p);//密码 p_U2270B_CFE = 1;//此时数据不停的循环传出 } else //停止操作码 { write_bit(1);//11 write_bit(1); p_U2270B_CFE = 1; } p_U2270B_CFE = 1; delay_2(560);//5.6ms } /************************************/ void f_clearpassword()//清除密码 { uchar data *data p; uchar i,x; p = &bankdata[24];//原密码 p_U2270B_CFE = 0; delay_2(18);//start gap>150us //操作码10:10xxxxxxB write_bit(1); write_bit(0); for(x = 0;x < 4;x++)//发原密码 { DATA = *(p++); for(i = 0;i < 8;i++) { write_bit(BIT0); DATA >>= 1; } } write_bit(0);//锁定位0:0 p = &cominceptbuff[0]; write_block(0x00,p);//写新配置参数:pwd=0 //密码无效:即清除密码 DATA = 0x00;//停止操作码00000000B for(i = 0;i < 2;i++) { write_bit(BIT7); DATA <<= 1; } p_U2270B_CFE = 1; delay_2(560);//5.6ms } /*********************************/ void f_changepassword()//修改密码 { uchar data *data p; uchar i,x,addr; addr = 0x07;//block7 p = &Nkey_a[0];//原密码 DATA = 0x80;//操作码10:10xxxxxxB for(i = 0;i < 2;i++) { write_bit(BIT7); DATA <<= 1; } for(x = 0;x < 4;x++)//发原密码 { DATA = *(p++); for(i = 0;i < 8;i++) { write_bit(BIT7); DATA >>= 1; } } write_bit(0);//锁定位0:0 p = &cominceptbuff[0]; write_block(0x07,p);//写新密码 p_U2270B_CFE = 1; bankdata[24] = cominceptbuff[0];//密码存入 bankdata[25] = cominceptbuff[1]; bankdata[26] = cominceptbuff[2]; bankdata[27] = cominceptbuff[3]; DATA = 0x00;//停止操作码00000000B for(i = 0;i < 2;i++) { write_bit(BIT7); DATA <<= 1; } p_U2270B_CFE = 1; delay_2(560);//5.6ms } /***************************子函数***********************************/ void write_bit(bit x)//写一位 { if(x) { p_U2270B_CFE = 1; delay_2(32);//448*11.0592/120=42延时448us p_U2270B_CFE = 0; delay_2(28);//280*11.0592/120=26写1 } else { p_U2270B_CFE = 1; delay_2(92);//192*11.0592/120=18 p_U2270B_CFE = 0; delay_2(28);//280*11.0592/120=26写0 } } /*******************写一个block*******************/ void write_block(uchar addr,uchar data *data p) { uchar i,j; for(i = 0;i < 4;i++)//block0数据 { DATA = *(p++); for(j = 0;j < 8;j++) { write_bit(BIT0); DATA >>= 1; } } DATA = addr <<= 5;//0地址 for(i = 0;i < 3;i++) { write_bit(BIT7); DATA <<= 1; } } /*************************************************/ void write_password(uchar data *data p) { uchar i,j; for(i = 0;i < 4;i++)// { DATA = *(p++); for(j = 0;j < 8;j++) { write_bit(BIT0); DATA >>= 1; } } } /*************************************************/ void main() { initial(); TI = RI = 0; ES = 1; EA = 1; delay_2(28); //f_readcard(); while(1) { f_readcard(); //读卡 f_writecard(command1); //写卡 f_clearpassword(); //清除密码 f_changepassword(); //修改密码 } }
标签: 12345
上传时间: 2017-10-20
上传用户:my_lcs