some fixes, strange zeros in between

This commit is contained in:
hg
2014-11-05 19:19:20 +01:00
parent d16530898e
commit ed17033c78
4 changed files with 14 additions and 26 deletions

View File

@ -69,26 +69,14 @@ void ADS1210::exec() {
res.in[3] = 0;
disableCS();
Serial << "DOR4x8: " << _HEX(res.in[3]) << " " << _HEX(res.in[2]) << " " << _HEX(res.in[1]) << " " << _HEX(res.in[0]) << endl;
Serial << "DOR1x32: " << _HEX(res.out) << endl;
// Serial << "DOR4x8: " << _HEX(res.in[3]) << " " << _HEX(res.in[2]) << " " << _HEX(res.in[1]) << " " << _HEX(res.in[0]) << endl;
// Serial << "DOR1x32: " << _HEX(res.out) << endl;
value = res.out;
}
}
void ADS1210::disableRefO() const {
uint8_t cmr = readRegister(ADDR_CMR3);
cmr &= ~CMR_REFO;
writeRegister(ADDR_CMR3, cmr);
}
void ADS1210::enableRefO() const {
uint8_t cmr = readRegister(ADDR_CMR3);
cmr |= CMR_REFO;
writeRegister(ADDR_CMR3, cmr);
}
void ADS1210::setMode(uint8_t mode) const {
uint8_t cmr = readRegister(ADDR_CMR2);
cmr &= ~CMR_MD_Mask;