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

Method writeBitW

lib/i2cdev/I2Cdev.cpp:486–491  ·  view source on GitHub ↗

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) */

Source from the content-addressed store, hash-verified

484 * @return Status of operation (true = success)
485 */
486bool 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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected