27 uint8_t
input(
const uint8_t port)
36 uint8_t
output(
const uint8_t port,
const uint8_t v)
81 uint8_t
readBit(uint8_t dev, uint8_t reg, uint8_t bit)
95 int8_t
readBytes(uint8_t dev, uint8_t reg, uint8_t size, uint8_t *data)
97 wire->beginTransmission(dev);
99 wire->endTransmission();
100 wire->requestFrom(dev, size);
102 while (
wire->available()) data[count++] =
wire->read();
106 bool writeBit(uint8_t dev, uint8_t reg, uint8_t bit, uint8_t data)
109 b = (data != 0) ? (b | (1 << bit)) : (b & ~(1 << bit));
118 bool writeBytes(uint8_t dev, uint8_t reg, uint8_t size, uint8_t* data)
120 wire->beginTransmission(dev);
122 for (uint8_t i = 0; i < size; i++)
123 wire->write(data[i]);
127 Serial.print(
"I2C ERROR : ");
uint8_t config()
Definition: TCA9534.h:72
uint8_t I2C_ADDR
Definition: TCA9534.h:10
uint8_t sts
Definition: TCA9534.h:13
uint8_t config(const Config cfg)
Definition: TCA9534.h:67
uint8_t polarity()
Definition: TCA9534.h:58
Config
Definition: TCA9534.h:17
uint8_t input()
Definition: TCA9534.h:31
uint8_t status() const
Definition: TCA9534.h:77
int8_t readBytes(uint8_t dev, uint8_t reg, uint8_t size, uint8_t *data)
Definition: TCA9534.h:95
Level
Definition: TCA9534.h:19
@ H
Definition: TCA9534.h:19
@ L
Definition: TCA9534.h:19
uint8_t config(const uint8_t port, const Config cfg)
Definition: TCA9534.h:63
uint8_t output(const uint8_t port, const uint8_t v)
Definition: TCA9534.h:36
TwoWire * wire
Definition: TCA9534.h:12
uint8_t input(const uint8_t port)
Definition: TCA9534.h:27
void setDeviceAddress(const uint8_t addr)
Definition: TCA9534.h:25
uint8_t output(const uint8_t v)
Definition: TCA9534.h:40
Reg
Definition: TCA9534.h:16
uint8_t readBit(uint8_t dev, uint8_t reg, uint8_t bit)
Definition: TCA9534.h:81
bool writeBytes(uint8_t dev, uint8_t reg, uint8_t size, uint8_t *data)
Definition: TCA9534.h:118
uint8_t polarity(const Polarity pol)
Definition: TCA9534.h:53
bool writeByte(uint8_t dev, uint8_t reg, uint8_t data)
Definition: TCA9534.h:113
uint8_t readByte(uint8_t dev, uint8_t reg)
Definition: TCA9534.h:88
Polarity
Definition: TCA9534.h:18
uint8_t polarity(const uint8_t port, const Polarity pol)
Definition: TCA9534.h:49
bool writeBit(uint8_t dev, uint8_t reg, uint8_t bit, uint8_t data)
Definition: TCA9534.h:106
uint8_t output()
Definition: TCA9534.h:44
void attach(TwoWire &w)
Definition: TCA9534.h:21