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