Module: Denko::Behaviors::BusPeripheral

Includes:
Component
Included in:
BusPeripheralAddressed, SPI::Peripheral
Defined in:
lib/denko/behaviors/bus_peripheral.rb

Instance Attribute Summary collapse

Attributes included from Component

#board

Instance Method Summary collapse

Methods included from Component

#initialize, #micro_delay

Methods included from State

#initialize, #state

Instance Attribute Details

#addressObject (readonly)

Returns the value of attribute address.



6
7
8
# File 'lib/denko/behaviors/bus_peripheral.rb', line 6

def address
  @address
end

Instance Method Details

#atomically(&block) ⇒ Object



14
15
16
17
18
# File 'lib/denko/behaviors/bus_peripheral.rb', line 14

def atomically(&block)
  bus.mutex.synchronize do
    block.call
  end
end

#before_initialize(options = {}) ⇒ Object



9
10
11
12
# File 'lib/denko/behaviors/bus_peripheral.rb', line 9

def before_initialize(options={})
  options[:board] ||= options[:bus]
  super(options)
end