cx3 flash
发布时间:2020-12-15 19:58:01 所属栏目:百科 来源:网络整理
导读:M25P40 4Mbit = 512k Bytes spi 串行接口(max 75MHz clock rate); Sector Erase (512 Kbit) in 0.6 s (typical) Bulk Erase (4 Mbit) in 4.5 s (typical) Hardware Write Protection: protected area size defined by three non-volatile bits (BP0, BP1
status = CyFxSpiEraseSector(CyTrue,Sector_Num,buf_temp);
if(status != CY_U3P_SUCCESS){
CyU3PDebugPrint (4,"Erase Error: %xrn",status);
}
do{//wait until wip is 0
CyU3PThreadSleep (50);
CyFxSpiEraseSector(CyFalse,buf_temp);
CyU3PDebugPrint (4,"111 RDSR: %xrn",buf_temp[0]);//3
}while((buf_temp[0] & 0x01) == 1);
buf[9] = i;
status = CyFxSpiTransfer (Sector_Num*glSpiPageSize,len,buf,CyFalse);//write
if(status != CY_U3P_SUCCESS){
CyU3PDebugPrint (4,"Write Error: %xrn",status);
}//*/
do{//wait until wip is 0
CyU3PThreadSleep (50);
CyFxSpiEraseSector(CyFalse,buf_temp[0]);//3
}while((buf_temp[0] & 0x01) == 1);
status = CyFxSpiTransfer (Sector_Num*glSpiPageSize,buffer2,CyTrue);//read
if(status != CY_U3P_SUCCESS){
CyU3PDebugPrint (4,"rnRead Error: %xrn",status);
}
CyU3PDebugPrint (4,"rnReadPage:%d,data:%x %x %x %x %x %x %x %x %x %xrn",Sector_Num*glSpiPageSize,buffer2[len-4],buffer2[len-3],buffer2[len-2],buffer2[len-1],buffer2[4],buffer2[5],buffer2[6],buffer2[7],buffer2[8],buffer2[9]);
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |