{"id":15043690,"url":"https://github.com/m1ari/ruby-spi","last_synced_at":"2026-02-07T14:03:15.511Z","repository":{"id":59156029,"uuid":"85101707","full_name":"m1ari/ruby-spi","owner":"m1ari","description":"Ruby SPI gem","archived":false,"fork":false,"pushed_at":"2018-07-30T15:36:52.000Z","size":11,"stargazers_count":3,"open_issues_count":2,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-09T22:38:40.312Z","etag":null,"topics":["chip","gem","raspberry-pi","raspberrypi","ruby","spi"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/m1ari.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-15T17:30:02.000Z","updated_at":"2022-12-06T08:08:51.000Z","dependencies_parsed_at":"2022-09-13T20:11:06.958Z","dependency_job_id":null,"html_url":"https://github.com/m1ari/ruby-spi","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/m1ari/ruby-spi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m1ari%2Fruby-spi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m1ari%2Fruby-spi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m1ari%2Fruby-spi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m1ari%2Fruby-spi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/m1ari","download_url":"https://codeload.github.com/m1ari/ruby-spi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m1ari%2Fruby-spi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29196631,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T12:38:28.597Z","status":"ssl_error","status_checked_at":"2026-02-07T12:38:23.888Z","response_time":63,"last_error":"SSL_read: 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":["chip","gem","raspberry-pi","raspberrypi","ruby","spi"],"created_at":"2024-09-24T20:49:26.491Z","updated_at":"2026-02-07T14:03:15.492Z","avatar_url":"https://github.com/m1ari.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SPI\n\nThis gem aims to provide a Unified method of talking to SPI devices on a variety of hardware. This is mainly aimed at a range of Small Board Computers (SBCs) such as the Raspberry Pi and C.H.I.P. computers.\n\nCurrently only the Linux spidev kernel interface is implimented however the code is designed to make adding other drivers a simple process. It should then be possible to choose the correct driver for the hardware without having to re-write code.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'spi'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install spi\n\n## Usage\n\nYou may need to enable the SPI device on your hardware and/or load the kernel module.\nOn the Raspberry Pi SPI can be enabled through raspi-cofig\nOn the C.H.I.P. SPI can be loaded by importing the SPI DTB\n\nAfter doing this you should find one or more devices in /dev\n```bash\nuser@device:~ $ ls /dev/spi*\n/dev/spidev32766.0\n```\n\nTo use the default (SPIdev) driver you can specify\n```ruby\nrequire \"bundler/setup\"\nrequire \"spi\"\ns=SPI.new(device: '/dev/spidev32766.0')\ns.speed=500000\ns.xfer(txdata: [0x10,0x00])\n```\nCurrently SPIdev is the only driver.\n\n\nSimple Testing of just the SPIdev Driver with an RFM69\n```ruby\nrequire \"bundler/setup\"\nrequire \"spi\"\nrequire 'spi/driver/spidev'\ns=SPI::Driver::SPIdev.new(device: '/dev/spidev32766.0')\ns.speed=500000\ns.xfer(txdata: [0x10,0x00])\n```\nThis should result in a 2 byte array with the 2nd value reporting 36 (0x24)\n\n\n## Enabling SPI\n### C.H.I.P.\nhttps://bbs.nextthing.co/t/using-spi-on-chip-without-kernel-hack/15395\n\nIn simple terms (assuming a more recent (december 2016 or later 4.4 image)\n```bash\nsudo mkdir -p /sys/kernel/config/device-tree/overlays/spi\nsudo cp /lib/firmware/nextthingco/chip/sample-spi.dtbo /sys/kernel/config/device-tree/overlays/spi/dtbo\n```\n\n### Raspberry Pi\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/m1ari/ruby-spi.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm1ari%2Fruby-spi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fm1ari%2Fruby-spi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm1ari%2Fruby-spi/lists"}