电子书阅读器单片机源程序如下:
- #include "stc15f2k60s2.h"
- #include "intrins.h"
- #include "sys.h"
- #include "lcd.h"
- #include "sd.h"
- #include "znfat.h"
- #include "module.h"
- unsigned long int zk_sec;
- unsigned char key;
- sbit INT1 = 0xB3;
- unsigned long int get_zk_sec(){
- struct FileInfo zk;
- unsigned long int re;
- if(!znFAT_Open_File(&zk,"/System/batter.zk",0,1)){
- re=zk.File_CurSec;
- znFAT_Close_File(&zk);
- znFAT_Flush_FS();
- }
- else return 0xffffffff;
- return re;
- }
- void key_board() interrupt 2{
- key=P3;
- }
- void pro_main(){
- unsigned char id;
- while(1){
- show_title();
- show_bar();
- id=get_bookid();
- read_book(id);
- }
- }
- void main(){
-
- struct znFAT_Init_Args fatag;
-
- fatag.BPB_Sector_No=0;
- fatag.Total_SizeKB=7761920L;
- fatag.BytesPerSector=512;
- fatag.FATsectors=30262;
- fatag.SectorsPerClust=8;
- fatag.FirstFATSector=34;
- fatag.FirstDirSector=30296;
- fatag.FSINFO_Sec=1;
- fatag.Free_nCluster=1936691L;
- fatag.Next_Free_Cluster=4;
-
- INT1=1;
- IT1=1;
- EX1=1;
- EA=1;
-
-
- lcd_init();
-
- delayms(300);
-
- lcd_clear(COLOR_SW(0x999999));
-
- delayms(300);
-
- ……………………
- …………限于本文篇幅 余下代码请从51黑下载附件…………
复制代码
Keil代码下载:
51电子书.zip
(403.65 KB, 下载次数: 117)
|