21 #include "no_os_gpio.h"
28 #define MBED_PLATFORM 1
31 #define CONTINUOUS_DATA_CAPTURE 0
32 #define BURST_DATA_CAPTURE 1
36 #define STR(s) XSTR(s)
39 #if !defined(ACTIVE_PLATFORM)
40 #define ACTIVE_PLATFORM MBED_PLATFORM
46 #if !defined(USE_PHY_COM_PORT)
47 #define USE_VIRTUAL_COM_PORT
58 #if defined(DEV_AD4111)
59 #define ACTIVE_DEVICE_NAME "ad4111"
60 #define DEVICE_NAME "DEV_AD4111"
61 #define ACTIVE_DEVICE_ID ID_AD4111
62 #define HW_MEZZANINE_NAME "Eval-AD4111SDZ"
63 #elif defined(DEV_AD4112)
64 #define ACTIVE_DEVICE_NAME "ad4112"
65 #define DEVICE_NAME "DEV_AD4112"
66 #define ACTIVE_DEVICE_ID ID_AD4112
67 #define HW_MEZZANINE_NAME "EVAL-AD4112SDZ"
68 #elif defined(DEV_AD4114)
69 #define ACTIVE_DEVICE_NAME "ad4114"
70 #define DEVICE_NAME "DEV_AD4114"
71 #define ACTIVE_DEVICE_ID ID_AD4114
72 #define HW_MEZZANINE_NAME "EVAL-AD4114SDZ"
73 #elif defined(DEV_AD4115)
74 #define ACTIVE_DEVICE_NAME "ad4115"
75 #define DEVICE_NAME "DEV_AD4115"
76 #define ACTIVE_DEVICE_ID ID_AD4115
77 #define HW_MEZZANINE_NAME "EVAL-AD4115SDZ"
78 #elif defined(DEV_AD4116)
79 #define ACTIVE_DEVICE_NAME "ad4116"
80 #define DEVICE_NAME "DEV_AD4116"
81 #define ACTIVE_DEVICE_ID ID_AD4116
82 #define HW_MEZZANINE_NAME "EVAL-AD4116SDZ"
83 #elif defined(DEV_AD7172_2)
85 #define ACTIVE_DEVICE_NAME "ad7172-2"
86 #define DEVICE_NAME "DEV_AD7172_2"
87 #define ACTIVE_DEVICE_ID ID_AD7172_2
88 #define HW_MEZZANINE_NAME "EVAL-AD7172-2SDZ"
89 #elif defined(DEV_AD7172_4)
91 #define ACTIVE_DEVICE_NAME "ad7172-4"
92 #define DEVICE_NAME "DEV_AD7172_4"
93 #define ACTIVE_DEVICE_ID ID_AD7172_4
94 #define HW_MEZZANINE_NAME "EVAL-AD7172-4SDZ"
95 #elif defined(DEV_AD7173_8)
97 #define ACTIVE_DEVICE_NAME "ad7173-8"
98 #define DEVICE_NAME "DEV_AD7173_8"
99 #define ACTIVE_DEVICE_ID ID_AD7173_8
100 #define HW_MEZZANINE_NAME "EVAL-AD7173-8SDZ"
101 #elif defined(DEV_AD7175_2)
102 #define AD7175_2_INIT
103 #define ACTIVE_DEVICE_NAME "ad7175-2"
104 #define DEVICE_NAME "DEV_AD7175_2"
105 #define ACTIVE_DEVICE_ID ID_AD7175_2
106 #define HW_MEZZANINE_NAME "EVAL-AD7175-2SDZ"
107 #elif defined(DEV_AD7175_8)
108 #define AD7175_8_INIT
109 #define ACTIVE_DEVICE_NAME "ad7175-8"
110 #define DEVICE_NAME "DEV_AD7175_8"
111 #define ACTIVE_DEVICE_ID ID_AD7175_8
112 #define HW_MEZZANINE_NAME "EVAL-AD7175-8SDZ"
113 #elif defined(DEV_AD7176_2)
114 #define AD7176_2_INIT
115 #define ACTIVE_DEVICE_NAME "ad7176-2"
116 #define DEVICE_NAME "DEV_AD7176_2"
117 #define ACTIVE_DEVICE_ID ID_AD7176_2
118 #define HW_MEZZANINE_NAME "EVAL-AD7176-2SDZ"
119 #elif defined(DEV_AD7177_2)
120 #define AD7177_2_INIT
121 #define ACTIVE_DEVICE_NAME "ad7177-2"
122 #define DEVICE_NAME "DEV_AD7177_2"
123 #define ACTIVE_DEVICE_ID ID_AD7177_2
124 #define HW_MEZZANINE_NAME "EVAL-AD7177-2SDZ"
126 #warning No/Unsupported ADxxxxy symbol defined. AD4111 defined
128 #define ACTIVE_DEVICE_NAME "ad4111"
129 #define DEVICE_NAME "DEV_AD4111"
130 #define ACTIVE_DEVICE_ID ID_AD4111
131 #define HW_MEZZANINE_NAME "Eval-AD4111SDZ"
134 #if (ACTIVE_PLATFORM == MBED_PLATFORM)
136 #define HW_CARRIER_NAME TARGET_NAME
138 #if defined(USE_VIRTUAL_COM_PORT)
139 #define uart_extra_init_params mbed_vcom_extra_init_params
140 #define uart_ops mbed_virtual_com_ops
142 #define uart_extra_init_params mbed_uart_extra_init_params
143 #define uart_ops mbed_uart_ops
145 #define spi_extra_init_params mbed_spi_extra_init_params
146 #define ext_int_extra_init_params mbed_trigger_gpio_irq_init_params
147 #define i2c_extra_init_params mbed_i2c_extra_init_params
148 #define csb_platform_ops mbed_gpio_ops
149 #define rdy_platform_ops mbed_gpio_ops
150 #define irq_platform_ops mbed_gpio_irq_ops
151 #define spi_platform_ops mbed_spi_ops
152 #define i2c_ops mbed_i2c_ops
153 #define trigger_gpio_handle 0
154 #define IRQ_INT_ID GPIO_IRQ_ID1
158 #define FIRMWARE_NAME "ad717x_iio"
160 #if !defined(PLATFORM_NAME)
161 #define PLATFORM_NAME HW_CARRIER_NAME
164 #if !defined(EVB_INTERFACE)
165 #define EVB_INTERFACE "SDP_120"
171 #define VIRTUAL_COM_PORT_VID 0x0456
172 #define VIRTUAL_COM_PORT_PID 0xb66c
173 #define VIRTUAL_COM_SERIAL_NUM (FIRMWARE_NAME "_" DEVICE_NAME "_" STR(PLATFORM_NAME))
176 #if defined(DEV_AD4111) || defined(DEV_AD4112) || \
177 defined(DEV_AD4114) || defined(DEV_AD4115) || defined (DEV_AD4116) ||\
178 defined(DEV_AD7173_8) || defined(DEV_AD7175_8)
179 #define NUMBER_OF_CHANNELS 16U
180 #define NUMBER_OF_SETUPS 8U
181 #elif defined(DEV_AD7172_4)
182 #define NUMBER_OF_CHANNELS 8U
183 #define NUMBER_OF_SETUPS 8U
185 #define NUMBER_OF_CHANNELS 4U
186 #define NUMBER_OF_SETUPS 4U
190 #if !defined(DATA_CAPTURE_MODE)
191 #define DATA_CAPTURE_MODE CONTINUOUS_DATA_CAPTURE
198 #define AD717X_INTERNAL_REFERENCE 2.5
199 #define AD717x_EXTERNAL_REFERENCE 2.5
200 #define AD717X_AVDD_AVSS_REFERENCE 2.5
203 #define IIO_UART_BAUD_RATE (230400)
221 #define AD717x_SAMPLING_RATE (31250)
224 #if defined (DEV_AD4111) || defined (DEV_AD4112) || defined (DEV_AD4114) ||\
225 defined (DEV_AD4115) || defined (DEV_AD7172_2) ||\
226 defined (DEV_AD7172_4) || defined (DEV_AD7173_8)
227 #if (AD717x_SAMPLING_RATE == 31250)
228 #define AD717x_ODR_SEL 0
229 #elif (AD717x_SAMPLING_RATE == 15625)
230 #define AD717x_ODR_SEL 6
231 #elif (AD717x_SAMPLING_RATE == 10417)
232 #define AD717x_ODR_SEL 7
233 #elif (AD717x_SAMPLING_RATE == 5208)
234 #define AD717x_ODR_SEL 8
235 #elif (AD717x_SAMPLING_RATE == 2957)
236 #define AD717x_ODR_SEL 9
237 #elif (AD717x_SAMPLING_RATE == 1007)
238 #define AD717x_ODR_SEL 10
239 #elif (AD717x_SAMPLING_RATE == 503)
240 #define AD717x_ODR_SEL 11
241 #elif (AD717x_SAMPLING_RATE == 381)
242 #define AD717x_ODR_SEL 12
243 #elif (AD717x_SAMPLING_RATE == 200)
244 #define AD717x_ODR_SEL 13
245 #elif (AD717x_SAMPLING_RATE == 100)
246 #define AD717x_ODR_SEL 14
247 #elif (AD717x_SAMPLING_RATE == 59)
248 #define AD717x_ODR_SEL 15
249 #elif (AD717x_SAMPLING_RATE == 49)
250 #define AD717x_ODR_SEL 16
251 #elif (AD717x_SAMPLING_RATE == 20)
252 #define AD717x_ODR_SEL 17
253 #elif (AD717x_SAMPLING_RATE == 16)
254 #define AD717x_ODR_SEL 18
255 #elif (AD717x_SAMPLING_RATE == 10)
256 #define AD717x_ODR_SEL 19
257 #elif (AD717x_SAMPLING_RATE == 5)
258 #define AD717x_ODR_SEL 20
259 #elif (AD717x_SAMPLING_RATE == 2)
260 #define AD717x_ODR_SEL 21
261 #elif (AD717x_SAMPLING_RATE == 1)
262 #define AD717x_ODR_SEL 22
264 #warining "Invalid sampling frequency selection, using 31250 as default"
265 #define AD717x_SAMPLING_RATE 31250
266 #define AD717x_ODR_SEL 0
269 #elif defined (DEV_AD4116)
270 #if (AD717x_SAMPLING_RATE == 625000)
271 #define AD717x_ODR_SEL 0
272 #elif (AD717x_SAMPLING_RATE == 31250)
273 #define AD717x_ODR_SEL 4
274 #elif (AD717x_SAMPLING_RATE == 15625)
275 #define AD717x_ODR_SEL 6
276 #elif (AD717x_SAMPLING_RATE == 10416)
277 #define AD717x_ODR_SEL 7
278 #elif (AD717x_SAMPLING_RATE == 5194)
279 #define AD717x_ODR_SEL 8
280 #elif (AD717x_SAMPLING_RATE == 2496)
281 #define AD717x_ODR_SEL 9
282 #elif (AD717x_SAMPLING_RATE == 1007)
283 #define AD717x_ODR_SEL 10
284 #elif (AD717x_SAMPLING_RATE == 499)
285 #define AD717x_ODR_SEL 11
286 #elif (AD717x_SAMPLING_RATE == 390)
287 #define AD717x_ODR_SEL 12
288 #elif (AD717x_SAMPLING_RATE == 200)
289 #define AD717x_ODR_SEL 13
290 #elif (AD717x_SAMPLING_RATE == 100)
291 #define AD717x_ODR_SEL 14
292 #elif (AD717x_SAMPLING_RATE == 59)
293 #define AD717x_ODR_SEL 15
294 #elif (AD717x_SAMPLING_RATE == 49)
295 #define AD717x_ODR_SEL 16
296 #elif (AD717x_SAMPLING_RATE == 20)
297 #define AD717x_ODR_SEL 17
298 #elif (AD717x_SAMPLING_RATE == 16)
299 #define AD717x_ODR_SEL 18
300 #elif (AD717x_SAMPLING_RATE == 10)
301 #define AD717x_ODR_SEL 19
302 #elif (AD717x_SAMPLING_RATE == 5)
303 #define AD717x_ODR_SEL 20
304 #elif (AD717x_SAMPLING_RATE == 2)
305 #define AD717x_ODR_SEL 21
306 #elif (AD717x_SAMPLING_RATE == 1)
307 #define AD717x_ODR_SEL 22
309 #elif defined (DEV_AD7175_2) || defined (DEV_AD7175_8) || defined (DEV_AD7176_2) || defined (DEV_AD7177_2)
310 #if !defined (DEV_AD7177_2)
311 #if (AD717x_SAMPLING_RATE == 31250)
312 #define AD717x_ODR_SEL 4
313 #elif (AD717x_SAMPLING_RATE == 25000)
314 #define AD717x_ODR_SEL 5
315 #elif (AD717x_SAMPLING_RATE == 15625)
316 #define AD717x_ODR_SEL 6
318 #elif (AD717x_SAMPLING_RATE == 10000)
319 #define AD717x_ODR_SEL 7
320 #elif (AD717x_SAMPLING_RATE == 5000)
321 #define AD717x_ODR_SEL 8
322 #elif (AD717x_SAMPLING_RATE == 2500)
323 #define AD717x_ODR_SEL 9
324 #elif (AD717x_SAMPLING_RATE == 1000)
325 #define AD717x_ODR_SEL 10
326 #elif (AD717x_SAMPLING_RATE == 500)
327 #define AD717x_ODR_SEL 11
328 #elif (AD717x_SAMPLING_RATE == 397)
329 #define AD717x_ODR_SEL 12
330 #elif (AD717x_SAMPLING_RATE == 200)
331 #define AD717x_ODR_SEL 13
332 #elif (AD717x_SAMPLING_RATE == 100)
333 #define AD717x_ODR_SEL 14
334 #elif (AD717x_SAMPLING_RATE == 59)
335 #define AD717x_ODR_SEL 15
336 #elif (AD717x_SAMPLING_RATE == 49)
337 #define AD717x_ODR_SEL 16
338 #elif (AD717x_SAMPLING_RATE == 20)
339 #define AD717x_ODR_SEL 17
340 #elif (AD717x_SAMPLING_RATE == 16)
341 #define AD717x_ODR_SEL 18
342 #elif (AD717x_SAMPLING_RATE == 10)
343 #define AD717x_ODR_SEL 19
344 #elif (AD717x_SAMPLING_RATE == 5)
345 #define AD717x_ODR_SEL 20
347 #warning "Invalid sampling frequency selection, using 31250 as default"
348 #if defined(DEV_AD7177_2)
349 #define AD717x_SAMPLING_RATE 10000
350 #define AD717x_ODR_SEL 7
352 #define AD717x_SAMPLING_RATE 31250
353 #define AD717x_ODR_SEL 4
359 #if defined(DEV_AD4111) || defined(DEV_AD4112) || \
360 defined(DEV_AD4114) || defined(DEV_AD4115) || defined (DEV_AD4116)
361 #define SCALE_FACTOR_DR 0.1
363 #define SCALE_FACTOR_DR 1
374 extern struct no_os_uart_desc *
uart_desc;
376 extern struct no_os_gpio_desc *
csb_gpio;
378 extern struct no_os_gpio_desc *
rdy_gpio;
struct no_os_irq_ctrl_desc * trigger_irq_desc
Definition: app_config.c:103
int32_t init_system(void)
Initialize the system peripherals.
Definition: app_config.c:185
struct no_os_uart_desc * uart_desc
Definition: app_config.c:97
struct no_os_eeprom_desc * eeprom_desc
Definition: app_config.c:194
struct no_os_gpio_desc * csb_gpio
Definition: app_config.c:51
struct no_os_gpio_desc * rdy_gpio
Definition: app_config.c:54
Header file for Mbed platform configurations.