## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
##
-#
-# Nintendo Wii Nunchuk decoder
-#
-
-#
-# TODO: Description
-#
-# http://wiibrew.org/wiki/Wiimote/Extension_Controllers/Nunchuck
-# http://todbot.com/blog/2008/02/18/wiichuck-wii-nunchuck-adapter-available/
-# https://www.sparkfun.com/products/9281
-#
+# Nintendo Wii Nunchuk protocol decoder
import sigrokdecode as srd
license = 'gplv2+'
inputs = ['i2c']
outputs = ['nunchuck']
- probes = [] # TODO
+ probes = []
+ optional_probes = [] # TODO
options = {}
annotations = [
- ['TODO', 'TODO'],
+ ['TODO', 'TODO'],
]
def __init__(self, **kwargs):
def decode(self, ss, es, data):
- cmd, databyte, ack_bit = data
+ cmd, databyte = data
if cmd == 'START': # TODO: Handle 'Sr' here, too?
self.state = START
if self.state == IDLE:
self.state = INITIALIZED
return
-
+
if databyte == 0x40 and self.state == START:
self.state = INIT
elif databyte == 0x00 and self.state == INIT: