ADuCM4x50 Device Drivers API Reference Manual  Release 4.0.0.0
adi_i2c_config.h
1 
15 #ifndef ADI_I2C_CONFIG_H
16 #define ADI_I2C_CONFIG_H
17 #include <adi_global_config.h>
18 
24 /************* I2C Driver configurations ***************/
25 
30 #define ADI_I2C_CFG_MCTL_MXMITDEC (0)
31 
35 #define ADI_I2C_CFG_MCTL_IENCMP (1)
36 
40 #define ADI_I2C_CFG_MCTL_IENACK (1)
41 
45 #define ADI_I2C_CFG_MCTL_IENALOST (1)
46 
50 #define ADI_I2C_CFG_MCTL_STRETCHSCL (0)
51 
55 #define ADI_I2C_CFG_MCTL_LOOPBACK (0)
56 
60 #define ADI_I2C_CFG_MCTL_COMPLETE (0)
61 
65 #define ADI_I2C_CFG_MCTL_MASEN (0)
66 
70 #define ADI_I2C_CFG_MCTL_BUSCLR (1)
71 
75 #define ADI_I2C_CFG_MCTL_STOPBUSCLR (1)
76 
77 
96 #define ADI_I2C_CFG_DIV_HIGH (25)
97 
102 #define ADI_I2C_CFG_DIV_LOW (31)
103 
107 #define ADI_I2C_CFG_SHCTL_RST (0)
108 
112 #define ADI_I2C_CFG_TCTL_FILTEROFF (0)
113 
116 #define ADI_I2C_CFG_TCTL_THDATIN (1)
117 
127 #define ADI_I2C_CFG_ASTRETCH_MST (0)
128 
135 #define ADI_I2C_CFG_SLAVE_ADDRESS (0x50)
136 
137 
138 /***********************************\
139 |* Check for overflowing values... *|
140 \***********************************/
141 
142 #if (ADI_I2C_CFG_MCTL_MXMITDEC >> 1)
143 #error "Decrement TX FIFO status config value too wide"
144 #endif
145 
146 #if (ADI_I2C_CFG_MCTL_IENCMP >> 1)
147 #error "Transaction complete (STOP) interrupt enable config value too wide"
148 #endif
149 
150 #if (ADI_I2C_CFG_MCTL_IENACK >> 1)
151 #error "NACK interrupt enable config value too wide"
152 #endif
153 
154 #if (ADI_I2C_CFG_MCTL_IENALOST >> 1)
155 #error "ALOST interrupt enable config value too wide"
156 #endif
157 
158 #if (ADI_I2C_CFG_MCTL_STRETCHSCL >> 1)
159 #error "Clock stretch enable config value too wide"
160 #endif
161 
162 #if (ADI_I2C_CFG_MCTL_LOOPBACK >> 1)
163 #error "Loopback enable config value too wide"
164 #endif
165 
166 #if (ADI_I2C_CFG_MCTL_COMPLETE >> 1)
167 #error "Start back-off disable config value too wide"
168 #endif
169 
170 #if (ADI_I2C_CFG_MCTL_MASEN >> 1)
171 #error "Master device enable config value too wide"
172 #endif
173 
174 #if (ADI_I2C_CFG_DIV_HIGH >> 8)
175 #error "Clock HIGH time config value too wide"
176 #endif
177 
178 #if (ADI_I2C_CFG_DIV_LOW >> 8)
179 #error "Clock LOW time config value too wide"
180 #endif
181 
182 #if (ADI_I2C_CFG_SHCTL_RST >> 1)
183 #error "Shared control reset config value too wide"
184 #endif
185 
186 #if (ADI_I2C_CFG_TCTL_FILTEROFF >> 1)
187 #error "Timing control filter-off config value too wide"
188 #endif
189 
190 #if (ADI_I2C_CFG_TCTL_THDATIN >> 5)
191 #error "Timing control filter-off config value too wide"
192 #endif
193 
194 #if (ADI_I2C_CFG_ASTRETCH_MST >> 4)
195 #error "Master clock stretch config value too wide"
196 #endif
197 
198 #if (ADI_I2C_CFG_SLAVE_ADDRESS >> 7)
199 #error "Slave address config value too wide"
200 #endif
201 
204 #endif /* ADI_I2C_CONFIG_H */