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 (
| 119 | * @return Status of read operation (true = success) |
| 120 | */ |
| 121 | int8_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 |
nothing calls this directly
no outgoing calls
no test coverage detected