{"id":20246960,"url":"https://github.com/prdktntwcklr/bootlin-nunchuk","last_synced_at":"2026-05-07T20:50:14.557Z","repository":{"id":222454173,"uuid":"657572995","full_name":"prdktntwcklr/bootlin-nunchuk","owner":"prdktntwcklr","description":"Nunchuk Linux kernel module from Bootlin course.","archived":false,"fork":false,"pushed_at":"2024-02-14T09:28:06.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-14T02:12:58.448Z","etag":null,"topics":["bootlin","i2c","kernel-module","linux","nintendo","nunchuk"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prdktntwcklr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-23T11:06:38.000Z","updated_at":"2024-02-14T09:31:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"fce41f31-ac28-4684-a4bc-18d631faebd8","html_url":"https://github.com/prdktntwcklr/bootlin-nunchuk","commit_stats":null,"previous_names":["prdktntwcklr/bootlin-nunchuk"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prdktntwcklr%2Fbootlin-nunchuk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prdktntwcklr%2Fbootlin-nunchuk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prdktntwcklr%2Fbootlin-nunchuk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prdktntwcklr%2Fbootlin-nunchuk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prdktntwcklr","download_url":"https://codeload.github.com/prdktntwcklr/bootlin-nunchuk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241692821,"owners_count":20004303,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bootlin","i2c","kernel-module","linux","nintendo","nunchuk"],"created_at":"2024-11-14T09:34:24.433Z","updated_at":"2026-05-07T20:50:14.552Z","avatar_url":"https://github.com/prdktntwcklr.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nunchuk Driver\r\n\r\nA sample Linux I2C driver for the [Nintendo Wii Nunchuk](https://www.nintendo.co.jp/support/manual/wiiu/accessories/pdf/MAA-RVL-A-F-JPN.pdf) (RVL-004). The driver supports the following inputs using the input subsystem:\r\n\r\n- Z Button\r\n- C Button\r\n- Joystick (X and Y)\r\n\r\nThis project is based on Bootlin's embedded Linux trainings (see `References` section below).\r\n\r\nTested on [BeagleBone Black](https://beagleboard.org/black) hardware running mainline Linux version 5.10.179.\r\n\r\n## Hardware\r\n\r\n- BeagleBone Black\r\n- Nintendo Wii Nunchuk\r\n- [UEXT connector for Wii Nunchuck](https://www.olimex.com/Products/Modules/Sensors/MOD-WII/MOD-WII-UEXT/open-source-hardware)\r\n\r\n## Building the kernel module\r\n\r\nTo cross-compile, run the following command (using a cross-compiling toolchain provided by Ubuntu as an example):\r\n\r\n```bash\r\n$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-\r\n```\r\n\r\n## Device Tree\r\n\r\nTo enable Nunchuk functionality on your board, add the following entry to the device tree:\r\n\r\n```dts\r\n\u0026i2c1 {\r\n\tpinctrl-names = \"default\";\r\n\tpinctrl-0 = \u003c\u0026i2c1_pins\u003e;\r\n\t\r\n\tstatus = \"okay\";\r\n\tclock-frequency = \u003c100000\u003e;\r\n\t\r\n\tjoystick@52 {\r\n\t\tcompatible = \"nintendo,nunchuk\";\r\n\t\treg = \u003c0x52\u003e;\r\n\t};\r\n};\r\n```\r\n\r\n## Nunchuk\r\n\r\nConnect the Nunchuk to the I2C1 bus of the BeagleBone Black board (pins 17 and 18 of P9, see [pinout](https://docs.beagleboard.org/latest/boards/beaglebone/black/ch07.html#connector-p9)). The Nunchuk should show up at address 0x52:\r\n\r\n```text\r\n$ sudo i2cdetect -r 1\r\ni2cdetect: WARNING! This program can confuse your I2C bus\r\nContinue? [y/N] y\r\n     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f\r\n00: -- -- -- -- -- -- -- -- -- -- -- -- --\r\n10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --\r\n20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --\r\n30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --\r\n40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --\r\n50: -- -- 52 -- -- -- -- -- -- -- -- -- -- -- -- --\r\n60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --\r\n70: -- -- -- -- -- -- -- --\r\n```\r\n\r\nLoad the kernel module to verify the driver finds the device:\r\n\r\n```bash\r\n$ sudo modprobe nunchuk\r\n```\r\n\r\nFinally, run the `evtest` application to test the inputs:\r\n\r\n```bash\r\n$ sudo evtest\r\n```\r\n\r\n## References\r\n\r\n- Bootlin: [Embedded Linux kernel and driver development training](https://bootlin.com/training/kernel/).\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprdktntwcklr%2Fbootlin-nunchuk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprdktntwcklr%2Fbootlin-nunchuk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprdktntwcklr%2Fbootlin-nunchuk/lists"}