source: svn/trunk/newcon3bcm2_21bu/nexus/modules/cec/7552/include/nexus_cec.h

Last change on this file was 2, checked in by phkim, 11 years ago

1.phkim

  1. revision copy newcon3sk r27
  • Property svn:executable set to *
File size: 6.9 KB
Line 
1/***************************************************************************
2*          (c)2007-2011 Broadcom Corporation
3*
4* This program is the proprietary software of Broadcom Corporation and/or its licensors,
5* and may only be used, duplicated, modified or distributed pursuant to the terms and
6* conditions of a separate, written license agreement executed between you and Broadcom
7* (an "Authorized License").    Except as set forth in an Authorized License, Broadcom grants
8* no license (express or implied), right to use, or waiver of any kind with respect to the
9* Software, and Broadcom expressly reserves all rights in and to the Software and all
10* intellectual property rights therein.  IF YOU HAVE NO AUTHORIZED LICENSE, THEN YOU
11* HAVE NO RIGHT TO USE THIS SOFTWARE IN ANY WAY, AND SHOULD IMMEDIATELY
12* NOTIFY BROADCOM AND DISCONTINUE ALL USE OF THE SOFTWARE.
13*
14* Except as expressly set forth in the Authorized License,
15*
16* 1.       This program, including its structure, sequence and organization, constitutes the valuable trade
17* secrets of Broadcom, and you shall use all reasonable efforts to protect the confidentiality thereof,
18* and to use this information only in connection with your use of Broadcom integrated circuit products.
19*
20*       2.         TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS"
21* AND WITH ALL FAULTS AND BROADCOM MAKES NO PROMISES, REPRESENTATIONS OR
22* WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO
23* THE SOFTWARE.  BROADCOM SPECIFICALLY DISCLAIMS ANY AND ALL IMPLIED WARRANTIES
24* OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE,
25* LACK OF VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION
26* OR CORRESPONDENCE TO DESCRIPTION. YOU ASSUME THE ENTIRE RISK ARISING OUT OF
27* USE OR PERFORMANCE OF THE SOFTWARE.
28*
29* 3.       TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL BROADCOM OR ITS
30* LICENSORS BE LIABLE FOR (i) CONSEQUENTIAL, INCIDENTAL, SPECIAL, INDIRECT, OR
31* EXEMPLARY DAMAGES WHATSOEVER ARISING OUT OF OR IN ANY WAY RELATING TO YOUR
32* USE OF OR INABILITY TO USE THE SOFTWARE EVEN IF BROADCOM HAS BEEN ADVISED OF
33* THE POSSIBILITY OF SUCH DAMAGES; OR (ii) ANY AMOUNT IN EXCESS OF THE AMOUNT
34* ACTUALLY PAID FOR THE SOFTWARE ITSELF OR U.S. $1, WHICHEVER IS GREATER. THESE
35* LIMITATIONS SHALL APPLY NOTWITHSTANDING ANY FAILURE OF ESSENTIAL PURPOSE OF
36* ANY LIMITED REMEDY.
37*
38* $brcm_Workfile: nexus_cec.h $
39* $brcm_Revision: SW7405-4781/1 $
40* $brcm_Date: 12/21/11 12:12p $
41*
42* Module Description:
43*
44* Revision History:
45*
46* $brcm_Log: /nexus/modules/cec/7425/include/nexus_cec.h $
47*
48* SW7405-4781/1   12/21/11 12:12p vle
49* SW7405-4781: allow CEC device type to be configurable
50*
51* 1   12/15/11 4:27p vsilyaev
52* SW7425-1140: Merge NEXUS_Cec module support into main-line
53*
54* SW7425-1140/1   12/9/11 4:40p vle
55* SW7425-1140: Add NEXUS_Cec module support
56*
57***************************************************************************/
58
59#ifndef NEXUS_CEC_H__
60#define NEXUS_CEC_H__
61
62
63#ifdef __cplusplus
64extern "C" {
65#endif
66
67#define NEXUS_CEC_MESSAGE_DATA_SIZE 16
68
69/**
70Summary:
71Handle for the CEC interface.
72**/
73typedef struct NEXUS_Cec *NEXUS_CecHandle;
74
75
76/**
77Summary:
78Enumeration indicate the device type
79**/
80typedef enum NEXUS_CecDeviceType
81{
82        NEXUS_CecDeviceType_eTv = 0,
83        NEXUS_CecDeviceType_eRecordingDevice,
84        NEXUS_CecDeviceType_eReserved,
85        NEXUS_CecDeviceType_eTuner,
86        NEXUS_CecDeviceType_ePlaybackDevice,
87        NEXUS_CecDeviceType_eAudioSystem,
88        NEXUS_CecDeviceType_ePureCecSwitch,
89        NEXUS_CecDeviceType_eVideoProcessor,
90        NEXUS_CecDeviceType_eMax
91} NEXUS_CecDeviceType;
92
93
94/**
95Summary:
96CEC settings
97**/
98typedef struct NEXUS_CecSettings
99{
100        bool enabled; /* enable the CEC core */
101        NEXUS_CallbackDesc messageTransmittedCallback;
102        NEXUS_CallbackDesc messageReceivedCallback;
103        NEXUS_CallbackDesc logicalAddressAcquiredCallback;
104        uint8_t physicalAddress[2];             /* device physical address: read from attached EDID */
105        NEXUS_CecDeviceType deviceType;
106} NEXUS_CecSettings;
107
108
109/**
110Summary:
111Get default CEC settings
112**/
113void NEXUS_Cec_GetDefaultSettings(
114        NEXUS_CecSettings *pSettings /* [out] */
115        );
116
117
118/**
119Summary:
120Open a CEC interface
121**/
122NEXUS_CecHandle NEXUS_Cec_Open( /* attr{destructor=NEXUS_Cec_Close} */
123        unsigned index,
124        const NEXUS_CecSettings *pSettings
125        );
126
127/**
128Summary:
129Close the Cec interface
130**/
131void NEXUS_Cec_Close(
132        NEXUS_CecHandle handle
133        );
134
135
136/**
137Summary:
138Get current CEC settings
139**/
140void NEXUS_Cec_GetSettings(
141        NEXUS_CecHandle handle,
142        NEXUS_CecSettings *pSettings /* [out] */
143        );
144
145
146/**
147Summary:
148Set new CEC settings
149
150Description:
151This function is expected to call this with a new physicalAddress after a hotplug occurred on the HDMI interface.
152CEC interface will then re-initialize after a hotplug.
153
154Consult the HDMI spec for more details.
155**/
156NEXUS_Error NEXUS_Cec_SetSettings(
157        NEXUS_CecHandle handle,
158        const NEXUS_CecSettings *pSettings
159        );
160
161
162/**
163Summary:
164Status returned by NEXUS_Cec_GetStatus
165**/
166typedef struct NEXUS_CecStatus
167{
168        bool ready; /* device is ready */
169
170        uint8_t physicalAddress[2];
171        uint8_t logicalAddress;  /* Until logical address is obtained by Nexus, the CEC Send/Receive functions cannot be used.
172                                                                0xFF means no address. */
173        NEXUS_CecDeviceType deviceType;
174                                                               
175        bool messageReceived;            /* If true, call NEXUS_Cec_ReceiveMessage to receive a message. */
176        bool messageTransmitPending; /* If true, you must wait before calling NEXUS_Cec_TransmitMessage again. */
177
178        bool transmitMessageAcknowledged; /* status from last transmitted message */
179       
180} NEXUS_CecStatus;
181
182
183/**
184Summary:
185Get CEC status
186**/
187NEXUS_Error NEXUS_Cec_GetStatus(
188        NEXUS_CecHandle handle,
189        NEXUS_CecStatus *pStatus /* [out] */
190        );
191
192
193/**
194Summary:
195Holds data of CEC message to be transmitted or received message
196**/
197typedef struct NEXUS_CecMessage
198{
199        uint8_t initiatorAddr;
200        uint8_t destinationAddr;
201        uint8_t buffer[NEXUS_CEC_MESSAGE_DATA_SIZE];
202        unsigned length;
203} NEXUS_CecMessage;
204
205
206typedef struct NEXUS_CecReceivedMessage
207{
208        struct {
209                bool receivedMessageAcknowledged;       /* HW has acknowledged received message */
210                bool endOfMessage;
211        } receivedStatus;
212       
213        NEXUS_CecMessage data;
214} NEXUS_CecReceivedMessage;
215
216
217/**
218Summary:
219Get a CEC message that was received
220
221Description:
222You can only have one message pending at a time.
223Fails if no message was received.
224
225Consult the HDMI spec for the contents of the CEC message.
226
227**/
228NEXUS_Error NEXUS_Cec_ReceiveMessage(
229        NEXUS_CecHandle handle,
230        NEXUS_CecReceivedMessage *pReceivedMessage /* [out] */
231        );
232
233
234/**
235Summary:
236Get defaults for the structure before populating it for transmission
237**/
238void NEXUS_Cec_GetDefaultMessageData(
239        NEXUS_CecMessage *pMessage /* [out] */
240        );
241
242
243/**
244Summary:
245Transmit CEC message
246
247Description:
248This function will fail if a previous NEXUS_Cec_TransmitMessage has not completed.
249Wait for messageTransmitted callback and/or check NEXUS_CecStatus.messageTransmitPending.
250
251Consult the HDMI spec for the contents of the CEC message.
252**/
253NEXUS_Error NEXUS_Cec_TransmitMessage(
254        NEXUS_CecHandle handle,
255        const NEXUS_CecMessage *pMessage
256        );
257
258
259#ifdef __cplusplus
260}
261#endif
262
263#endif
264
265 
266
Note: See TracBrowser for help on using the repository browser.