From 401c7e26648dd2474989207f2744576db1d6d447 Mon Sep 17 00:00:00 2001 From: awatlet <arnaud.watlet@umons.ac.be> Date: Tue, 26 Sep 2023 11:33:28 +0200 Subject: [PATCH] Updates mux_2024 specs handling --- ohmpi/hardware_components/mux_2024_rev_0_0.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/ohmpi/hardware_components/mux_2024_rev_0_0.py b/ohmpi/hardware_components/mux_2024_rev_0_0.py index 19a18db4..3bca1474 100644 --- a/ohmpi/hardware_components/mux_2024_rev_0_0.py +++ b/ohmpi/hardware_components/mux_2024_rev_0_0.py @@ -7,9 +7,19 @@ from adafruit_mcp230xx.mcp23017 import MCP23017 # noqa from digitalio import Direction # noqa # import time +# board specs +voltage_max = 50 +current_max = 3. +activation_delay = 0.01 +release_delay = 0.005 + 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({'activation_delay': 0.01, 'release_delay': 0.005}) # s +MUX_CONFIG.update({'voltage_max': max(0,min(MUX_CONFIG['voltage_max'],voltage_max)), + 'current_max': max(0,min(MUX_CONFIG['current_max'],voltage_max))}) + +MUX_CONFIG.update({'activation_delay': max(MUX_CONFIG['activation_delay'],activation_delay), + 'release_delay': max(MUX_CONFIG['release_delay'],release_delay)}) + # 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 ic connection -- GitLab