precision-converters-firmware
Loading...
Searching...
No Matches
app_config.h
Go to the documentation of this file.
1/*************************************************************************/
13#ifndef APP_CONFIG_H
14#define APP_CONFIG_H
15
16/******************************************************************************/
17/***************************** Include Files **********************************/
18/******************************************************************************/
19#include <stdint.h>
20#include "no_os_pwm.h"
21#include "common_macros.h"
22
23/******************************************************************************/
24/********************** Macros and Constants Definition ***********************/
25/******************************************************************************/
26/* List of data capture modes for ad559xr device */
27#define CONTINUOUS_DATA_CAPTURE 0
28#define BURST_DATA_CAPTURE 1
29
30/* Select the active platform (default is STM32) */
31#if !defined(ACTIVE_PLATFORM)
32#define ACTIVE_PLATFORM STM32_PLATFORM
33#endif
34
35/* Select the ADC data capture mode
36 * Note: Only Burst data Capture is supported for AD5593R */
37#if !defined(DATA_CAPTURE_MODE)
38#define DATA_CAPTURE_MODE BURST_DATA_CAPTURE
39#endif
40
41/* Macros for stringification */
42#define XSTR(s) #s
43#define STR(s) XSTR(s)
44
45#if (ACTIVE_PLATFORM == STM32_PLATFORM)
46#include "app_config_stm32.h"
47#define CONSOLE_STDIO_PORT_AVAILABLE
48#else
49#error "No/Invalid active platform selected"
50#endif
51
52/* Hardware Mezzanine name for the interposer board */
53#define HW_MEZZANINE_NAME "PMD-ARD-INT-LCZ"
54
55/* ADC Resolution */
56#define ADC_RESOLUTION 12
57
58/* ADC max count (full scale value) for unipolar inputs */
59#define ADC_MAX_COUNT_UNIPOLAR (uint32_t)((1 << ADC_RESOLUTION) - 1)
60
61/* ADC max count (full scale value) for bipolar inputs */
62#define ADC_MAX_COUNT_BIPOLAR (uint32_t)(1 << (ADC_RESOLUTION-1))
63
64#define DEFAULT_VREF 2.5
65#define ADC_MAX_COUNT (uint32_t)(1<<ADC_RESOLUTION)
66
67/* Additional bit macros */
68#define BYTES_PER_SAMPLE 2
69#define STORAGE_BITS (BYTES_PER_SAMPLE) * 8
70
71/* Baud rate for IIO application UART interface */
72#define IIO_UART_BAUD_RATE (230400)
73
74/* Used to form a VCOM serial number */
75#define FIRMWARE_NAME "ad559xr_iio"
76
77/****** Macros used to form a VCOM serial number ******/
78#if !defined(PLATFORM_NAME)
79#define PLATFORM_NAME HW_CARRIER_NAME
80#endif
81
82//#define SYSTEM_CONFIG_DISABLED // Uncomment this to disable system config
83#if !defined(SYSTEM_CONFIG_DISABLED)
84#define SYSTEM_CONFIG_ENABLED
85#else
86/* Change the device name here
87 * to either AD5592R or AD5593R */
88#define ACTIVE_DEVICE_NAME AD5593R
89#endif
90
91/* Enable the UART/VirtualCOM port connection (default VCOM) */
92//#define USE_PHY_COM_PORT // Uncomment to select UART
93
94#if !defined(USE_PHY_COM_PORT)
95#define USE_VIRTUAL_COM_PORT
96#endif
97
98/* Uncomment this if you want to enable only the GPIO Subsytem */
99//#define ONLY_GPIO_SUBSYSTEM
100
101/* Enable/Disable the use of SDRAM for ADC data capture buffer */
102//#define USE_SDRAM // Uncomment to use SDRAM as data buffer
103
104/* Slave Address for AD5593R */
105#define AD5593R_A0_STATE 0
106#define AD5593R_I2C(x) (0x10 | (x & 0x01))
107
108/******************************************************************************/
109/********************** Variables and User Defined Data Types *****************/
110/******************************************************************************/
111
112/******************************************************************************/
113/************************ Public Declarations *********************************/
114/******************************************************************************/
115extern struct no_os_uart_desc *uart_desc;
116extern struct no_os_eeprom_desc *eeprom_desc;
117extern struct no_os_pwm_desc *pwm_desc;
118extern struct no_os_uart_desc *uart_console_stdio_desc;
119int32_t init_system(void);
120int32_t ad559xr_trigger_handler(struct iio_device_data *iio_dev_data);
121
122#endif //APP_CONFIG_H
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_pwm_desc * pwm_desc
Definition app_config.c:106
struct no_os_uart_desc * uart_console_stdio_desc
Definition app_config.c:100
int32_t ad559xr_trigger_handler(struct iio_device_data *iio_dev_data)
Push data into IIO buffer when trigger handler IRQ is invoked.
Definition ad559xr_iio.c:1536
The file contain common macros that needs to be followed same across all the projects.
Header file for STM32 platform configurations.