关于STM32与 Marvell88w8686的问题
2019-07-14 18:33发布
打开微信“扫一扫”,打开网页后点击屏幕右上角分享按钮
tica">Marvell88W8686是怎样与主机STM32进行数据传输的,用SPI接口,对从机需要操作的寄存器有哪些?手册大致能看懂,加上程序下面就不太明白了- UINT16 GSPI_WriteByte(PSTM32SPI pSpi, UINT16 usData)
- {
- if (pSpi->ucMode == GSPI_MODE_SPI) {
- // Loop while DR register in not emplty,等待SPI发送寄存器里的数据发送结束
- while (SPI_I2S_GetFlagStatus(pSpi->SPIx, SPI_I2S_FLAG_TXE) == RESET);
- // Send byte through the SPI peripheral,发送数据
- SPI_I2S_SendData(pSpi->SPIx, usData);
- // Wait to receive a byte
- while (SPI_I2S_GetFlagStatus(pSpi->SPIx, SPI_I2S_FLAG_RXNE) == RESET);
- // Return the byte read from the SPI bus
- return SPI_I2S_ReceiveData(pSpi->SPIx);
复制代码
发送数据时,从机是怎样接收的,即将接收的数据放在哪里?
一周热门 更多>