PS_Fgen_FW  4da88f4073c1cc65ea45c3a652a2751e495e50db
Firmware for an Power Supply and Function Generator build from an ATX power supply
Loading...
Searching...
No Matches
ieee488.h
1/*-
2 * BSD 2-Clause License
3 *
4 * Copyright (c) 2012-2018, Jan Breuer
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are met:
9 *
10 * * Redistributions of source code must retain the above copyright notice, this
11 * list of conditions and the following disclaimer.
12 *
13 * * Redistributions in binary form must reproduce the above copyright notice,
14 * this list of conditions and the following disclaimer in the documentation
15 * and/or other materials provided with the distribution.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
37
38#ifndef SCPI_IEEE488_H
39#define SCPI_IEEE488_H
40
41#include "../../../../libraries/scpi-parser/inc/scpi/types.h"
42
43#ifdef __cplusplus
44extern "C" {
45#endif
46
47 scpi_result_t SCPI_CoreCls(scpi_t * context);
48 scpi_result_t SCPI_CoreEse(scpi_t * context);
49 scpi_result_t SCPI_CoreEseQ(scpi_t * context);
50 scpi_result_t SCPI_CoreEsrQ(scpi_t * context);
51 scpi_result_t SCPI_CoreIdnQ(scpi_t * context);
52 scpi_result_t SCPI_CoreOpc(scpi_t * context);
53 scpi_result_t SCPI_CoreOpcQ(scpi_t * context);
54 scpi_result_t SCPI_CoreRst(scpi_t * context);
55 scpi_result_t SCPI_CoreSre(scpi_t * context);
56 scpi_result_t SCPI_CoreSreQ(scpi_t * context);
57 scpi_result_t SCPI_CoreStbQ(scpi_t * context);
58 scpi_result_t SCPI_CoreTstQ(scpi_t * context);
59 scpi_result_t SCPI_CoreWai(scpi_t * context);
60
61
62#define STB_R01 0x01 /* Not used */
63#define STB_PRO 0x02 /* Protection Event Flag */
64#define STB_QMA 0x04 /* Error/Event queue message available */
65#define STB_QES 0x08 /* Questionable status */
66#define STB_MAV 0x10 /* Message Available */
67#define STB_ESR 0x20 /* Standard Event Status Register */
68#define STB_SRQ 0x40 /* Service Request */
69#define STB_OPS 0x80 /* Operation Status Flag */
70
71
72#define ESR_OPC 0x01 /* Operation complete */
73#define ESR_REQ 0x02 /* Request Control */
74#define ESR_QER 0x04 /* Query Error */
75#define ESR_DER 0x08 /* Device Dependent Error */
76#define ESR_EER 0x10 /* Execution Error (e.g. range error) */
77#define ESR_CER 0x20 /* Command error (e.g. syntax error) */
78#define ESR_URQ 0x40 /* User Request */
79#define ESR_PON 0x80 /* Power On */
80
81
82 scpi_reg_val_t SCPI_RegGet(scpi_t * context, scpi_reg_name_t name);
83 void SCPI_RegSet(scpi_t * context, scpi_reg_name_t name, scpi_reg_val_t val);
84 void SCPI_RegSetBits(scpi_t * context, scpi_reg_name_t name, scpi_reg_val_t bits);
85 void SCPI_RegClearBits(scpi_t * context, scpi_reg_name_t name, scpi_reg_val_t bits);
86
87 void SCPI_EventClear(scpi_t * context);
88
89#ifdef __cplusplus
90}
91#endif
92
93#endif /* SCPI_IEEE488_H */
94