while(ADS1247_DOut_Get());
// ADS1247_SCLK_SET();
for (ii = 0,x=0 ; ii < 8 ; ii++)
{
ADS1247_SCLK_SET();
ADS1247_Delays(20);
x<<=1;
if(ADS1247_DOut_Get())
x |= 0x01;
ADS1247_SCLK_CLR();
ADS1247_Delays(20);
}
return x;
}
unsigned int ReadWordADS1247(void)//16BIT
{
unsigned char ii;
unsigned int x ;
while(ADS1247_DOut_Get());
// ADS1247_SCLK_SET();
for (ii = 0,x=0 ; ii < 16 ; ii++)
{
ADS1247_SCLK_SET();
ADS1247_Delays(20);
x<<=1;
if (ADS1247_DOut_Get())
x |= 0x01;
ADS1247_SCLK_CLR();
ADS1247_Delays(20);
}
return x;
}
unsigned long int ReadDWordADS1247(void)//24BIT
{
unsigned char ii;
unsigned long int x ;
// ADS1247_SCLK_SET();
for (ii = 0,x = 0 ; ii < 24 ; ii++)
{
ADS1247_SCLK_SET();
ADS1247_Delays(20);
x<<=1;
if (ADS1247_DOut_Get())
x |= 0x01;
ADS1247_SCLK_CLR();
ADS1247_Delays(20);
}
//set_cs ;
return x;
}