研究生
最后登录1970-1-1
在线时间 小时
注册时间2018-1-18
|
发表于 2018-7-29 13:49:40
|
显示全部楼层
地址是会自己解码的
uint8_t NAND_WritePage(uint32_t PageNum,uint16_t ColNum,uint8_t *pBuffer,uint16_t NumByteToWrite)
{
uint16_t ipCmd;
ipCmd = SEMC_BuildNandIPCommand(NAND_WRITE0, kSEMC_NANDAM_ColumnRow, kSEMC_NANDCM_CommandAddressHold);
SEMC_SendIPCommand(SEMC, kSEMC_MemType_NAND, NAND_ADDRESS+PageNum*NAND_MAX_PAGE_SIZE+ColNum, ipCmd, 0, NULL);
if(NAND_WaitForReady()!=NSTA_READY)
return 1; //错误,返回
SEMC_IPCommandNandWrite(SEMC,NAND_ADDRESS+PageNum*NAND_MAX_PAGE_SIZE+ColNum,pBuffer,NumByteToWrite);
if(NAND_WaitForReady()!=NSTA_READY)
return 1; //错误,返回
SEMC_NandCMD(NAND_WRITE_TURE1);
if(NAND_WaitForReady()!=NSTA_READY)
return 1; //错误,返回
return 0; //成功
}
其中SEMC_SendIPCommand(SEMC, kSEMC_MemType_NAND, NAND_ADDRESS+PageNum*NAND_MAX_PAGE_SIZE+ColNum, ipCmd, 0, NULL);
第3个参数就是填入地址,然后这个地址,会被解码成nandflash需要的 命令+C0C1A0A1 |
|