1234567891011121314151617181920212223242526272829303132 |
- #ifndef __i2c_transfer_h__
- #define __i2c_transfer_h__
- #include "gpio_i2c.h"
- #define I2C_WRTIE 0
- #define I2C_READ 1
- typedef struct
- {
- int speed;
- } i2cConfig_t;
- typedef struct
- {
- int addr;
- int flags;
- int *buf;
- int len;
- } I2cMsg_t;
- typedef struct
- {
- int client_id;
- i2cConfig_t i2cConfig;
- }i2c_client_t;
- extern int i2cTransfer(const i2c_client_t i2cClient,const I2cMsg_t *i2cMsg);
- extern bool i2cProb(const i2c_port_t i2cPort,i2c_client_t i2cClient);
- #endif
|