{"id":21380807,"url":"https://github.com/frameworkcomputer/inputmodule-rs","last_synced_at":"2025-10-25T19:35:45.186Z","repository":{"id":147152204,"uuid":"598100237","full_name":"FrameworkComputer/inputmodule-rs","owner":"FrameworkComputer","description":"Framework Laptop 16 Input Module SW/FW","archived":false,"fork":false,"pushed_at":"2025-04-29T00:54:37.000Z","size":6714,"stargazers_count":278,"open_issues_count":45,"forks_count":36,"subscribers_count":15,"default_branch":"main","last_synced_at":"2025-08-30T07:23:41.184Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FrameworkComputer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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}},"created_at":"2023-02-06T11:59:51.000Z","updated_at":"2025-08-16T23:06:44.000Z","dependencies_parsed_at":"2023-05-28T09:15:34.112Z","dependency_job_id":"6a368cad-a4a3-4ea1-8a67-6b830a9f1fec","html_url":"https://github.com/FrameworkComputer/inputmodule-rs","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/FrameworkComputer/inputmodule-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FrameworkComputer%2Finputmodule-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FrameworkComputer%2Finputmodule-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FrameworkComputer%2Finputmodule-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FrameworkComputer%2Finputmodule-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FrameworkComputer","download_url":"https://codeload.github.com/FrameworkComputer/inputmodule-rs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FrameworkComputer%2Finputmodule-rs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281011932,"owners_count":26429433,"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","status":"online","status_checked_at":"2025-10-25T02:00:06.499Z","response_time":81,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":"2024-11-22T10:42:50.118Z","updated_at":"2025-10-25T19:35:45.148Z","avatar_url":"https://github.com/FrameworkComputer.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Framework Laptop 16 - Input Module Firmware/Software\n\nThis repository contains both the firmware for the Framework Laptop 16 input modules,\nas well as the tool to control them.\n\nRust firmware project setup based off of: https://github.com/rp-rs/rp2040-project-template\n\n## Modules\n\nSee pages of the individual modules for details about how they work and how\nthey're controlled.\n\n- [LED Matrix](ledmatrix/README.md)\n- [Minimal C1 Input Module](c1minimal/README.md)\n- [2nd Display](b1display/README.md)\n- [QT PY RP2040](qtpy/README.md)\n\n## Generic Features\n\nAll modules are built with an RP2040 microcontroller\nFeatures that all modules share\n\n- Firmware written in bare-metal Rust\n- Reset into RP2040 bootloader when firmware crashes/panics\n- Sleep Mode to save power\n- API over USB ACM Serial Port - Requires no Drivers on Windows and Linux\n  - Go to sleep\n  - Reset into bootloader\n  - Control and read module state (brightness, displayed image, ...)\n\n## Control from the host\n\nTo build your own application see the: [API command documentation](commands.md)\n\nOr use our `inputmodule-control` app, which you can download from the latest\n[GH Actions](https://github.com/FrameworkComputer/inputmodule-rs/actions) run or\nthe [release page](https://github.com/FrameworkComputer/inputmodule-rs/releases).\n\nFor device specific commands, see their individual documentation pages.\n\n### GUI and Python\nThere are also a python library and GUI tool. See their [README](python/README.md).\n\n![](res/ledmatrixgui-home.png)\n\n###### Permissions on Linux\nTo ensure that the input module's port is accessible, install the `udev` rule and trigger a reload:\n\n```sh\nsudo cp release/50-framework-inputmodule.rules /etc/udev/rules.d/\nsudo udevadm control --reload \u0026\u0026 sudo udevadm trigger\n```\n\n##### Common commands:\n\n###### Listing available devices\n\n```sh\n\u003e inputmodule-control --list\n/dev/ttyACM0\n  VID     0x32AC\n  PID     0x0020\n  SN      FRAKDEAM0020110001\n  Product LED_Matrix\n/dev/ttyACM1\n  VID     0x32AC\n  PID     0x0021\n  SN      FRAKDEAM0000000000\n  Product B1_Display\n```\n\n###### Apply command to single device\n\nBy default a command will be sent to all devices that can be found, to apply it\nto a single device, specify the COM port.\nIn this example the command is targeted at `b1-display`, so it will only apply\nto this module type.\n\n```sh\n# Example on Linux\n\u003e inputmodule-control --serial-dev /dev/ttyACM0 b1-display --pattern black\n\n# Example on Windows\n\u003e inputmodule-control.exe --serial-dev COM5 b1-display --pattern black\n```\n\n###### Send command when device connects\n\nBy default the app tries to connect with the device and aborts if it can't\nconnect. But you might want to start the app, have it wait until the device is\nconnected and then send the command.\n\n```\n\u003e inputmodule-control b1-display --pattern black\nFailed to find serial device. Please manually specify with --serial-dev\n\n# No failure, waits until the device is connected, sends command and exits\n\u003e inputmodule-control --wait-for-device b1-display --pattern black\n\n# If the device is already connected, it does nothing, just wait 1s.\n# This means you can run this command by a system service and restart it when\n# it finishes. Then it will only ever do anything if the device reconnects.\n\u003e inputmodule-control --wait-for-device b1-display --pattern black\nDevice already present. No need to wait. Not executing command.\n```\n\n## Update the Firmware\n\nFirst, put the module into bootloader mode.\n\nThis can be done either by pressing the bootsel button while plugging it in or\nby using one of the following commands:\n\n```sh\ninputmodule-control led-matrix --bootloader\ninputmodule-control b1-display --bootloader\ninputmodule-control c1-minimal --bootloader\n```\n\nThen the module will present itself in the same way as a USB thumb drive.\nCopy the UF2 firmware file onto it and the device will flash and reset automatically.\nAlternatively when building from source, run one of the following commands:\n\n```sh\ncargo run -p ledmatrix\ncargo run -p b1display\ncargo run -p c1minimal\n```\n\n## Building the firmware\n\nDependencies: [Rust/rustup](https://rustup.rs/), pkg-config, libudev\n\nPrepare Rust toolchain (once):\n\n```sh\nrustup target install thumbv6m-none-eabi\ncargo install flip-link\ncargo install cargo-make\ncargo install elf2uf2-rs\n```\n\nBuild:\n\n```sh\ncargo make --cwd ledmatrix\ncargo make --cwd b1display\ncargo make --cwd c1minimal\n```\n\nGenerate the UF2 update file into `target/thumbv6m-none-eabi/release/`:\n\n```sh\ncargo make --cwd ledmatrix uf2\ncargo make --cwd b1display uf2\ncargo make --cwd c1minimal uf2\n```\n\n## Building the Application\n\nDependencies: [Rust/rustup](https://rustup.rs/), pkg-config, libudev\n\nCurrently have to specify the build target because it's not possible to specify a per package build target.\nTracking issue: https://github.com/rust-lang/cargo/issues/9406\n\n```sh\n# Install cargo-make to help build it\ncargo install cargo-make\n\n# Build it\n\u003e cargo make --cwd inputmodule-control\n\n# Build and run it, showing the tool version\n\u003e cargo make --cwd inputmodule-control run -- --version\n```\n\n### Check the firmware version of the device\n\n###### In-band using commandline\n\n```sh\n\u003e inputmodule-control led-matrix --version\nDevice Version: 0.2.0\n```\n\n###### By looking at the USB descriptor\n\nOn Linux:\n\n```sh\n\u003e lsusb -d 32ac: -v 2\u003e /dev/null | grep -P 'ID 32ac|bcdDevice'\nBus 003 Device 078: ID 32ac:0021 Framework Laptop 16 B1 Display\n  bcdDevice            0.10\n```\n\n## Rust Panic\n\nWhen the Rust code panics, the RP2040 resets itself into bootloader mode.\nThis means a new firmware can be written to overwrite the old one.\n\nAdditionally the panic message is written to XIP RAM, which can be read with [picotool](https://github.com/raspberrypi/picotool):\n\n```sh\nsudo picotool save -r 0x15000000 0x15004000 message.bin\nstrings message.bin | head\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fframeworkcomputer%2Finputmodule-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fframeworkcomputer%2Finputmodule-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fframeworkcomputer%2Finputmodule-rs/lists"}