Class: WiringPi::SPI

Inherits:
Object
  • Object
show all
Defined in:
lib/wiringpi/spi.rb

Instance Method Summary collapse

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

#wiringPiSPIGetFdObject



8
9
10
# File 'lib/wiringpi/spi.rb', line 8

def wiringPiSPIGetFd()
  return Wiringpi.wiringPiSPIGetFd(@channel)
end