{"id":16717501,"url":"https://github.com/firobe/i2c-unix","last_synced_at":"2025-03-15T09:42:28.422Z","repository":{"id":74791557,"uuid":"592062082","full_name":"Firobe/i2c-unix","owner":"Firobe","description":"Modern bindings to the I2C user-space kernel interface","archived":false,"fork":false,"pushed_at":"2023-05-06T01:15:17.000Z","size":9,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-22T00:37:22.527Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"OCaml","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/Firobe.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-01-22T19:58:56.000Z","updated_at":"2023-04-26T16:35:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"aefd6716-2481-4830-88ca-ad175977e021","html_url":"https://github.com/Firobe/i2c-unix","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Firobe%2Fi2c-unix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Firobe%2Fi2c-unix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Firobe%2Fi2c-unix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Firobe%2Fi2c-unix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Firobe","download_url":"https://codeload.github.com/Firobe/i2c-unix/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243713402,"owners_count":20335566,"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":[],"created_at":"2024-10-12T21:32:10.725Z","updated_at":"2025-03-15T09:42:28.399Z","avatar_url":"https://github.com/Firobe.png","language":"OCaml","funding_links":[],"categories":[],"sub_categories":[],"readme":"# i2c-unix\n\nThis library provides bindings to the `i2c-dev` module of the Linux kernel to\naccess the I2C bus from user space.\n\nIt is partly inspired by the older\n[ocaml-i2c](https://github.com/mwweissmann/ocaml-i2c) library by Markus\nWeissmann, aiming to use more modern tools (like `dune` and `ctypes`).\n\nIts API is very straightforward and documented [online](FIXME).\n\n## Installation\n\n\u003e Run `opam install i2c-unix`\n\nYou will have to have the SMBus i2c headers available on your system for the\npackage to build, provided by `i2c-tools` on Arch Linux or `libi2c-dev` on\nDebian.\n\n## Usage\n\nFor the library to work, ensure:\n- the `i2c_dev` kernel module is loaded (`lsmod | grep i2c_dev`)\n- you have an I2C bus attached to the system (`i2cdetect -l`)\n\nThen you can use this library, with the name of the device returned by\n`i2cdetect` (usually of the form `i2c-X`):\n\n```ocaml\n(* This snippet reads a byte from the bus at address 0x20 *)\nlet (let*) = Result.bind\n\nlet i2c =\n  let* t = I2c_unix.open_device \"i2c-1\" 0x20 in\n  let* b : Stdint.uint8 = I2c_unix.read_byte t in\n  (* do something with b *)\n  I2c_unix.close_device t;\n  Result.ok ()\n```  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirobe%2Fi2c-unix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffirobe%2Fi2c-unix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirobe%2Fi2c-unix/lists"}