xref: /utopia/UTPA2-700.0.x/mxlib/include/apiCEC.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) 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   apiCEC.h
98 /// @brief  CEC Interface
99 /// @author MStar Semiconductor Inc.
100 ///////////////////////////////////////////////////////////////////////////////////////////////////
101 
102 /*! \defgroup MISC HDMI modules
103 
104     <b> CEC (Consumer Electronics Control) </b>\n
105     - In Europe, there was an analog predecessor to HDMI known as the SCART interface. Like HDMI, SCART carried audio and video signals through one cable. The SCART cable had a one-wire bus for controlling a home theater system.  This was branded as AV.link by Philips, among others. This bus supported one touch play, standby, etc.\n
106     For more information,see \link APICEC apiCEC interface (apiCEC.h) \endlink \n
107 
108     <b> DAC(digital-to-analog converter,DAC)</b>\n
109     - Convert digital signal to analog signal.\n
110     For more information,see \link DAC DAC interface (apiDAC.h) \endlink \n
111 
112     <b> MHL interface </b>
113     - Check whether MHL cable is plugged or not in Rx side
114     - Disable R-term and output Vbus
115     - Check whether Cbus is connected(discovery pulse completed)
116     - Sink -> Source: "SET_HPD"
117     - Sink -> Source: Write_Stat - "DCAP_RDY" and Write_INT - "DCAP_CHG"
118     - Sink -> Source: Write_Stat - "PATH_EN"\n
119     For more information,see \link MHL MHL interface (apiMHL.h)  \endlink \n
120 
121     <b> HDMI interface </b>
122     - HDMI Ethernet Channel
123     Support Ethernet communication through HDMI
124     - Audio Return Channel
125     - 3D support
126     - Frame packing, Side-by-Side half, Top-Buttom and etc.
127     - 4Kx2K support
128     3840x2160@24/25/30Hz, 4096x2160@24Hz
129     - Additional Color Spaces
130     sYCC601, AdobeRGB, AdobeYCC601
131     - HDMI Micro Connector
132     19-pin/1080p\n
133     For more information,see \link APICEC apiCEC interface (apiCEC.h)  \endlink \n
134 
135  * \defgroup APICEC apiCEC interface (apiCEC.h)
136  * \ingroup MISC
137 
138    <b> CEC (Consumer Electronics Control) </b>
139     In Europe, there was an analog predecessor to HDMI known as the SCART interface. Like HDMI, SCART carried audio and video signals through one cable. The SCART cable had a one-wire bus for controlling a home theater system.  This was branded as AV.link by Philips, among others. This bus supported one touch play, standby, etc.
140 
141 
142    <b> CEC layout </b>
143    \image html apiCEC_pic1.png
144    \image html apiCEC_pic2.png
145 
146    <b>Feature </b>
147    - Device OSD Name Transfer - Enables devices to upload their preferred OSD name to the TV. The TV can then use this name in any menus associated with that device.
148    - Device Power Status ?Allows the current power status of a device to be discovered.
149    - OSD Display - Enables a device to use the on-screen display of the TV to display text strings.
150    - Routing Control - Allows the control of CEC Switches for streaming of a new source device.
151    - System Information - Queries the system to determine device addresses and language.
152    - Vendor Specific Commands - Allows a set of vendor-defined commands to be used between devices of that vendor.
153    - Audio Rate Control ?Allows an Amplifier to fractionally increase or decrease the playback rate of an audio source.
154 
155    \image html apiCEC_pic3.png
156    \image html apiCEC_pic4.png
157 
158 
159  * \defgroup apiCEC_BASIC apiCEC Module basic
160  * \ingroup APICEC
161 
162  * \dergroup apiCEC_Message send messge
163  * \ingroup APICEC
164 
165 *! \dergroup apiCEC_STATUS CEC status
166 * \ingroup APICEC
167 
168 *! \dergroup apiCEC_SECOND support second LA
169 * \ingroup APICEC
170 
171 *! \dergroup apiCEC_ToBeRemove apiCEC api to be removed
172 * \ingroup APICEC
173 
174 *! \dergroup apiCEC_ToBeAdd apiCEC api to be added
175 * \ingroup APICEC
176 
177 */
178 
179 #ifndef _APICEC_H_
180 #define _APICEC_H_
181 
182 #ifdef __cplusplus
183 extern "C"
184 {
185 #endif
186 
187 #include "MsTypes.h"
188 #include "MsDevice.h"
189 #include "MsCommon.h"
190 
191 
192 //-------------------------------------------------------------------------------------------------
193 //  Macro and Define
194 //-------------------------------------------------------------------------------------------------
195 #define MSIF_CEC_LIB_CODE               {'C','E','C','_'}
196 #define MSIF_CEC_LIBVER                 {'0','0'}                         /* 0.0 ~ Z.Z */
197 #define MSIF_CEC_BUILDNUM               {'0','8'}                         /* 00 ~ 99   */
198 #define MSIF_CEC_CHANGELIST             {'0','0','4','4','9','9','9','1'} /* CL#       */
199 #define CEC_API_VERSION                  /* Character String for DRV/API version             */  \
200     MSIF_TAG,                           /* 'MSIF'                                           */  \
201     MSIF_CLASS,                         /* '00'                                             */  \
202     MSIF_CUS,                           /* 0x0000                                           */  \
203     MSIF_MOD,                           /* 0x0000                                           */  \
204     MSIF_CHIP,                                                                                  \
205     MSIF_CPU,                                                                                   \
206     MSIF_CEC_LIB_CODE,                  /* IP__                                             */  \
207     MSIF_CEC_LIBVER,                    /* 0.0 ~ Z.Z                                        */  \
208     MSIF_CEC_BUILDNUM,                  /* 00 ~ 99                                          */  \
209     MSIF_CEC_CHANGELIST,                /* CL#                                              */  \
210     MSIF_OS
211 
212 #define CEC_VERSION_11      0UL   //CEC1.1
213 #define CEC_VERSION_12      1UL   //CEC1.2
214 #define CEC_VERSION_12a     2UL   //CEC1.2a
215 #define CEC_VERSION_13      3UL   //CEC1.3
216 #define CEC_VERSION_13a     4UL   //CEC1.3a
217 #define CEC_VERSION_14      5UL   //CEC1.4
218 
219 #define HDMI_CEC_VERSION    CEC_VERSION_14
220 
221 #define CEC_FIFO_CNT                4UL
222 #define CEC_FIFO_NUM_COUNT          CEC_FIFO_CNT
223 #define CEC_PHY_ADDR_COUNT          2UL
224 #define CEC_DEVICE_EXIST_COUNT      15UL
225 #define CEC_FIFO_DATA_NUMBER        16UL
226 #define CEC_VENDOR_ID_COUNT         3UL
227 #define CEC_MENU_LANGUAGE_COUNT     3UL
228 
229 #define RETRY_CNT          1UL
230 #define FrameInterval      7UL
231 #define BusFreeTime        6UL//5 // Free bit time by IC design has a little difference than spec, set to 6 instead of 5
232 #define ReTxInterval       3UL
233 
234 #define ENABLE_CEC_INT                  ENABLE
235 #define ENABLE_CUST01_CEC               ENABLE
236 #define ENABLE_SW_CEC_WAKEUP            ENABLE
237 #define ENABLE_CEC_MULTIPLE             DISABLE
238 
239 //-------------------------------------------------------------------------------------------------
240 //  Type and Structure
241 //-------------------------------------------------------------------------------------------------
242 
243 typedef enum _MsCEC_INPUT_PORT
244 {
245     INPUT_PORT0 = 0x00,
246     INPUT_PORT1 = 0x01,
247     INPUT_PORT2 = 0x02,
248     INPUT_PORT3 = 0x03,
249 }MsCEC_INPUT_PORT;
250 
251 typedef enum _CEC_ERROR_CODE
252 {
253     E_CEC_FEATURE_ABORT = 0x00,
254     E_CEC_RX_SUCCESS    = 0x01,
255     E_CEC_TX_SUCCESS    = 0x02,
256     E_CEC_RF            = 0x04,
257     E_CEC_LOST_ABT      = 0x08,
258     E_CEC_BIT_SHORT     = 0x10,
259     E_CEC_BIT_LONG      = 0x20,
260     E_CEC_NACK          = 0x40,
261     E_CEC_SYSTEM_BUSY   = 0x80,
262 } CEC_ERROR_CODE;
263 
264 //Logical Address
265 typedef enum _MsCEC_DEVICELA
266 {
267     E_LA_TV              =0,
268     E_LA_RECORDER1       =1,
269     E_LA_RECORDER2       =2,
270     E_LA_TUNER1          =3,
271     E_LA_PLAYBACK1       =4,
272     E_LA_AUDIO_SYS       =5,
273     E_LA_TUNER2          =6,
274     E_LA_TUNER3          =7,
275     E_LA_PLAYBACK2       =8,
276     E_LA_RECORER3        =9,
277 #if(HDMI_CEC_VERSION >= CEC_VERSION_13a)
278     E_LA_TUNER4          =10,
279     E_LA_PLYBACK3        =11,
280 #endif
281     RESERVED_1            =12,
282     RESERVED_2            =13,
283     E_LA_FREE_USE        =14,
284     E_LA_UNREGISTERED    =15,
285     E_LA_BROADCAST       =15,
286     E_LA_MAX =15,
287 } MsCEC_DEVICELA;
288 
289 //the opcode is referenced from CEC1.3a table 7 ~ 27
290 typedef enum _MsCEC_MSGLIST
291 {
292 //----- One Touch Play ----------------------------
293     E_MSG_ACTIVE_SOURCE                         = 0x82,
294     E_MSG_OTP_IMAGE_VIEW_ON                     = 0x04,
295     E_MSG_OTP_TEXT_VIEW_ON                      = 0x0D,
296 
297 
298 //----- Routing Control ---------------------------
299     //E_MSG_RC_ACTIVE_SOURCE                      = 0x82,
300     E_MSG_RC_INACTIVE_SOURCE                    = 0x9D,
301 
302     E_MSG_RC_REQ_ACTIVE_SOURCE                  = 0x85, // should be removed
303     E_MSG_RC_REQUEST_ACTIVE_SOURCE              = 0x85,
304 
305     E_MSG_RC_ROUTING_CHANGE                     = 0x80,
306 
307     E_MSG_RC_ROUTING_INFO                       = 0x81, // should be removed
308     E_MSG_RC_ROUTING_INFORMATION                = 0x81,
309 
310     E_MSG_RC_SET_STREM_PATH                     = 0x86,
311 
312 
313 //----- Standby Command ---------------------------
314     E_MSG_STANDBY                               = 0x36,
315 
316 
317 //----- One Touch Record---------------------------
318     E_MSG_OTR_RECORD_OFF                        = 0x0B,
319     E_MSG_OTR_RECORD_ON                         = 0x09,
320     E_MSG_OTR_RECORD_STATUS                     = 0x0A,
321     E_MSG_OTR_RECORD_TV_SCREEN                  = 0x0F,
322 
323 
324 //----- Timer programmer -------------------------- CEC1.3a
325     E_MSG_TP_CLEAR_ANALOG_TIMER                 = 0x33, // should be removed
326     E_MSG_TP_CLEAR_ANALOGUE_TIMER               = 0x33,
327 
328     E_MSG_TP_CLEAR_DIGITAL_TIMER                = 0x99,
329 
330     E_MSG_TP_CLEAR_EXT_TIMER                    = 0xA1, // should be removed
331     E_MSG_TP_CLEAR_EXTERNAL_TIMER               = 0xA1,
332 
333     E_MSG_TP_SET_ANALOG_TIMER                   = 0x34, // should be removed
334     E_MSG_TP_SET_ANALOGUE_TIMER                 = 0x34,
335 
336     E_MSG_TP_SET_DIGITAL_TIMER                  = 0x97,
337 
338     E_MSG_TP_SET_EXT_TIMER                      = 0xA2, // should be removed
339     E_MSG_TP_SET_EXTERNAL_TIMER                 = 0xA2,
340 
341     E_MSG_TP_SET_TIMER_PROGRAM_TITLE            = 0x67,
342     E_MSG_TP_TIMER_CLEARD_STATUS                = 0x43,
343     E_MSG_TP_TIMER_STATUS                       = 0x35,
344 
345 
346 //----- System Information ------------------------
347     E_MSG_SI_CEC_VERSION                        = 0x9E,       //1.3a
348     E_MSG_SI_GET_CEC_VERSION                    = 0x9F,       //1.3a
349 
350     E_MSG_SI_REQUEST_PHY_ADDR                   = 0x83, // should be removed
351     E_MSG_SI_GIVE_PHYSICAL_ADDRESS              = 0x83,
352 
353     E_MSG_SI_GET_MENU_LANGUAGE                  = 0x91,
354     //E_MSG_SI_POLLING_MESSAGE                    = ?,
355 
356     E_MSG_SI_REPORT_PHY_ADDR                    = 0x84, // should be removed
357     E_MSG_SI_REPORT_PHYSICAL_ADDRESS            = 0x84,
358 
359     E_MSG_SI_SET_MENU_LANGUAGE                  = 0x32,
360 
361     //E_MSG_SI_REC_TYPE_PRESET                    = 0x00,  //parameter   ?
362     //E_MSG_SI_REC_TYPE_OWNSRC                    = 0x01,  //parameter   ?
363 
364 
365 //----- Deck Control Feature-----------------------
366     E_MSG_DC_DECK_CTRL                          = 0x42, // should be removed
367     E_MSG_DC_DECK_CONTROL                       = 0x42,
368 
369     E_MSG_DC_DECK_STATUS                        = 0x1B,
370     E_MSG_DC_GIVE_DECK_STATUS                   = 0x1A,
371     E_MSG_DC_PLAY                               = 0x41,
372 
373 
374 //----- Tuner Control ------------------------------
375     E_MSG_TC_GIVE_TUNER_STATUS                  = 0x08, // should be removed
376     E_MSG_TC_GIVE_TUNER_DEVICE_STATUS           = 0x08,
377 
378     E_MSG_TC_SEL_ANALOG_SERVICE                 = 0x92, // should be removed
379     E_MSG_TC_SEL_ANALOGUE_SERVICE               = 0x92,
380 
381     E_MSG_TC_SEL_DIGITAL_SERVICE                = 0x93, // should be removed
382     E_MSG_TC_SELECT_DIGITAL_SERVICE             = 0x93,
383 
384     E_MSG_TC_TUNER_DEVICE_STATUS                = 0x07,
385 
386     E_MSG_TC_TUNER_STEP_DEC                     = 0x06, // should be removed
387     E_MSG_TC_TUNER_STEP_DECREMENT               = 0x06,
388 
389     E_MSG_TC_TUNER_STEP_INC                     = 0x05, // should be removed
390     E_MSG_TC_TUNER_STEP_INCREMENT               = 0x05,
391 
392 
393 //---------Vendor Specific -------------------------
394     //E_MSG_VS_CEC_VERSION                        = 0x9E,       //1.3a
395     E_MSG_VS_DEVICE_VENDOR_ID                   = 0x87,
396     //E_MSG_VS_GET_CEC_VERSION                    = 0x9F,       //1.3a
397 
398     E_MSG_VS_GIVE_VENDOR_ID                     = 0x8C, // should be removed
399     E_MSG_VS_GIVE_DEVICE_VENDOR_ID              = 0x8C,
400 
401     E_MSG_VS_VENDOR_COMMAND                     = 0x89,
402     E_MSG_VS_VENDOR_COMMAND_WITH_ID             = 0xA0,      //1.3a
403 
404     E_MSG_VS_VENDOR_RC_BUT_DOWN                 = 0x8A, // should be removed
405     E_MSG_VS_VENDOR_REMOTE_BUTTON_DOWN          = 0x8A,
406 
407     E_MSG_VS_VENDOR_RC_BUT_UP                   = 0x8B, // should be removed
408     E_MSG_VS_VENDOR_REMOTE_BUTTON_UP            = 0x8B,
409 
410 
411 //----- OSD Display --------------------------------
412     E_MSG_SET_OSD_STRING                        = 0x64,
413 
414 
415 //----- Device OSD Name Transfer  -------------------------
416     E_MSG_OSDNT_GIVE_OSD_NAME                   = 0x46,
417     E_MSG_OSDNT_SET_OSD_NAME                    = 0x47,
418 
419 
420 //----- Device Menu Control ------------------------
421     E_MSG_DMC_MENU_REQUEST                      = 0x8D,
422     E_MSG_DMC_MENU_STATUS                       = 0x8E,
423     //E_MSG_DMC_MENU_ACTIVATED                    = 0x00,   //parameter
424     //E_MSG_DMC_MENU_DEACTIVATED                  = 0x01,   //parameter
425 
426     E_MSG_UI_PRESS                              = 0x44, // should be removed
427     E_MSG_DMC_USER_CONTROL_PRESSED              = 0x44,
428 
429     E_MSG_UI_RELEASE                            = 0x45, // should be removed
430     E_MSG_DMC_USER_CONTROL_RELEASED             = 0x45,
431 
432 
433 //----- Remote Control Passthrough ----------------
434 //----- UI Message --------------------------------
435 //    E_MSG_RCP_USER_CONTROL_PRESSED              = 0x44,
436 //    E_MSG_RCP_USER_CONTROL_RELEASED             = 0x45,
437 
438 
439 //----- Power Status  ------------------------------
440     E_MSG_PS_GIVE_POWER_STATUS                  = 0x8F, // should be removed
441     E_MSG_PS_GIVE_DEVICE_POWER_STATUS           = 0x8F,
442 
443     E_MSG_PS_REPORT_POWER_STATUS                = 0x90,
444 
445 
446 //----- General Protocal Message ------------------
447 
448 //----- Feature Abort -----------------------------
449     E_MSG_FEATURE_ABORT                         = 0x00,
450 
451 //----- Abort Message -----------------------------
452     E_MSG_ABORT_MESSAGE                         = 0xFF,
453 
454 
455 //----- System Audio Control ------------------
456     E_MSG_SAC_GIVE_AUDIO_STATUS                 = 0x71,
457     E_MSG_SAC_GIVE_SYSTEM_AUDIO_MODE_STATUS     = 0x7D,
458     E_MSG_SAC_REPORT_AUDIO_STATUS               = 0x7A,
459 
460     E_MSG_SAC_REPORT_SHORT_AUDIO_DESCRIPTOR     = 0xA3,
461     E_MSG_SAC_REQUEST_SHORT_AUDIO_DESCRIPTOR    = 0xA4,
462 
463     E_MSG_SAC_SET_SYSTEM_AUDIO_MODE             = 0x72,
464     E_MSG_SAC_SYSTEM_AUDIO_MODE_REQUEST         = 0x70,
465     E_MSG_SAC_SYSTEM_AUDIO_MODE_STATUS          = 0x7E,
466 
467 
468 //----- System Audio Control ------------------
469     E_MSG_SAC_SET_AUDIO_RATE                    = 0x9A,
470 
471 
472 //----- Audio Return Channel  Control ------------------
473     E_MSG_ARC_INITIATE_ARC                      = 0xC0,
474     E_MSG_ARC_REPORT_ARC_INITIATED              = 0xC1,
475     E_MSG_ARC_REPORT_ARC_TERMINATED             = 0xC2,
476 
477     E_MSG_ARC_REQUEST_ARC_INITATION             = 0xC3, // should be removed
478     E_MSG_ARC_REQUEST_ARC_INITIATION            = 0xC3,
479 
480     E_MSG_ARC_REQUEST_ARC_TERMINATION           = 0xC4,
481 
482     E_MSG_ARC_TERMINATED_ARC                    = 0xC5, // should be removed
483     E_MSG_ARC_TERMINATE_ARC                     = 0xC5,
484 
485 
486 //----- Capability Discovery and Control ------------------
487     E_MSG_CDC_CDC_MESSAGE                       = 0xF8,
488 
489 } MsCEC_MSGLIST;
490 
491 typedef enum _MsCEC_MSG_TRANS_TYPE
492 {
493     E_TRANS_BROADCAST_MSG   = 0,
494     E_TRANS_DIRECT_MSG      = 1,
495     E_TRANS_BOTHTYPE_MSG    = 2,
496 } MsCEC_MSG_TRANS_TYPE;
497 
498 
499 //Device Type, 1byte
500 typedef enum _MsCEC_DEVICE_TYPE
501 {
502     E_DEVICE_TYPE_TV                    =0,
503     E_DEVICE_TYPE_RECORDING_DEVICE      =1,
504     E_DEVICE_TYPE_RESERVED              =2,
505     E_DEVICE_TYPE_TUNER                 =3,
506     E_DEVICE_TYPE_PLAYBACK_DEVICE       =4,
507     E_DEVICE_TYPE_AUDIO_SYSTEM          =5,
508 } MsCEC_DEVICE_TYPE;
509 
510 
511 //Deck Control, Deck Control Mode 1 byte
512 typedef enum _MsCEC_MSG_DC_DECK_CTRL_PARM
513 {
514     E_MSG_DCM_CMD_SKIP_FORWARD          = 1,  //parameter
515     E_MSG_DCM_CMD_SKIP_REVERSE          = 2,  //parameter
516     E_MSG_DCM_CMD_STOP                  = 3,  //parameter
517     E_MSG_DCM_CMD_EJECT                 = 4,  //parameter
518 } MsCEC_MSG_DC_DECK_CTRL_PARM;
519 
520 //Deck status, Deck info 1 byte
521 typedef enum _MsCEC_MSG_DC_DECK_STATUS_PARM
522 {
523     E_MSG_DI_CMD_PLAY                   = 0x11,  //parameter
524     E_MSG_DI_CMD_RECORD                 = 0x12,  //parameter
525     E_MSG_DI_CMD_PLAY_REVERSE           = 0x13,  //parameter
526     E_MSG_DI_CMD_STILL                  = 0x14,  //parameter
527     E_MSG_DI_CMD_SLOW                   = 0x15,  //parameter
528     E_MSG_DI_CMD_SLOW_REVERSE           = 0x16,  //parameter
529     E_MSG_DI_CMD_FAST_FORWARD           = 0x17,  //parameter
530     E_MSG_DI_CMD_FAST_REVERSE           = 0x18,  //parameter
531     E_MSG_DI_CMD_NO_MEDIA               = 0x19,  //parameter
532     E_MSG_DI_CMD_STOP                   = 0x1A,  //parameter
533     E_MSG_DI_CMD_SKIP_FORWARD           = 0x1B,  //parameter
534     E_MSG_DI_CMD_SKIP_REVERSE           = 0x1C,  //parameter
535     E_MSG_DI_CMD_INDEX_SEARCH_FORWARD   = 0x1D,  //parameter
536     E_MSG_DI_CMD_INDEX_SEARCH_REVERSE   = 0x1E,  //parameter
537     E_MSG_DI_CMD_OTHER_STATUS           = 0x1F,  //parameter
538 } MsCEC_MSG_DC_DECK_STATUS_PARM;
539 
540 
541 //Give deck status, Status request 1 byte
542 typedef enum _MsCEC_MSG_STATUS_REQUEST_PARM
543 {
544     E_MSG_SR_CMD_ON                     = 1,  //parameter
545     E_MSG_SR_CMD_OFF                    = 2,  //parameter
546     E_MSG_SR_CMD_ONCE                   = 3,  //parameter
547 } MsCEC_MSG_STATUS_REQUEST_PARM;
548 
549 
550 //Play, [Play Mode] 1 byte
551 typedef enum _MsCEC_MSG_DC_PLAY_PARM
552 {
553     E_MSG_PM_CMD_PLAY_FORWARD               = 0x24,  //parameter
554     E_MSG_PM_CMD_PLAY_REVERSE               = 0x20,  //parameter
555     E_MSG_PM_CMD_PLAY_STILL                 = 0x25,  //parameter
556     E_MSG_PM_CMD_FAST_FORWARD_MINI_SPEED    = 0x05,  //parameter
557     E_MSG_PM_CMD_FAST_FORWARD_MEDIUM_SPEED  = 0x06,  //parameter
558     E_MSG_PM_CMD_FAST_FORWARD_MAXI_SPEED    = 0x07,  //parameter
559     E_MSG_PM_CMD_FAST_REVERSE_MINI_SPEED    = 0x09,  //parameter
560     E_MSG_PM_CMD_FAST_REVERSE_MEDIUM_SPEED  = 0x0A,  //parameter
561     E_MSG_PM_CMD_FAST_REVERSE_MAXI_SPEED    = 0x0B,  //parameter
562     E_MSG_PM_CMD_SLOW_FORWARD_MINI_SPEED    = 0x15,  //parameter
563     E_MSG_PM_CMD_SLOW_FORWARD_MEDIUM_SPEED  = 0x16,  //parameter
564     E_MSG_PM_CMD_SLOW_FORWARD_MAXI_SPEED    = 0x17,  //parameter
565     E_MSG_PM_CMD_SLOW_REVERSE_MINI_SPEED    = 0x19,  //parameter
566     E_MSG_PM_CMD_SLOW_REVERSE_MEDIUM_SPEED  = 0x1A,  //parameter
567     E_MSG_PM_CMD_SLOW_REVERSE_MAXI_SPEED    = 0x1B,  //parameter
568 } MsCEC_MSG_DC_PLAY_PARM;
569 
570 
571 //Power status 1 byte
572 typedef enum _MsCEC_MSG_POWER_STATUS_PARM
573 {
574     E_MSG_PWRSTA_ON             = 0x00,
575     E_MSG_PWRSTA_STANDBY        = 0x01,
576     E_MSG_PWRSTA_STANDBY2ON     = 0x02,
577     E_MSG_PWRSTA_ON2STANDBY     = 0x03,
578     E_MSG_PWRSTA_UNKNOW                 = 0x04,
579 } MsCEC_MSG_POWER_STATUS_PARM;
580 
581 
582 typedef enum _MsCEC_MSG_ABORT_REASON
583 {
584     E_MSG_AR_UNRECOGNIZE_OPCDE  = 0x00,  // abort reason
585     E_MSG_AR_CANNOTRESPOND      = 0x01,  // abort reason
586     E_MSG_AR_CANNOTPROVIDESCR   = 0x02,  // abort reason
587     E_MSG_AR_INVALID_OPCODE     = 0x03,  // abort reason
588     E_MSG_AR_REFUSED            = 0x04,  // abort reason
589     E_MSG_AR_IGNORED            = 0x05,
590     E_MSG_AR_SUCCESSED        = 0x06,
591 } MsCEC_MSG_ABORT_REASON;
592 
593 
594 typedef enum _MsCEC_MSG_MENU_REQ_TYPE
595 {
596     E_MSG_MENU_REQ_ACTIVATED    = 0,  // menu request activated status
597     E_MSG_MENU_REQ_DEACTIVATED  = 1,  // menu request deactivated status
598     E_MSG_MENU_REQ_QUERY        = 2,  // menu request query status
599 } MsCEC_MSG_MENU_REQ_TYPE;
600 
601 
602 typedef enum _MsCEC_MSG_MENU_STATE
603 {
604     E_MSG_MENU_ACTIVATED    = 0,  // menu activated
605     E_MSG_MENU_DEACTIVATED  = 1,  // menu deactivated
606 } MsCEC_MSG_MENU_STATE;
607 
608 
609 typedef enum _MsCEC_MSG_RECORD_SOURCE_TYPE
610 {
611     E_MSG_RECORD_TYPE_OWN_SOURCE                = 1,  // own source
612     E_MSG_RECORD_TYPE_DIGITAL_SERVICE           = 2,  // digital service
613 #if(HDMI_CEC_VERSION >= CEC_VERSION_13a)
614     E_MSG_RECORD_TYPE_ANALOGUE_SERVICE          = 3,  // Analogue Service
615     E_MSG_RECORD_TYPE_EXTERNAL_PLUG             = 4,  // External Plug
616     E_MSG_RECORD_TYPE_EXTERNAL_PHYSICAL_ADDRESS = 5,  // External Physical Address
617 #endif
618 } MsCEC_MSG_RECORD_SOURCE_TYPE;
619 
620 
621 typedef enum _MsCEC_MSG_RECORD_STATUS_INFO
622 {
623     E_MSG_RECORD_INFO_RECORDING_OWN_SOURCE   = 0x01,  // Recording currently selected source
624     E_MSG_RECORD_INFO_RECORDING_DIGITAL_SERVICE   = 0x02,  // Recording Digital Service
625 #if(HDMI_CEC_VERSION >= CEC_VERSION_13a)
626     E_MSG_RECORD_INFO_RECORDING_ANALOGUE_SERVICE   = 0x03,  // Recording Analogue Service
627     E_MSG_RECORD_INFO_RECORDING_EXTERNAL_INPUT   = 0x04,  // Recording External input
628 #endif
629     E_MSG_RECORD_INFO_NO_RECORDING_DIGITAL_SERVICE   = 0x05,  // unable to record Digital Service, no suitable tuner.
630 #if(HDMI_CEC_VERSION >= CEC_VERSION_13a)
631     E_MSG_RECORD_INFO_NO_RECORDING_ANALOGUE_SERVICE   = 0x06,  // unable to record Analogue Service, no suitable tuner.
632     E_MSG_RECORD_INFO_NO_RECORDING_REQ_SERVICE   = 0x07,  // unable to select required service, Has suitable tuner, but the requested parameters are invalid or out of range for that tuner.
633     E_MSG_RECORD_INFO_NO_RECORDING_INVALID_EXTERNAL_PLUG_NUMBER   = 0x09,  // invalid External plug number
634     E_MSG_RECORD_INFO_NO_RECORDING_INVALID_EXTERNAL_PHYSICAL_ADDRESS   = 0x0A,  // invalid External Physical Address
635     E_MSG_RECORD_INFO_NO_RECORDING_CA_NOT_SUPPORT   = 0x0B,  // CA system not supported
636     E_MSG_RECORD_INFO_NO_RECORDING_CA_NO   = 0x0C,  // No or Insufficient CA Entitlements
637     E_MSG_RECORD_INFO_NO_RECORDING_COPY_NEVER   = 0x0D,  // Not allowed to copy source, source is ��copy never��.
638     E_MSG_RECORD_INFO_NO_RECORDING_NO_FURTHER_COPY   = 0x0E,  // No further copies allowed
639 #endif
640     E_MSG_RECORD_INFO_NO_RECORDING_NO_MEDIA   = 0x10,  // no media
641     E_MSG_RECORD_INFO_NO_RECORDING_PLAYING   = 0x11,  // Playing
642     E_MSG_RECORD_INFO_NO_RECORDING_ALREADY_RECORDING   = 0x12,  // already recording
643     E_MSG_RECORD_INFO_NO_RECORDING_MEDIA_PROTECTED   = 0x13,  // media protected
644     E_MSG_RECORD_INFO_NO_RECORDING_NO_SOURCE  = 0x14,  // no source signal
645     E_MSG_RECORD_INFO_NO_RECORDING_MEDIA_PROBLEM  = 0x15,  // media problem
646 #if(HDMI_CEC_VERSION >= CEC_VERSION_13a)
647     E_MSG_RECORD_INFO_NO_RECORDING_NOT_ENOUGH_SPACE  = 0x16,  // not enough space available
648     E_MSG_RECORD_INFO_NO_RECORDING_PARENTAL_LOCK  = 0x17,  // Parental Lock On
649     E_MSG_RECORD_INFO_RECORDING_TERMINATED_NORMALLY  = 0x1A,  // Recording terminated normally, can optionally be sent in response to a <Record Off> message.
650     E_MSG_RECORD_INFO_RECORDING_ALREADY_TERMINATED  = 0x1B,  // Recording has already terminated, can optionally be sent in response to a <Record Off> message.
651 #endif
652     E_MSG_RECORD_INFO_NO_RECORDING_OTHER_REASON  = 0x1F,  // No recording �V other reason
653 } MsCEC_MSG_RECORD_STATUS_INFO;
654 
655 
656 //UI command parameter: Table 27 User Control Codes
657 typedef enum _MsCEC_MSG_USER_CTRL_PARM
658 {
659     E_MSG_UI_SELECT             = 0x00,
660     E_MSG_UI_UP                 = 0x01,
661     E_MSG_UI_DOWN               = 0x02,
662     E_MSG_UI_LEFT               = 0x03,
663     E_MSG_UI_RIGHT              = 0x04,
664     E_MSG_UI_RIGHT_UP           = 0x05,
665     E_MSG_UI_RIGHT_DOWN         = 0x06,
666     E_MSG_UI_LEFT_UP            = 0x07,
667     E_MSG_UI_LEFT_DOWN          = 0x08,
668     E_MSG_UI_ROOTMENU           = 0x09,
669     E_MSG_UI_SETUP_MENU         = 0x0A,
670     E_MSG_UI_CONTENTS_MENU      = 0x0B,
671     E_MSG_UI_FAVORITE_MENU      = 0x0C,
672     E_MSG_UI_EXIT               = 0x0D,
673 
674 // 0x0E ~ 0x1F  reserved
675 
676     E_MSG_UI_NUMBER_0           = 0x20,
677     E_MSG_UI_NUMBER_1           = 0x21,
678     E_MSG_UI_NUMBER_2           = 0x22,
679     E_MSG_UI_NUMBER_3           = 0x23,
680     E_MSG_UI_NUMBER_4           = 0x24,
681     E_MSG_UI_NUMBER_5           = 0x25,
682     E_MSG_UI_NUMBER_6           = 0x26,
683     E_MSG_UI_NUMBER_7           = 0x27,
684     E_MSG_UI_NUMBER_8           = 0x28,
685     E_MSG_UI_NUMBER_9           = 0x29,
686 
687     E_MSG_UI_DOT                = 0x2A,
688     E_MSG_UI_ENTER              = 0x2B,
689     E_MSG_UI_CLEAR              = 0x2C,
690 
691 // 0x2D ~ 0x2E reserved
692     E_MSG_UI_NEXT_FAVORITE      = 0x2F,
693 
694     E_MSG_UI_CHANNEL_UP         = 0x30,
695     E_MSG_UI_CHANNEL_DOWN       = 0x31,
696     E_MSG_UI_PREVIOUS_CHANNEL   = 0x32,
697     E_MSG_UI_SOUND_SELECT       = 0x33,
698     E_MSG_UI_INPUT_SELECT       = 0x34,
699     E_MSG_UI_DISPLAY_INFO       = 0x35,
700     E_MSG_UI_HELP               = 0x36,
701     E_MSG_UI_PAGE_UP            = 0x37,
702     E_MSG_UI_PAGE_DOWN          = 0x38,
703 
704 // 0x39 ~ 0x3F reserved
705 
706     E_MSG_UI_POWER              = 0x40,
707     E_MSG_UI_VOLUME_UP          = 0x41,
708     E_MSG_UI_VOLUME_DOWN        = 0x42,
709     E_MSG_UI_MUTE               = 0x43,
710     E_MSG_UI_PLAY               = 0x44,
711     E_MSG_UI_STOP               = 0x45,
712     E_MSG_UI_PAUSE              = 0x46,
713     E_MSG_UI_RECORD             = 0x47,
714     E_MSG_UI_REWIND             = 0x48,
715     E_MSG_UI_FAST_FORWARD       = 0x49,
716     E_MSG_UI_EJECT              = 0x4A,
717     E_MSG_UI_FORWARD            = 0x4B,
718     E_MSG_UI_BACKWARD           = 0x4C,
719     E_MSG_UI_STOP_RECORD        = 0x4D,
720     E_MSG_UI_PAUSE_RECORD       = 0x4E,
721 
722 // 0x4F reserved
723 
724     E_MSG_UI_ANGLE                      = 0x50,
725     E_MSG_UI_SUB_PICTURE                = 0x51,
726     E_MSG_UI_VIDEO_ON_DEMAND            = 0x52,
727     E_MSG_UI_ELECTRONIC_PROGRAM_GUIDE   = 0x53,
728     E_MSG_UI_TIMER_PROGRAMMING          = 0x54,
729     E_MSG_UI_INITIAL_CONFIGURATION      = 0x55,
730 
731 // 0x56 ~ 0x5F reserved
732 
733   //0x60 ~ 0x6D, identified as function
734     E_MSG_UI_PLAY_FUN               = 0x60,
735     E_MSG_UI_PSUSE_PLAY_FUN         = 0x61,
736     E_MSG_UI_RECORD_FUN             = 0x62,
737     E_MSG_UI_PAUSE_RECORD_FUN       = 0x63,
738     E_MSG_UI_STOP_FUN               = 0x64,
739     E_MSG_UI_MUTE_FUN               = 0x65,
740     E_MSG_UI_RESTORE_VOLUME_FUN     = 0x66,
741     E_MSG_UI_TUNE_FUN               = 0x67,
742     E_MSG_UI_SELECT_MEDIA_FUN       = 0x68,
743     E_MSG_UI_SELECT_AV_INPUT_FUN    = 0x69,
744     E_MSG_UI_SELECT_AUDIO_INPUT_FUN = 0x6A,
745     E_MSG_UI_POWER_TOGGLE_FUN       = 0x6B,
746     E_MSG_UI_POWER_OFF_FUN          = 0x6C,
747     E_MSG_UI_POWER_ON_FUN           = 0x6D,
748 
749 // 0x6E ~ 0x70 reserved
750 
751     E_MSG_UI_F1_BLUE            = 0x71,
752     E_MSG_UI_F2_RED             = 0x72,
753     E_MSG_UI_F3_GREEN           = 0x73,
754     E_MSG_UI_F4_YELLOW          = 0x74,
755     E_MSG_UI_F5                 = 0x75,
756     E_MSG_UI_DATA               = 0x76,
757 
758 // 0x77 ~ 0xFF reserved
759 } MsCEC_MSG_USER_CTRL_PARM;
760 
761 //query the power on mode through mailbox
762 #define CP_READ_POWERON_MODE  0x9A
763 
764 //mailbox report CEC wake up system
765 #define M_POWER_ON_BY_HDMI_CEC  0x2F
766 
767 
768 typedef struct _MDrv_Cec_RxData_Info
769 {
770     MS_U8 ucLength;
771     MS_U8 tRxData[CEC_FIFO_DATA_NUMBER];
772 } MS_CEC_RxData_Info;
773 
774 typedef struct DLL_PACKED
775 {
776     MS_U8 CecFifoIdxS;
777     MS_U8 CecFifoIdxE;
778     MS_U8 bCecMsgCnt;
779     MS_BOOL fCecInitFinish;
780     MS_CEC_RxData_Info CecRxBuf[CEC_FIFO_NUM_COUNT];   //TV CEC H/W part
781     MsCEC_DEVICELA MyLogicalAddress;                         //TV related
782     MS_U8 MyPhysicalAddress[CEC_PHY_ADDR_COUNT];
783     MsCEC_DEVICE_TYPE MyDeviceType;
784     MsCEC_MSG_POWER_STATUS_PARM MyPowerStatus;
785     MS_BOOL CecDevicesExisted[15];
786 
787     MS_U8 ActiveDeviceCECVersion;
788     MsCEC_DEVICE_TYPE ActiveDeviceType;
789     MsCEC_DEVICELA ActiveLogicalAddress;    //the remoter controller's active device
790     MS_U8 ActivePhysicalAddress[CEC_PHY_ADDR_COUNT];
791     MsCEC_MSG_POWER_STATUS_PARM ActivePowerStatus;
792 
793 #if ENABLE_CEC_MULTIPLE
794     MsCEC_DEVICELA MyLogicalAddress2;
795     MS_U8 MyPhysicalAddress2[CEC_PHY_ADDR_COUNT];
796     MsCEC_DEVICE_TYPE MyDeviceType2;
797     MsCEC_DEVICE_TYPE IniLogicalAddress;
798 #endif
799 } MS_CEC_INFO_LIST;
800 
801 typedef struct
802 {
803     MS_BOOL bAttachDrvISR;
804     MS_U32 ulXTAL_CLK_Hz;
805 } stCEC_INITIAL_CONFIG;
806 
807 typedef struct
808 {
809     MS_BOOL bAttachDrvISR;
810     MS_U32 ulXTAL_CLK_Hz;
811     MS_U32 ulReturnValue;
812 } stCEC_INITIAL_CONFIG_INFO;
813 
814 typedef enum
815 {
816     E_CEC_CMD_ATTACH_DRIVER_ISR
817 }E_CEC_CTRL_ID;
818 
819 //-------------------------------------------------------------------------------------------------
820 /// Attach driver ISR or not
821 /// @ingroup apiCEC_ToBeAdd
822 /// @param  bAttachDrvFlag       \b IN: true: attach driver ISR; false: no attach driver ISR
823 /// @return None
824 //-------------------------------------------------------------------------------------------------
825 typedef struct
826 {
827     MS_BOOL bAttachDrvFlag;
828 }stCMD_CEC_ATTACH_DRIVER_ISR;
829 
830 typedef enum
831 {
832     //CEC property
833     MAPI_CMD_DDC2BI_GET_INFO,
834     MAPI_CMD_CEC_INIT_CHIP,
835     MAPI_CMD_CEC_PORT_SELECT,
836     MAPI_CMD_CEC_EXIT,
837     MAPI_CMD_CEC_SET_MY_LOGICAL_ADDRESS,
838     MAPI_CMD_CEC_INIT,
839     MAPI_CMD_CEC_CHECK_EXIST_DEVICES,
840     MAPI_CMD_CEC_NEXT_DEVICE,
841     MAPI_CMD_CEC_CHK_RX_BUF,
842     MAPI_CMD_CEC_TX_SEND_MSG,
843     MAPI_CMD_CEC_TX_SEND_MSG2,
844     MAPI_CMD_CEC_TX_SEND_POLLING_MSG,
845     MAPI_CMD_CEC_MSG_ACTIVE_SOURCE,
846     MAPI_CMD_CEC_MSG_ROUTING_CHANGE,
847     MAPI_CMD_CEC_MSG_REQ_ACTIVE_SOURCE,
848     MAPI_CMD_CEC_MSG_SET_STREAM_PATH,
849     MAPI_CMD_CEC_MSG_STANDBY,
850     MAPI_CMD_CEC_MSG_RECORD_OFF,
851     MAPI_CMD_CEC_MSG_RECORD_ON,
852     MAPI_CMD_CEC_MSG_REPORT_CEC_VERSION,
853     MAPI_CMD_CEC_MSG_REQ_CEC_VERSION,
854     MAPI_CMD_CEC_MSG_REPORT_PHYCAL_ADDRESS,
855     MAPI_CMD_CEC_MSG_REQ_PHYCAL_ADDRESS,
856     MAPI_CMD_CEC_MSG_DECK_CONTROL,
857     MAPI_CMD_CEC_MSG_DEC_STATUS,
858     MAPI_CMD_CEC_MSG_GIVE_DECK_STATUS,
859     MAPI_CMD_CEC_MSG_DC_PLAY,
860     MAPI_CMD_CEC_MSG_REQ_MENU_STATUS,
861     MAPI_CMD_CEC_MSG_USER_CTRL_PRESSED,
862     MAPI_CMD_CEC_MSG_USER_CTRL_RELEASED,
863     MAPI_CMD_CEC_MSG_GIVE_AUDIO_STATUS,
864     MAPI_CMD_CEC_MSG_REPORT_POWER_STATUS,
865     MAPI_CMD_CEC_MSG_REQ_POWER_STATUS,
866     MAPI_CMD_CEC_MSG_FEATURE_ABORT,
867     MAPI_CMD_CEC_MSG_ABORT,
868     MAPI_CMD_CEC_MSG_SEND_MENU_LANGUAGE,
869     MAPI_CMD_CEC_MSG_REQ_ARC_INITIATION,
870     MAPI_CMD_CEC_MSG_REQ_ARC_TERMINATION,
871     MAPI_CMD_CEC_MSG_AUDIO_MODE_REQ,
872     MAPI_CMD_CEC_MSG_REPORT_PHYCAL_ADDRESS2,
873     MAPI_CMD_CEC_CHECK_FRAME,
874     MAPI_CMD_CEC_CONFIG_WAKEUP,
875     MAPI_CMD_CEC_ENABLED,
876     MAPI_CMD_CEC_GET_TX_STATUS,
877     MAPI_CMD_CEC_SET_POWER_STATE,
878     MAPI_CMD_CEC_SET_MY_LOGICAL_ADDRESS2,
879     MAPI_CMD_CEC_GET_HEADER,  // API TO DRV
880     MAPI_CMD_CEC_GET_OPCODE,
881     MAPI_CMD_CEC_GET_PARA,
882     MAPI_CMD_CEC_GET_CMD_LEN,
883     MAPI_CMD_CEC_IS_RX_BUF_EMPTY,
884     MAPI_CMD_CEC_SET_ACTIVE_LOGICAL_ADDRESS,
885     MAPI_CMD_CEC_GET_ACTIVE_LOGICAL_ADDRESS,
886     MAPI_CMD_CEC_GET_POWER_STATUS,
887     MAPI_CMD_CEC_GET_FIFO_IDX,
888     MAPI_CMD_CEC_SET_FIFO_IDX,
889     MAPI_CMD_CEC_SET_ACTIVE_POWER_STATUS,
890     MAPI_CMD_CEC_GET_ACTIVE_POWER_STATUS,
891     MAPI_CMD_CEC_SET_ACTIVE_PHYSICAL_ADDRESS,
892     MAPI_CMD_CEC_SET_ACTIVE_DEVICE_CEC_VERSION,
893     MAPI_CMD_CEC_SET_ACTIVE_DEVICE_TYPE,
894     MAPI_CMD_CEC_GET_MSG_CNT,
895     MAPI_CMD_CEC_SET_MSG_CNT,
896     MAPI_CMD_CEC_GET_RX_DATA,
897     MAPI_CMD_CEC_SET_MY_PHYSICAL_ADDRESS,
898     MAPI_CMD_CEC_SET_MY_PHYSICAL_ADDRESS2,
899     MAPI_CMD_CEC_SET_INITIATOR,
900     MAPI_CMD_CEC_CHECK_DEVICE_IS_TX,
901     MAPI_CMD_CEC_CONFIG_WAKEUP_INFO_VENDOR_ID,
902     MAPI_CMD_CEC_SET_RETRY_COUNT,
903     MAPI_CMD_CEC_ATTACH_DRIVER_ISR,
904     MAPI_CMD_CEC_GET_CONFIGURATION,
905 }E_CEC_API_CMD_TYPE;
906 
907 typedef struct
908 {
909     MS_U32 u32XTAL_CLK_Hz;
910 }MS_CEC_INIT_INFO;
911 
912 typedef struct DLL_PACKED
913 {
914     MS_CEC_INFO_LIST *eInfo;
915     MS_BOOL bGetInfo;
916 } stCEC_DDC2BI_GET_INFO, *pstCEC_DDC2BI_GET_INFO;
917 
918 typedef struct
919 {
920     MS_U32 u32XTAL_CLK_Hz;
921 } stCEC_INIT_CHIP, *pstCEC_INIT_CHIP;
922 
923 typedef struct
924 {
925     MsCEC_INPUT_PORT InputPort;
926 } stCEC_PORT_SELECT, *pstCEC_PORT_SELECT;
927 
928 typedef struct
929 {
930     MsCEC_DEVICELA myLA;
931 } stCEC_SET_MY_LOGICAL_ADDRESS, *pstCEC_SET_MY_LOGICAL_ADDRESS;
932 
933 typedef struct
934 {
935     MS_U32 u32XTAL_CLK_Hz;
936 } stCEC_INIT, *pstCEC_INIT;
937 
938 typedef struct
939 {
940     MsCEC_DEVICELA eNextDeviceLA;
941 } stCEC_NEXT_DEVICE, *pstCEC_NEXT_DEVICE;
942 
943 typedef struct DLL_PACKED
944 {
945     MsCEC_DEVICELA eDetAddr;
946     MsCEC_MSGLIST eMsg;
947     MS_U8 *ucCmd;
948     MS_U8 ucLen;
949     CEC_ERROR_CODE eErrorCode;
950 } stCEC_TX_SEND_MSG, *pstCEC_TX_SEND_MSG;
951 
952 typedef struct DLL_PACKED
953 {
954     MsCEC_DEVICELA eDetAddr;
955     MsCEC_MSGLIST eMsg;
956     MS_U8 *ucCmd;
957     MS_U8 ucLen;
958     CEC_ERROR_CODE eErrorCode;
959 } stCEC_TX_SEND_MSG2, *pstCEC_TX_SEND_MSG2;
960 
961 typedef struct
962 {
963     MsCEC_DEVICELA eDetAddr;
964     CEC_ERROR_CODE eErrorCode;
965 } stCEC_TX_SEND_POLLING_MSG, *pstCEC_TX_SEND_POLLING_MSG;
966 
967 typedef struct
968 {
969     CEC_ERROR_CODE eErrorCode;
970 } stCEC_MSG_ACTIVE_SOURCE, *pstCEC_MSG_ACTIVE_SOURCE;
971 
972 typedef struct DLL_PACKED
973 {
974     MS_U8 *ucOrigAddr;
975     MS_U8 *ucNewAddr;
976     CEC_ERROR_CODE eErrorCode;
977 } stCEC_MSG_ROUTING_CHANGE, *pstCEC_MSG_ROUTING_CHANGE;
978 
979 typedef struct
980 {
981     CEC_ERROR_CODE eErrorCode;
982 } stCEC_MSG_REQ_ACTIVE_SOURCE, *pstCEC_MSG_REQ_ACTIVE_SOURCE;
983 
984 typedef struct DLL_PACKED
985 {
986     MS_U8 *ucNewAddr;
987     CEC_ERROR_CODE eErrorCode;
988 } stCEC_MSG_SET_STREAM_PATH, *pstCEC_MSG_SET_STREAM_PATH;
989 
990 typedef struct
991 {
992     MsCEC_DEVICELA eDetAddr;
993     CEC_ERROR_CODE eErrorCode;
994 } stCEC_MSG_STANDBY, *pstCEC_MSG_STANDBY;
995 
996 typedef struct
997 {
998     MsCEC_DEVICELA eDetAddr;
999     CEC_ERROR_CODE eErrorCode;
1000 } stCEC_MSG_RECORD_OFF, *pstCEC_MSG_RECORD_OFF;
1001 
1002 typedef struct
1003 {
1004     MsCEC_DEVICELA eDetAddr;
1005     MsCEC_MSG_RECORD_SOURCE_TYPE eCmd;
1006     CEC_ERROR_CODE eErrorCode;
1007 } stCEC_MSG_RECORD_ON, *pstCEC_MSG_RECORD_ON;
1008 
1009 typedef struct
1010 {
1011     MsCEC_DEVICELA eDetAddr;
1012     MS_U8 ucVersion;
1013     CEC_ERROR_CODE eErrorCode;
1014 } stCEC_MSG_REPORT_CEC_VERSION, *pstCEC_MSG_REPORT_CEC_VERSION;
1015 
1016 typedef struct
1017 {
1018     MsCEC_DEVICELA eDetAddr;
1019     CEC_ERROR_CODE eErrorCode;
1020 } stCEC_MSG_REQ_CEC_VERSION, *pstCEC_MSG_REQ_CEC_VERSION;
1021 
1022 typedef struct
1023 {
1024     CEC_ERROR_CODE eErrorCode;
1025 } stCEC_MSG_REPORT_PHYCAL_ADDRESS, *pstCEC_MSG_REPORT_PHYCAL_ADDRESS;
1026 
1027 typedef struct
1028 {
1029     MsCEC_DEVICELA eDetAddr;
1030     CEC_ERROR_CODE eErrorCode;
1031 } stCEC_MSG_REQ_PHYCAL_ADDRESS, *pstCEC_MSG_REQ_PHYCAL_ADDRESS;
1032 
1033 typedef struct
1034 {
1035     MsCEC_DEVICELA eDetAddr;
1036     MsCEC_MSG_DC_DECK_CTRL_PARM eCmd;
1037     CEC_ERROR_CODE eErrorCode;
1038 } stCEC_MSG_DECK_CONTROL, *pstCEC_MSG_DECK_CONTROL;
1039 
1040 typedef struct
1041 {
1042     MsCEC_DEVICELA eDetAddr;
1043     MsCEC_MSG_DC_DECK_STATUS_PARM eCmd;
1044     CEC_ERROR_CODE eErrorCode;
1045 } stCEC_MSG_DEC_STATUS, *pstCEC_MSG_DEC_STATUS;
1046 
1047 typedef struct
1048 {
1049     MsCEC_DEVICELA eDetAddr;
1050     MsCEC_MSG_STATUS_REQUEST_PARM eCmd;
1051     CEC_ERROR_CODE eErrorCode;
1052 } stCEC_MSG_GIVE_DECK_STATUS, *pstCEC_MSG_GIVE_DECK_STATUS;
1053 
1054 typedef struct
1055 {
1056     MsCEC_DEVICELA eDetAddr;
1057     MsCEC_MSG_DC_PLAY_PARM eCmd;
1058     CEC_ERROR_CODE eErrorCode;
1059 } stCEC_MSG_DC_PLAY, *pstCEC_MSG_DC_PLAY;
1060 
1061 typedef struct
1062 {
1063     MsCEC_DEVICELA eDetAddr;
1064     MsCEC_MSG_MENU_REQ_TYPE eCmd;
1065     CEC_ERROR_CODE eErrorCode;
1066 } stCEC_MSG_REQ_MENU_STATUS, *pstCEC_MSG_REQ_MENU_STATUS;
1067 
1068 typedef struct
1069 {
1070     MS_BOOL bUserCtrlEn;
1071     MsCEC_DEVICELA eDetAddr;
1072     MsCEC_MSG_USER_CTRL_PARM eCmd;
1073     CEC_ERROR_CODE eErrorCode;
1074 } stCEC_MSG_USER_CTRL_PRESSED, *pstCEC_MSG_USER_CTRL_PRESSED;
1075 
1076 typedef struct
1077 {
1078     MsCEC_DEVICELA eDetAddr;
1079     CEC_ERROR_CODE eErrorCode;
1080 } stCEC_MSG_USER_CTRL_RELEASED, *pstCEC_MSG_USER_CTRL_RELEASED;
1081 
1082 typedef struct
1083 {
1084     MsCEC_DEVICELA eDetAddr;
1085     CEC_ERROR_CODE eErrorCode;
1086 } stCEC_MSG_GIVE_AUDIO_STATUS, *pstCEC_MSG_GIVE_AUDIO_STATUS;
1087 
1088 typedef struct
1089 {
1090     MsCEC_DEVICELA eDetAddr;
1091     CEC_ERROR_CODE eErrorCode;
1092 } stCEC_MSG_REPORT_POWER_STATUS, *pstCEC_MSG_REPORT_POWER_STATUS;
1093 
1094 typedef struct
1095 {
1096     MsCEC_DEVICELA eDetAddr;
1097     CEC_ERROR_CODE eErrorCode;
1098 } stCEC_MSG_REQ_POWER_STATUS, *pstCEC_MSG_REQ_POWER_STATUS;
1099 
1100 typedef struct
1101 {
1102     MsCEC_DEVICELA eDetAddr;
1103     MsCEC_MSGLIST eMsg;
1104     MsCEC_MSG_ABORT_REASON eCmd;
1105     CEC_ERROR_CODE eErrorCode;
1106 } stCEC_MSG_FEATURE_ABORT, *pstCEC_MSG_FEATURE_ABORT;
1107 
1108 typedef struct
1109 {
1110     MsCEC_DEVICELA eDetAddr;
1111     MsCEC_MSGLIST eMsg;
1112     MsCEC_MSG_ABORT_REASON eCmd;
1113     CEC_ERROR_CODE eErrorCode;
1114 } stCEC_MSG_ABORT, *pstCEC_MSG_ABORT;
1115 
1116 typedef struct DLL_PACKED
1117 {
1118     MS_U8 *pu8MenulanguageCode;
1119     CEC_ERROR_CODE eErrorCode;
1120 } stCEC_MSG_SEND_MENU_LANGUAGE, *pstCEC_MSG_SEND_MENU_LANGUAGE;
1121 
1122 typedef struct
1123 {
1124     MsCEC_DEVICELA eDetAddr;
1125     CEC_ERROR_CODE eErrorCode;
1126 } stCEC_MSG_REQ_ARC_INITIATION, *pstCEC_MSG_REQ_ARC_INITIATION;
1127 
1128 typedef struct
1129 {
1130     MsCEC_DEVICELA eDetAddr;
1131     CEC_ERROR_CODE eErrorCode;
1132 } stCEC_MSG_REQ_ARC_TERMINATION, *pstCEC_MSG_REQ_ARC_TERMINATION;
1133 
1134 typedef struct DLL_PACKED
1135 {
1136     MsCEC_DEVICELA eDetAddr;
1137     MS_BOOL bAmpSwitch;
1138     MS_U8 *ucMyAddress;
1139     CEC_ERROR_CODE eErrorCode;
1140 } stCEC_MSG_AUDIO_MODE_REQ, *pstCEC_MSG_AUDIO_MODE_REQ;
1141 
1142 typedef struct
1143 {
1144     CEC_ERROR_CODE eErrorCode;
1145 } stCEC_MSG_REPORT_PHYCAL_ADDRESS2, *pstCEC_MSG_REPORT_PHYCAL_ADDRESS2;
1146 
1147 typedef struct
1148 {
1149     MsCEC_MSG_TRANS_TYPE eMsgType;
1150     MS_U8 ucLen;
1151     MS_BOOL bValid;
1152 } stCEC_CHECK_FRAME, *pstCEC_CHECK_FRAME;
1153 
1154 typedef struct
1155 {
1156     MS_BOOL bEnableFlag;
1157 } stCEC_ENABLED, *pstCEC_ENABLED;
1158 
1159 typedef struct
1160 {
1161     MS_U8 ucTxStatus;
1162 } stCEC_GET_TX_STATUS, *pstCEC_GET_TX_STATUS;
1163 
1164 typedef struct
1165 {
1166     MS_BOOL bIsTx;
1167 } stCEC_DEVICE_IS_TX, *pstCEC_DEVICE_IS_TX;
1168 
1169 typedef struct
1170 {
1171     EN_POWER_MODE ePowerState;
1172     MS_U32 u32Status;
1173 } stCEC_SET_POWER_STATE, *pstCEC_SET_POWER_STATE;
1174 
1175 typedef struct
1176 {
1177     MsCEC_DEVICELA myLA;
1178 } stCEC_SET_MY_LOGICAL_ADDRESS2, *pstCEC_SET_MY_LOGICAL_ADDRESS2;
1179 
1180 // API TO DRV
1181 typedef struct
1182 {
1183     MS_U8 ucValue;
1184 } stCEC_GET_HEADER, *pstCEC_GET_HEADER;
1185 
1186 typedef struct
1187 {
1188     MS_U8 ucValue;
1189 } stCEC_GET_OPCODE, *pstCEC_GET_OPCODE;
1190 
1191 typedef struct
1192 {
1193     MS_U8 ucIdx;
1194     MS_U8 ucValue;
1195 } stCEC_GET_PARA, *pstCEC_GET_PARA;
1196 
1197 typedef struct
1198 {
1199     MS_U8 ucValue;
1200 } stCEC_GET_CMD_LEN, *pstCEC_GET_CMD_LEN;
1201 
1202 typedef struct
1203 {
1204     MS_BOOL bEmpty;
1205 } stCEC_IS_RX_BUF_EMPTY, *pstCEC_IS_RX_BUF_EMPTY;
1206 
1207 typedef struct
1208 {
1209     MsCEC_DEVICELA eAddr;
1210 } stCEC_SET_ACTIVE_LOGICAL_ADDRESS, *pstCEC_SET_ACTIVE_LOGICAL_ADDRESS;
1211 
1212 typedef struct
1213 {
1214     MsCEC_DEVICELA eAddr;
1215 } stCEC_GET_ACTIVE_LOGICAL_ADDRESS, *pstCEC_GET_ACTIVE_LOGICAL_ADDRESS;
1216 
1217 typedef struct
1218 {
1219     MsCEC_MSG_POWER_STATUS_PARM ePowerStatus;
1220 } stCEC_GET_POWER_STATUS, *pstCEC_GET_POWER_STATUS;
1221 
1222 typedef struct
1223 {
1224     MS_U8 ucFifoIdx;
1225 } stCEC_GET_FIFO_IDX, *pstCEC_GET_FIFO_IDX;
1226 
1227 typedef struct
1228 {
1229     MS_U8 ucIdx;
1230 } stCEC_SET_FIFO_IDX, *pstCEC_SET_FIFO_IDX;
1231 
1232 typedef struct
1233 {
1234     MsCEC_MSG_POWER_STATUS_PARM eStatus;
1235 } stCEC_SET_ACTIVE_POWER_STATUS, *pstCEC_SET_ACTIVE_POWER_STATUS;
1236 
1237 typedef struct
1238 {
1239     MsCEC_MSG_POWER_STATUS_PARM ePowerStatus;
1240 } stCEC_GET_ACTIVE_POWER_STATUS, *pstCEC_GET_ACTIVE_POWER_STATUS;
1241 
1242 typedef struct
1243 {
1244     MS_U8 ucPara1;
1245     MS_U8 ucPara2;
1246 } stCEC_SET_ACTIVE_PHYSICAL_ADDRESS, *pstCEC_SET_ACTIVE_PHYSICAL_ADDRESS;
1247 
1248 typedef struct
1249 {
1250     MS_U8 ucVer;
1251 } stCEC_SET_ACTIVE_DEVICE_CEC_VERSION, *pstCEC_SET_ACTIVE_DEVICE_CEC_VERSION;
1252 
1253 typedef struct
1254 {
1255     MsCEC_DEVICE_TYPE eType;
1256 } stCEC_SET_ACTIVE_DEVICE_TYPE, *pstCEC_SET_ACTIVE_DEVICE_TYPE;
1257 
1258 typedef struct
1259 {
1260     MS_U8 ucMsgCnt;
1261 } stCEC_GET_MSG_CNT, *pstCEC_GET_MSG_CNT;
1262 
1263 typedef struct
1264 {
1265     MS_U8 ucCnt;
1266 } stCEC_SET_MSG_CNT, *pstCEC_SET_MSG_CNT;
1267 
1268 typedef struct
1269 {
1270     MS_U8 ucFifoIdx;
1271     MS_U8 ucIdx;
1272     MS_U8 ucRxData;
1273 } stCEC_GET_RX_DATA, *pstCEC_GET_RX_DATA;
1274 
1275 typedef struct DLL_PACKED
1276 {
1277     MS_U8 *ucData;
1278 } stCEC_SET_MY_PHYSICAL_ADDRESS, *pstCEC_SET_MY_PHYSICAL_ADDRESS;
1279 
1280 typedef struct DLL_PACKED
1281 {
1282     MS_U8 *ucData;
1283 } stCEC_SET_MY_PHYSICAL_ADDRESS2, *pstCEC_SET_MY_PHYSICAL_ADDRESS2;
1284 
1285 typedef struct
1286 {
1287     MsCEC_DEVICELA eIniLa;
1288 } stCEC_SET_INITIATOR, *pstCEC_SET_INITIATOR;
1289 
1290 typedef struct DLL_PACKED
1291 {
1292     MS_U8 *ucVendorID;
1293 } stCEC_CONFIG_WAKEUP_INFO_VENDOR_ID, *pstCEC_CONFIG_WAKEUP_INFO_VENDOR_ID;
1294 
1295 typedef struct
1296 {
1297     MS_U8 ucRetryCount;
1298 } stCEC_SET_RETRY_COUNT, *pstCEC_SET_RETRY_COUNT;
1299 
1300 typedef struct
1301 {
1302     MS_BOOL bAttachDrvFlag;
1303 }stCEC_ATTACH_DRIVER_ISR, *pstCEC_ATTACH_DRIVER_ISR;
1304 
1305 typedef struct
1306 {
1307     stCEC_INITIAL_CONFIG_INFO stInitialConfigInfo;
1308 } stCEC_GET_CONFIGURATION, *pstCEC_GET_CONFIGURATION;
1309 
1310 //------------------------------------------------------------------------------------------------
1311 
1312 typedef struct
1313 {
1314     MS_BOOL bIsInitialized;
1315     MS_BOOL bIsRunning;
1316 }MS_CEC_Status;
1317 
1318 //-------------------------------------------------------------------------------------------------
1319 //  Function and Variable
1320 //-------------------------------------------------------------------------------------------------
1321 /**
1322 *   @brief HDMI Status
1323 */
1324 
1325 //-------------------------------------------------------------------------------------------------
1326 /// Assign which HDMI port connect to CEC
1327 /// @ingroup apiCEC_BASIC
1328 /// @param  InputPort          \b IN: CEC connect port
1329 /// @return None
1330 //-------------------------------------------------------------------------------------------------
1331 void SYMBOL_WEAK MApi_CEC_PortSelcet(MsCEC_INPUT_PORT InputPort); // Select CEC bank mapping
1332 
1333 //-------------------------------------------------------------------------------------------------
1334 /// Get version (without Mutex protect)
1335 /// @ingroup apiCEC_BASIC
1336 /// @param  ppVersion          \b IN: version
1337 /// @return TRUE: have version
1338 /// @return FALSE: no version
1339 //-------------------------------------------------------------------------------------------------
1340 MS_BOOL MApi_CEC_GetLibVer(const MSIF_Version **ppVersion);      ///< Get version (without Mutex protect)
1341 
1342 //-------------------------------------------------------------------------------------------------
1343 /// Get cec info
1344 /// @ingroup apiCEC_BASIC
1345 /// @param  pInfo          \b IN: info list
1346 /// @return TRUE: have info list
1347 /// @return FALSE: no info list
1348 //-------------------------------------------------------------------------------------------------
1349 MS_BOOL MApi_DDC2BI_GetInfo(MS_CEC_INFO_LIST *pInfo);
1350 
1351 //-------------------------------------------------------------------------------------------------
1352 /// Get cec status
1353 /// @ingroup apiCEC_BASIC
1354 /// @param  pStatus          \b IN: status
1355 /// @return TRUE: have status
1356 /// @return FALSE: no status
1357 //-------------------------------------------------------------------------------------------------
1358 MS_BOOL MApi_DDC2BI_GetStatus(MS_CEC_Status *pStatus);
1359 
1360 //-------------------------------------------------------------------------------------------------
1361 /// Set debug level
1362 /// @ingroup apiCEC_BASIC
1363 /// @param  u16DbgSwitch          \b IN: switch or not
1364 /// @return TRUE: do switch
1365 /// @return FALSE: no switch
1366 //-------------------------------------------------------------------------------------------------
1367 MS_BOOL MApi_DDC2BI_SetDbgLevel(MS_U16 u16DbgSwitch);
1368 
1369 //-------------------------------------------------------------------------------------------------
1370 /// CEC do not work
1371 /// @ingroup apiCEC_BASIC
1372 /// @return None
1373 //------------------------------------------------------------------------------------------------
1374 void MApi_CEC_Exit(void); // Mask CEC interrupt and release CEC
1375 
1376 //-------------------------------------------------------------------------------------------------
1377 /// CEC initial sequence
1378 /// @ingroup apiCEC_BASIC
1379 /// @param  pCECInfo          \b IN: CEC info
1380 /// @return None
1381 //-------------------------------------------------------------------------------------------------
1382 void MApi_CEC_Init(MS_CEC_INIT_INFO *pCECInfo); // CEC initial sequence
1383 
1384 //-------------------------------------------------------------------------------------------------
1385 /// CEC initial chip relatived part
1386 /// @ingroup apiCEC_BASIC
1387 /// @param  pCECInfo          \b IN: CEC info
1388 /// @return None
1389 //-------------------------------------------------------------------------------------------------
1390 void MApi_CEC_InitChip(MS_CEC_INIT_INFO *pCECInfo); // CEC initial chip relatived part
1391 
1392 //-------------------------------------------------------------------------------------------------
1393 /// CEC set own logical address
1394 /// @ingroup apiCEC_STATUS
1395 /// @param  myLA          \b IN: logical address
1396 /// @return None
1397 //-------------------------------------------------------------------------------------------------
1398 void MApi_CEC_SetMyLogicalAddress(MsCEC_DEVICELA myLA); // CEC set own logical address
1399 
1400 //-------------------------------------------------------------------------------------------------
1401 /// Use to store CEC received messages
1402 /// @ingroup apiCEC_STATUS
1403 /// @return None
1404 //------------------------------------------------------------------------------------------------
1405 void MApi_CEC_ChkRxBuf(void); // Use to store CEC received messages
1406 
1407 //-------------------------------------------------------------------------------------------------
1408 /// Use to send any CEC message by user defined
1409 /// @ingroup apiCEC_STATUS
1410 /// @param  header          \b IN: destination logical address
1411 /// @param  opcode          \b IN: opcode
1412 /// @param  operand_ptr          \b IN: operand
1413 /// @param  len          \b IN: length
1414 /// @return CEC_ERROR_CODE
1415 //-------------------------------------------------------------------------------------------------
1416 CEC_ERROR_CODE MApi_CEC_TxSendMsg(MsCEC_DEVICELA header,MsCEC_MSGLIST opcode,MS_U8* operand_ptr,MS_U8 len);
1417 
1418 //-------------------------------------------------------------------------------------------------
1419 /// Use to send any CEC message by user defined
1420 /// @ingroup apiCEC_ToBeRemove
1421 /// @param  dst_address          \b IN: destination logical address
1422 /// @param  opcode          \b IN: opcode
1423 /// @param  operand_ptr          \b IN: operand
1424 /// @param  len          \b IN: length
1425 /// @return CEC_ERROR_CODE
1426 //-------------------------------------------------------------------------------------------------
1427 CEC_ERROR_CODE MApi_CEC_TxSendMsg2(MsCEC_DEVICELA dst_address, MsCEC_MSGLIST msg, MS_U8* operand_ptr, MS_U8 len);
1428 
1429 //-------------------------------------------------------------------------------------------------
1430 /// Use to send CEC polling msg
1431 /// @ingroup apiCEC_BASIC
1432 /// @param  dst_address       \b IN: destination logical address
1433 /// @return CEC_ERROR_CODE
1434 //-------------------------------------------------------------------------------------------------
1435 CEC_ERROR_CODE MsAPI_CecTxSendPollingMsg(MsCEC_DEVICELA dst_address); // Use to send CEC polling msg
1436 
1437 //*****************************//
1438 //    One Touch Play &
1439 //    Routing Control Feature
1440 //*****************************//
1441 
1442 //-------------------------------------------------------------------------------------------------
1443 /// Used by a new source to indicate that it has started to transmit a stream or used in response to a <Request Active Source>
1444 /// @ingroup apiCEC_Message
1445 /// @return CEC_ERROR_CODE
1446 //-------------------------------------------------------------------------------------------------
1447 CEC_ERROR_CODE MApi_CEC_Msg_ActiveSource(void);
1448 
1449 
1450 //*****************************//
1451 //    Routing Control Feature
1452 //*****************************//
1453 
1454 //-------------------------------------------------------------------------------------------------
1455 /// Used by a CEC switch when it's manually switched to inform akk other devices
1456 /// @ingroup apiCEC_Message
1457 /// @param  orig_address       \b IN: the original physicall address
1458 /// @param  new_address       \b IN: the new physical address
1459 /// @return CEC_ERROR_CODE
1460 //-------------------------------------------------------------------------------------------------
1461 CEC_ERROR_CODE MApi_CEC_Msg_RoutingChange(MS_U8* orig_address, MS_U8* new_address);
1462 
1463 //-------------------------------------------------------------------------------------------------
1464 /// Used by a new device to discover the status of the system.
1465 /// @ingroup apiCEC_Message
1466 /// @return CEC_ERROR_CODE
1467 //-------------------------------------------------------------------------------------------------
1468 CEC_ERROR_CODE MApi_CEC_Msg_ReqActiveSource(void);
1469 
1470 //-------------------------------------------------------------------------------------------------
1471 /// Used by the TV to request a streaming path from the specified physical address.
1472 /// @ingroup apiCEC_Message
1473 /// @param  new_address       \b IN: the new physical address
1474 /// @return CEC_ERROR_CODE
1475 //-------------------------------------------------------------------------------------------------
1476 CEC_ERROR_CODE MApi_CEC_Msg_SetStreamPath(MS_U8* new_address);
1477 
1478 
1479 //*****************************//
1480 //    Standby Feature
1481 //*****************************//
1482 
1483 //-------------------------------------------------------------------------------------------------
1484 /// Use to switch one or all devices into standby mode.
1485 /// One device: it's specific logical address, like "E_LA_RECORDER1"
1486 /// All device:   Use broadcast logical address, "E_LA_BROADCAST"
1487 /// @ingroup apiCEC_Message
1488 /// @param  dst_address       \b IN: destination logical address
1489 /// @return CEC_ERROR_CODE
1490 //-------------------------------------------------------------------------------------------------
1491 CEC_ERROR_CODE MApi_CEC_Msg_Standby(MsCEC_DEVICELA dst_address);
1492 
1493 
1494 //*****************************//
1495 //    On Touch Record
1496 //*****************************//
1497 
1498 //-------------------------------------------------------------------------------------------------
1499 /// Requests a device to stop a recording.
1500 /// @ingroup apiCEC_Message
1501 /// @param  dst_address       \b IN: destination logical address
1502 /// @return CEC_ERROR_CODE
1503 //-------------------------------------------------------------------------------------------------
1504 CEC_ERROR_CODE MApi_CEC_Msg_RecordOff(MsCEC_DEVICELA dst_address);
1505 
1506 //-------------------------------------------------------------------------------------------------
1507 /// Attempt to record the specified source.
1508 /// @ingroup apiCEC_Message
1509 /// @param  dst_address       \b IN: destination logical address
1510 /// @param  cmd       \b IN: record source command
1511 /// @return CEC_ERROR_CODE
1512 //-------------------------------------------------------------------------------------------------
1513 CEC_ERROR_CODE MsAPI_CEC_Msg_RecordOn(MsCEC_DEVICELA dst_address, MsCEC_MSG_RECORD_SOURCE_TYPE cmd);
1514 
1515 
1516 //*****************************//
1517 //    System Information Feature
1518 //*****************************//
1519 
1520 //-------------------------------------------------------------------------------------------------
1521 /// Used to indicate the supported CEC version, in response to a <Get CEC Version>
1522 /// @ingroup apiCEC_Message
1523 /// @param  dst_address       \b IN: destination logical address
1524 /// @param  version       \b IN: cec version
1525 /// @return CEC_ERROR_CODE
1526 //-------------------------------------------------------------------------------------------------
1527 CEC_ERROR_CODE MApi_CEC_Msg_ReportCECVersion(MsCEC_DEVICELA dst_address, MS_U8 version);
1528 
1529 //-------------------------------------------------------------------------------------------------
1530 /// Used by a device to enquire which version of CEC the target supports
1531 /// @ingroup apiCEC_Message
1532 /// @param  dst_address       \b IN: destination logical address
1533 /// @return CEC_ERROR_CODE
1534 //-------------------------------------------------------------------------------------------------
1535 CEC_ERROR_CODE MApi_CEC_Msg_ReqCECVersion(MsCEC_DEVICELA dst_address);
1536 
1537 //-------------------------------------------------------------------------------------------------
1538 ///  Use to inform all other devices of the mapping between physical and logical address of the initiator
1539 /// @ingroup apiCEC_Message
1540 /// @return CEC_ERROR_CODE
1541 //-------------------------------------------------------------------------------------------------
1542 CEC_ERROR_CODE MApi_CEC_Msg_ReportPhycalAddress(void);
1543 
1544 //-------------------------------------------------------------------------------------------------
1545 /// A request to a device to return its physical address
1546 /// @ingroup apiCEC_Message
1547 /// @param  dst_address       \b IN: destination logical address
1548 /// @return CEC_ERROR_CODE
1549 //-------------------------------------------------------------------------------------------------
1550 CEC_ERROR_CODE MApi_CEC_Msg_ReqPhycalAddress(MsCEC_DEVICELA dst_address);
1551 
1552 
1553 //*****************************//
1554 //    Deck Control Feature
1555 //*****************************//
1556 
1557 //-------------------------------------------------------------------------------------------------
1558 ///  Use to control a device's media functions
1559 /// @ingroup apiCEC_Message
1560 /// @param  dst_address       \b IN: destination logical address
1561 /// @param  cmd       \b IN: deck control mode command
1562 /// @return CEC_ERROR_CODE
1563 //-------------------------------------------------------------------------------------------------
1564 CEC_ERROR_CODE MApi_CEC_Msg_DeckControl(MsCEC_DEVICELA dst_address, MsCEC_MSG_DC_DECK_CTRL_PARM cmd);
1565 
1566 //-------------------------------------------------------------------------------------------------
1567 ///  Use to provide a device's status when received "Give Deck Status"
1568 /// @ingroup apiCEC_Message
1569 /// @param  dst_address       \b IN: destination logical address
1570 /// @param  cmd       \b IN: deck info command
1571 /// @return CEC_ERROR_CODE
1572 //-------------------------------------------------------------------------------------------------
1573 CEC_ERROR_CODE MApi_CEC_Msg_DecStatus(MsCEC_DEVICELA dst_address, MsCEC_MSG_DC_DECK_STATUS_PARM cmd);
1574 
1575 //-------------------------------------------------------------------------------------------------
1576 ///  Use to request device's status
1577 /// @ingroup apiCEC_Message
1578 /// @param  dst_address       \b IN: destination logical address
1579 /// @param  cmd       \b IN: status request command
1580 /// @return CEC_ERROR_CODE
1581 //-------------------------------------------------------------------------------------------------
1582 CEC_ERROR_CODE MApi_CEC_MSg_GiveDeckStatus(MsCEC_DEVICELA dst_address, MsCEC_MSG_STATUS_REQUEST_PARM cmd);
1583 
1584 //-------------------------------------------------------------------------------------------------
1585 ///  Use to control the playback behaviour of a source device
1586 /// @ingroup apiCEC_Message
1587 /// @param  dst_address       \b IN: destination logical address
1588 /// @param  cmd       \b IN: play mode command
1589 /// @return CEC_ERROR_CODE
1590 //-------------------------------------------------------------------------------------------------
1591 CEC_ERROR_CODE MApi_CEC_MSg_DCPlay(MsCEC_DEVICELA dst_address, MsCEC_MSG_DC_PLAY_PARM cmd);
1592 
1593 
1594 //*****************************//
1595 //    Device Menu Control &
1596 //    Remote Control Passthrough Feature
1597 //*****************************//
1598 
1599 //-------------------------------------------------------------------------------------------------
1600 ///  Request from TV for a device to show/remove a menu or to query status
1601 /// @ingroup apiCEC_Message
1602 /// @param  dst_address       \b IN: destination logical address
1603 /// @param  cmd       \b IN: menu request type command
1604 /// @return CEC_ERROR_CODE
1605 //-------------------------------------------------------------------------------------------------
1606 CEC_ERROR_CODE MApi_CEC_Msg_ReqMenuStatus(MsCEC_DEVICELA dst_address, MsCEC_MSG_MENU_REQ_TYPE cmd);
1607 
1608 //-------------------------------------------------------------------------------------------------
1609 /// Use to indicated that user pressed which control button
1610 /// @ingroup apiCEC_Message
1611 /// @param  bUserCtrlEn       \b IN: menu status is activated or not
1612 /// @param  dst_address       \b IN: destination logical address
1613 /// @param  cmd       \b IN: UI command
1614 /// @return CEC_ERROR_CODE
1615 //-------------------------------------------------------------------------------------------------
1616 CEC_ERROR_CODE MApi_CEC_Msg_UserCtrlPressed(MS_BOOL bUserCtrlEn, MsCEC_DEVICELA dst_address, MsCEC_MSG_USER_CTRL_PARM cmd);
1617 
1618 //-------------------------------------------------------------------------------------------------
1619 /// Use to indicated that user released which control button
1620 /// @ingroup apiCEC_Message
1621 /// @param  dst_address       \b IN: destination logical address
1622 /// @return CEC_ERROR_CODE
1623 //-------------------------------------------------------------------------------------------------
1624 CEC_ERROR_CODE MApi_CEC_Msg_UserCtrlReleased(MsCEC_DEVICELA dst_address);
1625 
1626 
1627 //*****************************//
1628 //    Power Status Feature
1629 //*****************************//
1630 
1631 //-------------------------------------------------------------------------------------------------
1632 /// Use to inform a requesting device of the current power status
1633 /// @ingroup apiCEC_Message
1634 /// @param  dst_address       \b IN: destination logical address
1635 /// @return CEC_ERROR_CODE
1636 //-------------------------------------------------------------------------------------------------
1637 CEC_ERROR_CODE MApi_CEC_Msg_ReportPowerStatus(MsCEC_DEVICELA dst_address);
1638 
1639 //-------------------------------------------------------------------------------------------------
1640 /// Use to determine the current power status of a target device
1641 /// @ingroup apiCEC_Message
1642 /// @param  dst_address       \b IN: destination logical address
1643 /// @return CEC_ERROR_CODE
1644 //-------------------------------------------------------------------------------------------------
1645 CEC_ERROR_CODE MApi_CEC_Msg_ReqPowerStatus(MsCEC_DEVICELA dst_address);
1646 
1647 //*****************************//
1648 //    General Protocol Feature
1649 //*****************************//
1650 
1651 //-------------------------------------------------------------------------------------------------
1652 /// Use to indicate that device doesn't support message type
1653 /// @ingroup apiCEC_Message
1654 /// @param  dst_address       \b IN: destination logical address
1655 /// @param  msg       \b IN: feature opcode
1656 /// @param  cmd       \b IN: abort reason
1657 /// @return CEC_ERROR_CODE
1658 //-------------------------------------------------------------------------------------------------
1659 CEC_ERROR_CODE MApi_CEC_Msg_FeatureAbort(MsCEC_DEVICELA dst_address, MsCEC_MSGLIST msg, MsCEC_MSG_ABORT_REASON cmd);
1660 
1661 //-------------------------------------------------------------------------------------------------
1662 /// This message is reserved for testing purposes.
1663 /// @ingroup apiCEC_Message
1664 /// @param  dst_address       \b IN: destination logical address
1665 /// @return CEC_ERROR_CODE
1666 //-------------------------------------------------------------------------------------------------
1667 CEC_ERROR_CODE MApi_CEC_Msg_Abort(MsCEC_DEVICELA dst_address);
1668 
1669 //-------------------------------------------------------------------------------------------------
1670 /// Used by a TV to indicate its currently selected menu language
1671 /// @ingroup apiCEC_Message
1672 /// @param  pu8MenuLanguageCode       \b IN: menu language code
1673 /// @return CEC_ERROR_CODE
1674 //-------------------------------------------------------------------------------------------------
1675 CEC_ERROR_CODE MApi_CEC_Msg_SendMenuLanguage(MS_U8* pu8MenuLanguageCode);
1676 
1677 //-------------------------------------------------------------------------------------------------
1678 /// Used by an ARC TX device to request an ARC RX device to activate the ARC functionility in ARC TX device
1679 /// @ingroup apiCEC_Message
1680 /// @param  dst_address       \b IN: destination logical address
1681 /// @return CEC_ERROR_CODE
1682 //-------------------------------------------------------------------------------------------------
1683 CEC_ERROR_CODE MsAPI_CecMsg_ReqARCInitiation(MsCEC_DEVICELA dst_address);
1684 
1685 //-------------------------------------------------------------------------------------------------
1686 /// Used by an ARC TX device to request an ARC RX device to deactivate the ARC functionility in ARC TX device
1687 /// @ingroup apiCEC_Message
1688 /// @param  dst_address       \b IN: destination logical address
1689 /// @return CEC_ERROR_CODE
1690 //-------------------------------------------------------------------------------------------------
1691 CEC_ERROR_CODE MsAPI_CecMsg_ReqARCTermination(MsCEC_DEVICELA dst_address);
1692 
1693 //-------------------------------------------------------------------------------------------------
1694 /// A device implementing System Audio Control and which has volume control  RC buttons request to use System Audio Mode to the Amplifier
1695 /// @ingroup apiCEC_Message
1696 /// @param  dst_address       \b IN: destination logical address
1697 /// @param  amp_switch       \b IN: 1: unmute amplifier. 0: mute amplifier
1698 /// @param  my_address       \b IN: source to be used is the device specified at this address
1699 /// @return CEC_ERROR_CODE
1700 //-------------------------------------------------------------------------------------------------
1701 CEC_ERROR_CODE MsAPI_CecMsg_AudioModeReq(MsCEC_DEVICELA dst_address, MS_BOOL amp_switch, MS_U8* my_address );
1702 
1703 //-------------------------------------------------------------------------------------------------
1704 /// Use to request an Amplifier to send its volume and mute status
1705 /// @ingroup apiCEC_Message
1706 /// @param  dst_address       \b IN: destination logical address
1707 /// @return CEC_ERROR_CODE
1708 //-------------------------------------------------------------------------------------------------
1709 CEC_ERROR_CODE MApi_CEC_Msg_GiveAudioStatus(MsCEC_DEVICELA dst_address);
1710 
1711 //-------------------------------------------------------------------------------------------------
1712 /// Get RX header
1713 /// @ingroup apiCEC_STATUS
1714 /// @return header
1715 //-------------------------------------------------------------------------------------------------
1716 MS_U8 MApi_CEC_Get_Header(void);
1717 
1718 //-------------------------------------------------------------------------------------------------
1719 /// Get RX opcode
1720 /// @ingroup apiCEC_STATUS
1721 /// @return opcode
1722 //-------------------------------------------------------------------------------------------------
1723 MS_U8 MApi_CEC_Get_OpCode(void);
1724 
1725 //-------------------------------------------------------------------------------------------------
1726 /// Get RX parameter
1727 /// @ingroup apiCEC_STATUS
1728 /// @param  u8Idx       \b IN: parameter index
1729 /// @return parameter
1730 //-------------------------------------------------------------------------------------------------
1731 MS_U8 MApi_CEC_Get_Para(MS_U8 u8Idx);
1732 
1733 //-------------------------------------------------------------------------------------------------
1734 /// Get RX command length
1735 /// @ingroup apiCEC_STATUS
1736 /// @return comand length
1737 //-------------------------------------------------------------------------------------------------
1738 MS_U8 MApi_CEC_GetCmdLen(void);
1739 
1740 //-------------------------------------------------------------------------------------------------
1741 /// Set active logical address
1742 /// @ingroup apiCEC_STATUS
1743 /// @param  Addr       \b IN: logical address
1744 /// @return None
1745 //-------------------------------------------------------------------------------------------------
1746 void MApi_CEC_SetActiveLogicalAddress(MsCEC_DEVICELA Addr);
1747 
1748 //-------------------------------------------------------------------------------------------------
1749 /// Get active logical address
1750 /// @ingroup apiCEC_STATUS
1751 /// @return logical address
1752 //-------------------------------------------------------------------------------------------------
1753 MsCEC_DEVICELA MApi_CEC_GetActiveLogicalAddress(void);
1754 
1755 //-------------------------------------------------------------------------------------------------
1756 /// Get power status
1757 /// @ingroup apiCEC_STATUS
1758 /// @return power status
1759 //-------------------------------------------------------------------------------------------------
1760 MsCEC_MSG_POWER_STATUS_PARM MApi_CEC_GetPowerStatus(void);
1761 
1762 //-------------------------------------------------------------------------------------------------
1763 /// Get fifo index
1764 /// @ingroup apiCEC_BASIC
1765 /// @return fifo index
1766 //-------------------------------------------------------------------------------------------------
1767 MS_U8 MApi_CEC_GetFifoIdx(void);
1768 
1769 //-------------------------------------------------------------------------------------------------
1770 /// Set fifo index
1771 /// @ingroup apiCEC_BASIC
1772 /// @param  u8Idx       \b IN: fifo index
1773 /// @return None
1774 //-------------------------------------------------------------------------------------------------
1775 void MApi_CEC_SetFifoIdx(MS_U8 u8Idx);
1776 
1777 //-------------------------------------------------------------------------------------------------
1778 /// Set active power status
1779 /// @ingroup apiCEC_STATUS
1780 /// @param  Status       \b IN: active power status
1781 /// @return None
1782 //-------------------------------------------------------------------------------------------------
1783 void MApi_CEC_SetActivePowerStatus(MsCEC_MSG_POWER_STATUS_PARM Status);
1784 
1785 //-------------------------------------------------------------------------------------------------
1786 /// Get active power status
1787 /// @ingroup apiCEC_STATUS
1788 /// @return power status
1789 //-------------------------------------------------------------------------------------------------
1790 MsCEC_MSG_POWER_STATUS_PARM MApi_CEC_GetActivePowerStatus(void);
1791 
1792 //-------------------------------------------------------------------------------------------------
1793 /// Set active physical address
1794 /// @ingroup apiCEC_STATUS
1795 /// @param  u8Para1       \b IN: physical address lower byte
1796 /// @param  u8Para2       \b IN: physical address higer byte
1797 /// @return None
1798 //-------------------------------------------------------------------------------------------------
1799 void MApi_CEC_SetActivePhysicalAddress(MS_U8 u8Para1, MS_U8 u8Para2);
1800 
1801 //-------------------------------------------------------------------------------------------------
1802 /// Set active device CEC version
1803 /// @ingroup apiCEC_STATUS
1804 /// @param  u8Ver       \b IN: active cec version
1805 /// @return None
1806 //-------------------------------------------------------------------------------------------------
1807 void MApi_CEC_SetActiveDeviceCECVersion(MS_U8 u8Ver);
1808 
1809 //-------------------------------------------------------------------------------------------------
1810 /// Set active device type
1811 /// @ingroup apiCEC_STATUS
1812 /// @param  Type       \b IN: active device type
1813 /// @return None
1814 //-------------------------------------------------------------------------------------------------
1815 void MApi_CEC_SetActiveDeviceType(MsCEC_DEVICE_TYPE Type);
1816 
1817 //-------------------------------------------------------------------------------------------------
1818 /// Get message count
1819 /// @ingroup apiCEC_STATUS
1820 /// @return message count
1821 //-------------------------------------------------------------------------------------------------
1822 MS_U8 MApi_CEC_GetMsgCnt(void);
1823 
1824 //-------------------------------------------------------------------------------------------------
1825 /// Set message count
1826 /// @ingroup apiCEC_STATUS
1827 /// @param  u8Cnt       \b IN: message count
1828 /// @return None
1829 //-------------------------------------------------------------------------------------------------
1830 void MApi_CEC_SetMsgCnt(MS_U8 u8Cnt);
1831 
1832 //-------------------------------------------------------------------------------------------------
1833 /// Get Rx data
1834 /// @ingroup apiCEC_STATUS
1835 /// @param  u8Fifoidx       \b IN: fifo index
1836 /// @param  u8Idx       \b IN: data index
1837 /// @return data
1838 //-------------------------------------------------------------------------------------------------
1839 MS_U8 MApi_CEC_GetRxData(MS_U8 u8Fifoidx, MS_U8 u8Idx);
1840 
1841 //-------------------------------------------------------------------------------------------------
1842 /// Use to check CEC frame is valid or not
1843 /// @ingroup apiCEC_BASIC
1844 /// @param  msg_type       \b IN: CEC message type
1845 /// @param  ucLen       \b IN: message length, include header and opcode
1846 /// @return TRUE: CEC frame is valid
1847 /// @return FALSE: CEC frame is not valid
1848 //-------------------------------------------------------------------------------------------------
1849 MS_BOOL MApi_CEC_CheckFrame(MsCEC_MSG_TRANS_TYPE msg_type, MS_U8 ucLen);
1850 
1851 //-------------------------------------------------------------------------------------------------
1852 /// Use to check exist devices
1853 /// @ingroup apiCEC_BASIC
1854 /// @return None
1855 //-------------------------------------------------------------------------------------------------
1856 void MApi_CEC_CheckExistDevices(void);
1857 
1858 //-------------------------------------------------------------------------------------------------
1859 /// Use to config wake up
1860 /// @ingroup apiCEC_BASIC
1861 /// @return None
1862 //-------------------------------------------------------------------------------------------------
1863 void MApi_CEC_ConfigWakeUp(void);
1864 
1865 //-------------------------------------------------------------------------------------------------
1866 /// Enable CEC
1867 /// @ingroup apiCEC_BASIC
1868 /// @param  bEnableFlag       \b IN: enable CEC or not
1869 /// @return None
1870 //-------------------------------------------------------------------------------------------------
1871 void MApi_CEC_Enabled(MS_BOOL bEnableFlag);
1872 
1873 //-------------------------------------------------------------------------------------------------
1874 /// Set physical address
1875 /// @ingroup apiCEC_STATUS
1876 /// @param  pdata       \b IN: physical address
1877 /// @return None
1878 //-------------------------------------------------------------------------------------------------
1879 void MApi_CEC_SetMyPhysicalAddress(MS_U8 *pdata);
1880 
1881 #if ENABLE_CEC_MULTIPLE
1882 //-------------------------------------------------------------------------------------------------
1883 /// Set second logical address
1884 /// @ingroup apiCEC_SECOND
1885 /// @param  myLA       \b IN: second logical address
1886 /// @return None
1887 //-------------------------------------------------------------------------------------------------
1888 void MApi_CEC_SetMyLogicalAddress2(MsCEC_DEVICELA myLA);
1889 
1890 //-------------------------------------------------------------------------------------------------
1891 /// Report second physical address
1892 /// @ingroup apiCEC_SECOND
1893 /// @return CEC_ERROR_CODE
1894 //-------------------------------------------------------------------------------------------------
1895 CEC_ERROR_CODE MApi_CEC_Msg_ReportPhycalAddress2(void);
1896 
1897 //-------------------------------------------------------------------------------------------------
1898 /// Set second physical address
1899 /// @ingroup apiCEC_SECOND
1900 /// @param  pdata       \b IN: second physical address
1901 /// @return None
1902 //-------------------------------------------------------------------------------------------------
1903 void MApi_CEC_SetMyPhysicalAddress2(MS_U8 *pdata);
1904 
1905 //-------------------------------------------------------------------------------------------------
1906 /// Set initiator logical address
1907 /// @ingroup apiCEC_SECOND
1908 /// @param  IniLA       \b IN: initiator logical address
1909 /// @return None
1910 //-------------------------------------------------------------------------------------------------
1911 void MApi_CEC_SetInitiator(MsCEC_DEVICELA IniLA);
1912 #endif
1913 
1914 //-------------------------------------------------------------------------------------------------
1915 /// Get Tx status
1916 /// @ingroup apiCEC_STATUS
1917 /// @return status
1918 ///[Bit0]: CEC receives a new message.
1919 ///[Bit1]: CEC transmits a message successfully.
1920 ///[Bit2]: CEC retry fail for TX.
1921 ///[Bit3]: CEC lost arbitration to the second initiator.
1922 //-------------------------------------------------------------------------------------------------
1923 MS_U8 MApi_CEC_GetTxStatus(void);
1924 
1925 //-------------------------------------------------------------------------------------------------
1926 /// Set power state
1927 /// @ingroup apiCEC_STATUS
1928 /// @param  u16PowerState       \b IN: power state
1929 /// @return 0: success
1930 /// @return 1: fail
1931 //-------------------------------------------------------------------------------------------------
1932 MS_U32 MApi_CEC_SetPowerState(EN_POWER_MODE u16PowerState);
1933 
1934 //-------------------------------------------------------------------------------------------------
1935 /// Set retry count
1936 /// @ingroup apiCEC_ToBeAdd
1937 /// @param  u8RetryCount       \b IN: retry count
1938 /// @return None
1939 //-------------------------------------------------------------------------------------------------
1940 void MApi_CEC_SetRetryCount(MS_U8 u8RetryCount);
1941 
1942 //-------------------------------------------------------------------------------------------------
1943 /// config wakeup info vendor ID
1944 /// @ingroup apiCEC_ToBeAdd
1945 /// @param  u8CecVendorID       \b IN: vendor ID
1946 /// @return None
1947 //-------------------------------------------------------------------------------------------------
1948 void MApi_CEC_ConfigWakeupInfoVendorID(MS_U8* u8CecVendorID);
1949 
1950 //-------------------------------------------------------------------------------------------------
1951 /// Set logical address to next active device
1952 /// @ingroup apiCEC_ToBeAdd
1953 /// @param  None
1954 /// @return logical address
1955 //-------------------------------------------------------------------------------------------------
1956 MsCEC_DEVICELA MApi_CEC_NextDevice(void);
1957 
1958 //-------------------------------------------------------------------------------------------------
1959 /// Check Rx Buf if empty or not
1960 /// @ingroup apiCEC_ToBeAdd
1961 /// @param  None
1962 /// @return 1: empty
1963 /// @return 0: non empty
1964 //-------------------------------------------------------------------------------------------------
1965 MS_BOOL MApi_CEC_IsRxBufEmpty(void);
1966 
1967 //-------------------------------------------------------------------------------------------------
1968 /// Check divcec is Tx or not
1969 /// @ingroup apiCEC_ToBeAdd
1970 /// @param  None
1971 /// @return 1: Tx
1972 /// @return 0: Rx
1973 //-------------------------------------------------------------------------------------------------
1974 MS_BOOL MApi_CEC_CheckDeviceIsTx(void);
1975 
1976 //-------------------------------------------------------------------------------------------------
1977 /// General API
1978 /// @ingroup apiCEC_ToBeAdd
1979 /// @param  u32Cmd       \b IN: API name
1980 /// @param  pBuf       \b IN: buffer of input and output value
1981 /// @param  u32BufSize       \b IN: buffer size
1982 /// @return TRUE: call API success
1983 /// @return FALSE: call API fail
1984 //-------------------------------------------------------------------------------------------------
1985 MS_BOOL SYMBOL_WEAK MApi_CEC_Ctrl(MS_U32 u32Cmd, void *pBuf, MS_U32 u32BufSize);
1986 
1987 //-------------------------------------------------------------------------------------------------
1988 /// Get CEC init parameter
1989 /// @ingroup apiCEC_BASIC
1990 /// @param  stInitialConfig: Init parameters
1991 /// @return UTOPIA_STATUS_ERR_NOT_AVAIL: CEC not system init
1992 /// @return UTOPIA_STATUS_SUCCESS: CEC system init ready
1993 //-------------------------------------------------------------------------------------------------
1994 MS_U32 SYMBOL_WEAK mapi_CEC_GetConfig(stCEC_INITIAL_CONFIG *stInitialConfig);
1995 
1996 #ifdef __cplusplus
1997 }
1998 #endif
1999 
2000 #endif //_API_CEC_H_
2001 
2002