source: svn/newcon3bcm2_21bu/magnum/portinginterface/hdm/7552/bhdm_cec.h

Last change on this file was 76, checked in by megakiss, 10 years ago

1W 대기전력을 만족시키기 위하여 POWEROFF시 튜너를 Standby 상태로 함

  • Property svn:executable set to *
File size: 15.7 KB
Line 
1/***************************************************************************
2 *     Copyright (c) 2003-2011, Broadcom Corporation
3 *     All Rights Reserved
4 *     Confidential Property of Broadcom Corporation
5 *
6 *  THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE
7 *  AGREEMENT  BETWEEN THE USER AND BROADCOM.  YOU HAVE NO RIGHT TO USE OR
8 *  EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT.
9 *
10 * $brcm_Workfile: bhdm_cec.h $
11 * $brcm_Revision: Hydra_Software_Devel/23 $
12 * $brcm_Date: 11/22/11 6:01p $                                                         
13 *
14 * Module Description:
15 *   See Module Overview below.
16 *
17 * Revision History:
18 *
19 * $brcm_Log: /magnum/portinginterface/hdm/7038/bhdm_cec.h $
20 *
21 * Hydra_Software_Devel/23   11/22/11 6:01p vle
22 * SW7425-1140: Merge to mainline.  Remove all CEC functionality out of
23 * HDM PI.
24 *
25 * Hydra_Software_Devel/SW7425-1140/2   11/22/11 5:47p vle
26 * SW7425-1140: Add BHDM_CONFIG_CEC_LEGACY_SUPPORT for backward compatible
27 * for CEC legacy platforms.
28 *
29 * Hydra_Software_Devel/SW7425-1140/1   11/16/11 12:16p vle
30 * SW7425-1140: Remove all CEC functionalities out of HDM PI
31 *
32 * Hydra_Software_Devel/22   10/30/08 5:51p vle
33 * PR47447: Merge to main branch.
34 * Add new GetReceivedMessage API. Use same CEC configuration for
35 * transmitter and receiver.
36 *
37 * Hydra_Software_Devel/PR47447/1   9/30/08 7:03p vle
38 * PR47447: Add new GetReceivedMessage API. Use same CEC configuration for
39 * transmitter and receiver.
40 *
41 * Hydra_Software_Devel/21   4/28/08 6:02p vle
42 * PR42271: Move HDMI CEC implementations to bhdm_cec_priv to allow ease
43 * of code sharing between HDMI transmitter and receiver platforms.
44 *
45 * Hydra_Software_Devel/20   3/11/08 3:30p rgreen
46 * PR40264: Add HDMI CEC Support for 3563
47 *
48 * Hydra_Software_Devel/19   2/14/08 5:21p vle
49 * PR 39069: Add BHDM_CEC_PingLogicalAddr() API for polling logical
50 * address.
51 *
52 * Hydra_Software_Devel/18   2/4/08 10:36p vle
53 * PR 39341: Add API allowing application to enable/disable CEC core.
54 * Fix compiler warning in BHDM_CEC_ReportPhysicalAddress()
55 *
56 * Hydra_Software_Devel/17   12/3/07 6:07p rgreen
57 * PR37814:Prevent transmission of 2nd CEC message when another is active
58 *
59 * Hydra_Software_Devel/16   9/20/06 10:02p rgreen
60 * PR14359: Add CEC broadcast address
61 *
62 * Hydra_Software_Devel/15   5/19/06 3:20p rgreen
63 * PR21630: force compilation error if BHDM_CEC_SUPPORT is not defined
64 *
65 * Hydra_Software_Devel/14   2/1/06 6:56p rgreen
66 * PR14359,PR19283: HDMI CEC Support
67 * Move BHDM_CEC_xxx definitions to bavc_hdmi.h (BAVC_HDMI_CEC_xxx for
68 * shared use with both Rx and Tx devices
69 * Update CEC code for getting CEC logical/physical addresses
70 *
71 * Hydra_Software_Devel/13   11/30/04 10:40a rgreen
72 * PR8896: Modifications to support CEC functions
73 *
74 * Hydra_Software_Devel/12   12/8/03 8:26p rgreen
75 * PR8896:
76 * Add CEC error messages
77 * Modify variable/description from BufSize to ByteLength
78 *
79 * Hydra_Software_Devel/11   10/6/03 8:32p rgreen
80 * Incorporate API review  comments
81 *
82 * Hydra_Software_Devel/10   9/30/03 5:07p lseverin
83 * fixed a few documentation (DocJet) warnings
84 *
85 * Hydra_Software_Devel/9   9/24/03 8:37p rgreen
86 * Changes to reflect internal HDMI review comments.
87 *
88 * Hydra_Software_Devel/8   4/15/03 6:01p rgreen
89 * Documentation Updates
90 *
91 * Hydra_Software_Devel/7   3/27/03 5:05p rgreen
92 * Documentation Updates.
93 *
94 * Hydra_Software_Devel/5   3/20/03 6:00p rgreen
95 * Use StandardNamingConventions on enumeration types
96 *
97 * Hydra_Software_Devel/4   3/20/03 4:33p rgreen
98 * Add module overview tag
99 * Add ReportPhysicalAddress prototype
100 *
101 * Hydra_Software_Devel/3   3/14/03 11:22a rgreen
102 * remove bstd include
103 *
104 * Hydra_Software_Devel/2   3/13/03 11:51a rgreen
105 * Add module overview; additional function headers
106 *
107 * Hydra_Software_Devel/1   3/7/03 1:24p rgreen
108 * Beta Release of HDMI API
109 *
110 *****************************************************************************/
111
112#ifndef BHDM_CEC_H__
113#define BHDM_CEC_H__
114
115
116#ifndef BHDM_CEC_SUPPORT
117#error Missing BHDM_CEC_SUPPORT definition;
118#error Set optional BHDM_CEC_SUPPORT or remove CEC references
119#endif
120
121/****************************** Include Files ********************************/
122#include "bhdm.h"
123#include "bhdm_config.h"
124
125
126#ifdef __cplusplus
127extern "C" {
128#endif
129
130#if BHDM_CONFIG_CEC_LEGACY_SUPPORT
131
132
133/*=************************ Module Overview ********************************
134  The CEC (Consumer Electronic Control) functions provide support for sending
135  and receving messages used for the control of HDMI devices connected
136  together.
137
138  These functions do not interpret CEC messages, but buffers them for access
139  by application software.  Support is also provided to send messages to
140  other HDMI connected devices.
141***************************************************************************/
142
143
144/******************************************************************************
145Summary:
146CEC Function Return Values
147*******************************************************************************/
148#define BHDM_CEC_NOT_IMPLEMENTED            BERR_MAKE_CODE(BERR_HDM_ID, BHDM_CEC_ERRS+ 0)
149#define BHDM_CEC_NO_PHYS_ADDR               BERR_MAKE_CODE(BERR_HDM_ID, BHDM_CEC_ERRS+ 1)
150#define BHDM_CEC_ASSIGNED_FREEUSE_ADDR      BERR_MAKE_CODE(BERR_HDM_ID, BHDM_CEC_ERRS+ 2)
151#define BHDM_CEC_ASSIGNED_UNREGISTERED_ADDR BERR_MAKE_CODE(BERR_HDM_ID, BHDM_CEC_ERRS+ 3)
152#define BHDM_CEC_NO_LOGICAL_ADDR            BERR_MAKE_CODE(BERR_HDM_ID, BHDM_CEC_ERRS+ 4)
153#define BHDM_CEC_EXCEED_MAX_DEVICE_LEVELS   BERR_MAKE_CODE(BERR_HDM_ID, BHDM_CEC_ERRS+ 5)
154#define BHDM_CEC_TRANSMIT_ERROR             BERR_MAKE_CODE(BERR_HDM_ID, BHDM_CEC_ERRS+ 6)
155#define BHDM_CEC_RECEIVE_ERROR              BERR_MAKE_CODE(BERR_HDM_ID, BHDM_CEC_ERRS+ 7)
156#define BHDM_CEC_NOT_ENOUGH_MEM             BERR_MAKE_CODE(BERR_HDM_ID, BHDM_CEC_ERRS+ 8)
157#define BHDM_CEC_EXCEED_MSG_LENGTH                      BERR_MAKE_CODE(BERR_HDM_ID, BHDM_CEC_ERRS+ 9)
158#define BHDM_CEC_TRANSMIT_BUSY                  BERR_MAKE_CODE(BERR_HDM_ID, BHDM_CEC_ERRS+ 10)
159
160
161#define BHDM_CEC_BROADCAST_ADDR  0xF
162
163/******************************************************************************
164 * Public API
165 ******************************************************************************/
166
167/******************************************************************************
168Summary:
169Get the Logical and Physical addresses for MyHDMI device.
170
171Description:
172  Determine what my MyPhysical and MyLogical device addresses are.
173
174
175Input:
176        hHDMI - HDMI control handle that was previously opened by BHDM_Open.
177
178Output:
179        pMyPhysicalAddr - pointer to memory location to hold this devices
180        current physical address.  See section 8.7.3 In the HDMI Spec.
181
182        pMyLogicalAddr  - pointer to memory location to hold this device's
183        current logical address,  See CEC supplement section 10.2.1 in the HDMI
184        Spec,
185
186Returns:
187        BERR_SUCCESS                      - Successfully returned the Logical and
188                                            Physical Addresses
189        BERR_INVALID_PARAMETER            - Invalid function parameter.
190        BHDM_CEC_NO_PHYS_ADDR             - No Phys Device Addrs left in HDMI cluster
191        BHDM_CEC_ASSIGNED_FREEUSE_ADDR    - Device Assigned the Free Use Address   
192        BHDM_CEC_ASSIGNED_UNREGISTERED_ADDR      - Device Assigned the Unregistered Address
193        BHDM_CEC_NO_LOGICAL_ADDR          - No Logical Addresses left in HDMI cluster
194        BHDM_CEC_EXCEED_MAX_DEVICE_LEVELS - Num of Devices exceed HDMI cluster maximum
195
196
197See Also:
198        o BHDM_Handle
199        o BHDM_CEC_AllDevices
200        o BHDM_CEC_RecDevices
201        o BHDM_CEC_StbDevices
202        o BHDM_CEC_DvdDevices
203
204*******************************************************************************/
205BERR_Code BHDM_CEC_GetMyAddrs(
206   BHDM_Handle hHDMI,        /* [in] HDMI handle */
207   uint8_t *pMyPhysicalAddr, /* [out] ptr to uint8 to hold my Physical Addr */
208   uint8_t *pMyLogicalAddr   /* [out] ptr to uint8 to hold my Logical Addr */
209)  ;
210
211
212/******************************************************************************
213Summary:
214        Set the Logical CEC Address for this Device
215       
216
217Input:
218        hHDMI - HDMI control handle that was previously opened by BHDM_Open.
219        MyLogicalAddr - CEC Address to use for this device (1-15).
220
221Output:
222        <none>
223
224Returns:
225        BERR_SUCCESS - Successfully broadcast the <Report Physical Address> message
226        BERR_INVALID_PARAMETER - Invalid function parameter.
227
228
229See Also:
230        o BHDM_Handle
231        o BHDM_CEC_GetMyAddrs
232*******************************************************************************/
233BERR_Code BHDM_CEC_SetMyAddr(
234   BHDM_Handle hHDMI,        /* [in] HDMI handle */
235   uint8_t MyLogicalAddr
236) ;
237
238
239/******************************************************************************
240Summary:
241        Get the Message/Status for the CEC Interrupt
242       
243Description:
244        Read the Interrupt and Status bits to determine the result of CEC messages
245
246Input:
247        hHDMI - HDMI control handle that was previously opened by BHDM_Open.
248        MessageType - Interrupt is result of transmitted or received message.
249        CECStatus - Status of the transmitted or received message (OK, ERROR)
250        EOM - End Of Message indicator (true indicates last of message)
251
252Output:
253        <none>
254
255Returns:
256        BERR_SUCCESS - Successfully broadcast the <Report Physical Address> message
257        BERR_INVALID_PARAMETER - Invalid function parameter.
258        BHDM_ERR_CEC_ReceiveError - Error broadcasting <Report Physical Address>
259        message
260
261
262See Also:
263        BHDM_Handle
264
265*******************************************************************************/
266BERR_Code BHDM_CEC_GetMsgInfo(
267        BHDM_Handle hHDMI,     /* [in] HDMI handle */
268        BAVC_HDMI_CEC_IntMessageType * MessageType, /* Interrupt Message Type (Rx or Tx */
269        uint8_t *CECStatus,
270        uint8_t *CECMsgLength,
271        uint8_t *EOM
272) ;
273
274
275/******************************************************************************
276Summary:
277        Transmit CEC Polling message
278
279Description:
280        Transmit formatted CEC Polling message to determine the device logical address.
281
282Input:
283        hHDMI - HDMI control handle that was previously opened by BHDM_Open.
284        LogicalAddr - The logical address to poll for
285
286Output:
287        <none>
288
289Returns:
290        BERR_SUCCESS - Successfully set up the message for transmission
291        (TBD) Interrupt may signal message has been acknowledged by recipient
292        BHDM_CEC_TRANSMIT_BUSY - Busy transmitting another CEC message
293
294See Also:
295        o BHDM_Handle
296        o BHDM_CEC_XmitMsg
297        o BHDM_CEC_RecvMsg
298
299*******************************************************************************/
300BERR_Code BHDM_CEC_PingLogicalAddr(
301   BHDM_Handle hHDMI,     /* [in] HDMI handle */
302   uint8_t LogicalAddr  /* [in] device logical address */
303); 
304
305
306/******************************************************************************
307Summary:
308        Transmit a CEC message
309
310Description:
311        Transmit the prevously formatted CEC message.  The message has the
312        destinaton embedded in the header block of the message.
313
314Input:
315        hHDMI - HDMI control handle that was previously opened by BHDM_Open.
316        pCECTxMsgBuf - pointer to CEC message to be transmitted
317        ByteLength   - number of bytes that make up the CEC message
318
319Output:
320        <none>
321
322Returns:
323        BERR_SUCCESS - Successfully set up the message for transmission
324        (TBD) Interrupt may signal message has been acknowledged by recipient
325        BERR_INVALID_PARAMETER - Invalid function parameter.
326        BHDM_ERR_CEC_TransmitError - Error Transmittiing CEC Message
327
328
329See Also:
330        o BHDM_Handle
331        o BHDM_CEC_RecvMsg
332
333*******************************************************************************/
334BERR_Code BHDM_CEC_XmitMsg(
335   BHDM_Handle hHDMI,     /* [in] HDMI handle */
336   uint8_t DestinationAddr,
337   const uint8_t *pCECTxMsgBuf, /* [in] ptr to buffer containing CEC msg to send */
338   uint8_t ByteLength       /* [in] size (bytes) of buffer to send */
339) ;
340
341
342
343/******************************************************************************
344Summary:
345        Enable the HDMI Core to receive a CEC message
346
347Description:
348        This function will enable the Core to receive messsages on the CEC bus.
349        BHDM_CEC_EnableReceive should be called after each message is received and
350        acknowledge so the next CEC message intended for the core can be received
351
352Input:
353        hHDMI - HDMI control handle that was previously opened by BHDM_Open.
354
355Output:
356        None
357
358Returns:
359        BERR_SUCCESS - Successfully retrieved the stored CEC message.
360        BERR_INVALID_PARAMETER - Invalid function parameter.
361
362
363See Also:
364        o BHDM_Handle
365        o BHDM_CEC_RecvMsg
366
367*******************************************************************************/
368BERR_Code BHDM_CEC_EnableReceive(
369   BHDM_Handle hHDMI     /* [in] HDMI handle */
370) ;
371
372
373
374/******************************************************************************
375Summary:
376        Receive a CEC message
377
378Description:
379        Copy the contents of the received CEC message to a data structure for later use.
380
381Input:
382        hHDMI - HDMI control handle that was previously opened by BHDM_Open.
383
384Output:
385        pRecvMessageData - pointer to memory location to hold received message data
386
387Returns:
388        BERR_SUCCESS - Successfully retrieved the stored CEC message.
389
390See Also:
391        o BHDM_Handle
392        o BHDM_CEC_XmitMsg
393
394*******************************************************************************/
395BERR_Code BHDM_CEC_GetReceivedMessage(
396        BHDM_Handle hHDMI,     /* [in] HDMI handle */
397        BAVC_HDMI_CEC_MessageData *pRecvMessageData /* [out] ptr to storage for received CEC msg */
398) ;
399
400
401
402/******************************************************************************
403Summary:
404        Receive a CEC message
405
406Description:
407        Copy the contents of the received CEC message to a buffer for use.
408
409Input:
410        hHDMI - HDMI control handle that was previously opened by BHDM_Open.
411    iByteLength - size of memory pointed to by pCECRxMsgBuf
412
413Output:
414        pCECRxMsgBuf - pointer to memory location to hold received message
415
416Returns:
417        BERR_SUCCESS - Successfully retrieved the stored CEC message.
418        BERR_INVALID_PARAMETER - Invalid function parameter.
419        BHDM_ERR_CEC_ReceiveError - Error Receiving CEC Message
420        BHDM_CEC_NOT_ENOUGH_MEM   - Not enough memory to hold CEC message
421
422Note:
423        The calling function must allocate and free the 16 byte buffer
424        pointed to by pCECRxMsgBuf
425
426
427See Also:
428        o BHDM_Handle
429        o BHDM_CEC_XmitMsg
430
431*******************************************************************************/
432BERR_Code BHDM_CEC_RecvMsg(
433   BHDM_Handle hHDMI,     /* [in] HDMI handle */
434   uint8_t *pCECRxMsgBuf, /* [out] ptr to storage for received CEC msg */
435   uint8_t *iByteLength       /* [in ] size of memory in Received CEC Msg */
436) ;
437
438
439
440/******************************************************************************
441Summary:
442        Report the Physical Address and Device Type as a broadcast message.
443
444Description:
445        CEC Devices shall report the association between its logical and physical
446        addresses by broadcasting the <Report Physical Address> message
447
448Input:
449        hHDMI - HDMI control handle that was previously opened by BHDM_Open.
450
451Output:
452        <none>
453
454Returns:
455        BERR_SUCCESS - Successfully broadcast the <Report Physical Address> message
456        BERR_INVALID_PARAMETER - Invalid function parameter.
457        BHDM_ERR_CEC_ReceiveError - Error broadcasting <Report Physical Address>
458        message
459
460
461See Also:
462        BHDM_Handle
463
464*******************************************************************************/
465BERR_Code BHDM_CEC_ReportPhysicalAddress(
466   BHDM_Handle hHDMI     /* [in] HDMI handle */
467) ;
468
469
470/******************************************************************************
471Summary:
472        Enable/Disable CEC core.
473
474Description:
475        The CEC core will be disabled by holding CEC core in reset state. Otherwise, the core is
476        enabled.
477
478Input:
479        hHDMI - HDMI control handle that was previously opened by BHDM_Open.
480        bEnableCecCore - boolean to indicate enable/disable CEC core
481
482Output:
483        <none>
484
485Returns:
486        BERR_SUCCESS - Successfully broadcast the <Report Physical Address> message
487
488See Also:
489        BHDM_Handle
490
491*******************************************************************************/
492BERR_Code BHDM_CEC_Enable(
493        BHDM_Handle hHDMI,              /* [in] HDMI handle */
494        bool bEnableCec         /* [in] boolean to enable/disable CEC core      */
495);
496
497#endif /* end BHDM_CONFIG_CEC_LEGACY_SUPPORT */
498
499
500#ifdef __cplusplus
501}
502#endif
503
504#endif /* ifndef BHDM_CEC_H__ */
505
506/* End of file */
Note: See TracBrowser for help on using the repository browser.