RTEMS  5.1
imx_i2creg.h
1 /*
2  * Copyright (c) 2017 embedded brains GmbH. All rights reserved.
3  *
4  * embedded brains GmbH
5  * Dornierstr. 4
6  * 82178 Puchheim
7  * Germany
8  * <info@embedded-brains.de>
9  *
10  * The license and distribution terms for this file may be
11  * found in the file LICENSE in this distribution or at
12  * http://www.rtems.org/license/LICENSE.
13  */
14 
15 #ifndef IMX_I2CREG_H
16 #define IMX_I2CREG_H
17 
18 #include <bsp/utility.h>
19 
20 typedef struct {
21  uint16_t iadr;
22 #define IMX_I2C_IADR_ADR(val) BSP_FLD16(val, 1, 7)
23 #define IMX_I2C_IADR_ADR_GET(reg) BSP_FLD16GET(reg, 1, 7)
24 #define IMX_I2C_IADR_ADR_SET(reg, val) BSP_FLD16SET(reg, val, 1, 7)
25  uint16_t reserved_02;
26  uint16_t ifdr;
27 #define IMX_I2C_IFDR_IC(val) BSP_FLD16(val, 0, 5)
28 #define IMX_I2C_IFDR_IC_GET(reg) BSP_FLD16GET(reg, 0, 5)
29 #define IMX_I2C_IFDR_IC_SET(reg, val) BSP_FLD16SET(reg, val, 0, 5)
30  uint16_t reserved_06;
31  uint16_t i2cr;
32 #define IMX_I2C_I2CR_IEN BSP_BIT16(7)
33 #define IMX_I2C_I2CR_IIEN BSP_BIT16(6)
34 #define IMX_I2C_I2CR_MSTA BSP_BIT16(5)
35 #define IMX_I2C_I2CR_MTX BSP_BIT16(4)
36 #define IMX_I2C_I2CR_TXAK BSP_BIT16(3)
37 #define IMX_I2C_I2CR_RSTA BSP_BIT16(2)
38  uint16_t reserved_0a;
39  uint16_t i2sr;
40 #define IMX_I2C_I2SR_ICF BSP_BIT16(7)
41 #define IMX_I2C_I2SR_IAAS BSP_BIT16(6)
42 #define IMX_I2C_I2SR_IBB BSP_BIT16(5)
43 #define IMX_I2C_I2SR_IAL BSP_BIT16(4)
44 #define IMX_I2C_I2SR_SRW BSP_BIT16(2)
45 #define IMX_I2C_I2SR_IIF BSP_BIT16(1)
46 #define IMX_I2C_I2SR_RXAK BSP_BIT16(0)
47  uint16_t reserved_0e;
48  uint16_t i2dr;
49 #define IMX_I2C_I2DR_DATA(val) BSP_FLD16(val, 0, 7)
50 #define IMX_I2C_I2DR_DATA_GET(reg) BSP_FLD16GET(reg, 0, 7)
51 #define IMX_I2C_I2DR_DATA_SET(reg, val) BSP_FLD16SET(reg, val, 0, 7)
52 } imx_i2c;
53 
54 #endif /* IMX_I2CREG_H */
Utility macros.
Definition: imx_i2creg.h:20