想问下倒数第四排*pBuffer = SPI_FLASH_SendByte(Dummy_Byte); 有什么用
时间:10-02
整理:3721RD
点击:
void SPI_FLASH_BufferRead(u8* pBuffer, u32 ReadAddr, u16 NumByteToRead)
{
/* Select the FLASH: Chip Select low */
SPI_FLASH_CS_LOW();
/* Send "Read from Memory " instruction */
SPI_FLASH_SendByte(W25X_ReadData);
/* Send ReadAddr high nibble address byte to read from */
SPI_FLASH_SendByte((ReadAddr & 0xFF0000) >> 16);
/* Send ReadAddr medium nibble address byte to read from */
SPI_FLASH_SendByte((ReadAddr& 0xFF00) >> 8);
/* Send ReadAddr low nibble address byte to read from */
SPI_FLASH_SendByte(ReadAddr & 0xFF);
while (NumByteToRead--) /* while there is data to be read */
{
/* Read a byte from the FLASH */
*pBuffer = SPI_FLASH_SendByte(Dummy_Byte); 注明:#define Dummy_Byte 0xFF
/* Point to the next location where the byte read will be saved */
pBuffer++;
}
想问下倒数第四排*pBuffer = SPI_FLASH_SendByte(Dummy_Byte); 有什么用
{
/* Select the FLASH: Chip Select low */
SPI_FLASH_CS_LOW();
/* Send "Read from Memory " instruction */
SPI_FLASH_SendByte(W25X_ReadData);
/* Send ReadAddr high nibble address byte to read from */
SPI_FLASH_SendByte((ReadAddr & 0xFF0000) >> 16);
/* Send ReadAddr medium nibble address byte to read from */
SPI_FLASH_SendByte((ReadAddr& 0xFF00) >> 8);
/* Send ReadAddr low nibble address byte to read from */
SPI_FLASH_SendByte(ReadAddr & 0xFF);
while (NumByteToRead--) /* while there is data to be read */
{
/* Read a byte from the FLASH */
*pBuffer = SPI_FLASH_SendByte(Dummy_Byte); 注明:#define Dummy_Byte 0xFF
/* Point to the next location where the byte read will be saved */
pBuffer++;
}
想问下倒数第四排*pBuffer = SPI_FLASH_SendByte(Dummy_Byte); 有什么用
这个你要看相应的前面的声明函数,才知道运行方式。当然有时候这些声明函数是包含在头文件里面的。