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

Method readProm

libraries/MS5611/MS5611.cpp:241–262  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

239
240
241uint16_t MS5611::readProm(uint8_t reg)
242{
243 // last EEPROM register is CRC - Page 13 datasheet.
244 uint8_t promCRCRegister = 7;
245 if (reg > promCRCRegister) return 0;
246
247 uint8_t offset = reg * 2;
248 command(MS5611_CMD_READ_PROM + offset);
249 if (_result == 0)
250 {
251 uint8_t length = 2;
252 int bytes = _wire->requestFrom(_address, length);
253 if (bytes >= length)
254 {
255 uint16_t value = _wire->read() * 256;
256 value += _wire->read();
257 return value;
258 }
259 return 0;
260 }
261 return 0;
262}
263
264
265uint32_t MS5611::readADC()

Callers

nothing calls this directly

Calls 1

readMethod · 0.45

Tested by

no test coverage detected