xref: /utopia/UTPA2-700.0.x/mxlib/include/apiSWI2C.h (revision 53ee8cc121a030b8d368113ac3e966b4705770ef)
1 //<MStar Software>
2 //******************************************************************************
3 // MStar Software
4 // Copyright (c) 2010 - 2012 MStar Semiconductor, Inc. All rights reserved.
5 // All software, firmware and related documentation herein ("MStar Software") are
6 // intellectual property of MStar Semiconductor, Inc. ("MStar") and protected by
7 // law, including, but not limited to, copyright law and international treaties.
8 // Any use, modification, reproduction, retransmission, or republication of all
9 // or part of MStar Software is expressly prohibited, unless prior written
10 // permission has been granted by MStar.
11 //
12 // By accessing, browsing and/or using MStar Software, you acknowledge that you
13 // have read, understood, and agree, to be bound by below terms ("Terms") and to
14 // comply with all applicable laws and regulations:
15 //
16 // 1. MStar shall retain any and all right, ownership and interest to MStar
17 //    Software and any modification/derivatives thereof.
18 //    No right, ownership, or interest to MStar Software and any
19 //    modification/derivatives thereof is transferred to you under Terms.
20 //
21 // 2. You understand that MStar Software might include, incorporate or be
22 //    supplied together with third party`s software and the use of MStar
23 //    Software may require additional licenses from third parties.
24 //    Therefore, you hereby agree it is your sole responsibility to separately
25 //    obtain any and all third party right and license necessary for your use of
26 //    such third party`s software.
27 //
28 // 3. MStar Software and any modification/derivatives thereof shall be deemed as
29 //    MStar`s confidential information and you agree to keep MStar`s
30 //    confidential information in strictest confidence and not disclose to any
31 //    third party.
32 //
33 // 4. MStar Software is provided on an "AS IS" basis without warranties of any
34 //    kind. Any warranties are hereby expressly disclaimed by MStar, including
35 //    without limitation, any warranties of merchantability, non-infringement of
36 //    intellectual property rights, fitness for a particular purpose, error free
37 //    and in conformity with any international standard.  You agree to waive any
38 //    claim against MStar for any loss, damage, cost or expense that you may
39 //    incur related to your use of MStar Software.
40 //    In no event shall MStar be liable for any direct, indirect, incidental or
41 //    consequential damages, including without limitation, lost of profit or
42 //    revenues, lost or damage of data, and unauthorized system use.
43 //    You agree that this Section 4 shall still apply without being affected
44 //    even if MStar Software has been modified by MStar in accordance with your
45 //    request or instruction for your use, except otherwise agreed by both
46 //    parties in writing.
47 //
48 // 5. If requested, MStar may from time to time provide technical supports or
49 //    services in relation with MStar Software to you for your use of
50 //    MStar Software in conjunction with your or your customer`s product
51 //    ("Services").
52 //    You understand and agree that, except otherwise agreed by both parties in
53 //    writing, Services are provided on an "AS IS" basis and the warranty
54 //    disclaimer set forth in Section 4 above shall apply.
55 //
56 // 6. Nothing contained herein shall be construed as by implication, estoppels
57 //    or otherwise:
58 //    (a) conferring any license or right to use MStar name, trademark, service
59 //        mark, symbol or any other identification;
60 //    (b) obligating MStar or any of its affiliates to furnish any person,
61 //        including without limitation, you and your customers, any assistance
62 //        of any kind whatsoever, or any information; or
63 //    (c) conferring any license or right under any intellectual property right.
64 //
65 // 7. These terms shall be governed by and construed in accordance with the laws
66 //    of Taiwan, R.O.C., excluding its conflict of law rules.
67 //    Any and all dispute arising out hereof or related hereto shall be finally
68 //    settled by arbitration referred to the Chinese Arbitration Association,
69 //    Taipei in accordance with the ROC Arbitration Law and the Arbitration
70 //    Rules of the Association by three (3) arbitrators appointed in accordance
71 //    with the said Rules.
72 //    The place of arbitration shall be in Taipei, Taiwan and the language shall
73 //    be English.
74 //    The arbitration award shall be final and binding to both parties.
75 //
76 //******************************************************************************
77 //<MStar Software>
78 ////////////////////////////////////////////////////////////////////////////////
79 //
80 // Copyright (c) 2006-2009 MStar Semiconductor, Inc.
81 // All rights reserved.
82 //
83 // Unless otherwise stipulated in writing, any and all information contained
84 // herein regardless in any format shall remain the sole proprietary of
85 // MStar Semiconductor Inc. and be kept in strict confidence
86 // (��MStar Confidential Information��) by the recipient.
87 // Any unauthorized act including without limitation unauthorized disclosure,
88 // copying, use, reproduction, sale, distribution, modification, disassembling,
89 // reverse engineering and compiling of the contents of MStar Confidential
90 // Information is unlawful and strictly prohibited. MStar hereby reserves the
91 // rights to any and all damages, losses, costs and expenses resulting therefrom.
92 //
93 ////////////////////////////////////////////////////////////////////////////////
94 
95 ///////////////////////////////////////////////////////////////////////////////////////////////////
96 ///
97 /// @file   apiSWI2C.h
98 /// @brief  SWI2C interface
99 /// @author MStar Semiconductor Inc.
100 /// @version 1.0
101 /////////////////////////////////////////////////////////////////////////////////////////////////////
102 
103 /*! \defgroup G_PERIPHERAL Peripheral modules
104 	\defgroup G_SWI2C SWI2C interface
105     \ingroup  G_PERIPHERAL
106 
107     \brief
108 
109 	IIC is a multi-master, multi-slave, single-ended, serial computer bus. It is typically used for attaching lower-speed peripheral
110 	ICs to processors and micro-controllers. Alternatively I2C is spelled I2C (pronounced I-two-C) or IIC (pronounced I-I-C).
111 
112 	apiSWI2C using GPIOs(SDA and SCL) to emulate IIC protocol.
113 
114     <b>Features</b>
115     - IIC Initialize & De-initialize function
116     - IIC Send Data
117     - IIC Receive Data
118 
119     <b> Operation Code Flow: </b> \n
120     -# I2C Start Condition.
121     -# Send data.
122     -# Receive data.
123 	-# I2C End Condition.
124 
125     \defgroup G_SWI2C_INIT Initialization Task relative
126     \ingroup  G_SWI2C
127     \defgroup G_SWI2C_COMMON read/write Task relative
128     \ingroup  G_SWI2C
129     \defgroup G_SWI2C_BUS I2C Bus relative
130     \ingroup  G_SWI2C
131     \defgroup G_SWI2C_OTHER  other relative
132     \ingroup  G_SWI2C
133     \defgroup G_SWI2C_ToBeModified SWI2C api to be modified
134     \ingroup  G_SWI2C
135     \defgroup G_SWI2C_ToBeRemove SWI2C api to be removed
136     \ingroup  G_SWI2C
137 */
138 
139 #ifndef _API_SWI2C_H_
140 #define _API_SWI2C_H_
141 
142 #include "MsCommon.h"
143 
144 #ifdef __cplusplus
145 extern "C"
146 {
147 #endif
148 
149 //-------------------------------------------------------------------------------------------------
150 //  Driver Capability
151 //-------------------------------------------------------------------------------------------------
152 
153 
154 //-------------------------------------------------------------------------------------------------
155 //  Macro and Define
156 //-------------------------------------------------------------------------------------------------
157 /// define IR library version
158 #define MSIF_SWI2C_LIB_CODE             {'S','I','2','C'}
159 #define MSIF_SWI2C_LIBVER               {'0','5'}
160 #define MSIF_SWI2C_BUILDNUM             {'0','5' }
161 #define MSIF_SWI2C_CHANGELIST           {'0','0','4','9','7','5','7','8'}
162 
163 #define SWI2C_API_VERSION                 /* Character String for DRV/API version */  \
164       MSIF_TAG,                           /* 'MSIF' */  \
165       MSIF_CLASS,                         /* '00' */  \
166       MSIF_CUS,                           /* 0x0000 */  \
167       MSIF_MOD,                           /* 0x0000 */  \
168       MSIF_CHIP,                                       \
169       MSIF_CPU,                                        \
170       MSIF_SWI2C_LIB_CODE,                /* IP__ */  \
171       MSIF_SWI2C_LIBVER,                  /* 0.0 ~ Z.Z */  \
172       MSIF_SWI2C_BUILDNUM,                /* 00 ~ 99 */  \
173       MSIF_SWI2C_CHANGELIST,              /* CL# */  \
174       MSIF_OS
175 
176 // Speed Mapping: Base on the Driver loading, maybe you must to use the oscilloscope to measure this Value
177 // Speed Mapping has been refined, and you can specify the IIC speed X (KHz) driectly by X.
178 #define SWI2C_SPEED_MAPPING_400K          400
179 #define SWI2C_SPEED_MAPPING_350K          350
180 #define SWI2C_SPEED_MAPPING_300K          300
181 #define SWI2C_SPEED_MAPPING_250K          250
182 #define SWI2C_SPEED_MAPPING_200K          200
183 #define SWI2C_SPEED_MAPPING_150K          150
184 #define SWI2C_SPEED_MAPPING_100K          100
185 #define SWI2C_SPEED_MAPPING_50K           50
186 
187 /// emurate SWI2C fucntion return result
188 typedef enum
189 {
190     /// SWI2C result for failure
191     E_SWI2C_FAIL =0,
192     /// SWI2C result for OK
193     E_SWI2C_OK = 1,
194 
195 } SWI2C_Result;
196 
197 ///Define SWI2C Bus Configuration
198 typedef struct
199 {
200     MS_U16 padSCL;
201     MS_U16 padSDA;
202     MS_U16 defDelay;
203 } SWI2C_BusCfg;
204 
205 ///Define SWI2C read mode
206 typedef enum {
207     E_SWI2C_READ_MODE_DIRECT,                 ///< first transmit slave address + reg address and then start receive the data */
208     E_SWI2C_READ_MODE_DIRECTION_CHANGE,       ///< slave address + reg address in write mode, direction change to read mode, repeat start slave address in read mode, data from device
209     E_SWI2C_READ_MODE_DIRECTION_CHANGE_STOP_START,  ///< slave address + reg address in write mode + stop, direction change to read mode, repeat start slave address in read mode, data from device
210     E_SWI2C_READ_MODE_MAX
211 } SWI2C_ReadMode;
212 
213 ///Define SWI2C debug level
214 typedef enum _SWI2C_DbgLvl
215 {
216     E_SWI2C_DBGLVL_NONE = 0,      /// no debug message
217     E_SWI2C_DBGLVL_WARNING,       /// show warning only
218     E_SWI2C_DBGLVL_ERROR,         /// show error only
219     E_SWI2C_DBGLVL_INFO,          /// show error & informaiton
220     E_SWI2C_DBGLVL_ALL,           /// show error, information & funciton name
221 }SWI2C_DbgLvl;
222 
223 typedef enum _SWI2C_CfgCmd
224 {
225     E_SWI2C_CFGCMD_TRANSRTY=0,  /// do transcation retry
226     E_SWI2C_CFGCMD_SNDBYRTY,  /// do send byte retry
227     E_SWI2C_CFGCMD_NONE,                  /// do nothing
228 }SWI2C_CfgCmd;
229 
230 ///Define SWI2C bus configuration parameters
231 typedef struct
232 {
233     MS_U32 u32CfgParam[8] ; /// configuration parameter list
234     SWI2C_CfgCmd  cfgCmd;      /// configuration commands
235     MS_U8 u8BusNum;               /// bus number to be configured
236     MS_BOOL bByBus;                 ///0: configure by bus, 1: configure for all buses
237     MS_BOOL bRecoveried;      ///0: set by specified value, 1: recoveried back to default value
238 } SWI2C_Config;
239 //-------------------------------------------------------------------------------------------------
240 /// MOBF Encrypt
241 /// @ingroup G_SWI2C_INIT
242 /// @param u32Key \b IN: Key
243 /// @param bEnable \b IN: TRUE/FLASE
244 /// @return DRVAESDMA_OK : Success
245 /// @return Others : Fail
246 //-------------------------------------------------------------------------------------------------
247 void MApi_SWI2C_Init(SWI2C_BusCfg SWI2CBusCfg[],MS_U8 u8CfgBusNum);
248 //-------------------------------------------------------------------------------------------------
249 /// MOBF Encrypt
250 /// @ingroup G_SWI2C_COMMON
251 /// @param u32Key \b IN: Key
252 /// @param bEnable \b IN: TRUE/FLASE
253 /// @return DRVAESDMA_OK : Success
254 /// @return Others : Fail
255 //-------------------------------------------------------------------------------------------------
256 MS_BOOL MApi_SWI2C_WriteBytes(MS_U16 u16BusNumSlaveID, MS_U8 u8addrcount, MS_U8* pu8addr, MS_U16 u16size, MS_U8* pu8data);
257 //-------------------------------------------------------------------------------------------------
258 /// MOBF Encrypt
259 /// @ingroup G_SWI2C_COMMON
260 /// @param u32Key \b IN: Key
261 /// @param bEnable \b IN: TRUE/FLASE
262 /// @return DRVAESDMA_OK : Success
263 /// @return Others : Fail
264 //-------------------------------------------------------------------------------------------------
265 MS_BOOL MApi_SWI2C_WriteBytesStop(MS_U16 u16BusNumSlaveID, MS_U8 AddrCnt, MS_U8* pu8addr, MS_U16 u16size, MS_U8* pBuf,MS_BOOL bGenStop);
266 //-------------------------------------------------------------------------------------------------
267 /// MOBF Encrypt
268 /// @ingroup G_SWI2C_COMMON
269 /// @param u32Key \b IN: Key
270 /// @param bEnable \b IN: TRUE/FLASE
271 /// @return DRVAESDMA_OK : Success
272 /// @return Others : Fail
273 //-------------------------------------------------------------------------------------------------
274 MS_BOOL MApi_SWI2C_ReadBytes(MS_U16 u16BusNumSlaveID, MS_U8 u8AddrNum, MS_U8* paddr, MS_U16 u16size, MS_U8* pu8data);
275 //-------------------------------------------------------------------------------------------------
276 /// MOBF Encrypt
277 /// @ingroup G_SWI2C_COMMON
278 /// @param u32Key \b IN: Key
279 /// @param bEnable \b IN: TRUE/FLASE
280 /// @return DRVAESDMA_OK : Success
281 /// @return Others : Fail
282 //-------------------------------------------------------------------------------------------------
283 MS_BOOL MApi_SWI2C_ReadBytes_ThruMode(MS_U16 u16BusNumSlaveID, MS_U8 ucSubAdr, MS_U8* paddr, MS_U16 ucBufLen, MS_U8* pBuf);
284 //-------------------------------------------------------------------------------------------------
285 /// MOBF Encrypt
286 /// @ingroup G_SWI2C_ToBeRemove
287 /// @param u32Key \b IN: Key
288 /// @param bEnable \b IN: TRUE/FLASE
289 /// @return DRVAESDMA_OK : Success
290 /// @return Others : Fail
291 //-------------------------------------------------------------------------------------------------
292 MS_BOOL MApi_SWI2C_ReadByte(MS_U16 u16BusNumSlaveID, MS_U8 u8RegAddr, MS_U8 *pu8Data);
293 //-------------------------------------------------------------------------------------------------
294 /// MOBF Encrypt
295 /// @ingroup G_SWI2C_ToBeRemove
296 /// @param u32Key \b IN: Key
297 /// @param bEnable \b IN: TRUE/FLASE
298 /// @return DRVAESDMA_OK : Success
299 /// @return Others : Fail
300 //-------------------------------------------------------------------------------------------------
301 MS_BOOL MApi_SWI2C_WriteByte(MS_U16 u16BusNumSlaveID, MS_U8 u8RegAddr, MS_U8 u8Data);
302 //-------------------------------------------------------------------------------------------------
303 /// MOBF Encrypt
304 /// @ingroup G_SWI2C_ToBeRemove
305 /// @param u32Key \b IN: Key
306 /// @param bEnable \b IN: TRUE/FLASE
307 /// @return DRVAESDMA_OK : Success
308 /// @return Others : Fail
309 //-------------------------------------------------------------------------------------------------
310 MS_BOOL MApi_SWI2C_Write2Bytes(MS_U16 u16BusNumSlaveID, MS_U8 u8addr, MS_U16 u16data);
311 //-------------------------------------------------------------------------------------------------
312 /// MOBF Encrypt
313 /// @ingroup G_SWI2C_ToBeRemove
314 /// @param u32Key \b IN: Key
315 /// @param bEnable \b IN: TRUE/FLASE
316 /// @return DRVAESDMA_OK : Success
317 /// @return Others : Fail
318 //-------------------------------------------------------------------------------------------------
319 MS_U16 MApi_SWI2C_Read2Bytes(MS_U16 u16BusNumSlaveID, MS_U8 u8addr);
320 //-------------------------------------------------------------------------------------------------
321 /// MOBF Encrypt
322 /// @ingroup G_SWI2C_ToBeRemove
323 /// @param u32Key \b IN: Key
324 /// @param bEnable \b IN: TRUE/FLASE
325 /// @return DRVAESDMA_OK : Success
326 /// @return Others : Fail
327 //-------------------------------------------------------------------------------------------------
328 MS_BOOL MApi_SWI2C_Write4Bytes(MS_U16 u16BusNumSlaveID, MS_U32 u32Data, MS_U8 u8EndData);
329 //-------------------------------------------------------------------------------------------------
330 /// MOBF Encrypt
331 /// @ingroup G_SWI2C_ToBeRemove
332 /// @param u32Key \b IN: Key
333 /// @param bEnable \b IN: TRUE/FLASE
334 /// @return DRVAESDMA_OK : Success
335 /// @return Others : Fail
336 //-------------------------------------------------------------------------------------------------
337 MS_BOOL MApi_SWI2C_ReadByteDirectly(MS_U16 u16BusNumSlaveID, MS_U8 * pu8Data);
338 //-------------------------------------------------------------------------------------------------
339 /// MOBF Encrypt
340 /// @ingroup G_SWI2C_ToBeRemove
341 /// @param u32Key \b IN: Key
342 /// @param bEnable \b IN: TRUE/FLASE
343 /// @return DRVAESDMA_OK : Success
344 /// @return Others : Fail
345 //-------------------------------------------------------------------------------------------------
346 MS_BOOL MApi_SWI2C_WriteGroupBytes(MS_U16 u16BusNumSlaveID, MS_U8 u8SubGroup, MS_U16 u16Addr, MS_U16 u16Data);
347 //-------------------------------------------------------------------------------------------------
348 /// MOBF Encrypt
349 /// @ingroup G_SWI2C_ToBeRemove
350 /// @param u32Key \b IN: Key
351 /// @param bEnable \b IN: TRUE/FLASE
352 /// @return DRVAESDMA_OK : Success
353 /// @return Others : Fail
354 //-------------------------------------------------------------------------------------------------
355 MS_U16 MApi_SWI2C_ReadGroupBytes(MS_U16 u16BusNumSlaveID, MS_U8 u8SubGroup, MS_U16 u16Addr);
356 //-------------------------------------------------------------------------------------------------
357 /// MOBF Encrypt
358 /// @ingroup G_SWI2C_BUS
359 /// @param u32Key \b IN: Key
360 /// @param bEnable \b IN: TRUE/FLASE
361 /// @return DRVAESDMA_OK : Success
362 /// @return Others : Fail
363 //-------------------------------------------------------------------------------------------------
364 MS_U8 MApi_SWI2C_GetMaxBuses(void);
365 //-------------------------------------------------------------------------------------------------
366 /// MOBF Encrypt
367 /// @ingroup G_SWI2C_BUS
368 /// @param u32Key \b IN: Key
369 /// @param bEnable \b IN: TRUE/FLASE
370 /// @return DRVAESDMA_OK : Success
371 /// @return Others : Fail
372 //-------------------------------------------------------------------------------------------------
373 MS_U32 MApi_SWI2C_Speed_Setting(MS_U8 u8BusNum, MS_U32 u32Speed_K);
374 //-------------------------------------------------------------------------------------------------
375 /// MOBF Encrypt
376 /// @ingroup G_SWI2C_COMMON
377 /// @param u32Key \b IN: Key
378 /// @param bEnable \b IN: TRUE/FLASE
379 /// @return DRVAESDMA_OK : Success
380 /// @return Others : Fail
381 //-------------------------------------------------------------------------------------------------
382 MS_BOOL MApi_SWI2C_SetReadMode(SWI2C_ReadMode eReadMode);
383 //-------------------------------------------------------------------------------------------------
384 /// MOBF Encrypt
385 /// @ingroup G_SWI2C_BUS
386 /// @param u32Key \b IN: Key
387 /// @param bEnable \b IN: TRUE/FLASE
388 /// @return DRVAESDMA_OK : Success
389 /// @return Others : Fail
390 //-------------------------------------------------------------------------------------------------
391 MS_BOOL MApi_SWI2C_SetBusReadMode(MS_U8 u8BusNum, SWI2C_ReadMode eReadMode);
392 //-------------------------------------------------------------------------------------------------
393 /// MOBF Encrypt
394 /// @ingroup G_SWI2C_COMMON
395 /// @param u32Key \b IN: Key
396 /// @param bEnable \b IN: TRUE/FLASE
397 /// @return DRVAESDMA_OK : Success
398 /// @return Others : Fail
399 //-------------------------------------------------------------------------------------------------
400 MS_BOOL MApi_SWI2C_GetLibVer(const MSIF_Version **ppVersion);
401 //-------------------------------------------------------------------------------------------------
402 /// MOBF Encrypt
403 /// @ingroup G_SWI2C_COMMON
404 /// @param u32Key \b IN: Key
405 /// @param bEnable \b IN: TRUE/FLASE
406 /// @return DRVAESDMA_OK : Success
407 /// @return Others : Fail
408 //-------------------------------------------------------------------------------------------------
409 SWI2C_Result MApi_SWI2C_SetDbgLevel(SWI2C_DbgLvl eLevel);
410 //-------------------------------------------------------------------------------------------------
411 /// MOBF Encrypt
412 /// @ingroup G_SWI2C_COMMON
413 /// @param u32Key \b IN: Key
414 /// @param bEnable \b IN: TRUE/FLASE
415 /// @return DRVAESDMA_OK : Success
416 /// @return Others : Fail
417 //-------------------------------------------------------------------------------------------------
418 MS_U16 MApi_SWI2C_SetPowerState(EN_POWER_MODE u16PowerState);
419 
420 /******************************************************************************/
421 ///
422 /// The following API functions are packed for special usage in ISP programming
423 ///
424 /******************************************************************************/
425 //-------------------------------------------------------------------------------------------------
426 /// MOBF Encrypt
427 /// @ingroup G_SWI2C_COMMON
428 /// @param u32Key \b IN: Key
429 /// @param bEnable \b IN: TRUE/FLASE
430 /// @return DRVAESDMA_OK : Success
431 /// @return Others : Fail
432 //-------------------------------------------------------------------------------------------------
433 void MApi_SWI2C_MutexLock(void);
434 //-------------------------------------------------------------------------------------------------
435 /// MOBF Encrypt
436 /// @ingroup G_SWI2C_COMMON
437 /// @param u32Key \b IN: Key
438 /// @param bEnable \b IN: TRUE/FLASE
439 /// @return DRVAESDMA_OK : Success
440 /// @return Others : Fail
441 //-------------------------------------------------------------------------------------------------
442 void MApi_SWI2C_MutexUnlock(void);
443 //-------------------------------------------------------------------------------------------------
444 /// MOBF Encrypt
445 /// @ingroup G_SWI2C_BUS
446 /// @param u32Key \b IN: Key
447 /// @param bEnable \b IN: TRUE/FLASE
448 /// @return DRVAESDMA_OK : Success
449 /// @return Others : Fail
450 //-------------------------------------------------------------------------------------------------
451 void MApi_SWI2C_UseBus( MS_U8 u8BusChn );
452 //-------------------------------------------------------------------------------------------------
453 /// MOBF Encrypt
454 /// @ingroup G_SWI2C_BUS
455 /// @param u32Key \b IN: Key
456 /// @param bEnable \b IN: TRUE/FLASE
457 /// @return DRVAESDMA_OK : Success
458 /// @return Others : Fail
459 //-------------------------------------------------------------------------------------------------
460 void MApi_SWI2C_UnuseBus(void);
461 //-------------------------------------------------------------------------------------------------
462 /// MOBF Encrypt
463 /// @ingroup G_SWI2C_COMMON
464 /// @param u32Key \b IN: Key
465 /// @param bEnable \b IN: TRUE/FLASE
466 /// @return DRVAESDMA_OK : Success
467 /// @return Others : Fail
468 //-------------------------------------------------------------------------------------------------
469 MS_BOOL MApi_SWI2C_AccessStart(MS_U8 u8SlaveID, MS_U8 trans_t);
470 //-------------------------------------------------------------------------------------------------
471 /// MOBF Encrypt
472 /// @ingroup G_SWI2C_COMMON
473 /// @param u32Key \b IN: Key
474 /// @param bEnable \b IN: TRUE/FLASE
475 /// @return DRVAESDMA_OK : Success
476 /// @return Others : Fail
477 //-------------------------------------------------------------------------------------------------
478 void MApi_SWI2C_Stop(void);
479 //-------------------------------------------------------------------------------------------------
480 /// MOBF Encrypt
481 /// @ingroup G_SWI2C_COMMON
482 /// @param u32Key \b IN: Key
483 /// @param bEnable \b IN: TRUE/FLASE
484 /// @return DRVAESDMA_OK : Success
485 /// @return Others : Fail
486 //-------------------------------------------------------------------------------------------------
487 MS_BOOL MApi_SWI2C_Start(void);
488 //-------------------------------------------------------------------------------------------------
489 /// MOBF Encrypt
490 /// @ingroup G_SWI2C_COMMON
491 /// @param u32Key \b IN: Key
492 /// @param bEnable \b IN: TRUE/FLASE
493 /// @return DRVAESDMA_OK : Success
494 /// @return Others : Fail
495 //-------------------------------------------------------------------------------------------------
496 MS_BOOL MApi_SWI2C_SendByte(MS_U8 u8date);
497 //-------------------------------------------------------------------------------------------------
498 /// MOBF Encrypt
499 /// @ingroup G_SWI2C_COMMON
500 /// @param u32Key \b IN: Key
501 /// @param bEnable \b IN: TRUE/FLASE
502 /// @return DRVAESDMA_OK : Success
503 /// @return Others : Fail
504 //-------------------------------------------------------------------------------------------------
505 MS_U8 MApi_SWI2C_GetByte(MS_U16 u16Ack);
506 
507 #ifdef __cplusplus
508 }
509 #endif
510 
511 #endif // _API_SWI2C_H_
512