Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/charkster/i2c_and_spi_shared_regmap
A shared regmap with 2 bus interfaces (I2C and SPI 3wire). Three different clock domains all handled cleanly with an extremely simple bus arbitration.
https://github.com/charkster/i2c_and_spi_shared_regmap
arbitration i2c-bus regmap spi-bus
Last synced: about 1 month ago
JSON representation
A shared regmap with 2 bus interfaces (I2C and SPI 3wire). Three different clock domains all handled cleanly with an extremely simple bus arbitration.
- Host: GitHub
- URL: https://github.com/charkster/i2c_and_spi_shared_regmap
- Owner: charkster
- License: mit
- Created: 2024-10-16T01:52:24.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-10-25T02:45:20.000Z (about 2 months ago)
- Last Synced: 2024-10-26T16:19:32.768Z (about 2 months ago)
- Topics: arbitration, i2c-bus, regmap, spi-bus
- Language: SystemVerilog
- Homepage:
- Size: 23.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# i2c_and_spi_shared_regmap
A 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.The 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).
The 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.