scpi_psu.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 "scpi_regs.h"
22 #include "scpi_params.h"
23 
24 namespace eez {
25 namespace psu {
27 namespace scpi {
28 
30 struct scpi_psu_t {
31  scpi_reg_val_t *registers;
32  uint8_t selected_channel_index;
33 };
34 
35 void init(scpi_t &scpi_context,
36  scpi_psu_t &scpi_psu_context,
37  scpi_interface_t *interface,
38  char *input_buffer,
39  size_t input_buffer_length,
40  int16_t *error_queue_data,
41  int16_t error_queue_size);
42 
43 void tick(uint32_t tickCount);
44 
45 void input(scpi_t &scpi_context, char ch);
46 void input(scpi_t &scpi_context, const char *str, size_t size);
47 
48 void printError(int_fast16_t err);
49 
50 void resultChoiceName(scpi_t *context, scpi_choice_def_t *choice, int tag);
51 
52 bool isIdle();
53 
54 }
55 }
56 } // namespace eez::psu::scpi
EEZ PSU specific SCPI parser context data.
Definition: scpi_psu.h:30
Namespace for the everything from the EEZ.
Definition: actions.cpp:41