在论坛上有看到说,spi只想写数据是,也要有相应的读动作。于是,每次读写都这样是必须的吗?
uint8_t SpiReadWriteByte(uint8_t data_tx)
{
uint8_t temp;
/* Write to TX register */
SPI_WRITE_TX(SPI0, data_tx);
/* Check SPI0 busy status */
while(SPI_IS_BUSY(SPI0));
/* Read received data */
SPI_READ_RX(SPI0);
return temp;
}
|