Liqun Wu / Mbed 2 deprecated 90418_mbed_controller

Dependencies:   mbed

Committer:
wuliqunyy
Date:
Mon Jan 17 13:20:09 2022 +0000
Revision:
0:be95bfb06686
a working non_flat + adc_didt for ehp regulation version

Who changed what in which revision?

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