1 /** @file reg_i2c.h
2 *   @brief I2C Register Layer Header File
3 *   @date 29.May.2013
4 *   @version 03.05.02
5 *
6 *   This file contains:
7 *   - Definitions
8 *   - Types
9 *   - Interface Prototypes
10 *   .
11 *   which are relevant for the I2C driver.
12 */
13 
14 /* (c) Texas Instruments 2009-2013, All rights reserved. */
15 
16 #ifndef __REG_I2C_H__
17 #define __REG_I2C_H__
18 
19 #include "sys_common.h"
20 #include "gio.h"
21 
22 
23 
24 /* USER CODE BEGIN (0) */
25 /* USER CODE END */
26 
27 /* I2c Register Frame Definition */
28 /** @struct i2cBase
29 *   @brief I2C Base Register Definition
30 *
31 *   This structure is used to access the I2C module registers.
32 */
33 /** @typedef i2cBASE_t
34 *   @brief I2C Register Frame Type Definition
35 *
36 *   This type is used to access the I2C Registers.
37 */
38 typedef volatile struct i2cBase
39 {
40 
41     uint32 OAR;           /**<  0x0000 I2C Own Address register               */
42     uint32 IMR;           /**<  0x0004 I2C Interrupt Mask/Status register     */
43     uint32 STR;           /**<  0x0008 I2C Interrupt Status register          */
44     uint32 CLKL;          /**<  0x000C I2C Clock Divider Low register         */
45     uint32 CLKH;          /**<  0x0010 I2C Clock Divider High register        */
46     uint32 CNT;           /**<  0x0014 I2C Data Count register                */
47     uint32 DRR;           /**<  0x0018 I2C Data Receive register              */
48     uint32 SAR;           /**<  0x001C I2C Slave Address register             */
49     uint32 DXR;           /**<  0x0020 I2C Data Transmit register             */
50     uint32 MDR;           /**<  0x0024 I2C Mode register                      */
51     uint32 IVR;           /**<  0x0028 I2C Interrupt Vector register          */
52     uint32 EMDR;          /**<  0x002C I2C Extended Mode register             */
53     uint32 PSC;           /**<  0x0030 I2C Prescaler register                 */
54     uint32 PID11;         /**<  0x0034 I2C Peripheral ID register 1           */
55     uint32 PID12;         /**<  0x0038 I2C Peripheral ID register 2           */
56     uint32 DMAC;          /**<  0x003C I2C DMA Control Register               */
57     uint32   rsvd1;       /**<  0x0040 Reserved                               */
58     uint32   rsvd2;       /**<  0x0044 Reserved                               */
59     uint32 FUN;           /**<  0x0048 Pin Function Register                  */
60     uint32 DIR;           /**<  0x004C Pin Direction Register                 */
61     uint32 DIN;           /**<  0x0050 Pin Data In Register                   */
62     uint32 DOUT;          /**<  0x0054 Pin Data Out Register                  */
63     uint32 SET;           /**<  0x0058 Pin Data Set Register                  */
64     uint32 CLR;           /**<  0x005C Pin Data Clr Register                  */
65     uint32 ODR;           /**<  0x0060 Pin Open Drain Output Enable Register  */
66     uint32 PD;            /**<  0x0064 Pin Pullup/Pulldown Disable Register   */
67     uint32 PSL;           /**<  0x0068 Pin Pullup/Pulldown Selection Register */
68 } i2cBASE_t;
69 
70 
71 /** @def i2cREG1
72 *   @brief I2C Register Frame Pointer
73 *
74 *   This pointer is used by the I2C driver to access the I2C module registers.
75 */
76 #define i2cREG1 ((i2cBASE_t *)0xFFF7D400U)
77 
78 /* USER CODE BEGIN (1) */
79 /* USER CODE END */
80 
81 
82 /** @def i2cPORT1
83 *   @brief I2C GIO Port Register Pointer
84 *
85 *   Pointer used by the GIO driver to access I/O PORT of I2C
86 *   (use the GIO drivers to access the port pins).
87 */
88 #define i2cPORT1 ((gioPORT_t *)0xFFF7D44CU)
89 
90 /* USER CODE BEGIN (2) */
91 /* USER CODE END */
92 
93 
94 #endif
95