Debian Codegraph @

thirdparty/analogdevicesinc/no-OS/device_commands/AD5449/Command.h

raw symbols SCIP
1 /***************************************************************************//**
2 * @file Command.h
3 * @brief Header file of the commands driver.
4 * @author Istvan Csomortani ([email protected])
5 *
6 ********************************************************************************
7 * Copyright 2013(c) Analog Devices, Inc.
8 *
9 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions are met:
13 * - Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * - Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in
17 * the documentation and/or other materials provided with the
18 * distribution.
19 * - Neither the name of Analog Devices, Inc. nor the names of its
20 * contributors may be used to endorse or promote products derived
21 * from this software without specific prior written permission.
22 * - The use of this software may or may not infringe the patent rights
23 * of one or more patent holders. This license does not release you
24 * from the requirement that you obtain separate licenses from these
25 * patent holders to use this software.
26 * - Use of the software either in source or binary form, must be run
27 * on or directly connected to an Analog Devices Inc. component.
28 *
29 * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
30 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
31 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
32 * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
33 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34 * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
35 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
36 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
37 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 *
40 *******************************************************************************/
41 #ifndef __COMMAND_H__
42 #define __COMMAND_H__
43
44 /******************************************************************************/
45 /********************** Macros and Constants Definitions **********************/
46 /******************************************************************************/
47 #define NULL ((void *)0)
48 #define SUCCESS 0
49 #define ERROR -1
50
51 /******************************************************************************/
52 /*************************** Types Declarations *******************************/
53 /******************************************************************************/
54 typedef void (*cmdFunction)(double* param, char paramNo);
55
56 struct cmd_info {
57 char* name;
58 char* description;
59 char* acceptedValue;
60 char* example;
61 };
62 /******************************************************************************/
63 /************************ Functions Declarations ******************************/
64 /******************************************************************************/
65
66 /* Initializes the device. */
67 char DoDeviceInit(void);
68
69 /* Set the current device type */
70 void DoDeviceLock(void);
71
72 /* Displays all available commands. */
73 void GetHelp(double* param, char paramNo);
74
75 /* Loads and updates the selected DAC with a given value. */
76 void SetLoadAndUpdate(double* param, char paramNo);
77
78 /* Loads selected DAC input register with a given value. */
79 void SetLoad(double* param, char paramNo);
80
81 /* Sets the output value of LDAC pin. */
82 void SetLdacPin(double* param, char paramNo);
83
84 /* Sets the output value of CLR pin. */
85 void SetClrPin(double* param, char paramNo);
86
87 /* Reads from the selected DAC register. */
88 void GetReadback(double* param, char paramNo);
89
90 /* Loads both DAC input registers with a given value. */
91 void SetLoadAll(double* param, char paramNo);
92
93 /* Updates both DAC outputs. */
94 void SetUpdateAll(double* param, char paramNo);
95
96 /* Clears both DAC outputs to zero scale. */
97 void SetClearToZero(double* param, char paramNo);
98
99 /* Clears both DAC outputs to midscale. */
100 void SetClearToMid(double* param, char paramNo);
101
102 /* Displays the value of LDAC pin. */
103 void GetLdacPin(double* param, char paramNo);
104
105 /* Displays the value of CLR pin. */
106 void GetClrPin(double* param, char paramNo);
107
108 #endif // __COMMAND_H__