channel.h
1 /*
2  * EEZ PSU Firmware
3  * Copyright (C) 2015-present, Envox d.o.o.
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9 
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14 
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #pragma once
20 
21 #include "persist_conf.h"
22 #include "ioexp.h"
23 #include "adc.h"
24 #include "dac.h"
25 #include "temp_sensor.h"
26 
27 #define IS_OVP_VALUE(channel, cpv) (&cpv == &channel->ovp)
28 #define IS_OCP_VALUE(channel, cpv) (&cpv == &channel->ocp)
29 #define IS_OPP_VALUE(channel, cpv) (&cpv == &channel->opp)
30 
31 namespace eez {
32 namespace psu {
33 
34 namespace calibration {
35 struct Value;
36 }
37 
38 enum DisplayValue {
39  DISPLAY_VALUE_VOLTAGE,
40  DISPLAY_VALUE_CURRENT,
41  DISPLAY_VALUE_POWER
42 };
43 
44 enum ChannelFeatures {
45  CH_FEATURE_VOLT = (1 << 1),
46  CH_FEATURE_CURRENT = (1 << 2),
47  CH_FEATURE_POWER = (1 << 3),
48  CH_FEATURE_OE = (1 << 4),
49  CH_FEATURE_DPROG = (1 << 5),
50  CH_FEATURE_LRIPPLE = (1 << 6),
51  CH_FEATURE_RPROG = (1 << 7),
52  CH_FEATURE_RPOL = (1 << 8)
53 };
54 
55 enum TriggerMode {
56  TRIGGER_MODE_FIXED,
57  TRIGGER_MODE_LIST,
58  TRIGGER_MODE_STEP
59 };
60 
62 class Channel {
63  friend class DigitalAnalogConverter;
64  friend struct calibration::Value;
65 
66 public:
70  unsigned u_cal_params_exists : 1;
72  unsigned i_cal_params_exists : 1;
73  };
74 
78  float dac;
80  float val;
82  float adc;
83  };
84 
100 
102  float minPossible;
103 
105  float maxPossible;
106  };
107 
112 
115 
118 
121 
125  char calibration_date[8 + 1];
126 
129  };
130 
134  unsigned u_state : 1;
136  unsigned i_state : 1;
138  unsigned p_state : 1;
139  };
140 
144 
146 
147  float u_delay;
148  float u_level;
149  float i_delay;
150  float p_delay;
151  float p_level;
152  };
153 
155  struct Flags {
156  unsigned outputEnabled : 1;
157  unsigned afterBootOutputEnabled: 1;
158  unsigned dpOn : 1;
159  unsigned senseEnabled : 1;
160  unsigned cvMode : 1;
161  unsigned ccMode : 1;
162  unsigned powerOk : 1;
163  unsigned _calEnabled : 1;
164  unsigned rprogEnabled: 1;
165  unsigned lrippleEnabled: 1;
166  unsigned lrippleAutoEnabled: 1;
167  unsigned rpol : 1; // remote sense reverse polarity is detected
168  unsigned displayValue1: 2;
169  unsigned displayValue2: 2;
170  unsigned voltageTriggerMode: 2;
171  unsigned currentTriggerMode: 2;
172  };
173 
175  struct Value {
176  float set;
177  float mon_dac;
178  int16_t mon_adc;
179  float mon;
180  float step;
181  float limit;
182 
183  float min;
184  float def;
185  float max;
186 
187  void init(float set, float def_step, float def_limit);
188  };
189 
192  unsigned alarmed : 1;
193  unsigned tripped : 1;
194  };
195 
198  ProtectionFlags flags;
199  uint32_t alarm_started;
200  };
201 
202 #ifdef EEZ_PSU_SIMULATOR
203  struct Simulator {
205  bool oe;
206  bool load_enabled;
207  float load;
208  float u_set;
209  float u_dac;
210  float i_set;
211  float i_dac;
212  float temperature[temp_sensor::NUM_TEMP_SENSORS];
213  float voltProgExt;
214 
215  void setLoadEnabled(bool value);
216  bool getLoadEnabled();
217 
218  void setLoad(float value);
219  float getLoad();
220 
221  void setVoltProgExt(float value);
222  float getVoltProgExt();
223  };
224 #endif // EEZ_PSU_SIMULATOR
225 
229  static Channel &get(int channel_index);
230 
232  static void saveAndDisableOE();
233 
235  static void restoreOE();
236 
238  static char *getChannelsInfo(char *p);
239  static char *getChannelsInfoShort(char *p);
240 
242  uint8_t index;
243 
244  uint8_t boardRevision;
245 
246  uint8_t ioexp_iodir;
247  uint8_t ioexp_gpio_init;
248  uint8_t isolator_pin;
249  uint8_t ioexp_pin;
250  uint8_t convend_pin;
251  uint8_t adc_pin;
252  uint8_t dac_pin;
253 #if EEZ_PSU_SELECTED_REVISION == EEZ_PSU_REVISION_R1B9
254  uint8_t bp_led_out_plus;
255  uint8_t bp_led_out_minus;
256  uint8_t bp_led_sense_plus;
257  uint8_t bp_led_sense_minus;
258 #elif EEZ_PSU_SELECTED_REVISION == EEZ_PSU_REVISION_R3B4 || EEZ_PSU_SELECTED_REVISION == EEZ_PSU_REVISION_R5B12
259  uint8_t bp_led_out;
260  uint8_t bp_led_sense;
261  uint8_t bp_led_prog;
262 #endif
263  uint8_t bp_relay_sense;
264  uint8_t cc_led_pin;
265  uint8_t cv_led_pin;
266 
267  float U_MIN_STEP;
268  float U_DEF_STEP;
269  float U_MAX_STEP;
270  float U_CAL_VAL_MIN;
271  float U_CAL_VAL_MID;
272  float U_CAL_VAL_MAX;
273  float U_CURR_CAL; // voltage level during current calibration
274 
275  bool OVP_DEFAULT_STATE;
276  float OVP_MIN_DELAY;
277  float OVP_DEFAULT_DELAY;
278  float OVP_MAX_DELAY;
279 
280  float I_MIN_STEP;
281  float I_DEF_STEP;
282  float I_MAX_STEP;
283  float I_CAL_VAL_MIN;
284  float I_CAL_VAL_MID;
285  float I_CAL_VAL_MAX;
286  float I_VOLT_CAL; // current level during voltage calibration
287 
288  bool OCP_DEFAULT_STATE;
289  float OCP_MIN_DELAY;
290  float OCP_DEFAULT_DELAY;
291  float OCP_MAX_DELAY;
292 
293  bool OPP_DEFAULT_STATE;
294  float OPP_MIN_DELAY;
295  float OPP_DEFAULT_DELAY;
296  float OPP_MAX_DELAY;
297  float OPP_MIN_LEVEL;
298  float OPP_DEFAULT_LEVEL;
299  float OPP_MAX_LEVEL;
300 
301  float SOA_VIN;
302  float SOA_PREG_CURR;
303  float SOA_POSTREG_PTOT;
304 
305  float PTOT;
306 
307  IOExpander ioexp;
310 
311  Flags flags;
312 
313  Value u;
314  Value i;
315 
316  float p_limit;
317 
318  CalibrationConfiguration cal_conf;
320 
321  ProtectionValue ovp;
322  ProtectionValue ocp;
323  ProtectionValue opp;
324 
325  ontime::Counter onTimeCounter;
326 
327  float ytViewRate;
328 
329 #ifdef EEZ_PSU_SIMULATOR
330  Simulator simulator;
331 #endif // EEZ_PSU_SIMULATOR
332 
333  Channel(
334  uint8_t index,
335  uint8_t boardRevision, uint8_t ioexp_iodir, uint8_t ioexp_gpio_init, uint8_t IO_BIT_OUT_SET_100_PERCENT_, uint8_t IO_BIT_OUT_EXT_PROG_, float VOLTAGE_GND_OFFSET_, float CURRENT_GND_OFFSET_,
336  uint8_t isolator_pin, uint8_t ioexp_pin, uint8_t convend_pin, uint8_t adc_pin, uint8_t dac_pin,
337 #if EEZ_PSU_SELECTED_REVISION == EEZ_PSU_REVISION_R1B9
338  uint8_t bp_led_out_plus, uint8_t bp_led_out_minus, uint8_t bp_led_sense_plus, uint8_t bp_led_sense_minus, uint8_t bp_relay_sense,
339 #elif EEZ_PSU_SELECTED_REVISION == EEZ_PSU_REVISION_R3B4 || EEZ_PSU_SELECTED_REVISION == EEZ_PSU_REVISION_R5B12
340  uint8_t bp_led_out, uint8_t bp_led_sense, uint8_t bp_relay_sense, uint8_t bp_led_prog,
341 #endif
342  uint8_t cc_led_pin, uint8_t cv_led_pin,
343  float U_MIN, float U_DEF, float U_MAX, float U_MAX_CONF, float U_MIN_STEP, float U_DEF_STEP, float U_MAX_STEP, float U_CAL_VAL_MIN, float U_CAL_VAL_MID, float U_CAL_VAL_MAX, float U_CURR_CAL,
344  bool OVP_DEFAULT_STATE, float OVP_MIN_DELAY, float OVP_DEFAULT_DELAY, float OVP_MAX_DELAY,
345  float I_MIN, float I_DEF, float I_MAX, float I_MIN_STEP, float I_DEF_STEP, float I_MAX_STEP, float I_CAL_VAL_MIN, float I_CAL_VAL_MID, float I_CAL_VAL_MAX, float I_VOLT_CAL,
346  bool OCP_DEFAULT_STATE, float OCP_MIN_DELAY, float OCP_DEFAULT_DELAY, float OCP_MAX_DELAY,
347  bool OPP_DEFAULT_STATE, float OPP_MIN_DELAY, float OPP_DEFAULT_DELAY, float OPP_MAX_DELAY, float OPP_MIN_LEVEL, float OPP_DEFAULT_LEVEL, float OPP_MAX_LEVEL,
348  float SOA_VIN, float SOA_PREG_CURR, float SOA_POSTREG_PTOT, float PTOT);
349 
352  void init();
353 
355  void reset();
356 
358  void clearCalibrationConf();
359 
361  bool test();
362 
364  bool isPowerOk();
365 
367  bool isTestFailed();
368 
370  bool isTestOk();
371 
373  bool isOk();
374 
376  void tick(uint32_t tick_usec);
377 
381  void eventAdcData(int16_t adc_data);
382  void eventGpio(uint8_t gpio);
383 
386  void onPowerDown();
387 
389  void adcReadMonDac();
390 
392  void adcReadAll();
393 
396  void update();
397 
399  void outputEnable(bool enable);
400 
401  void afterBootOutputEnable();
402 
404  bool isOutputEnabled();
405 
407  void calibrationEnable(bool enable);
408  void calibrationEnableNoEvent(bool enable);
409 
411  bool isCalibrationEnabled();
412 
414  void remoteSensingEnable(bool enable);
415 
417  bool isRemoteSensingEnabled();
418 
420  void remoteProgrammingEnable(bool enable);
421 
424 
426  bool lowRippleEnable(bool enable);
427 
429  void lowRippleAutoEnable(bool enable);
430 
432  bool isLowRippleAllowed(uint32_t tick_usec);
433 
435  bool isLowRippleEnabled();
436 
438  bool isLowRippleAutoEnabled();
439 
441  void setVoltage(float voltage);
442 
444  void setCurrent(float current);
445 
447  bool isCalibrationExists();
448 
450  bool isTripped();
451 
453  void clearProtection();
454 
456  void disableProtection();
457 
459  void setQuesBits(int bit_mask, bool on);
460 
462  void setOperBits(int bit_mask, bool on);
463 
465  bool isCvMode() { return flags.cvMode && !flags.ccMode; }
466 
468  bool isCcMode() { return flags.ccMode && !flags.cvMode; }
469 
471  char *getCvModeStr();
472 
474  float remapAdcDataToVoltage(int16_t adc_data);
475 
477  float remapAdcDataToCurrent(int16_t adc_data);
478 
480  int16_t remapVoltageToAdcData(float value);
481 
483  int16_t remapCurrentToAdcData(float value);
484 
486  const char *getBoardRevisionName();
487 
489  uint16_t getFeatures();
490 
492  float getVoltageLimit() const;
493 
495  float getVoltageMaxLimit() const;
496 
498  void setVoltageLimit(float limit);
499 
501  float getCurrentLimit() const;
502 
504  void setCurrentLimit(float limit);
505 
507  float getMaxCurrentLimit() const;
508 
510  bool isMaxCurrentLimited() const;
511 
513  MaxCurrentLimitCause getMaxCurrentLimitCause() const;
514 
516  void limitMaxCurrent(MaxCurrentLimitCause cause);
517 
519  void unlimitMaxCurrent();
520 
522  float getPowerLimit() const;
523 
525  float getPowerMaxLimit() const;
526 
528  void setPowerLimit(float limit);
529 
530  bool isVoltageBalanced() { return !util::isNaN(uBeforeBalancing); }
531  bool isCurrentBalanced() { return !util::isNaN(iBeforeBalancing); }
532  float getUSetUnbalanced() { return isVoltageBalanced() ? uBeforeBalancing : u.set; }
533  float getISetUnbalanced() { return isCurrentBalanced() ? iBeforeBalancing : i.set; }
534 
535  int getCurrentHistoryValuePosition() { return historyPosition; }
536  float getUMonHistory(int position) const { return uHistory[position]; }
537  float getIMonHistory(int position) const { return iHistory[position]; }
538 
539  void resetHistory();
540 
541  TriggerMode getVoltageTriggerMode();
542  void setVoltageTriggerMode(TriggerMode mode);
543 
544  TriggerMode getCurrentTriggerMode();
545  void setCurrentTriggerMode(TriggerMode mode);
546 
547 private:
548  bool delayed_dp_off;
549  uint32_t delayed_dp_off_start;
550  bool delayLowRippleCheck;
551  uint32_t outputEnableStartTime;
552  uint32_t dpNegMonitoringTime;
553 
554  float U_MIN;
555  float U_DEF;
556  float U_MAX;
557  float U_MAX_CONF;
558 
559  float I_MIN;
560  float I_DEF;
561  float I_MAX;
562 
563  float uBeforeBalancing;
564  float iBeforeBalancing;
565 
566  MaxCurrentLimitCause maxCurrentLimitCause;
567 
568  int negligibleAdcDiffForVoltage;
569  int negligibleAdcDiffForCurrent;
570 
571  float uHistory[CHANNEL_HISTORY_SIZE];
572  float iHistory[CHANNEL_HISTORY_SIZE];
573  int historyPosition;
574  uint32_t historyLastTick;
575 
576  float VOLTAGE_GND_OFFSET;
577  float CURRENT_GND_OFFSET;
578 
579  void clearProtectionConf();
580  void protectionEnter(ProtectionValue &cpv);
581  void protectionCheck(ProtectionValue &cpv);
582  void protectionCheck();
583 
584  void doCalibrationEnable(bool enable);
585  void calibrationFindVoltageRange(float minDac, float minVal, float minAdc, float maxDac, float maxVal, float maxAdc, float *min, float *max);
586  void calibrationFindCurrentRange(float minDac, float minVal, float minAdc, float maxDac, float maxVal, float maxAdc, float *min, float *max);
587  bool isVoltageCalibrationEnabled();
588  bool isCurrentCalibrationEnabled();
589 
590  void adcDataIsReady(int16_t data);
591 
592  void voltageBalancing();
593  void currentBalancing();
594 
595  void restoreVoltageToValueBeforeBalancing();
596  void restoreCurrentToValueBeforeBalancing();
597 
598  void doSetVoltage(float value);
599  void doSetCurrent(float value);
600 
601  void setCcMode(bool cc_mode);
602  void setCvMode(bool cv_mode);
603  void updateCcAndCvSwitch();
604 
605  void doOutputEnable(bool enable);
606 
607  void doRemoteSensingEnable(bool enable);
608  void doRemoteProgrammingEnable(bool enable);
609 
610  void lowRippleCheck(uint32_t tick_usec);
611  void doLowRippleEnable(bool enable);
612  void doLowRippleAutoEnable(bool enable);
613 
614  void doDpEnable(bool enable);
615 
616 #if !CONF_SKIP_PWRGOOD_TEST
617  void testPwrgood(uint8_t gpio);
618 #endif
619 };
620 
621 }
622 } // namespace eez::psu
void adcReadAll()
Force ADC read of all values: u.mon, u.mon_dac, i.mon and i.mon_dac.
Definition: channel.cpp:933
bool lowRippleEnable(bool enable)
Enable/disable low ripple mode.
Definition: channel.cpp:1345
Definition: ontime.h:35
void outputEnable(bool enable)
Enable/disable channel output.
Definition: channel.cpp:1137
CalibrationValueConfiguration u
Calibration parameters for the voltage.
Definition: channel.h:117
unsigned i_cal_params_exists
Is current calibrated?
Definition: channel.h:72
int16_t remapVoltageToAdcData(float value)
Remap voltage value to ADC data value (use calibration if configured).
Definition: channel.cpp:717
void remoteSensingEnable(bool enable)
Enable/disable remote sensing.
Definition: channel.cpp:1319
void adcReadMonDac()
Force ADC read of u.mon_dac and i.mon_dac.
Definition: channel.cpp:920
Voltage and current data set and measured during runtime.
Definition: channel.h:175
unsigned p_state
Is OPP enabled?
Definition: channel.h:138
float getVoltageMaxLimit() const
Returns max. voltage limit.
Definition: channel.cpp:1505
void setCurrent(float current)
Set channel current level.
Definition: channel.cpp:1412
Namespace for the everything from the EEZ.
Definition: actions.cpp:41
uint8_t index
Channel index. Starts from 1.
Definition: channel.h:242
void setCurrentLimit(float limit)
Change current limit, it will adjust I_SET if necessary.
Definition: channel.cpp:1521
Channel binary flags like output enabled, sense enabled, ...
Definition: channel.h:155
A structure where calibration parameters for the channel are stored.
Definition: channel.h:109
void eventAdcData(int16_t adc_data)
Called from IO expander interrupt routine.
Definition: channel.cpp:886
#define CALIBRATION_REMARK_MAX_LENGTH
Calibration remark maximum length.
Definition: conf_advanced.h:82
float getVoltageLimit() const
Returns currently set voltage limit.
Definition: channel.cpp:1501
float minPossible
Real min after calibration.
Definition: channel.h:102
const char * getBoardRevisionName()
Returns name of the board revison of this channel.
Definition: channel.cpp:1493
void setVoltageLimit(float limit)
Change voltage limit, it will adjust U_SET if necessary.
Definition: channel.cpp:1509
void reset()
Reset the channel to default values.
Definition: channel.cpp:421
void init()
Initialize channel and underlying hardware.
Definition: channel.cpp:396
char calibration_date[8+1]
Date when calibration is saved.
Definition: channel.h:125
CalibrationValuePointConfiguration min
Min point.
Definition: channel.h:95
float remapAdcDataToCurrent(int16_t adc_data)
Remap ADC data value to actual current value (use calibration if configured).
Definition: channel.cpp:713
float maxPossible
Real max after calibration.
Definition: channel.h:105
static void restoreOE()
Restore previously saved OE state for all the channels.
Definition: channel.cpp:119
void setQuesBits(int bit_mask, bool on)
Turn on/off bit in SCPI Questinable Instrument Isummary register for this channel.
Definition: channel.cpp:1469
bool isCalibrationExists()
Is channel calibrated, both voltage and current?
Definition: channel.cpp:1421
Runtime protection values.
Definition: channel.h:197
float getCurrentLimit() const
Returns currently set current limit.
Definition: channel.cpp:1517
bool isCvMode()
Is channel in CV (constant voltage) mode?
Definition: channel.h:465
void onPowerDown()
Called when device power is turned off, so channel can do its own housekeeping.
Definition: channel.cpp:406
void lowRippleAutoEnable(bool enable)
Enable/disable low ripple auto mode.
Definition: channel.cpp:1359
Analog to digital converter HW used by the channel.
Definition: adc.h:25
void update()
Force update of all channel state (u.set, i.set, output enable, remote sensing, ...).
Definition: channel.cpp:1119
float dac
Value set on DAC by the calibration module.
Definition: channel.h:78
Calibration parameters for the voltage and current.
Definition: channel.h:93
float adc
Value read from ADC.
Definition: channel.h:82
void setPowerLimit(float limit)
Change power limit, it will adjust U_SET or I_SET if necessary.
Definition: channel.cpp:1575
void disableProtection()
Disable protection for this channel.
Definition: channel.cpp:1460
void remoteProgrammingEnable(bool enable)
Enable/disable remote programming.
Definition: channel.cpp:1332
PSU channel.
Definition: channel.h:62
float remapAdcDataToVoltage(int16_t adc_data)
Remap ADC data value to actual voltage value (use calibration if configured).
Definition: channel.cpp:709
float getMaxCurrentLimit() const
Returns ERR_MAX_CURRENT if max. current is limited or i.max if not.
Definition: channel.cpp:1532
Runtime protection binary flags (alarmed, tripped)
Definition: channel.h:191
bool isLowRippleEnabled()
Is low ripple mode enabled?
Definition: channel.cpp:1355
bool isCcMode()
Is channel in CC (constant current) mode?
Definition: channel.h:468
CalibrationValueConfiguration i
Calibration parameters for the current.
Definition: channel.h:120
CalibrationValuePointConfiguration mid
Mid point.
Definition: channel.h:97
Calibration parameters for the voltage or current during calibration procedure.
Definition: calibration.h:34
persist_conf::BlockHeader header
Used by the persist_conf.
Definition: channel.h:111
unsigned i_state
Is OCP enabled?
Definition: channel.h:136
void setVoltage(float voltage)
Set channel voltage level.
Definition: channel.cpp:1390
bool test()
Test the channel.
Definition: channel.cpp:537
IO Expander HW used by the channel.
Definition: ioexp.h:54
Per channel simulator data.
Definition: channel.h:204
bool isCalibrationEnabled()
Is channel calibration enabled?
Definition: channel.cpp:1207
Channel OVP, OVP and OPP configuration parameters like level and delay.
Definition: channel.h:142
bool isTripped()
Is OVP, OCP or OPP tripped?
Definition: channel.cpp:1425
char * getCvModeStr()
Returns "CC", "CV" or "UR".
Definition: channel.cpp:1487
bool isOk()
Is channel ready to work with?
Definition: channel.cpp:582
bool isLowRippleAutoEnabled()
Is low ripple auto mode enabled?
Definition: channel.cpp:1365
void clearCalibrationConf()
Clear channel calibration configuration.
Definition: channel.cpp:501
int16_t remapCurrentToAdcData(float value)
Remap current value to ADC data value (use calibration if configured).
Definition: channel.cpp:722
MaxCurrentLimitCause getMaxCurrentLimitCause() const
Returns max. current limit cause.
Definition: channel.cpp:1540
Calibration parameters for the single point.
Definition: channel.h:76
float val
Real value, in volts, set by the user who reads it on the instrument (voltmeter and ampermeter)...
Definition: channel.h:80
bool isTestOk()
Is channel test ok?
Definition: channel.cpp:576
bool isOutputEnabled()
Is channel output enabled?
Definition: channel.cpp:1152
float getPowerMaxLimit() const
Returns max. power limit.
Definition: channel.cpp:1571
bool isPowerOk()
Is channel power ok (state of PWRGOOD bit in IO Expander)?
Definition: channel.cpp:566
float getPowerLimit() const
Returns currently set power limit.
Definition: channel.cpp:1567
uint16_t getFeatures()
Returns features present (check ChannelFeatures) in board revision of this channel.
Definition: channel.cpp:1497
Header of the every block stored in EEPROM. It contains checksum and version.
Definition: persist_conf.h:40
unsigned u_state
Is OVP enabled?
Definition: channel.h:134
unsigned u_cal_params_exists
Is voltage calibrated?
Definition: channel.h:70
Binary flags for the channel protection configuration.
Definition: channel.h:132
Digital to analog converter HW used by the channel.
Definition: dac.h:25
bool isLowRippleAllowed(uint32_t tick_usec)
Is low ripple mode allowed?
Definition: channel.cpp:1065
bool isRemoteSensingEnabled()
Is remote sensing enabled?
Definition: channel.cpp:1328
void unlimitMaxCurrent()
Unset current max. limit.
Definition: channel.cpp:1563
void calibrationEnable(bool enable)
Enable/disable channel calibration.
Definition: channel.cpp:1191
bool isTestFailed()
Is channel test failed?
Definition: channel.cpp:570
Binary flags for the channel calibration configuration.
Definition: channel.h:68
static void saveAndDisableOE()
Save and disable OE for all the channels.
Definition: channel.cpp:104
void clearProtection()
Clear channel protection tripp state.
Definition: channel.cpp:1432
char calibration_remark[CALIBRATION_REMARK_MAX_LENGTH+1]
Remark about calibration set by user.
Definition: channel.h:128
bool isRemoteProgrammingEnabled()
Is remote programming enabled?
Definition: channel.cpp:1341
bool isMaxCurrentLimited() const
Returns true if max current is limited to ERR_MAX_CURRENT.
Definition: channel.cpp:1536
void tick(uint32_t tick_usec)
Called by main loop, used for channel maintenance.
Definition: channel.cpp:618
CalibrationConfigurationFlags flags
Flags.
Definition: channel.h:114
CalibrationValuePointConfiguration max
Max point.
Definition: channel.h:99
#define CHANNEL_HISTORY_SIZE
Number of history values shown in YT diagram.
Definition: conf_advanced.h:267
void limitMaxCurrent(MaxCurrentLimitCause cause)
Set current max. limit to ERR_MAX_CURRENT.
Definition: channel.cpp:1547
void setOperBits(int bit_mask, bool on)
Turn on/off bit in SCPI Operational Instrument Isummary register for this channel.
Definition: channel.cpp:1478