{"id":49070685,"url":"https://github.com/benedekkupper/stm32-i2c-hid","last_synced_at":"2026-04-20T07:08:17.771Z","repository":{"id":225229995,"uuid":"470364928","full_name":"benedekkupper/stm32-i2c-hid","owner":"benedekkupper","description":"HID over I2C demonstration","archived":false,"fork":false,"pushed_at":"2024-08-02T14:18:27.000Z","size":167,"stargazers_count":34,"open_issues_count":2,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-02T16:04:11.976Z","etag":null,"topics":["hid-device","hid-keyboard","hid-over-i2c","i2c","i2c-slave","stm32"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/benedekkupper.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2022-03-15T23:33:43.000Z","updated_at":"2024-08-02T14:18:30.000Z","dependencies_parsed_at":"2024-08-02T16:10:34.501Z","dependency_job_id":null,"html_url":"https://github.com/benedekkupper/stm32-i2c-hid","commit_stats":null,"previous_names":["benedekkupper/stm32-i2c-hid"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/benedekkupper/stm32-i2c-hid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benedekkupper%2Fstm32-i2c-hid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benedekkupper%2Fstm32-i2c-hid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benedekkupper%2Fstm32-i2c-hid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benedekkupper%2Fstm32-i2c-hid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benedekkupper","download_url":"https://codeload.github.com/benedekkupper/stm32-i2c-hid/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benedekkupper%2Fstm32-i2c-hid/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32036825,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T00:18:06.643Z","status":"online","status_checked_at":"2026-04-20T02:00:06.527Z","response_time":94,"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":["hid-device","hid-keyboard","hid-over-i2c","i2c","i2c-slave","stm32"],"created_at":"2026-04-20T07:08:17.249Z","updated_at":"2026-04-20T07:08:17.761Z","avatar_url":"https://github.com/benedekkupper.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HID over I2C demonstration\n\nThis project demonstrates how HID over I2C can be used as a flexible protocol between a Linux SoC and an STM32 MCU.\nWhen enumerated by the kernel, the MCU will be treated as 3 separate virtual devices: a keyboard, a mouse\nand a raw HID device. The number and purpose of the virtual devices is defined by the descriptors\nsent by the MCU.\nThe demo code sends CAPS_LOCK key events when the button on the development board is pressed,\nand lights up an LED when the CAPS_LOCK LED is activated from the host.\n\n## Portability\n\nThis code is built for and tested on an [32F072BDISCOVERY][32F072BDISCOVERY] kit, as this is a low cost MCU line,\nand the board has a separate connector for I2C communication.\n\nPorting this code within the STM32 product line is guaranteed to be minimal effort, since the implementation\ninteracts with the hardware via the HAL library.\nAll you need to do is replace the current STM32CubeMX configuration with your choice\nand generate the new cmake project with it.\n\nPorting this code to another MCU type will require porting `hal_i2c_slave.cpp` to interact with the I2C and GPIO\nFW of your choice of silicon.\n\n## Customizing the HID application\n\nYou can easily extend the HID functionality by modifying the report descriptor and adapting the app code.\nEither find the existing application and usages in the HID usage tables,\nor define your own vendor-specific usage page(s) - even by adding them to your [hid-usage-tables] fork.\nThe [hid-rp] library allows you to perform compile-time verification of the report descriptor,\nhelping you avoid some mistakes. This verification isn't all-encompassing,\nand it relies on C++ exceptions. That's why there is a separate cmake target, that compiles the related source file\nfor verification with exceptions enabled. Exceptions are disabled in the firmware to be flashed itself.\n\n## Host configuration\n\nThis project is tested with a Raspberry Pi 400, please refer to [this guide][raspberry-guide] on how to\nconfigure a Linux kernel to use HID over I2C.\n\n\n[32F072BDISCOVERY]: https://www.st.com/en/evaluation-tools/32f072bdiscovery.html\n[hid-usage-tables]: https://github.com/IntergatedCircuits/hid-usage-tables\n[hid-rp]: https://github.com/IntergatedCircuits/hid-rp\n[raspberry-guide]: https://github.com/NordicPlayground/nrf52-i2c-hid-demo/blob/master/Raspbian/Raspbian_HID-Over-I2C_README.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenedekkupper%2Fstm32-i2c-hid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenedekkupper%2Fstm32-i2c-hid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenedekkupper%2Fstm32-i2c-hid/lists"}