Lines Matching +full:a +full:- +full:bit
1 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
8 The CEC Pin Framework is a core CEC framework for CEC hardware that only
9 has low-level support for the CEC bus. Most hardware today will have
10 high-level CEC support where the hardware deals with driving the CEC bus,
12 allows you to connect the CEC pin to a GPIO on e.g. a Raspberry Pi and
13 you have now made a CEC adapter.
19 Currently only the cec-gpio driver (when the CEC line is directly
20 connected to a pull-up GPIO line) and the AllWinner A10/A20 drm driver
25 now an ``error-inj`` file.
29 The error injection commands are not a stable ABI and may change in the
32 With ``cat error-inj`` you can see both the possible commands and the current
35 $ cat /sys/kernel/debug/cec/cec0/error-inj
38 # rx-clear clear all rx error injections
39 # tx-clear clear all tx error injections
41 # <op> rx-clear clear all rx error injections for <op>
42 # <op> tx-clear clear all tx error injections for <op>
45 # <op>[,<mode>] rx-nack NACK the message instead of sending an ACK
46 # <op>[,<mode>] rx-low-drive <bit> force a low-drive condition at this bit position
47 # <op>[,<mode>] rx-add-byte add a spurious byte to the received CEC message
48 # <op>[,<mode>] rx-remove-byte remove the last byte from the received CEC message
49 # any[,<mode>] rx-arb-lost [<poll>] generate a POLL message to trigger an arbitration lost
52 # tx-ignore-nack-until-eom ignore early NACKs until EOM
53 # tx-custom-low-usecs <usecs> define the 'low' time for the custom pulse
54 # tx-custom-high-usecs <usecs> define the 'high' time for the custom pulse
55 # tx-custom-pulse transmit the custom pulse once the bus is idle
58 # <op>[,<mode>] tx-no-eom don't set the EOM bit
59 # <op>[,<mode>] tx-early-eom set the EOM bit one byte too soon
60 # <op>[,<mode>] tx-add-bytes <num> append <num> (1-255) spurious bytes to the message
61 # <op>[,<mode>] tx-remove-byte drop the last byte from the message
62 # <op>[,<mode>] tx-short-bit <bit> make this bit shorter than allowed
63 # <op>[,<mode>] tx-long-bit <bit> make this bit longer than allowed
64 # <op>[,<mode>] tx-custom-bit <bit> send the custom pulse instead of this bit
65 # <op>[,<mode>] tx-short-start send a start pulse that's too short
66 # <op>[,<mode>] tx-long-start send a start pulse that's too long
67 # <op>[,<mode>] tx-custom-start send the custom pulse instead of the start pulse
68 # <op>[,<mode>] tx-last-bit <bit> stop sending after this bit
69 # <op>[,<mode>] tx-low-drive <bit> force a low-drive condition at this bit position
71 # <op> CEC message opcode (0-255) or 'any'
73 # <bit> CEC message bit (0-159)
74 # 10 bits per 'byte': bits 0-7: data, bit 8: EOM, bit 9: ACK
75 # <poll> CEC poll message used to test arbitration lost (0x00-0xff, default 0x0f)
76 # <usecs> microseconds (0-10000000, default 1000)
80 You can write error injection commands to ``error-inj`` using
81 ``echo 'cmd' >error-inj`` or ``cat cmd.txt >error-inj``. The ``cat error-inj``
82 output contains the current error commands. You can save the output to a file
83 and use it as an input to ``error-inj`` later.
86 ------------
88 Leading spaces/tabs are ignored. If the next character is a ``#`` or the end
89 of the line was reached, then the whole line is ignored. Otherwise a command
98 all opcodes (``any``). Each command also has a 'mode' which can be ``off``
105 So '``any rx-nack``' will NACK the next received CEC message,
106 '``any,always rx-nack``' will NACK all received CEC messages and
107 '``0x82,toggle rx-nack``' will only NACK if an Active Source message was
111 is cleared automatically, so ``once`` is a one-time deal.
113 All combinations of ``<op>`` and error injection commands can co-exist. So
116 0x9e tx-add-bytes 1
117 0x9e tx-early-eom
118 0x9f tx-add-bytes 2
119 any rx-nack
126 0x9e tx-add-bytes 1
127 0x9e tx-add-bytes 2
132 ----------------------
137 ``rx-clear``
140 ``tx-clear``
146 ``<op> rx-clear``
149 ``<op> tx-clear``
153 ----------------
155 ``<op>[,<mode>] rx-nack``
160 ``<op>[,<mode>] rx-low-drive <bit>``
161 Force a Low Drive condition at this bit position. If <op> specifies
162 a specific CEC opcode then the bit position must be at least 18,
165 the error correctly. Note that a Low Drive in the first 4 bits can also
169 ``<op>[,<mode>] rx-add-byte``
170 Add a spurious 0x55 byte to the received CEC message, provided
172 the high-level protocol since spurious bytes should be ignored.
174 ``<op>[,<mode>] rx-remove-byte``
176 was at least 2 bytes long. This is useful to test the high-level
179 ``<op>[,<mode>] rx-arb-lost <poll>``
180 Generate a POLL message to trigger an Arbitration Lost condition.
182 As soon as a start bit has been received the CEC adapter will switch
183 to transmit mode and it will transmit a POLL message. By default this is
188 start sending a message at the same time. In that case the initiator
197 -----------------
199 ``tx-ignore-nack-until-eom``
201 as soon as the receiver NACKs a byte the transmit will stop, but the
203 at the end will the transmitter look at the ACK bit. This is not
207 This setting can be used to test how well a receiver deals with
210 ``<op>[,<mode>] tx-no-eom``
211 Don't set the EOM bit. Normally the last byte of the message has the EOM
212 (End-Of-Message) bit set. With this command the transmit will just stop
213 without ever sending an EOM. This can be used to test how a receiver
214 handles this case. Normally receivers have a time-out after which
217 ``<op>[,<mode>] tx-early-eom``
218 Set the EOM bit one byte too soon. This obviously only works for messages
219 of two bytes or more. The EOM bit will be set for the second-to-last byte
225 ``<op>[,<mode>] tx-add-bytes <num>``
226 Append ``<num>`` (1-255) spurious bytes to the message. The extra bytes
227 have the value of the byte position in the message. So if you transmit a
228 two byte message (e.g. a Get CEC Version message) and add 2 bytes, then
236 ``<op>[,<mode>] tx-remove-byte``
240 ``<op>[,<mode>] tx-short-bit <bit>``
241 Make this bit period shorter than allowed. The bit position cannot be
242 an Ack bit. If <op> specifies a specific CEC opcode then the bit position
244 Normally the period of a data bit is between 2.05 and 2.75 milliseconds.
245 With this command the period of this bit is 1.8 milliseconds, this is
246 done by reducing the time the CEC bus is high. This bit period is less
247 than is allowed and the receiver should respond with a Low Drive
250 This command is ignored for 0 bits in bit positions 0 to 3. This is
253 sees a too-short 0 bit.
255 ``<op>[,<mode>] tx-long-bit <bit>``
256 Make this bit period longer than is valid. The bit position cannot be
257 an Ack bit. If <op> specifies a specific CEC opcode then the bit position
259 Normally the period of a data bit is between 2.05 and 2.75 milliseconds.
260 With this command the period of this bit is 2.9 milliseconds, this is
263 Even though this bit period is longer than is valid it is undefined what
264 a receiver will do. It might just accept it, or it might time out and
268 This command is ignored for 0 bits in bit positions 0 to 3. This is
271 sees a too-long 0 bit.
273 ``<op>[,<mode>] tx-short-start``
274 Make this start bit period shorter than allowed. Normally the period of
275 a start bit is between 4.3 and 4.7 milliseconds. With this command the
276 period of the start bit is 4.1 milliseconds, this is done by reducing
277 the time the CEC bus is high. This start bit period is less than is
280 ``<op>[,<mode>] tx-long-start``
281 Make this start bit period longer than is valid. Normally the period of
282 a start bit is between 4.3 and 4.7 milliseconds. With this command the
283 period of the start bit is 5 milliseconds, this is done by increasing
284 the time the CEC bus is high. This start bit period is more than is
287 Even though this start bit period is longer than is valid it is undefined
288 what a receiver will do. It might just accept it, or it might time out and
292 ``<op>[,<mode>] tx-last-bit <bit>``
293 Just stop transmitting after this bit. If <op> specifies a specific CEC
294 opcode then the bit position must be at least 18, otherwise the opcode
296 reacts when a message just suddenly stops. It should time out and go back
299 ``<op>[,<mode>] tx-low-drive <bit>``
300 Force a Low Drive condition at this bit position. If <op> specifies a
301 specific CEC opcode then the bit position must be at least 18, otherwise
303 receiver handles Low Drive conditions. Note that if this happens at bit
304 positions 0-3 the receiver can interpret this as an Arbitration Lost
308 -------------
310 ``tx-custom-low-usecs <usecs>``
314 ``tx-custom-high-usecs <usecs>``
318 ``tx-custom-low-usecs + tx-custom-high-usecs``.
320 ``<op>[,<mode>] tx-custom-bit <bit>``
321 Send the custom bit instead of a regular data bit. The bit position cannot
322 be an Ack bit. If <op> specifies a specific CEC opcode then the bit
325 ``<op>[,<mode>] tx-custom-start``
326 Send the custom bit instead of a regular start bit.
328 ``tx-custom-pulse``
329 Transmit a single custom pulse as soon as the CEC bus is idle.