MAXREFDES71# Code Documentation  V01.00
MAXREFDES71# 2-Channel Analog Input/Analog Output
 All Data Structures Files Functions Variables Macros Pages
axi_millbrae.h
Go to the documentation of this file.
1 
28 /*
29  * Copyright (C) 2012 Maxim Integrated Products, Inc., All Rights Reserved.
30  *
31  * Permission is hereby granted, free of charge, to any person obtaining a
32  * copy of this software and associated documentation files (the "Software"),
33  * to deal in the Software without restriction, including without limitation
34  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
35  * and/or sell copies of the Software, and to permit persons to whom the
36  * Software is furnished to do so, subject to the following conditions:
37  *
38  * The above copyright notice and this permission notice shall be included
39  * in all copies or substantial portions of the Software.
40  *
41  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
42  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
43  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
44  * IN NO EVENT SHALL MAXIM INTEGRATED PRODUCTS BE LIABLE FOR ANY CLAIM, DAMAGES
45  * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
46  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
47  * OTHER DEALINGS IN THE SOFTWARE.
48  *
49  * Except as contained in this notice, the name of Maxim Integrated Products
50  * shall not be used except as stated in the Maxim Integrated Products
51  * Branding Policy.
52  *
53  * The mere transfer of this software does not imply any licenses
54  * of trade secrets, proprietary technology, copyrights, patents,
55  * trademarks, maskwork rights, or any other form of intellectual
56  * property whatsoever. Maxim Integrated Products retains all ownership rights.
57  *
58  ***************************************************************************/
59 
60 #ifndef AXI_MILLBRAE_H
61 #define AXI_MILLBRAE_H
62 
63 /***************************** Include Files *******************************/
64 
65 #include "xbasic_types.h"
66 #include "xstatus.h"
67 #include "xil_io.h"
68 
69 /************************** Constant Definitions ***************************/
70 
71 
75 #define AXI_MILLBRAE_USER_SLV_SPACE_OFFSET (0x00000000)
76 #define AXI_MILLBRAE_ADC_DATA1_REG_OFFSET (AXI_MILLBRAE_USER_SLV_SPACE_OFFSET + 0x00000000)
77 #define AXI_MILLBRAE_ADC_DATA2_REG_OFFSET (AXI_MILLBRAE_USER_SLV_SPACE_OFFSET + 0x00000004)
78 #define AXI_MILLBRAE_MODE_REG_OFFSET (AXI_MILLBRAE_USER_SLV_SPACE_OFFSET + 0x00000008)
79 #define AXI_MILLBRAE_TIMER_REG_OFFSET (AXI_MILLBRAE_USER_SLV_SPACE_OFFSET + 0x0000000C)
80 #define AXI_MILLBRAE_ADC_CONF_REG_OFFSET (AXI_MILLBRAE_USER_SLV_SPACE_OFFSET + 0x00000010)
81 #define AXI_MILLBRAE_DAC_CONF_REG_OFFSET (AXI_MILLBRAE_USER_SLV_SPACE_OFFSET + 0x00000014)
82 #define AXI_MILLBRAE_WRITE_ADC_CR_REG_OFFSET (AXI_MILLBRAE_USER_SLV_SPACE_OFFSET + 0x00000018)
83 #define AXI_MILLBRAE_WRITE_DAC_CR_REG_OFFSET (AXI_MILLBRAE_USER_SLV_SPACE_OFFSET + 0x0000001C)
84 #define AXI_MILLBRAE_START_OPERATION_REG_OFFSET (AXI_MILLBRAE_USER_SLV_SPACE_OFFSET + 0x00000020)
85 #define AXI_MILLBRAE_IP_INTR_STATUS_REG_OFFSET (AXI_MILLBRAE_USER_SLV_SPACE_OFFSET + 0x00000024)
86 #define AXI_MILLBRAE_IP_INTR_ENABLE_REG_OFFSET (AXI_MILLBRAE_USER_SLV_SPACE_OFFSET + 0x00000028)
87 
88 /**************************** Type Definitions *****************************/
89 
90 
91 /***************** Macros (Inline Functions) Definitions *******************/
92 
110 #define AXI_MILLBRAE_mWriteReg(BaseAddress, RegOffset, Data) \
111  Xil_Out32((BaseAddress) + (RegOffset), (Xuint32)(Data))
112 
130 #define AXI_MILLBRAE_mReadReg(BaseAddress, RegOffset) \
131  Xil_In32((BaseAddress) + (RegOffset))
132 
133 
134 
135 void AXI_MILLBRAE_Config_ADC(u32 BaseAddress, u32 Value);
136 
137 void AXI_MILLBRAE_Config_DAC(u32 BaseAddress, u32 Value);
138 
139 void AXI_MILLBRAE_Start_Conversion(u32 BaseAddress);
140 
141 void AXI_MILLBRAE_Stop_Operation(u32 BaseAddress);
142 
143 void AXI_MILLBRAE_Start_Replication(u32 BaseAddress);
144 
145 void AXI_MILLBRAE_Write_Timer_Reg(u32 BaseAddress, u32 Value);
146 
147 void AXI_MILLBRAE_Interrupt_Enable(u32 BaseAddress);
148 
149 void AXI_MILLBRAE_Interrupt_Disable(u32 BaseAddress);
150 
151 u32 AXI_MILLBRAE_Read_Data(u32 BaseAddress, u8 Channel);
152 
153 u32 AXI_MILLBRAE_Read_Interrupt_Status(u32 BaseAddress);
154 
155 void AXI_MILLBRAE_Single_Convert(u32 BaseAddress, u8 Channel, u16 * uSample);
156 
157 
158 #endif