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