pi_piper 2.0.beta.3 → 2.0.beta.4
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/Rakefile +1 -1
- data/lib/pi_piper/bcm2835.rb +13 -5
- data/lib/pi_piper/i2c.rb +4 -0
- data/lib/pi_piper/libbcm2835.img +0 -0
- data/pi_piper.gemspec +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4db33bd67174aa5889959cf3eddcb2e8b7a6ac7e
|
4
|
+
data.tar.gz: 2a9d53cc16b42c4642f99f15cfaa5600a990cd96
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33caeb1cc9c76871be9c7ea6c49bf2f738eff563bac9bc41bbb5febfbaeb6161a1bb3740cfa15b673f92da2b299a601a332fbd717481706fe6e2534a23d0987c
|
7
|
+
data.tar.gz: 3feece4a4633c52ad6ea15c6acbfd596cdc2ab1ee5c558002c2e934682f985a73419e2d9a861387a25a142438134d9b06386d1a9f724f87f824d6cdff8cb9943
|
data/Rakefile
CHANGED
@@ -8,7 +8,7 @@ require 'rake/testtask'
|
|
8
8
|
#gem build pi_piper.gemspec
|
9
9
|
#gem push xxx.gem
|
10
10
|
|
11
|
-
Echoe.new('pi_piper', '2.0.beta.
|
11
|
+
Echoe.new('pi_piper', '2.0.beta.4') do |p|
|
12
12
|
p.description = "Event driven Raspberry Pi GPIO library"
|
13
13
|
p.url = "http://github.com/jwhitehorn/pi_piper"
|
14
14
|
p.author = "Jason Whitehorn"
|
data/lib/pi_piper/bcm2835.rb
CHANGED
@@ -54,11 +54,12 @@ module PiPiper
|
|
54
54
|
:bcm2835_spi_setChipSelectPolarity, [:uint8, :uint8], :void
|
55
55
|
|
56
56
|
#I2C support...
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
57
|
+
attach_function :i2c_begin, :bcm2835_i2c_begin, [], :void
|
58
|
+
attach_function :i2c_end, :bcm2835_i2c_end, [], :void
|
59
|
+
attach_function :i2c_write, :bcm2835_i2c_write, [:pointer, :uint], :uint8
|
60
|
+
attach_function :i2c_set_address,:bcm2835_i2c_setSlaveAddress, [:uint8], :void
|
61
|
+
attach_function :i2c_set_clock_divider, :bcm2835_i2c_setClockDivider, [:uint16], :void
|
62
|
+
attach_function :i2c_read, :bcm2835_i2c_read, [:pointer, :uint], :uint8
|
62
63
|
|
63
64
|
def self.i2c_allowed_clocks
|
64
65
|
[100.kilohertz,
|
@@ -84,5 +85,12 @@ module PiPiper
|
|
84
85
|
i2c_write data_out, data.count
|
85
86
|
end
|
86
87
|
|
88
|
+
def self.i2c_read_bytes(bytes)
|
89
|
+
data_in = FFI::MemoryPointer.new(bytes)
|
90
|
+
i2c_read(data_in, bytes) #TODO reason codes
|
91
|
+
|
92
|
+
(0..bytes-1).map { |i| data_in.get_uint8(i) }
|
93
|
+
end
|
94
|
+
|
87
95
|
end
|
88
96
|
end
|
data/lib/pi_piper/i2c.rb
CHANGED
data/lib/pi_piper/libbcm2835.img
CHANGED
Binary file
|
data/pi_piper.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "pi_piper"
|
5
|
-
s.version = "2.0.beta.
|
5
|
+
s.version = "2.0.beta.4"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Jason Whitehorn"]
|
9
|
-
s.date = "2013-09-
|
9
|
+
s.date = "2013-09-14"
|
10
10
|
s.description = "Event driven Raspberry Pi GPIO library"
|
11
11
|
s.email = "jason.whitehorn@gmail.com"
|
12
12
|
s.extra_rdoc_files = ["README.md", "lib/pi_piper.rb", "lib/pi_piper/bcm2835.rb", "lib/pi_piper/frequency.rb", "lib/pi_piper/i2c.rb", "lib/pi_piper/libbcm2835.img", "lib/pi_piper/pin.rb", "lib/pi_piper/platform.rb", "lib/pi_piper/spi.rb"]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pi_piper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.beta.
|
4
|
+
version: 2.0.beta.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Whitehorn
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-09-
|
11
|
+
date: 2013-09-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|