学习一下,看x5045能不能借用 |
缺资料收藏了,STM32硬件SPI驱动试试 |
不错不错,好东西. |
好东西,赞一个 |
感谢分享!!!!! |
不错 学习了 谢谢哦 |
感谢分享!!! |
好,下载测试![]() |
下载看看 正好在做430与AT45的程序![]() |
谢谢! |
下载了,看看我会不会用 |
好资料 学习一下 |
hao,henhao |
好东西啊,赞一个 |
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; } } |