Class: WiringPi::SPI
- Inherits:
-
Object
- Object
- WiringPi::SPI
- Defined in:
- lib/wiringpi/spi.rb
Instance Method Summary collapse
-
#initialize(channel, speed) ⇒ SPI
constructor
A new instance of SPI.
- #wiringPiSPIDataRW(data) ⇒ Object
- #wiringPiSPIGetFd ⇒ Object
Constructor Details
#initialize(channel, speed) ⇒ SPI
Returns a new instance of SPI.
4 5 6 7 |
# File 'lib/wiringpi/spi.rb', line 4 def initialize(channel,speed) @channel = channel Wiringpi.wiringPiSPISetup(channel,speed) end |
Instance Method Details
#wiringPiSPIDataRW(data) ⇒ Object
11 12 13 |
# File 'lib/wiringpi/spi.rb', line 11 def wiringPiSPIDataRW(data) return Wiringpi.wiringPiSPIDataRW(@channel,data) end |
#wiringPiSPIGetFd ⇒ Object
8 9 10 |
# File 'lib/wiringpi/spi.rb', line 8 def wiringPiSPIGetFd() return Wiringpi.wiringPiSPIGetFd(@channel) end |