Example program for AD717x and AD411x family of products.

Dependencies:   adi_console_menu platform_drivers

Committer:
Kjansen
Date:
Tue Aug 03 12:23:16 2021 +0100
Revision:
8:2e0e9b520392
Parent:
4:4592cc69bfa6
No-OS Adoption Changes:
* Updated the .lib files for adoption of no-OS repository as-is.
* Replaced platform_drivers.h with required header files.
* Updated the copyright year.

Mbed OS update changes:
1) Added the mbed_app.json file with custom parameters.
2) Updated the mbed-os version to 6.8.0

Updated the readme file.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mahphalke 1:48914f9593f1 1 /*!
mahphalke 1:48914f9593f1 2 *****************************************************************************
mahphalke 1:48914f9593f1 3 @file: ad717x_console_app.h
mahphalke 1:48914f9593f1 4
mahphalke 1:48914f9593f1 5 @brief: Header for AD717x/AD411x console application interface.
mahphalke 1:48914f9593f1 6
mahphalke 1:48914f9593f1 7 @details:
mahphalke 1:48914f9593f1 8 -----------------------------------------------------------------------------
mahphalke 1:48914f9593f1 9 Copyright (c) 2020 Analog Devices, Inc.
mahphalke 1:48914f9593f1 10 All rights reserved.
mahphalke 1:48914f9593f1 11
mahphalke 1:48914f9593f1 12 This software is proprietary to Analog Devices, Inc. and its licensors.
mahphalke 1:48914f9593f1 13 By using this software you agree to the terms of the associated
mahphalke 1:48914f9593f1 14 Analog Devices Software License Agreement.
mahphalke 1:48914f9593f1 15 *****************************************************************************/
mahphalke 1:48914f9593f1 16
mahphalke 1:48914f9593f1 17 #ifndef AD717X_CONSOLE_APP_H_
mahphalke 1:48914f9593f1 18 #define AD717X_CONSOLE_APP_H_
mahphalke 1:48914f9593f1 19
mahphalke 1:48914f9593f1 20 /******************************************************************************/
mahphalke 1:48914f9593f1 21 /***************************** Include Files **********************************/
mahphalke 1:48914f9593f1 22 /******************************************************************************/
mahphalke 1:48914f9593f1 23
mahphalke 1:48914f9593f1 24 #include "adi_console_menu.h"
mahphalke 1:48914f9593f1 25 #include "app_config.h"
mahphalke 1:48914f9593f1 26
mahphalke 1:48914f9593f1 27 /******************************************************************************/
mahphalke 1:48914f9593f1 28 /********************** Macros and Constants Definitions **********************/
mahphalke 1:48914f9593f1 29 /******************************************************************************/
mahphalke 1:48914f9593f1 30
mahphalke 1:48914f9593f1 31 #define ADC_REF_VOLTAGE 2.5 // in volts
mahphalke 1:48914f9593f1 32
mahphalke 1:48914f9593f1 33 #if defined(DEV_AD7177_2)
mahphalke 1:48914f9593f1 34 #define ADC_RESOLUTION 32 // in bits
mahphalke 1:48914f9593f1 35 #else
mahphalke 1:48914f9593f1 36 #define ADC_RESOLUTION 24 // in bits
mahphalke 1:48914f9593f1 37 #endif
mahphalke 1:48914f9593f1 38
mahphalke 1:48914f9593f1 39
mahphalke 1:48914f9593f1 40 // Define the number of channels for selected device
mahphalke 1:48914f9593f1 41 #if defined(DEV_AD4111) || defined(DEV_AD4112) || \
Mahesh Phalke 4:4592cc69bfa6 42 defined(DEV_AD4114) || defined(DEV_AD4115) || \
mahphalke 1:48914f9593f1 43 defined(DEV_AD7173_8) || defined(DEV_AD7175_8)
mahphalke 1:48914f9593f1 44 #define NUMBER_OF_CHANNELS 16U
mahphalke 1:48914f9593f1 45 #elif defined(DEV_AD7172_4)
mahphalke 1:48914f9593f1 46 #define NUMBER_OF_CHANNELS 8U
mahphalke 1:48914f9593f1 47 #else
mahphalke 1:48914f9593f1 48 #define NUMBER_OF_CHANNELS 4U
mahphalke 1:48914f9593f1 49 #endif
mahphalke 1:48914f9593f1 50
mahphalke 1:48914f9593f1 51
mahphalke 1:48914f9593f1 52 // Define the number of setups for selected device
mahphalke 1:48914f9593f1 53 #if defined(DEV_AD4111) || defined(DEV_AD4112) || \
Mahesh Phalke 4:4592cc69bfa6 54 defined(DEV_AD4114) || defined(DEV_AD4115) || \
mahphalke 1:48914f9593f1 55 defined(DEV_AD7173_8) || defined(DEV_AD7172_4) || \
mahphalke 1:48914f9593f1 56 defined(DEV_AD7175_8)
mahphalke 1:48914f9593f1 57 #define NUMBER_OF_SETUPS 8U
mahphalke 1:48914f9593f1 58 #else
mahphalke 1:48914f9593f1 59 #define NUMBER_OF_SETUPS 4U
mahphalke 1:48914f9593f1 60 #endif
mahphalke 1:48914f9593f1 61
mahphalke 1:48914f9593f1 62 /******************************************************************************/
mahphalke 1:48914f9593f1 63 /********************** Variables and User Defined Data Types *****************/
mahphalke 1:48914f9593f1 64 /******************************************************************************/
mahphalke 1:48914f9593f1 65
mahphalke 1:48914f9593f1 66 extern console_menu ad717x_main_menu;
mahphalke 1:48914f9593f1 67
mahphalke 1:48914f9593f1 68 /* AD717x Setup Configuration Structure */
mahphalke 1:48914f9593f1 69 typedef struct {
mahphalke 1:48914f9593f1 70 uint32_t setup; // Selected setup
mahphalke 1:48914f9593f1 71 uint32_t filter; // Filter type
mahphalke 1:48914f9593f1 72 uint32_t postfilter; // Post filter type for SINC5+1 Filter
mahphalke 1:48914f9593f1 73 uint32_t post_filter_enabled; // Post filter enable status
mahphalke 1:48914f9593f1 74 uint32_t odr_bits; // Output data rate register bits
mahphalke 1:48914f9593f1 75 uint32_t polarity; // Bipolar or Unipolar analog input
mahphalke 1:48914f9593f1 76 uint32_t reference; // Reference source for ADC
mahphalke 1:48914f9593f1 77 uint32_t input_buffers; // Buffers on analog inputs
mahphalke 1:48914f9593f1 78 uint32_t reference_buffers; // Buffers on reference source
mahphalke 1:48914f9593f1 79 uint32_t pos_analog_input; // Positive analog input
mahphalke 1:48914f9593f1 80 uint32_t neg_analog_input; // Negative analog input
mahphalke 1:48914f9593f1 81 uint32_t channel_enabled; // Channel Enable/Disable flag
mahphalke 1:48914f9593f1 82 uint32_t setup_assigned; // Setup assigned to a channel
mahphalke 1:48914f9593f1 83 } ad717x_setup_config;
mahphalke 1:48914f9593f1 84
mahphalke 1:48914f9593f1 85 /******************************************************************************/
mahphalke 1:48914f9593f1 86 /************************ Public Declarations *********************************/
mahphalke 1:48914f9593f1 87 /******************************************************************************/
mahphalke 1:48914f9593f1 88
mahphalke 1:48914f9593f1 89 int32_t ad717x_app_initialize(void);
mahphalke 1:48914f9593f1 90
mahphalke 1:48914f9593f1 91 #endif /* AD717X_CONSOLE_APP_H_ */