class Pigpio::BitBangSerialRx

Attributes

rx[R]

Public Class Methods

new(rx,baud=9600,data_bits=8) click to toggle source
# File lib/pigpio/bit_bang_serial_rx.rb, line 4
def initialize(rx,baud=9600,data_bits=8)
  @rx=rx
  IF.bb_serial_read_open(@rx.pi,@rx.gpio,baud,data_bits)
  IF.bb_serial_invert(@rx.pi,@rx.gpio,0)
end

Public Instance Methods

close() click to toggle source
# File lib/pigpio/bit_bang_serial_rx.rb, line 9
def close
  IF.bb_serial_read_close(@rx.pi,@rx.gpio)
end
invert(invert=1) click to toggle source
# File lib/pigpio/bit_bang_serial_rx.rb, line 15
def invert(invert=1)
  IF.bb_serial_invert(@rx.pi,@rx.gpio,invert)
end
read(bufsize=1) click to toggle source
# File lib/pigpio/bit_bang_serial_rx.rb, line 12
def read(bufsize=1)
  IF.bb_serial_read(@rx.pi,@rx.gpio,bufsize)
end