{"id":40824052,"url":"https://github.com/loopj/libjoybus","last_synced_at":"2026-01-21T22:10:42.400Z","repository":{"id":321461568,"uuid":"1082752002","full_name":"loopj/libjoybus","owner":"loopj","description":"An implementation of the Joybus protocol used by N64 and GameCube controllers, for 32-bit microcontrollers","archived":false,"fork":false,"pushed_at":"2026-01-10T19:34:33.000Z","size":480,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-11T05:35:43.872Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://loopj.com/libjoybus/","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/loopj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-24T18:01:04.000Z","updated_at":"2026-01-10T19:34:32.000Z","dependencies_parsed_at":"2025-10-29T20:42:55.041Z","dependency_job_id":null,"html_url":"https://github.com/loopj/libjoybus","commit_stats":null,"previous_names":["loopj/libjoybus"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/loopj/libjoybus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loopj%2Flibjoybus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loopj%2Flibjoybus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loopj%2Flibjoybus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loopj%2Flibjoybus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/loopj","download_url":"https://codeload.github.com/loopj/libjoybus/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loopj%2Flibjoybus/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28645179,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T21:29:11.980Z","status":"ssl_error","status_checked_at":"2026-01-21T21:24:31.872Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2026-01-21T22:10:41.677Z","updated_at":"2026-01-21T22:10:42.394Z","avatar_url":"https://github.com/loopj.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# libjoybus\n\nAn implementation of the Joybus protocol used by N64 and GameCube controllers,\nfor 32-bit microcontrollers.\n\n## Supported Platforms\n\nThe following platforms are currently supported:\n\n- Raspberry Pi RP2040 and RP2350 series MCUs\n- Silicon Labs EFR32 Series 1 and Series 2 MCUs\n\n## Communicating with Controllers\n\nIn *host mode*, `libjoybus` allows a microcontroller to communicate with N64 and\nGameCube controllers. This allows you to use input data from N64 and GameCube\ncontrollers in your projects.\n\n```c\n#include \u003cjoybus/joybus.h\u003e\n#include \u003cjoybus/host/gamecube.h\u003e\n\nstruct joybus_rp2xxx rp2xxx_bus;\nstruct joybus *bus = JOYBUS(\u0026rp2xxx_bus);\n\nstruct joybus_gc_controller_input input;\nuint8_t joybus_buffer[JOYBUS_BLOCK_SIZE];\n\nvoid poll_cb(struct joybus *bus, int result, void *user_data) {\n  // Check for errors\n  // TODO\n\n  // Unpack the input data from the response\n  joybus_gcn_unpack_input(\u0026input, joybus_buffer, JOYBUS_GCN_ANALOG_MODE_3);\n\n  // Do something with the input data\n  if(input.buttons \u0026 JOYBUS_GCN_BUTTON_A) {\n    // The A button is pressed\n  }\n}\n\nvoid main() {\n  // Initialize the Joybus\n  joybus_rp2xxx_init(\u0026rp2xxx_bus, MY_GPIO, pio0);\n  joybus_enable(bus);\n\n  while (1) {\n    // Read a GameCube controller in analog mode 3 with the rumble motor off\n    joybus_gcn_read(bus, JOYBUS_GCN_ANALOG_MODE_3, JOYBUS_GCN_MOTOR_STOP, joybus_buffer,\n                    poll_cb, NULL);\n\n    sleep_ms(10);\n  }\n}\n```\n\n## Emulating a Controller\n\nIn *target mode*, `libjoybus` allows a microcontroller to act as an N64 or GameCube\ncontroller. This allows you to create custom controllers that can interface with\nN64, GameCube, and Wii consoles.\n\n```c\n#include \u003cjoybus/joybus.h\u003e\n#include \u003cjoybus/target/gc_controller.h\u003e\n\nstruct joybus_rp2xxx rp2xxx_bus;\nstruct joybus *bus = JOYBUS(\u0026rp2xxx_bus);\nstruct joybus_gc_controller controller;\n\nvoid main() {\n  // Initialize the Joybus\n  joybus_rp2xxx_init(\u0026rp2xxx_bus, MY_GPIO, pio0);\n  joybus_enable(bus);\n\n  // Initialize a GameCube controller target\n  joybus_gc_controller_init(\u0026controller, JOYBUS_GAMECUBE_CONTROLLER);\n\n  // Register the target on the bus\n  joybus_target_register(bus, JOYBUS_TARGET(\u0026controller));\n\n  // At this point the target will respond to commands from a connected console!\n  // Modify the input state as needed, for example based on GPIO or ADC readings\n  while (1) {\n    // Clear previous button state\n    controller.input.buttons \u0026= ~JOYBUS_GCN_BUTTON_MASK;\n\n    // Simulate pressing the A button\n    controller.input.buttons |= JOYBUS_GCN_BUTTON_A;\n\n    // Simulate setting the analog stick position\n    controller.input.stick_x = 200;\n    controller.input.stick_y = 200;\n\n    sleep_ms(10);\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floopj%2Flibjoybus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Floopj%2Flibjoybus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floopj%2Flibjoybus/lists"}