]> sigrok.org Git - libsigrokdecode.git/blame - decoders/onewire_link/__init__.py
license: remove FSF postal address from boiler plate license text
[libsigrokdecode.git] / decoders / onewire_link / __init__.py
CommitLineData
51990c45 1##
50bd5d25 2## This file is part of the libsigrokdecode project.
51990c45
IJ
3##
4## Copyright (C) 2012 Uwe Hermann <uwe@hermann-uwe.de>
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 2 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
4539e9ca 17## along with this program; if not, see <http://www.gnu.org/licenses/>.
51990c45
IJ
18##
19
20'''
4c3b1846 21This protocol decoder handles the 1-Wire link layer.
51990c45 22
e7720d6c
UH
23The 1-Wire protocol enables bidirectional communication over a single wire
24(and ground) between a single master and one or multiple slaves. The protocol
25is layered:
4633e258 26
e7720d6c
UH
27 - Link layer (reset, presence detection, reading/writing bits)
28 - Network layer (skip/search/match device ROM addresses)
29 - Transport layer (transport data between 1-Wire master and device)
30
f4d0363d 31Sample rate:
e7720d6c
UH
32A sufficiently high samplerate is required to properly detect all the elements
33of the protocol. A lower samplerate can be used if the master does not use
34overdrive communication speed. The following minimal values should be used:
35
36 - overdrive available: 2MHz minimum, 5MHz suggested
37 - overdrive not available: 400kHz minimum, 1MHz suggested
f4d0363d 38
6a15597a 39Channels:
a2b13347 401-Wire requires a single signal, but some master implementations might have a
e7720d6c
UH
41separate signal used to deliver power to the bus during temperature conversion
42as an example. This power signal is currently not used.
43
44 - owr (1-Wire signal line)
45 - pwr (optional, dedicated power supply pin)
a2b13347
IJ
46
47Options:
e7720d6c
UH
481-Wire is an asynchronous protocol, so the decoder must know the samplerate.
49The timing for sampling bits, presence, and reset is calculated by the decoder,
a2b13347 50but in case the user wishes to use different values, it is possible to
e7720d6c
UH
51configure the following timing values (number of samplerate periods):
52
53 - overdrive (if active the decoder will be prepared for overdrive)
54 - cnt_normal_bit (time for normal mode sample bit)
55 - cnt_normal_slot (time for normal mode data slot)
56 - cnt_normal_presence (time for normal mode sample presence)
57 - cnt_normal_reset (time for normal mode reset)
58 - cnt_overdrive_bit (time for overdrive mode sample bit)
59 - cnt_overdrive_slot (time for overdrive mode data slot)
60 - cnt_overdrive_presence (time for overdrive mode sample presence)
61 - cnt_overdrive_reset (time for overdrive mode reset)
62
63These options should be configured only on very rare cases and the user should
a2b13347 64read the decoder source code to understand them correctly.
51990c45
IJ
65'''
66
95d11271 67from .pd import Decoder