Debian Codegraph @

thirdparty/analogdevicesinc/no-OS/device_drivers/AD5660/ad5660.h

raw symbols SCIP
1 /***************************************************************************//**
2 * @file ad5660.h
3 * @brief Header file of ad5660 Driver for Microblaze processor.
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 modification,
12 * 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 IMPLIED
30 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY
31 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
32 * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
34 * INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
35 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
36 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
38 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 *
40 *******************************************************************************/
41
42 #ifndef _ad5660_H_
43 #define _ad5660_H_
44 /******************************************************************************/
45 /***************************** Include Files **********************************/
46 /******************************************************************************/
47 #include "Communication.h"
48 #include "xil_types.h"
49 #include "xparameters.h"
50
51 /******************************************************************************/
52 /********************* Macros and Constants Definitions ***********************/
53 /******************************************************************************/
54 /* Supported devices */
55 typedef enum {
56 ID_AD5620_2_3,
57 ID_AD5620_1,
58 ID_AD5640_2_3,
59 ID_AD5640_1,
60 ID_AD5660_2_3,
61 ID_AD5660_1,
62 } AD56x0_type;
63
64 #define ad5660_SLAVE_ID 2
65
66 /******************************************************************************/
67 /* ad5660 Power Modes */
68 /******************************************************************************/
69 #define ad5660_LOAD 0x0 /* Load and update Normal Operation.*/
70 #define ad5660_PWRDWN_1K 0x1 /* Power-down: 1kOhm to GND. */
71 #define ad5660_PWRDWN_100K 0x2 /* Power-down: 100kOhm to GND. */
72 #define ad5660_PWRDWN_TRISTATE 0x3 /* Power-down: Three-state. */
73
74 /******************************************************************************/
75 /*************************** Functions Declarations ***************************/
76 /******************************************************************************/
77 /* Initializes the communication with the device. */
78 char ad5660_Init(AD56x0_type device);
79
80 /* Writes 12/14/16 bits of data to input register through SPI. */
81 char ad5660_WriteRegister(unsigned long data);
82
83 /* Sets the output DAC voltage to a desired value. */
84 void ad5660_SetVoltage(float vOut);
85
86 #endif /* _ad5660_H_ */