MCPcopy Create free account
hub / github.com/crosspoint-reader/crosspoint-reader / readI2CReg8

Function readI2CReg8

lib/hal/HalGPIO.cpp:23–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21};
22
23bool readI2CReg8(uint8_t addr, uint8_t reg, uint8_t* outValue) {
24 Wire.beginTransmission(addr);
25 Wire.write(reg);
26 if (Wire.endTransmission(false) != 0) {
27 return false;
28 }
29 if (Wire.requestFrom(addr, static_cast<uint8_t>(1), static_cast<uint8_t>(true)) < 1) {
30 return false;
31 }
32 *outValue = Wire.read();
33 return true;
34}
35
36bool readI2CReg16LE(uint8_t addr, uint8_t reg, uint16_t* outValue) {
37 Wire.beginTransmission(addr);

Callers 2

probeDS3231SignatureFunction · 0.85
probeQMI8658SignatureFunction · 0.85

Calls 2

writeMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected