source: svn/newcon3bcm2_21bu/magnum/portinginterface/cec/7552/bcec.h @ 47

Last change on this file since 47 was 47, checked in by megakiss, 11 years ago

459Mhz로 OTC 주파수 변경

  • Property svn:executable set to *
File size: 26.0 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: bcec.h $
39* $brcm_Revision: Hydra_Software_Devel/8 $
40* $brcm_Date: 3/26/12 6:43p $
41*
42* Module Description:
43*
44* Revision History:
45*
46* $brcm_Log: /magnum/portinginterface/cec/7425/bcec.h $
47*
48* Hydra_Software_Devel/8   3/26/12 6:43p vle
49* SW7420-2283: Fix build warning for 65nm builds.
50*
51* Hydra_Software_Devel/7   3/1/12 1:19p vle
52* SW7425-2289: Additional update to make sure only AutoOn CEC is active
53*
54* Hydra_Software_Devel/6   2/24/12 4:06p vle
55* SW7425-2289: Merge to mainline
56*
57* Hydra_Software_Devel/SW7425-2289/1   2/22/12 6:10p vle
58* SW7425-2289: Add support for CEC AutoOn
59*
60* Hydra_Software_Devel/5   2/17/12 3:45p vle
61* SW7425-2279: Merge to mainline
62*
63* Hydra_Software_Devel/SW7425-2279/4   2/16/12 4:55p vle
64* SW7425-2279: Additional updates after 2nd review. Still need to rework
65* Standby/Resume function to use CEC autoOn feature.
66*
67* Hydra_Software_Devel/SW7425-2279/3   2/14/12 5:56p vle
68* SW7425-2279: More updates improving implementations.
69*
70* Hydra_Software_Devel/SW7425-2279/2   2/13/12 3:32p vle
71* SW7420-682: Merge to SW7425-2279 branch
72*
73* Hydra_Software_Devel/SW7425-2279/1   2/9/12 3:35p vle
74* SW7425-2279: Update BCEC PI implementations. Use separate events for
75* transmit and receive.
76*
77* Hydra_Software_Devel/SW7420-682/1   2/3/12 6:41p vle
78* SW7420-682: First attempt at enable Auto-on CEC. Code hasn't gone
79* through testing.
80*
81* Hydra_Software_Devel/4   12/21/11 1:40p vle
82* SW7405-4781: merge to mainline
83*
84* Hydra_Software_Devel/SW7405-4781/1   12/21/11 12:12p vle
85* SW7405-4781: allow CEC device type to be configurable
86*
87* Hydra_Software_Devel/3   12/19/11 1:49p vle
88* SW7405-5574: Add support for 65nm platforms.
89*
90* Hydra_Software_Devel/2   12/9/11 11:00a vle
91* SW7425-1140: fix comments and add GetDefaultSettings API
92*
93* Hydra_Software_Devel/1   11/22/11 6:23p vle
94* SW7425-1140: Add BCEC PI support
95*
96* Hydra_Software_Devel/SW7425-1140/1   11/16/11 12:14p vle
97* SW7425-1140: Add CEC PI support for 7425
98*
99***************************************************************************/
100
101#ifndef BCEC_H__
102#define BCEC_H__
103
104#include "bchp.h"               /* Chip Info */
105#include "breg_mem.h"   /* Chip register access. */
106#include "bkni.h"               /* Kernel Interface */
107#include "bint.h"               /* Interrupt */
108
109#include "bavc_hdmi.h"
110#include "bchp_hdmi.h"
111#include "bcec_config.h"
112
113
114#ifdef __cplusplus
115extern "C" {
116#endif
117
118/************************* Module Overview ********************************
119  The CEC (Consumer Electronic Control) functions provide support for sending
120  and receving messages used for the control of HDMI devices connected
121  together.
122
123  These functions do not interpret CEC messages, but buffers them for access
124  by application software.      Support is also provided to send messages to
125  other HDMI connected devices.
126***************************************************************************/
127
128
129/******************************************************************************
130Summary:
131CEC Context Handle
132*******************************************************************************/
133typedef struct BCEC_P_Handle *BCEC_Handle ;
134
135
136/******************************************************************************
137Summary:
138CEC Function Return Values
139*******************************************************************************/
140#define BCEC_BASE_ERRORS 0
141
142#define BCEC_NOT_IMPLEMENTED                    BERR_MAKE_CODE(BERR_CEC_ID, BCEC_BASE_ERRORS+ 0)
143#define BCEC_NO_PHYS_ADDR                               BERR_MAKE_CODE(BERR_CEC_ID, BCEC_BASE_ERRORS+ 1)
144#define BCEC_ASSIGNED_FREEUSE_ADDR              BERR_MAKE_CODE(BERR_CEC_ID, BCEC_BASE_ERRORS+ 2)
145#define BCEC_ASSIGNED_UNREGISTERED_ADDR BERR_MAKE_CODE(BERR_CEC_ID, BCEC_BASE_ERRORS+ 3)
146#define BCEC_NO_LOGICAL_ADDR                    BERR_MAKE_CODE(BERR_CEC_ID, BCEC_BASE_ERRORS+ 4)
147#define BCEC_EXCEED_MAX_DEVICE_LEVELS   BERR_MAKE_CODE(BERR_CEC_ID, BCEC_BASE_ERRORS+ 5)
148#define BCEC_TRANSMIT_ERROR                     BERR_MAKE_CODE(BERR_CEC_ID, BCEC_BASE_ERRORS+ 6)
149#define BCEC_RECEIVE_ERROR                              BERR_MAKE_CODE(BERR_CEC_ID, BCEC_BASE_ERRORS+ 7)
150#define BCEC_NOT_ENOUGH_MEM                     BERR_MAKE_CODE(BERR_CEC_ID, BCEC_BASE_ERRORS+ 8)
151#define BCEC_EXCEED_MSG_LENGTH                  BERR_MAKE_CODE(BERR_CEC_ID, BCEC_BASE_ERRORS+ 9)
152#define BCEC_TRANSMIT_BUSY                              BERR_MAKE_CODE(BERR_CEC_ID, BCEC_BASE_ERRORS+ 10)
153
154/* CEC Broadcast address */
155#define BCEC_BROADCAST_ADDR  0xF
156
157
158#if BCEC_CONFIG_40NM_SUPPORT
159#include "bchp_aon_hdmi_tx.h"
160#include "bchp_hdmi_tx_intr2.h"
161#include "bchp_int_id_hdmi_tx_intr2.h"
162#include "bchp_int_id_aon_pm_l2.h"
163#include "bchp_int_id_aon_l2.h"
164#else
165#include "bchp_hdmi_intr2.h"
166#include "bchp_int_id_hdmi_intr2.h"
167#include "bchp_hdmi_tx_phy.h"
168#endif
169
170
171#if BCEC_CONFIG_40NM_SUPPORT
172#define BCHP_MASK_DVP(Register,Field) BCHP_AON_HDMI_TX_##Register##_##Field##_MASK
173
174#define REGADDR_CEC_CNTRL_1 BCHP_AON_HDMI_TX_CEC_CNTRL_1
175#define REGNAME_CEC_CNTRL_1 AON_HDMI_TX_CEC_CNTRL_1
176
177#define REGADDR_CEC_CNTRL_2 BCHP_AON_HDMI_TX_CEC_CNTRL_2
178#define REGNAME_CEC_CNTRL_2 AON_HDMI_TX_CEC_CNTRL_2
179
180#define REGADDR_CEC_CNTRL_3 BCHP_AON_HDMI_TX_CEC_CNTRL_3
181#define REGNAME_CEC_CNTRL_3 AON_HDMI_TX_CEC_CNTRL_3
182
183#define REGADDR_CEC_CNTRL_4 BCHP_AON_HDMI_TX_CEC_CNTRL_4
184#define REGNAME_CEC_CNTRL_4 AON_HDMI_TX_CEC_CNTRL_4
185
186#define REGADDR_CEC_CNTRL_5 BCHP_AON_HDMI_TX_CEC_CNTRL_5
187#define REGNAME_CEC_CNTRL_5 AON_HDMI_TX_CEC_CNTRL_5
188
189#define REGADDR_CEC_CNTRL_6 BCHP_AON_HDMI_TX_CEC_CNTRL_6
190#define REGNAME_CEC_CNTRL_6 AON_HDMI_TX_CEC_CNTRL_6
191
192#define REGADDR_CEC_TX_DATA_1 BCHP_AON_HDMI_TX_CEC_TX_DATA_1
193#define REGNAME_CEC_TX_DATA_1 AON_HDMI_TX_CEC_TX_DATA_1
194
195#define REGADDR_CEC_RX_DATA_1 BCHP_AON_HDMI_TX_CEC_RX_DATA_1
196#define REGNAME_CEC_RX_DATA_1 AON_HDMI_TX_CEC_RX_DATA_1
197
198#define REGADDR_CEC_TX_AUTO_CEC_CFG BCHP_AON_HDMI_TX_AUTO_CEC_CFG
199#define REGNAME_CEC_TX_AUTO_CEC_CFG AON_HDMI_TX_AUTO_CEC_CFG
200
201#define REGADDR_CEC_TX_AUTO_CEC_CNTRL BCHP_AON_HDMI_TX_AUTO_CEC_CNTRL
202#define REGNAME_CEC_TX_AUTO_CEC_CNTRL AON_HDMI_TX_AUTO_CEC_CNTRL
203
204#define REGADDR_CEC_TX_AUTO_CEC_FEATURE_ABORT_CFG BCHP_AON_HDMI_TX_AUTO_CEC_FEATURE_ABORT_CFG
205#define REGNAME_CEC_TX_AUTO_CEC_FEATURE_ABORT_CFG AON_HDMI_TX_AUTO_CEC_FEATURE_ABORT_CFG
206
207#define REGADDR_CEC_TX_AUTO_CEC_POWER_STATUS_CFG BCHP_AON_HDMI_TX_AUTO_CEC_POWER_STATUS_CFG
208#define REGNAME_CEC_TX_AUTO_CEC_POWER_STATUS_CFG AON_HDMI_TX_AUTO_CEC_POWER_STATUS_CFG
209
210#define REGADDR_CEC_TX_AUTO_CEC_CHECK_STANDBY_CFG BCHP_AON_HDMI_TX_AUTO_CEC_CHECK_STANDBY_CFG
211#define REGNAME_CEC_TX_AUTO_CEC_CHECK_STANDBY_CFG AON_HDMI_TX_AUTO_CEC_CHECK_STANDBY_CFG
212
213#define REGADDR_CEC_TX_AUTO_CEC_CHECK_WAKE1_CFG_0 BCHP_AON_HDMI_TX_AUTO_CEC_CHECK_WAKE1_CFG_0
214#define REGNAME_CEC_TX_AUTO_CEC_CHECK_WAKE1_CFG_0 AON_HDMI_TX_AUTO_CEC_CHECK_WAKE1_CFG_0
215
216#define REGADDR_CEC_TX_AUTO_CEC_CHECK_WAKE1_CFG_1 BCHP_AON_HDMI_TX_AUTO_CEC_CHECK_WAKE1_CFG_1
217#define REGNAME_CEC_TX_AUTO_CEC_CHECK_WAKE1_CFG_1 AON_HDMI_TX_AUTO_CEC_CHECK_WAKE1_CFG_1
218
219#define REGADDR_CEC_TX_AUTO_CEC_CHECK_WAKE1_CFG_2 BCHP_AON_HDMI_TX_AUTO_CEC_CHECK_WAKE1_CFG_2
220#define REGNAME_CEC_TX_AUTO_CEC_CHECK_WAKE1_CFG_2 AON_HDMI_TX_AUTO_CEC_CHECK_WAKE1_CFG_2
221
222#define REGADDR_CEC_TX_AUTO_CEC_CHECK_WAKE1_CFG_3 BCHP_AON_HDMI_TX_AUTO_CEC_CHECK_WAKE1_CFG_3
223#define REGNAME_CEC_TX_AUTO_CEC_CHECK_WAKE1_CFG_3 AON_HDMI_TX_AUTO_CEC_CHECK_WAKE1_CFG_3
224
225#define REGADDR_CEC_TX_AUTO_CEC_CHECK_WAKE2_CFG_0 BCHP_AON_HDMI_TX_AUTO_CEC_CHECK_WAKE2_CFG_0
226#define REGNAME_CEC_TX_AUTO_CEC_CHECK_WAKE2_CFG_0 AON_HDMI_TX_AUTO_CEC_CHECK_WAKE2_CFG_0
227
228#define REGADDR_CEC_TX_AUTO_CEC_CHECK_WAKE2_CFG_1 BCHP_AON_HDMI_TX_AUTO_CEC_CHECK_WAKE2_CFG_1
229#define REGNAME_CEC_TX_AUTO_CEC_CHECK_WAKE2_CFG_1 AON_HDMI_TX_AUTO_CEC_CHECK_WAKE2_CFG_1
230
231#define REGADDR_CEC_TX_AUTO_CEC_CHECK_WAKE3_CFG_0 BCHP_AON_HDMI_TX_AUTO_CEC_CHECK_WAKE3_CFG_0
232#define REGNAME_CEC_TX_AUTO_CEC_CHECK_WAKE3_CFG_0 AON_HDMI_TX_AUTO_CEC_CHECK_WAKE3_CFG_0
233
234#define REGADDR_CEC_TX_AUTO_CEC_CHECK_WAKE3_CFG_1 BCHP_AON_HDMI_TX_AUTO_CEC_CHECK_WAKE3_CFG_1
235#define REGNAME_CEC_TX_AUTO_CEC_CHECK_WAKE3_CFG_1 AON_HDMI_TX_AUTO_CEC_CHECK_WAKE3_CFG_1
236
237#define REGADDR_CEC_TX_AUTO_CEC_CHECK_WAKE4_CFG_0 BCHP_AON_HDMI_TX_AUTO_CEC_CHECK_WAKE4_CFG_0
238#define REGNAME_CEC_TX_AUTO_CEC_CHECK_WAKE4_CFG_0 AON_HDMI_TX_AUTO_CEC_CHECK_WAKE4_CFG_0
239
240#define REGADDR_CEC_TX_AUTO_CEC_CHECK_WAKE4_CFG_1 BCHP_AON_HDMI_TX_AUTO_CEC_CHECK_WAKE4_CFG_1
241#define REGNAME_CEC_TX_AUTO_CEC_CHECK_WAKE4_CFG_1 AON_HDMI_TX_AUTO_CEC_CHECK_WAKE4_CFG_1
242
243#define REGADDR_CEC_TX_CEC_ENERGYSTAR_CFG1 BCHP_AON_HDMI_TX_CEC_ENERGYSTAR_CFG1
244#define REGNAME_CEC_TX_CEC_ENERGYSTAR_CFG1 AON_HDMI_TX_CEC_ENERGYSTAR_CFG1
245
246#define REGADDR_CEC_TX_CEC_ENERGYSTAR_CFG2 BCHP_AON_HDMI_TX_CEC_ENERGYSTAR_CFG2
247#define REGNAME_CEC_TX_CEC_ENERGYSTAR_CFG2 AON_HDMI_TX_CEC_ENERGYSTAR_CFG2
248
249#define REGADDR_CEC_TX_CEC_ENERGYSTAR_CNTRL BCHP_AON_HDMI_TX_CEC_ENERGYSTAR_CNTRL
250#define REGNAME_CEC_TX_CEC_ENERGYSTAR_CNTRL AON_HDMI_TX_CEC_ENERGYSTAR_CNTRL
251
252#define REGADDR_CEC_TX_CEC_ENERGYSTAR_STATUS BCHP_AON_HDMI_TX_CEC_ENERGYSTAR_STATUS
253#define REGNAME_CEC_TX_CEC_ENERGYSTAR_STATUS AON_HDMI_TX_CEC_ENERGYSTAR_STATUS
254
255
256#else
257#define BCHP_MASK_DVP(Register,Field) BCHP_HDMI_##Register##_##Field##_MASK
258
259#define REGADDR_CEC_CNTRL_1 BCHP_HDMI_CEC_CNTRL_1
260#define REGNAME_CEC_CNTRL_1 HDMI_CEC_CNTRL_1
261
262#define REGADDR_CEC_CNTRL_2 BCHP_HDMI_CEC_CNTRL_2
263#define REGNAME_CEC_CNTRL_2 HDMI_CEC_CNTRL_2
264
265#define REGADDR_CEC_CNTRL_3 BCHP_HDMI_CEC_CNTRL_3
266#define REGNAME_CEC_CNTRL_3 HDMI_CEC_CNTRL_3
267
268#define REGADDR_CEC_CNTRL_4 BCHP_HDMI_CEC_CNTRL_4
269#define REGNAME_CEC_CNTRL_4 HDMI_CEC_CNTRL_4
270
271#define REGADDR_CEC_CNTRL_5 BCHP_HDMI_CEC_CNTRL_5
272#define REGNAME_CEC_CNTRL_5 HDMI_CEC_CNTRL_5
273
274#define REGADDR_CEC_TX_DATA_1 BCHP_HDMI_CEC_TX_DATA_1
275#define REGNAME_CEC_TX_DATA_1 HDMI_CEC_TX_DATA_1
276
277#define REGADDR_CEC_RX_DATA_1 BCHP_HDMI_CEC_RX_DATA_1
278#define REGNAME_CEC_RX_DATA_1 HDMI_CEC_RX_DATA_1
279#endif
280
281
282
283/* CEC default timings */
284#if (BCHP_CHIP == 7038) || (BCHP_CHIP == 7401) || (BCHP_CHIP == 7403) || \
285        (BCHP_CHIP == 7440) || (BCHP_CHIP == 7400) || (BCHP_CHIP == 7405) || \
286        (BCHP_CHIP == 7325) || (BCHP_CHIP == 7335)
287/* Optimal settings for HDMI CEC control registers for 108Mhz system clock */
288#define BCEC_CNTRL_1_DIV_CLK_CNT_VALUE                  0xa8b
289#define BCEC_CNTRL_2_CNT_TO_400_US_VALUE                0x00e
290#define BCEC_CNTRL_2_CNT_TO_600_US_VALUE                0x018
291#define BCEC_CNTRL_2_CNT_TO_800_US_VALUE                0x022
292#define BCEC_CNTRL_2_CNT_TO_1300_US_VALUE               0x032
293#define BCEC_CNTRL_2_CNT_TO_1500_US_VALUE               0x03c
294#define BCEC_CNTRL_3_CNT_TO_1700_US_VALUE               0x046
295#define BCEC_CNTRL_3_CNT_TO_2050_US_VALUE               0x050
296#define BCEC_CNTRL_3_CNT_TO_2400_US_VALUE               0x062
297#define BCEC_CNTRL_3_CNT_TO_2750_US_VALUE               0x070
298#define BCEC_CNTRL_4_CNT_TO_3500_US_VALUE               0x08A
299#define BCEC_CNTRL_4_CNT_TO_3600_US_VALUE               0x094
300#define BCEC_CNTRL_4_CNT_TO_3900_US_VALUE               0x09e
301#define BCEC_CNTRL_4_CNT_TO_4300_US_VALUE               0x0aa
302#define BCEC_CNTRL_5_CNT_TO_4500_US_VALUE               0x0b4
303#define BCEC_CNTRL_5_CNT_TO_4700_US_VALUE               0x0be
304
305#else
306/* Optimal settings for HDMI CEC control registers for 27Mhz system clock */
307#define BCEC_CNTRL_1_DIV_CLK_CNT_VALUE                  0x545
308#define BCEC_CNTRL_2_CNT_TO_400_US_VALUE                0x007
309#define BCEC_CNTRL_2_CNT_TO_600_US_VALUE                0x00c
310#define BCEC_CNTRL_2_CNT_TO_800_US_VALUE                0x011
311#define BCEC_CNTRL_2_CNT_TO_1300_US_VALUE               0x019
312#define BCEC_CNTRL_2_CNT_TO_1500_US_VALUE               0x01e
313#define BCEC_CNTRL_3_CNT_TO_1700_US_VALUE               0x023
314#define BCEC_CNTRL_3_CNT_TO_2050_US_VALUE               0x028
315#define BCEC_CNTRL_3_CNT_TO_2400_US_VALUE               0x031
316#define BCEC_CNTRL_3_CNT_TO_2750_US_VALUE               0x038
317#define BCEC_CNTRL_4_CNT_TO_3500_US_VALUE               0x045
318#define BCEC_CNTRL_4_CNT_TO_3600_US_VALUE               0x04a
319#define BCEC_CNTRL_4_CNT_TO_3900_US_VALUE               0x04f
320#define BCEC_CNTRL_4_CNT_TO_4300_US_VALUE               0x055
321#define BCEC_CNTRL_5_CNT_TO_4500_US_VALUE               0x05a
322#define BCEC_CNTRL_5_CNT_TO_4700_US_VALUE               0x05f
323#endif
324
325
326/**************************************
327  * CEC Messages & corresponding Opcodes   *
328 **************************************/
329#define BCEC_OpCode_FeatureAbort         0x00
330#define BCEC_OpCode_ImageViewOn    0x04
331#define BCEC_OpCode_TunerStepIncrement    0x05
332#define BCEC_OpCode_TunerStepDecrement    0x06
333#define BCEC_OpCode_TunerDeviceStatus    0x07
334#define BCEC_OpCode_DiveTunerDeviceStatus        0x08
335#define BCEC_OpCode_RecordOn    0x09
336#define BCEC_OpCode_RecordStatus        0x0A
337#define BCEC_OpCode_RecordOff    0x0B
338#define BCEC_OpCode_TextViewOn    0x0D
339#define BCEC_OpCode_RecordTVScreen        0x0F
340#define BCEC_OpCode_GiveDeckStatus        0x1A
341#define BCEC_OpCode_DecStatus    0x1B
342#define BCEC_OpCode_SetMenuLanguage    0x32
343#define BCEC_OpCode_ClearAnalogueTimer    0x33
344#define BCEC_OpCode_SetAnalogueTimer   0x34
345#define BCEC_OpCode_TimerStatus    0x35
346#define BCEC_OpCode_Standby    0x36
347#define BCEC_OpCode_Play        0x41
348#define BCEC_OpCode_DeckControl    0x42
349#define BCEC_OpCode_TimerClearedStatus    0x43
350#define BCEC_OpCode_UserControlPressed    0x44
351#define BCEC_OpCode_UserControlReleased    0x45
352#define BCEC_OpCode_GiveOSDName    0x46
353#define BCEC_OpCode_SetOSDName    0x47
354#define BCEC_OpCode_SetOSDString        0x64
355#define BCEC_OpCode_SetTimerProgramTitle        0x67
356#define BCEC_OpCode_SystemAudioModeRequest        0x70
357#define BCEC_OpCode_GiveAudioStatus    0x71
358#define BCEC_OpCode_SetSystemAudioMode    0x72
359#define BCEC_OpCode_ReportAudioStatus    0x7A
360#define BCEC_OpCode_GiveSystemAudioModeStatus    0x7D
361#define BCEC_OpCode_SystemAudioModeStatus        0x7E
362#define BCEC_OpCode_RoutingChange        0x80
363#define BCEC_OpCode_RoutingInformation    0x81
364#define BCEC_OpCode_ActiveSource        0x82
365#define BCEC_OpCode_GivePhysicalAddress    0x83
366#define BCEC_OpCode_ReportPhysicalAddress        0x84
367#define BCEC_OpCode_RequestActiveSource   0x85
368#define BCEC_OpCode_SetStreamPath        0x86
369#define BCEC_OpCode_DeviceVendorID        0x87
370#define BCEC_OpCode_VendorCommand        0x89
371#define BCEC_OpCode_VendorRemoteButtonDown        0x8A
372#define BCEC_OpCode_VendorRemoteButtonUp        0x8A
373#define BCEC_OpCode_GiveDeviceVendorID    0x8C
374#define BCEC_OpCode_MenuRequest    0x8D
375#define BCEC_OpCode_MenuStatus    0x8E
376#define BCEC_OpCode_GiveDevicePowerStatus        0x8F
377#define BCEC_OpCode_ReportPowerStatus    0x90
378#define BCEC_OpCode_GetMenuLanguage    0x91
379#define BCEC_OpCode_SelectAnalogueService        0x92
380#define BCEC_OpCode_SelectDigitalService        0x93
381#define BCEC_OpCode_SetDigitalTimer    0x97
382#define BCEC_OpCode_ClearDigitalTimer    0x99
383#define BCEC_OpCode_SetAudioRate   0x9A
384#define BCEC_OpCode_InActiveSource       0x9D
385#define BCEC_OpCode_CECVersion    0x9E
386#define BCEC_OpCode_GetCECVersion        0x9F
387#define BCEC_OpCode_VendorCommandWithID    0xA0
388#define BCEC_OpCode_ClearExternalTimer    0xA1
389#define BCEC_OpCode_SetExternalTimer    0xA2
390#define BCEC_OpCode_Abort        0xFF
391
392
393typedef enum
394{
395        BCEC_EventCec_eTransmitted,
396        BCEC_EventCec_eReceived
397} BCEC_EventType ;
398
399
400typedef struct BCEC_Dependencies
401{
402        BCHP_Handle hChip;             
403        BREG_Handle hRegister; 
404        BINT_Handle hInterrupt; 
405       
406} BCEC_Dependencies;
407
408
409typedef enum BCEC_DeviceType
410{
411        BCEC_DeviceType_eTv = 0,
412        BCEC_DeviceType_eRecordingDevice,
413        BCEC_DeviceType_eReserved,
414        BCEC_DeviceType_eTuner,
415        BCEC_DeviceType_ePlaybackDevice,
416        BCEC_DeviceType_eAudioSystem,
417        BCEC_DeviceType_ePureCecSwitch,
418        BCEC_DeviceType_eVideoProcessor,
419        BCEC_DeviceType_eMax
420} BCEC_DeviceType;
421
422
423typedef struct BCEC_Settings
424{
425        bool enable;
426        uint8_t CecLogicalAddr;
427        uint8_t CecPhysicalAddr[2];
428        BCEC_DeviceType eDeviceType;   
429        bool enableAutoOn;
430} BCEC_Settings;
431
432
433typedef struct BCEC_MessageStatus
434{
435        BAVC_HDMI_CEC_IntMessageType eMessageType; /* Interrupt Message Type (Rx or Tx) */
436        uint8_t uiStatus;
437        uint8_t uiMessageLength;
438        uint8_t uiEOM;
439
440} BCEC_MessageStatus;
441
442
443/******************************************************************************
444 * Public API
445 ******************************************************************************/
446       
447
448/******************************************************************************
449BERR_Code BCEC_Open
450Summary: Open/Initialize the CEC device
451*******************************************************************************/
452BERR_Code BCEC_Open(
453   BCEC_Handle *phCEC,    /* [out] CEC handle */
454   const BCEC_Dependencies *pstDependencies
455);
456
457
458/******************************************************************************
459BERR_Code BCEC_Close
460Summary: Close the CEC handle
461*******************************************************************************/
462void BCEC_Close(
463   BCEC_Handle hCEC  /* [in] CEC handle */
464);
465
466
467/***************************************************************************
468BERR_Code BCEC_GetEventHandle
469Summary: Get the event handle for checking CEC events.
470****************************************************************************/
471BERR_Code BCEC_GetEventHandle(
472   BCEC_Handle hCEC,                    /* [in] HDMI handle */
473   BCEC_EventType eEventType,
474   BKNI_EventHandle *pBCECEvent /* [out] event handle */
475);
476
477
478/******************************************************************************
479Summary:
480Get default settings
481
482Output
483        pstDefaultCecSetting - default settings
484
485Returns:
486        BERR_SUCCESS
487
488See Also:
489        BCEC_SetSettings
490******************************************************************************/
491void BCEC_GetDefaultSettings(
492        BCEC_Settings *pstDefaultCecSettings
493) ;
494
495
496/******************************************************************************
497Summary:
498Get the current CEC settings
499
500Input:
501        hCEC - CEC control handle that was previously opened by BCEC_Open.
502
503Output:
504        pstCecSettings - returned CEC settings
505
506Returns:
507        BERR_SUCCESS - Successfully retrieve current CEC settings
508        BERR_NOT_INITIALIZED - CEC logical address has not been initialized
509
510See Also:
511        BCEC_SetSettings
512*******************************************************************************/
513BERR_Code BCEC_GetSettings(
514        BCEC_Handle hCEC,                 /* [in] CEC handle */
515        BCEC_Settings *pstCecSettings
516)  ;
517
518
519/******************************************************************************
520Summary:
521        Set CEC settings for the current device
522       
523Input:
524        hCEC - CEC control handle that was previously opened by BCEC_Open.
525        pstCecSettings - CEC settings to be applied
526
527Returns:
528        BERR_SUCCESS - Successfully set CEC settings
529
530See Also:
531        o BCEC_GetSettings
532*******************************************************************************/
533BERR_Code BCEC_SetSettings(
534        BCEC_Handle hCEC,                  /* [in] CEC handle */
535        const BCEC_Settings *pstCecSettings
536) ;
537
538
539/******************************************************************************
540Summary:
541        Get the transmitted message status from the last CEC_SENT interrupt
542       
543Description:
544        Read the Interrupt and Status bits to determine the result of transmitted CEC messages
545
546Input:
547        hCEC - CEC control handle that was previously opened by BCEC_Open.
548
549Returns:
550        BERR_SUCCESS - Successfully retrieve current CEC settings
551
552Output:
553        pstCecMessageStatus - transmitted Cec message status
554*******************************************************************************/ 
555BERR_Code BCEC_GetTransmitMessageStatus(
556        BCEC_Handle hCEC,          /* [in] CEC handle */
557        BCEC_MessageStatus *pstCecMessageStatus /* [out] */
558);     
559
560
561/******************************************************************************
562Summary:
563        Get the received message status from the last CEC_RECEIVED Interrupt
564       
565Description:
566        Read the Interrupt and Status bits to determine the result of received CEC messages
567
568Input:
569        hCEC - CEC control handle that was previously opened by BCEC_Open.
570
571Returns:
572        BERR_SUCCESS - Successfully retrieve current CEC settings
573
574Output:
575        pstCecMessageStatus - received Cec message status
576*******************************************************************************/ 
577BERR_Code BCEC_GetReceivedMessageStatus(
578        BCEC_Handle hCEC,          /* [in] CEC handle */
579        BCEC_MessageStatus *pstCecMessageStatus /* [out] */
580);     
581
582
583/******************************************************************************
584Summary:
585        Transmit CEC Polling message
586
587Description:
588        Transmit formatted CEC Polling message to determine the device logical address.
589
590Input:
591        hCEC - CEC control handle that was previously opened by BCEC_Open.
592        LogicalAddr - The logical address to poll for
593
594Output:
595        <none>
596
597Returns:
598        BERR_SUCCESS - Successfully set up the message for transmission
599        BCEC_TRANSMIT_BUSY - Busy transmitting another CEC message
600
601See Also:
602        o BCEC_XmitMsg
603        o BCEC_RecvMsg
604*******************************************************************************/
605BERR_Code BCEC_PingLogicalAddr( 
606        BCEC_Handle hCEC,         /* [in] CEC handle */
607        uint8_t uiLogicalAddr /* [in] device logical address */
608);
609
610
611/******************************************************************************
612Summary:
613        Transmit a CEC message
614
615Description:
616        Transmit the prevously formatted CEC message.  The message has the
617        destinaton embedded in the header block of the message.
618
619Input:
620        hCEC - CEC control handle that was previously opened by BCEC_Open.
621        pMessageData - message to be transmitted
622
623Output:
624        <none>
625
626Returns:
627        BERR_SUCCESS - Successfully set up the message for transmission
628        BERR_INVALID_PARAMETER - Invalid function parameter.
629        BERR_CEC_TRANSMIT_ERROR - Error Transmittiing CEC Message
630
631
632See Also:
633        o BCEC_RecvMsg
634
635*******************************************************************************/
636BERR_Code BCEC_XmitMessage(
637        BCEC_Handle hCEC,         /* [in] CEC handle */
638        const BAVC_HDMI_CEC_MessageData *pMessageData   /* [in] ptr to storage for received CEC msg */
639);
640
641
642/******************************************************************************
643Summary:
644        Enable the CEC Core to receive a CEC message
645
646Description:
647        This function will enable the Core to receive messsages on the CEC bus.
648        BCEC_EnableReceive should be called after each message is received and
649        acknowledge so the next CEC message intended for the core can be received
650
651Input:
652        hCEC - CEC control handle that was previously opened by BCEC_Open.
653
654Output:
655        None
656
657Returns:
658        BERR_SUCCESS - Successfully retrieved the stored CEC message.
659        BERR_INVALID_PARAMETER - Invalid function parameter.
660
661
662See Also:
663        o BCEC_RecvMsg
664
665*******************************************************************************/
666BERR_Code BCEC_EnableReceive(
667        BCEC_Handle hCEC         /* [in] CEC handle */
668) ;
669
670
671/******************************************************************************
672Summary:
673        Get a received CEC message
674
675Description:
676        Copy the contents of the received CEC message to a data structure for use.
677
678Input:
679        hCEC - CEC control handle that was previously opened by BCEC_Open.
680
681Output:
682        pRecvMessageData - pointer to memory location to hold received message data
683
684Returns:
685        BERR_SUCCESS - Successfully retrieved the stored CEC message.
686
687See Also:
688        o BCEC_XmitMsg
689
690*******************************************************************************/
691BERR_Code BCEC_GetReceivedMessage(
692        BCEC_Handle hCEC,                       /* [in] CEC handle */
693        BAVC_HDMI_CEC_MessageData *pRecvMessageData     /* [out] ptr to storage for received CEC msg */
694) ;
695
696
697/******************************************************************************
698Summary:
699        Report the Physical Address and Device Type as a broadcast message.
700
701Description:
702        CEC Devices shall report the association between its logical and physical
703        addresses by broadcasting the <Report Physical Address> message
704
705Input:
706        hCEC - CEC control handle that was previously opened by BCEC_Open.
707
708Output:
709        <none>
710
711Returns:
712        BERR_SUCCESS - Successfully broadcast the <Report Physical Address> message
713        BERR_INVALID_PARAMETER - Invalid function parameter.
714        BCEC_RECEIVE_ERROR - Error broadcasting <Report Physical Address>
715        message
716
717
718See Also:
719
720*******************************************************************************/
721BERR_Code BCEC_ReportPhysicalAddress(
722        BCEC_Handle hCEC         /* [in] CEC handle */
723) ;
724
725
726/***************************************************************************
727Summary:
728        CEC standby settings
729       
730****************************************************************************/
731typedef struct BCEC_StandbySettings
732{
733        unsigned unused;
734} BCEC_StandbySettings;
735
736
737/******************************************************************************
738Summary: Enter standby mode
739*******************************************************************************/
740BERR_Code BCEC_Standby(
741        BCEC_Handle hCEC, /* [in] CEC Handle */
742        const BCEC_StandbySettings *pSettings
743        );
744
745
746/******************************************************************************
747Summary: Resume standby mode
748*******************************************************************************/
749BERR_Code BCEC_Resume(
750        BCEC_Handle hCEC /* [in] CEC Handle */
751        );
752
753
754#ifdef __cplusplus
755}
756#endif
757
758#endif /* ifndef BCEC_H__ */
759/* End of File */
760
761
Note: See TracBrowser for help on using the repository browser.