1
2
3
4
5
6
7
8
9#ifndef LIBQOS_I2C_H
10#define LIBQOS_I2C_H
11
12
13typedef struct I2CAdapter I2CAdapter;
14struct I2CAdapter {
15 void (*send)(I2CAdapter *adapter, uint8_t addr,
16 const uint8_t *buf, uint16_t len);
17 void (*recv)(I2CAdapter *adapter, uint8_t addr,
18 uint8_t *buf, uint16_t len);
19};
20
21void i2c_send(I2CAdapter *i2c, uint8_t addr,
22 const uint8_t *buf, uint16_t len);
23void i2c_recv(I2CAdapter *i2c, uint8_t addr,
24 uint8_t *buf, uint16_t len);
25
26
27I2CAdapter *omap_i2c_create(uint64_t addr);
28
29
30I2CAdapter *imx_i2c_create(uint64_t addr);
31
32#endif
33