You are here: Forum Home → ANT Developers Forums → ANT General Questions → Thread
void AntInit(void)
{
GPIOSetDir(ANT_SRDY_PORT,ANT_SRDY,1); //output
GPIOSetDir(ANT_MRDY_PORT,ANT_MRDY,1); //output
GPIOSetDir(ANT_SEN_PORT,ANT_SEN,0); //input
GPIOSetDir(ANT_RESET_PORT,ANT_RESET,1); //output
ANT_RESET_H();
ANT_SRDY_H();
ANT_MRDY_H();
//DO_ANT_RESET();
//waitms(500);
}
int CallAnt(void)
{
uint8_t data[10];
ANT_MRDY_H();
waitms(1);
ANT_SRDY_L();
waitus(400);
ANT_MRDY_L();
waitms(1);
ANT_SRDY_H();
while((ANT_TEST_SEN()));
DO_SRDY_PULSE(); //H->L->H
SSP_Receive(ANT_SPI_PORT, data , 1);
ANT_MRDY_H();
return(data[0]);
}