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