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;
}
赞0
评论
2020-12-23
赞0
238225fe3023fbf4c4.png (25.66 KB )
下载附件
2020-12-23 16:39 上传
881185fe302769da6d.png (29.1 KB )
下载附件
2020-12-23 16:40 上传
559085fe3036a52db7.png (33.94 KB )
下载附件
2020-12-23 16:44 上传
329095fe303594cdb7.png (31.75 KB )
下载附件
2020-12-23 16:44 上传
评论
2020-12-23
赞1
评论
2020-12-22
您需要登录后才可以回复 登录 | 注册