MCPcopy Create free account
hub / github.com/SlimeVR/SlimeVR-Tracker-ESP / readBitW

Method readBitW

lib/i2cdev/I2Cdev.cpp:121–126  ·  view source on GitHub ↗

Read a single bit from a 16-bit device register. * @param devAddr I2C slave device address * @param regAddr Register regAddr to read from * @param bitNum Bit position to read (0-15) * @param data Container for single bit value * @param timeout Optional read timeout in milliseconds (0 to disable, leave off to use default class value in I2Cdev::readTimeout) * @return Status of read operation (

Source from the content-addressed store, hash-verified

119 * @return Status of read operation (true = success)
120 */
121int8_t I2Cdev::readBitW(uint8_t devAddr, uint8_t regAddr, uint8_t bitNum, uint16_t *data, uint16_t timeout, void *wireObj) {
122 uint16_t b;
123 uint8_t count = readWord(devAddr, regAddr, &b, timeout, wireObj);
124 *data = b & (1 << bitNum);
125 return count;
126}
127
128/** Read multiple bits from an 8-bit device register.
129 * @param devAddr I2C slave device address

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected