22#include "no_os_gpio.h"
29#define CONTINUOUS_DATA_CAPTURE 0
30#define BURST_DATA_CAPTURE 1
37#if !defined(ACTIVE_PLATFORM)
38#define ACTIVE_PLATFORM STM32_PLATFORM
44#if !defined(USE_PHY_COM_PORT)
45#define USE_VIRTUAL_COM_PORT
56#if defined(DEV_AD4111)
57#define ACTIVE_DEVICE_NAME "ad4111"
58#define DEVICE_NAME "DEV_AD4111"
59#define ACTIVE_DEVICE_ID ID_AD4111
60#define HW_MEZZANINE_NAME "Eval-AD4111SDZ"
61#elif defined(DEV_AD4112)
62#define ACTIVE_DEVICE_NAME "ad4112"
63#define DEVICE_NAME "DEV_AD4112"
64#define ACTIVE_DEVICE_ID ID_AD4112
65#define HW_MEZZANINE_NAME "EVAL-AD4112SDZ"
66#elif defined(DEV_AD4114)
67#define ACTIVE_DEVICE_NAME "ad4114"
68#define DEVICE_NAME "DEV_AD4114"
69#define ACTIVE_DEVICE_ID ID_AD4114
70#define HW_MEZZANINE_NAME "EVAL-AD4114SDZ"
71#elif defined(DEV_AD4115)
72#define ACTIVE_DEVICE_NAME "ad4115"
73#define DEVICE_NAME "DEV_AD4115"
74#define ACTIVE_DEVICE_ID ID_AD4115
75#define HW_MEZZANINE_NAME "EVAL-AD4115SDZ"
76#elif defined(DEV_AD4116)
77#define ACTIVE_DEVICE_NAME "ad4116"
78#define DEVICE_NAME "DEV_AD4116"
79#define ACTIVE_DEVICE_ID ID_AD4116
80#define HW_MEZZANINE_NAME "EVAL-AD4116SDZ"
81#elif defined(DEV_AD7172_2)
83#define ACTIVE_DEVICE_NAME "ad7172-2"
84#define DEVICE_NAME "DEV_AD7172_2"
85#define ACTIVE_DEVICE_ID ID_AD7172_2
86#define HW_MEZZANINE_NAME "EVAL-AD7172-2SDZ"
87#elif defined(DEV_AD7172_4)
89#define ACTIVE_DEVICE_NAME "ad7172-4"
90#define DEVICE_NAME "DEV_AD7172_4"
91#define ACTIVE_DEVICE_ID ID_AD7172_4
92#define HW_MEZZANINE_NAME "EVAL-AD7172-4SDZ"
93#elif defined(DEV_AD7173_8)
95#define ACTIVE_DEVICE_NAME "ad7173-8"
96#define DEVICE_NAME "DEV_AD7173_8"
97#define ACTIVE_DEVICE_ID ID_AD7173_8
98#define HW_MEZZANINE_NAME "EVAL-AD7173-8SDZ"
99#elif defined(DEV_AD7175_2)
101#define ACTIVE_DEVICE_NAME "ad7175-2"
102#define DEVICE_NAME "DEV_AD7175_2"
103#define ACTIVE_DEVICE_ID ID_AD7175_2
104#define HW_MEZZANINE_NAME "EVAL-AD7175-2SDZ"
105#elif defined(DEV_AD7175_8)
107#define ACTIVE_DEVICE_NAME "ad7175-8"
108#define DEVICE_NAME "DEV_AD7175_8"
109#define ACTIVE_DEVICE_ID ID_AD7175_8
110#define HW_MEZZANINE_NAME "EVAL-AD7175-8SDZ"
111#elif defined(DEV_AD7176_2)
113#define ACTIVE_DEVICE_NAME "ad7176-2"
114#define DEVICE_NAME "DEV_AD7176_2"
115#define ACTIVE_DEVICE_ID ID_AD7176_2
116#define HW_MEZZANINE_NAME "EVAL-AD7176-2SDZ"
117#elif defined(DEV_AD7177_2)
119#define ACTIVE_DEVICE_NAME "ad7177-2"
120#define DEVICE_NAME "DEV_AD7177_2"
121#define ACTIVE_DEVICE_ID ID_AD7177_2
122#define HW_MEZZANINE_NAME "EVAL-AD7177-2SDZ"
124#warning No/Unsupported ADxxxxy symbol defined. AD4111 defined
126#define ACTIVE_DEVICE_NAME "ad4111"
127#define DEVICE_NAME "DEV_AD4111"
128#define ACTIVE_DEVICE_ID ID_AD4111
129#define HW_MEZZANINE_NAME "Eval-AD4111SDZ"
132#if (ACTIVE_PLATFORM == STM32_PLATFORM)
134#define HW_CARRIER_NAME TARGET_NAME
136#define uart_extra_init_params stm32_uart_extra_init_params
137#define spi_extra_init_params stm32_spi_extra_init_params
138#define vcom_extra_init_params stm32_vcom_extra_init_params
139#define uart_extra_init_params stm32_uart_extra_init_params
140#define ext_int_extra_init_params stm32_trigger_gpio_irq_init_params
141#define uart_ops stm32_uart_ops
142#define vcom_ops stm32_usb_uart_ops
143#define irq_platform_ops stm32_gpio_irq_ops
144#define csb_platform_ops stm32_gpio_ops
145#define rdy_platform_ops stm32_gpio_ops
146#define spi_platform_ops stm32_spi_ops
147#define irq_ops stm32_irq_ops
148#define i2c_ops stm32_i2c_ops
149#define trigger_gpio_irq_ops stm32_gpio_irq_ops
150#define trigger_gpio_handle 0
151#define IRQ_INT_ID RDY_PIN
153#error "No/Invalid active platform selected"
157#define FIRMWARE_NAME "ad717x_iio"
159#if !defined(PLATFORM_NAME)
160#define PLATFORM_NAME HW_CARRIER_NAME
163#if !defined(EVB_INTERFACE)
164#define EVB_INTERFACE "SDP_120"
170#define VIRTUAL_COM_PORT_VID 0x0456
171#define VIRTUAL_COM_PORT_PID 0xb66c
172#define VIRTUAL_COM_SERIAL_NUM (FIRMWARE_NAME "_" DEVICE_NAME "_" STR(PLATFORM_NAME))
175#if defined(DEV_AD4111) || defined(DEV_AD4112) || \
176 defined(DEV_AD4114) || defined(DEV_AD4115) || defined (DEV_AD4116) ||\
177 defined(DEV_AD7173_8) || defined(DEV_AD7175_8)
178#define NUMBER_OF_CHANNELS 16U
179#define NUMBER_OF_SETUPS 8U
180#elif defined(DEV_AD7172_4)
181#define NUMBER_OF_CHANNELS 8U
182#define NUMBER_OF_SETUPS 8U
184#define NUMBER_OF_CHANNELS 4U
185#define NUMBER_OF_SETUPS 4U
189#if !defined(DATA_CAPTURE_MODE)
190#define DATA_CAPTURE_MODE CONTINUOUS_DATA_CAPTURE
197#define AD717X_INTERNAL_REFERENCE 2.5
198#define AD717x_EXTERNAL_REFERENCE 2.5
199#define AD717X_AVDD_AVSS_REFERENCE 2.5
202#define IIO_UART_BAUD_RATE (230400)
220#define AD717x_SAMPLING_RATE (31250)
223#if defined (DEV_AD4111) || defined (DEV_AD4112) || defined (DEV_AD4114) ||\
224 defined (DEV_AD4115) || defined (DEV_AD7172_2) ||\
225 defined (DEV_AD7172_4) || defined (DEV_AD7173_8)
226#if (AD717x_SAMPLING_RATE == 31250)
227#define AD717x_ODR_SEL 0
228#elif (AD717x_SAMPLING_RATE == 15625)
229#define AD717x_ODR_SEL 6
230#elif (AD717x_SAMPLING_RATE == 10417)
231#define AD717x_ODR_SEL 7
232#elif (AD717x_SAMPLING_RATE == 5208)
233#define AD717x_ODR_SEL 8
234#elif (AD717x_SAMPLING_RATE == 2957)
235#define AD717x_ODR_SEL 9
236#elif (AD717x_SAMPLING_RATE == 1007)
237#define AD717x_ODR_SEL 10
238#elif (AD717x_SAMPLING_RATE == 503)
239#define AD717x_ODR_SEL 11
240#elif (AD717x_SAMPLING_RATE == 381)
241#define AD717x_ODR_SEL 12
242#elif (AD717x_SAMPLING_RATE == 200)
243#define AD717x_ODR_SEL 13
244#elif (AD717x_SAMPLING_RATE == 100)
245#define AD717x_ODR_SEL 14
246#elif (AD717x_SAMPLING_RATE == 59)
247#define AD717x_ODR_SEL 15
248#elif (AD717x_SAMPLING_RATE == 49)
249#define AD717x_ODR_SEL 16
250#elif (AD717x_SAMPLING_RATE == 20)
251#define AD717x_ODR_SEL 17
252#elif (AD717x_SAMPLING_RATE == 16)
253#define AD717x_ODR_SEL 18
254#elif (AD717x_SAMPLING_RATE == 10)
255#define AD717x_ODR_SEL 19
256#elif (AD717x_SAMPLING_RATE == 5)
257#define AD717x_ODR_SEL 20
258#elif (AD717x_SAMPLING_RATE == 2)
259#define AD717x_ODR_SEL 21
260#elif (AD717x_SAMPLING_RATE == 1)
261#define AD717x_ODR_SEL 22
263#warining "Invalid sampling frequency selection, using 31250 as default"
264#define AD717x_SAMPLING_RATE 31250
265#define AD717x_ODR_SEL 0
268#elif defined (DEV_AD4116)
269#if (AD717x_SAMPLING_RATE == 625000)
270#define AD717x_ODR_SEL 0
271#elif (AD717x_SAMPLING_RATE == 31250)
272#define AD717x_ODR_SEL 4
273#elif (AD717x_SAMPLING_RATE == 15625)
274#define AD717x_ODR_SEL 6
275#elif (AD717x_SAMPLING_RATE == 10416)
276#define AD717x_ODR_SEL 7
277#elif (AD717x_SAMPLING_RATE == 5194)
278#define AD717x_ODR_SEL 8
279#elif (AD717x_SAMPLING_RATE == 2496)
280#define AD717x_ODR_SEL 9
281#elif (AD717x_SAMPLING_RATE == 1007)
282#define AD717x_ODR_SEL 10
283#elif (AD717x_SAMPLING_RATE == 499)
284#define AD717x_ODR_SEL 11
285#elif (AD717x_SAMPLING_RATE == 390)
286#define AD717x_ODR_SEL 12
287#elif (AD717x_SAMPLING_RATE == 200)
288#define AD717x_ODR_SEL 13
289#elif (AD717x_SAMPLING_RATE == 100)
290#define AD717x_ODR_SEL 14
291#elif (AD717x_SAMPLING_RATE == 59)
292#define AD717x_ODR_SEL 15
293#elif (AD717x_SAMPLING_RATE == 49)
294#define AD717x_ODR_SEL 16
295#elif (AD717x_SAMPLING_RATE == 20)
296#define AD717x_ODR_SEL 17
297#elif (AD717x_SAMPLING_RATE == 16)
298#define AD717x_ODR_SEL 18
299#elif (AD717x_SAMPLING_RATE == 10)
300#define AD717x_ODR_SEL 19
301#elif (AD717x_SAMPLING_RATE == 5)
302#define AD717x_ODR_SEL 20
303#elif (AD717x_SAMPLING_RATE == 2)
304#define AD717x_ODR_SEL 21
305#elif (AD717x_SAMPLING_RATE == 1)
306#define AD717x_ODR_SEL 22
308#elif defined (DEV_AD7175_2) || defined (DEV_AD7175_8) || defined (DEV_AD7176_2) || defined (DEV_AD7177_2)
309#if !defined (DEV_AD7177_2)
310#if (AD717x_SAMPLING_RATE == 31250)
311#define AD717x_ODR_SEL 4
312#elif (AD717x_SAMPLING_RATE == 25000)
313#define AD717x_ODR_SEL 5
314#elif (AD717x_SAMPLING_RATE == 15625)
315#define AD717x_ODR_SEL 6
317#elif (AD717x_SAMPLING_RATE == 10000)
318#define AD717x_ODR_SEL 7
319#elif (AD717x_SAMPLING_RATE == 5000)
320#define AD717x_ODR_SEL 8
321#elif (AD717x_SAMPLING_RATE == 2500)
322#define AD717x_ODR_SEL 9
323#elif (AD717x_SAMPLING_RATE == 1000)
324#define AD717x_ODR_SEL 10
325#elif (AD717x_SAMPLING_RATE == 500)
326#define AD717x_ODR_SEL 11
327#elif (AD717x_SAMPLING_RATE == 397)
328#define AD717x_ODR_SEL 12
329#elif (AD717x_SAMPLING_RATE == 200)
330#define AD717x_ODR_SEL 13
331#elif (AD717x_SAMPLING_RATE == 100)
332#define AD717x_ODR_SEL 14
333#elif (AD717x_SAMPLING_RATE == 59)
334#define AD717x_ODR_SEL 15
335#elif (AD717x_SAMPLING_RATE == 49)
336#define AD717x_ODR_SEL 16
337#elif (AD717x_SAMPLING_RATE == 20)
338#define AD717x_ODR_SEL 17
339#elif (AD717x_SAMPLING_RATE == 16)
340#define AD717x_ODR_SEL 18
341#elif (AD717x_SAMPLING_RATE == 10)
342#define AD717x_ODR_SEL 19
343#elif (AD717x_SAMPLING_RATE == 5)
344#define AD717x_ODR_SEL 20
346#warning "Invalid sampling frequency selection, using 31250 as default"
347#if defined(DEV_AD7177_2)
348#define AD717x_SAMPLING_RATE 10000
349#define AD717x_ODR_SEL 7
351#define AD717x_SAMPLING_RATE 31250
352#define AD717x_ODR_SEL 4
357#define CONSOLE_STDIO_PORT_AVAILABLE
360#if defined(DEV_AD4111) || defined(DEV_AD4112) || \
361 defined(DEV_AD4114) || defined(DEV_AD4115) || defined (DEV_AD4116)
362#define SCALE_FACTOR_DR 0.1
364#define SCALE_FACTOR_DR 1
377extern struct no_os_gpio_desc *
csb_gpio;
379extern 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:170
struct no_os_gpio_desc * csb_gpio
Definition app_config.c:51
struct no_os_gpio_desc * rdy_gpio
Definition app_config.c:54
The file contain common macros that needs to be followed same across all the projects.
Header file for STM32 platform configurations.