-
Notifications
You must be signed in to change notification settings - Fork 908
Open
Description
read code is:
/*
* 1: write CFG for sample N and read old data (sample N-2)
* 2: if CFG was not changed since sample N-1 then we'll get good data
* at the next xfer, so we bail out now, otherwise we write something
* and we read garbage (sample N-1 configuration).
*/
for (i = 0; i < 2; i++) {
ret = ad7949_spi_write_cfg(ad7949_adc,
FIELD_PREP(AD7949_CFG_MASK_INX, channel),
AD7949_CFG_MASK_INX);
if (ret)
return ret;
if (channel == ad7949_adc->current_channel)
break;
}
/* 3: write something and read actual data */
if (ad7949_adc->spi->bits_per_word == 8)
ret = spi_read(ad7949_adc->spi, &ad7949_adc->buf8b, 2); // at this whill send 0xff to ad7689 and ad7689 will set to external-ref
else
ret = spi_read(ad7949_adc->spi, &ad7949_adc->buffer, 2); // at this whill send 0xff to ad7689 and ad7689 will set to external-ref
Metadata
Metadata
Assignees
Labels
No labels