]> sigrok.org Git - libsigrokdecode.git/blame - decoders/i2cfilter/__init__.py
All PDs: Bump api_version to 2.
[libsigrokdecode.git] / decoders / i2cfilter / __init__.py
CommitLineData
61c2bd36 1##
50bd5d25 2## This file is part of the libsigrokdecode project.
61c2bd36
BV
3##
4## Copyright (C) 2012 Bert Vermeulen <bert@biot.com>
5##
6## This program is free software; you can redistribute it and/or modify
7## it under the terms of the GNU General Public License as published by
8## the Free Software Foundation; either version 3 of the License, or
9## (at your option) any later version.
10##
11## This program is distributed in the hope that it will be useful,
12## but WITHOUT ANY WARRANTY; without even the implied warranty of
13## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14## GNU General Public License for more details.
15##
16## You should have received a copy of the GNU General Public License
17## along with this program; if not, see <http://www.gnu.org/licenses/>.
18##
19
20'''
4c3b1846 21This is a generic I²C filtering protocol decoder.
156509ca 22
4c3b1846 23It takes input from the I²C protocol decoder and removes all traffic
48eee789 24except that from/to the specified slave address and/or direction.
61c2bd36 25
48eee789
UH
26It then outputs the filtered data again as OUTPUT_PROTO of type/format 'i2c'
27(up the protocol decoder stack). No annotations are output.
61c2bd36 28
bbe6d87f 29The I²C slave address to filter out should be passed in as an option
48eee789
UH
30'address', as an integer. A specific read or write operation can be selected
31with the 'direction' option, which should be 'read', 'write', or 'both'.
61c2bd36
BV
32
33Both of these are optional; if no options are specified the entire payload
bbe6d87f 34of the I²C session will be output.
61c2bd36
BV
35'''
36
24c74fd3 37from .pd import *
61c2bd36 38