beagleboard 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/beagleboard.rb +1 -1
- data/lib/beagleboard/base/adc.rb +5 -1
- data/lib/beagleboard/freebsd/adc.rb +12 -0
- data/lib/beagleboard/linux/adc.rb +2 -0
- data/lib/beagleboard/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7529c565c34774903cc1727c3ec2e4e7ca1215ccc4e841689b47d2c78283fccb
|
4
|
+
data.tar.gz: 2ad09edb5e7cf89d8041b834da41ad2650f58919ba6d6d7d766288cce575cffc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5eb08ff8a874e132aa0facb4c1f6604e04ed2336e6d6e771bd481267f147bfe955f3a820f282cc4444048af2c9935f3252716a795bacc0d14887c4997557efa4
|
7
|
+
data.tar.gz: 451ab8d8c73d3737bb935541e732c130552535117535de805aa6a2ea641802714a519f82af409baf9eb60dc9e10edddc944bd8420d5f108f92520f02ae6a430d
|
data/README.md
CHANGED
data/lib/beagleboard.rb
CHANGED
data/lib/beagleboard/base/adc.rb
CHANGED
@@ -13,6 +13,14 @@ module BeagleBoard
|
|
13
13
|
attach_function :sysctlbyname, %i[string pointer pointer pointer size_t], :int
|
14
14
|
attach_function :sysctlnametomib, %i[string pointer pointer], :int
|
15
15
|
|
16
|
+
def self.enabled?(mib)
|
17
|
+
buf = FFI::MemoryPointer.new(:int)
|
18
|
+
bufsiz = FFI::MemoryPointer.new(:int).write_int(buf.size)
|
19
|
+
res = sysctl(mib, 6, buf, bufsiz, nil, 0)
|
20
|
+
raise StandardError, 'Read error' if res < 0
|
21
|
+
buf.read_int == 1
|
22
|
+
end
|
23
|
+
|
16
24
|
def self.enable(mib)
|
17
25
|
buf = FFI::MemoryPointer.new(:int).write_int(1)
|
18
26
|
res = sysctl(mib, 6, nil, nil, buf, buf.size)
|
@@ -44,6 +52,10 @@ module BeagleBoard
|
|
44
52
|
super
|
45
53
|
end
|
46
54
|
|
55
|
+
def enabled?
|
56
|
+
Adc.enabled?(@enable_mib)
|
57
|
+
end
|
58
|
+
|
47
59
|
def enable
|
48
60
|
Adc.enable(@enable_mib)
|
49
61
|
end
|
data/lib/beagleboard/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: beagleboard
|
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
|
- atome
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|
@@ -132,7 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
132
132
|
version: '0'
|
133
133
|
requirements: []
|
134
134
|
rubyforge_project:
|
135
|
-
rubygems_version: 2.7.
|
135
|
+
rubygems_version: 2.7.7
|
136
136
|
signing_key:
|
137
137
|
specification_version: 4
|
138
138
|
summary: Library to manipulate beagleBoard devices.
|