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

Method getFeatureSet

libraries/SGP30/SGP30.cpp:93–113  ·  view source on GitHub ↗

expect to return 0x0022

Source from the content-addressed store, hash-verified

91
92// expect to return 0x0022
93uint16_t SGP30::getFeatureSet()
94{
95 _command(0x202F);
96 delay(10);
97 uint16_t rv = 0;
98 if (_wire->requestFrom(_address, (uint8_t)3) == 3)
99 {
100 rv = _wire->read() << 8;
101 rv += _wire->read();
102 uint8_t crc = _wire->read();
103 if (_CRC8(rv) != crc)
104 {
105 _error = SGP30_ERROR_CRC;
106 return rv;
107 }
108 _error = SGP30_OK;
109 return rv;
110 }
111 _error = SGP30_ERROR_I2C;
112 return 0xFFFF;
113}
114
115
116// WARNING: resets all devices on I2C bus.

Callers

nothing calls this directly

Calls 1

readMethod · 0.45

Tested by

no test coverage detected