21ic问答首页 - m0518,spi怎么连外设
m0518,spi怎么连外设
zjx69382020-12-22
求救大佬,新唐m0518,spi怎么读写一个字节,
我这样不行,
u1_t hwspi_ReadWriteByte(u1_t TxData)
{
uint8_t Data = 0;
SPI_WRITE_TX(SPI0,TxData);
while(SPI_IS_BUSY(SPI0));
SPI_TRIGGER(SPI0);
Data = SPI_READ_RX(SPI0);
return Data;
}
我这样不行,
u1_t hwspi_ReadWriteByte(u1_t TxData)
{
uint8_t Data = 0;
SPI_WRITE_TX(SPI0,TxData);
while(SPI_IS_BUSY(SPI0));
SPI_TRIGGER(SPI0);
Data = SPI_READ_RX(SPI0);
return Data;
}
您需要登录后才可以回复 登录 | 注册