Analog Devices / Mbed OS EVAL-AD4696

Dependencies:   platform_drivers

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers app_config.h Source File

app_config.h

Go to the documentation of this file.
00001 /*************************************************************************//**
00002  *   @file   app_config.h
00003  *   @brief  Configuration file for AD4696 device applications
00004 ******************************************************************************
00005 * Copyright (c) 2021 Analog Devices, Inc.
00006 *
00007 * All rights reserved.
00008 *
00009 * This software is proprietary to Analog Devices, Inc. and its licensors.
00010 * By using this software you agree to the terms of the associated
00011 * Analog Devices Software License Agreement.
00012 *****************************************************************************/
00013 
00014 #ifndef APP_CONFIG_H
00015 #define APP_CONFIG_H
00016 
00017 /******************************************************************************/
00018 /***************************** Include Files **********************************/
00019 /******************************************************************************/
00020 
00021 #include <stdint.h>
00022 
00023 /******************************************************************************/
00024 /********************** Macros and Constants Definition ***********************/
00025 /******************************************************************************/
00026 
00027 /* List of supported platforms*/
00028 #define MBED_PLATFORM       1
00029 
00030 /* Select the active platform */
00031 #define ACTIVE_PLATFORM     MBED_PLATFORM
00032 
00033 #if (ACTIVE_PLATFORM == MBED_PLATFORM)
00034 #include "app_config_mbed.h"
00035 
00036 /* Used to form a VCOM serial number */
00037 #define FIRMWARE_NAME   "ad4696_mbed_iio_application"
00038 
00039 /* Redefine the init params structure mapping w.r.t. platform */
00040 #define bsy_gpio_extra_init_params mbed_gpio_bsy_extra_init_params
00041 #define ext_int_extra_init_params mbed_ext_int_extra_init_params
00042 #define uart_extra_init_params mbed_uart_extra_init_params
00043 #define spi_extra_init_params mbed_spi_extra_init_params
00044 #else
00045 #error "No/Invalid active platform selected"
00046 #endif
00047 
00048 // **** Note for User: ACTIVE_DEVICE selection **** //
00049 /* Define the device type here from the list of below device type defines
00050  * (one at a time. Defining more than one device can result into compile error).
00051  * e.g. #define DEV_AD4696 -> This will make AD4696 as an ACTIVE_DEVICE.
00052  * The ACTIVE_DEVICE is default set to AD4696 if device type is not defined.
00053  * */
00054 
00055 //#define DEV_AD4696
00056 
00057 #if defined(DEV_AD4696)
00058 #define ACTIVE_DEVICE       ID_AD4696
00059 #define ACTIVE_DEVICE_NAME  "AD4696"
00060 #elif defined(DEV_AD4695)
00061 #define ACTIVE_DEVICE       ID_AD4695
00062 #define ACTIVE_DEVICE_NAME  "AD4695"
00063 #else
00064 #warning No/Unsupported ADxxxxy symbol defined. AD4696 defined
00065 #define DEV_AD4696
00066 #define ACTIVE_DEVICE       ID_AD4696
00067 #define ACTIVE_DEVICE_NAME  "AD4696"
00068 #endif
00069 
00070 #if defined(DEV_AD4696)
00071 #define NO_OF_CHANNELS      16
00072 #define ADC_RESOLUTION      16
00073 #elif defined(DEV_AD4695)
00074 #define NO_OF_CHANNELS      16
00075 #define ADC_RESOLUTION      16
00076 #else
00077 /* Default config for AD4696 */
00078 #define NO_OF_CHANNELS      16
00079 #define ADC_RESOLUTION      16
00080 #endif
00081 
00082 // **** Note for User: Polarity Mode selection **** //
00083 /* Since the pin pairing option is same for all the channels in
00084  * standard sequencer mode, hence polarity mode for all the 
00085  * channels is also kept same to avoid stale ADC output codes. 
00086  * Make sure to change the JP6 jumper position on the Eval board to A 
00087  * to use the PSEUDO_BIPOLAR_MODE. 
00088  * 
00089  * Select Pseudo bipolar mode (default is unipolar mode) for all the channels.
00090  * e.g. #define PSEUDO_BIPOLAR_MODE -> This will enable the PSEUDO_BIPOLAR_MODE 
00091  * for all the channels. 
00092  * */
00093  
00094 //#define PSEUDO_BIPOLAR_MODE
00095 
00096 /* Pins to be used an interrupt to trigger callback function */
00097 #define EXT_TRIGGER_PIN     CONVST_PIN
00098 
00099 /* ADC max count (full scale value) for unipolar inputs */
00100 #define ADC_MAX_COUNT_UNIPOLAR  (uint32_t)((1 << ADC_RESOLUTION) - 1)
00101 
00102 /* ADC max count (full scale value) for bipolar inputs */
00103 #define ADC_MAX_COUNT_BIPOLAR   (uint32_t)(1 << (ADC_RESOLUTION-1))
00104 
00105 /* Baud rate for IIO application UART interface */
00106 #define IIO_UART_BAUD_RATE  (230400)
00107 
00108 /****** Macros used to form a VCOM serial number ******/
00109 #if !defined(DEVICE_NAME)
00110 #define DEVICE_NAME     "DEV_AD4696"
00111 #endif
00112 
00113 #if !defined(PLATFORM_NAME)
00114 #define PLATFORM_NAME   "SDP_K1"
00115 #endif
00116 /******/
00117 
00118 /* Enable the VirtualCOM port connection/interface. By default serial communication
00119  * is physical UART */
00120 //#define USE_VIRTUAL_COM_PORT
00121 
00122 #if defined(USE_VIRTUAL_COM_PORT)
00123 /* Below USB configurations (VID and PID) are owned and assigned by ADI.
00124  * If intended to distribute software further, use the VID and PID owned by your
00125  * organization */
00126 #define VIRTUAL_COM_PORT_VID    0x0456
00127 #define VIRTUAL_COM_PORT_PID    0xb66c
00128 /* Serial number string is formed as: application name + device (target) name + platform (host) name */
00129 #define VIRTUAL_COM_SERIAL_NUM  (FIRMWARE_NAME "_" DEVICE_NAME "_" PLATFORM_NAME)
00130 #endif
00131 
00132 /******************************************************************************/
00133 /********************** Variables and User Defined Data Types *****************/
00134 /******************************************************************************/
00135 
00136 /******************************************************************************/
00137 /************************ Public Declarations *********************************/
00138 /******************************************************************************/
00139 
00140 /* UART init parameters structure */
00141 extern struct uart_init_param uart_init_params;
00142 
00143 /* PWM descriptor */
00144 extern struct pwm_desc *pwm_desc;
00145 
00146 /* Initializing system peripherals */
00147 int32_t init_system(void);
00148 
00149 #endif //APP_CONFIG_H