Commit 74e068f1 authored by Olivier Kaufmann's avatar Olivier Kaufmann
Browse files

Modifies the way a controller is used by defining several connections and...

Modifies the way a controller is used by defining several connections and adding an io to components
Showing with 2 additions and 2 deletions
+2 -2
...@@ -11,7 +11,7 @@ MUX_CONFIG = HARDWARE_CONFIG['mux'].pop('default', {}) ...@@ -11,7 +11,7 @@ MUX_CONFIG = HARDWARE_CONFIG['mux'].pop('default', {})
MUX_CONFIG.update({'voltage_max': 50., 'current_max': 3.}) # board default values that overwrite system default values MUX_CONFIG.update({'voltage_max': 50., 'current_max': 3.}) # board default values that overwrite system default values
MUX_CONFIG.update({'activation_delay': 0.01, 'release_delay': 0.005}) # s MUX_CONFIG.update({'activation_delay': 0.01, 'release_delay': 0.005}) # s
default_mux_cabling = {(elec, role) : ('mux_1', elec) for role in ['A', 'B', 'M', 'N'] for elec in range(1,9)} # defaults to 4 roles cabling electrodes from 1 to 8 default_mux_cabling = {(elec, role) : ('mux_1', elec) for role in ['A', 'B', 'M', 'N'] for elec in range(1,9)} # defaults to 4 roles cabling electrodes from 1 to 8
ctl_connection = HARDWARE_CONFIG['ctl'].pop('connection', 'i2c')
inner_cabling = {'4_roles' : {(1, 'X'): {'MCP': 0, 'MCP_GPIO': 0}, (1, 'Y'): {'MCP': 0, 'MCP_GPIO': 8}, inner_cabling = {'4_roles' : {(1, 'X'): {'MCP': 0, 'MCP_GPIO': 0}, (1, 'Y'): {'MCP': 0, 'MCP_GPIO': 8},
(2, 'X'): {'MCP': 0, 'MCP_GPIO': 1}, (2, 'Y'): {'MCP': 0, 'MCP_GPIO': 9}, (2, 'X'): {'MCP': 0, 'MCP_GPIO': 1}, (2, 'Y'): {'MCP': 0, 'MCP_GPIO': 9},
...@@ -75,7 +75,7 @@ class Mux(MuxAbstract): ...@@ -75,7 +75,7 @@ class Mux(MuxAbstract):
self.exec_logger.error(f'Invalid role assignment for {self.board_name}: {self._roles} !') self.exec_logger.error(f'Invalid role assignment for {self.board_name}: {self._roles} !')
self._mode = '' self._mode = ''
if tca_address is None: if tca_address is None:
self._tca = self.ctl.bus self._tca = self.ctl.connections[kwargs.pop('connection', ctl_connection)]
else: else:
self._tca = adafruit_tca9548a.TCA9548A(self.ctl.bus, tca_address)[tca_channel] self._tca = adafruit_tca9548a.TCA9548A(self.ctl.bus, tca_address)[tca_channel]
self._mcp_addresses = (kwargs.pop('mcp_0', '0x22'), kwargs.pop('mcp_1', '0x23')) # TODO: add assert on valid addresses.. self._mcp_addresses = (kwargs.pop('mcp_0', '0x22'), kwargs.pop('mcp_1', '0x23')) # TODO: add assert on valid addresses..
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment