]>
Commit | Line | Data |
---|---|---|
2bf7b457 AF |
1 | /* |
2 | * I2C libqos | |
3 | * | |
4 | * Copyright (c) 2012 Andreas Färber | |
5 | * | |
6 | * This work is licensed under the terms of the GNU GPL, version 2 or later. | |
7 | * See the COPYING file in the top-level directory. | |
8 | */ | |
9 | #ifndef LIBQOS_I2C_H | |
10 | #define LIBQOS_I2C_H | |
11 | ||
f1dfd507 | 12 | #include "libqtest.h" |
2bf7b457 AF |
13 | |
14 | typedef struct I2CAdapter I2CAdapter; | |
15 | struct 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); | |
f1dfd507 EB |
20 | |
21 | QTestState *qts; | |
2bf7b457 AF |
22 | }; |
23 | ||
5141d415 CLG |
24 | #define OMAP2_I2C_1_BASE 0x48070000 |
25 | ||
2bf7b457 AF |
26 | void i2c_send(I2CAdapter *i2c, uint8_t addr, |
27 | const uint8_t *buf, uint16_t len); | |
28 | void i2c_recv(I2CAdapter *i2c, uint8_t addr, | |
29 | uint8_t *buf, uint16_t len); | |
30 | ||
31 | /* libi2c-omap.c */ | |
f1dfd507 | 32 | I2CAdapter *omap_i2c_create(QTestState *qts, uint64_t addr); |
2bf7b457 | 33 | |
7f398627 | 34 | /* libi2c-imx.c */ |
f1dfd507 | 35 | I2CAdapter *imx_i2c_create(QTestState *qts, uint64_t addr); |
7f398627 | 36 | |
2bf7b457 | 37 | #endif |