3#IJK 谢谢你的回复,那数据块的读写是不是只能对一个数据块写一样的数据?
/*------------------- Block Read/Write --------------------------*/
/* Fill the buffer to send */
Fill_Buffer(Buffer_Block_Tx, BufferWordsSize, 0xFFFF);
if (Status == SD_OK)
{
/* Write block of 512 bytes on address 0 */
Status = SD_WriteBlock(0x00, Buffer_Block_Tx, BlockSize);
}
if (Status == SD_OK)
{
/* Read block of 512 bytes from address 0 */
Status = SD_ReadBlock(0x00, Buffer_Block_Rx, BlockSize);
}
if (Status == SD_OK)
{
/* Check the corectness of written dada */
TransferStatus1 = Buffercmp(Buffer_Block_Tx, Buffer_Block_Rx, BufferWordsSize);
}
填充缓存器程序如下:
void Fill_Buffer(u32 *pBuffer, u16 BufferLenght, u32 Offset)
{
u16 index = 0;
/* Put in global buffer same values */
for (index = 0; index < BufferLenght; index++ )
{
pBuffer[index] = index + Offset;
}
}
程序走下来写入快的数据都是FF还是00?用这种方法写的数据块里的数据是不是都一样?