Loading files
/*=====================================================================================================*/
/*=====================================================================================================*/
#include "stm32f4_system.h"
#include "stm32f4_spi.h"
/*=====================================================================================================*/
/*=====================================================================================================*
**函數 : SPI_RW
**功能 : Receive Data
**輸入 : SPIx
**輸出 : None
**使用 : Read = SPI_RW(SPI1, 0xFFFF);
**=====================================================================================================*/
/*=====================================================================================================*/
uint16_t SPI_RW( SPI_TypeDef *SPIx, uint16_t WriteByte )
{
while((SPIx->SR & SPI_FLAG_TXE) == (uint16_t)RESET);
SPIx->DR = WriteByte;
while((SPIx->SR & SPI_FLAG_RXNE) == (uint16_t)RESET);
return SPIx->DR;
}
/*=====================================================================================================*/
/*=====================================================================================================*/
0cf3523cfThis file is pinned to the selected release. Download the original to open it in your design tool.