/*******************************************************************************
* Function Name : SPI_ADC_SendHalfWord 发送数据
*******************************************************************************/
u16 SPI_ADC_SendHalfWord(u16 HalfWord)
{
SPI_ADC_RDCO_HIGH();
__nop();__nop();
SPI_ADC_RDCO_LOW();
__nop();__nop();
/* Loop while DR register in not emplty */
while (SPI_I2S_GetFlagStatus(SPI1, SPI_I2S_FLAG_TXE) == RESET);
/* Send Half Word through the SPI1 peripheral */
SPI_I2S_SendData(SPI1, HalfWord);
/* Wait to receive a Half Word */
while (SPI_I2S_GetFlagStatus(SPI1, SPI_I2S_FLAG_RXNE) == RESET);
/* Return the Half Word read from the SPI bus */
return SPI_I2S_ReceiveData(SPI1);