亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ata_8c-source.html

?? ATMEL的AVR單片機庫文件
?? HTML
?? 第 1 頁 / 共 3 頁
字號:
00408     cyl = (<span class="keywordtype">int</span>) ( lba &amp; 0x0000ffff );00409     lba = lba &gt;&gt; 16;00410     head = ( (<span class="keywordtype">int</span>) ( lba &amp; 0x0fL ) ) | ATA_HEAD_USE_LBA;00411 00412     temp = ataWriteSectorsCHS( Drive, head, cyl, sect, numsectors, Buffer );00413 00414     <span class="keywordflow">if</span>(temp)00415         ataDiskErr();00416     <span class="keywordflow">return</span> temp;00417 }                                   00418 00419 00420 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> ataReadSectors(   <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> Drive, 00421                                         <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> lba,00422                                         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> numsectors,00423                                 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *Buffer)00424 {00425     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> cyl, head, sect;00426     <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> temp;00427 00428     <span class="comment">// check if drive supports native LBA mode</span>00429     <span class="keywordflow">if</span>(ataDriveInfo.LBAsupport)00430     {00431         <span class="comment">// drive supports using native LBA</span>00432         temp = ataReadSectorsLBA(Drive, lba, numsectors, Buffer);00433     }00434     <span class="keywordflow">else</span>00435     {00436         <span class="comment">// drive required CHS access</span>00437 <span class="preprocessor">        #ifdef DEBUG_ATA</span>00438 <span class="preprocessor"></span>            <span class="comment">// do this defore destroying lba</span>00439             rprintfProgStrM(<span class="stringliteral">"ATA LBA for CHS read: "</span>);00440             rprintfProgStrM(<span class="stringliteral">"LBA="</span>); <a class="code" href="rprintf_8h.html#a15">rprintfu32</a>(lba); rprintfProgStrM(<span class="stringliteral">" "</span>);00441 <span class="preprocessor">        #endif</span>00442 <span class="preprocessor"></span>00443         <span class="comment">// convert LBA to pseudo CHS</span>00444         <span class="comment">// remember to offset the sector count by one</span>00445         sect = (u08) (lba % ataDriveInfo.sectors)+1;00446         lba = lba / ataDriveInfo.sectors;00447         head = (u08) (lba % ataDriveInfo.heads);00448         lba = lba / ataDriveInfo.heads;00449         cyl = (u16) lba;00450 00451 <span class="preprocessor">        #ifdef DEBUG_ATA</span>00452 <span class="preprocessor"></span>            rprintfProgStrM(<span class="stringliteral">"C:H:S="</span>);00453             <a class="code" href="rprintf_8h.html#a14">rprintfu16</a>(cyl); rprintfProgStrM(<span class="stringliteral">":"</span>);00454             <a class="code" href="rprintf_8h.html#a13">rprintfu08</a>(head); rprintfProgStrM(<span class="stringliteral">":"</span>);00455             <a class="code" href="rprintf_8h.html#a13">rprintfu08</a>(sect); <a class="code" href="rprintf_8c.html#a9">rprintfCRLF</a>();00456 <span class="preprocessor">        #endif</span>00457 <span class="preprocessor"></span>00458         temp = ataReadSectorsCHS( Drive, head, cyl, sect, numsectors, Buffer );00459     }00460 00461     <span class="keywordflow">if</span>(temp)00462         ataDiskErr();00463     <span class="keywordflow">return</span> temp;00464 }00465 00466 00467 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> ataWriteSectors(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> Drive, 00468                                         <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> lba,00469                                         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> numsectors,00470                                 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *Buffer)00471 {00472     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> cyl, head, sect;00473     <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> temp;00474 00475     <span class="comment">// check if drive supports native LBA mode</span>00476     <span class="keywordflow">if</span>(ataDriveInfo.LBAsupport)00477     {00478         <span class="comment">// drive supports using native LBA</span>00479         temp = ataWriteSectorsLBA(Drive, lba, numsectors, Buffer);00480     }00481     <span class="keywordflow">else</span>00482     {00483         <span class="comment">// drive required CHS access</span>00484 <span class="preprocessor">        #ifdef DEBUG_ATA</span>00485 <span class="preprocessor"></span>            <span class="comment">// do this defore destroying lba</span>00486             rprintfProgStrM(<span class="stringliteral">"ATA LBA for CHS write: "</span>);00487             rprintfProgStrM(<span class="stringliteral">"LBA="</span>); <a class="code" href="rprintf_8h.html#a15">rprintfu32</a>(lba); rprintfProgStrM(<span class="stringliteral">" "</span>);00488 <span class="preprocessor">        #endif</span>00489 <span class="preprocessor"></span>00490         <span class="comment">// convert LBA to pseudo CHS</span>00491         <span class="comment">// remember to offset the sector count by one</span>00492         sect = (u08) (lba % ataDriveInfo.sectors)+1;00493         lba = lba / ataDriveInfo.sectors;00494         head = (u08) (lba % ataDriveInfo.heads);00495         lba = lba / ataDriveInfo.heads;00496         cyl = (u16) lba;00497 00498 <span class="preprocessor">        #ifdef DEBUG_ATA</span>00499 <span class="preprocessor"></span>            rprintfProgStrM(<span class="stringliteral">"C:H:S="</span>);00500             <a class="code" href="rprintf_8h.html#a14">rprintfu16</a>(cyl); rprintfProgStrM(<span class="stringliteral">":"</span>);00501             <a class="code" href="rprintf_8h.html#a13">rprintfu08</a>(head); rprintfProgStrM(<span class="stringliteral">":"</span>);00502             <a class="code" href="rprintf_8h.html#a13">rprintfu08</a>(sect); <a class="code" href="rprintf_8c.html#a9">rprintfCRLF</a>();00503 <span class="preprocessor">        #endif</span>00504 <span class="preprocessor"></span>00505         temp = ataWriteSectorsCHS( Drive, head, cyl, sect, numsectors, Buffer );00506     }00507 00508     <span class="keywordflow">if</span>(temp)00509         ataDiskErr();00510     <span class="keywordflow">return</span> temp;00511 }                                   00512 00513 <span class="keywordtype">void</span> ataDriveSelect(u08 DriveNo)00514 {00515     ataWriteByte(ATA_REG_HDDEVSEL, 0xA0+(DriveNo ? 0x10:00)); <span class="comment">// Drive selection</span>00516 }00517  00518 <span class="comment">//----------------------------------------------------------------------------</span>00519 <span class="comment">// Set drive mode (STANDBY, IDLE)</span>00520 <span class="comment">//----------------------------------------------------------------------------</span>00521 <span class="comment">/*#define STANDBY 0</span>00522 <span class="comment">#define IDLE    1</span>00523 <span class="comment">#define SLEEP   2 </span>00524 <span class="comment">*/</span> 00525 00526 <span class="comment">/*</span>00527 <span class="comment">unsigned char SetMode(unsigned char DriveNo, unsigned char Mode, unsigned char PwrDown) </span>00528 <span class="comment">{</span>00529 <span class="comment">  WriteBYTE(CMD, 6, 0xA0 + (DriveNo ? 0x10:0x00)); // Select drive</span>00530 <span class="comment">  WriteBYTE(CMD, 2, (PwrDown ? 0x01:0x00)); // Enable automatic power down</span>00531 <span class="comment">  switch (Mode) </span>00532 <span class="comment">  {</span>00533 <span class="comment">    case STANDBY: WriteBYTE(CMD,7, 0xE2); break;</span>00534 <span class="comment">    case IDLE:    WriteBYTE(CMD,7, 0xE3); break;</span>00535 <span class="comment">    // NOTE: To recover from sleep, either issue a soft or hardware reset !</span>00536 <span class="comment">    // (But not on all drives, f.ex seagate ST3655A it's not nessecary to reset</span>00537 <span class="comment">    // but only to go in Idle mode, But on a Conner CFA170A it's nessecary with</span>00538 <span class="comment">    // a reset)</span>00539 <span class="comment">    case SLEEP:   WriteBYTE(CMD,7, 0xE6); break;</span>00540 <span class="comment">  }</span>00541 <span class="comment">  Timer10mSec=10000;</span>00542 <span class="comment">  while ((ReadBYTE(CMD,7) &amp; 0xC0)!=0x40 &amp;&amp; Timer10mSec); // Wait for DRDY &amp; NOT BUSY </span>00543 <span class="comment">  if (Timer10mSec==0) return 0xFF;                       //   or timeout</span>00544 <span class="comment"> </span>00545 <span class="comment">  // Return the error register...</span>00546 <span class="comment">  return ReadBYTE(CMD, 1);</span>00547 <span class="comment">}</span>00548 <span class="comment"></span>00549 <span class="comment">*/</span>00550 00551 u08 ataReadByte(u08 reg)00552 {00553     <span class="keyword">register</span> u08 ret;00554     <span class="comment">//sbi(MCUCR, SRW);          // enable RAM waitstate</span>00555     ret = *((<span class="keyword">volatile</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>*) ATA_REG_BASE + reg);00556     <span class="comment">//cbi(MCUCR, SRW);          // disable RAM waitstate</span>00557     <span class="keywordflow">return</span> ret;00558 }00559 00560 <span class="keywordtype">void</span> ataWriteByte(u08 reg, u08 data)00561 {00562     <span class="comment">//sbi(MCUCR, SRW);          // enable RAM waitstate</span>00563     *((<span class="keyword">volatile</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>*) ATA_REG_BASE + reg) = data;00564     <span class="comment">//cbi(MCUCR, SRW);          // disable RAM waitstate</span>00565 }00566 00567  00568 <span class="keywordtype">void</span> ataShowRegisters(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> DriveNo) 00569 { 00570     ataWriteByte(ATA_REG_HDDEVSEL, 0xA0 + (DriveNo ? 0x10:0x00)); <span class="comment">// Select drive</span>00571     00572     rprintfProgStrM(<span class="stringliteral">"R0: DATALOW  = 0x"</span>);   <a class="code" href="rprintf_8h.html#a13">rprintfu08</a>(ataReadByte(ATA_REG_DATAL    ));     rprintfProgStrM(<span class="stringliteral">" \r\n"</span>);00573     rprintfProgStrM(<span class="stringliteral">"R1: ERROR    = 0x"</span>);   <a class="code" href="rprintf_8h.html#a13">rprintfu08</a>(ataReadByte(ATA_REG_ERROR    ));     rprintfProgStrM(<span class="stringliteral">" \r\n"</span>);00574     rprintfProgStrM(<span class="stringliteral">"R2: SECT CNT = 0x"</span>);   <a class="code" href="rprintf_8h.html#a13">rprintfu08</a>(ataReadByte(ATA_REG_SECCOUNT));      rprintfProgStrM(<span class="stringliteral">" \r\n"</span>);00575     rprintfProgStrM(<span class="stringliteral">"R3: SECT NUM = 0x"</span>);   <a class="code" href="rprintf_8h.html#a13">rprintfu08</a>(ataReadByte(ATA_REG_STARTSEC));      rprintfProgStrM(<span class="stringliteral">" \r\n"</span>);00576     rprintfProgStrM(<span class="stringliteral">"R4: CYL LOW  = 0x"</span>);   <a class="code" href="rprintf_8h.html#a13">rprintfu08</a>(ataReadByte(ATA_REG_CYLLO    ));     rprintfProgStrM(<span class="stringliteral">" \r\n"</span>);00577     rprintfProgStrM(<span class="stringliteral">"R5: CYL HIGH = 0x"</span>);   <a class="code" href="rprintf_8h.html#a13">rprintfu08</a>(ataReadByte(ATA_REG_CYLHI    ));     rprintfProgStrM(<span class="stringliteral">" \r\n"</span>);00578     rprintfProgStrM(<span class="stringliteral">"R6: HEAD/DEV = 0x"</span>);   <a class="code" href="rprintf_8h.html#a13">rprintfu08</a>(ataReadByte(ATA_REG_HDDEVSEL));      rprintfProgStrM(<span class="stringliteral">" \r\n"</span>);00579     rprintfProgStrM(<span class="stringliteral">"R7: CMD/STA  = 0x"</span>);   <a class="code" href="rprintf_8h.html#a13">rprintfu08</a>(ataReadByte(ATA_REG_CMDSTATUS1));    rprintfProgStrM(<span class="stringliteral">"\r\n"</span>);00580 } 00581 00582 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> ataSWReset(<span class="keywordtype">void</span>)00583 {00584     ataWriteByte(ATA_REG_HDDEVSEL, 0x06);   <span class="comment">// SRST and nIEN bits</span>00585     delay(10);  <span class="comment">// 10uS delay</span>00586     ataWriteByte(ATA_REG_HDDEVSEL, 0x02);   <span class="comment">// nIEN bits</span>00587     delay(10);  <span class="comment">// 10 uS delay</span>00588    00589    <span class="keywordflow">while</span>( (ataReadByte(ATA_REG_CMDSTATUS1) &amp; 0xC0) != 0x40 ); <span class="comment">// Wait for DRDY and not BSY</span>00590     00591     <span class="keywordflow">return</span> ataReadByte(ATA_REG_CMDSTATUS1) + ataReadByte(ATA_REG_ERROR);00592 }00593 00594 <span class="comment">/*</span>00595 <span class="comment">unsigned char ATA_Idle(unsigned char Drive)</span>00596 <span class="comment">{</span>00597 <span class="comment"></span>00598 <span class="comment">  WriteBYTE(CMD, 6, 0xA0 + (Drive ? 0x10:0x00)); // Select drive</span>00599 <span class="comment">  WriteBYTE(CMD,7, 0xE1);</span>00600 <span class="comment"></span>00601 <span class="comment">  while ((ReadBYTE(CMD,7) &amp; 0xC0)!=0x40); // Wait for DRDY &amp; NOT BUSY </span>00602 <span class="comment"></span>00603 <span class="comment">  // Return the error register...</span>00604 <span class="comment">  return ReadBYTE(CMD, 1);</span>00605 <span class="comment">}</span>00606 <span class="comment">*/</span></pre></div><hr size="1"><address style="align: right;"><small>Generated on Fri Oct 15 03:50:21 2004 for Procyon AVRlib by<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border=0 > </a>1.3.6 </small></address></body></html>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲综合激情小说| 99精品久久免费看蜜臀剧情介绍| 欧美日韩视频第一区| 亚洲国产aⅴ天堂久久| 在线播放中文一区| 日韩电影在线免费观看| 911精品国产一区二区在线| 国产在线精品一区二区| 日韩欧美一二区| 国产盗摄女厕一区二区三区| 国产精品国产三级国产有无不卡| 不卡视频在线看| 一区二区三区在线观看国产| 欧美人体做爰大胆视频| 日韩国产精品91| 精品日韩99亚洲| 91在线云播放| 精品亚洲免费视频| 亚洲免费在线观看视频| 在线免费精品视频| 免费观看在线综合色| 国产免费成人在线视频| 91国产精品成人| 国产乱码精品1区2区3区| 亚洲一区二区三区四区在线 | 亚洲午夜私人影院| 欧美电视剧在线观看完整版| 成人丝袜视频网| 精品一区二区三区免费毛片爱| 欧美激情综合五月色丁香| 久久蜜桃一区二区| 欧美精品v国产精品v日韩精品 | 99久久国产综合精品色伊| 日韩一区精品字幕| 亚洲精品一二三| 久久久久久夜精品精品免费| 欧美浪妇xxxx高跟鞋交| 在线观看三级视频欧美| www.亚洲色图| 成人夜色视频网站在线观看| 国产精品综合二区| 国产一区二区福利视频| 久久国产婷婷国产香蕉| 久久99精品国产麻豆不卡| 日本系列欧美系列| 日韩国产欧美在线播放| 另类小说色综合网站| 麻豆高清免费国产一区| 蜜臀av性久久久久av蜜臀妖精| 蜜臀99久久精品久久久久久软件| 日韩成人午夜精品| 久久精品国产免费| 国产成人综合自拍| 99久久久免费精品国产一区二区| 91麻豆123| 欧美老肥妇做.爰bbww| 欧美一区二区三区免费视频 | 91黄色免费看| 欧美日韩日日夜夜| 久久蜜桃av一区精品变态类天堂| 国产精品毛片无遮挡高清| 最近日韩中文字幕| 午夜欧美视频在线观看| 九九精品视频在线看| 成人免费毛片高清视频| 色婷婷综合久久久中文一区二区 | 欧美日韩和欧美的一区二区| 欧美喷潮久久久xxxxx| 精品美女在线播放| 一区二区三区高清在线| 精品一区二区三区免费| 成人白浆超碰人人人人| 这里只有精品电影| 国产精品福利影院| 美女脱光内衣内裤视频久久网站 | 欧美激情综合五月色丁香小说| 亚洲精品免费看| 懂色av一区二区三区免费看| 日韩欧美国产综合| 亚洲午夜久久久久久久久久久 | 91啪九色porn原创视频在线观看| 8v天堂国产在线一区二区| 国产精品电影一区二区| 国产精品综合视频| 欧美一区二区三区喷汁尤物| 亚洲精品自拍动漫在线| bt欧美亚洲午夜电影天堂| 久久夜色精品一区| 激情图片小说一区| 精品少妇一区二区三区免费观看| 午夜久久久影院| 欧洲精品中文字幕| 一区二区三区视频在线观看| 91性感美女视频| 亚洲午夜av在线| 欧美二区三区91| 免费在线成人网| 日韩欧美123| 国产91精品露脸国语对白| 国产午夜精品久久久久久免费视| 加勒比av一区二区| 欧美电影免费观看完整版| 老色鬼精品视频在线观看播放| 精品乱人伦小说| 国产成a人亚洲| 亚洲男人天堂一区| 4438x成人网最大色成网站| 久久国产福利国产秒拍| 国产女人aaa级久久久级| 日本高清不卡在线观看| 免费不卡在线观看| 国产精品不卡视频| 日韩视频永久免费| 国产精品88888| 一区二区三区四区在线免费观看| 欧美老人xxxx18| 成人在线视频一区二区| 五月激情综合网| 欧美激情综合在线| 欧美久久久久中文字幕| 高清国产午夜精品久久久久久| 亚洲va韩国va欧美va精品| 国产欧美一区二区三区网站| 欧美最猛性xxxxx直播| 国产91在线观看丝袜| 日韩精品乱码av一区二区| 国产精品久久久久久久久久免费看 | 青青草国产成人av片免费| 亚洲免费观看高清完整版在线 | 日韩网站在线看片你懂的| 91丨porny丨在线| 成人h动漫精品一区二| 久久99精品国产.久久久久久| 亚洲高清免费一级二级三级| 国产精品福利一区二区三区| 久久久久免费观看| 亚洲精品在线免费播放| 欧美mv日韩mv| 久久在线观看免费| 久久久久国产精品免费免费搜索| 欧美变态tickling挠脚心| 9191成人精品久久| 91精品国产综合久久久蜜臀图片| 欧美性感一类影片在线播放| 在线观看日韩高清av| 欧美伦理影视网| 精品国产乱码久久久久久牛牛 | 4438x成人网最大色成网站| 欧美日韩一区高清| 欧美日韩国产天堂| 欧美一级爆毛片| 久久精品视频一区二区| 欧美国产精品专区| 一区二区三区四区激情| 午夜日韩在线观看| 激情图区综合网| 91在线码无精品| 欧美日韩mp4| 国产调教视频一区| 亚洲一卡二卡三卡四卡五卡| 免费人成网站在线观看欧美高清| 国产资源精品在线观看| 成人涩涩免费视频| 欧美日韩在线免费视频| 久久综合九色综合欧美98| 一区二区在线免费| 国产精品正在播放| 欧美精品粉嫩高潮一区二区| 国产亚洲欧美激情| 午夜精品免费在线| 99热这里都是精品| 久久午夜羞羞影院免费观看| 亚洲影院免费观看| 成人动漫一区二区在线| 欧美xxxxx裸体时装秀| 亚洲色图都市小说| 高清av一区二区| 日韩一区二区三区视频在线| 亚洲人成影院在线观看| 国产成人综合在线播放| 精品日韩在线观看| 日本欧美加勒比视频| 欧美综合天天夜夜久久| 国产精品国产三级国产专播品爱网 | 欧美精品国产精品| 综合久久综合久久| 不卡av在线免费观看| 久久久蜜桃精品| 免费av成人在线| 欧美肥妇bbw| 日本网站在线观看一区二区三区| 欧美中文字幕一区二区三区亚洲| 亚洲三级在线免费观看| www.亚洲精品| 亚洲另类春色校园小说| 日本黄色一区二区| 亚洲在线免费播放| 日韩一区二区三区在线| 美女高潮久久久| 国产欧美日韩亚州综合|