1 /******************************************************************************
2  *
3  * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by
4  * Analog Devices, Inc.),
5  * Copyright (C) 2023-2024 Analog Devices, Inc.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *     http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  ******************************************************************************/
20 
21 #include <stdio.h>
22 #include <stddef.h>
23 #include <stdint.h>
24 #include "mxc_device.h"
25 #include "mxc_assert.h"
26 #include "mxc_lock.h"
27 #include "mxc_sys.h"
28 #include "mxc_pins.h"
29 #include "mxc_delay.h"
30 #include "i2c_regs.h"
31 #include "dma_regs.h"
32 #include "i2c.h"
33 #include "i2c_reva.h"
34 #include "dma.h"
35 #include "dma_reva.h"
36 #include "dma_reva_regs.h"
37 
38 /* **** Definitions **** */
39 #define MXC_I2C_MAX_ADDR_WIDTH 0x7F
40 
41 /* **** Variable Declaration **** */
42 uint32_t interruptCheck = MXC_F_I2C_INTFL0_ADDR_MATCH | MXC_F_I2C_INTFL0_DNR_ERR;
43 
44 /* **** Function Prototypes **** */
45 
46 /* ************************************************************************* */
47 /* Control/Configuration functions                                           */
48 /* ************************************************************************* */
MXC_I2C_Init(mxc_i2c_regs_t * i2c,int masterMode,unsigned int slaveAddr)49 int MXC_I2C_Init(mxc_i2c_regs_t *i2c, int masterMode, unsigned int slaveAddr)
50 {
51     if (i2c == NULL) {
52         return E_NULL_PTR;
53     }
54 
55 #ifndef MSDK_NO_GPIO_CLK_INIT
56     MXC_I2C_Shutdown(i2c); // Clear everything out
57 
58     if (i2c == MXC_I2C0) {
59         MXC_SYS_ClockEnable(MXC_SYS_PERIPH_CLOCK_I2C0);
60         MXC_GPIO_Config(&gpio_cfg_i2c0);
61 #if TARGET_NUM != 32675
62     } else if (i2c == MXC_I2C1) {
63         MXC_SYS_ClockEnable(MXC_SYS_PERIPH_CLOCK_I2C1);
64         MXC_GPIO_Config(&gpio_cfg_i2c1);
65 #endif
66     } else if (i2c == MXC_I2C2) {
67         MXC_SYS_ClockEnable(MXC_SYS_PERIPH_CLOCK_I2C2);
68         MXC_GPIO_Config(&gpio_cfg_i2c2);
69     } else {
70         return E_NO_DEVICE;
71     }
72 #endif // MSDK_NO_GPIO_CLK_INIT
73 
74     return MXC_I2C_RevA_Init((mxc_i2c_reva_regs_t *)i2c, masterMode, slaveAddr);
75 }
76 
MXC_I2C_SetSlaveAddr(mxc_i2c_regs_t * i2c,unsigned int slaveAddr,int idx)77 int MXC_I2C_SetSlaveAddr(mxc_i2c_regs_t *i2c, unsigned int slaveAddr, int idx)
78 {
79     if (i2c == NULL) {
80         return E_NULL_PTR;
81     }
82 
83     if (idx >= MXC_I2C_NUM_TARGET_ADDR) {
84         return E_NOT_SUPPORTED;
85     }
86 
87     if (slaveAddr > MXC_F_I2C_SLAVE_ADDR) {
88         // Only support addresses up to 10 bits
89         return E_BAD_PARAM;
90     }
91 
92     // Set the slave address to operate on
93     MXC_SETFIELD(i2c->slave, MXC_F_I2C_SLAVE_IDX, (idx << MXC_F_I2C_SLAVE_IDX_POS));
94 
95     if (slaveAddr > MXC_I2C_MAX_ADDR_WIDTH) {
96         // Set for 10bit addressing mode
97         i2c->slave |= MXC_F_I2C_SLAVE_EXT_ADDR_EN;
98     } else {
99         // Clear for 7bit addressing mode
100         i2c->slave &= ~MXC_F_I2C_SLAVE_EXT_ADDR_EN;
101     }
102 
103     // Set the slave address
104     MXC_SETFIELD(i2c->slave, MXC_F_I2C_SLAVE_ADDR, (slaveAddr << MXC_F_I2C_SLAVE_ADDR_POS));
105 
106     // Enable the slave address
107     i2c->slave &= ~MXC_F_I2C_SLAVE_DIS;
108 
109     return E_NO_ERROR;
110 }
111 
MXC_I2C_Shutdown(mxc_i2c_regs_t * i2c)112 int MXC_I2C_Shutdown(mxc_i2c_regs_t *i2c)
113 {
114     // Configure GPIO for I2C
115     if (i2c == MXC_I2C0) {
116         MXC_SYS_ClockDisable(MXC_SYS_PERIPH_CLOCK_I2C0);
117         MXC_SYS_Reset_Periph(MXC_SYS_RESET0_I2C0);
118     } else if (i2c == MXC_I2C1) {
119         MXC_SYS_ClockDisable(MXC_SYS_PERIPH_CLOCK_I2C1);
120         MXC_SYS_Reset_Periph(MXC_SYS_RESET1_I2C1);
121     } else if (i2c == MXC_I2C2) {
122         MXC_SYS_ClockDisable(MXC_SYS_PERIPH_CLOCK_I2C2);
123         MXC_SYS_Reset_Periph(MXC_SYS_RESET1_I2C2);
124     } else {
125         return E_NO_DEVICE;
126     }
127 
128     return MXC_I2C_RevA_Shutdown((mxc_i2c_reva_regs_t *)i2c);
129 }
130 
MXC_I2C_Reset(mxc_i2c_regs_t * i2c)131 int MXC_I2C_Reset(mxc_i2c_regs_t *i2c)
132 {
133     // Configure GPIO for I2C
134     if (i2c == MXC_I2C0) {
135         MXC_SYS_Reset_Periph(MXC_SYS_RESET0_I2C0);
136     } else if (i2c == MXC_I2C1) {
137         MXC_SYS_Reset_Periph(MXC_SYS_RESET1_I2C1);
138     } else if (i2c == MXC_I2C2) {
139         MXC_SYS_Reset_Periph(MXC_SYS_RESET1_I2C2);
140     } else {
141         return E_NO_DEVICE;
142     }
143 
144     return E_NO_ERROR;
145 }
146 
MXC_I2C_SetFrequency(mxc_i2c_regs_t * i2c,unsigned int hz)147 int MXC_I2C_SetFrequency(mxc_i2c_regs_t *i2c, unsigned int hz)
148 {
149     return MXC_I2C_RevA_SetFrequency((mxc_i2c_reva_regs_t *)i2c, hz);
150 }
151 
MXC_I2C_GetFrequency(mxc_i2c_regs_t * i2c)152 unsigned int MXC_I2C_GetFrequency(mxc_i2c_regs_t *i2c)
153 {
154     return MXC_I2C_RevA_GetFrequency((mxc_i2c_reva_regs_t *)i2c);
155 }
156 
MXC_I2C_ReadyForSleep(mxc_i2c_regs_t * i2c)157 int MXC_I2C_ReadyForSleep(mxc_i2c_regs_t *i2c)
158 {
159     return MXC_I2C_RevA_ReadyForSleep((mxc_i2c_reva_regs_t *)i2c);
160 }
161 
MXC_I2C_SetClockStretching(mxc_i2c_regs_t * i2c,int enable)162 int MXC_I2C_SetClockStretching(mxc_i2c_regs_t *i2c, int enable)
163 {
164     return MXC_I2C_RevA_SetClockStretching((mxc_i2c_reva_regs_t *)i2c, enable);
165 }
166 
MXC_I2C_GetClockStretching(mxc_i2c_regs_t * i2c)167 int MXC_I2C_GetClockStretching(mxc_i2c_regs_t *i2c)
168 {
169     return MXC_I2C_RevA_GetClockStretching((mxc_i2c_reva_regs_t *)i2c);
170 }
171 
MXC_I2C_DMA_Init(mxc_i2c_regs_t * i2c,mxc_dma_regs_t * dma,bool use_dma_tx,bool use_dma_rx)172 int MXC_I2C_DMA_Init(mxc_i2c_regs_t *i2c, mxc_dma_regs_t *dma, bool use_dma_tx, bool use_dma_rx)
173 {
174     return MXC_I2C_RevA_DMA_Init((mxc_i2c_reva_regs_t *)i2c, (mxc_dma_reva_regs_t *)dma, use_dma_tx,
175                                  use_dma_rx);
176 }
177 
MXC_I2C_DMA_GetTXChannel(mxc_i2c_regs_t * i2c)178 int MXC_I2C_DMA_GetTXChannel(mxc_i2c_regs_t *i2c)
179 {
180     return MXC_I2C_RevA_DMA_GetTXChannel((mxc_i2c_reva_regs_t *)i2c);
181 }
182 
MXC_I2C_DMA_GetRXChannel(mxc_i2c_regs_t * i2c)183 int MXC_I2C_DMA_GetRXChannel(mxc_i2c_regs_t *i2c)
184 {
185     return MXC_I2C_RevA_DMA_GetRXChannel((mxc_i2c_reva_regs_t *)i2c);
186 }
187 
MXC_I2C_DMA_SetRequestSelect(mxc_i2c_regs_t * i2c,uint8_t * txData,uint8_t * rxData)188 int MXC_I2C_DMA_SetRequestSelect(mxc_i2c_regs_t *i2c, uint8_t *txData, uint8_t *rxData)
189 {
190     int i2cNum;
191     int txReqSel = -1;
192     int rxReqSel = -1;
193 
194     if (i2c == NULL) {
195         return E_NULL_PTR;
196     }
197 
198     i2cNum = MXC_I2C_GET_IDX((mxc_i2c_regs_t *)i2c);
199 
200     if (txData != NULL) {
201         switch (i2cNum) {
202         case 0:
203             txReqSel = MXC_DMA_REQUEST_I2C0TX;
204             break;
205 
206         case 1:
207             txReqSel = MXC_DMA_REQUEST_I2C1TX;
208             break;
209 
210         case 2:
211             txReqSel = MXC_DMA_REQUEST_I2C2TX;
212             break;
213 
214         default:
215             return E_BAD_PARAM;
216         }
217     }
218 
219     if (rxData != NULL) {
220         switch (i2cNum) {
221         case 0:
222             rxReqSel = MXC_DMA_REQUEST_I2C0RX;
223             break;
224 
225         case 1:
226             rxReqSel = MXC_DMA_REQUEST_I2C1RX;
227             break;
228 
229         case 2:
230             rxReqSel = MXC_DMA_REQUEST_I2C2RX;
231             break;
232 
233         default:
234             return E_BAD_PARAM;
235         }
236     }
237 
238     return MXC_I2C_RevA_DMA_SetRequestSelect((mxc_i2c_reva_regs_t *)i2c,
239                                              (mxc_dma_reva_regs_t *)MXC_DMA, txReqSel, rxReqSel);
240 }
241 
242 /* ************************************************************************* */
243 /* Low-level functions                                                       */
244 /* ************************************************************************* */
MXC_I2C_Start(mxc_i2c_regs_t * i2c)245 int MXC_I2C_Start(mxc_i2c_regs_t *i2c)
246 {
247     return MXC_I2C_RevA_Start((mxc_i2c_reva_regs_t *)i2c);
248 }
249 
MXC_I2C_Stop(mxc_i2c_regs_t * i2c)250 int MXC_I2C_Stop(mxc_i2c_regs_t *i2c)
251 {
252     return MXC_I2C_RevA_Stop((mxc_i2c_reva_regs_t *)i2c);
253 }
254 
MXC_I2C_WriteByte(mxc_i2c_regs_t * i2c,unsigned char byte)255 int MXC_I2C_WriteByte(mxc_i2c_regs_t *i2c, unsigned char byte)
256 {
257     return MXC_I2C_RevA_WriteByte((mxc_i2c_reva_regs_t *)i2c, byte);
258 }
259 
MXC_I2C_ReadByte(mxc_i2c_regs_t * i2c,unsigned char * byte,int ack)260 int MXC_I2C_ReadByte(mxc_i2c_regs_t *i2c, unsigned char *byte, int ack)
261 {
262     return MXC_I2C_RevA_ReadByte((mxc_i2c_reva_regs_t *)i2c, byte, ack);
263 }
264 
MXC_I2C_Write(mxc_i2c_regs_t * i2c,unsigned char * bytes,unsigned int * len)265 int MXC_I2C_Write(mxc_i2c_regs_t *i2c, unsigned char *bytes, unsigned int *len)
266 {
267     return MXC_I2C_RevA_Write((mxc_i2c_reva_regs_t *)i2c, bytes, len);
268 }
269 
MXC_I2C_Read(mxc_i2c_regs_t * i2c,unsigned char * bytes,unsigned int * len,int ack)270 int MXC_I2C_Read(mxc_i2c_regs_t *i2c, unsigned char *bytes, unsigned int *len, int ack)
271 {
272     return MXC_I2C_RevA_Read((mxc_i2c_reva_regs_t *)i2c, bytes, len, ack);
273 }
274 
MXC_I2C_ReadRXFIFO(mxc_i2c_regs_t * i2c,volatile unsigned char * bytes,unsigned int len)275 int MXC_I2C_ReadRXFIFO(mxc_i2c_regs_t *i2c, volatile unsigned char *bytes, unsigned int len)
276 {
277     return MXC_I2C_RevA_ReadRXFIFO((mxc_i2c_reva_regs_t *)i2c, bytes, len);
278 }
279 
MXC_I2C_ReadRXFIFODMA(mxc_i2c_regs_t * i2c,unsigned char * bytes,unsigned int len,mxc_i2c_dma_complete_cb_t callback)280 int MXC_I2C_ReadRXFIFODMA(mxc_i2c_regs_t *i2c, unsigned char *bytes, unsigned int len,
281                           mxc_i2c_dma_complete_cb_t callback)
282 {
283     // The callback parameter was previously unused but keeping it for backwards-compatibility.
284     return MXC_I2C_RevA_ReadRXFIFODMA((mxc_i2c_reva_regs_t *)i2c, bytes, len, MXC_DMA);
285 }
286 
MXC_I2C_GetRXFIFOAvailable(mxc_i2c_regs_t * i2c)287 int MXC_I2C_GetRXFIFOAvailable(mxc_i2c_regs_t *i2c)
288 {
289     return MXC_I2C_RevA_GetRXFIFOAvailable((mxc_i2c_reva_regs_t *)i2c);
290 }
291 
MXC_I2C_WriteTXFIFO(mxc_i2c_regs_t * i2c,volatile unsigned char * bytes,unsigned int len)292 int MXC_I2C_WriteTXFIFO(mxc_i2c_regs_t *i2c, volatile unsigned char *bytes, unsigned int len)
293 {
294     return MXC_I2C_RevA_WriteTXFIFO((mxc_i2c_reva_regs_t *)i2c, bytes, len);
295 }
296 
MXC_I2C_WriteTXFIFODMA(mxc_i2c_regs_t * i2c,unsigned char * bytes,unsigned int len,mxc_i2c_dma_complete_cb_t callback)297 int MXC_I2C_WriteTXFIFODMA(mxc_i2c_regs_t *i2c, unsigned char *bytes, unsigned int len,
298                            mxc_i2c_dma_complete_cb_t callback)
299 {
300     // The callback parameter was previously unused but keeping it for backwards-compatibility.
301     return MXC_I2C_RevA_WriteTXFIFODMA((mxc_i2c_reva_regs_t *)i2c, bytes, len, MXC_DMA);
302 }
303 
MXC_I2C_GetTXFIFOAvailable(mxc_i2c_regs_t * i2c)304 int MXC_I2C_GetTXFIFOAvailable(mxc_i2c_regs_t *i2c)
305 {
306     return MXC_I2C_RevA_GetTXFIFOAvailable((mxc_i2c_reva_regs_t *)i2c);
307 }
308 
MXC_I2C_ClearRXFIFO(mxc_i2c_regs_t * i2c)309 void MXC_I2C_ClearRXFIFO(mxc_i2c_regs_t *i2c)
310 {
311     MXC_I2C_RevA_ClearRXFIFO((mxc_i2c_reva_regs_t *)i2c);
312 }
313 
MXC_I2C_ClearTXFIFO(mxc_i2c_regs_t * i2c)314 void MXC_I2C_ClearTXFIFO(mxc_i2c_regs_t *i2c)
315 {
316     MXC_I2C_RevA_ClearTXFIFO((mxc_i2c_reva_regs_t *)i2c);
317 }
318 
MXC_I2C_GetFlags(mxc_i2c_regs_t * i2c,unsigned int * flags0,unsigned int * flags1)319 int MXC_I2C_GetFlags(mxc_i2c_regs_t *i2c, unsigned int *flags0, unsigned int *flags1)
320 {
321     return MXC_I2C_RevA_GetFlags((mxc_i2c_reva_regs_t *)i2c, flags0, flags1);
322 }
323 
MXC_I2C_ClearFlags(mxc_i2c_regs_t * i2c,unsigned int flags0,unsigned int flags1)324 void MXC_I2C_ClearFlags(mxc_i2c_regs_t *i2c, unsigned int flags0, unsigned int flags1)
325 {
326     MXC_I2C_RevA_ClearFlags((mxc_i2c_reva_regs_t *)i2c, flags0, flags1);
327 }
328 
MXC_I2C_EnableInt(mxc_i2c_regs_t * i2c,unsigned int flags0,unsigned int flags1)329 void MXC_I2C_EnableInt(mxc_i2c_regs_t *i2c, unsigned int flags0, unsigned int flags1)
330 {
331     MXC_I2C_RevA_EnableInt((mxc_i2c_reva_regs_t *)i2c, flags0, flags1);
332 }
333 
MXC_I2C_DisableInt(mxc_i2c_regs_t * i2c,unsigned int flags0,unsigned int flags1)334 void MXC_I2C_DisableInt(mxc_i2c_regs_t *i2c, unsigned int flags0, unsigned int flags1)
335 {
336     MXC_I2C_RevA_DisableInt((mxc_i2c_reva_regs_t *)i2c, flags0, flags1);
337 }
338 
MXC_I2C_EnablePreload(mxc_i2c_regs_t * i2c)339 void MXC_I2C_EnablePreload(mxc_i2c_regs_t *i2c)
340 {
341     MXC_I2C_RevA_EnablePreload((mxc_i2c_reva_regs_t *)i2c);
342 }
343 
MXC_I2C_DisablePreload(mxc_i2c_regs_t * i2c)344 void MXC_I2C_DisablePreload(mxc_i2c_regs_t *i2c)
345 {
346     MXC_I2C_RevA_DisablePreload((mxc_i2c_reva_regs_t *)i2c);
347 }
348 
MXC_I2C_EnableGeneralCall(mxc_i2c_regs_t * i2c)349 void MXC_I2C_EnableGeneralCall(mxc_i2c_regs_t *i2c)
350 {
351     MXC_I2C_RevA_EnableGeneralCall((mxc_i2c_reva_regs_t *)i2c);
352 }
353 
MXC_I2C_DisableGeneralCall(mxc_i2c_regs_t * i2c)354 void MXC_I2C_DisableGeneralCall(mxc_i2c_regs_t *i2c)
355 {
356     MXC_I2C_RevA_DisableGeneralCall((mxc_i2c_reva_regs_t *)i2c);
357 }
358 
MXC_I2C_SetTimeout(mxc_i2c_regs_t * i2c,unsigned int timeout)359 void MXC_I2C_SetTimeout(mxc_i2c_regs_t *i2c, unsigned int timeout)
360 {
361     MXC_I2C_RevA_SetTimeout((mxc_i2c_reva_regs_t *)i2c, timeout);
362 }
363 
MXC_I2C_GetTimeout(mxc_i2c_regs_t * i2c)364 unsigned int MXC_I2C_GetTimeout(mxc_i2c_regs_t *i2c)
365 {
366     return MXC_I2C_RevA_GetTimeout((mxc_i2c_reva_regs_t *)i2c);
367 }
368 
MXC_I2C_Recover(mxc_i2c_regs_t * i2c,unsigned int retries)369 int MXC_I2C_Recover(mxc_i2c_regs_t *i2c, unsigned int retries)
370 {
371     return MXC_I2C_RevA_Recover((mxc_i2c_reva_regs_t *)i2c, retries);
372 }
373 
374 /* ************************************************************************* */
375 /* Transaction level functions                                               */
376 /* ************************************************************************* */
377 
MXC_I2C_MasterTransaction(mxc_i2c_req_t * req)378 int MXC_I2C_MasterTransaction(mxc_i2c_req_t *req)
379 {
380     return MXC_I2C_RevA_MasterTransaction((mxc_i2c_reva_req_t *)req);
381 }
382 
MXC_I2C_MasterTransactionAsync(mxc_i2c_req_t * req)383 int MXC_I2C_MasterTransactionAsync(mxc_i2c_req_t *req)
384 {
385     return MXC_I2C_RevA_MasterTransactionAsync((mxc_i2c_reva_req_t *)req);
386 }
387 
MXC_I2C_MasterTransactionDMA(mxc_i2c_req_t * req)388 int MXC_I2C_MasterTransactionDMA(mxc_i2c_req_t *req)
389 {
390     return MXC_I2C_RevA_MasterTransactionDMA((mxc_i2c_reva_req_t *)req, MXC_DMA);
391 }
392 
MXC_I2C_SlaveTransaction(mxc_i2c_regs_t * i2c,mxc_i2c_slave_handler_t callback)393 int MXC_I2C_SlaveTransaction(mxc_i2c_regs_t *i2c, mxc_i2c_slave_handler_t callback)
394 {
395     return MXC_I2C_RevA_SlaveTransaction((mxc_i2c_reva_regs_t *)i2c,
396                                          (mxc_i2c_reva_slave_handler_t)callback, interruptCheck);
397 }
398 
MXC_I2C_SlaveTransactionAsync(mxc_i2c_regs_t * i2c,mxc_i2c_slave_handler_t callback)399 int MXC_I2C_SlaveTransactionAsync(mxc_i2c_regs_t *i2c, mxc_i2c_slave_handler_t callback)
400 {
401     return MXC_I2C_RevA_SlaveTransactionAsync(
402         (mxc_i2c_reva_regs_t *)i2c, (mxc_i2c_reva_slave_handler_t)callback, interruptCheck);
403 }
404 
MXC_I2C_SetRXThreshold(mxc_i2c_regs_t * i2c,unsigned int numBytes)405 int MXC_I2C_SetRXThreshold(mxc_i2c_regs_t *i2c, unsigned int numBytes)
406 {
407     return MXC_I2C_RevA_SetRXThreshold((mxc_i2c_reva_regs_t *)i2c, numBytes);
408 }
409 
MXC_I2C_GetRXThreshold(mxc_i2c_regs_t * i2c)410 unsigned int MXC_I2C_GetRXThreshold(mxc_i2c_regs_t *i2c)
411 {
412     return MXC_I2C_RevA_GetRXThreshold((mxc_i2c_reva_regs_t *)i2c);
413 }
414 
MXC_I2C_SetTXThreshold(mxc_i2c_regs_t * i2c,unsigned int numBytes)415 int MXC_I2C_SetTXThreshold(mxc_i2c_regs_t *i2c, unsigned int numBytes)
416 {
417     return MXC_I2C_RevA_SetTXThreshold((mxc_i2c_reva_regs_t *)i2c, numBytes);
418 }
419 
MXC_I2C_GetTXThreshold(mxc_i2c_regs_t * i2c)420 unsigned int MXC_I2C_GetTXThreshold(mxc_i2c_regs_t *i2c)
421 {
422     return MXC_I2C_RevA_GetTXThreshold((mxc_i2c_reva_regs_t *)i2c);
423 }
424 
MXC_I2C_AsyncStop(mxc_i2c_regs_t * i2c)425 void MXC_I2C_AsyncStop(mxc_i2c_regs_t *i2c)
426 {
427     MXC_I2C_RevA_AsyncStop((mxc_i2c_reva_regs_t *)i2c);
428 }
429 
MXC_I2C_AbortAsync(mxc_i2c_regs_t * i2c)430 void MXC_I2C_AbortAsync(mxc_i2c_regs_t *i2c)
431 {
432     MXC_I2C_RevA_AbortAsync((mxc_i2c_reva_regs_t *)i2c);
433 }
434 
MXC_I2C_AsyncHandler(mxc_i2c_regs_t * i2c)435 void MXC_I2C_AsyncHandler(mxc_i2c_regs_t *i2c)
436 {
437     MXC_I2C_RevA_AsyncHandler((mxc_i2c_reva_regs_t *)i2c, interruptCheck);
438 }
439 
MXC_I2C_DMACallback(int ch,int error)440 void MXC_I2C_DMACallback(int ch, int error)
441 {
442     MXC_I2C_RevA_DMACallback(ch, error);
443 }
444