2 * Copyright@ Samsung Electronics Co. LTD
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
24 /* Maximum CEC frame size */
25 #define CEC_MAX_FRAME_SIZE 16
26 /* Not valid CEC physical address */
27 #define CEC_NOT_VALID_PHYSICAL_ADDRESS 0xFFFF
29 /* CEC broadcast address (as destination address) */
30 #define CEC_MSG_BROADCAST 0x0F
31 /* CEC unregistered address (as initiator address) */
32 #define CEC_LADDR_UNREGISTERED 0x0F
38 /* @name Messages for the One Touch Play Feature */
39 #define CEC_OPCODE_ACTIVE_SOURCE 0x82
40 #define CEC_OPCODE_IMAGE_VIEW_ON 0x04
41 #define CEC_OPCODE_TEXT_VIEW_ON 0x0D
43 /* @name Messages for the Routing Control Feature */
44 #define CEC_OPCODE_INACTIVE_SOURCE 0x9D
45 #define CEC_OPCODE_REQUEST_ACTIVE_SOURCE 0x85
46 #define CEC_OPCODE_ROUTING_CHANGE 0x80
47 #define CEC_OPCODE_ROUTING_INFORMATION 0x81
48 #define CEC_OPCODE_SET_STREAM_PATH 0x86
50 /* @name Messages for the Standby Feature */
51 #define CEC_OPCODE_STANDBY 0x36
53 /* @name Messages for the One Touch Record Feature */
54 #define CEC_OPCODE_RECORD_OFF 0x0B
55 #define CEC_OPCODE_RECORD_ON 0x09
56 #define CEC_OPCODE_RECORD_STATUS 0x0A
57 #define CEC_OPCODE_RECORD_TV_SCREEN 0x0F
59 /* @name Messages for the Timer Programming Feature */
60 #define CEC_OPCODE_CLEAR_ANALOGUE_TIMER 0x33
61 #define CEC_OPCODE_CLEAR_DIGITAL_TIMER 0x99
62 #define CEC_OPCODE_CLEAR_EXTERNAL_TIMER 0xA1
63 #define CEC_OPCODE_SET_ANALOGUE_TIMER 0x34
64 #define CEC_OPCODE_SET_DIGITAL_TIMER 0x97
65 #define CEC_OPCODE_SET_EXTERNAL_TIMER 0xA2
66 #define CEC_OPCODE_SET_TIMER_PROGRAM_TITLE 0x67
67 #define CEC_OPCODE_TIMER_CLEARED_STATUS 0x43
68 #define CEC_OPCODE_TIMER_STATUS 0x35
70 /* @name Messages for the System Information Feature */
71 #define CEC_OPCODE_CEC_VERSION 0x9E
72 #define CEC_OPCODE_GET_CEC_VERSION 0x9F
73 #define CEC_OPCODE_GIVE_PHYSICAL_ADDRESS 0x83
74 #define CEC_OPCODE_GET_MENU_LANGUAGE 0x91
75 //#define CEC_OPCODE_POLLING_MESSAGE
76 #define CEC_OPCODE_REPORT_PHYSICAL_ADDRESS 0x84
77 #define CEC_OPCODE_SET_MENU_LANGUAGE 0x32
79 /* @name Messages for the Deck Control Feature */
80 #define CEC_OPCODE_DECK_CONTROL 0x42
81 #define CEC_OPCODE_DECK_STATUS 0x1B
82 #define CEC_OPCODE_GIVE_DECK_STATUS 0x1A
83 #define CEC_OPCODE_PLAY 0x41
85 /* @name Messages for the Tuner Control Feature */
86 #define CEC_OPCODE_GIVE_TUNER_DEVICE_STATUS 0x08
87 #define CEC_OPCODE_SELECT_ANALOGUE_SERVICE 0x92
88 #define CEC_OPCODE_SELECT_DIGITAL_SERVICE 0x93
89 #define CEC_OPCODE_TUNER_DEVICE_STATUS 0x07
90 #define CEC_OPCODE_TUNER_STEP_DECREMENT 0x06
91 #define CEC_OPCODE_TUNER_STEP_INCREMENT 0x05
93 /* @name Messages for the Vendor Specific Commands Feature */
94 #define CEC_OPCODE_DEVICE_VENDOR_ID 0x87
95 #define CEC_OPCODE_GET_DEVICE_VENDOR_ID 0x8C
96 #define CEC_OPCODE_VENDOR_COMMAND 0x89
97 #define CEC_OPCODE_VENDOR_COMMAND_WITH_ID 0xA0
98 #define CEC_OPCODE_VENDOR_REMOTE_BUTTON_DOWN 0x8A
99 #define CEC_OPCODE_VENDOR_REMOTE_BUTTON_UP 0x8B
101 /* @name Messages for the OSD Display Feature */
102 #define CEC_OPCODE_SET_OSD_STRING 0x64
104 /* @name Messages for the Device OSD Transfer Feature */
105 #define CEC_OPCODE_GIVE_OSD_NAME 0x46
106 #define CEC_OPCODE_SET_OSD_NAME 0x47
108 /* @name Messages for the Device Menu Control Feature */
109 #define CEC_OPCODE_MENU_REQUEST 0x8D
110 #define CEC_OPCODE_MENU_STATUS 0x8E
111 #define CEC_OPCODE_USER_CONTROL_PRESSED 0x44
112 #define CEC_OPCODE_USER_CONTROL_RELEASED 0x45
114 /* @name Messages for the Remote Control Passthrough Feature */
116 /* @name Messages for the Power Status Feature */
117 #define CEC_OPCODE_GIVE_DEVICE_POWER_STATUS 0x8F
118 #define CEC_OPCODE_REPORT_POWER_STATUS 0x90
120 /* @name Messages for General Protocol messages */
121 #define CEC_OPCODE_FEATURE_ABORT 0x00
122 #define CEC_OPCODE_ABORT 0xFF
124 /* @name Messages for the System Audio Control Feature */
125 #define CEC_OPCODE_GIVE_AUDIO_STATUS 0x71
126 #define CEC_OPCODE_GIVE_SYSTEM_AUDIO_MODE_STATUS 0x7D
127 #define CEC_OPCODE_REPORT_AUDIO_STATUS 0x7A
128 #define CEC_OPCODE_SET_SYSTEM_AUDIO_MODE 0x72
129 #define CEC_OPCODE_SYSTEM_AUDIO_MODE_REQUEST 0x70
130 #define CEC_OPCODE_SYSTEM_AUDIO_MODE_STATUS 0x7E
132 /* @name Messages for the Audio Rate Control Feature */
133 #define CEC_OPCODE_SET_AUDIO_RATE 0x9A
135 /* @name CEC Operands */
137 /* TODO: not finished */
139 #define CEC_DECK_CONTROL_MODE_STOP 0x03
140 #define CEC_PLAY_MODE_PLAY_FORWARD 0x24
143 * @enum CECDeviceType
149 /* Recording Device */
155 /* Playback Device */
163 int CECAllocLogicalAddress(int paddr, enum CECDeviceType devtype);
164 int CECSendMessage(unsigned char *buffer, int size);
165 int CECReceiveMessage(unsigned char *buffer, int size, long timeout);
167 int CECIgnoreMessage(unsigned char opcode, unsigned char lsrc);
168 int CECCheckMessageSize(unsigned char opcode, int size);
169 int CECCheckMessageMode(unsigned char opcode, int broadcast);
170 int CECProcessOpcode(unsigned char *buffer, int laddr, int paddr, int raddr);
171 int CECReportKey(unsigned int key);
176 #endif /* _LIBCEC_H_ */