Debian Codegraph @

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

raw symbols SCIP
1 /***************************************************************************//**
2 * @file Command.h
3 * @brief Header file of the commands driver.
4 * @author Lucian Sin ([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 /* Makes a power-on reset. */
76 void DoReset(double* param, char paramNo);
77
78 /* Selects a given power mode for selected DAC. */
79 void SetPowerMode(double* param, char paramNo);
80
81 /* Displays the power mode for one selected DAC. */
82 void GetPowerMode(double* param, char paramNo);
83
84 /* Turns on/off the internal reference. */
85 void SetIntRef(double* param, char paramNo);
86
87 /* Displays the status of the internal reference. */
88 void GetIntRef(double* param, char paramNo);
89
90 /* Loads selected DAC register with a given value. */
91 void SetLoadN(double* param, char paramNo);
92
93 /* Updates the selected DAC with the last value written in register. */
94 void SetUpdateN(double* param, char paramNo);
95
96 /* Loads and updates the selected DAC with a given value. */
97 void SetLoadNAndUpdateN(double* param, char paramNo);
98
99 /* Loads the selected DAC with a given value and updates all DACs. */
100 void SetLoadNAndUpdateAll(double* param, char paramNo);
101
102 /* Enables/Disables the LDAC pin for selected DAC. */
103 void SetEnLdacPin(double* param, char paramNo);
104
105 /* Displays the status(enabled or disabled) of the LDAC pin for a selected DAC*/
106 void GetEnLdacPin(double* param, char paramNo);
107
108 /* Loads Clear Code Register with specific clear code. */
109 void SetClrCode(double* param, char paramNo);
110
111 /* Displays the active clear code. */
112 void GetClrCode(double* param, char paramNo);
113
114 /* Sets the output value of LDAC pin. */
115 void SetLdacPin(double* param, char paramNo);
116
117 /* Sets the output value of CLR pin. */
118 void SetClrPin(double* param, char paramNo);
119
120 /* Displays the value of LDAC pin. */
121 void GetLdacPin(double* param, char paramNo);
122
123 /* Displays the value of CLR pin. */
124 void GetClrPin(double* param, char paramNo);
125
126 #endif // __COMMAND_H__