precision-converters-firmware
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
app_config.h
Go to the documentation of this file.
1/***************************************************************************//*
2 * @file app_config.h
3 * @brief Header file for application configurations (platform-agnostic)
4******************************************************************************
5 * Copyright (c) 2022-24 Analog Devices, Inc.
6 * All rights reserved.
7 *
8 * This software is proprietary to Analog Devices, Inc. and its licensors.
9 * By using this software you agree to the terms of the associated
10 * Analog Devices Software License Agreement.
11******************************************************************************/
12
13#ifndef _APP_CONFIG_H_
14#define _APP_CONFIG_H_
15
16/******************************************************************************/
17/***************************** Include Files **********************************/
18/******************************************************************************/
19
20#include <stdint.h>
21
22/******************************************************************************/
23/********************** Macros and Constants Definition ***********************/
24/******************************************************************************/
25
26/* List of supported platforms */
27#define MBED_PLATFORM 1
28#define STM32_PLATFORM 2
29
30/* Macros for stringification */
31#define XSTR(s) #s
32#define STR(s) XSTR(s)
33
34/******************************************************************************/
35
36/* Select the active platform (default is Mbed) */
37#if !defined(ACTIVE_PLATFORM)
38#define ACTIVE_PLATFORM MBED_PLATFORM
39#endif
40
41/* Enable the UART/VirtualCOM port connection (default VCOM) */
42//#define USE_PHY_COM_PORT // Uncomment to select UART
43
44#if !defined(USE_PHY_COM_PORT)
45#define USE_VIRTUAL_COM_PORT
46#endif
47
48#if (ACTIVE_PLATFORM == MBED_PLATFORM)
49#include "app_config_mbed.h"
50
51#define HW_CARRIER_NAME TARGET_NAME
52
53/* Redefine the init params structure mapping w.r.t. platform */
54#if defined(USE_VIRTUAL_COM_PORT)
55#define uart_extra_init_params mbed_vcom_extra_init_params
56#define uart_ops mbed_virtual_com_ops
57#else
58#define uart_extra_init_params mbed_uart_extra_init_params
59#define uart_ops mbed_uart_ops
60#endif
61#define i2c_extra_init_params mbed_i2c_extra_init_params
62#define i2c_ops mbed_i2c_ops
63#elif (ACTIVE_PLATFORM == STM32_PLATFORM)
64#include "app_config_stm32.h"
65
66#define uart_extra_init_params stm32_uart_extra_init_params
67#define i2c_extra_init_params stm32_i2c_extra_init_params
68#define i2c_ops stm32_i2c_ops
69#define uart_ops stm32_uart_ops
70#else
71#error "No/Invalid active platform selected"
72#endif
73
74/****** Macros used to form a VCOM serial number ******/
75#define FIRMWARE_NAME "evb_discovery_firmware"
76
77#if !defined(PLATFORM_NAME)
78#define PLATFORM_NAME HW_CARRIER_NAME
79#endif
80
81/* Below USB configurations (VID and PID) are owned and assigned by ADI.
82 * If intended to distribute software further, use the VID and PID owned by your
83 * organization */
84#define VIRTUAL_COM_PORT_VID 0x0456
85#define VIRTUAL_COM_PORT_PID 0xb66c
86/* Serial number string is formed as: application name + platform (host) name */
87#define VIRTUAL_COM_SERIAL_NUM (FIRMWARE_NAME "_" STR(PLATFORM_NAME))
88
89/* Default baud rate for IIO UART interface */
90#define IIO_UART_BAUD_RATE (230400)
91
92/* Uncomment to enable the EEPROM IIO device */
93//#define ENABLE_EVB_EEPROM_IIO_DEV
94
95/******************************************************************************/
96/********************** Public/Extern Declarations ****************************/
97/******************************************************************************/
98
99extern struct no_os_uart_desc *uart_desc;
100extern struct no_os_eeprom_desc *eeprom_desc;
101
102int32_t init_system(void);
103
104#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:176
Header file for Mbed platform configurations.