{"id":16251739,"url":"https://github.com/bgould/tinygo-model-m","last_synced_at":"2025-06-15T01:39:54.472Z","repository":{"id":74149839,"uuid":"212930745","full_name":"bgould/tinygo-model-m","owner":"bgould","description":"Prototype of firmware written in TinyGo for replacement controller for Model M keyboard","archived":false,"fork":false,"pushed_at":"2019-11-03T20:00:00.000Z","size":782,"stargazers_count":17,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-03T06:22:56.874Z","etag":null,"topics":["keyboard-firmware","tinygo"],"latest_commit_sha":null,"homepage":"","language":"Go","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/bgould.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":"2019-10-05T02:02:52.000Z","updated_at":"2024-11-26T09:27:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"749c76c7-35da-479e-8bb3-55db6b2a8ef6","html_url":"https://github.com/bgould/tinygo-model-m","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bgould/tinygo-model-m","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgould%2Ftinygo-model-m","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgould%2Ftinygo-model-m/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgould%2Ftinygo-model-m/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgould%2Ftinygo-model-m/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bgould","download_url":"https://codeload.github.com/bgould/tinygo-model-m/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgould%2Ftinygo-model-m/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259910053,"owners_count":22930673,"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":["keyboard-firmware","tinygo"],"created_at":"2024-10-10T15:11:12.714Z","updated_at":"2025-06-15T01:39:54.433Z","avatar_url":"https://github.com/bgould.png","language":"Go","readme":"Replacement controller for Model M keyboard with firmware written in TinyGo\n=================================================\n\nThis is an experimental project that I am using to familiarize myself with idioms and techniques for creating embedded firmware using [TinyGo][tinygo].\n\nThe architecture of the firmware code is a loose port of the excellent [TMK Keyboard][tmk] firmware libary from C to TinyGo.\n\nHardware\n--------\n\nTo build the controller I de-soldered the connectors from the original controller and added the following parts:\n * (1) [Adafruit Feather M0 Express][feather-m0]\n * (1) [Bluefruit LE SPI Friend][spifriend]\n * (2) [MCP23008 I/O Port Expanders][mcp23008]\n * (2) 4.47k resistors\n\nThe setup looks like this:\n\n\u003cimage src=\"docs/matrix_and_circuit_1024x768.png\"\u003e\n\n\u003cimage src=\"docs/circuit.jpg\"\u003e\n\nFirmware\n--------\n\nTo build and install the firmware, first install TinyGo as per the website and make sure you've setup up the LLVM toolchain to be able to compile code for ARM Cortex-M according to the instructions.\n\nUse `make` to compile a UF2 file and `make flash` to flash it onto the Feather board (assuming it is on `/dev/ttyACM0`, you may need to adjust the Makefile to suit your needs).  If you do not already have a TinyGo application running on the Feather board, you may need to press the reset button twice in order to put it into bootloader mode the first time.\n\nNote: if your Bluefruit LE SPI Friend device is not brand new you should power up the device and hold the DFU pin low for 5 seconds and then release it to perform a factory reset, or use one of Adafruit's example Arduino sketches to do the same using the documented AT command.\n\nUsage\n-----\n\nOnce the firmware starts up, the Bluefruit device will need to be paired.  Perform a bluetooth scan with the device you want to pair and select \"TinyGo Model M Keyboard\".  Once paired, the blue light on the Bluefruit device will illuminate and stay on.  You can then start using the keyboard with the paired device.\n\nThe keymap used in the firmware is the \"ANSI 101\" layout that you'll find on most vintage US versions of the Model M keyboard.  The keys can be remapped by changing the \u003ca href=\"pkg/modelm/keymap.go\"\u003epkg/modelm/keymap.go\u003c/a\u003e file and recompiling.  A list of available keycodes can be found in \u003ca href=\"pkg/keyboard/keycodes/keycodes.go\"\u003ekeycodes.go\u003c/a\u003e (not all are supported yet, see Next Steps below).\n\nIf the firmware is compiled with the debug variable set to true in main.go, you can connect to the serial port of the Feather device to see debugging information as you type, for exampe:\n\n    screen /dev/ttyACM0 115200\n\nMake sure you set the baud rate explicitly other is seems `screen` will trigger a reset to the bootloader on the Feather board.\n\nFor development, you might find it useful to set the following build tags in your editor for better Go completion:\n\n    :GoBuildTags tinygo arm atsamd21g18 atsamd21 sam atsamd21g18a feather_m0\n\nNext steps\n----------\n\nI plan to take this a little further before perhaps refactoring and spinning off a separate project that is a more generic port (friendly fork) of the TMK firmware library.  I would definitely like to get layer switching working with multiple keymaps, as well as mouse keys and media keys.\n\nIn addition, to the keyboard framework code, this project probably has a couple of driver libraries that could be extracted and built upon, specifically the code for the MCP23008 chips and the code for interfacing with the Bluefruit SPI Friend device.\n\nContributions \u0026 License\n-----------------------\n\nPull requests are welcome.\n\nFor now license is GPLv2 or later, same as TMK keyboard firmware since I'm not sure if this is considered a derivative work or not, so better safe than sorry.  At this point this is just a prototype/experiment anyhow.\n\n[tinygo]: https://tinygo.org/\n[tmk]: https://github.com/tmk/tmk_keyboard\n\n[feather-m0]: https://www.adafruit.com/product/3403\n[spifriend]: https://www.adafruit.com/product/2633\n[mcp23008]: https://www.adafruit.com/product/593","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbgould%2Ftinygo-model-m","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbgould%2Ftinygo-model-m","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbgould%2Ftinygo-model-m/lists"}