cry-bus
Version, currently master branch1 version
- master branchlatestMar 31, 2026
github.com/D-Shwagginz/cry-bus
A library for using connectors and a bus to emulate an address space in Crystal
Installation
# Add this to your shard.yml
dependencies:
cry-bus:
github: D-Shwagginz/cry-bus
branch: mastermaster is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
>= 1.18.2- License
- MIT
- Author
- your-name-here <your-email-here>
- Target
cry-busfrom src/cry-bus.cr
Dependencies
This version declares no dependencies.
README
Crystal Bus
A simple library used to create an IO bus and attach connectors to read and write data on the bus.
Installation
- Add
cry-busto yourshard.yml:
dependencies:
cry-bus:
github: D-Shwagginz/cry-bus
- Run
shards install
Usage
For a guide check out the docs
Make sure to check out the examples!
Quick example of using Crybus to connect two registers to be written to and read from on a bus:
require "cry-bus"
class Register < Crybus::Circuit
@data : UInt8 = 0
def output(address : UInt32) : UInt8
return @data
end
def input(address : UInt32, data : UInt8)
@data = data
end
def initialize(bus : Crybus::Bus, address : UInt32)
bus.connect(@connector)
@connector.segments << Crybus::Connector::Segment.new(address, ->output(UInt32), ->input(UInt32, UInt8))
end
end
bus = Crybus::Bus.new
Register.new(bus, 0)
Register.new(bus, 1)
You can now bus.read(address) and bus.write(address, data) to registers at 0x00 and 0x01!
Contributing
- Fork it (https://github.com/your-github-user/cry-bus/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- D. Shwagginz - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
master- Seen
- Mar 31, 2026
- Crystal
>= 1.18.2- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/D-Shwagginz/cry-bus
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 17, 2026
- Synced
- Aug 17, 2026
- Versions
- 1