write a single bit in a 16-bit device register. * @param devAddr I2C slave device address * @param regAddr Register regAddr to write to * @param bitNum Bit position to write (0-15) * @param value New bit value to write * @return Status of operation (true = success) */
| 484 | * @return Status of operation (true = success) |
| 485 | */ |
| 486 | bool I2Cdev::writeBitW(uint8_t devAddr, uint8_t regAddr, uint8_t bitNum, uint16_t data, void *wireObj) { |
| 487 | uint16_t w; |
| 488 | readWord(devAddr, regAddr, &w, I2Cdev::readTimeout, wireObj); |
| 489 | w = (data != 0) ? (w | (1 << bitNum)) : (w & ~(1 << bitNum)); |
| 490 | return writeWord(devAddr, regAddr, w, wireObj); |
| 491 | } |
| 492 | |
| 493 | /** Write multiple bits in an 8-bit device register. |
| 494 | * @param devAddr I2C slave device address |
nothing calls this directly
no outgoing calls
no test coverage detected