precision-converters-firmware
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 HW_CARRIER_NAME NUCLEO-H563ZI
67 
68 #define uart_extra_init_params stm32_uart_extra_init_params
69 #define i2c_extra_init_params stm32_i2c_extra_init_params
70 #define i2c_ops stm32_i2c_ops
71 #define uart_ops stm32_uart_ops
72 #else
73 #error "No/Invalid active platform selected"
74 #endif
75 
76 /****** Macros used to form a VCOM serial number ******/
77 #define FIRMWARE_NAME "evb_discovery_firmware"
78 
79 #if !defined(PLATFORM_NAME)
80 #define PLATFORM_NAME HW_CARRIER_NAME
81 #endif
82 
83 /* Below USB configurations (VID and PID) are owned and assigned by ADI.
84  * If intended to distribute software further, use the VID and PID owned by your
85  * organization */
86 #define VIRTUAL_COM_PORT_VID 0x0456
87 #define VIRTUAL_COM_PORT_PID 0xb66c
88 /* Serial number string is formed as: application name + platform (host) name */
89 #define VIRTUAL_COM_SERIAL_NUM (FIRMWARE_NAME "_" STR(PLATFORM_NAME))
90 
91 /* Default baud rate for IIO UART interface */
92 #define IIO_UART_BAUD_RATE (230400)
93 
94 /* Uncomment to enable the EEPROM IIO device */
95 //#define ENABLE_EVB_EEPROM_IIO_DEV
96 
97 /******************************************************************************/
98 /********************** Public/Extern Declarations ****************************/
99 /******************************************************************************/
100 
101 extern struct no_os_uart_desc *uart_desc;
102 extern struct no_os_eeprom_desc *eeprom_desc;
103 
104 int32_t init_system(void);
105 
106 #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:194
Header file for Mbed platform configurations.