Andreas Färber | 2bf7b45 | 2013-01-16 01:57:54 +0100 | [diff] [blame] | 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 | |
| 12 | #include <stdint.h> |
| 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); |
| 20 | }; |
| 21 | |
| 22 | void i2c_send(I2CAdapter *i2c, uint8_t addr, |
| 23 | const uint8_t *buf, uint16_t len); |
| 24 | void i2c_recv(I2CAdapter *i2c, uint8_t addr, |
| 25 | uint8_t *buf, uint16_t len); |
| 26 | |
| 27 | /* libi2c-omap.c */ |
| 28 | I2CAdapter *omap_i2c_create(uint64_t addr); |
| 29 | |
Jean-Christophe Dubois | 7f39862 | 2015-09-07 10:39:31 +0100 | [diff] [blame] | 30 | /* libi2c-imx.c */ |
| 31 | I2CAdapter *imx_i2c_create(uint64_t addr); |
| 32 | |
Andreas Färber | 2bf7b45 | 2013-01-16 01:57:54 +0100 | [diff] [blame] | 33 | #endif |