標題: AT45DB041B AT45DB161D各種單片機驅(qū)動程序及其pdf下載 [打印本頁]

作者: wudawei    時間: 2014-12-31 21:45
標題: AT45DB041B AT45DB161D各種單片機驅(qū)動程序及其pdf下載
at45db161d.rar (4.97 MB, 下載次數(shù): 184)


作者: wudawei    時間: 2014-12-31 22:01
AT45DB161D 擦除算法:// 1 Chip = 16 Sectors = 512 Blocks = 4096 Pages
//            1 Sector = 32 Blocks  = 256 Pages
//                          1 Block = 8 Pages
//------------------------------------------------------------------------------
// Pm ... Pn [Bm ... Bn] [Sm ... Sn] [Bm ... Bn] Pm ... Pn
//------------------------------------------------------------------------------
// Caller must make dwAddress in Page boundary
// Example : AT45_ErasePages(247*512, 1+1*8+1*256+1*8+1);
//
void AT45_ErasePages(u32 dwAddress, u32 dwPageCount)
{
  if ( dwPageCount == 0)
    return;
  if ( ( dwAddress == 0) && ( dwPageCount >= 4096) )
  {
    AT45_ChipErase();
    return;
  }
  if ( dwPageCount >= 256 )
  {
    if ( (dwAddress & 0x1FFFF) == 0x00000000 )   // At Sector boundary
    {
      while ( dwPageCount >= 256 )
      {
        AT45_SectorErase(dwAddress);
        dwAddress += 256 * 512;
        dwPageCount -= 256;
      }
      BOOT_AT45_ErasePages(dwAddress, dwPageCount);
      return;
    }
  }
  if ( dwPageCount >= 8 )                      // Erase Blocks until Sector boundary
  {
    if ( (dwAddress & 0xFFF) == 0x00000000 )   // At Block boundary
    {
      while ( dwPageCount >= 8 )
      {
        if ( (dwAddress & 0x1FFFF) == 0x00000000 )   // At Sector boundary
        {
          if ( dwPageCount >= 256 )
          {
            BOOT_AT45_ErasePages(dwAddress, dwPageCount);
            return;
          }
        }
        AT45_BlockErase(dwAddress);
        dwAddress += 8 * 512;
        dwPageCount -= 8;
      }
      BOOT_AT45_ErasePages(dwAddress, dwPageCount);
      return;
    }
  }
  while ( dwPageCount > 0 )                    // Erase Pages until Block boundary
  {
    if ( (dwAddress & 0xFFF) == 0x00000000 )   // At Block boundary
    {
      if ( dwPageCount >= 8 )
      {
        BOOT_AT45_ErasePages(dwAddress, dwPageCount);
        return;
      }
    }
    AT45_PageErase(dwAddress);
    dwAddress += 1*512;
    dwPageCount -= 1;
  }
}

作者: owenql    時間: 2015-9-23 10:28
好東西啊,贊一個
作者: meimeide    時間: 2016-1-30 23:50
hao,henhao
作者: 648742653@qq.co    時間: 2016-3-21 10:44
好資料 學習一下
作者: fsss007    時間: 2016-4-9 20:50
下載了,看看我會不會用
作者: proe40    時間: 2016-7-25 22:13
謝謝!
作者: MuXuan    時間: 2016-8-14 17:13
下載看看   正好在做430與AT45的程序
作者: km958    時間: 2017-1-5 11:51
好,下載測試
作者: yanjiasheng    時間: 2017-1-12 09:01
感謝分享。!
作者: 348085799    時間: 2017-10-16 10:27
不錯 學習了 謝謝哦
作者: 348085799    時間: 2017-10-16 10:30
感謝分享!。。!
作者: changhenjian    時間: 2018-1-18 16:05
好東西,贊一個
作者: 饅頭寶寶    時間: 2018-4-9 21:02
不錯不錯,好東西.
作者: 闊愛的釗釗    時間: 2021-7-22 20:58
缺資料收藏了,STM32硬件SPI驅(qū)動試試
作者: dabin895888    時間: 2022-12-11 20:52
學習一下,看x5045能不能借用




歡迎光臨 (http://www.torrancerestoration.com/bbs/) Powered by Discuz! X3.1