ADuCM302x Device Drivers API Reference Manual  Release 3.1.2.0
adi_i2c_config.h
1 
48 #ifndef ADI_I2C_CONFIG_H
49 #define ADI_I2C_CONFIG_H
50 #include <adi_global_config.h>
51 
57 /************* I2C Driver configurations ***************/
58 
63 #define ADI_I2C_CFG_MCTL_MXMITDEC (0)
64 
68 #define ADI_I2C_CFG_MCTL_IENCMP (1)
69 
73 #define ADI_I2C_CFG_MCTL_IENACK (1)
74 
78 #define ADI_I2C_CFG_MCTL_IENALOST (1)
79 
83 #define ADI_I2C_CFG_MCTL_STRETCHSCL (0)
84 
88 #define ADI_I2C_CFG_MCTL_LOOPBACK (0)
89 
93 #define ADI_I2C_CFG_MCTL_COMPLETE (0)
94 
98 #define ADI_I2C_CFG_MCTL_MASEN (0)
99 
118 #define ADI_I2C_CFG_DIV_HIGH (25)
119 
124 #define ADI_I2C_CFG_DIV_LOW (31)
125 
129 #define ADI_I2C_CFG_SHCTL_RST (0)
130 
134 #define ADI_I2C_CFG_TCTL_FILTEROFF (0)
135 
138 #define ADI_I2C_CFG_TCTL_THDATIN (1)
139 
149 #define ADI_I2C_CFG_ASTRETCH_MST (0)
150 
157 #define ADI_I2C_CFG_SLAVE_ADDRESS (0x50)
158 
159 
160 /***********************************\
161 |* Check for overflowing values... *|
162 \***********************************/
163 
164 #if (ADI_I2C_CFG_MCTL_MXMITDEC >> 1)
165 #error "Decrement TX FIFO status config value too wide"
166 #endif
167 
168 #if (ADI_I2C_CFG_MCTL_IENCMP >> 1)
169 #error "Transaction complete (STOP) interrupt enable config value too wide"
170 #endif
171 
172 #if (ADI_I2C_CFG_MCTL_IENACK >> 1)
173 #error "NACK interrupt enable config value too wide"
174 #endif
175 
176 #if (ADI_I2C_CFG_MCTL_IENALOST >> 1)
177 #error "ALOST interrupt enable config value too wide"
178 #endif
179 
180 #if (ADI_I2C_CFG_MCTL_STRETCHSCL >> 1)
181 #error "Clock stretch enable config value too wide"
182 #endif
183 
184 #if (ADI_I2C_CFG_MCTL_LOOPBACK >> 1)
185 #error "Loopback enable config value too wide"
186 #endif
187 
188 #if (ADI_I2C_CFG_MCTL_COMPLETE >> 1)
189 #error "Start back-off disable config value too wide"
190 #endif
191 
192 #if (ADI_I2C_CFG_MCTL_MASEN >> 1)
193 #error "Master device enable config value too wide"
194 #endif
195 
196 #if (ADI_I2C_CFG_DIV_HIGH >> 8)
197 #error "Clock HIGH time config value too wide"
198 #endif
199 
200 #if (ADI_I2C_CFG_DIV_LOW >> 8)
201 #error "Clock LOW time config value too wide"
202 #endif
203 
204 #if (ADI_I2C_CFG_SHCTL_RST >> 1)
205 #error "Shared control reset config value too wide"
206 #endif
207 
208 #if (ADI_I2C_CFG_TCTL_FILTEROFF >> 1)
209 #error "Timing control filter-off config value too wide"
210 #endif
211 
212 #if (ADI_I2C_CFG_TCTL_THDATIN >> 5)
213 #error "Timing control filter-off config value too wide"
214 #endif
215 
216 #if (ADI_I2C_CFG_ASTRETCH_MST >> 4)
217 #error "Master clock stretch config value too wide"
218 #endif
219 
220 #if (ADI_I2C_CFG_SLAVE_ADDRESS >> 7)
221 #error "Slave address config value too wide"
222 #endif
223 
226 #endif /* ADI_I2C_CONFIG_H */