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

Method readBit

lib/i2cdev/I2Cdev.cpp:106–111  ·  view source on GitHub ↗

Read a single bit from an 8-bit device register. * @param devAddr I2C slave device address * @param regAddr Register regAddr to read from * @param bitNum Bit position to read (0-7) * @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 (t

Source from the content-addressed store, hash-verified

104 * @return Status of read operation (true = success)
105 */
106int8_t I2Cdev::readBit(uint8_t devAddr, uint8_t regAddr, uint8_t bitNum, uint8_t *data, uint16_t timeout, void *wireObj) {
107 uint8_t b;
108 uint8_t count = readByte(devAddr, regAddr, &b, timeout, wireObj);
109 *data = b & (1 << bitNum);
110 return count;
111}
112
113/** Read a single bit from a 16-bit device register.
114 * @param devAddr I2C slave device address

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected