{"id":20195398,"url":"https://github.com/charkster/i2c_and_spi_shared_regmap","last_synced_at":"2026-03-05T07:35:31.196Z","repository":{"id":258087026,"uuid":"873334849","full_name":"charkster/i2c_and_spi_shared_regmap","owner":"charkster","description":"A shared regmap with 2 bus interfaces (I2C and SPI 3wire). Three different clock domains all handled cleanly with an extremely simple bus arbitration.","archived":false,"fork":false,"pushed_at":"2025-05-02T00:36:04.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-02T01:27:18.910Z","etag":null,"topics":["arbitration","i2c-bus","regmap","spi-bus"],"latest_commit_sha":null,"homepage":"","language":"SystemVerilog","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/charkster.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":"2024-10-16T01:52:24.000Z","updated_at":"2025-05-02T00:36:07.000Z","dependencies_parsed_at":"2025-01-13T19:25:20.704Z","dependency_job_id":"7382444e-ab6e-4ef6-906b-f8157e616142","html_url":"https://github.com/charkster/i2c_and_spi_shared_regmap","commit_stats":null,"previous_names":["charkster/i2c_and_spi_shared_regmap"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/charkster/i2c_and_spi_shared_regmap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charkster%2Fi2c_and_spi_shared_regmap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charkster%2Fi2c_and_spi_shared_regmap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charkster%2Fi2c_and_spi_shared_regmap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charkster%2Fi2c_and_spi_shared_regmap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/charkster","download_url":"https://codeload.github.com/charkster/i2c_and_spi_shared_regmap/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charkster%2Fi2c_and_spi_shared_regmap/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30114316,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T03:40:26.266Z","status":"ssl_error","status_checked_at":"2026-03-05T03:39:15.902Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["arbitration","i2c-bus","regmap","spi-bus"],"created_at":"2024-11-14T04:17:16.899Z","updated_at":"2026-03-05T07:35:30.863Z","avatar_url":"https://github.com/charkster.png","language":"SystemVerilog","funding_links":[],"categories":[],"sub_categories":[],"readme":"# i2c_and_spi_shared_regmap\nA shared regmap with 2 bus interfaces (I2C and SPI 3wire). Three different clock domains all handled cleanly with an extremely simple bus arbitration. No fifo is needed, but read_data is buffered in two clock domains.\n\nThe core clock needs to be at least half of the fastest bus clock frequency. For example if the I2C clock is 400kHz and the SPI clock is 1MHz, the slowest core clock frequency is 500kHz (it can be infinitely faster, but no slower). If the I2C clock is 400kHz and the SPI clock is 100kHz, the slowest core clock would be 200kHz. If SPI and I2C buses are simultaneously trying to access the shared regmap, the SPI bus has priority and the I2C bus will get access on the next core clock cycle (isn't this simple).\n\nThe SPI variant used here is a 3wire, but minimal changes would allow a 4wire to be used (see [spi_slave_lbus](https://github.com/charkster/cmod_a7_spi_sram/blob/master/spi_slave_lbus.sv) in my [cmod_a7_spi_sram](https://github.com/charkster/cmod_a7_spi_sram) repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharkster%2Fi2c_and_spi_shared_regmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcharkster%2Fi2c_and_spi_shared_regmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharkster%2Fi2c_and_spi_shared_regmap/lists"}