Class: Beaglebone::SPIDevice
- Inherits:
-
Object
- Object
- Beaglebone::SPIDevice
- Defined in:
- lib/beaglebone/spi.rb
Overview
Object Oriented SPI Implementation. This treats the SPI device as an object.
Instance Method Summary collapse
-
#disable ⇒ Object
Disable the specified SPI device.
-
#file ⇒ Object
Return the file descriptor to the open SPI device.
-
#initialize(spi, mode = nil, speed = 1000000, bpw = 8) ⇒ SPIDevice
constructor
Initialize an SPI device.
-
#set_bpw(bpw) ⇒ Object
Set the bits per word of the SPI device.
-
#set_mode(mode) ⇒ Object
Set the communication speed of the SPI device.
-
#set_speed(speed) ⇒ Object
Set the communication speed of the SPI device.
-
#xfer(tx_data, readbytes = 0, speed = nil, delay = nil, bpw = nil) ⇒ Object
Transfer data to and from the SPI device.
Constructor Details
Instance Method Details
#disable ⇒ Object
Note:
device trees cannot be unloaded at this time without kernel panic.
Disable the specified SPI device
457 458 459 |
# File 'lib/beaglebone/spi.rb', line 457 def disable SPI::disable(@spi) end |
#file ⇒ Object
Return the file descriptor to the open SPI device
428 429 430 |
# File 'lib/beaglebone/spi.rb', line 428 def file SPI::file(@spi) end |
#set_bpw(bpw) ⇒ Object
Set the bits per word of the SPI device
449 450 451 |
# File 'lib/beaglebone/spi.rb', line 449 def set_bpw(bpw) SPI::set_bpw(@spi, bpw) end |
#set_mode(mode) ⇒ Object
Set the communication speed of the SPI device
442 443 444 |
# File 'lib/beaglebone/spi.rb', line 442 def set_mode(mode) SPI::set_mode(@spi, mode) end |