...
u08 ad7927Init(void)
{
// initialize spi interface
spiInit();
// switch to f/4 bitrate
cbi(SPCR, SPR0);
cbi(SPCR, SPR1);
// setup chip select
sbi(AD7927_CS_PORT, AD7927_CS_PIN);
sbi(AD7927_CS_DDR, AD7927_CS_PIN);
// Set write bit, power mode normal, range 0-5V, coding straight binary
ad7927ctrlreg = (1<<AD7927_WRITE)|(1<<AD7927_PM1)|(1<<AD7927_PM0)|(1<<AD7927_CODING);
ad7927WriteCtrlReg(ad7927ctrlreg);
// return success
return 1;
}
...