51单片机的ds1302驱动程序
RCC_Clocks->SYSCLK_Frequency= (HSE_Value >> for(i=8; i> ACC = ACC >> ds1302-> ds1302-> ds1302-> ds1302-> ds1302-> ds1302-> ds1302-> ds1302->timestr[0] = ds1302-> ds1302->timestr[1] = ds1302-> ds1302-> ds1302-> ds1302-> ds1302->timestr[3] = ds1302-> ds1302->timestr[4] = ds1302-> ds1302-> ds1302-> ds1302-> ds1302->timestr[6] = ds1302-> ds1302->timestr[7] = ds1302-> ds1302-> ds1302-> ds1302-> 成液晶显示字符串,放到数组里DateString[] { if(flagyear<2) //这里的if,else语句都是判断位闪烁,<2显示数据,>2就不显示,输出字符串为 2007/07/22 { ds1302->datestr[0] = 2; ds1302->datestr[1] = 0; ds1302->datestr[2] = ds1302->Year/10 + 0; ds1302->datestr[3] = ds1302->Year%10 + 0; } else { ds1302->datestr[0] = ; ds1302->datestr[1] = ; ds1302->datestr[2] = ; ds1302->datestr[3] = ; } ds1302->datestr[4] = /; if(flagmonth<2) { ds1302->datestr[5] = ds1302->Month/10 + 0; ds1302->datestr[6] = ds1302->Month%10 + 0; } else { ds1302->datestr[5] = ; ds1302->datestr[6] = ; } ds1302->datestr[7] = /; if(flagday<2) { ds1302->datestr[8] = ds1302->Day/10 + 0; ds1302->datestr[9] = ds1302->Day%10 + 0; } else { ds1302->datestr[8] = ; ds1302->datestr[9] = ; } if(flagweek<2) { week_value[0] = ds1302->Week%10 + 0; //星期的数据另外放到 week_value[]数组里,跟年,月,日的分开存放,因为等一下要在最后显示 } else { week_value[0] = ; } week_value[1] = ; ds1302->datestr[10] = ; //字符串末尾加 ,判断结束字符 }
51单片机ds1302驱动程 相关文章:
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)