void startADS(void)
{
Transfer_START();
HAL_Delay(10);
Transfer_RDATAC( );
HAL_Delay(10);
HAL_Delay(100);
}
void Transfer_START(void)
{
SPI1_CS_0();
SPI1_ReadWriteByte(_START);
HAL_Delay(100);
SPI1_CS_1();
}
void Transfer_RDATAC(void)
{
SPI1_CS_0();
SPI1_ReadWriteByte(RDATAC); // read data continuous
SPI1_CS_1();
HAL_Delay(3);
}
uint8_t SPI1_ReadWriteByte(uint8_t TxData)
{
uint8_t Rxdata;
HAL_SPI_TransmitReceive(&hspi1,&TxData,&Rxdata,1, 1000);
return Rxdata; //·µ»ØÊÕµ½µÄÊý¾Ý
}