{"id":18646701,"url":"https://github.com/rinhizakura/vi2c-diva","last_synced_at":"2025-05-08T21:13:28.624Z","repository":{"id":154865406,"uuid":"442187092","full_name":"RinHizakura/vi2c-diva","owner":"RinHizakura","description":"The virtual I2C platform device \"diva\" and its device driver","archived":false,"fork":false,"pushed_at":"2022-01-24T14:44:42.000Z","size":25,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-08T21:13:07.394Z","etag":null,"topics":["linux-i2c","linux-kernel-driver","linux-kernel-module"],"latest_commit_sha":null,"homepage":"","language":"C","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/RinHizakura.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":"2021-12-27T14:46:52.000Z","updated_at":"2024-07-15T09:08:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"d2025ad1-986a-44c5-b71d-57cdbde3d281","html_url":"https://github.com/RinHizakura/vi2c-diva","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/RinHizakura%2Fvi2c-diva","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RinHizakura%2Fvi2c-diva/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RinHizakura%2Fvi2c-diva/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RinHizakura%2Fvi2c-diva/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RinHizakura","download_url":"https://codeload.github.com/RinHizakura/vi2c-diva/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253149617,"owners_count":21861739,"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":["linux-i2c","linux-kernel-driver","linux-kernel-module"],"created_at":"2024-11-07T06:22:12.279Z","updated_at":"2025-05-08T21:13:28.565Z","avatar_url":"https://github.com/RinHizakura.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vi2c-diva\n\n## Introduction\n\nThe vi2c-diva project is trying to implement virtual I2C platform device \"diva\" and its device\ndriver. We'll try to understand the purpose of each component in the Linux I2C subsystem.\n\n![](misc/linux-i2c-subsystem.png)\n\nFor traditional chinese users who want to learn more about this project, you\nare welcome to check the [link](https://hackmd.io/@RinHizakura/BJDTZnUsF) for more\nintroduction of I2C. Welcome for any advice and discussion, thanks!\n\n## Usage\n\nTo build and insert these module, using the following command. Note that the sequence to\ninsert each module is important for kerenl to match our device and driver correctly.\n\n```\n$ make subdirs\n$ make -C pdev insert\n$ make -C adap insert\n$ make -C diva-dev insert\n```\n\nIf everything goes right, it means the probe function of 'adap' and 'diva-dev' will be\ncallbacked by kernel, which means we match the device driver to device successfully!\n\n```\n$ dmesg\n[diva-pdev] Init diva with status 0\n[i2c-diva-adap] Connect to diva adap i2c-diva\n[i2c-diva-dev] Connect to diva dev vi2c,diva-i2c\n[i2c-diva-dev] Transfer message: PASS\n```\n\nTo remove the module from kernel, using the following command.\n\n```\n$ make -C diva-dev remove\n$ make -C adap remove\n$ make -C pdev remove\n```\n\n## Reference\n* [Day 10：I2C Driver (Part 1) - 使用 Device Tree 來找 Driver](https://ithelp.ithome.com.tw/articles/10244211)\n* [Implementing I2C device drivers](https://www.kernel.org/doc/html/latest/i2c/writing-clients.html)\n* [How to instantiate I2C devices](https://www.kernel.org/doc/html/latest/i2c/instantiating-devices.html)\n* [linux/drivers/i2c/busses/i2c-bcm2835.c](https://github.com/torvalds/linux/blob/master/drivers/i2c/busses/i2c-bcm2835.c)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frinhizakura%2Fvi2c-diva","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frinhizakura%2Fvi2c-diva","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frinhizakura%2Fvi2c-diva/lists"}