Class: Denko::UART::Hardware
- Inherits:
-
Object
- Object
- Denko::UART::Hardware
- Defined in:
- lib/denko/uart/hardware.rb
Constant Summary
Constants included from Behaviors::Lifecycle
Behaviors::Lifecycle::CALLBACK_METHODS
Instance Attribute Summary collapse
-
#baud ⇒ Object
readonly
Returns the value of attribute baud.
-
#index ⇒ Object
readonly
Returns the value of attribute index.
Attributes included from Behaviors::State
Attributes included from Behaviors::SinglePin
Attributes included from Behaviors::Component
Instance Method Summary collapse
Methods included from Common
#flush, #gets, #initialize_buffer
Methods included from Behaviors::Lifecycle
Methods included from Behaviors::Callbacks
#add_callback, #callbacks, #pre_callback_filter, #remove_callback, #update
Methods included from Behaviors::State
Methods included from Behaviors::SinglePin
#convert_pins, #initialize_pins
Methods included from Behaviors::Component
Instance Attribute Details
#baud ⇒ Object (readonly)
Returns the value of attribute baud.
9 10 11 |
# File 'lib/denko/uart/hardware.rb', line 9 def baud @baud end |
#index ⇒ Object (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 |
#stop ⇒ Object
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 |