precision-converters-firmware
Loading...
Searching...
No Matches
app_config.h
Go to the documentation of this file.
1/*************************************************************************/
14#ifndef APP_CONFIG_H
15#define APP_CONFIG_H
16
17/******************************************************************************/
18/***************************** Include Files **********************************/
19/******************************************************************************/
20#include <stdint.h>
21#include <common_macros.h>
22#include "no_os_gpio.h"
23
24/******************************************************************************/
25/********************** Macros and Constants Definition ***********************/
26/******************************************************************************/
27
28/* List of data capture modes for AD717x device */
29#define CONTINUOUS_DATA_CAPTURE 0
30#define BURST_DATA_CAPTURE 1
31
32/* List of board interface for AD717x device */
33#define SDP_120_INTERFACE 0
34#define ARDUINO_INTERFACE 1
35
36/* Macros for stringification */
37#define XSTR(s) #s
38#define STR(s) XSTR(s)
39
40/* Select the interface mode (default is SDP_120 interface) */
41#if !defined(EVB_INTERFACE)
42#define EVB_INTERFACE ARDUINO_INTERFACE
43#endif
44
45/* Select the active platform */
46#if !defined(ACTIVE_PLATFORM)
47#define ACTIVE_PLATFORM STM32_PLATFORM
48#endif // ACTIVE_PLATFORM
49
50/* Enable the UART/VirtualCOM port connection (default VCOM) */
51//#define USE_PHY_COM_PORT // Uncomment to select UART
52
53#if !defined(USE_PHY_COM_PORT)
54#define USE_VIRTUAL_COM_PORT
55#endif
56
57/* Enable register map support for AD717x family devices.
58 * AD411x devices do not require these macros. */
59#define AD7172_2_INIT
60#define AD7172_4_INIT
61#define AD7173_8_INIT
62#define AD7175_2_INIT
63#define AD7175_8_INIT
64#define AD7176_2_INIT
65#define AD7177_2_INIT
66
67#if (ACTIVE_PLATFORM == STM32_PLATFORM)
68#include "app_config_stm32.h"
69#define HW_CARRIER_NAME TARGET_NAME
70/* Redefine the init params structure mapping w.r.t. platform */
71#define uart_extra_init_params stm32_uart_extra_init_params
72#define spi_extra_init_params stm32_spi_extra_init_params
73#define vcom_extra_init_params stm32_vcom_extra_init_params
74#define uart_extra_init_params stm32_uart_extra_init_params
75#define ext_int_extra_init_params stm32_trigger_gpio_irq_init_params
76#define uart_ops stm32_uart_ops
77#define vcom_ops stm32_usb_uart_ops
78#define irq_platform_ops stm32_gpio_irq_ops
79#define csb_platform_ops stm32_gpio_ops
80#define rdy_platform_ops stm32_gpio_ops
81#define spi_platform_ops stm32_spi_ops
82#define irq_ops stm32_irq_ops
83#define i2c_ops stm32_i2c_ops
84#define trigger_gpio_irq_ops stm32_gpio_irq_ops
85#define trigger_gpio_handle 0 // Unused macro
86#define IRQ_INT_ID RDY_PIN
87#else
88#error "No/Invalid active platform selected"
89#endif
90
91/* VCOM Serial number definition */
92#define FIRMWARE_NAME "ad717x_iio"
93
94#if !defined(PLATFORM_NAME)
95#define PLATFORM_NAME HW_CARRIER_NAME
96#endif
97
98/* Select the ADC data capture mode (default is CC mode) */
99#if !defined(DATA_CAPTURE_MODE)
100#define DATA_CAPTURE_MODE CONTINUOUS_DATA_CAPTURE
101#endif
102
103/* Enable/Disable the use of SDRAM for ADC data capture buffer */
104//#define USE_SDRAM // Uncomment to use SDRAM for data buffer
105
106/* ADC Reference Voltage in volts */
107#define AD717X_INTERNAL_REFERENCE 2.5
108#define AD717x_EXTERNAL_REFERENCE 2.5
109#define AD717X_AVDD_AVSS_REFERENCE 2.5
110
111/* Baud Rate for IIO Application */
112#define IIO_UART_BAUD_RATE (230400)
113
114#define CONSOLE_STDIO_PORT_AVAILABLE
115
116/******************************************************************************/
117/********************** Variables and User Defined Data Types *****************/
118/******************************************************************************/
119
120/******************************************************************************/
121/************************ Public Declarations *********************************/
122/******************************************************************************/
123
124extern struct no_os_uart_desc *uart_desc;
125
126extern struct no_os_gpio_desc *csb_gpio;
127
128extern struct no_os_gpio_desc *rdy_gpio;
129
130extern struct no_os_irq_ctrl_desc *trigger_irq_desc;
131
132extern struct no_os_eeprom_desc *eeprom_desc;
133
134extern struct no_os_uart_desc *uart_console_stdio_desc;
135
136int32_t init_system(void);
137
138#endif // APP_CONFIG_H
139
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:172
struct no_os_uart_desc * uart_console_stdio_desc
Definition app_config.c:100
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.