1 /* 2 * Copyright (c) 2020-2021 Huawei Device Co., Ltd. 3 * 4 * HDF is dual licensed: you can use it either under the terms of 5 * the GPL, or the BSD license, at your option. 6 * See the LICENSE file in the root of this repository for complete details. 7 */ 8 9 #ifndef INPUT_I2C_OPS_H 10 #define INPUT_I2C_OPS_H 11 12 #include "hdf_types.h" 13 #include "i2c_if.h" 14 15 typedef struct { 16 uint16_t busNum; 17 uint16_t addr; 18 } I2cConfig; 19 20 typedef struct { 21 struct DevHandle *i2cHandle; 22 I2cConfig i2cCfg; 23 } InputI2cClient; 24 25 int InputI2cRead(const InputI2cClient *client, uint8_t *writeBuf, uint32_t writeLen, uint8_t *readBuf, 26 uint32_t readLen); 27 int InputI2cWrite(const InputI2cClient *client, uint8_t *writeBuf, uint32_t len); 28 29 #endif 30