<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://sigrok.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jsolla</id>
	<title>sigrok - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://sigrok.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jsolla"/>
	<link rel="alternate" type="text/html" href="https://sigrok.org/wiki/Special:Contributions/Jsolla"/>
	<updated>2026-04-19T14:30:21Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.37.1</generator>
	<entry>
		<id>https://sigrok.org/w/index.php?title=Protocol_decoder_API&amp;diff=14558</id>
		<title>Protocol decoder API</title>
		<link rel="alternate" type="text/html" href="https://sigrok.org/w/index.php?title=Protocol_decoder_API&amp;diff=14558"/>
		<updated>2019-11-03T22:51:16Z</updated>

		<summary type="html">&lt;p&gt;Jsolla: /* Required functions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes how [[libsigrokdecode]] &amp;#039;&amp;#039;&amp;#039;Protocol Decoders ([[Protocol decoders|PDs]])&amp;#039;&amp;#039;&amp;#039; work.&lt;br /&gt;
&lt;br /&gt;
See also [[Protocol decoder HOWTO]] for a quick introduction of how to write your own decoders.&lt;br /&gt;
&lt;br /&gt;
See [[Protocol decoder API/Queries]] for changes to the decoder API in version 3. All decoders use this API now and the v2 API is no longer supported.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
* All PDs are written in Python (&amp;gt;= 3.0).&lt;br /&gt;
* Every PD registers its name, description, capabilities, etc.&lt;br /&gt;
* PDs can be stacked, so the user can construct a decoding pipeline/stack. The control of communication to/from PDs is done by the backend code in libsigrokdecode.&lt;br /&gt;
* The sample data passed into the PDs will be streamed/chunked, so they can run in real time as the data comes in from the hardware (or from a file).&lt;br /&gt;
* In order to keep PDs simple, they don&amp;#039;t have to deal with the intricacies of the datafeed packets.&lt;br /&gt;
&lt;br /&gt;
The frontend passes sample data into libsigrokdecode and gets decoder output (of various types) from every PD in the stack. Which of these output types of which PDs are actually displayed to the user is a matter of configuration or selection by the user; it is possible, for example, to have [[sigrok-cli]] print only the top of the PD stack&amp;#039;s annotation output on stdout.&lt;br /&gt;
&lt;br /&gt;
== API ==&lt;br /&gt;
&lt;br /&gt;
=== Backend library ===&lt;br /&gt;
&lt;br /&gt;
A Python module called &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;sigrokdecode&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; is provided. Every protocol decoder must import this. It contains the following items:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;the Decoder object&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Every protocol decoder must subclass this object.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;OUTPUT_ANN&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
A constant used to register annotation output, used as argument to the &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;[[#register-function|register()]]&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; function. [[Sigrok-cli|sigrok-cli]] shows the annotation output of a decoder stack&amp;#039;s topmost decoder (per default), [[PulseView]] shows annotation output as graphical boxes or as circles (if the duration of the annotation is zero).&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;OUTPUT_PYTHON&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
A constant used to register Python output, used as argument to the &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;[[#register-function|register()]]&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; function. Python output is passed as input to a decoder that is stacked onto the current decoder. The format of the data that is given to the &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;[[#put-function|put()]]&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; function is specific to a certain PD and should be documented for the authors of the higher level decoders, for example with a comment at the top of the decoder&amp;#039;s source file.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;OUTPUT_BINARY&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
A constant used to register binary output, used as argument to the &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;[[#register-function|register()]]&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; function. The format of the data that is outputted is not specified, it&amp;#039;s up to the author of the decoder to choose one (or multiple) appropriate format(s). For example, the [[Protocol_decoder:Uart|UART]] decoder outputs the raw bytes that it decodes, the [[Protocol_decoder:I2s|I²S]] decoder outputs the audio in WAV format, but the output could also be an image (JPG, PNG, other) file for a decoder that decodes a display protocol, a PCAP file for network/USB decoders, or one of [[Protocol decoder output|many other]] formats. [[Sigrok-cli|sigrok-cli]] can be used to redirect the binary output of a decoder into a file (or to pipe it into other applications), see the documentation of its &amp;#039;&amp;#039;&amp;#039;--protocol-decoder-binary&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;-B&amp;#039;&amp;#039;&amp;#039;) option.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;OUTPUT_META&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
A constant used to register metadata output, used as argument to the &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;[[#register-function|register()]]&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; function. An example for a PD that outputs metadata is the SPI decoder that uses it to output the detected bitrate. See [[Protocol decoder output]] for various other possible examples.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;div id=&amp;quot;put-function&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;put(startsample, endsample, output_id, data)&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
This is used to provide the decoded data back into the backend. &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;startsample&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;endsample&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; specify the absolute sample numbers of where this item (e.g. an annotation) starts and ends. &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;output_id&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; is an output identifier returned by the &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;[[#register-function|register()]]&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; function.&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;data&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; parameter&amp;#039;s contents depend on the output type (&amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;output_id&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;):&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OUTPUT_ANN&amp;#039;&amp;#039;&amp;#039;: The &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;data&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; parameter is a Python list with two items. The first item is the annotation index (determined by the order of items in &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;Decoder.annotations&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;, see [[#Decoder_registration|below]]), the second is a list of annotation strings. The strings should be longer and shorter versions of the same annotation text (sorted by length, longest first), which can be used by frontends to show different annotation texts depending on e.g. zoom level.&lt;br /&gt;
** Example: &amp;#039;&amp;#039;&amp;lt;tt&amp;gt;self.put(10, 20, self.out_ann, [4, [&amp;#039;Start&amp;#039;, &amp;#039;St&amp;#039;, &amp;#039;S&amp;#039;]])&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*** The emitted data spans samples 10 to 20, is of type OUTPUT_ANN, the annotation index is 4, the list of annotations strings is &amp;quot;Start&amp;quot;, &amp;quot;St&amp;quot;, &amp;quot;S&amp;quot;.&lt;br /&gt;
** Example: &amp;#039;&amp;#039;&amp;lt;tt&amp;gt;self.put(10, 20, self.out_ann, [4, [&amp;#039;CRC&amp;#039;]])&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*** The emitted data spans samples 10 to 20, is of type OUTPUT_ANN, the annotation index is 4, the list of annotations strings is just &amp;quot;CRC&amp;quot; (the list containins only one item).&lt;br /&gt;
** Example: &amp;#039;&amp;#039;&amp;lt;tt&amp;gt;self.put(35, 9000, self.out_ann, [17, [&amp;#039;Registered Parameter Number&amp;#039;, &amp;#039;Reg Param Num&amp;#039;, &amp;#039;RPN&amp;#039;, &amp;#039;R&amp;#039;]])&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*** The emitted data spans samples 35 to 9000, is of type OUTPUT_ANN, the annotation index is 17, the list of annotations strings is &amp;quot;Registered Parameter Number&amp;quot;, &amp;quot;Reg Param Num&amp;quot;, &amp;quot;RPN&amp;quot;, &amp;quot;R&amp;quot;.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OUTPUT_PYTHON&amp;#039;&amp;#039;&amp;#039;: The &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;data&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; parameter is any arbitrary Python object that will be passed to stacked decoders. The format and contents are entirely decoder-dependent. Typically a Python list with various contents is passed to the stacked PDs.&lt;br /&gt;
** Example: &amp;#039;&amp;#039;&amp;lt;tt&amp;gt;self.put(10, 20, self.out_python, [&amp;#039;PACKET&amp;#039;, [&amp;#039;Foo&amp;#039;, 19.7, [1, 2, 3], (&amp;#039;bar&amp;#039;, &amp;#039;baz&amp;#039;)]])&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*** The emitted data spans samples 10 to 20, is of type OUTPUT_PYTHON, the data contents themselves are entirely dependent on the respective decoder and should be documented in its [[Protocol_decoder_HOWTO#pd.py|pd.py]] file.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OUTPUT_BINARY&amp;#039;&amp;#039;&amp;#039;: The &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;data&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; parameter is a Python list with two items. The first item is the binary format&amp;#039;s index (determined by the order of items in &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;Decoder.binary&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;, see [[#Decoder_registration|below]]), the second is a Python [https://docs.python.org/3/library/stdtypes.html#typebytes &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;bytes&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;] object.&lt;br /&gt;
** Example: &amp;#039;&amp;#039;&amp;lt;tt&amp;gt;self.put(10, 20, self.out_binary, [4, b&amp;#039;\xfe\x55\xaa&amp;#039;])&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*** The emitted data spans samples 10 to 20, is of type OUTPUT_BINARY, the binary format&amp;#039;s index is 4, the emitted bytes are 0xfe, 0x55, 0xaa.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OUTPUT_META&amp;#039;&amp;#039;&amp;#039;: The &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;data&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; parameter is a Python object of a certain type, as defined in the respective &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;[[#register-function|register()]]&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; function.&lt;br /&gt;
** Example: &amp;#039;&amp;#039;&amp;lt;tt&amp;gt;self.put(10, 20, self.out_meta, 15.7)&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*** The emitted data spans samples 10 to 20, is of type OUTPUT_META, the data itself is a floating point number in this case.&lt;br /&gt;
** Example: &amp;#039;&amp;#039;&amp;lt;tt&amp;gt;self.put(10, 20, self.out_meta, 42)&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*** The emitted data spans samples 10 to 20, is of type OUTPUT_META, the data itself is an integer number in this case.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Decoder class functions ===&lt;br /&gt;
&lt;br /&gt;
==== Required functions ====&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;start(self)&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
This function is called before the beginning of the decoding. This is the place to &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;[[#register-function|register()]]&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; the output types, check the user-supplied PD options for validity, and so on.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;div id=&amp;quot;decode-and-wait-function-&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;decode(self)&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;In logic decoders&amp;#039;&amp;#039;&amp;#039;, this function is called by the [[libsigrokdecode]] backend to start the decoding.&lt;br /&gt;
&lt;br /&gt;
It takes no arguments, but instead will enter an infinite loop and gets samples by calling the more versatile &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;[[Protocol_decoder_API/Queries#self.wait()|wait()]]&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; method. This frees specific protocol decoders from tedious yet common tasks like detecting edges, or sampling signals at specific points in time relative to the current position.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; This &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;[[Protocol_decoder_API/Queries#self.decode()|decode(self)]]&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; method&amp;#039;s signature has been introduced in version 3 of the protocol decoder API, in previous versions only &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;decode(self, startsample, endsample, data)&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; was available.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;div id=&amp;quot;decode-function&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;decode(self, startsample, endsample, data)&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;In stacked decoders&amp;#039;&amp;#039;&amp;#039;, this is a function that is called by the [[libsigrokdecode]] backend whenever it has a chunk of data for the protocol decoder to handle.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; style=&amp;quot;font-size: smaller;&amp;quot; class=&amp;quot;alternategrey sortable sigroktable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!style=&amp;quot;width: 8em;&amp;quot; | Argument&lt;br /&gt;
!Description&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;startsample&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| The absolute samplenumber of the first sample in this chunk of data.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;endsample&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| The absolute samplenumber of the last sample in this chunk of data.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;data&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| A list containing the data to decode. Depending on whether the decoder decodes raw samples or is stacked onto another decoder, this argument is:&lt;br /&gt;
* Raw samples (&amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;inputs = [&amp;#039;logic&amp;#039;]&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;):&lt;br /&gt;
  &amp;lt;blockquote&amp;gt;&lt;br /&gt;
  &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;data&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; is a list of tuples containing the (absolute) sample number and the channels of that sample: &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;[(samplenum, channels), (samplenum, channels), ...]&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;.&amp;lt;br /&amp;gt;&lt;br /&gt;
  &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;samplenum&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; is the (absolute) number of the sample, an integer that takes the values from &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;startsample&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; to &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;endsample&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; - 1.&amp;lt;br /&amp;gt;&lt;br /&gt;
  The type of &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;channels&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; is [https://docs.python.org/3/library/stdtypes.html#typebytes &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;bytes&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;],&lt;br /&gt;
  a sequence type whose length is the sum of the lengths of &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;channels&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;optional_channels&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
  (in other words, &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;channels&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; contains a byte for every channel/optional channel).&amp;lt;br /&amp;gt;&lt;br /&gt;
  The order of the bytes is the same as the order of the channels in &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;channels&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;optional_channels&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;.&amp;lt;br&amp;gt;&lt;br /&gt;
  The individual bytes take the values &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;0&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;1&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;, or some other value for optional channels that aren&amp;#039;t supplied to the decoder.&amp;lt;br&amp;gt;&lt;br /&gt;
  The [[Protocol_decoder_HOWTO#channels_.26_optional_channels|Protocol decoder HOWTO]] page contains an example how the data can be processed.&lt;br /&gt;
  &amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Stacked decoder (&amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;inputs = [&amp;#039;&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;id of some other decoder&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;&amp;#039;]&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;):&lt;br /&gt;
  &amp;lt;blockquote&amp;gt;&lt;br /&gt;
  &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;data&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; is the &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;OUTPUT_PYTHON&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; output of the decoder this PD is stacked upon.&lt;br /&gt;
  Its format depends on the implementation of the underlying decoder and should be documented there.&lt;br /&gt;
  &amp;lt;/blockquote&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Optional functions ====&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;metadata(self, key, value)&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Used to pass the decoder metadata about the data stream. Currently the only value for &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;key&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; is &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;sigrokdecode.SRD_CONF_SAMPLERATE&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;value&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; is then the sample rate of the data stream in Hz. &lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Decoder registration ===&lt;br /&gt;
&lt;br /&gt;
A PD&amp;#039;s &amp;#039;&amp;#039;&amp;#039;Decoder&amp;#039;&amp;#039;&amp;#039; class must contain a few attributes specifying metadata about the PD. The following keys can be used:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; style=&amp;quot;font-size: smaller;&amp;quot; class=&amp;quot;alternategrey sortable sigroktable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!style=&amp;quot;width: 8em;&amp;quot; | Key&lt;br /&gt;
!Description&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;api_version&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| The libsigrokdecode API version which this module uses. This is currently either 2 or 3.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;id&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| A short unique identifier for this protocol decoder. It should be all-lowercase, and only contains a-z, 0-9 and underscores. This must match the PD&amp;#039;s Python module name (subdirectory name in the &amp;#039;&amp;#039;&amp;#039;decoders&amp;#039;&amp;#039;&amp;#039; directory). The [[sigrok-cli]] tool uses this to specify PDs on the command-line. Examples: &amp;#039;jtag&amp;#039;, &amp;#039;sdcard_spi&amp;#039;, &amp;#039;uart&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| The name of the decoder. Used when listing available PDs. Examples: &amp;#039;JTAG&amp;#039;, &amp;#039;SD card (SPI mode)&amp;#039;, &amp;#039;UART&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;longname&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| The (long) name of the decoder. Used when listing available PDs. Example: &amp;#039;Joint Test Action Group (IEEE 1149.1)&amp;#039;, &amp;#039;Secure Digital card (SPI mode)&amp;#039;, &amp;#039;Universal Asynchronous Receiver/Transmitter&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;desc&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| A freeform one-line description of the decoder. Used when listing available PDs. Should end with a full stop. Example: &amp;#039;Protocol for testing, debugging, and flashing ICs.&amp;#039;, &amp;#039;Secure Digital card (SPI mode) low-level protocol.&amp;#039;, &amp;#039;Asynchronous, serial bus.&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;license&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| The license under which the module is provided. This must be either &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;gplv2+&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; (meaning the GNU General Public License 2 or later), or &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;gplv3+&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; (GNU General Public License 3 or later). No other licenses for modules are permitted in libsigrokdecode.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;inputs&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| The list of types of input this decoder needs. If the decoder takes input from a logic analyzer driver, this should be set to &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;logic&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;, which maps to SR_DF_LOGIC, the datafeed type. If it takes input from another PD, it should be set to the value of the &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;outputs&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; key of that PD. It should conform to the same rules as the &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;id&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; key (lowercase, no spaces, and so on).&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;outputs&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| The list of types of output this decoder produces. If this decoder can feed decoded data back into the datafeed stream, its outputs will be identified with this key&amp;#039;s value. It should conform to the same rules as the &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;id&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; key.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;channels&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| This key contains information about the channels (pins) that &amp;#039;&amp;#039;&amp;#039;must&amp;#039;&amp;#039;&amp;#039; be provided to this PD; the PD will not be able to work without them. For example, the [[Protocol_decoder:Spi|SPI]] decoder has to know which channel has the clock signal. This key contains a tuple of channel entries, where each entry is a Python dict with the keys &amp;#039;&amp;#039;&amp;#039;id&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;name&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;desc&amp;#039;&amp;#039;&amp;#039;. Example: &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;{&amp;#039;id&amp;#039;: &amp;#039;rx&amp;#039;, &amp;#039;name&amp;#039;: &amp;#039;RX&amp;#039;, &amp;#039;desc&amp;#039;: &amp;#039;UART receive line&amp;#039;}&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;optional_channels&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| The channels the PD can make use of, but are not strictly required. The key has the same format as that of the &amp;lt;tt&amp;gt;channels&amp;lt;/tt&amp;gt; key above (a tuple of dicts). This tuple is allowed to be empty if the respective protocol decoder has no optional channels.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;options&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| A tuple describing the options for this decoder. Each tuple entry is a Python dict with the keys &amp;#039;&amp;#039;&amp;#039;id&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;desc&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;default&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;values&amp;#039;&amp;#039;&amp;#039;. Example: &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;{&amp;#039;id&amp;#039;: &amp;#039;bitorder&amp;#039;, &amp;#039;desc&amp;#039;: &amp;#039;Bit order&amp;#039;, &amp;#039;default&amp;#039;: &amp;#039;msb-first&amp;#039;, &amp;#039;values&amp;#039;: (&amp;#039;msb-first&amp;#039;, &amp;#039;lsb-first&amp;#039;)}&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;. This tuple can be empty, if the PD has no options.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;annotations&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| A list of annotation classes this protocol decoder can output. Elements of this list are tuples consisting of an identifier string and a human readable description string. The identifier string can be used in the options of [[sigrok-cli]] to select the specific annotation type, and should therefore not contain whitespace or special characters.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;annotation_rows&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| Annotation rows are used to group multiple annotation types together. The elements of this list are three element tuples consisting of:&lt;br /&gt;
* An annotation row ID (same naming rules as for other IDs).&lt;br /&gt;
* A human readable name/description string for the annotation row.&lt;br /&gt;
* A tuple containing the indices of the the annotation classes in the &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;annotations&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; tuple.&lt;br /&gt;
See the [[Protocol_decoder_HOWTO#annotations_.26_annotation_rows|example on the Protocol decoder HOWTO page]] for more information on this attribute.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;binary&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| A list of binary output types this protocol decoder can output, same format as the &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;annotations&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; list.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;div id=&amp;quot;register-function&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;register(output_type)&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
This function is used to register the output that will be generated by the decoder, its argument should be one of the &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;OUTPUT_...&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; constants described above. The function returns an identifier that can then be used as the &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;output_id&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; argument of the &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;[[#put-function|put()]]&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; function.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[Protocol decoder HOWTO#pd.py|pd.py]] for an example.&lt;br /&gt;
&lt;br /&gt;
[[Category:APIs]]&lt;/div&gt;</summary>
		<author><name>Jsolla</name></author>
	</entry>
	<entry>
		<id>https://sigrok.org/w/index.php?title=Protocol_decoder:Cec&amp;diff=14557</id>
		<title>Protocol decoder:Cec</title>
		<link rel="alternate" type="text/html" href="https://sigrok.org/w/index.php?title=Protocol_decoder:Cec&amp;diff=14557"/>
		<updated>2019-11-03T22:10:08Z</updated>

		<summary type="html">&lt;p&gt;Jsolla: /* Current status */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox protocol decoder&lt;br /&gt;
| id              = cec&lt;br /&gt;
| name            = cec&lt;br /&gt;
| description     = HDMI Consumer Electronics Control (CEC) protocol.&lt;br /&gt;
| status          = supported&lt;br /&gt;
| license         = GPLv2+&lt;br /&gt;
| source_code_dir = cec&lt;br /&gt;
| image           = [[File:Cec_hdmi_pinout.png|250px]]&lt;br /&gt;
| input           = logic&lt;br /&gt;
| output          = cec&lt;br /&gt;
| probes          = cec&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Consumer Electronics Control (CEC) is a feature of HDMI designed to allow users to command and control devices connected through HDMI&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
CEC Bus can be found in PIN 13 of the HDMI connector:&lt;br /&gt;
&lt;br /&gt;
[[File:Cec_hdmi_pinout.png]]&lt;br /&gt;
&lt;br /&gt;
== Protocol ==&lt;br /&gt;
&lt;br /&gt;
It is a one-wire bidirectional serial bus that is based on the [https://en.wikipedia.org/wiki/European_Committee_for_Electrotechnical_Standardization CENELEC] standard AV.link protocol to perform remote control functions.&lt;br /&gt;
&lt;br /&gt;
CEC is a separate electrical signal from the other HDMI signals. This allows a device to disable its high-speed HDMI circuitry in sleep mode, but be woken up by CEC. It is a single shared bus, which is directly connected between all HDMI ports on a device, so it can flow through a device which is completely powered off (not just asleep).&lt;br /&gt;
&lt;br /&gt;
The bus is electrically identical to the AV.link protocol, but CEC adds a detailed higher-level message protocol.&lt;br /&gt;
&lt;br /&gt;
The bus is an open-collector line, somewhat like I²C, passively pulled up to +3.3 V, and driven low to transmit a bit.&lt;br /&gt;
&lt;br /&gt;
== Pulseview screenshots ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=800px&amp;gt;&lt;br /&gt;
File:Cec_pulseview_ping_frames.png|&amp;lt;small&amp;gt;Ping (poll) frames&amp;lt;/small&amp;gt;&lt;br /&gt;
File:cec_pulseview_vendor_command_frame.png|&amp;lt;small&amp;gt;Vendor command frame&amp;lt;/small&amp;gt;&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Usage examples ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Print all annotations (very verbose)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
  &amp;#039;&amp;#039;&amp;#039;sigrok-cli -i data.sr -P cec:CEC=CEC&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
    &lt;br /&gt;
  cec-1: ST&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 1&lt;br /&gt;
  cec-1: 1&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0x30&lt;br /&gt;
  cec-1: EOM=N&lt;br /&gt;
  cec-1: ACK&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 1&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0x04&lt;br /&gt;
  cec-1: EOM=Y&lt;br /&gt;
  cec-1: ACK&lt;br /&gt;
  cec-1: 30:04&lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: IMAGE_VIEW_ON | R: ACK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Print frames only&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
  &amp;#039;&amp;#039;&amp;#039;sigrok-cli -i data.sr -P cec:CEC=CEC -A cec=frames&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
  &lt;br /&gt;
  cec-1: 30:04&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 3f:82:10:00&lt;br /&gt;
  cec-1: 30:8f&lt;br /&gt;
  cec-1: 03:90:01&lt;br /&gt;
  cec-1: 30:44:6d&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 30:04&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 30:0d&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 30:04&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 30:8f&lt;br /&gt;
  cec-1: 03:90:01&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 30:04&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Print sections only&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
  &amp;#039;&amp;#039;&amp;#039;sigrok-cli -i data.sr -P cec:CEC=CEC -A cec=sections&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
  &lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: IMAGE_VIEW_ON | R: ACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, Broadcast | OPC: ACTIVE_SOURCE | OPS: 0x10, 0x00 | R: ACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: GIVE_DEVICE_POWER_STATUS | R: ACK&lt;br /&gt;
  cec-1: HDR: TV, Tuner_1 | OPC: REPORT_POWER_STATUS | OPS: 0x01 | R: ACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: USER_CONTROL_PRESSED | OPS: 0x6d | R: ACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: IMAGE_VIEW_ON | R: ACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: TEXT_VIEW_ON | R: ACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: IMAGE_VIEW_ON | R: ACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: GIVE_DEVICE_POWER_STATUS | R: ACK&lt;br /&gt;
  cec-1: HDR: TV, Tuner_1 | OPC: REPORT_POWER_STATUS | OPS: 0x01 | R: ACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: IMAGE_VIEW_ON | R: ACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: GIVE_DEVICE_POWER_STATUS | R: ACK&lt;br /&gt;
  cec-1: HDR: TV, Tuner_1 | OPC: REPORT_POWER_STATUS | OPS: 0x01 | R: ACK&lt;br /&gt;
&lt;br /&gt;
== Current status ==&lt;br /&gt;
&lt;br /&gt;
The CEC protocol decoder is capable of the following:&lt;br /&gt;
&lt;br /&gt;
* Decoding all low level parts: START, BITs, EOM, ACK / NACK&lt;br /&gt;
* Resolve names of all logical addresses&lt;br /&gt;
* Resolve names of all opcodes&lt;br /&gt;
* Detect (and warn) timing errors&lt;br /&gt;
* Detect (and warn) misplaced bits, etc&lt;br /&gt;
&lt;br /&gt;
Not implemented:&lt;br /&gt;
&lt;br /&gt;
* Operands of the opcodes are not parsed, only printed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Protocol decoder]]&lt;/div&gt;</summary>
		<author><name>Jsolla</name></author>
	</entry>
	<entry>
		<id>https://sigrok.org/w/index.php?title=Protocol_decoder_API&amp;diff=14555</id>
		<title>Protocol decoder API</title>
		<link rel="alternate" type="text/html" href="https://sigrok.org/w/index.php?title=Protocol_decoder_API&amp;diff=14555"/>
		<updated>2019-11-03T21:15:45Z</updated>

		<summary type="html">&lt;p&gt;Jsolla: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes how [[libsigrokdecode]] &amp;#039;&amp;#039;&amp;#039;Protocol Decoders ([[Protocol decoders|PDs]])&amp;#039;&amp;#039;&amp;#039; work.&lt;br /&gt;
&lt;br /&gt;
See also [[Protocol decoder HOWTO]] for a quick introduction of how to write your own decoders.&lt;br /&gt;
&lt;br /&gt;
See [[Protocol decoder API/Queries]] for changes to the decoder API in version 3. All decoders use this API now and the v2 API is no longer supported.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
* All PDs are written in Python (&amp;gt;= 3.0).&lt;br /&gt;
* Every PD registers its name, description, capabilities, etc.&lt;br /&gt;
* PDs can be stacked, so the user can construct a decoding pipeline/stack. The control of communication to/from PDs is done by the backend code in libsigrokdecode.&lt;br /&gt;
* The sample data passed into the PDs will be streamed/chunked, so they can run in real time as the data comes in from the hardware (or from a file).&lt;br /&gt;
* In order to keep PDs simple, they don&amp;#039;t have to deal with the intricacies of the datafeed packets.&lt;br /&gt;
&lt;br /&gt;
The frontend passes sample data into libsigrokdecode and gets decoder output (of various types) from every PD in the stack. Which of these output types of which PDs are actually displayed to the user is a matter of configuration or selection by the user; it is possible, for example, to have [[sigrok-cli]] print only the top of the PD stack&amp;#039;s annotation output on stdout.&lt;br /&gt;
&lt;br /&gt;
== API ==&lt;br /&gt;
&lt;br /&gt;
=== Backend library ===&lt;br /&gt;
&lt;br /&gt;
A Python module called &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;sigrokdecode&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; is provided. Every protocol decoder must import this. It contains the following items:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;the Decoder object&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Every protocol decoder must subclass this object.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;OUTPUT_ANN&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
A constant used to register annotation output, used as argument to the &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;[[#register-function|register()]]&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; function. [[Sigrok-cli|sigrok-cli]] shows the annotation output of a decoder stack&amp;#039;s topmost decoder (per default), [[PulseView]] shows annotation output as graphical boxes or as circles (if the duration of the annotation is zero).&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;OUTPUT_PYTHON&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
A constant used to register Python output, used as argument to the &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;[[#register-function|register()]]&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; function. Python output is passed as input to a decoder that is stacked onto the current decoder. The format of the data that is given to the &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;[[#put-function|put()]]&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; function is specific to a certain PD and should be documented for the authors of the higher level decoders, for example with a comment at the top of the decoder&amp;#039;s source file.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;OUTPUT_BINARY&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
A constant used to register binary output, used as argument to the &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;[[#register-function|register()]]&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; function. The format of the data that is outputted is not specified, it&amp;#039;s up to the author of the decoder to choose one (or multiple) appropriate format(s). For example, the [[Protocol_decoder:Uart|UART]] decoder outputs the raw bytes that it decodes, the [[Protocol_decoder:I2s|I²S]] decoder outputs the audio in WAV format, but the output could also be an image (JPG, PNG, other) file for a decoder that decodes a display protocol, a PCAP file for network/USB decoders, or one of [[Protocol decoder output|many other]] formats. [[Sigrok-cli|sigrok-cli]] can be used to redirect the binary output of a decoder into a file (or to pipe it into other applications), see the documentation of its &amp;#039;&amp;#039;&amp;#039;--protocol-decoder-binary&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;-B&amp;#039;&amp;#039;&amp;#039;) option.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;OUTPUT_META&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
A constant used to register metadata output, used as argument to the &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;[[#register-function|register()]]&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; function. An example for a PD that outputs metadata is the SPI decoder that uses it to output the detected bitrate. See [[Protocol decoder output]] for various other possible examples.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;div id=&amp;quot;put-function&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;put(startsample, endsample, output_id, data)&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
This is used to provide the decoded data back into the backend. &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;startsample&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;endsample&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; specify the absolute sample numbers of where this item (e.g. an annotation) starts and ends. &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;output_id&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; is an output identifier returned by the &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;[[#register-function|register()]]&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; function.&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;data&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; parameter&amp;#039;s contents depend on the output type (&amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;output_id&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;):&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OUTPUT_ANN&amp;#039;&amp;#039;&amp;#039;: The &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;data&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; parameter is a Python list with two items. The first item is the annotation index (determined by the order of items in &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;Decoder.annotations&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;, see [[#Decoder_registration|below]]), the second is a list of annotation strings. The strings should be longer and shorter versions of the same annotation text (sorted by length, longest first), which can be used by frontends to show different annotation texts depending on e.g. zoom level.&lt;br /&gt;
** Example: &amp;#039;&amp;#039;&amp;lt;tt&amp;gt;self.put(10, 20, self.out_ann, [4, [&amp;#039;Start&amp;#039;, &amp;#039;St&amp;#039;, &amp;#039;S&amp;#039;]])&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*** The emitted data spans samples 10 to 20, is of type OUTPUT_ANN, the annotation index is 4, the list of annotations strings is &amp;quot;Start&amp;quot;, &amp;quot;St&amp;quot;, &amp;quot;S&amp;quot;.&lt;br /&gt;
** Example: &amp;#039;&amp;#039;&amp;lt;tt&amp;gt;self.put(10, 20, self.out_ann, [4, [&amp;#039;CRC&amp;#039;]])&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*** The emitted data spans samples 10 to 20, is of type OUTPUT_ANN, the annotation index is 4, the list of annotations strings is just &amp;quot;CRC&amp;quot; (the list containins only one item).&lt;br /&gt;
** Example: &amp;#039;&amp;#039;&amp;lt;tt&amp;gt;self.put(35, 9000, self.out_ann, [17, [&amp;#039;Registered Parameter Number&amp;#039;, &amp;#039;Reg Param Num&amp;#039;, &amp;#039;RPN&amp;#039;, &amp;#039;R&amp;#039;]])&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*** The emitted data spans samples 35 to 9000, is of type OUTPUT_ANN, the annotation index is 17, the list of annotations strings is &amp;quot;Registered Parameter Number&amp;quot;, &amp;quot;Reg Param Num&amp;quot;, &amp;quot;RPN&amp;quot;, &amp;quot;R&amp;quot;.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OUTPUT_PYTHON&amp;#039;&amp;#039;&amp;#039;: The &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;data&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; parameter is any arbitrary Python object that will be passed to stacked decoders. The format and contents are entirely decoder-dependent. Typically a Python list with various contents is passed to the stacked PDs.&lt;br /&gt;
** Example: &amp;#039;&amp;#039;&amp;lt;tt&amp;gt;self.put(10, 20, self.out_python, [&amp;#039;PACKET&amp;#039;, [&amp;#039;Foo&amp;#039;, 19.7, [1, 2, 3], (&amp;#039;bar&amp;#039;, &amp;#039;baz&amp;#039;)]])&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*** The emitted data spans samples 10 to 20, is of type OUTPUT_PYTHON, the data contents themselves are entirely dependent on the respective decoder and should be documented in its [[Protocol_decoder_HOWTO#pd.py|pd.py]] file.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OUTPUT_BINARY&amp;#039;&amp;#039;&amp;#039;: The &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;data&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; parameter is a Python list with two items. The first item is the binary format&amp;#039;s index (determined by the order of items in &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;Decoder.binary&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;, see [[#Decoder_registration|below]]), the second is a Python [https://docs.python.org/3/library/stdtypes.html#typebytes &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;bytes&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;] object.&lt;br /&gt;
** Example: &amp;#039;&amp;#039;&amp;lt;tt&amp;gt;self.put(10, 20, self.out_binary, [4, b&amp;#039;\xfe\x55\xaa&amp;#039;])&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*** The emitted data spans samples 10 to 20, is of type OUTPUT_BINARY, the binary format&amp;#039;s index is 4, the emitted bytes are 0xfe, 0x55, 0xaa.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OUTPUT_META&amp;#039;&amp;#039;&amp;#039;: The &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;data&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; parameter is a Python object of a certain type, as defined in the respective &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;[[#register-function|register()]]&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; function.&lt;br /&gt;
** Example: &amp;#039;&amp;#039;&amp;lt;tt&amp;gt;self.put(10, 20, self.out_meta, 15.7)&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*** The emitted data spans samples 10 to 20, is of type OUTPUT_META, the data itself is a floating point number in this case.&lt;br /&gt;
** Example: &amp;#039;&amp;#039;&amp;lt;tt&amp;gt;self.put(10, 20, self.out_meta, 42)&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*** The emitted data spans samples 10 to 20, is of type OUTPUT_META, the data itself is an integer number in this case.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Decoder class functions ===&lt;br /&gt;
&lt;br /&gt;
==== Required functions ====&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;start(self)&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
This function is called before the beginning of the decoding. This is the place to &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;[[#register-function|register()]]&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; the output types, check the user-supplied PD options for validity, and so on.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;div id=&amp;quot;decode-and-wait-function-&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;decode(self)&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;In logic decoders&amp;#039;&amp;#039;&amp;#039;, this function is called by the [[libsigrokdecode]] backend to start the decoding.&lt;br /&gt;
&lt;br /&gt;
It takes no arguments, but instead will enter an infinite loop and gets samples by calling the more versatile &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;[[Protocol_decoder_API/Queries#self.wait()|wait()]]&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; method. This frees specific protocol decoders from tedious yet common tasks like detecting edges, or sampling signals at specific points in time relative to the current position.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; This &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;decode(self)&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; method&amp;#039;s signature has been introduced in version 3 of the protocol decoder API, in previous versions only &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;decode(self, startsample, endsample, data)&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; was available.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;div id=&amp;quot;decode-function&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;decode(self, startsample, endsample, data)&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;In stacked decoders&amp;#039;&amp;#039;&amp;#039;, this is a function that is called by the [[libsigrokdecode]] backend whenever it has a chunk of data for the protocol decoder to handle.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; style=&amp;quot;font-size: smaller;&amp;quot; class=&amp;quot;alternategrey sortable sigroktable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!style=&amp;quot;width: 8em;&amp;quot; | Argument&lt;br /&gt;
!Description&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;startsample&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| The absolute samplenumber of the first sample in this chunk of data.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;endsample&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| The absolute samplenumber of the last sample in this chunk of data.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;data&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| A list containing the data to decode. Depending on whether the decoder decodes raw samples or is stacked onto another decoder, this argument is:&lt;br /&gt;
* Raw samples (&amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;inputs = [&amp;#039;logic&amp;#039;]&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;):&lt;br /&gt;
  &amp;lt;blockquote&amp;gt;&lt;br /&gt;
  &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;data&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; is a list of tuples containing the (absolute) sample number and the channels of that sample: &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;[(samplenum, channels), (samplenum, channels), ...]&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;.&amp;lt;br /&amp;gt;&lt;br /&gt;
  &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;samplenum&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; is the (absolute) number of the sample, an integer that takes the values from &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;startsample&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; to &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;endsample&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; - 1.&amp;lt;br /&amp;gt;&lt;br /&gt;
  The type of &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;channels&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; is [https://docs.python.org/3/library/stdtypes.html#typebytes &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;bytes&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;],&lt;br /&gt;
  a sequence type whose length is the sum of the lengths of &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;channels&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;optional_channels&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
  (in other words, &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;channels&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; contains a byte for every channel/optional channel).&amp;lt;br /&amp;gt;&lt;br /&gt;
  The order of the bytes is the same as the order of the channels in &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;channels&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;optional_channels&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;.&amp;lt;br&amp;gt;&lt;br /&gt;
  The individual bytes take the values &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;0&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;1&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;, or some other value for optional channels that aren&amp;#039;t supplied to the decoder.&amp;lt;br&amp;gt;&lt;br /&gt;
  The [[Protocol_decoder_HOWTO#channels_.26_optional_channels|Protocol decoder HOWTO]] page contains an example how the data can be processed.&lt;br /&gt;
  &amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Stacked decoder (&amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;inputs = [&amp;#039;&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;id of some other decoder&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;&amp;#039;]&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;):&lt;br /&gt;
  &amp;lt;blockquote&amp;gt;&lt;br /&gt;
  &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;data&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; is the &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;OUTPUT_PYTHON&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; output of the decoder this PD is stacked upon.&lt;br /&gt;
  Its format depends on the implementation of the underlying decoder and should be documented there.&lt;br /&gt;
  &amp;lt;/blockquote&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Optional functions ====&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;metadata(self, key, value)&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Used to pass the decoder metadata about the data stream. Currently the only value for &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;key&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; is &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;sigrokdecode.SRD_CONF_SAMPLERATE&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;value&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; is then the sample rate of the data stream in Hz. &lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Decoder registration ===&lt;br /&gt;
&lt;br /&gt;
A PD&amp;#039;s &amp;#039;&amp;#039;&amp;#039;Decoder&amp;#039;&amp;#039;&amp;#039; class must contain a few attributes specifying metadata about the PD. The following keys can be used:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; style=&amp;quot;font-size: smaller;&amp;quot; class=&amp;quot;alternategrey sortable sigroktable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!style=&amp;quot;width: 8em;&amp;quot; | Key&lt;br /&gt;
!Description&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;api_version&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| The libsigrokdecode API version which this module uses. This is currently either 2 or 3.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;id&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| A short unique identifier for this protocol decoder. It should be all-lowercase, and only contains a-z, 0-9 and underscores. This must match the PD&amp;#039;s Python module name (subdirectory name in the &amp;#039;&amp;#039;&amp;#039;decoders&amp;#039;&amp;#039;&amp;#039; directory). The [[sigrok-cli]] tool uses this to specify PDs on the command-line. Examples: &amp;#039;jtag&amp;#039;, &amp;#039;sdcard_spi&amp;#039;, &amp;#039;uart&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| The name of the decoder. Used when listing available PDs. Examples: &amp;#039;JTAG&amp;#039;, &amp;#039;SD card (SPI mode)&amp;#039;, &amp;#039;UART&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;longname&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| The (long) name of the decoder. Used when listing available PDs. Example: &amp;#039;Joint Test Action Group (IEEE 1149.1)&amp;#039;, &amp;#039;Secure Digital card (SPI mode)&amp;#039;, &amp;#039;Universal Asynchronous Receiver/Transmitter&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;desc&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| A freeform one-line description of the decoder. Used when listing available PDs. Should end with a full stop. Example: &amp;#039;Protocol for testing, debugging, and flashing ICs.&amp;#039;, &amp;#039;Secure Digital card (SPI mode) low-level protocol.&amp;#039;, &amp;#039;Asynchronous, serial bus.&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;license&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| The license under which the module is provided. This must be either &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;gplv2+&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; (meaning the GNU General Public License 2 or later), or &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;gplv3+&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; (GNU General Public License 3 or later). No other licenses for modules are permitted in libsigrokdecode.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;inputs&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| The list of types of input this decoder needs. If the decoder takes input from a logic analyzer driver, this should be set to &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;logic&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;, which maps to SR_DF_LOGIC, the datafeed type. If it takes input from another PD, it should be set to the value of the &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;outputs&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; key of that PD. It should conform to the same rules as the &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;id&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; key (lowercase, no spaces, and so on).&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;outputs&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| The list of types of output this decoder produces. If this decoder can feed decoded data back into the datafeed stream, its outputs will be identified with this key&amp;#039;s value. It should conform to the same rules as the &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;id&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; key.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;channels&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| This key contains information about the channels (pins) that &amp;#039;&amp;#039;&amp;#039;must&amp;#039;&amp;#039;&amp;#039; be provided to this PD; the PD will not be able to work without them. For example, the [[Protocol_decoder:Spi|SPI]] decoder has to know which channel has the clock signal. This key contains a tuple of channel entries, where each entry is a Python dict with the keys &amp;#039;&amp;#039;&amp;#039;id&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;name&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;desc&amp;#039;&amp;#039;&amp;#039;. Example: &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;{&amp;#039;id&amp;#039;: &amp;#039;rx&amp;#039;, &amp;#039;name&amp;#039;: &amp;#039;RX&amp;#039;, &amp;#039;desc&amp;#039;: &amp;#039;UART receive line&amp;#039;}&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;optional_channels&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| The channels the PD can make use of, but are not strictly required. The key has the same format as that of the &amp;lt;tt&amp;gt;channels&amp;lt;/tt&amp;gt; key above (a tuple of dicts). This tuple is allowed to be empty if the respective protocol decoder has no optional channels.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;options&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| A tuple describing the options for this decoder. Each tuple entry is a Python dict with the keys &amp;#039;&amp;#039;&amp;#039;id&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;desc&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;default&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;values&amp;#039;&amp;#039;&amp;#039;. Example: &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;{&amp;#039;id&amp;#039;: &amp;#039;bitorder&amp;#039;, &amp;#039;desc&amp;#039;: &amp;#039;Bit order&amp;#039;, &amp;#039;default&amp;#039;: &amp;#039;msb-first&amp;#039;, &amp;#039;values&amp;#039;: (&amp;#039;msb-first&amp;#039;, &amp;#039;lsb-first&amp;#039;)}&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;. This tuple can be empty, if the PD has no options.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;annotations&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| A list of annotation classes this protocol decoder can output. Elements of this list are tuples consisting of an identifier string and a human readable description string. The identifier string can be used in the options of [[sigrok-cli]] to select the specific annotation type, and should therefore not contain whitespace or special characters.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;annotation_rows&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| Annotation rows are used to group multiple annotation types together. The elements of this list are three element tuples consisting of:&lt;br /&gt;
* An annotation row ID (same naming rules as for other IDs).&lt;br /&gt;
* A human readable name/description string for the annotation row.&lt;br /&gt;
* A tuple containing the indices of the the annotation classes in the &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;annotations&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; tuple.&lt;br /&gt;
See the [[Protocol_decoder_HOWTO#annotations_.26_annotation_rows|example on the Protocol decoder HOWTO page]] for more information on this attribute.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;binary&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| A list of binary output types this protocol decoder can output, same format as the &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;annotations&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; list.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;div id=&amp;quot;register-function&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;register(output_type)&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
This function is used to register the output that will be generated by the decoder, its argument should be one of the &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;OUTPUT_...&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; constants described above. The function returns an identifier that can then be used as the &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;output_id&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; argument of the &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;[[#put-function|put()]]&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; function.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[Protocol decoder HOWTO#pd.py|pd.py]] for an example.&lt;br /&gt;
&lt;br /&gt;
[[Category:APIs]]&lt;/div&gt;</summary>
		<author><name>Jsolla</name></author>
	</entry>
	<entry>
		<id>https://sigrok.org/w/index.php?title=Protocol_decoder_API&amp;diff=14554</id>
		<title>Protocol decoder API</title>
		<link rel="alternate" type="text/html" href="https://sigrok.org/w/index.php?title=Protocol_decoder_API&amp;diff=14554"/>
		<updated>2019-11-03T20:57:56Z</updated>

		<summary type="html">&lt;p&gt;Jsolla: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes how [[libsigrokdecode]] &amp;#039;&amp;#039;&amp;#039;Protocol Decoders ([[Protocol decoders|PDs]])&amp;#039;&amp;#039;&amp;#039; work.&lt;br /&gt;
&lt;br /&gt;
See also [[Protocol decoder HOWTO]] for a quick introduction of how to write your own decoders.&lt;br /&gt;
&lt;br /&gt;
See [[Protocol decoder API/Queries]] for changes to the decoder API in version 3. All decoders use this API now and the v2 API is no longer supported.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
* All PDs are written in Python (&amp;gt;= 3.0).&lt;br /&gt;
* Every PD registers its name, description, capabilities, etc.&lt;br /&gt;
* PDs can be stacked, so the user can construct a decoding pipeline/stack. The control of communication to/from PDs is done by the backend code in libsigrokdecode.&lt;br /&gt;
* The sample data passed into the PDs will be streamed/chunked, so they can run in real time as the data comes in from the hardware (or from a file).&lt;br /&gt;
* In order to keep PDs simple, they don&amp;#039;t have to deal with the intricacies of the datafeed packets.&lt;br /&gt;
&lt;br /&gt;
The frontend passes sample data into libsigrokdecode and gets decoder output (of various types) from every PD in the stack. Which of these output types of which PDs are actually displayed to the user is a matter of configuration or selection by the user; it is possible, for example, to have [[sigrok-cli]] print only the top of the PD stack&amp;#039;s annotation output on stdout.&lt;br /&gt;
&lt;br /&gt;
== API ==&lt;br /&gt;
&lt;br /&gt;
=== Backend library ===&lt;br /&gt;
&lt;br /&gt;
A Python module called &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;sigrokdecode&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; is provided. Every protocol decoder must import this. It contains the following items:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;the Decoder object&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Every protocol decoder must subclass this object.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;OUTPUT_ANN&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
A constant used to register annotation output, used as argument to the &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;[[#register-function|register()]]&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; function. [[Sigrok-cli|sigrok-cli]] shows the annotation output of a decoder stack&amp;#039;s topmost decoder (per default), [[PulseView]] shows annotation output as graphical boxes or as circles (if the duration of the annotation is zero).&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;OUTPUT_PYTHON&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
A constant used to register Python output, used as argument to the &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;[[#register-function|register()]]&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; function. Python output is passed as input to a decoder that is stacked onto the current decoder. The format of the data that is given to the &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;[[#put-function|put()]]&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; function is specific to a certain PD and should be documented for the authors of the higher level decoders, for example with a comment at the top of the decoder&amp;#039;s source file.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;OUTPUT_BINARY&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
A constant used to register binary output, used as argument to the &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;[[#register-function|register()]]&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; function. The format of the data that is outputted is not specified, it&amp;#039;s up to the author of the decoder to choose one (or multiple) appropriate format(s). For example, the [[Protocol_decoder:Uart|UART]] decoder outputs the raw bytes that it decodes, the [[Protocol_decoder:I2s|I²S]] decoder outputs the audio in WAV format, but the output could also be an image (JPG, PNG, other) file for a decoder that decodes a display protocol, a PCAP file for network/USB decoders, or one of [[Protocol decoder output|many other]] formats. [[Sigrok-cli|sigrok-cli]] can be used to redirect the binary output of a decoder into a file (or to pipe it into other applications), see the documentation of its &amp;#039;&amp;#039;&amp;#039;--protocol-decoder-binary&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;-B&amp;#039;&amp;#039;&amp;#039;) option.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;OUTPUT_META&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
A constant used to register metadata output, used as argument to the &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;[[#register-function|register()]]&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; function. An example for a PD that outputs metadata is the SPI decoder that uses it to output the detected bitrate. See [[Protocol decoder output]] for various other possible examples.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;div id=&amp;quot;put-function&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;put(startsample, endsample, output_id, data)&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
This is used to provide the decoded data back into the backend. &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;startsample&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;endsample&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; specify the absolute sample numbers of where this item (e.g. an annotation) starts and ends. &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;output_id&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; is an output identifier returned by the &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;[[#register-function|register()]]&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; function.&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;data&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; parameter&amp;#039;s contents depend on the output type (&amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;output_id&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;):&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OUTPUT_ANN&amp;#039;&amp;#039;&amp;#039;: The &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;data&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; parameter is a Python list with two items. The first item is the annotation index (determined by the order of items in &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;Decoder.annotations&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;, see [[#Decoder_registration|below]]), the second is a list of annotation strings. The strings should be longer and shorter versions of the same annotation text (sorted by length, longest first), which can be used by frontends to show different annotation texts depending on e.g. zoom level.&lt;br /&gt;
** Example: &amp;#039;&amp;#039;&amp;lt;tt&amp;gt;self.put(10, 20, self.out_ann, [4, [&amp;#039;Start&amp;#039;, &amp;#039;St&amp;#039;, &amp;#039;S&amp;#039;]])&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*** The emitted data spans samples 10 to 20, is of type OUTPUT_ANN, the annotation index is 4, the list of annotations strings is &amp;quot;Start&amp;quot;, &amp;quot;St&amp;quot;, &amp;quot;S&amp;quot;.&lt;br /&gt;
** Example: &amp;#039;&amp;#039;&amp;lt;tt&amp;gt;self.put(10, 20, self.out_ann, [4, [&amp;#039;CRC&amp;#039;]])&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*** The emitted data spans samples 10 to 20, is of type OUTPUT_ANN, the annotation index is 4, the list of annotations strings is just &amp;quot;CRC&amp;quot; (the list containins only one item).&lt;br /&gt;
** Example: &amp;#039;&amp;#039;&amp;lt;tt&amp;gt;self.put(35, 9000, self.out_ann, [17, [&amp;#039;Registered Parameter Number&amp;#039;, &amp;#039;Reg Param Num&amp;#039;, &amp;#039;RPN&amp;#039;, &amp;#039;R&amp;#039;]])&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*** The emitted data spans samples 35 to 9000, is of type OUTPUT_ANN, the annotation index is 17, the list of annotations strings is &amp;quot;Registered Parameter Number&amp;quot;, &amp;quot;Reg Param Num&amp;quot;, &amp;quot;RPN&amp;quot;, &amp;quot;R&amp;quot;.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OUTPUT_PYTHON&amp;#039;&amp;#039;&amp;#039;: The &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;data&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; parameter is any arbitrary Python object that will be passed to stacked decoders. The format and contents are entirely decoder-dependent. Typically a Python list with various contents is passed to the stacked PDs.&lt;br /&gt;
** Example: &amp;#039;&amp;#039;&amp;lt;tt&amp;gt;self.put(10, 20, self.out_python, [&amp;#039;PACKET&amp;#039;, [&amp;#039;Foo&amp;#039;, 19.7, [1, 2, 3], (&amp;#039;bar&amp;#039;, &amp;#039;baz&amp;#039;)]])&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*** The emitted data spans samples 10 to 20, is of type OUTPUT_PYTHON, the data contents themselves are entirely dependent on the respective decoder and should be documented in its [[Protocol_decoder_HOWTO#pd.py|pd.py]] file.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OUTPUT_BINARY&amp;#039;&amp;#039;&amp;#039;: The &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;data&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; parameter is a Python list with two items. The first item is the binary format&amp;#039;s index (determined by the order of items in &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;Decoder.binary&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;, see [[#Decoder_registration|below]]), the second is a Python [https://docs.python.org/3/library/stdtypes.html#typebytes &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;bytes&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;] object.&lt;br /&gt;
** Example: &amp;#039;&amp;#039;&amp;lt;tt&amp;gt;self.put(10, 20, self.out_binary, [4, b&amp;#039;\xfe\x55\xaa&amp;#039;])&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*** The emitted data spans samples 10 to 20, is of type OUTPUT_BINARY, the binary format&amp;#039;s index is 4, the emitted bytes are 0xfe, 0x55, 0xaa.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OUTPUT_META&amp;#039;&amp;#039;&amp;#039;: The &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;data&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; parameter is a Python object of a certain type, as defined in the respective &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;[[#register-function|register()]]&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; function.&lt;br /&gt;
** Example: &amp;#039;&amp;#039;&amp;lt;tt&amp;gt;self.put(10, 20, self.out_meta, 15.7)&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*** The emitted data spans samples 10 to 20, is of type OUTPUT_META, the data itself is a floating point number in this case.&lt;br /&gt;
** Example: &amp;#039;&amp;#039;&amp;lt;tt&amp;gt;self.put(10, 20, self.out_meta, 42)&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*** The emitted data spans samples 10 to 20, is of type OUTPUT_META, the data itself is an integer number in this case.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Decoder class functions ===&lt;br /&gt;
&lt;br /&gt;
==== Required functions ====&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;start(self)&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
This function is called before the beginning of the decoding. This is the place to &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;[[#register-function|register()]]&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; the output types, check the user-supplied PD options for validity, and so on.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;div id=&amp;quot;decode-function&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;decode(self, startsample, endsample, data)&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
This is a function that is called by the [[libsigrokdecode]] backend whenever it has a chunk of data for the protocol decoder to handle.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; style=&amp;quot;font-size: smaller;&amp;quot; class=&amp;quot;alternategrey sortable sigroktable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!style=&amp;quot;width: 8em;&amp;quot; | Argument&lt;br /&gt;
!Description&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;startsample&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| The absolute samplenumber of the first sample in this chunk of data.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;endsample&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| The absolute samplenumber of the last sample in this chunk of data.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;data&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| A list containing the data to decode. Depending on whether the decoder decodes raw samples or is stacked onto another decoder, this argument is:&lt;br /&gt;
* Raw samples (&amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;inputs = [&amp;#039;logic&amp;#039;]&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;):&lt;br /&gt;
  &amp;lt;blockquote&amp;gt;&lt;br /&gt;
  &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;data&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; is a list of tuples containing the (absolute) sample number and the channels of that sample: &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;[(samplenum, channels), (samplenum, channels), ...]&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;.&amp;lt;br /&amp;gt;&lt;br /&gt;
  &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;samplenum&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; is the (absolute) number of the sample, an integer that takes the values from &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;startsample&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; to &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;endsample&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; - 1.&amp;lt;br /&amp;gt;&lt;br /&gt;
  The type of &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;channels&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; is [https://docs.python.org/3/library/stdtypes.html#typebytes &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;bytes&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;],&lt;br /&gt;
  a sequence type whose length is the sum of the lengths of &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;channels&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;optional_channels&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
  (in other words, &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;channels&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; contains a byte for every channel/optional channel).&amp;lt;br /&amp;gt;&lt;br /&gt;
  The order of the bytes is the same as the order of the channels in &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;channels&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;optional_channels&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;.&amp;lt;br&amp;gt;&lt;br /&gt;
  The individual bytes take the values &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;0&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;1&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;, or some other value for optional channels that aren&amp;#039;t supplied to the decoder.&amp;lt;br&amp;gt;&lt;br /&gt;
  The [[Protocol_decoder_HOWTO#channels_.26_optional_channels|Protocol decoder HOWTO]] page contains an example how the data can be processed.&lt;br /&gt;
  &amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Stacked decoder (&amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;inputs = [&amp;#039;&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;id of some other decoder&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;&amp;#039;]&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;):&lt;br /&gt;
  &amp;lt;blockquote&amp;gt;&lt;br /&gt;
  &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;data&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; is the &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;OUTPUT_PYTHON&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; output of the decoder this PD is stacked upon.&lt;br /&gt;
  Its format depends on the implementation of the underlying decoder and should be documented there.&lt;br /&gt;
  &amp;lt;/blockquote&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
When writing a logic decoder, please note the &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;decode()&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; method&amp;#039;s signature has changed in version 3 of the protocol decoder API. It takes no arguments, but instead will enter an infinite loop and gets samples by calling the more versatile &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;wait()&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; method. This frees specific protocol decoders from tedious yet common tasks like detecting edges, or sampling signals at specific points in time relative to the current position.&lt;br /&gt;
&lt;br /&gt;
When writing a stacked decoder, the &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;decode(self, startsample, endsample, data)&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; is still valid.&lt;br /&gt;
&lt;br /&gt;
==== Optional functions ====&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;metadata(self, key, value)&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Used to pass the decoder metadata about the data stream. Currently the only value for &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;key&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; is &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;sigrokdecode.SRD_CONF_SAMPLERATE&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;value&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; is then the sample rate of the data stream in Hz. &lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Decoder registration ===&lt;br /&gt;
&lt;br /&gt;
A PD&amp;#039;s &amp;#039;&amp;#039;&amp;#039;Decoder&amp;#039;&amp;#039;&amp;#039; class must contain a few attributes specifying metadata about the PD. The following keys can be used:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; style=&amp;quot;font-size: smaller;&amp;quot; class=&amp;quot;alternategrey sortable sigroktable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!style=&amp;quot;width: 8em;&amp;quot; | Key&lt;br /&gt;
!Description&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;api_version&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| The libsigrokdecode API version which this module uses. This is currently either 2 or 3.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;id&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| A short unique identifier for this protocol decoder. It should be all-lowercase, and only contains a-z, 0-9 and underscores. This must match the PD&amp;#039;s Python module name (subdirectory name in the &amp;#039;&amp;#039;&amp;#039;decoders&amp;#039;&amp;#039;&amp;#039; directory). The [[sigrok-cli]] tool uses this to specify PDs on the command-line. Examples: &amp;#039;jtag&amp;#039;, &amp;#039;sdcard_spi&amp;#039;, &amp;#039;uart&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| The name of the decoder. Used when listing available PDs. Examples: &amp;#039;JTAG&amp;#039;, &amp;#039;SD card (SPI mode)&amp;#039;, &amp;#039;UART&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;longname&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| The (long) name of the decoder. Used when listing available PDs. Example: &amp;#039;Joint Test Action Group (IEEE 1149.1)&amp;#039;, &amp;#039;Secure Digital card (SPI mode)&amp;#039;, &amp;#039;Universal Asynchronous Receiver/Transmitter&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;desc&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| A freeform one-line description of the decoder. Used when listing available PDs. Should end with a full stop. Example: &amp;#039;Protocol for testing, debugging, and flashing ICs.&amp;#039;, &amp;#039;Secure Digital card (SPI mode) low-level protocol.&amp;#039;, &amp;#039;Asynchronous, serial bus.&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;license&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| The license under which the module is provided. This must be either &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;gplv2+&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; (meaning the GNU General Public License 2 or later), or &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;gplv3+&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; (GNU General Public License 3 or later). No other licenses for modules are permitted in libsigrokdecode.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;inputs&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| The list of types of input this decoder needs. If the decoder takes input from a logic analyzer driver, this should be set to &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;logic&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;, which maps to SR_DF_LOGIC, the datafeed type. If it takes input from another PD, it should be set to the value of the &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;outputs&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; key of that PD. It should conform to the same rules as the &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;id&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; key (lowercase, no spaces, and so on).&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;outputs&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| The list of types of output this decoder produces. If this decoder can feed decoded data back into the datafeed stream, its outputs will be identified with this key&amp;#039;s value. It should conform to the same rules as the &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;id&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; key.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;channels&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| This key contains information about the channels (pins) that &amp;#039;&amp;#039;&amp;#039;must&amp;#039;&amp;#039;&amp;#039; be provided to this PD; the PD will not be able to work without them. For example, the [[Protocol_decoder:Spi|SPI]] decoder has to know which channel has the clock signal. This key contains a tuple of channel entries, where each entry is a Python dict with the keys &amp;#039;&amp;#039;&amp;#039;id&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;name&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;desc&amp;#039;&amp;#039;&amp;#039;. Example: &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;{&amp;#039;id&amp;#039;: &amp;#039;rx&amp;#039;, &amp;#039;name&amp;#039;: &amp;#039;RX&amp;#039;, &amp;#039;desc&amp;#039;: &amp;#039;UART receive line&amp;#039;}&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;optional_channels&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| The channels the PD can make use of, but are not strictly required. The key has the same format as that of the &amp;lt;tt&amp;gt;channels&amp;lt;/tt&amp;gt; key above (a tuple of dicts). This tuple is allowed to be empty if the respective protocol decoder has no optional channels.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;options&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| A tuple describing the options for this decoder. Each tuple entry is a Python dict with the keys &amp;#039;&amp;#039;&amp;#039;id&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;desc&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;default&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;values&amp;#039;&amp;#039;&amp;#039;. Example: &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;{&amp;#039;id&amp;#039;: &amp;#039;bitorder&amp;#039;, &amp;#039;desc&amp;#039;: &amp;#039;Bit order&amp;#039;, &amp;#039;default&amp;#039;: &amp;#039;msb-first&amp;#039;, &amp;#039;values&amp;#039;: (&amp;#039;msb-first&amp;#039;, &amp;#039;lsb-first&amp;#039;)}&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;. This tuple can be empty, if the PD has no options.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;annotations&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| A list of annotation classes this protocol decoder can output. Elements of this list are tuples consisting of an identifier string and a human readable description string. The identifier string can be used in the options of [[sigrok-cli]] to select the specific annotation type, and should therefore not contain whitespace or special characters.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;annotation_rows&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| Annotation rows are used to group multiple annotation types together. The elements of this list are three element tuples consisting of:&lt;br /&gt;
* An annotation row ID (same naming rules as for other IDs).&lt;br /&gt;
* A human readable name/description string for the annotation row.&lt;br /&gt;
* A tuple containing the indices of the the annotation classes in the &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;annotations&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; tuple.&lt;br /&gt;
See the [[Protocol_decoder_HOWTO#annotations_.26_annotation_rows|example on the Protocol decoder HOWTO page]] for more information on this attribute.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;binary&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| A list of binary output types this protocol decoder can output, same format as the &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;annotations&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; list.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;div id=&amp;quot;register-function&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;register(output_type)&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
This function is used to register the output that will be generated by the decoder, its argument should be one of the &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;OUTPUT_...&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; constants described above. The function returns an identifier that can then be used as the &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;output_id&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; argument of the &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;[[#put-function|put()]]&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; function.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[Protocol decoder HOWTO#pd.py|pd.py]] for an example.&lt;br /&gt;
&lt;br /&gt;
[[Category:APIs]]&lt;/div&gt;</summary>
		<author><name>Jsolla</name></author>
	</entry>
	<entry>
		<id>https://sigrok.org/w/index.php?title=Protocol_decoders&amp;diff=14553</id>
		<title>Protocol decoders</title>
		<link rel="alternate" type="text/html" href="https://sigrok.org/w/index.php?title=Protocol_decoders&amp;diff=14553"/>
		<updated>2019-11-03T20:22:49Z</updated>

		<summary type="html">&lt;p&gt;Jsolla: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a list of &amp;#039;&amp;#039;&amp;#039;supported protocol decoders (PDs)&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;decoders which we might want to write in the future&amp;#039;&amp;#039;&amp;#039; (or users might want to contribute).&lt;br /&gt;
&lt;br /&gt;
See [[Protocol decoder API]] for details on how the decoders work in sigrok, and [[Protocol decoder HOWTO]] for a quick introduction about how to write your own decoders.&lt;br /&gt;
&lt;br /&gt;
== Supported protocol decoders ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Generated via sigrok-cli --list-supported-wiki. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Number of currently supported protocol decoders: &amp;#039;&amp;#039;&amp;#039;102&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; style=&amp;quot;font-size: smaller&amp;quot; class=&amp;quot;alternategrey sortable sigroktable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Protocol&lt;br /&gt;
!Tags&lt;br /&gt;
!Input IDs&lt;br /&gt;
!Output IDs&lt;br /&gt;
!Status&lt;br /&gt;
!Full name&lt;br /&gt;
!Description&lt;br /&gt;
&lt;br /&gt;
{{pd|ac97|AC &amp;#039;97|Audio Codec &amp;#039;97|Audio and modem control for PC systems.|Audio, PC|logic|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|ade77xx|ADE77xx|Analog Devices ADE77xx|Poly phase multifunction energy metering IC protocol.|Analog/digital, IC, Sensor|spi|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|adf435x|ADF435x|Analog Devices ADF4350/1|Wideband synthesizer with integrated VCO.|Clock/timing, IC, Wireless/RF|spi|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|adns5020|ADNS-5020|Avago ADNS-5020|Bidirectional optical mouse sensor protocol.|IC, PC, Sensor|spi|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|am230x|AM230x|Aosong AM230x/DHTxx/RHTxx|Aosong AM230x/DHTxx/RHTxx humidity/temperature sensor.|IC, Sensor|logic|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|arm_etmv3|ARM ETMv3|ARM Embedded Trace Macroblock v3|ARM ETM v3 instruction trace protocol.|Debug/trace|uart|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|arm_itm|ARM ITM|ARM Instrumentation Trace Macroblock|ARM Cortex-M / ARMv7m ITM trace protocol.|Debug/trace|uart|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|arm_tpiu|ARM TPIU|ARM Trace Port Interface Unit|Filter TPIU formatted trace data into separate streams.|Debug/trace|uart|uart|supported}}&lt;br /&gt;
{{pd|atsha204a|ATSHA204A|Microchip ATSHA204A|Microchip ATSHA204A family crypto authentication protocol.|Security/crypto, IC, Memory|i2c|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|aud|AUD|Advanced User Debugger|Renesas/Hitachi Advanced User Debugger (AUD) protocol.|Debug/trace|logic|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|avr_isp|AVR ISP|AVR In-System Programming|Atmel AVR In-System Programming (ISP) protocol.|Debug/trace|spi|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|avr_pdi|AVR PDI|Atmel Program and Debug Interface|Atmel ATxmega Program and Debug Interface (PDI) protocol.|Debug/trace|logic|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|can|CAN|Controller Area Network|Field bus protocol for distributed realtime control.|Automotive|logic|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|cc1101|CC1101|Texas Instruments CC1101|Low-power sub-1GHz RF transceiver chip.|IC, Wireless/RF|spi|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|cec|CEC|HDMI-CEC|HDMI Consumer Electronics Control (CEC) protocol.|Display, PC|logic|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|cfp|CFP|100 Gigabit C form-factor pluggable|100 Gigabit C form-factor pluggable (CFP) protocol.|Networking|mdio|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|counter|Counter|Edge counter|Count the number of edges in a signal.|Util|logic|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|dali|DALI|Digital Addressable Lighting Interface|Digital Addressable Lighting Interface (DALI) protocol.|Embedded/industrial, Lighting|logic|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|dcf77|DCF77|DCF77 time protocol|European longwave time signal (77.5kHz carrier signal).|Clock/timing|logic|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|dmx512|DMX512|Digital MultipleX 512|Digital MultipleX 512 (DMX512) lighting protocol.|Embedded/industrial, Lighting|logic|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|ds1307|DS1307|Dallas DS1307|Dallas DS1307 realtime clock module protocol.|Clock/timing, IC|i2c|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|ds2408|DS2408|Maxim DS2408|1-Wire 8-channel addressable switch.|Embedded/industrial, IC|onewire_network|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|ds243x|DS243x|Maxim DS2432/3|Maxim DS243x series 1-Wire EEPROM protocol.|IC, Memory|onewire_network|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|ds28ea00|DS28EA00|Maxim DS28EA00 1-Wire digital thermometer|1-Wire digital thermometer with Sequence Detect and PIO.|IC, Sensor|onewire_network|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|dsi|DSI|Digital Serial Interface|Digital Serial Interface (DSI) lighting protocol.|Embedded/industrial, Lighting|logic|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|edid|EDID|Extended Display Identification Data|Data structure describing display device capabilities.|Display, Memory, PC|i2c|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|eeprom24xx|24xx EEPROM|24xx I²C EEPROM|24xx series I²C EEPROM protocol.|IC, Memory|i2c|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|eeprom93xx|93xx EEPROM|93xx Microwire EEPROM|93xx series Microwire EEPROM protocol.|IC, Memory|microwire|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|em4100|EM4100|RFID EM4100|EM4100 100-150kHz RFID protocol.|IC, RFID|logic|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|em4305|EM4305|RFID EM4205/EM4305|EM4205/EM4305 100-150kHz RFID protocol.|IC, RFID|logic|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|enc28j60|ENC28J60|Microchip ENC28J60|Microchip ENC28J60 10Base-T Ethernet controller protocol.|Embedded/industrial, Networking|spi|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|gpib|GPIB|General Purpose Interface Bus|IEEE-488 General Purpose Interface Bus (GPIB / HPIB).|PC|logic|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|graycode|Gray code|Gray code and rotary encoder|Accumulate rotary encoder increments, provide statistics.|Encoding|logic|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|guess_bitrate|Guess bitrate|Guess bitrate/baudrate|Guess the bitrate/baudrate of a UART (or other) protocol.|Clock/timing, Util|logic|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|i2c|I²C|Inter-Integrated Circuit|Two-wire, multi-master, serial bus.|Embedded/industrial|logic|i2c|supported}}&lt;br /&gt;
{{pd|i2cdemux|I²C demux|I²C demultiplexer|Demux I²C packets into per-slave-address streams.|Util|i2c|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|i2cfilter|I²C filter|I²C filter|Filter out addresses/directions in an I²C stream.|Util|i2c|i2c|supported}}&lt;br /&gt;
{{pd|i2s|I²S|Integrated Interchip Sound|Serial bus for connecting digital audio devices.|Audio, PC|logic|i2s|supported}}&lt;br /&gt;
{{pd|iec|IEC|Commodore IEC bus|Commodore serial IEEE-488 (IEC) bus protocol.|PC, Retro computing|logic|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|ir_nec|IR NEC|IR NEC|NEC infrared remote control protocol.|IR|logic|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|ir_rc5|IR RC-5|IR RC-5|RC-5 infrared remote control protocol.|IR|logic|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|jitter|Jitter|Timing jitter calculation|Retrieves the timing jitter between two digital signals.|Clock/timing, Util|logic|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|jtag|JTAG|Joint Test Action Group (IEEE 1149.1)|Protocol for testing, debugging, and flashing ICs.|Debug/trace|logic|jtag|supported}}&lt;br /&gt;
{{pd|jtag_ejtag|JTAG / EJTAG|Joint Test Action Group / EJTAG (MIPS)|MIPS EJTAG protocol.|Debug/trace|jtag|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|jtag_stm32|JTAG / STM32|Joint Test Action Group / ST STM32|ST STM32-specific JTAG protocol.|Debug/trace|jtag|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|lin|LIN|Local Interconnect Network|Local Interconnect Network (LIN) protocol.|Automotive|uart|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|lm75|LM75|National LM75|National LM75 (and compatibles) temperature sensor.|Sensor|i2c|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|lpc|LPC|Low Pin Count|Protocol for low-bandwidth devices on PC mainboards.|PC|logic|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|maple_bus|Maple bus|SEGA Maple bus|Maple bus peripheral protocol for SEGA Dreamcast.|Retro computing|logic|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|max7219|MAX7219|Maxim MAX7219/MAX7221|Maxim MAX72xx series 8-digit LED display driver.|Display|spi|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|mcs48|MCS-48|Intel MCS-48|Intel MCS-48 external memory access protocol.|Retro computing|logic|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|mdio|MDIO|Management Data Input/Output|MII management bus between MAC and PHY.|Networking|logic|mdio|supported}}&lt;br /&gt;
{{pd|microwire|Microwire|Microwire|3-wire, half-duplex, synchronous serial bus.|Embedded/industrial|logic|microwire|supported}}&lt;br /&gt;
{{pd|midi|MIDI|Musical Instrument Digital Interface|Musical Instrument Digital Interface (MIDI) protocol.|Audio, PC|uart|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|miller|Miller|Miller encoding|Miller encoding protocol.|Encoding|logic|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|mlx90614|MLX90614|Melexis MLX90614|Melexis MLX90614 infrared thermometer protocol.|IC, Sensor|i2c|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|modbus|Modbus|Modbus RTU over RS232/RS485|Modbus RTU protocol for industrial applications.|Embedded/industrial|uart|modbus|supported}}&lt;br /&gt;
{{pd|morse|Morse|Morse code|Demodulated morse code protocol.|Encoding|logic|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|mrf24j40|MRF24J40|Microchip MRF24J40|IEEE 802.15.4 2.4 GHz RF tranceiver chip.|IC, Wireless/RF|spi|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|mxc6225xu|MXC6225XU|MEMSIC MXC6225XU|Digital Thermal Orientation Sensor (DTOS) protocol.|IC, Sensor|i2c|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|nrf24l01|nRF24L01(+)|Nordic Semiconductor nRF24L01(+)|2.4GHz RF transceiver chip.|IC, Wireless/RF|spi|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|nunchuk|Nunchuk|Nintendo Wii Nunchuk|Nintendo Wii Nunchuk controller protocol.|Sensor|i2c|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|onewire_link|1-Wire link layer|1-Wire serial communication bus (link layer)|Bidirectional, half-duplex, asynchronous serial bus.|Embedded/industrial|logic|onewire_link|supported}}&lt;br /&gt;
{{pd|onewire_network|1-Wire network layer|1-Wire serial communication bus (network layer)|Bidirectional, half-duplex, asynchronous serial bus.|Embedded/industrial|onewire_link|onewire_network|supported}}&lt;br /&gt;
{{pd|ook|OOK|On-off keying|On-off keying protocol.|Encoding|logic|ook|supported}}&lt;br /&gt;
{{pd|ook_oregon|Oregon|Oregon Scientific|Oregon Scientific weather sensor protocol.|Sensor|ook|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|ook_vis|OOK visualisation|On-off keying visualisation|OOK visualisation in various formats.|Encoding|ook|ook|supported}}&lt;br /&gt;
{{pd|pan1321|PAN1321|Panasonic PAN1321|Bluetooth RF module with Serial Port Profile (SPP).|Wireless/RF|uart|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|parallel|Parallel|Parallel sync bus|Generic parallel synchronous bus.|Util|logic|parallel|supported}}&lt;br /&gt;
{{pd|pca9571|PCA9571|NXP PCA9571|NXP PCA9571 8-bit I²C output expander.|Embedded/industrial, IC|i2c|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|ps2|PS/2|PS/2|PS/2 keyboard/mouse interface.|PC|logic|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|pwm|PWM|Pulse-width modulation|Analog level encoded in duty cycle percentage.|Encoding|logic|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|qi|Qi|Qi charger protocol|Protocol used by Qi receiver.|Embedded/industrial, Wireless/RF|logic|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|rc_encode|RC encode|Remote control encoder|PT2262/HX2262/SC5262 remote control encoder protocol.|IC, IR|logic|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|rfm12|RFM12|HopeRF RFM12|HopeRF RFM12 wireless transceiver control protocol.|Wireless/RF|spi|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|rgb_led_spi|RGB LED (SPI)|RGB LED string decoder (SPI)|RGB LED string protocol (RGB values clocked over SPI).|Display|spi|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|rgb_led_ws281x|RGB LED (WS281x)|RGB LED string decoder (WS281x)|RGB LED string protocol (WS281x).|Display, IC|logic|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|rtc8564|RTC-8564|Epson RTC-8564 JE/NB|Realtime clock module protocol.|Clock/timing|i2c|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|sda2506|SDA2506|Siemens SDA 2506-5|Serial nonvolatile 1-Kbit EEPROM.|IC, Memory|logic|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|sdcard_sd|SD card (SD mode)|Secure Digital card (SD mode)|Secure Digital card (SD mode) low-level protocol.|Memory|logic|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|sdcard_spi|SD card (SPI mode)|Secure Digital card (SPI mode)|Secure Digital card (SPI mode) low-level protocol.|Memory|spi|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|spdif|S/PDIF|Sony/Philips Digital Interface Format|Serial bus for connecting digital audio devices.|Audio, PC|logic|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|spi|SPI|Serial Peripheral Interface|Full-duplex, synchronous, serial bus.|Embedded/industrial|logic|spi|supported}}&lt;br /&gt;
{{pd|spiflash|SPI flash|SPI flash chips|xx25 series SPI (NOR) flash chip protocol.|IC, Memory|spi|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|ssi32|SSI32|Synchronous Serial Interface (32bit)|Synchronous Serial Interface (32bit) protocol.|Embedded/industrial|spi|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|st7735|ST7735|Sitronix ST7735|Sitronix ST7735 TFT controller protocol.|Display, IC|logic|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|stepper_motor|Stepper motor|Stepper motor position / speed|Absolute position and movement speed from step/dir.|Embedded/industrial|logic|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|swd|SWD|Serial Wire Debug|Two-wire protocol for debug access to ARM CPUs.|Debug/trace|logic|swd|supported}}&lt;br /&gt;
{{pd|swim|SWIM|STM8 SWIM bus|STM8 Single Wire Interface Module (SWIM) protocol.|Debug/trace|logic|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|t55xx|T55xx|RFID T55xx|T55xx 100-150kHz RFID protocol.|IC, RFID|logic|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|tca6408a|TI TCA6408A|Texas Instruments TCA6408A|Texas Instruments TCA6408A 8-bit I²C I/O expander.|Embedded/industrial, IC|i2c|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|timing|Timing|Timing calculation with frequency and averaging|Calculate time between edges.|Clock/timing, Util|logic|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|tlc5620|TI TLC5620|Texas Instruments TLC5620|Texas Instruments TLC5620 8-bit quad DAC.|IC, Analog/digital|logic|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|uart|UART|Universal Asynchronous Receiver/Transmitter|Asynchronous, serial bus.|Embedded/industrial|logic|uart|supported}}&lt;br /&gt;
{{pd|usb_packet|USB packet|Universal Serial Bus (LS/FS) packet|USB (low-speed and full-speed) packet protocol.|PC|usb_signalling|usb_packet|supported}}&lt;br /&gt;
{{pd|usb_power_delivery|USB PD|USB Power Delivery|USB Power Delivery protocol.|PC|logic|usb_pd|supported}}&lt;br /&gt;
{{pd|usb_request|USB request|Universal Serial Bus (LS/FS) transaction/request|USB (low-speed/full-speed) transaction/request protocol.|PC|usb_packet|usb_request|supported}}&lt;br /&gt;
{{pd|usb_signalling|USB signalling|Universal Serial Bus (LS/FS) signalling|USB (low-speed/full-speed) signalling protocol.|PC|logic|usb_signalling|supported}}&lt;br /&gt;
{{pd|wiegand|Wiegand|Wiegand interface|Wiegand interface for electronic entry systems.|Embedded/industrial, RFID|logic|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|x2444m|X2444M/P|Xicor X2444M/P|Xicor X2444M/P nonvolatile static RAM protocol.|IC, Memory|spi|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|xfp|XFP|10 Gigabit Small Form Factor Pluggable Module (XFP)|XFP I²C management interface structures/protocol|Networking|i2c|&amp;amp;mdash;|supported}}&lt;br /&gt;
{{pd|z80|Z80|Zilog Z80 CPU|Zilog Z80 microprocessor disassembly.|Retro computing|logic|&amp;amp;mdash;|supported}}&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Possible candidates for future protocol decoders ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; style=&amp;quot;font-size: smaller&amp;quot; class=&amp;quot;alternategrey sortable sigroktable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Protocol&lt;br /&gt;
!Category&lt;br /&gt;
!Input ID(s)&lt;br /&gt;
!Output ID(s)&lt;br /&gt;
!Status&lt;br /&gt;
!Description&lt;br /&gt;
!Comments&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| SA8807A&lt;br /&gt;
| Displays&lt;br /&gt;
| spi&lt;br /&gt;
|&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
| SPI-attached LCD. Datasheet: [http://pdf1.alldatasheet.com/datasheet-pdf/view/36922/SAMES/SA8807A.html Sames SA8807A].&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| EA eDIPTFT43-A&lt;br /&gt;
| Displays&lt;br /&gt;
| i2c&lt;br /&gt;
|&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
| I2C-attached LCD. Datasheet: [http://www.lcd-module.de/pdf/grafik/ediptft43-a.pdf EA eDIPTFT43-A].&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Analog Devices AD7291&lt;br /&gt;
| ADC&lt;br /&gt;
| i2c&lt;br /&gt;
|&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
| I2C-attached ADC. Datasheet: [http://pdf1.alldatasheet.com/datasheet-pdf/view/318172/AD/AD7291.html Analog Devices AD7291].&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Analog Devices ADS1258&lt;br /&gt;
| ADC&lt;br /&gt;
| spi&lt;br /&gt;
| ads1258&lt;br /&gt;
| bgcolor=&amp;quot;orange&amp;quot; | 0%&lt;br /&gt;
| SPI-attached ADC.&lt;br /&gt;
| Planned (Uwe Hermann).&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Microchip MCP3901&lt;br /&gt;
| ADC&lt;br /&gt;
| spi&lt;br /&gt;
| mcp3901&lt;br /&gt;
| bgcolor=&amp;quot;orange&amp;quot; | 0%&lt;br /&gt;
| Can be controlled via a parallel protocol, or SPI, or I2C.&lt;br /&gt;
| Planned (Uwe Hermann).&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| JTAG / TMPA9xx&lt;br /&gt;
| Flash/debug&lt;br /&gt;
| jtag&lt;br /&gt;
| jtag_tmpa9xx&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
| Toshiba TMPA9xx specific JTAG protocol details.&lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| USB transfer&lt;br /&gt;
| USB&lt;br /&gt;
| usb_request&lt;br /&gt;
| usb_transfer&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| USB / HID&lt;br /&gt;
| USB&lt;br /&gt;
| usb_transfer&lt;br /&gt;
| usb_hid&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| USB / CDC&lt;br /&gt;
| USB&lt;br /&gt;
| usb_transfer&lt;br /&gt;
| usb_cdc&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| USB / USBTMC&lt;br /&gt;
| USB&lt;br /&gt;
| usb_transfer&lt;br /&gt;
| usb_usbtmc&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Dallas DS1985&lt;br /&gt;
| Other&lt;br /&gt;
| onewire_network&lt;br /&gt;
| &lt;br /&gt;
| bgcolor=&amp;quot;orange&amp;quot; | 0%&lt;br /&gt;
| Dallas DS1985 iButton (1-Wire) device.&lt;br /&gt;
| Planned (Uwe Hermann).&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| UNI/O&lt;br /&gt;
| Embedded&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
|&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| [https://en.wikipedia.org/wiki/Synchronous_Serial_Interface SSI]&lt;br /&gt;
| Embedded&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
|&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
| Synchronous Serial Interface&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| CompactFlash&lt;br /&gt;
| Memory&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| &lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| MMC&lt;br /&gt;
| Memory&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| &lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Memory Stick&lt;br /&gt;
| Memory&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| &lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| SmartMedia&lt;br /&gt;
| Memory&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| &lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| xD-Picture Card&lt;br /&gt;
| Memory&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| &lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| [https://en.wikipedia.org/wiki/ISO/IEC_7816 ISO 7816]&lt;br /&gt;
| Smartcards&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| &lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| FlexRay&lt;br /&gt;
| Automotive&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
|&lt;br /&gt;
| bgcolor=&amp;quot;yellow&amp;quot; | 99%&lt;br /&gt;
| [http://en.wikipedia.org/wiki/Flexray FlexRay] is an automotive network communications protocol.&lt;br /&gt;
| Work in progress ([[User:Stephan_Thiele|Stephan Thiele]]).&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| AVR TPI&lt;br /&gt;
| Flash/debug&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
|&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
| Atmel Tiny Programming Interface (TPI) protocol.&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| FWH&lt;br /&gt;
| PC&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
|&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| ISA&lt;br /&gt;
| PC&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
|&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| PCI&lt;br /&gt;
| PC&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
|&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| SMBus&lt;br /&gt;
| PC&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
|&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| IDE&lt;br /&gt;
| PC&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
|&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| SCSI&lt;br /&gt;
| PC&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
|&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| [https://en.wikipedia.org/wiki/Platform_Environment_Control_Interface PECI]&lt;br /&gt;
| PC&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
|&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
| Platform Environment Control Interface&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| [https://en.wikipedia.org/wiki/SVID SVID]&lt;br /&gt;
| PC&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
|&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
| Serial Voltage Identification&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| [[Protocol_decoder:mfm|MFM]]&lt;br /&gt;
| PC&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
|&lt;br /&gt;
| bgcolor=&amp;quot;yellow&amp;quot; | 90%&lt;br /&gt;
| Floppy disk FM and [https://en.wikipedia.org/wiki/Modified_Frequency_Modulation MFM].&lt;br /&gt;
| Work in progress (David Wiens).&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| HD Audio&lt;br /&gt;
| Audio&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
|&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Nokia NRC17&lt;br /&gt;
| IR&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
|&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Sony SIRC&lt;br /&gt;
| IR&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
|&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Philips RC-6&lt;br /&gt;
| IR&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
|&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Philips RC-MM&lt;br /&gt;
| IR&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
|&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Philips RECS80&lt;br /&gt;
| IR&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
|&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| [http://en.wikipedia.org/wiki/Infrared_Data_Association IrDA]&lt;br /&gt;
| Misc&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
|&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| HD44780&lt;br /&gt;
| Displays&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
|&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
| [http://en.wikipedia.org/wiki/HD44780_Character_LCD HD44780 character LCD] protocol&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 7-segment display&lt;br /&gt;
| Displays&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
|&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| [[Protocol_decoder:Pcf8814|PCF8814]]&lt;br /&gt;
| Displays&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| pcf8814&lt;br /&gt;
| bgcolor=&amp;quot;yellow&amp;quot; | 50%&lt;br /&gt;
| Philips PCF8814 65 x 96 pixels matrix LCD driver&lt;br /&gt;
| Work in progress (Uwe Hermann).&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| [[Protocol_decoder:Pcf8814_lcd|PCF8814 LCD]]&lt;br /&gt;
| Displays&lt;br /&gt;
| pcf8814&lt;br /&gt;
| pcf8814_lcd&lt;br /&gt;
| bgcolor=&amp;quot;yellow&amp;quot; | 50%&lt;br /&gt;
| Philips PCF8814 65 x 96 pixels matrix LCD driver&lt;br /&gt;
| Work in progress (Uwe Hermann).&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| [https://en.wikipedia.org/wiki/RDM_%28lighting%29 RDM]&lt;br /&gt;
| Industrial Lighting&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| rdm&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| [https://en.wikipedia.org/wiki/NMEA_0183 NMEA 0183]&lt;br /&gt;
| GPS&lt;br /&gt;
| uart&lt;br /&gt;
| nmea0183&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| [[Protocol_decoder:Nmea2000|NMEA2000]]&lt;br /&gt;
| Marine&lt;br /&gt;
| can&lt;br /&gt;
| nmea2000&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
| [https://en.wikipedia.org/wiki/NMEA_2000 NMEA 2000 Wikipedia page]&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| [https://en.wikipedia.org/wiki/Digital_Command_Control DCC]&lt;br /&gt;
| Trains&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| dcc&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| [https://en.wikipedia.org/wiki/Train_Communication_Network MVB]&lt;br /&gt;
| Trains&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| mvb&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
| Multifunction Vehicle Bus&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| [https://en.wikipedia.org/wiki/Train_Communication_Network WTB]&lt;br /&gt;
| Trains&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| wtb&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
| Wire Train Bus&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| [https://en.wikipedia.org/wiki/C-Bus_%28protocol%29 C-Bus]&lt;br /&gt;
| Home automation&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| cbus&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| [https://en.wikipedia.org/wiki/X10_%28industry_standard%29 X10]&lt;br /&gt;
| Home automation&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| x10&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| [https://en.wikipedia.org/wiki/LonWorks LonWorks]&lt;br /&gt;
| Home automation&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| lonworks&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| [https://en.wikipedia.org/wiki/S-Bus S-Bus]&lt;br /&gt;
| Home automation&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| sbus&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| [https://en.wikipedia.org/wiki/Meter-Bus M-Bus]&lt;br /&gt;
| Automation&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| mbus&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| [https://en.wikipedia.org/wiki/Modbus Modbus ASCII]&lt;br /&gt;
| Automation&lt;br /&gt;
| uart&lt;br /&gt;
| modbus&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| [https://en.wikipedia.org/wiki/Modbus Modbus TCP]&lt;br /&gt;
| Automation&lt;br /&gt;
| ip&lt;br /&gt;
| modbus&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| [https://en.wikipedia.org/wiki/Highway_Addressable_Remote_Transducer_Protocol HART protocol]&lt;br /&gt;
| Automation&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| hart&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| [https://en.wikipedia.org/wiki/INTERBUS INTERBUS]&lt;br /&gt;
| Automation&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| interbus&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| [https://en.wikipedia.org/wiki/DirectNET_Protocol DirectNET]&lt;br /&gt;
| Automation&lt;br /&gt;
| uart&lt;br /&gt;
| directnet&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| [https://en.wikipedia.org/wiki/KNX_%28standard%29 KNX]&lt;br /&gt;
| Automation&lt;br /&gt;
| various&lt;br /&gt;
| knx&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| [https://en.wikipedia.org/wiki/Bacnet BACnet]&lt;br /&gt;
| Automation&lt;br /&gt;
| &lt;br /&gt;
| bacnet&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| [https://en.wikipedia.org/wiki/OpenTherm OpenTherm]&lt;br /&gt;
| Automation&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| opentherm&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| [https://en.wikipedia.org/wiki/EBUS_%28serial_buses%29 EBUS]&lt;br /&gt;
| Automation&lt;br /&gt;
| uart&lt;br /&gt;
| ebus&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| [https://en.wikipedia.org/wiki/Attachment_Unit_Interface AUI]&lt;br /&gt;
| Networking&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| aui&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
| Attachment Unit Interface&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| [https://en.wikipedia.org/wiki/Medium_Dependent_Interface MDI]&lt;br /&gt;
| Networking&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| mdi&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
| Medium Dependent Interface&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| [https://en.wikipedia.org/wiki/Media_Independent_Interface MII]&lt;br /&gt;
| Networking&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| mii&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
| Media Independent Interface&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| [https://en.wikipedia.org/wiki/Gigabit_Media_Independent_Interface#Gigabit_Media_Independent_Interface GMII]&lt;br /&gt;
| Networking&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| gmii&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
| Gigabit Media Independent Interface&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| [https://en.wikipedia.org/wiki/10_Gigabit_Media_Independent_Interface#10_Gigabit_Media_Independent_Interface XGMII]&lt;br /&gt;
| Networking&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| xgmii&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
| 10 Gigabit Media Independent Interface&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| [[Protocol_decoder:esp8266|ESP8266]]&lt;br /&gt;
| Wireless&lt;br /&gt;
| uart&lt;br /&gt;
| esp8266&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
| WiFi Serial Transceiver&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| [[Protocol Decoder:tmds|TMDS (HDMI / DVI Pixel Data)]]&lt;br /&gt;
| Display&lt;br /&gt;
| tmds&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| bgcolor=&amp;quot;orange&amp;quot; | 1%&lt;br /&gt;
| https://github.com/mithro/tmds_encoding&lt;br /&gt;
| Work in progress ([[User:Mithro|mithro]])&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| [[Protocol Decoder:Easymatic|Easymatic]]&lt;br /&gt;
| Home automation&lt;br /&gt;
| uart&lt;br /&gt;
| easymatic&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 10%&lt;br /&gt;
| &lt;br /&gt;
| Work in progress (Platypus)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| [[Protocol Decoder:DDC/CI|DDC/CI]]&lt;br /&gt;
| PC&lt;br /&gt;
| i2c&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Kenwood VH&lt;br /&gt;
| Misc&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| bgcolor=&amp;quot;yellow&amp;quot; | 50%&lt;br /&gt;
| SYSTEM CONTROL protocol used by Kenwood&amp;#039;s VH HiFi-system&lt;br /&gt;
| In progress: https://github.com/kripton/libsigrokdecode/compare/kenwood_vh&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| IEC 61131-9&lt;br /&gt;
| Industrial&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
| &amp;quot;Single-drop digital communication interface for small sensors and actuators (SDCI, marketed as IO-Link)&amp;quot; https://en.wikipedia.org/wiki/IEC_61131&lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| NRZ encoding family&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
| Non-Return-to-Zero and its [https://en.wikipedia.org/wiki/Non-return-to-zero#Variants variants]&lt;br /&gt;
| whoever wants it&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Manchester encoding&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
| [https://en.wikipedia.org/wiki/Manchester_code Manchester code]&lt;br /&gt;
| whoever wants it&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Sony LANC&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| bgcolor=&amp;quot;red&amp;quot; | 0%&lt;br /&gt;
| [http://www.boehmel.de/lanc.htm Sony LANC]&lt;br /&gt;
| whoever wants it, contact [[User:Alexdaniel|AlexDaniel]] for more info. You can already decode the raw data by using UART with 9600 baud and no parity, but it&amp;#039;d be better if pulseview displayed the meaning (as in what these commands do)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| CAN-FD&lt;br /&gt;
| Automotive&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| can&lt;br /&gt;
| bgcolor=&amp;quot;yellow&amp;quot; | 90%&lt;br /&gt;
| Controller Area Network with Flexible Data Rate&lt;br /&gt;
| Work in progress ([[User:Stephan_Thiele|Stephan Thiele]]).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| nrf905&lt;br /&gt;
| IC, Wireless/RF&lt;br /&gt;
| spi&lt;br /&gt;
| nrf905&lt;br /&gt;
| bgcolor=&amp;quot;yellow&amp;quot; | 90%&lt;br /&gt;
| 433/868/915 Mhz RF transceiver chip&lt;br /&gt;
| Work in progress ([[User:jsolla|Jorge Solla]]).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
__FORCETOC__&lt;/div&gt;</summary>
		<author><name>Jsolla</name></author>
	</entry>
	<entry>
		<id>https://sigrok.org/w/index.php?title=Protocol_decoder:Cec&amp;diff=14552</id>
		<title>Protocol decoder:Cec</title>
		<link rel="alternate" type="text/html" href="https://sigrok.org/w/index.php?title=Protocol_decoder:Cec&amp;diff=14552"/>
		<updated>2019-11-03T17:30:27Z</updated>

		<summary type="html">&lt;p&gt;Jsolla: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox protocol decoder&lt;br /&gt;
| id              = cec&lt;br /&gt;
| name            = cec&lt;br /&gt;
| description     = HDMI Consumer Electronics Control (CEC) protocol.&lt;br /&gt;
| status          = supported&lt;br /&gt;
| license         = GPLv2+&lt;br /&gt;
| source_code_dir = cec&lt;br /&gt;
| image           = [[File:Cec_hdmi_pinout.png|250px]]&lt;br /&gt;
| input           = logic&lt;br /&gt;
| output          = cec&lt;br /&gt;
| probes          = cec&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Consumer Electronics Control (CEC) is a feature of HDMI designed to allow users to command and control devices connected through HDMI&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
CEC Bus can be found in PIN 13 of the HDMI connector:&lt;br /&gt;
&lt;br /&gt;
[[File:Cec_hdmi_pinout.png]]&lt;br /&gt;
&lt;br /&gt;
== Protocol ==&lt;br /&gt;
&lt;br /&gt;
It is a one-wire bidirectional serial bus that is based on the [https://en.wikipedia.org/wiki/European_Committee_for_Electrotechnical_Standardization CENELEC] standard AV.link protocol to perform remote control functions.&lt;br /&gt;
&lt;br /&gt;
CEC is a separate electrical signal from the other HDMI signals. This allows a device to disable its high-speed HDMI circuitry in sleep mode, but be woken up by CEC. It is a single shared bus, which is directly connected between all HDMI ports on a device, so it can flow through a device which is completely powered off (not just asleep).&lt;br /&gt;
&lt;br /&gt;
The bus is electrically identical to the AV.link protocol, but CEC adds a detailed higher-level message protocol.&lt;br /&gt;
&lt;br /&gt;
The bus is an open-collector line, somewhat like I²C, passively pulled up to +3.3 V, and driven low to transmit a bit.&lt;br /&gt;
&lt;br /&gt;
== Pulseview screenshots ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=800px&amp;gt;&lt;br /&gt;
File:Cec_pulseview_ping_frames.png|&amp;lt;small&amp;gt;Ping (poll) frames&amp;lt;/small&amp;gt;&lt;br /&gt;
File:cec_pulseview_vendor_command_frame.png|&amp;lt;small&amp;gt;Vendor command frame&amp;lt;/small&amp;gt;&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Usage examples ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Print all annotations (very verbose)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
  &amp;#039;&amp;#039;&amp;#039;sigrok-cli -i data.sr -P cec:CEC=CEC&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
    &lt;br /&gt;
  cec-1: ST&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 1&lt;br /&gt;
  cec-1: 1&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0x30&lt;br /&gt;
  cec-1: EOM=N&lt;br /&gt;
  cec-1: ACK&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 1&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0x04&lt;br /&gt;
  cec-1: EOM=Y&lt;br /&gt;
  cec-1: ACK&lt;br /&gt;
  cec-1: 30:04&lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: IMAGE_VIEW_ON | R: ACK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Print frames only&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
  &amp;#039;&amp;#039;&amp;#039;sigrok-cli -i data.sr -P cec:CEC=CEC -A cec=frames&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
  &lt;br /&gt;
  cec-1: 30:04&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 3f:82:10:00&lt;br /&gt;
  cec-1: 30:8f&lt;br /&gt;
  cec-1: 03:90:01&lt;br /&gt;
  cec-1: 30:44:6d&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 30:04&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 30:0d&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 30:04&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 30:8f&lt;br /&gt;
  cec-1: 03:90:01&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 30:04&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Print sections only&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
  &amp;#039;&amp;#039;&amp;#039;sigrok-cli -i data.sr -P cec:CEC=CEC -A cec=sections&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
  &lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: IMAGE_VIEW_ON | R: ACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, Broadcast | OPC: ACTIVE_SOURCE | OPS: 0x10, 0x00 | R: ACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: GIVE_DEVICE_POWER_STATUS | R: ACK&lt;br /&gt;
  cec-1: HDR: TV, Tuner_1 | OPC: REPORT_POWER_STATUS | OPS: 0x01 | R: ACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: USER_CONTROL_PRESSED | OPS: 0x6d | R: ACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: IMAGE_VIEW_ON | R: ACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: TEXT_VIEW_ON | R: ACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: IMAGE_VIEW_ON | R: ACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: GIVE_DEVICE_POWER_STATUS | R: ACK&lt;br /&gt;
  cec-1: HDR: TV, Tuner_1 | OPC: REPORT_POWER_STATUS | OPS: 0x01 | R: ACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: IMAGE_VIEW_ON | R: ACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: GIVE_DEVICE_POWER_STATUS | R: ACK&lt;br /&gt;
  cec-1: HDR: TV, Tuner_1 | OPC: REPORT_POWER_STATUS | OPS: 0x01 | R: ACK&lt;br /&gt;
&lt;br /&gt;
== Current status ==&lt;br /&gt;
&lt;br /&gt;
The CEC protocol decoder is capable of the following:&lt;br /&gt;
&lt;br /&gt;
* Decoding all low level parts: START, BITs, EOM, ACK / NACK&lt;br /&gt;
* Resolve names of all logical addresses&lt;br /&gt;
* Resolve names of all opcodes&lt;br /&gt;
* Detect (and warn) timing errors&lt;br /&gt;
* Detect (and warn) misplaced bits, etc&lt;br /&gt;
&lt;br /&gt;
Pending:&lt;br /&gt;
&lt;br /&gt;
* Operands of the opcodes are not parsed, only printed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Protocol decoder]]&lt;/div&gt;</summary>
		<author><name>Jsolla</name></author>
	</entry>
	<entry>
		<id>https://sigrok.org/w/index.php?title=Protocol_decoder:Cec&amp;diff=14551</id>
		<title>Protocol decoder:Cec</title>
		<link rel="alternate" type="text/html" href="https://sigrok.org/w/index.php?title=Protocol_decoder:Cec&amp;diff=14551"/>
		<updated>2019-11-03T17:26:13Z</updated>

		<summary type="html">&lt;p&gt;Jsolla: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox protocol decoder&lt;br /&gt;
| id              = cec&lt;br /&gt;
| name            = cec&lt;br /&gt;
| description     = HDMI Consumer Electronics Control (CEC) protocol.&lt;br /&gt;
| status          = supported&lt;br /&gt;
| license         = GPLv2+&lt;br /&gt;
| source_code_dir = cec&lt;br /&gt;
| image           = [[File:Cec_hdmi_pinout.png|250px]]&lt;br /&gt;
| input           = logic&lt;br /&gt;
| output          = cec&lt;br /&gt;
| probes          = cec&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Consumer Electronics Control (CEC) is a feature of HDMI designed to allow users to command and control devices connected through HDMI&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
CEC Bus can be found in PIN 13 of the HDMI connector:&lt;br /&gt;
&lt;br /&gt;
[[File:Cec_hdmi_pinout.png]]&lt;br /&gt;
&lt;br /&gt;
== Protocol ==&lt;br /&gt;
&lt;br /&gt;
It is a one-wire bidirectional serial bus that is based on the [https://en.wikipedia.org/wiki/European_Committee_for_Electrotechnical_Standardization CENELEC] standard AV.link protocol to perform remote control functions.&lt;br /&gt;
&lt;br /&gt;
CEC is a separate electrical signal from the other HDMI signals. This allows a device to disable its high-speed HDMI circuitry in sleep mode, but be woken up by CEC. It is a single shared bus, which is directly connected between all HDMI ports on a device, so it can flow through a device which is completely powered off (not just asleep).&lt;br /&gt;
&lt;br /&gt;
The bus is electrically identical to the AV.link protocol, but CEC adds a detailed higher-level message protocol.&lt;br /&gt;
&lt;br /&gt;
The bus is an open-collector line, somewhat like I²C, passively pulled up to +3.3 V, and driven low to transmit a bit.&lt;br /&gt;
&lt;br /&gt;
== Pulseview screenshots ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=800px&amp;gt;&lt;br /&gt;
File:Cec_pulseview_ping_frames.png|&amp;lt;small&amp;gt;Ping (poll) frames&amp;lt;/small&amp;gt;&lt;br /&gt;
File:cec_pulseview_vendor_command_frame.png|&amp;lt;small&amp;gt;Vendor command frame&amp;lt;/small&amp;gt;&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Usage examples ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Print all annotations (very verbose)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
  &amp;#039;&amp;#039;&amp;#039;sigrok-cli -i data.sr -P cec:CEC=CEC&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
    &lt;br /&gt;
  cec-1: ST&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 1&lt;br /&gt;
  cec-1: 1&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0x30&lt;br /&gt;
  cec-1: EOM=N&lt;br /&gt;
  cec-1: ACK&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 1&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0x04&lt;br /&gt;
  cec-1: EOM=Y&lt;br /&gt;
  cec-1: ACK&lt;br /&gt;
  cec-1: 30:04&lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: IMAGE_VIEW_ON | R: ACK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Print frames only&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
  &amp;#039;&amp;#039;&amp;#039;sigrok-cli -i data.sr -P cec:CEC=CEC -A cec=frames&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
  &lt;br /&gt;
  cec-1: 30:04&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 3f:82:10:00&lt;br /&gt;
  cec-1: 30:8f&lt;br /&gt;
  cec-1: 03:90:01&lt;br /&gt;
  cec-1: 30:44:6d&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 30:04&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 30:0d&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 30:04&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 30:8f&lt;br /&gt;
  cec-1: 03:90:01&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 30:04&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Print sections only&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
  &amp;#039;&amp;#039;&amp;#039;sigrok-cli -i data.sr -P cec:CEC=CEC -A cec=sections&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
  &lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: IMAGE_VIEW_ON | R: ACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, Broadcast | OPC: ACTIVE_SOURCE | OPS: 0x10, 0x00 | R: ACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: GIVE_DEVICE_POWER_STATUS | R: ACK&lt;br /&gt;
  cec-1: HDR: TV, Tuner_1 | OPC: REPORT_POWER_STATUS | OPS: 0x01 | R: ACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: USER_CONTROL_PRESSED | OPS: 0x6d | R: ACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: IMAGE_VIEW_ON | R: ACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: TEXT_VIEW_ON | R: ACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: IMAGE_VIEW_ON | R: ACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: GIVE_DEVICE_POWER_STATUS | R: ACK&lt;br /&gt;
  cec-1: HDR: TV, Tuner_1 | OPC: REPORT_POWER_STATUS | OPS: 0x01 | R: ACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: IMAGE_VIEW_ON | R: ACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: GIVE_DEVICE_POWER_STATUS | R: ACK&lt;br /&gt;
  cec-1: HDR: TV, Tuner_1 | OPC: REPORT_POWER_STATUS | OPS: 0x01 | R: ACK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Protocol decoder]]&lt;/div&gt;</summary>
		<author><name>Jsolla</name></author>
	</entry>
	<entry>
		<id>https://sigrok.org/w/index.php?title=Protocol_decoder:Cec&amp;diff=14550</id>
		<title>Protocol decoder:Cec</title>
		<link rel="alternate" type="text/html" href="https://sigrok.org/w/index.php?title=Protocol_decoder:Cec&amp;diff=14550"/>
		<updated>2019-11-03T17:25:50Z</updated>

		<summary type="html">&lt;p&gt;Jsolla: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox protocol decoder&lt;br /&gt;
| id              = cec&lt;br /&gt;
| name            = cec&lt;br /&gt;
| description     = HDMI Consumer Electronics Control (CEC) protocol.&lt;br /&gt;
| status          = supported&lt;br /&gt;
| license         = GPLv2+&lt;br /&gt;
| source_code_dir = cec&lt;br /&gt;
| image           = [[File:Cec_hdmi_pinout.png|250px]]&lt;br /&gt;
| input           = logic&lt;br /&gt;
| output          = cec&lt;br /&gt;
| probes          = cec&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Consumer Electronics Control (CEC) is a feature of HDMI designed to allow users to command and control devices connected through HDMI&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
CEC Bus can be found in PIN 13 of the HDMI connector:&lt;br /&gt;
&lt;br /&gt;
[[File:Cec_hdmi_pinout.png]]&lt;br /&gt;
&lt;br /&gt;
== Protocol ==&lt;br /&gt;
&lt;br /&gt;
It is a one-wire bidirectional serial bus that is based on the [https://en.wikipedia.org/wiki/European_Committee_for_Electrotechnical_Standardization CENELEC] standard AV.link protocol to perform remote control functions.&lt;br /&gt;
&lt;br /&gt;
CEC is a separate electrical signal from the other HDMI signals. This allows a device to disable its high-speed HDMI circuitry in sleep mode, but be woken up by CEC. It is a single shared bus, which is directly connected between all HDMI ports on a device, so it can flow through a device which is completely powered off (not just asleep).&lt;br /&gt;
&lt;br /&gt;
The bus is electrically identical to the AV.link protocol, but CEC adds a detailed higher-level message protocol.&lt;br /&gt;
&lt;br /&gt;
The bus is an open-collector line, somewhat like I²C, passively pulled up to +3.3 V, and driven low to transmit a bit.&lt;br /&gt;
&lt;br /&gt;
== Pulseview screenshots ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=800px&amp;gt;&lt;br /&gt;
File:Cec_pulseview_ping_frames.png|&amp;lt;small&amp;gt;Ping (poll) frames&amp;lt;/small&amp;gt;&lt;br /&gt;
File:cec_pulseview_vendor_command_frame.png|&amp;lt;small&amp;gt;Vendor command frame&amp;lt;/small&amp;gt;&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Usage examples ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Print all annotations (very verbose)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
  &amp;#039;&amp;#039;&amp;#039;sigrok-cli -i data.sr -P cec:CEC=CEC&amp;#039;&amp;#039;&lt;br /&gt;
    &lt;br /&gt;
  cec-1: ST&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 1&lt;br /&gt;
  cec-1: 1&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0x30&lt;br /&gt;
  cec-1: EOM=N&lt;br /&gt;
  cec-1: ACK&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 1&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0x04&lt;br /&gt;
  cec-1: EOM=Y&lt;br /&gt;
  cec-1: ACK&lt;br /&gt;
  cec-1: 30:04&lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: IMAGE_VIEW_ON | R: ACK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Print frames only&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
  &amp;#039;&amp;#039;&amp;#039;sigrok-cli -i data.sr -P cec:CEC=CEC -A cec=frames&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
  &lt;br /&gt;
  cec-1: 30:04&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 3f:82:10:00&lt;br /&gt;
  cec-1: 30:8f&lt;br /&gt;
  cec-1: 03:90:01&lt;br /&gt;
  cec-1: 30:44:6d&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 30:04&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 30:0d&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 30:04&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 30:8f&lt;br /&gt;
  cec-1: 03:90:01&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 30:04&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Print sections only&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
  &amp;#039;&amp;#039;&amp;#039;sigrok-cli -i data.sr -P cec:CEC=CEC -A cec=sections&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
  &lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: IMAGE_VIEW_ON | R: ACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, Broadcast | OPC: ACTIVE_SOURCE | OPS: 0x10, 0x00 | R: ACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: GIVE_DEVICE_POWER_STATUS | R: ACK&lt;br /&gt;
  cec-1: HDR: TV, Tuner_1 | OPC: REPORT_POWER_STATUS | OPS: 0x01 | R: ACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: USER_CONTROL_PRESSED | OPS: 0x6d | R: ACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: IMAGE_VIEW_ON | R: ACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: TEXT_VIEW_ON | R: ACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: IMAGE_VIEW_ON | R: ACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: GIVE_DEVICE_POWER_STATUS | R: ACK&lt;br /&gt;
  cec-1: HDR: TV, Tuner_1 | OPC: REPORT_POWER_STATUS | OPS: 0x01 | R: ACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: IMAGE_VIEW_ON | R: ACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: GIVE_DEVICE_POWER_STATUS | R: ACK&lt;br /&gt;
  cec-1: HDR: TV, Tuner_1 | OPC: REPORT_POWER_STATUS | OPS: 0x01 | R: ACK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Protocol decoder]]&lt;/div&gt;</summary>
		<author><name>Jsolla</name></author>
	</entry>
	<entry>
		<id>https://sigrok.org/w/index.php?title=Protocol_decoder:Cec&amp;diff=14549</id>
		<title>Protocol decoder:Cec</title>
		<link rel="alternate" type="text/html" href="https://sigrok.org/w/index.php?title=Protocol_decoder:Cec&amp;diff=14549"/>
		<updated>2019-11-03T17:24:40Z</updated>

		<summary type="html">&lt;p&gt;Jsolla: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox protocol decoder&lt;br /&gt;
| id              = cec&lt;br /&gt;
| name            = cec&lt;br /&gt;
| description     = HDMI Consumer Electronics Control (CEC) protocol.&lt;br /&gt;
| status          = supported&lt;br /&gt;
| license         = GPLv2+&lt;br /&gt;
| source_code_dir = cec&lt;br /&gt;
| image           = [[File:Cec_hdmi_pinout.png|250px]]&lt;br /&gt;
| input           = logic&lt;br /&gt;
| output          = cec&lt;br /&gt;
| probes          = cec&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Consumer Electronics Control (CEC) is a feature of HDMI designed to allow users to command and control devices connected through HDMI&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
CEC Bus can be found in PIN 13 of the HDMI connector:&lt;br /&gt;
&lt;br /&gt;
[[File:Cec_hdmi_pinout.png]]&lt;br /&gt;
&lt;br /&gt;
== Protocol ==&lt;br /&gt;
&lt;br /&gt;
It is a one-wire bidirectional serial bus that is based on the [https://en.wikipedia.org/wiki/European_Committee_for_Electrotechnical_Standardization CENELEC] standard AV.link protocol to perform remote control functions.&lt;br /&gt;
&lt;br /&gt;
CEC is a separate electrical signal from the other HDMI signals. This allows a device to disable its high-speed HDMI circuitry in sleep mode, but be woken up by CEC. It is a single shared bus, which is directly connected between all HDMI ports on a device, so it can flow through a device which is completely powered off (not just asleep).&lt;br /&gt;
&lt;br /&gt;
The bus is electrically identical to the AV.link protocol, but CEC adds a detailed higher-level message protocol.&lt;br /&gt;
&lt;br /&gt;
The bus is an open-collector line, somewhat like I²C, passively pulled up to +3.3 V, and driven low to transmit a bit.&lt;br /&gt;
&lt;br /&gt;
== Pulseview screenshots ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=800px&amp;gt;&lt;br /&gt;
File:Cec_pulseview_ping_frames.png|&amp;lt;small&amp;gt;Ping (poll) frames&amp;lt;/small&amp;gt;&lt;br /&gt;
File:cec_pulseview_vendor_command_frame.png|&amp;lt;small&amp;gt;Vendor command frame&amp;lt;/small&amp;gt;&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Usage examples ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Print all annotations (very verbose)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
  &amp;#039;&amp;#039;&amp;#039;sigrok-cli -i data.sr -P cec:CEC=CEC&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
  &lt;br /&gt;
  cec-1: ST&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 1&lt;br /&gt;
  cec-1: 1&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0x30&lt;br /&gt;
  cec-1: EOM=N&lt;br /&gt;
  cec-1: ACK&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 1&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0&lt;br /&gt;
  cec-1: 0x04&lt;br /&gt;
  cec-1: EOM=Y&lt;br /&gt;
  cec-1: ACK&lt;br /&gt;
  cec-1: 30:04&lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: IMAGE_VIEW_ON | R: ACK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Print frames only&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
  &amp;#039;&amp;#039;&amp;#039;sigrok-cli -i data.sr -P cec:CEC=CEC -A cec=frames&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
  cec-1: 30:04&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 3f:82:10:00&lt;br /&gt;
  cec-1: 30:8f&lt;br /&gt;
  cec-1: 03:90:01&lt;br /&gt;
  cec-1: 30:44:6d&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 30:04&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 30:0d&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 30:04&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 30:8f&lt;br /&gt;
  cec-1: 03:90:01&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 35&lt;br /&gt;
  cec-1: 30:04&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Print sections only&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
  &amp;#039;&amp;#039;&amp;#039;sigrok-cli -i data.sr -P cec:CEC=CEC -A cec=sections&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: IMAGE_VIEW_ON | R: ACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1   HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, Broadcast | OPC: ACTIVE_SOURCE | OPS: 0x10, 0x00 | R: ACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: GIVE_DEVICE_POWER_STATUS | R: ACK&lt;br /&gt;
  cec-1: HDR: TV, Tuner_1 | OPC: REPORT_POWER_STATUS | OPS: 0x01 | R: ACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: USER_CONTROL_PRESSED | OPS: 0x6d | R: ACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: IMAGE_VIEW_ON | R: ACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: TEXT_VIEW_ON | R: ACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: IMAGE_VIEW_ON | R: ACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: GIVE_DEVICE_POWER_STATUS | R: ACK&lt;br /&gt;
  cec-1: HDR: TV, Tuner_1 | OPC: REPORT_POWER_STATUS | OPS: 0x01 | R: ACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: IMAGE_VIEW_ON | R: ACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK&lt;br /&gt;
  cec-1: HDR: Tuner_1, TV | OPC: GIVE_DEVICE_POWER_STATUS | R: ACK&lt;br /&gt;
  cec-1: HDR: TV, Tuner_1 | OPC: REPORT_POWER_STATUS | OPS: 0x01 | R: ACK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Protocol decoder]]&lt;/div&gt;</summary>
		<author><name>Jsolla</name></author>
	</entry>
	<entry>
		<id>https://sigrok.org/w/index.php?title=File:Cec_pulseview_vendor_command_frame.png&amp;diff=14548</id>
		<title>File:Cec pulseview vendor command frame.png</title>
		<link rel="alternate" type="text/html" href="https://sigrok.org/w/index.php?title=File:Cec_pulseview_vendor_command_frame.png&amp;diff=14548"/>
		<updated>2019-11-03T17:05:55Z</updated>

		<summary type="html">&lt;p&gt;Jsolla: cec pulseview vendor command frame&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
cec pulseview vendor command frame&lt;br /&gt;
== Licensing ==&lt;br /&gt;
{{PD}}&lt;/div&gt;</summary>
		<author><name>Jsolla</name></author>
	</entry>
	<entry>
		<id>https://sigrok.org/w/index.php?title=File:Cec_pulseview_ping_frames.png&amp;diff=14547</id>
		<title>File:Cec pulseview ping frames.png</title>
		<link rel="alternate" type="text/html" href="https://sigrok.org/w/index.php?title=File:Cec_pulseview_ping_frames.png&amp;diff=14547"/>
		<updated>2019-11-03T17:05:23Z</updated>

		<summary type="html">&lt;p&gt;Jsolla: cec protocol pulseview ping frames&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
cec protocol pulseview ping frames&lt;br /&gt;
== Licensing ==&lt;br /&gt;
{{PD}}&lt;/div&gt;</summary>
		<author><name>Jsolla</name></author>
	</entry>
	<entry>
		<id>https://sigrok.org/w/index.php?title=Protocol_decoder:Cec&amp;diff=14545</id>
		<title>Protocol decoder:Cec</title>
		<link rel="alternate" type="text/html" href="https://sigrok.org/w/index.php?title=Protocol_decoder:Cec&amp;diff=14545"/>
		<updated>2019-11-03T17:04:18Z</updated>

		<summary type="html">&lt;p&gt;Jsolla: Created page with &amp;quot;{{Infobox protocol decoder | id              = cec | name            = cec | description     = HDMI Consumer Electronics Control (CEC) protocol. | status          = supported...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox protocol decoder&lt;br /&gt;
| id              = cec&lt;br /&gt;
| name            = cec&lt;br /&gt;
| description     = HDMI Consumer Electronics Control (CEC) protocol.&lt;br /&gt;
| status          = supported&lt;br /&gt;
| license         = GPLv2+&lt;br /&gt;
| source_code_dir = cec&lt;br /&gt;
| image           = [[File:|250px]]&lt;br /&gt;
| input           = logic&lt;br /&gt;
| output          = cec&lt;br /&gt;
| probes          = cec&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== HDMI CEC protocol decoder ==&lt;br /&gt;
&lt;br /&gt;
Sigrok protocol decoder for HDMI CEC (Consumer Electronics Control)&lt;br /&gt;
&lt;br /&gt;
Consumer Electronics Control (CEC) is a feature of HDMI designed to allow users to command and control devices connected through HDMI&lt;br /&gt;
&lt;br /&gt;
CEC Bus can be found in PIN 13 of the HDMI connector:&lt;/div&gt;</summary>
		<author><name>Jsolla</name></author>
	</entry>
</feed>