Class: Denko::UART::Hardware

Inherits:
Object
  • Object
show all
Includes:
Behaviors::Callbacks, Behaviors::Lifecycle, Behaviors::SinglePin, Common
Defined in:
lib/denko/uart/hardware.rb

Constant Summary

Constants included from Behaviors::Lifecycle

Behaviors::Lifecycle::CALLBACK_METHODS

Instance Attribute Summary collapse

Attributes included from Behaviors::State

#state

Attributes included from Behaviors::SinglePin

#mode, #pin

Attributes included from Behaviors::Component

#board, #params

Instance Method Summary collapse

Methods included from Common

#flush, #gets, #initialize_buffer

Methods included from Behaviors::Lifecycle

included

Methods included from Behaviors::Callbacks

#add_callback, #callbacks, #pre_callback_filter, #remove_callback, #update

Methods included from Behaviors::State

#update_state

Methods included from Behaviors::SinglePin

#convert_pins, #initialize_pins

Methods included from Behaviors::Component

#initialize, #micro_delay

Instance Attribute Details

#baudObject (readonly)

Returns the value of attribute baud.



9
10
11
# File 'lib/denko/uart/hardware.rb', line 9

def baud
  @baud
end

#indexObject (readonly)

Returns the value of attribute index.



9
10
11
# File 'lib/denko/uart/hardware.rb', line 9

def index
  @index
end

Instance Method Details

#start(baud) ⇒ Object



27
28
29
30
# File 'lib/denko/uart/hardware.rb', line 27

def start(baud)
  @baud = baud
  board.uart_start(index, baud, true)
end

#stopObject



32
33
34
# File 'lib/denko/uart/hardware.rb', line 32

def stop()
  board.uart_stop(index)
end

#write(data) ⇒ Object



36
37
38
# File 'lib/denko/uart/hardware.rb', line 36

def write(data)
  board.uart_write(index, data)
end