Class: Beaglebone::I2CDevice
- Inherits:
-
Object
- Object
- Beaglebone::I2CDevice
- Defined in:
- lib/beaglebone/i2c.rb
Overview
Object Oriented I2C Implementation. This treats the I2C device as an object.
Instance Method Summary collapse
-
#disable ⇒ Object
Disable the specified I2C device.
-
#file ⇒ Object
Return the file descriptor to the open I2C device.
-
#initialize(i2c) ⇒ I2CDevice
constructor
Initialize an I2C device.
-
#read(address, bytes = 1, register = nil) ⇒ Object
Read data from an I2C device.
-
#write(address, data) ⇒ Object
Write data to an I2C device.
Constructor Details
Instance Method Details
#disable ⇒ Object
Note:
device trees cannot be unloaded at this time without kernel panic.
Disable the specified I2C device.
251 252 253 |
# File 'lib/beaglebone/i2c.rb', line 251 def disable I2C::disable(@i2c) end |
#file ⇒ Object
Return the file descriptor to the open I2C device
256 257 258 |
# File 'lib/beaglebone/i2c.rb', line 256 def file I2C::file(@i2c) end |