• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 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 I2C_SERVICE_H
10 #define I2C_SERVICE_H
11 
12 #include "hdf_base.h"
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18 #pragma pack(push, 4)
19 struct I2cUserMsg {
20     /** Address of the I2C device */
21     uint16_t addr;
22     /** Length of the transferred data */
23     uint16_t len;
24     /**
25      * Transfer Mode Flag | Description
26      * ------------| -----------------------
27      * I2C_FLAG_READ | Read flag
28      * I2C_FLAG_ADDR_10BIT | 10-bit addressing flag
29      * I2C_FLAG_READ_NO_ACK | No-ACK read flag
30      * I2C_FLAG_IGNORE_NO_ACK | Ignoring no-ACK flag
31      * I2C_FLAG_NO_START | No START condition flag
32      * I2C_FLAG_STOP | STOP condition flag
33      */
34     uint16_t flags;
35 };
36 #pragma pack(pop)
37 
38 #ifdef __cplusplus
39 }
40 #endif
41 
42 #endif /* I2C_SERVICE_H */
43