no-OS
parameters.h
Go to the documentation of this file.
1 /***************************************************************************/
33 #ifndef _PARAMETERS_H_
34 #define _PARAMETERS_H_
35 
36 /******************************************************************************/
37 /***************************** Include Files **********************************/
38 /******************************************************************************/
39 #include "app_config.h"
40 #ifdef ALTERA_PLATFORM
41 #include "system.h"
42 #else
43 #include "xparameters.h"
44 #endif
45 
46 /******************************************************************************/
47 /********************** Macros and Constants Definitions **********************/
48 /******************************************************************************/
49 #ifdef ALTERA_PLATFORM
50 
51 #define GPIO_OFFSET 0
52 
53 #define GPIO_DEVICE_ID 0
54 #define SPI_DEVICE_ID 0
55 
56 #define GPIO_BASEADDR SYS_GPIO_OUT_BASE
57 #define SPI_BASEADDR SYS_SPI_BASE
58 
59 #define DDR_MEM_BASEADDR SYS_DDR3_CNTRL_ARCH_BASE
60 #define ADC_DDR_BASEADDR SYS_DDR3_CNTRL_ARCH_BASE + 0x800000
61 #define DAC_DDR_BASEADDR SYS_DDR3_CNTRL_ARCH_BASE + 0xA000000
62 
63 #define RX_A10_FPLL_BASEADDR AD9371_RX_JESD204_LINK_PLL_RECONFIG_BASE
64 #define TX_A10_FPLL_BASEADDR AD9371_TX_JESD204_LINK_PLL_RECONFIG_BASE
65 #define RX_OS_A10_FPLL_BASEADDR AD9371_RX_OS_JESD204_LINK_PLL_RECONFIG_BASE
66 
67 #define RX_JESD_BASEADDR AD9371_RX_JESD204_LINK_RECONFIG_BASE
68 #define TX_JESD_BASEADDR AD9371_TX_JESD204_LINK_RECONFIG_BASE
69 #define RX_OS_JESD_BASEADDR AD9371_RX_OS_JESD204_LINK_RECONFIG_BASE
70 
71 #define RX_XCVR_BASEADDR AD9371_RX_JESD204_LINK_MANAGEMENT_BASE
72 #define TX_XCVR_BASEADDR AD9371_TX_JESD204_LINK_MANAGEMENT_BASE
73 #define RX_OS_XCVR_BASEADDR AD9371_RX_OS_JESD204_LINK_MANAGEMENT_BASE
74 
75 #define RX_ADXCFG_0_BASEADDR AVL_ADXCFG_0_RCFG_S1_BASE
76 #define RX_ADXCFG_1_BASEADDR AVL_ADXCFG_1_RCFG_S1_BASE
77 #define TX_ADXCFG_0_BASEADDR AVL_ADXCFG_0_RCFG_S0_BASE
78 #define TX_ADXCFG_1_BASEADDR AVL_ADXCFG_1_RCFG_S0_BASE
79 #define TX_ADXCFG_2_BASEADDR AVL_ADXCFG_2_RCFG_S0_BASE
80 #define TX_ADXCFG_3_BASEADDR AVL_ADXCFG_3_RCFG_S0_BASE
81 #define RX_OS_ADXCFG_0_BASEADDR AVL_ADXCFG_2_RCFG_S1_BASE
82 #define RX_OS_ADXCFG_1_BASEADDR AVL_ADXCFG_3_RCFG_S1_BASE
83 
84 #define TX_PLL_BASEADDR AD9371_TX_JESD204_LANE_PLL_RECONFIG_BASE
85 
86 #define RX_CORE_BASEADDR AXI_AD9371_BASE
87 #define TX_CORE_BASEADDR AXI_AD9371_BASE + 0x4000
88 #define RX_OS_CORE_BASEADDR AXI_AD9371_BASE + 0x8000
89 
90 #define RX_OBS_DMA_BASEADDR AXI_AD9371_RX_OS_DMA_BASE
91 #define RX_DMA_BASEADDR AXI_AD9371_RX_DMA_BASE
92 #define TX_DMA_BASEADDR AXI_AD9371_TX_DMA_BASE
93 #else
94 #ifdef _XPARAMETERS_PS_H_
95 #ifdef XPS_BOARD_ZCU102
96 #define GPIO_OFFSET 78
97 
98 #define GPIO_DEVICE_ID XPAR_PSU_GPIO_0_DEVICE_ID
99 #define SPI_DEVICE_ID XPAR_PSU_SPI_0_DEVICE_ID
100 #define UART_IRQ_ID XPAR_XUARTPS_0_INTR
101 #else
102 #define GPIO_OFFSET 54
103 
104 #define GPIO_DEVICE_ID XPAR_PS7_GPIO_0_DEVICE_ID
105 #define SPI_DEVICE_ID XPAR_PS7_SPI_0_DEVICE_ID
106 #define UART_IRQ_ID XPAR_XUARTPS_1_INTR
107 #endif
108 
109 #define DDR_MEM_BASEADDR XPAR_DDR_MEM_BASEADDR
110 #else
111 #define GPIO_OFFSET 0
112 
113 #define GPIO_DEVICE_ID XPAR_GPIO_0_DEVICE_ID
114 #define SPI_DEVICE_ID XPAR_SPI_0_DEVICE_ID
115 #define UART_IRQ_ID XPAR_AXI_INTC_AXI_UART_INTERRUPT_INTR
116 
117 #define DDR_MEM_BASEADDR XPAR_AXI_DDR_CNTRL_BASEADDR
118 #endif
119 
120 #define RX_CLKGEN_BASEADDR XPAR_AXI_AD9371_RX_CLKGEN_BASEADDR
121 #define TX_CLKGEN_BASEADDR XPAR_AXI_AD9371_TX_CLKGEN_BASEADDR
122 #define RX_OS_CLKGEN_BASEADDR XPAR_AXI_AD9371_RX_OS_CLKGEN_BASEADDR
123 
124 #define RX_JESD_BASEADDR XPAR_AXI_AD9371_RX_JESD_RX_AXI_BASEADDR
125 #define TX_JESD_BASEADDR XPAR_AXI_AD9371_TX_JESD_TX_AXI_BASEADDR
126 #define RX_OS_JESD_BASEADDR XPAR_AXI_AD9371_RX_OS_JESD_RX_AXI_BASEADDR
127 
128 #define RX_XCVR_BASEADDR XPAR_AXI_AD9371_RX_XCVR_BASEADDR
129 #define TX_XCVR_BASEADDR XPAR_AXI_AD9371_TX_XCVR_BASEADDR
130 #define RX_OS_XCVR_BASEADDR XPAR_AXI_AD9371_RX_OS_XCVR_BASEADDR
131 
132 #ifdef XPAR_AXI_AD9371_CORE_BASEADDR
133 #define RX_CORE_BASEADDR XPAR_AXI_AD9371_CORE_BASEADDR
134 #define TX_CORE_BASEADDR XPAR_AXI_AD9371_CORE_BASEADDR + 0x4000
135 #define RX_OS_CORE_BASEADDR XPAR_AXI_AD9371_CORE_BASEADDR + 0x8000
136 #else
137 #define RX_CORE_BASEADDR XPAR_RX_AD9371_TPL_CORE_ADC_TPL_CORE_BASEADDR
138 #define TX_CORE_BASEADDR XPAR_TX_AD9371_TPL_CORE_DAC_TPL_CORE_BASEADDR
139 #define RX_OS_CORE_BASEADDR XPAR_RX_OS_AD9371_TPL_CORE_ADC_TPL_CORE_BASEADDR
140 #endif
141 
142 #define RX_OBS_DMA_BASEADDR XPAR_AXI_AD9371_RX_OS_DMA_BASEADDR
143 #define RX_DMA_BASEADDR XPAR_AXI_AD9371_RX_DMA_BASEADDR
144 #define TX_DMA_BASEADDR XPAR_AXI_AD9371_TX_DMA_BASEADDR
145 #endif
146 
147 #if defined(DMA_EXAMPLE) || defined(IIO_SUPPORT)
148 #define DAC_BUFFER_SAMPLES 1024
149 #define ADC_BUFFER_SAMPLES 16384
150 #define ADC_CHANNELS 4
151 #endif
152 
153 #ifdef _XPARAMETERS_PS_H_
154 #define UART_DEVICE_ID XPAR_XUARTPS_0_DEVICE_ID
155 #define INTC_DEVICE_ID XPAR_SCUGIC_SINGLE_DEVICE_ID
156 #else /* _XPARAMETERS_PS_H_ */
157 #define UART_DEVICE_ID XPAR_AXI_UART_DEVICE_ID
158 #define INTC_DEVICE_ID XPAR_INTC_SINGLE_DEVICE_ID
159 #endif /* _XPARAMETERS_PS_H_ */
160 #define AD9528_CS 1
161 #define AD9371_CS 2
162 
163 #define DAC_GPIO_PLDDR_BYPASS GPIO_OFFSET + 60
164 #define AD9528_RESET_B GPIO_OFFSET + 59
165 #define AD9528_SYSREF_REQ GPIO_OFFSET + 58
166 #define AD9371_RESET_B GPIO_OFFSET + 52
167 
168 #endif