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 95 /////////////////////////////////////////////////////////////////////////////////////////////////// 96 /// 97 /// @file apiDAC.h 98 /// @brief DAC Interface 99 /// @author MStar Semiconductor Inc. 100 // CL162321++: 101 // update HDGen table. tPanelDACOUT480I_60 output for U4 102 // CL 216439++: 103 // Adds DACOUT_1080P_24, DACOUT_1080P_25, DACOUT_1080P_30. 104 // CL 223188++: 105 // i. Modify HDGEN settings in "U4_DAC_Driver.xls" for HDMITx 480i/576i/1080i 106 // ii. Add CLKGEN1 setting in halClkSel.c for HDMITx 1080i 107 /////////////////////////////////////////////////////////////////////////////////////////////////// 108 /*! \defgroup MISC HDMI modules 109 110 111 * \defgroup DAC DAC interface (apiDAC.h) 112 * \ingroup MISC 113 114 DAC(digital-to-analog converter,DAC):Convert digital signal to analog signal, ex:YPbPr for HD,CVBS?�S-Video?�SCART-RGB for SD 115 116 \image html apiDAC_pic1.png 117 118 <b>Operation Flow</b> 119 -# MApi_DAC_Init(void) 120 - A) Get PM address ??register head 121 - B) Set DAC address 122 - C) DAC init 123 -# MApi_DAC_Enable(MS_BOOL bEnable, MS_BOOL bIsYPbPr) 124 - Enable DAC 125 - Select HD or SD DAC 126 -# MApi_DAC_SetOutputSwapSel(E_DAC_SWAP_SEL enSwap,MS_BOOL bIsYPbPr) 127 - Swap type 128 - Select swap HD or SD DAC 129 -# MApi_DAC_SetOutputLevel(E_DAC_MAX_OUTPUT_LEVEL enLevel, MS_BOOL bIsYPbPr) 130 - Level type 131 - Set Level type to HD or SD DAC 132 -# MApi_DAC_SetQuartOutput (MS_BOOL bEnable, MS_BOOL bIsYPbPr) 133 -# MApi_DAC_SetIHalfOutput (MS_BOOL bEnable,MS_BOOL bIsYPbPr) 134 - To save power 135 136 */ 137 #ifndef _API_DAC_H_ 138 #define _API_DAC_H_ 139 140 #include "MsCommon.h" 141 142 #ifdef __cplusplus 143 extern "C" { 144 #endif 145 #include "UFO.h" 146 //------------------------------------------------------------------------------------------------- 147 // Macro and Define 148 //------------------------------------------------------------------------------------------------- 149 //------------------------------------------------------------------------------------------------- 150 // This macro defined in mscommon.h originally, here just for avoid SN compile error 151 //------------------------------------------------------------------------------------------------- 152 #ifndef SYMBOL_WEAK 153 #define SYMBOL_WEAK __attribute__((weak)) 154 #endif 155 // library information 156 #define MSIF_DAC_LIB_CODE {'D','A','C','_'} 157 #define MSIF_DAC_LIBVER {'0','0'} 158 #define MSIF_DAC_BUILDNUM {'2','7'} 159 #define MSIF_DAC_CHANGELIST {'0','0','6','5','8','6','0','4'} 160 161 #define DAC_API_VERSION /* Character String for DRV/API version */ \ 162 MSIF_TAG, /* 'MSIF' */ \ 163 MSIF_CLASS, /* '00' */ \ 164 MSIF_CUS, /* 0x0000 */ \ 165 MSIF_MOD, /* 0x0000 */ \ 166 MSIF_CHIP, \ 167 MSIF_CPU, \ 168 MSIF_DAC_LIB_CODE , /* IP__ */ \ 169 MSIF_DAC_LIBVER , /* 0.0 ~ Z.Z */ \ 170 MSIF_DAC_BUILDNUM , /* 00 ~ 99 */ \ 171 MSIF_DAC_CHANGELIST, /* CL# */ \ 172 MSIF_OS 173 174 //------------------------------------------------------------------------------------------------- 175 // Type and Structure 176 //------------------------------------------------------------------------------------------------- 177 /// Define return value of MApi_DAC 178 typedef enum 179 { 180 E_APIDAC_FAIL = 0, 181 E_APIDAC_OK = 1, 182 E_APIDAC_GET_BASEADDR_FAIL, ///< get base address failed when initialize panel driver 183 E_APIDAC_OBTAIN_MUTEX_FAIL, ///< obtain mutex timeout when calling this function 184 } APIDAC_Result; 185 186 /// Define output video timing 187 /// Shall align to E_DAC_PANEL_INDEX. 188 typedef enum 189 { 190 E_RES_720x480I_60Hz = 0, 191 E_RES_720x480P_60Hz, 192 E_RES_720x576I_50Hz, 193 E_RES_720x576P_50Hz, 194 E_RES_1280x720P_50Hz, 195 E_RES_1280x720P_60Hz, 196 E_RES_1920x1080I_50Hz, 197 E_RES_1920x1080I_60Hz, 198 E_RES_1920x1080P_50Hz, 199 E_RES_1920x1080P_60Hz, 200 E_RES_1920x1080P_30Hz, 201 E_RES_1920x1080P_25Hz, 202 E_RES_1920x1080P_24Hz, 203 E_RES_640x480P_60Hz, 204 E_RES_1920x2205P_24Hz, 205 E_RES_1280x1470P_50Hz, 206 E_RES_1280x1470P_60Hz, 207 E_RES_3840x2160P_24Hz, 208 E_RES_3840x2160P_25Hz, 209 E_RES_3840x2160P_30Hz, 210 E_RES_3840x2160P_50Hz, 211 E_RES_3840x2160P_60Hz, 212 E_RES_4096x2160P_24Hz, 213 E_RES_4096x2160P_25Hz, 214 E_RES_4096x2160P_30Hz, 215 E_RES_4096x2160P_50Hz, 216 E_RES_4096x2160P_60Hz, 217 E_RES_3840x2160P420_30Hz, 218 E_RES_3840x2160P420_50Hz, 219 E_RES_3840x2160P420_60Hz, 220 E_RES_4096x2160P420_30Hz, 221 E_RES_4096x2160P420_50Hz, 222 E_RES_4096x2160P420_60Hz, 223 E_RES_1600x1200P_60Hz, 224 E_RES_1440x900P_60Hz, 225 E_RES_1280x1024P_60Hz, 226 E_RES_1024x768P_60Hz, 227 E_RES_VGA_START = 0x40, ///< Resolution for VGA output 228 E_RES_VGA640x480P_60Hz = E_RES_VGA_START, 229 E_RES_TTL_START = 0xC0, ///< Resolution for TTL output(will not coexist with VGA). 230 E_RES_TTL480X272P_60Hz = E_RES_TTL_START, 231 } E_OUTPUT_VIDEO_TIMING_TYPE; 232 233 /// Define the color depth of output 234 typedef enum 235 { 236 E_COLOR_8_BIT, 237 E_COLOR_10_BIT, 238 E_COLOR_12_BIT, 239 }E_OUTPUT_BIT_TYPE; 240 241 typedef enum 242 { 243 E_DAC_TO_HDGEN = 0, //HD Gen output 244 E_DAC_TO_VE = 1, //VE output (CVBS + S-Video) 245 E_DAC_TO_VE_YPBPR =3 //VE output (Y/Pb/Pr) 246 } E_DAC_OUTPUT_TYPE; 247 248 typedef enum 249 { 250 E_DAC_R_G_B = 0, 251 E_DAC_R_B_G = 1, 252 E_DAC_G_R_B = 2, 253 E_DAC_B_G_R = 4, 254 E_DAC_G_B_R = 5, 255 E_DAC_B_R_G = 6, 256 E_DAC_R_R_R = 7, 257 } E_DAC_SWAP_SEL; 258 259 typedef enum 260 { 261 E_DAC_OUTPUT_LEVEL_HIGH = 0, //1.3V for CVBS + S-Video 262 E_DAC_OUTPUT_LEVEL_LOW = 1 //1.0V for YPbPr 263 } E_DAC_MAX_OUTPUT_LEVEL; 264 265 typedef enum 266 { 267 E_DAC_SD_OFF =0, 268 E_DAC_SD_X = 1, 269 E_DAC_SD_Y = 2, 270 E_DAC_SD_XY = 3, 271 E_DAC_SD_C = 4, 272 E_DAC_SD_XC = 5, 273 E_DAC_SD_YC = 6, 274 E_DAC_SD_XYC = 7, 275 }E_DAC_SD_ENABLE_CTRL; 276 277 typedef enum 278 { 279 E_DAC_HD_OFF =0, 280 E_DAC_HD_R = 1, 281 E_DAC_HD_G = 2, 282 E_DAC_HD_RG = 3, 283 E_DAC_HD_B = 4, 284 E_DAC_HD_RB = 5, 285 E_DAC_HD_GB = 6, 286 E_DAC_HD_RGB = 7, 287 288 }E_DAC_HD_ENABLE_CTRL; 289 290 typedef enum 291 { 292 E_DAC_DETECT_PLUGIN, //Detect Plug_IN 293 E_DAC_DETECT_PLUGOUT, // Detect Plug_OUT 294 }E_DAC_DETECT_TYPE; 295 296 typedef enum 297 { 298 E_DAC_DETECT_HD, //Detect Plug_IN 299 E_DAC_DETECT_SD, // Detect Plug_OUT 300 }E_DAC_DETECT; 301 302 typedef enum 303 { 304 E_DAC_VIDEO_VBI_WSS_START = 0x0000, 305 306 E_DAC_VIDEO_VBI_WSS_AS_4x3_FULL, 307 E_DAC_VIDEO_VBI_WSS_AS_14x9_LETTERBOX_CENTER, 308 E_DAC_VIDEO_VBI_WSS_AS_14x9_LETTERBOX_TOP, 309 E_DAC_VIDEO_VBI_WSS_AS_16x9_LETTERBOX_CENTER, 310 E_DAC_VIDEO_VBI_WSS_AS_16x9_LETTERBOX_TOP, 311 E_DAC_VIDEO_VBI_WSS_AS_ABOVE16x9_LETTERBOX_CENTER, 312 E_DAC_VIDEO_VBI_WSS_AS_14x9_FULL_CENTER, 313 E_DAC_VIDEO_VBI_WSS_AS_16x9_ANAMORPHIC, 314 315 E_DAC_VIDEO_VBI_WSS_CGMS_COPYRIGHT, 316 E_DAC_VIDEO_VBI_WSS_CGMS_COPY_PROTECTION, 317 318 E_DAC_VIDEO_VBI_WSS_CGMS_COPY_FREELY, //No Copyright Issue 319 E_DAC_VIDEO_VBI_WSS_CGMS_COPY_ONCE, //VBI_WSS_COPYRIGHT 320 E_DAC_VIDEO_VBI_WSS_CGMS_COPY_NO_MORE, //VBI_WSS_COPY_PROTECTION 321 E_DAC_VIDEO_VBI_WSS_CGMS_COPY_NEVER, //VBI_WSS_COPYRIGHT | VBI_WSS_COPY_PROTECTION 322 323 E_DAC_VIDEO_VBI_WSS525_A_START = 0x0100, 324 325 E_DAC_VIDEO_VBI_WSS525_A_AS_4x3_NORMAL, 326 E_DAC_VIDEO_VBI_WSS525_A_AS_4x3_LETTERBOX, 327 E_DAC_VIDEO_VBI_WSS525_A_AS_16x9_ANAMORPHIC, //Using in CVBS 328 E_DAC_VIDEO_VBI_WSS525_A_AS_16x9_NORMAL = E_DAC_VIDEO_VBI_WSS525_A_AS_16x9_ANAMORPHIC, //Using in YPbPr 329 E_DAC_VIDEO_VBI_WSS525_A_AS_RESERVED, 330 331 E_DAC_VIDEO_VBI_WSS525_A_CGMS_COPY_FREELY, 332 E_DAC_VIDEO_VBI_WSS525_A_CGMS_COPY_ONCE, 333 E_DAC_VIDEO_VBI_WSS525_A_CGMS_COPY_NO_MORE, 334 E_DAC_VIDEO_VBI_WSS525_A_CGMS_COPY_NEVER, 335 336 E_DAC_VIDEO_VBI_WSS525_A_APS_NO_APS, 337 E_DAC_VIDEO_VBI_WSS525_A_APS_PSP_CS_OFF, 338 E_DAC_VIDEO_VBI_WSS525_A_APS_PSP_2_LINE_CS, 339 E_DAC_VIDEO_VBI_WSS525_A_APS_PSP_4_LINE_CS, 340 } E_DAC_VIDEO_VBI_WSS_TYPE; 341 342 typedef struct __attribute__((__packed__)) 343 { 344 //Versioning 345 MS_U32 u32DAC_SetWSS_version; ///<Version of current structure. 346 MS_U32 u32DAC_SetWSS_Length; ///<Length of this structure, u32DAC_SetWSS_Length=sizeof(DAC_SETWSS_INFO) 347 //Data 348 E_OUTPUT_VIDEO_TIMING_TYPE eOutput_Timing; ///< Output Video Timing 349 E_DAC_VIDEO_VBI_WSS_TYPE eVBI_WSS_Type; ///< Video VBI WSS Type 350 //MS_U32 VBI_Data[9]; ///< Video VBI WSS Data (CGMS-A Type B) 351 } DAC_SETWSS_INFO; 352 353 typedef struct __attribute__((__packed__)) 354 { 355 MS_U32 u32Type; 356 }APIDAC_OUTPUT_TYPE; 357 358 typedef struct __attribute__((__packed__)) 359 { 360 APIDAC_OUTPUT_TYPE eSupportOutputType; ///< Gamma type supported by apiPNL 361 } DAC_ApiInfo; 362 363 typedef struct __attribute__((__packed__)) 364 { 365 MS_BOOL bDac_Initialized; ///< DAC initialized or not 366 MS_BOOL bDac_VE_enabled; ///< DAC CVBS/S-Video enabled or not 367 MS_BOOL bDac_YPbPr_enabled; ///< DAC YPbPr enabled or not 368 } DAC_ApiStatus; 369 370 typedef enum 371 { 372 E_DAC_POWER_SUSPEND = 1, // State is backup in DRAM, components power off. 373 E_DAC_POWER_RESUME = 2, // Resume from Suspend or Hibernate mode 374 E_DAC_POWER_MECHANICAL = 3, // Full power off mode. System return to working state only after full reboot 375 E_DAC_POWER_SOFT_OFF = 4, // The system appears to be off, but some components remain powered for trigging boot-up. 376 } E_DAC_POWER_MODE; 377 378 //------------------------------------------------------------------------------------------------- 379 // Function and Variable 380 //------------------------------------------------------------------------------------------------- 381 382 /******************************************************************************/ 383 /* Variable */ 384 /* ****************************************************************************/ 385 /** 386 * 387 * The global interface for panel manipulation. 388 * 389 * @attention <b>Call "MApi_DAC_Init()" first before using this obj</b> 390 */ 391 392 //------------------------------------------------------------------------------------------------- 393 /// Get version (without Mutex protect) 394 /// @param ppVersion \b OUT: Version information of DAC lib. 395 /// @return @ref APIDAC_Result 396 //------------------------------------------------------------------------------------------------- 397 APIDAC_Result MApi_DAC_GetLibVer(const MSIF_Version **ppVersion); 398 399 //------------------------------------------------------------------------------------------------- 400 /// Get DAC driver info 401 /// @return the pointer to DAC_ApiInfo structure 402 //------------------------------------------------------------------------------------------------- 403 const DAC_ApiInfo * MApi_DAC_GetInfo(void); 404 405 //------------------------------------------------------------------------------------------------- 406 /// Get DAC status 407 /// @param pDacStatus \b OUT: the pointer to DAC_ApiStatus structure 408 /// @return @ref MS_BOOL 409 //------------------------------------------------------------------------------------------------- 410 MS_BOOL MApi_DAC_GetStatus(DAC_ApiStatus *pDacStatus); 411 412 #ifdef UFO_XC_GETOUTPUTINTELACETIMING 413 //------------------------------------------------------------------------------------------------- 414 /// Get DAC GetOutputInterlaceTiming 415 /// @return @ref MS_BOOL 416 //------------------------------------------------------------------------------------------------- 417 MS_BOOL SYMBOL_WEAK MApi_DAC_GetOutputInterlaceTiming(void); 418 #endif 419 //------------------------------------------------------------------------------------------------- 420 /// Set DAC debug level 421 /// @param pDacStatus \b IN: debug level 422 /// @return @ref MS_BOOL 423 //------------------------------------------------------------------------------------------------- 424 MS_BOOL MApi_DAC_SetDbgLevel(MS_U16 u16DbgSwitch); 425 426 //------------------------------------------------------------------------------------------------- 427 /// DAC Initialization 428 /// @return @ref MS_BOOL 429 //------------------------------------------------------------------------------------------------- 430 MS_BOOL MApi_DAC_Init(void); 431 432 //------------------------------------------------------------------------------------------------- 433 /// DAC configuration enable 434 // @param bEnable \b IN: Enable or Disable DAC 435 // @param bIsYPbPr \b IN: The DAC output signal type: YPbPr or CVBS/S-VIDEO 436 //------------------------------------------------------------------------------------------------- 437 void MApi_DAC_Enable(MS_BOOL bEnable, MS_BOOL bIsYPbPr); 438 439 //------------------------------------------------------------------------------------------------- 440 /// Set DAC clock inv 441 // @param bEnable \b IN: Enable or Disable clock INV 442 // @param bIsYPbPr \b IN: The DAC output signal type: YPbPr or CVBS/S-VIDEO 443 //------------------------------------------------------------------------------------------------- 444 void MApi_DAC_SetClkInv(MS_BOOL bEnable, MS_BOOL bIsYPbPr); 445 446 //------------------------------------------------------------------------------------------------- 447 /// Set DAC output timing for hdgen(YPbPr) 448 // @param eTiming \b IN: The output timing type for YPbPr 449 //------------------------------------------------------------------------------------------------- 450 void MApi_DAC_SetYPbPrOutputTiming(E_OUTPUT_VIDEO_TIMING_TYPE eTiming); 451 452 //------------------------------------------------------------------------------------------------- 453 /// Set DAC output sourcec 454 // @param enOutputType \b IN: The output source type 455 // @param bIsYPbPr \b IN: The DAC output signal type: YPbPr or CVBS/S-VIDEO 456 //------------------------------------------------------------------------------------------------- 457 void MApi_DAC_SetOutputSource(E_DAC_OUTPUT_TYPE enOutputType, MS_BOOL bIsYPbPr); 458 459 //------------------------------------------------------------------------------------------------- 460 /// Set DAC output Voltage 461 // @param enLevel \b IN: The output maximun output Voltage 462 // @param bIsYPbPr \b IN: The DAC output signal type: YPbPr or CVBS/S-VIDEO 463 //------------------------------------------------------------------------------------------------- 464 void MApi_DAC_SetOutputLevel(E_DAC_MAX_OUTPUT_LEVEL enLevel, MS_BOOL bIsYPbPr); 465 466 //------------------------------------------------------------------------------------------------- 467 /// Set DAC Swap three output 468 // @param enSwap \b IN: swap three output (RGB/XYC) 469 // @param bIsYPbPr \b IN: The DAC output signal type: YPbPr or CVBS/S-VIDEO 470 //------------------------------------------------------------------------------------------------- 471 void MApi_DAC_SetOutputSwapSel(E_DAC_SWAP_SEL enSwap,MS_BOOL bIsYPbPr); 472 473 //------------------------------------------------------------------------------------------------- 474 /// Control DAC SD output En/Disable 475 // @param enBit \b IN: XYC 476 //------------------------------------------------------------------------------------------------- 477 void MApi_DAC_OnOffSD(E_DAC_SD_ENABLE_CTRL enBit); 478 479 //------------------------------------------------------------------------------------------------- 480 /// Get DAC SD output En/Disable 481 /// @return @ref E_DAC_SD_ENABLE_CTRL 482 //------------------------------------------------------------------------------------------------- 483 E_DAC_SD_ENABLE_CTRL SYMBOL_WEAK MApi_DAC_GetSDStatus(void); 484 485 //------------------------------------------------------------------------------------------------- 486 /// Control DAC HD output En/Disable 487 // @param enBit \b IN: RGB 488 //------------------------------------------------------------------------------------------------- 489 void MApi_DAC_OnOffHD(E_DAC_HD_ENABLE_CTRL enBit); 490 491 //------------------------------------------------------------------------------------------------- 492 /// Get DAC HD output En/Disable 493 /// @return @ref E_DAC_HD_ENABLE_CTRL 494 //------------------------------------------------------------------------------------------------- 495 E_DAC_HD_ENABLE_CTRL SYMBOL_WEAK MApi_DAC_GetHDStatus(void); 496 497 //------------------------------------------------------------------------------------------------- 498 /// Set common clock mux for DAC & HDMITx 499 // @param eTiming \b IN: The output timing type 500 // @param ebits \b IN: The output bit type 501 //------------------------------------------------------------------------------------------------- 502 void MApi_DAC_ClkSel(E_OUTPUT_VIDEO_TIMING_TYPE eTiming, E_OUTPUT_BIT_TYPE ebits); 503 504 void MApi_DAC_DumpTable(MS_U8 *pDACTable, MS_U8 u8DACtype); 505 506 void MApi_DAC_Exit(void); 507 508 //---------------------------------------------------------------- 509 // DAC - set half output current 510 // @return none 511 //---------------------------------------------------------------- 512 void MApi_DAC_SetIHalfOutput(MS_BOOL bEnable, MS_BOOL bIsYPbPr); 513 514 //---------------------------------------------------------------- 515 // DAC - set quart output current 516 // @return none 517 //---------------------------------------------------------------- 518 void MApi_DAC_SetQuartOutput(MS_BOOL bEnable,MS_BOOL bIsYPbPr); 519 520 //---------------------------------------------------------------- 521 // DAC - SetDacState 522 // When DAC is already enabled in the MBoot, we can use this function to 523 // mark the DAC init state as "enabled". 524 // @bInited: TRUE: enabled, FALSE: not enabled 525 // @bIsYPbPr: TRUE: HD, FALSE: SD 526 // @return none 527 //---------------------------------------------------------------- 528 void MApi_DAC_SetDacState(MS_BOOL bEnabled, MS_BOOL bIsYPbPr); 529 530 //---------------------------------------------------------------- 531 // MApi_DAC_HotPlugDetect - Get DAC HotPlug state 532 // @param: SelDAC: DAC_DETECT_HD, DAC_DETECT_SD 533 // @param: DetectType: DAC_DETECT_PLUGIN, DAC_DETECT_PLUGOUT 534 // @param: bIsSignIn: Report signal is in/out 535 // @return: TRUE is working successful 536 //---------------------------------------------------------------- 537 MS_BOOL MApi_DAC_HotPlugDetect(E_DAC_DETECT SelDAC,E_DAC_DETECT_TYPE DetectType, MS_BOOL *State); 538 539 MS_U32 Mapi_DAC_SetPowerState(E_DAC_POWER_MODE ePowerState); 540 541 //---------------------------------------------------------------- 542 // MApi_DAC_SetWSSOnOff - Turn On/Off WSS 543 // @bEnabled: TRUE: enabled, FALSE: not enabled 544 // @bIsYPbPr: TRUE: component, FALSE: CVBS 545 // @return: TRUE is working successful 546 //---------------------------------------------------------------- 547 MS_BOOL SYMBOL_WEAK MApi_DAC_SetWSSOnOff(MS_BOOL bEnable, MS_BOOL bIsYPbPr); 548 549 //---------------------------------------------------------------- 550 // MApi_DAC_GetWSSStatus - Get WSS Status 551 // @bIsYPbPr: TRUE: component, FALSE: CVBS 552 // @pEnabled: \b OUT: the pointer to WSS OnOff. TRUE: enabled, FALSE: not enabled 553 ///@pSetWSS_Data: \b OUT: the pointer to DAC_SETWSS_INFO structure 554 // @return: TRUE is working successful 555 //---------------------------------------------------------------- 556 MS_BOOL SYMBOL_WEAK MApi_DAC_GetWSSStatus(MS_BOOL bIsYPbPr, MS_BOOL *pEnable, DAC_SETWSS_INFO *pSetWSS_Data); 557 558 //---------------------------------------------------------------- 559 // MApi_DAC_ResetWSSData - Reset WSS Data 560 // @bIsYPbPr: TRUE: component, FALSE: CVBS 561 // @return: TRUE is working successful 562 //---------------------------------------------------------------- 563 MS_BOOL SYMBOL_WEAK MApi_DAC_ResetWSSData(MS_BOOL bIsYPbPr); 564 565 //---------------------------------------------------------------- 566 // MApi_DAC_SetWSSOutput - Set WSS VBI data output 567 // @bEnabled: TRUE: enabled, FALSE: not enabled 568 // @bIsYPbPr: TRUE: component, FALSE: CVBS 569 // @DAC_SETWSS_INFO: video vbi data struct 570 // @return: TRUE is working successful 571 //---------------------------------------------------------------- 572 MS_BOOL SYMBOL_WEAK MApi_DAC_SetWSSOutput(MS_BOOL bEnable, MS_BOOL bIsYPbPr, DAC_SETWSS_INFO SetWSS_Data); 573 574 //---------------------------------------------------------------- 575 // MApi_DAC_EnableICT 576 // Enable hdgen ICT (Image Constriant Token) function 577 // @bEnable: TRUE: enable, FALSE: disable 578 // @return: TRUE is working successful 579 //---------------------------------------------------------------- 580 581 MS_BOOL SYMBOL_WEAK MApi_DAC_EnableICT(MS_BOOL bEnable); 582 583 //---------------------------------------------------------------- 584 // DAC - set VGA Hsync Vsync 585 // @return none 586 //---------------------------------------------------------------- 587 588 void MApi_DAC_SetVGAHsyncVsync(MS_BOOL bEnable); 589 590 591 592 #ifdef __cplusplus 593 } 594 #endif 595 596 #endif 597 598