Class: RubyI2C::Adapter::Base
- Inherits:
-
Object
- Object
- RubyI2C::Adapter::Base
- Defined in:
- lib/ruby-i2c/adapter/base.rb
Instance Method Summary collapse
- #command(address, cmd, length = 1, rest = nil) ⇒ Object
-
#initialize(force: false, **args) ⇒ Base
constructor
A new instance of Base.
- #read(address, length = 1) ⇒ Object
- #write(address, *data) ⇒ Object
Constructor Details
#initialize(force: false, **args) ⇒ Base
Returns a new instance of Base.
6 7 8 |
# File 'lib/ruby-i2c/adapter/base.rb', line 6 def initialize(force: false, **args) @slave_addr = force ? I2C_SLAVE_FORCE : I2C_SLAVE end |
Instance Method Details
#command(address, cmd, length = 1, rest = nil) ⇒ Object
11 12 13 |
# File 'lib/ruby-i2c/adapter/base.rb', line 11 def command(address, cmd, length=1, rest=nil) raise NotImplementedError end |
#read(address, length = 1) ⇒ Object
16 17 18 |
# File 'lib/ruby-i2c/adapter/base.rb', line 16 def read(address, length=1) raise NotImplementedError end |
#write(address, *data) ⇒ Object
21 22 23 |
# File 'lib/ruby-i2c/adapter/base.rb', line 21 def write(address, *data) raise NotImplementedError end |