spi 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +13 -1
- data/lib/spi.rb +1 -1
- data/lib/spi/driver/spidev.rb +0 -1
- data/lib/spi/version.rb +1 -1
- data/spi.gemspec +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e2b1fac94e0b135719cfc082dde905168e0a837
|
4
|
+
data.tar.gz: 45565544a59e3948411896f9fbab5d41133409d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5144a2dbe72439cf91494d3a26ec1ffdd20d4363408f8edbd3ea7c0a8b4be5ac72b46593ceaf065dfe83e8ef1a3d17012231bed8090cc47ddcdbd346b5e581a
|
7
|
+
data.tar.gz: 680f0a311ec4cbcc031a4ae02a545899d794faf35b34e61f90e83a8a02777f84c3252bb5f063b84380611a867a2c8120ca0ed729b71fba02c43049f947addc27
|
data/README.md
CHANGED
@@ -55,6 +55,18 @@ s.xfer(txdata: [0x10,0x00])
|
|
55
55
|
This should result in a 2 byte array with the 2nd value reporting 36 (0x24)
|
56
56
|
|
57
57
|
|
58
|
+
## Enabling SPI
|
59
|
+
### C.H.I.P.
|
60
|
+
https://bbs.nextthing.co/t/using-spi-on-chip-without-kernel-hack/15395
|
61
|
+
|
62
|
+
In simple terms (assuming a more recent (december 2016 or later 4.4 image)
|
63
|
+
```bash
|
64
|
+
sudo mkdir -p /sys/kernel/config/device-tree/overlays/spi
|
65
|
+
sudo cp /lib/firmware/nextthingco/chip/sample-spi.dtbo /sys/kernel/config/device-tree/overlays/spi/dtbo
|
66
|
+
```
|
67
|
+
|
68
|
+
### Raspberry Pi
|
69
|
+
|
58
70
|
## Development
|
59
71
|
|
60
72
|
After 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.
|
@@ -63,5 +75,5 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
63
75
|
|
64
76
|
## Contributing
|
65
77
|
|
66
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
78
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/m1ari/ruby-spi.
|
67
79
|
|
data/lib/spi.rb
CHANGED
@@ -12,7 +12,7 @@ class SPI
|
|
12
12
|
if args[:driver].nil?
|
13
13
|
require "spi/driver/spidev"
|
14
14
|
@device = args[:device] or raise SPIException, "args[:device] required"
|
15
|
-
@driver=SPI::Driver::SPIdev.new(device:
|
15
|
+
@driver = SPI::Driver::SPIdev.new(device: @device)
|
16
16
|
end
|
17
17
|
|
18
18
|
def speed
|
data/lib/spi/driver/spidev.rb
CHANGED
@@ -10,7 +10,6 @@ class SPI
|
|
10
10
|
def initialize(args={})
|
11
11
|
raise SPIException, "No Device specified" if args[:device].nil?
|
12
12
|
raise SPIException, "Device #{args[:device]} not found" unless File.exists?(args[:device])
|
13
|
-
puts "Using Device #{args[:device]}"
|
14
13
|
@device = File.open(args[:device])
|
15
14
|
@mode=getMode
|
16
15
|
@bits=getBits
|
data/lib/spi/version.rb
CHANGED
data/spi.gemspec
CHANGED
@@ -19,6 +19,6 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
|
-
spec.add_development_dependency "bundler"
|
22
|
+
spec.add_development_dependency "bundler" #, "~> 1.11"
|
23
23
|
spec.add_development_dependency "rake", "~> 10.0"
|
24
24
|
end
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Axford
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|