freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

基于mp3播放器的設(shè)計(jì)畢業(yè)論文-資料下載頁

2025-06-27 18:04本頁面
  

【正文】 )。 ADD_LAMP()。//設(shè)置 LED 線為輸出OPEN_LAMP()。//開燈Delay_ms(200)。CLOSE_LAMP()。//關(guān)燈Delay_ms(200)。OPEN_LAMP()。//開燈SPI_Low()。 //SPI 低速度 SPI_init()。//SPI 初始化,設(shè)置方向LCD_init()。 //初始化 LCD 模塊 LCD_write_String(0,0,11,LCD_INT OK!,0)。SD_Reset()。//SD 卡復(fù)位LCD_write_String(0,2,12,SD reset OK!,0)。if(!SDInit())//SD 卡初始化LCD_write_String(0,3,11,SD INIT OK!,0)。else {LCD_write_String(0,3,11,SD INIT ER!,0)。while(1)。}SPI_Low()。 //SPI 低速度 SPI_init()。//SPI 初始化,設(shè)置方向if(VS1003B_Init())//VS1003B 初始化{ LCD_write_String(0,1,11,VS1003B ER!,0)。while(1)。}LCD_write_String(0,1,11,VS1003B OK!,0)。SPI_High()。//高速 SPI34if(FAT32_init())//FAT32 初始化 { LCD_write_String(0,4,12,Isn39。t FAT32.,0)。 while(1)。 }LCD_write_String(0,4,14,FAT32 INIT OK!,0)。Mp3_number_Counter()。//計(jì)算 MP3 的數(shù)量if(MP3_total==0){ LCD_write_String(0,5,13,HAVE NOT MP3!,0)。 //啟動(dòng) 3310 顯示沒有 MP3 文件 while(1)。}Delay_ms(500)。LCD_clear()。 //清屏LCD_write_String(20,5,1,,0)。ASCII(buffer,MP3_total)。//輸出 MP3 的數(shù)量LCD_write_String(26,5,2,buffer,0)。set_volume=EEPROM_read(0x02)。//從 EEPROM 中 0x02 地址讀出保存的音量VS1003B_set_VOL()。//設(shè)置音量DISP_VOL()。//顯示音量圖LCD_write_tubiao(0,5,2)。//暫停圖標(biāo)DAT_Directory()。//查找字庫key_init()。 //按鍵初始化MP3_current_number=(EEPROM_read(0x00)8)+EEPROM_read(0x01)。//讀取掉電保存的歌曲進(jìn)度}SD 卡部分ifndef SD_Hdefine SD_Hdefine SD_Write PORTB define SD_Direction_REG DDRB define SPI_DI 3 define SPI_DO 2 define SPI_Clock 1 35define SD_Chip_Select 0 define SPI_SS 0 define SD_Disable() SD_Write|=(1SD_Chip_Select)define SD_Enable() SD_Writeamp。=~(1SD_Chip_Select)define TRY_TIME 10 //向 SD 卡寫入命令之后,讀取 SD 卡的回應(yīng)次數(shù),即讀TRY_TIME 次,如果在 TRY_TIME 次中讀不到回應(yīng),產(chǎn)生超時(shí)錯(cuò)誤,命令寫入失敗//define INIT_CMD0_ERROR 0x01 //CMD0 錯(cuò)誤define INIT_CMD1_ERROR 0x02 //CMD1 錯(cuò)誤define WRITE_BLOCK_ERROR 0x03 //寫塊錯(cuò)誤define READ_BLOCK_ERROR 0x04 //讀塊錯(cuò)誤//extern unsigned char Write_Command_SD(unsigned char CMD,unsigned long address,unsigned char CRC,unsigned char response) 。extern unsigned char SD_Reset(void)。extern unsigned char SDInit(void)。extern unsigned char SD_read_Byte(unsigned long addr,unsigned char *Tmp_Buffer,unsigned int Bytes) 。extern unsigned char SD_read_sector(unsigned long Sector_NUM,unsigned char *Tmp_Buffer)。endif 文件:include extern unsigned char buffer[512]。 //緩存扇區(qū)的 512 個(gè)字節(jié) unsigned char Write_Command_SD(unsigned char CMD,unsigned long address,unsigned char CRC,unsigned char response) { unsigned char tmp。 unsigned char Timeout=0。 SD_Disable()。 SPI_WriteByte(0xFF)。 //提高兼容性,這里相當(dāng)重要SD_Enable()。 SPI_WriteByte(CMD|0x40)。//寫命令號(hào)SPI_WriteByte(address24)。//寫 4 字節(jié)參數(shù)SPI_WriteByte(address16)。36SPI_WriteByte(address8)。SPI_WriteByte(address)。SPI_WriteByte(CRC)。 //寫 CRCdo { tmp= SPI_ReadByte()。//一直讀,直到讀到的不是 0xff 或超時(shí) Timeout++。 }while((tmp!=response)amp。amp。(TimeoutTRY_TIME))。//return(tmp)。}unsigned char SD_Reset(void)//SD 卡復(fù)位,進(jìn)入 SPI 模式,使用 CMD0(命令 0){unsigned char i,temp,time=0。SD_Disable()。 for(i=0。i0x1f。i++)//復(fù)位時(shí),首先要發(fā)送最少 74 個(gè)時(shí)鐘信號(hào),這是必須的?。?!SPI_WriteByte(0xff)。//120 個(gè)時(shí)鐘SD_Enable()。//打開片選do { temp=Write_Command_SD(0x00,0x00,0x95,0x01)。//寫入命令 0,響應(yīng)值為 0x01 Delay_ms(10)。 if(time++TRY_TIME) { SD_Disable()。 //關(guān)閉片選 return(INIT_CMD0_ERROR)。//CMD0 寫入失敗 } }while(temp!=0x01)。//CMD0 的響應(yīng)為 0x01SD_Disable()。 //關(guān)閉片選SPI_WriteByte(0xff)。 //按照 SD 卡的操作時(shí)序在這里補(bǔ) 8 個(gè)時(shí)鐘 return 0。//返回 0,說明復(fù)位操作成功}unsigned char SDInit(void){ unsigned char time=0,temp。37SD_Enable()。 //打開片選do{ temp=Write_Command_SD(0x01,0,0xff,0x00)。//寫入 CMD1 Delay_ms(10)。 if(time++TRY_TIME) { SD_Disable()。 //關(guān)閉片選 return(INIT_CMD1_ERROR)。//CMD1 寫入失敗 } }while(temp!=0x00)。//CMD1 的響應(yīng)為 0x00 SD_Disable()。 //關(guān)閉片選 SPI_WriteByte(0xff)。 //按照 SD 卡的操作時(shí)序在這里補(bǔ) 8 個(gè)時(shí)鐘return(0)。 //返回 0,說明初始化操作成功} unsigned char SD_read_sector(unsigned long Sector_NUM,unsigned char *Tmp_Buffer) { unsigned int i。unsigned char temp=0,retry=0。SD_Enable()。 do { temp=Write_Command_SD(17,Sector_NUM9,0xff,0x00)。//寫入 CMD17 if (retry++TRY_TIME) return READ_BLOCK_ERROR。 }while(temp!=0) 。 while(SPI_ReadByte()!=0xfe)。 //讀到 0xfe 報(bào)頭 for(i=0。i512。i++) Tmp_Buffer[i]=SPI_ReadByte()。 //連續(xù)讀出一扇區(qū)數(shù)據(jù)SPI_ReadByte()。 //讀 2 個(gè) CRC 校驗(yàn)字節(jié)SPI_ReadByte()。 SD_Disable()。 SPI_WriteByte(0xff)。 //補(bǔ)一個(gè)字節(jié)return 0。 38} unsigned char SD_read_Byte(unsigned long addr,unsigned char *Tmp_Buffer,unsigned int Bytes) { unsigned char i。unsigned int temp1。unsigned long temp。temp=addr/512。temp1=addr%512。if((temp1+Bytes)512){SD_read_sector(temp,buffer)。//讀一扇區(qū)for(i=0。iBytes。i++)*Tmp_Buffer++=buffer[temp1+i]。//取需要的數(shù)據(jù)} else。}5110.Hifndef NOKIA5110_Hdefine NOKIA5110_Hdefine LCD_DC BIT(4)define LCD_CE BIT(5)define LCD_PORT PORTBdefine LCD_DIR DDRBdefine LCD_IN PINBdefine LCD_Lamp BIT(7) //PB0define LCD_Lamp_DIR DDRBdefine LCD_Lamp_PORT PORTBdefine ADD_LAMP() SETBIT(LCD_Lamp_DIR,LCD_Lamp)define CLOSE_LAMP() SETBIT(LCD_Lamp_PORT,LCD_Lamp)define OPEN_LAMP() CLEARBIT(LCD_Lamp_PORT,LCD_Lamp)define Enable_5110() CLEARBIT(LCD_PORT,LCD_CE)define Disable_5110() SETBIT(LCD_PORT,LCD_CE)。39extern void LCD_init(void)。extern void LCD_clear(void)。extern void LCD_write_String(unsigned char X,unsigned char Y,unsigned char l,unsigned char *s,unsigned char N)。extern void LCD_write_char(unsigned char c,unsigned char N)。extern void LCD_write_byte(unsigned char data, unsigned char mand)。extern void LCD_set_XY(unsigned char X, unsigned char Y)。extern v endifinclude const unsigned char font6x8[][6] ={{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },// sp{ 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00 },// !{ 0x00, 0x00, 0x07, 0x00, 0x07, 0x00 },// { 0x00, 0x14, 0x7f, 0x14, 0x7f, 0x14 },// { 0x00, 0x
點(diǎn)擊復(fù)制文檔內(nèi)容
環(huán)評(píng)公示相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1