From 7502e1172823322e9108d5aa9dbaf54374665cf9 Mon Sep 17 00:00:00 2001 From: su530201 <olivier.kaufmann@umons.ac.be> Date: Tue, 2 May 2023 15:16:25 +0200 Subject: [PATCH] Adds reset method in MuxAbstract --- config_mb_2023_mux_2024.py | 14 ++++++++------ test_mux_2024.py | 6 +++--- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/config_mb_2023_mux_2024.py b/config_mb_2023_mux_2024.py index a52c1702..097d5fde 100644 --- a/config_mb_2023_mux_2024.py +++ b/config_mb_2023_mux_2024.py @@ -34,12 +34,14 @@ HARDWARE_CONFIG = { # overwritten by board properties defined at the board level within the board model file # both will be overwritten by properties specified in the board dict below. Use with caution... {'boards': - {'mux_1': {'model' : 'mux_2024_rev_0_0', # 'ohmpi_i2c_mux64_v1.01', - 'tca_address': None, - 'tca_channel': 0, - 'mcp_0' : '0x22', # TODO : Replace this with pos of jumper on MUX board (address doesn't mean anything for the average user...) - 'mcp_1' : '0x23', # TODO : Replace this with pos of jumper on MUX board (address doesn't mean anything for the average user...) - 'voltage_max': 12. + {'mux_1': + {'model' : 'mux_2024_rev_0_0', # 'ohmpi_i2c_mux64_v1.01', + 'tca_address': None, + 'tca_channel': 0, + 'mcp_0' : '0x22', # TODO : Replace this with pos of jumper on MUX board (address doesn't mean anything for the average user... + 'mcp_1' : '0x23', # TODO : Replace this with pos of jumper on MUX board (address doesn't mean anything for the average user...) + 'roles' : {'A': 'X', 'B': 'Y', 'M' : 'XX', 'N' : 'YY'}, + 'voltage_max': 12. }}, 'default': {'voltage_max': 100., 'current_max': 3.}} } diff --git a/test_mux_2024.py b/test_mux_2024.py index 0dbc1359..f313ea6f 100644 --- a/test_mux_2024.py +++ b/test_mux_2024.py @@ -5,13 +5,13 @@ change_config('config_mb_2023_mux_2024.py', verbose=False) from OhmPi.hardware_components.mux_2024_rev_0_0 import Mux, MUX_CONFIG from OhmPi.hardware_components import raspberry_pi as controller_module -stand_alone_mux = False -part_of_hardware_system = True +stand_alone_mux = True +part_of_hardware_system = False # Stand alone mux if stand_alone_mux: MUX_CONFIG['controller'] = controller_module.Controller() MUX_CONFIG['id'] = 'mux_1' - MUX_CONFIG['default_mux_cabling'] = {(i+8, j) : ('mux_1', i) for j in ['A', 'B', 'M', 'N'] for i in range(1,9)} + MUX_CONFIG['cabling'] = {(i+8, j) : ('mux_1', i) for j in ['A', 'B', 'M', 'N'] for i in range(1,9)} mux = Mux(**MUX_CONFIG) mux.switch_one(elec=9, role='M', state='on') time.sleep(2) -- GitLab