2 ## This file is part of the libsigrokdecode project.
4 ## Copyright (C) 2019 Stephan Thiele <stephan.thiele@mailbox.org>
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.
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.
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/>.
21 This decoder stacks on top of the 'spi' PD and decodes the button states
24 The SPI decoder needs to be configured as follows:
31 Chip-select is not used and must not be assigned to any channel.
33 Hardware setup is as follows:
44 CUP - Shift register clock (CLK)
45 OUT 0 - Shift register latch (optional)
46 D1 - Gamepad data (MOSI)
50 Data pins D3 and D4 are not used by the standard gamepad but
51 by special controllers like the Nintento Zapper light gun.
54 from .pd import Decoder