https://github.com/j123b567/scpi-parser

Dependents:   scpi_sx127x scpi_sx127x_firstTest MLX90418_I2C_master

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ieee488.h Source File

ieee488.h

00001 /*-
00002  * Copyright (c) 2012-2013 Jan Breuer,
00003  *
00004  * All Rights Reserved
00005  * 
00006  * Redistribution and use in source and binary forms, with or without
00007  * modification, are permitted provided that the following conditions are
00008  * met:
00009  * 1. Redistributions of source code must retain the above copyright notice,
00010  *    this list of conditions and the following disclaimer.
00011  * 2. Redistributions in binary form must reproduce the above copyright
00012  *    notice, this list of conditions and the following disclaimer in the
00013  *    documentation and/or other materials provided with the distribution.
00014  * 
00015  * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
00016  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00017  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00018  * DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
00019  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
00020  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
00021  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
00022  * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
00023  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
00024  * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
00025  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00026  */
00027 
00028 /**
00029  * @file   scpi_ieee488.h
00030  * @date   Thu Nov 15 10:58:45 UTC 2012
00031  * 
00032  * @brief  Implementation of IEEE488.2 commands and state model
00033  * 
00034  * 
00035  */
00036 
00037 #ifndef SCPI_IEEE488_H
00038 #define SCPI_IEEE488_H
00039 
00040 #include "scpi/types.h"
00041 
00042 #ifdef  __cplusplus
00043 extern "C" {
00044 #endif
00045 
00046 scpi_result_t SCPI_CoreCls(scpi_t * context);
00047 scpi_result_t SCPI_CoreEse(scpi_t * context);
00048 scpi_result_t SCPI_CoreEseQ(scpi_t * context);
00049 scpi_result_t SCPI_CoreEsrQ(scpi_t * context);
00050 scpi_result_t SCPI_CoreIdnQ(scpi_t * context);
00051 scpi_result_t SCPI_CoreOpc(scpi_t * context);
00052 scpi_result_t SCPI_CoreOpcQ(scpi_t * context);
00053 scpi_result_t SCPI_CoreRst(scpi_t * context);
00054 scpi_result_t SCPI_CoreSre(scpi_t * context);
00055 scpi_result_t SCPI_CoreSreQ(scpi_t * context);
00056 scpi_result_t SCPI_CoreStbQ(scpi_t * context);
00057 scpi_result_t SCPI_CoreTstQ(scpi_t * context);
00058 scpi_result_t SCPI_CoreWai(scpi_t * context);
00059 
00060 
00061 #define STB_R01 0x01    /* Not used */
00062 #define STB_PRO 0x02    /* Protection Event Flag */
00063 #define STB_QMA 0x04    /* Error/Event queue message available */
00064 #define STB_QES 0x08    /* Questionable status */
00065 #define STB_MAV 0x10    /* Message Available */
00066 #define STB_ESR 0x20    /* Standard Event Status Register */
00067 #define STB_SRQ 0x40    /* Service Request */
00068 #define STB_OPS 0x80    /* Operation Status Flag */
00069 
00070 
00071 #define ESR_OPC 0x01    /* Operation complete */
00072 #define ESR_REQ 0x02    /* Request Control */
00073 #define ESR_QER 0x04    /* Query Error */
00074 #define ESR_DER 0x08    /* Device Dependent Error */
00075 #define ESR_EER 0x10    /* Execution Error (e.g. range error) */
00076 #define ESR_CER 0x20    /* Command error (e.g. syntax error) */
00077 #define ESR_URQ 0x40    /* User Request */
00078 #define ESR_PON 0x80    /* Power On */
00079 
00080 
00081 scpi_reg_val_t SCPI_RegGet(scpi_t * context, scpi_reg_name_t name);
00082 void SCPI_RegSet(scpi_t * context, scpi_reg_name_t name, scpi_reg_val_t val);
00083 void SCPI_RegSetBits(scpi_t * context, scpi_reg_name_t name, scpi_reg_val_t bits);
00084 void SCPI_RegClearBits(scpi_t * context, scpi_reg_name_t name, scpi_reg_val_t bits);
00085 
00086 void SCPI_EventClear(scpi_t * context);
00087 
00088 #ifdef  __cplusplus
00089 }
00090 #endif
00091 
00092 #endif  /* SCPI_IEEE488_H */
00093