scpi-parser, adopted from github

Dependents:   scpi_parser_test

Committer:
iesensor
Date:
Fri Nov 14 01:07:59 2014 +0000
Revision:
0:d8aca47812e0
tested on K64F

Who changed what in which revision?

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