scpi_params.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 namespace eez {
22 namespace psu {
23 namespace scpi {
24 
25 extern scpi_choice_def_t temp_sensor_choice[];
26 extern scpi_choice_def_t internal_external_choice[];
27 
28 Channel *param_channel(scpi_t *context, scpi_bool_t mandatory = FALSE, scpi_bool_t skip_channel_check = FALSE);
29 bool check_channel(scpi_t *context, int32_t ch);
30 Channel *set_channel_from_command_number(scpi_t *context);
31 
32 bool param_temp_sensor(scpi_t *context, int32_t &sensor);
33 
34 bool get_voltage_param(scpi_t *context, float &value, const Channel *channel, const Channel::Value *cv);
35 bool get_voltage_protection_level_param(scpi_t *context, float &value, float min, float max, float def);
36 bool get_current_param(scpi_t *context, float &value, const Channel *channel, const Channel::Value *cv);
37 bool get_power_param(scpi_t *context, float &value, float min, float max, float def);
38 bool get_temperature_param(scpi_t *context, float &value, float min, float max, float def);
39 bool get_duration_param(scpi_t *context, float &value, float min, float max, float def);
40 
41 bool get_voltage_from_param(scpi_t *context, const scpi_number_t &param, float &value, const Channel *channel, const Channel::Value *cv);
42 bool get_voltage_protection_level_from_param(scpi_t *context, const scpi_number_t &param, float &value, float min, float max, float def);
43 bool get_current_from_param(scpi_t *context, const scpi_number_t &param, float &value, const Channel *channel, const Channel::Value *cv);
44 bool get_power_from_param(scpi_t *context, const scpi_number_t &param, float &value, float min, float max, float def);
45 bool get_temperature_from_param(scpi_t *context, const scpi_number_t &param, float &value, float min, float max, float def);
46 bool get_duration_from_param(scpi_t *context, const scpi_number_t &param, float &value, float min, float max, float def);
47 
48 bool get_voltage_limit_param(scpi_t *context, float &value, const Channel *channel, const Channel::Value *cv);
49 bool get_current_limit_param(scpi_t *context, float &value, const Channel *channel, const Channel::Value *cv);
50 bool get_power_limit_param(scpi_t *context, float &value, const Channel *channel, const Channel::Value *cv);
51 bool get_voltage_limit_from_param(scpi_t *context, const scpi_number_t &param, float &value, const Channel *channel, const Channel::Value *cv);
52 bool get_current_limit_from_param(scpi_t *context, const scpi_number_t &param, float &value, const Channel *channel, const Channel::Value *cv);
53 bool get_power_limit_from_param(scpi_t *context, const scpi_number_t &param, float &value, const Channel *channel, const Channel::Value *cv);
54 
55 scpi_result_t result_float(scpi_t * context, float value);
56 bool get_profile_location_param(scpi_t * context, int &location, bool all_locations = false);
57 
58 void outputOnTime(scpi_t* context, uint32_t time);
59 
60 }
61 }
62 } // namespace eez::psu::scpi
Namespace for the everything from the EEZ.
Definition: actions.cpp:41