Functions

deprecated TWI-Wrapper features More...

Functions

int8_t readBit (uint8_t devAddr, uint8_t regAddr, uint8_t bitNum, uint8_t *data)
 Read a single bit from an 8-bit device register. More...
 
int8_t readBits (uint8_t devAddr, uint8_t regAddr, uint8_t bitStart, uint8_t bitLength, uint8_t *data)
 Read multiple bits from an 8-bit device register. More...
 
int8_t readByte (uint8_t devAddr, uint8_t regAddr, uint8_t *data)
 Read single byte from an 8-bit device register. More...
 
int8_t readBytes (uint8_t devAddr, uint8_t regAddr, uint8_t byteCount, uint8_t *data)
 Read multiple bytes from an 8-bit device register. More...
 
char writeBit (uint8_t devAddr, uint8_t regAddr, uint8_t bitNum, uint8_t data)
 Write a single bit in an 8-bit device register. More...
 
char writeBits (uint8_t devAddr, uint8_t regAddr, uint8_t bitStart, uint8_t bitLength, uint8_t data)
 Write multiple bits in an 8-bit device register. More...
 
char writeByte (uint8_t devAddr, uint8_t regAddr, uint8_t data)
 Write single byte to an 8-bit device register. More...
 
char writeBytes (uint8_t devAddr, uint8_t regAddr, uint8_t byteCount, uint8_t *data)
 Write multiple bytes to an 8-bit device register. More...
 

Detailed Description

deprecated TWI-Wrapper features

Function Documentation

◆ readBit()

int8_t readBit ( uint8_t  devAddr,
uint8_t  regAddr,
uint8_t  bitNum,
uint8_t *  data 
)

Read a single bit from an 8-bit device register.

Function is deprecated!

Internal conversion:

int8_t readBit(uint8_t devAddr, uint8_t regAddr, uint8_t bitNum,
  uint8_t *data) {

    int8_t status;
    status = !twiWrapper_readBit(2*devAddr, regAddr, bitNum, data);
    *data&= _BV(bitNum);
    return status;
}
See also
twiWrapper_readBit()

◆ readBits()

int8_t readBits ( uint8_t  devAddr,
uint8_t  regAddr,
uint8_t  bitStart,
uint8_t  bitLength,
uint8_t *  data 
)

Read multiple bits from an 8-bit device register.

Function is deprecated!

Internal conversion:

int8_t readBits(uint8_t devAddr, uint8_t regAddr, uint8_t bitStart,
  uint8_t bitLength, uint8_t *data) {

    return !twiWrapper_readBits(2*devAddr, regAddr, bitStart-bitLength + 1,
      bitLength, data);
}
See also
twiWrapper_readBits()

◆ readByte()

int8_t readByte ( uint8_t  devAddr,
uint8_t  regAddr,
uint8_t *  data 
)

Read single byte from an 8-bit device register.

Function is deprecated!

Internal conversion:

int8_t readByte(uint8_t devAddr, uint8_t regAddr, uint8_t *data) {

    return !twiWrapper_readByte(2*devAddr, regAddr, data);
}
See also
twiWrapper_readByte()

◆ readBytes()

int8_t readBytes ( uint8_t  devAddr,
uint8_t  regAddr,
uint8_t  byteCount,
uint8_t *  data 
)

Read multiple bytes from an 8-bit device register.

Function is deprecated!

Internal conversion:

int8_t readBytes(uint8_t devAddr, uint8_t regAddr, uint8_t byteCount,
  uint8_t *data) {

    if (twiWrapper_readBytes(2*devAddr, regAddr, byteCount, data)) {
        return byteCount;
    } else {
        return -1;
    }
}
See also
readBytes()

◆ writeBit()

char writeBit ( uint8_t  devAddr,
uint8_t  regAddr,
uint8_t  bitNum,
uint8_t  data 
)

Write a single bit in an 8-bit device register.

Function is deprecated!

Internal conversion:

char writeBit(uint8_t devAddr, uint8_t regAddr, uint8_t bitNum,
  uint8_t data) {

    return twiWrapper_writeBit(2*devAddr, regAddr, bitNum, data);
}
See also
twiWrapper_writeBit()

◆ writeBits()

char writeBits ( uint8_t  devAddr,
uint8_t  regAddr,
uint8_t  bitStart,
uint8_t  bitLength,
uint8_t  data 
)

Write multiple bits in an 8-bit device register.

Function is deprecated!

Internal conversion:

char writeBits(uint8_t devAddr, uint8_t regAddr, uint8_t bitStart,
  uint8_t bitLength, uint8_t data) {

    return twiWrapper_writeBits(2*devAddr, regAddr, bitStart-bitLength + 1,
      bitLength, data);
}
See also
twiWrapper_writeBits()

◆ writeByte()

char writeByte ( uint8_t  devAddr,
uint8_t  regAddr,
uint8_t  data 
)

Write single byte to an 8-bit device register.

Function is deprecated!

Internal conversion:

char writeByte(uint8_t devAddr, uint8_t regAddr, uint8_t data) {

    return twiWrapper_writeByte(2*devAddr, regAddr, data);
}
See also
twiWrapper_writeByte()

◆ writeBytes()

char writeBytes ( uint8_t  devAddr,
uint8_t  regAddr,
uint8_t  byteCount,
uint8_t *  data 
)

Write multiple bytes to an 8-bit device register.

Function is deprecated!

Internal conversion:

char writeBytes(uint8_t devAddr, uint8_t regAddr, uint8_t byteCount,
  uint8_t *data) {

    return twiWrapper_writeBytes(2*devAddr, regAddr, byteCount, data);
}
See also
twiWrapper_writeBytes()