Module: Denko::Behaviors::BusControllerAddressed

Includes:
BusController
Included in:
I2C::BusCommon, OneWire::Bus
Defined in:
lib/denko/behaviors/bus_controller_addressed.rb

Constant Summary

Constants included from Lifecycle

Lifecycle::CALLBACK_METHODS

Instance Attribute Summary

Attributes included from Component

#board, #params

Attributes included from State

#state

Instance Method Summary collapse

Methods included from BusController

#mutex

Methods included from Subcomponents

#add_hw_i2c, #add_hw_spi, #add_single_pin, #components, #hw_i2c_comps, #hw_spi_comps, #remove_component, #remove_hw_i2c, #remove_hw_spi, #remove_single_pin, #single_pin_components

Methods included from Component

#initialize, #micro_delay

Methods included from State

#update_state

Methods included from Lifecycle

included

Instance Method Details

#add_component(component) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/denko/behaviors/bus_controller_addressed.rb', line 6

def add_component(component)
  addresses = components.map { |c| c.address }
  if addresses.include? component.address
    raise ArgumentError, "duplicate peripheral address for #{component}"
  end
  
  super(component)
end