MCPcopy Create free account
hub / github.com/RobTillaart/Arduino / _readRegister

Method _readRegister

libraries/ADS1x15/ADS1X15.cpp:453–467  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

451
452
453uint16_t ADS1X15::_readRegister(uint8_t address, uint8_t reg)
454{
455 _wire->beginTransmission(address);
456 _wire->write(reg);
457 _wire->endTransmission();
458
459 int rv = _wire->requestFrom((int) address, (int) 2);
460 if (rv == 2)
461 {
462 uint16_t value = _wire->read() << 8;
463 value += _wire->read();
464 return value;
465 }
466 return 0x0000;
467}
468
469
470

Callers

nothing calls this directly

Calls 2

writeMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected