36 dev->i2c_trans.slave_addr = addr;
51 dev->i2c_trans.buf[1] =
val;
69 dev->i2c_trans.buf[1] = mask;
87 *result =
dev->i2c_trans.buf[0] & mask;
static const bool blocking[]
bool i2c_blocking_transceive(struct i2c_periph *p, struct i2c_transaction *t, uint8_t s_addr, uint8_t len_w, uint16_t len_r)
Submit a write/read transaction and wait for it to complete.
bool i2c_transmit(struct i2c_periph *p, struct i2c_transaction *t, uint8_t s_addr, uint8_t len)
Submit a write only transaction.
bool i2c_blocking_transmit(struct i2c_periph *p, struct i2c_transaction *t, uint8_t s_addr, uint8_t len)
Submit a write only transaction and wait for it to complete.
@ I2CTransSuccess
transaction successfully finished by I2C driver
@ I2CTransFailed
transaction failed
@ I2CTransDone
transaction set to done by user level
void pca95xx_init(struct pca95xx *dev, struct i2c_periph *i2c_p, uint8_t addr)
Init PCA95XX.
bool pca95xx_get_input(struct pca95xx *dev, uint8_t mask, uint8_t *result)
Get input value.
bool pca95xx_configure(struct pca95xx *dev, uint8_t val, bool blocking)
Configure PCA95XX.
bool pca95xx_set_output(struct pca95xx *dev, uint8_t mask, bool blocking)
Set output value.
Driver for the 8-bit I/O expander based on i2c.
#define PCA95XX_OUTPUT_REG
#define PCA95XX_CONFIG_REG
#define PCA95XX_INPUT_REG
static const struct usb_device_descriptor dev
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.