{"id":15957267,"url":"https://github.com/mamantoha/crystal-hidapi","last_synced_at":"2026-02-25T13:32:19.386Z","repository":{"id":175882834,"uuid":"613324487","full_name":"mamantoha/crystal-hidapi","owner":"mamantoha","description":"A Crystal interface to HIDAPI library.","archived":false,"fork":false,"pushed_at":"2024-07-09T16:38:34.000Z","size":28,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-27T14:32:28.471Z","etag":null,"topics":["crystal","hidapi"],"latest_commit_sha":null,"homepage":"","language":"Crystal","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/mamantoha.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":"2023-03-13T10:57:15.000Z","updated_at":"2024-07-09T16:38:37.000Z","dependencies_parsed_at":"2024-07-09T20:42:33.337Z","dependency_job_id":"f4a8cd3a-b0a1-4ba2-84ae-3e447e91c0f1","html_url":"https://github.com/mamantoha/crystal-hidapi","commit_stats":null,"previous_names":["mamantoha/crystal-hidapi"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mamantoha/crystal-hidapi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mamantoha%2Fcrystal-hidapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mamantoha%2Fcrystal-hidapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mamantoha%2Fcrystal-hidapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mamantoha%2Fcrystal-hidapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mamantoha","download_url":"https://codeload.github.com/mamantoha/crystal-hidapi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mamantoha%2Fcrystal-hidapi/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266210835,"owners_count":23893337,"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":["crystal","hidapi"],"created_at":"2024-10-07T13:41:11.142Z","updated_at":"2025-10-29T11:18:00.789Z","avatar_url":"https://github.com/mamantoha.png","language":"Crystal","funding_links":[],"categories":[],"sub_categories":[],"readme":"# crystal-hidapi\n\n[![Crystal CI](https://github.com/mamantoha/crystal-hidapi/actions/workflows/crystal.yml/badge.svg)](https://github.com/mamantoha/crystal-hidapi/actions/workflows/crystal.yml)\n\nA Crystal interface to [HIDAPI](https://github.com/libusb/hidapi) library.\n\nIt works on Linux and macOS.\n\n## Installation\n\n1. Add the dependency to your `shard.yml`:\n\n   ```yaml\n   dependencies:\n     crystal-hidapi:\n       github: mamantoha/crystal-hidapi\n   ```\n\n2. Run `shards install`\n\n### Compile time dependencies\n\nYou need to install the development package for `hidapi`\n\n- macOS: `brew install hidapi`\n- Arch Linux: `pacman -S hidapi`\n- Ubuntu: `apt install libhidapi-dev`\n\n## Usage\n\n```crystal\nrequire \"crystal-hidapi\"\n```\n\n### Sample Usage\n\nExplore the following examples:\n\n- [Retrieve battery level for Sony PlayStation 5 DualSense controller](samples/dualsense_battery.cr)\n- [Fetch battery capacity and status for Sony DualShock4 (2nd gen) controller](samples/dualshock4_battery.cr)\n\n## Development\n\n```\ncrystal ./lib/crystal_lib/src/main.cr src/hidapi/lib_hidapi.cr.in \u003e src/hidapi/lib_hidapi.cr\n```\n\n## External Resources Usage\n\n- [libusb's hidapi on GitHub](https://github.com/libusb/hidapi)\n- [hidapi header file](https://github.com/libusb/hidapi/blob/master/hidapi/hidapi.h)\n- [hidapi test code](https://github.com/libusb/hidapi/blob/master/hidtest/test.c)\n- [hidapitester code by todbot](https://github.com/todbot/hidapitester/blob/master/hidapitester.c)\n\n## Contributing\n\n1. Fork it (\u003chttps://github.com/mamantoha/crystal-hidapi/fork\u003e)\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n\n## Contributors\n\n- [Anton Maminov](https://github.com/mamantoha) - creator and maintainer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmamantoha%2Fcrystal-hidapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmamantoha%2Fcrystal-hidapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmamantoha%2Fcrystal-hidapi/lists"}