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) 2008-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 /*! \defgroup G_HWI2C HWI2C interface 95 \ingroup G_PERIPHERAL 96 97 \brief 98 99 IIC is a multi-master, multi-slave, single-ended, serial computer bus. It is typically used for attaching lower-speed peripheral 100 ICs to processors and micro-controllers. Alternatively I2C is spelled I2C (pronounced I-two-C) or IIC (pronounced I-I-C). 101 102 <b>Features</b> 103 - IIC Initialize & De-initialize function 104 - IIC Send Data 105 - IIC Receive Data 106 107 <b> Operation Code Flow: </b> \n 108 -# I2C Start Condition. 109 -# Send data. 110 -# Receive data. 111 -# I2C End Condition. 112 113 \defgroup G_HWI2C_INIT Initialization Task relative 114 \ingroup G_HWI2C 115 \defgroup G_HWI2C_COMMON Common Task relative 116 \ingroup G_HWI2C 117 \defgroup G_HWI2C_CONTROL Control relative 118 \ingroup G_HWI2C 119 \defgroup G_HWI2C_INT Interrupt relative 120 \ingroup G_HWI2C 121 \defgroup G_HWI2C_ToBeModified GPIO api to be modified 122 \ingroup G_HWI2C 123 \defgroup G_HWI2C_ToBeRemove GPIO api to be removed 124 \ingroup G_HWI2C 125 */ 126 127 #ifndef _DRV_HWI2C_H_ 128 #define _DRV_HWI2C_H_ 129 130 //////////////////////////////////////////////////////////////////////////////// 131 // Header Files 132 //////////////////////////////////////////////////////////////////////////////// 133 #ifdef __cplusplus 134 extern "C" 135 { 136 #endif 137 138 #include "MsTypes.h" 139 #include "MsDevice.h" 140 141 #define HWI2C_UTOPIA20 (0) 142 //////////////////////////////////////////////////////////////////////////////// 143 // Define & data type 144 //////////////////////////////////////////////////////////////////////////////// 145 #define MSIF_HWI2C_LIB_CODE {'H','I','2','C'} //Lib code 146 #define MSIF_HWI2C_LIBVER {'0','6'} //LIB version 147 #define MSIF_HWI2C_BUILDNUM {'0','6'} //Build Number 148 #define MSIF_HWI2C_CHANGELIST {'0','0','5','6','2','3','3','3'} //P4 ChangeList Number 149 150 #define HWI2C_DRV_VERSION /* Character String for DRV/API version */ \ 151 MSIF_TAG, /* 'MSIF' */ \ 152 MSIF_CLASS, /* '00' */ \ 153 MSIF_CUS, /* 0x0000 */ \ 154 MSIF_MOD, /* 0x0000 */ \ 155 MSIF_CHIP, \ 156 MSIF_CPU, \ 157 MSIF_HWI2C_LIB_CODE, /* IP__ */ \ 158 MSIF_HWI2C_LIBVER, /* 0.0 ~ Z.Z */ \ 159 MSIF_HWI2C_BUILDNUM, /* 00 ~ 99 */ \ 160 MSIF_HWI2C_CHANGELIST, /* CL# */ \ 161 MSIF_OS 162 163 /// debug level 164 typedef enum _HWI2C_DbgLv 165 { 166 E_HWI2C_DBGLV_NONE, /// no debug message 167 E_HWI2C_DBGLV_ERR_ONLY, /// show error only 168 E_HWI2C_DBGLV_INFO, /// show error & informaiton 169 E_HWI2C_DBGLV_ALL /// show error, information & funciton name 170 }HWI2C_DbgLv; 171 172 /// I2C select master port 173 typedef enum _HWI2C_PORT 174 { 175 E_HWI2C_PORT_0 = 0, /// port 0_0 //disable port 0 176 E_HWI2C_PORT0_1, /// port 0_1 177 E_HWI2C_PORT0_2, /// port 0_2 178 E_HWI2C_PORT0_3, /// port 0_3 179 E_HWI2C_PORT0_4, /// port 0_4 180 E_HWI2C_PORT0_5, /// port 0_5 181 E_HWI2C_PORT0_6, /// port 0_6 182 E_HWI2C_PORT0_7, /// port 0_7 183 184 E_HWI2C_PORT_1 = 8, /// port 1_0 //disable port 1 185 E_HWI2C_PORT1_1, /// port 1_1 186 E_HWI2C_PORT1_2, /// port 1_2 187 E_HWI2C_PORT1_3, /// port 1_3 188 E_HWI2C_PORT1_4, /// port 1_4 189 E_HWI2C_PORT1_5, /// port 1_5 190 E_HWI2C_PORT1_6, /// port 1_6 191 E_HWI2C_PORT1_7, /// port 1_7 192 193 E_HWI2C_PORT_2 = 16,/// port 2_0 //disable port 2 194 E_HWI2C_PORT2_1, /// port 2_1 195 E_HWI2C_PORT2_2, /// port 2_2 196 E_HWI2C_PORT2_3, /// port 2_3 197 E_HWI2C_PORT2_4, /// port 2_4 198 E_HWI2C_PORT2_5, /// port 2_5 199 E_HWI2C_PORT2_6, /// port 2_6 200 E_HWI2C_PORT2_7, /// port 2_7 201 202 E_HWI2C_PORT_3 = 24,/// port 3_0 //disable port 3 203 E_HWI2C_PORT3_1, /// port 3_1 204 E_HWI2C_PORT3_2, /// port 3_2 205 E_HWI2C_PORT3_3, /// port 3_3 206 E_HWI2C_PORT3_4, /// port 3_4 207 E_HWI2C_PORT3_5, /// port 3_5 208 E_HWI2C_PORT3_6, /// port 3_6 209 E_HWI2C_PORT3_7, /// port 3_7 210 211 E_HWI2C_PORT_NOSUP /// non-support port 212 }HWI2C_PORT; 213 214 /// I2C clock speed select 215 typedef enum _HWI2C_CLKSEL 216 { 217 E_HWI2C_HIGH = 0, /// high speed 218 E_HWI2C_NORMAL, /// normal speed 219 E_HWI2C_SLOW, /// slow speed 220 E_HWI2C_VSLOW, /// very slow 221 E_HWI2C_USLOW, /// ultra slow 222 E_HWI2C_UVSLOW, /// ultra-very slow 223 E_HWI2C_NOSUP /// non-support speed 224 }HWI2C_CLKSEL; 225 226 /// I2C state 227 typedef enum _HWI2C_State 228 { 229 E_HWI2C_IDLE, /// idle state 230 E_HWI2C_READ_DATA, /// read data state 231 E_HWI2C_WRITE_DATA, /// write data state 232 E_HWI2C_DMA_READ_DATA, /// DMA read data state 233 E_HWI2C_DMA_WRITE_DATA /// DMA write data state 234 }HWI2C_State; 235 236 typedef enum { 237 E_HWI2C_READ_MODE_DIRECT, ///< first transmit slave address + reg address and then start receive the data */ 238 E_HWI2C_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 239 E_HWI2C_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 240 E_HWI2C_READ_MODE_MAX 241 } HWI2C_ReadMode; 242 243 typedef enum _HWI2C_DMA_ADDRMODE 244 { 245 E_HWI2C_DMA_ADDR_NORMAL = 0, 246 E_HWI2C_DMA_ADDR_10BIT, 247 E_HWI2C_DMA_ADDR_MAX, 248 }HWI2C_DMA_ADDRMODE; 249 250 typedef enum _HWI2C_DMA_READMODE 251 { 252 E_HWI2C_DMA_READ_NOSTOP = 0, 253 E_HWI2C_DMA_READ_STOP, 254 E_HWI2C_DMA_READ_MAX, 255 }HWI2C_DMA_READMODE; 256 257 typedef enum _HWI2C_DMA_MIUPRI 258 { 259 E_HWI2C_DMA_PRI_LOW = 0, 260 E_HWI2C_DMA_PRI_HIGH, 261 E_HWI2C_DMA_PRI_MAX, 262 }HWI2C_DMA_MIUPRI; 263 264 typedef enum _HWI2C_DMA_MIUCH 265 { 266 E_HWI2C_DMA_MIU_CH0 = 0, 267 E_HWI2C_DMA_MIU_CH1, 268 E_HWI2C_DMA_MIU_MAX, 269 }HWI2C_DMA_MIUCH; 270 271 /// I2C master pin config 272 typedef struct _HWI2C_PinCfg 273 { 274 MS_U32 u32Reg; /// register 275 MS_U8 u8BitPos; /// bit position 276 MS_BOOL bEnable; /// enable or disable 277 }HWI2C_PinCfg; 278 279 /// I2C port config 280 typedef struct _HWI2C_PortCfg 281 { 282 MS_U32 u32DmaPhyAddr; /// DMA physical address 283 HWI2C_DMA_ADDRMODE eDmaAddrMode; /// DMA address mode 284 HWI2C_DMA_MIUPRI eDmaMiuPri; /// DMA miu priroity 285 HWI2C_DMA_MIUCH eDmaMiuCh; /// DMA miu channel 286 MS_BOOL bDmaEnable; /// DMA enable 287 288 HWI2C_PORT ePort; /// number 289 HWI2C_CLKSEL eSpeed; /// clock speed 290 HWI2C_ReadMode eReadMode; /// read mode 291 MS_BOOL bEnable; /// enable 292 293 }HWI2C_PortCfg; 294 295 /// I2C Configuration for initialization 296 typedef struct _HWI2C_UnitCfg 297 { 298 HWI2C_PortCfg sCfgPort[8]; /// port cfg info 299 HWI2C_PinCfg sI2CPin; /// pin info 300 HWI2C_CLKSEL eSpeed; /// speed 301 HWI2C_PORT ePort; /// port 302 HWI2C_ReadMode eReadMode; /// read mode 303 304 }HWI2C_UnitCfg; 305 306 /// I2C information 307 typedef struct _HWI2C_Info 308 { 309 MS_U32 u32IOMap; /// base address 310 HWI2C_UnitCfg sUnitCfg; /// configuration 311 }HWI2C_Info; 312 313 /// I2C status 314 typedef struct _HWI2C_Status 315 { 316 MS_U8 u8DbgLevel; /// debug level 317 MS_BOOL bIsInit; /// initialized 318 MS_BOOL bIsMaster; /// master 319 HWI2C_State eState; /// state 320 }HWI2C_Status; 321 322 typedef struct _HWI2C_PortStatus 323 { 324 MS_U8 u8DbgLevel; /// debug level 325 MS_BOOL bIsInit; /// initialized 326 MS_BOOL bIsMaster; /// master 327 HWI2C_State eState; /// state 328 MS_U8 u8Port; 329 }HWI2C_PortStatus; 330 331 typedef struct _HWI2C_DelayConfig 332 { 333 MS_U8 u8Port; 334 MS_U32 u32StartDelay; 335 MS_U32 u32StopDelay; 336 }HWI2C_DelayConfig; 337 338 //////////////////////////////////////////////////////////////////////////////// 339 // Extern Function 340 //////////////////////////////////////////////////////////////////////////////// 341 #include "drvHWI2C_v2.h" 342 343 //------------------------------------------------------------------------------------------------- 344 /// MOBF Encrypt 345 /// @ingroup G_HWI2C_INIT 346 /// @param u32Key \b IN: Key 347 /// @param bEnable \b IN: TRUE/FLASE 348 /// @return DRVAESDMA_OK : Success 349 /// @return Others : Fail 350 //------------------------------------------------------------------------------------------------- 351 MS_BOOL MDrv_HWI2C_Init(HWI2C_UnitCfg *psCfg); 352 //------------------------------------------------------------------------------------------------- 353 /// MOBF Encrypt 354 /// @ingroup G_HWI2C_CONTROL 355 /// @param u32Key \b IN: Key 356 /// @param bEnable \b IN: TRUE/FLASE 357 /// @return DRVAESDMA_OK : Success 358 /// @return Others : Fail 359 //------------------------------------------------------------------------------------------------- 360 // MS_BOOL MDrv_HWI2C_Start(void); 361 //------------------------------------------------------------------------------------------------- 362 /// MOBF Encrypt 363 /// @ingroup G_HWI2C_CONTROL 364 /// @param u32Key \b IN: Key 365 /// @param bEnable \b IN: TRUE/FLASE 366 /// @return DRVAESDMA_OK : Success 367 /// @return Others : Fail 368 //------------------------------------------------------------------------------------------------- 369 // MS_BOOL MDrv_HWI2C_Stop(void); 370 //------------------------------------------------------------------------------------------------- 371 /// MOBF Encrypt 372 /// @ingroup G_HWI2C_CONTROL 373 /// @param u32Key \b IN: Key 374 /// @param bEnable \b IN: TRUE/FLASE 375 /// @return DRVAESDMA_OK : Success 376 /// @return Others : Fail 377 //------------------------------------------------------------------------------------------------- 378 // MS_BOOL MDrv_HWI2C_GetPortIndex(HWI2C_PORT ePort, MS_U8* pu8Port); 379 //------------------------------------------------------------------------------------------------- 380 /// MOBF Encrypt 381 /// @ingroup G_HWI2C_CONTROL 382 /// @param u32Key \b IN: Key 383 /// @param bEnable \b IN: TRUE/FLASE 384 /// @return DRVAESDMA_OK : Success 385 /// @return Others : Fail 386 //------------------------------------------------------------------------------------------------- 387 MS_BOOL MDrv_HWI2C_SelectPort(HWI2C_PORT ePort); 388 //------------------------------------------------------------------------------------------------- 389 /// MOBF Encrypt 390 /// @ingroup G_HWI2C_CONTROL 391 /// @param u32Key \b IN: Key 392 /// @param bEnable \b IN: TRUE/FLASE 393 /// @return DRVAESDMA_OK : Success 394 /// @return Others : Fail 395 //------------------------------------------------------------------------------------------------- 396 MS_BOOL MDrv_HWI2C_SetClk(HWI2C_CLKSEL eClk); 397 //------------------------------------------------------------------------------------------------- 398 /// MOBF Encrypt 399 /// @ingroup G_HWI2C_CONTROL 400 /// @param u32Key \b IN: Key 401 /// @param bEnable \b IN: TRUE/FLASE 402 /// @return DRVAESDMA_OK : Success 403 /// @return Others : Fail 404 //------------------------------------------------------------------------------------------------- 405 MS_BOOL MDrv_HWI2C_SetReadMode(HWI2C_ReadMode eReadMode); 406 //------------------------------------------------------------------------------------------------- 407 /// MOBF Encrypt 408 /// @ingroup G_HWI2C_COMMON 409 /// @param u32Key \b IN: Key 410 /// @param bEnable \b IN: TRUE/FLASE 411 /// @return DRVAESDMA_OK : Success 412 /// @return Others : Fail 413 //------------------------------------------------------------------------------------------------- 414 MS_BOOL MDrv_HWI2C_WriteByte(MS_U16 u16SlaveCfg, MS_U8 u8RegAddr, MS_U8 u8Data); 415 //------------------------------------------------------------------------------------------------- 416 /// MOBF Encrypt 417 /// @ingroup G_HWI2C_COMMON 418 /// @param u32Key \b IN: Key 419 /// @param bEnable \b IN: TRUE/FLASE 420 /// @return DRVAESDMA_OK : Success 421 /// @return Others : Fail 422 //------------------------------------------------------------------------------------------------- 423 MS_BOOL MDrv_HWI2C_WriteBytes(MS_U16 u16SlaveCfg, MS_U32 uAddrCnt, MS_U8 *pRegAddr, MS_U32 uSize, MS_U8 *pData); 424 //------------------------------------------------------------------------------------------------- 425 /// MOBF Encrypt 426 /// @ingroup G_HWI2C_COMMON 427 /// @param u32Key \b IN: Key 428 /// @param bEnable \b IN: TRUE/FLASE 429 /// @return DRVAESDMA_OK : Success 430 /// @return Others : Fail 431 //------------------------------------------------------------------------------------------------- 432 MS_BOOL MDrv_HWI2C_ReadByte(MS_U16 u16SlaveCfg, MS_U8 u8RegAddr, MS_U8 *pData); 433 //------------------------------------------------------------------------------------------------- 434 /// MOBF Encrypt 435 /// @ingroup G_HWI2C_COMMON 436 /// @param u32Key \b IN: Key 437 /// @param bEnable \b IN: TRUE/FLASE 438 /// @return DRVAESDMA_OK : Success 439 /// @return Others : Fail 440 //------------------------------------------------------------------------------------------------- 441 MS_BOOL MDrv_HWI2C_ReadBytes(MS_U16 u16SlaveCfg, MS_U32 uAddrCnt, MS_U8 *pRegAddr, MS_U32 uSize, MS_U8 *pData); 442 //------------------------------------------------------------------------------------------------- 443 /// MOBF Encrypt 444 /// @ingroup G_HWI2C_CONTROL 445 /// @param u32Key \b IN: Key 446 /// @param bEnable \b IN: TRUE/FLASE 447 /// @return DRVAESDMA_OK : Success 448 /// @return Others : Fail 449 //------------------------------------------------------------------------------------------------- 450 MS_BOOL MDrv_HWI2C_SelectPort1(HWI2C_PORT ePort); 451 //------------------------------------------------------------------------------------------------- 452 /// MOBF Encrypt 453 /// @ingroup G_HWI2C_CONTROL 454 /// @param u32Key \b IN: Key 455 /// @param bEnable \b IN: TRUE/FLASE 456 /// @return DRVAESDMA_OK : Success 457 /// @return Others : Fail 458 //------------------------------------------------------------------------------------------------- 459 MS_BOOL MDrv_HWI2C_SetClkP1(HWI2C_CLKSEL eClk); 460 //------------------------------------------------------------------------------------------------- 461 /// MOBF Encrypt 462 /// @ingroup G_HWI2C_CONTROL 463 /// @param u32Key \b IN: Key 464 /// @param bEnable \b IN: TRUE/FLASE 465 /// @return DRVAESDMA_OK : Success 466 /// @return Others : Fail 467 //------------------------------------------------------------------------------------------------- 468 MS_BOOL MDrv_HWI2C_SetReadModeP1(HWI2C_ReadMode eReadMode); 469 //------------------------------------------------------------------------------------------------- 470 /// MOBF Encrypt 471 /// @ingroup G_HWI2C_COMMON 472 /// @param u32Key \b IN: Key 473 /// @param bEnable \b IN: TRUE/FLASE 474 /// @return DRVAESDMA_OK : Success 475 /// @return Others : Fail 476 //------------------------------------------------------------------------------------------------- 477 MS_BOOL MDrv_HWI2C_WriteByteP1(MS_U16 u16SlaveCfg, MS_U8 u8RegAddr, MS_U8 u8Data); 478 //------------------------------------------------------------------------------------------------- 479 /// MOBF Encrypt 480 /// @ingroup G_HWI2C_COMMON 481 /// @param u32Key \b IN: Key 482 /// @param bEnable \b IN: TRUE/FLASE 483 /// @return DRVAESDMA_OK : Success 484 /// @return Others : Fail 485 //------------------------------------------------------------------------------------------------- 486 MS_BOOL MDrv_HWI2C_WriteBytesP1(MS_U16 u16SlaveCfg, MS_U32 uAddrCnt, MS_U8 *pRegAddr, MS_U32 uSize, MS_U8 *pData); 487 //------------------------------------------------------------------------------------------------- 488 /// MOBF Encrypt 489 /// @ingroup G_HWI2C_COMMON 490 /// @param u32Key \b IN: Key 491 /// @param bEnable \b IN: TRUE/FLASE 492 /// @return DRVAESDMA_OK : Success 493 /// @return Others : Fail 494 //------------------------------------------------------------------------------------------------- 495 MS_BOOL MDrv_HWI2C_ReadByteP1(MS_U16 u16SlaveCfg, MS_U8 u8RegAddr, MS_U8 *pData); 496 //------------------------------------------------------------------------------------------------- 497 /// MOBF Encrypt 498 /// @ingroup G_HWI2C_COMMON 499 /// @param u32Key \b IN: Key 500 /// @param bEnable \b IN: TRUE/FLASE 501 /// @return DRVAESDMA_OK : Success 502 /// @return Others : Fail 503 //------------------------------------------------------------------------------------------------- 504 MS_BOOL MDrv_HWI2C_ReadBytesP1(MS_U16 u16SlaveCfg, MS_U32 uAddrCnt, MS_U8 *pRegAddr, MS_U32 uSize, MS_U8 *pData); 505 //------------------------------------------------------------------------------------------------- 506 /// MOBF Encrypt 507 /// @ingroup G_HWI2C_COMMON 508 /// @param u32Key \b IN: Key 509 /// @param bEnable \b IN: TRUE/FLASE 510 /// @return DRVAESDMA_OK : Success 511 /// @return Others : Fail 512 //------------------------------------------------------------------------------------------------- 513 MS_BOOL MDrv_HWI2C_SetDbgLevel(HWI2C_DbgLv eLevel); 514 //------------------------------------------------------------------------------------------------- 515 /// MOBF Encrypt 516 /// @ingroup G_HWI2C_COMMON 517 /// @param u32Key \b IN: Key 518 /// @param bEnable \b IN: TRUE/FLASE 519 /// @return DRVAESDMA_OK : Success 520 /// @return Others : Fail 521 //------------------------------------------------------------------------------------------------- 522 // MS_BOOL MDrv_HWI2C_GetLibVer(const MSIF_Version **ppVersion); 523 //------------------------------------------------------------------------------------------------- 524 /// MOBF Encrypt 525 /// @ingroup G_HWI2C_COMMON 526 /// @param u32Key \b IN: Key 527 /// @param bEnable \b IN: TRUE/FLASE 528 /// @return DRVAESDMA_OK : Success 529 /// @return Others : Fail 530 //------------------------------------------------------------------------------------------------- 531 // void MDrv_HWI2C_GetStatus(HWI2C_Status *pStatus); 532 //------------------------------------------------------------------------------------------------- 533 /// MOBF Encrypt 534 /// @ingroup G_HWI2C_COMMON 535 /// @param u32Key \b IN: Key 536 /// @param bEnable \b IN: TRUE/FLASE 537 /// @return DRVAESDMA_OK : Success 538 /// @return Others : Fail 539 //------------------------------------------------------------------------------------------------- 540 // const HWI2C_Info* MDrv_HWI2C_GetInfo(void); 541 //------------------------------------------------------------------------------------------------- 542 /// MOBF Encrypt 543 /// @ingroup G_HWI2C_CONTROL 544 /// @param u32Key \b IN: Key 545 /// @param bEnable \b IN: TRUE/FLASE 546 /// @return DRVAESDMA_OK : Success 547 /// @return Others : Fail 548 //------------------------------------------------------------------------------------------------- 549 // MS_BOOL MDrv_HWI2C_ConfigDelay(MS_U32 u32StartDelay, MS_U32 u32StopDelay); 550 //------------------------------------------------------------------------------------------------- 551 /// MOBF Encrypt 552 /// @ingroup G_HWI2C_COMMON 553 /// @param u32Key \b IN: Key 554 /// @param bEnable \b IN: TRUE/FLASE 555 /// @return DRVAESDMA_OK : Success 556 /// @return Others : Fail 557 //------------------------------------------------------------------------------------------------- 558 MS_U16 MDrv_HWI2C_SetPowerState(EN_POWER_MODE u16PowerState); 559 //------------------------------------------------------------------------------------------------- 560 /// MOBF Encrypt 561 /// @ingroup G_HWI2C_CONTROL 562 /// @param u32Key \b IN: Key 563 /// @param bEnable \b IN: TRUE/FLASE 564 /// @return DRVAESDMA_OK : Success 565 /// @return Others : Fail 566 //------------------------------------------------------------------------------------------------- 567 // MS_BOOL MDrv_HWI2C_ConfigDelay_EX(void *pParam_Config); 568 //------------------------------------------------------------------------------------------------- 569 /// MOBF Encrypt 570 /// @ingroup G_HWI2C_COMMON 571 /// @param u32Key \b IN: Key 572 /// @param bEnable \b IN: TRUE/FLASE 573 /// @return DRVAESDMA_OK : Success 574 /// @return Others : Fail 575 //------------------------------------------------------------------------------------------------- 576 // void MDrv_HWI2C_GetStatus_EX(void *pParam_Status); 577 578 // For Utopia2K 579 //------------------------------------------------------------------------------------------------- 580 /// MOBF Encrypt 581 /// @ingroup G_HWI2C_ToBeRemove 582 /// @param u32Key \b IN: Key 583 /// @param bEnable \b IN: TRUE/FLASE 584 /// @return DRVAESDMA_OK : Success 585 /// @return Others : Fail 586 //------------------------------------------------------------------------------------------------- 587 // MS_BOOL MDrv_HWI2C_Init_U2K(HWI2C_UnitCfg *psCfg); 588 //------------------------------------------------------------------------------------------------- 589 /// MOBF Encrypt 590 /// @ingroup G_HWI2C_ToBeRemove 591 /// @param u32Key \b IN: Key 592 /// @param bEnable \b IN: TRUE/FLASE 593 /// @return DRVAESDMA_OK : Success 594 /// @return Others : Fail 595 //------------------------------------------------------------------------------------------------- 596 // MS_BOOL MDrv_HWI2C_Start_U2K(void); 597 //------------------------------------------------------------------------------------------------- 598 /// MOBF Encrypt 599 /// @ingroup G_HWI2C_ToBeRemove 600 /// @param u32Key \b IN: Key 601 /// @param bEnable \b IN: TRUE/FLASE 602 /// @return DRVAESDMA_OK : Success 603 /// @return Others : Fail 604 //------------------------------------------------------------------------------------------------- 605 // MS_BOOL MDrv_HWI2C_Stop_U2K(void); 606 //------------------------------------------------------------------------------------------------- 607 /// MOBF Encrypt 608 /// @ingroup G_HWI2C_ToBeRemove 609 /// @param u32Key \b IN: Key 610 /// @param bEnable \b IN: TRUE/FLASE 611 /// @return DRVAESDMA_OK : Success 612 /// @return Others : Fail 613 //------------------------------------------------------------------------------------------------- 614 // MS_BOOL MDrv_HWI2C_WriteBytes_U2K(MS_U16 u16SlaveCfg, MS_U32 uAddrCnt, MS_U8 *pRegAddr, MS_U32 uSize, MS_U8 *pData); 615 //------------------------------------------------------------------------------------------------- 616 /// MOBF Encrypt 617 /// @ingroup G_HWI2C_ToBeRemove 618 /// @param u32Key \b IN: Key 619 /// @param bEnable \b IN: TRUE/FLASE 620 /// @return DRVAESDMA_OK : Success 621 /// @return Others : Fail 622 //------------------------------------------------------------------------------------------------- 623 // MS_BOOL MDrv_HWI2C_ReadBytes_U2K(MS_U16 u16SlaveCfg, MS_U32 uAddrCnt, MS_U8 *pRegAddr, MS_U32 uSize, MS_U8 *pData); 624 //------------------------------------------------------------------------------------------------- 625 /// MOBF Encrypt 626 /// @ingroup G_HWI2C_ToBeRemove 627 /// @param u32Key \b IN: Key 628 /// @param bEnable \b IN: TRUE/FLASE 629 /// @return DRVAESDMA_OK : Success 630 /// @return Others : Fail 631 //------------------------------------------------------------------------------------------------- 632 // MS_BOOL MDrv_HWI2C_SelectPort_U2K(HWI2C_PORT ePort); 633 //------------------------------------------------------------------------------------------------- 634 /// MOBF Encrypt 635 /// @ingroup G_HWI2C_ToBeRemove 636 /// @param u32Key \b IN: Key 637 /// @param bEnable \b IN: TRUE/FLASE 638 /// @return DRVAESDMA_OK : Success 639 /// @return Others : Fail 640 //------------------------------------------------------------------------------------------------- 641 // MS_BOOL MDrv_HWI2C_SetClk_U2K(HWI2C_CLKSEL eClk); 642 643 #ifdef __cplusplus 644 } 645 #endif 646 647 648 #endif 649