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:
6:28e40a21857f
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_menu_defines_app.h
mahphalke 1:48914f9593f1 4
mahphalke 1:48914f9593f1 5 @brief: Header for AD717x/AD411x console menu definitions.
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_MENU_DEFINES_H_
mahphalke 1:48914f9593f1 18 #define AD717X_MENU_DEFINES_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
mahphalke 1:48914f9593f1 26 /******************************************************************************/
mahphalke 1:48914f9593f1 27 /********************** Macros and Constants Definitions **********************/
mahphalke 1:48914f9593f1 28 /******************************************************************************/
mahphalke 1:48914f9593f1 29
mahphalke 1:48914f9593f1 30 // Prototypes for the console menu functions defined in ad717x_console_app.c file
mahphalke 1:48914f9593f1 31 void display_main_menu_header(void);
mahphalke 1:48914f9593f1 32 int32_t menu_read_id(uint32_t menu_id);
mahphalke 1:48914f9593f1 33 int32_t menu_read_status(uint32_t menu_id);
mahphalke 1:48914f9593f1 34 int32_t menu_sample_channels(uint32_t menu_id);
mahphalke 1:48914f9593f1 35 int32_t menu_chn_enable_disable_display(uint32_t menu_id);
mahphalke 1:48914f9593f1 36 int32_t menu_input_chn_connect_display(uint32_t menu_id);
mahphalke 1:48914f9593f1 37 int32_t menu_config_and_assign_setup(uint32_t menu_id);
mahphalke 1:48914f9593f1 38 int32_t menu_display_setup(uint32_t menu_id);
mahphalke 1:48914f9593f1 39 int32_t menu_read_temperature(uint32_t menu_id);
mahphalke 1:48914f9593f1 40 int32_t menu_calibrate_adc(uint32_t menu_id);
mahphalke 1:48914f9593f1 41 int32_t menu_read_write_device_regs(uint32_t menu_id);
mahphalke 1:48914f9593f1 42 int32_t menu_channels_enable_disable(uint32_t action);
mahphalke 1:48914f9593f1 43 int32_t menu_analog_input_connect(uint32_t user_analog_input);
mahphalke 3:6c7324997606 44 int32_t menu_input_type_selection(uint32_t input_type_id);
mahphalke 3:6c7324997606 45 int32_t menu_select_chn_pair(uint32_t user_channel_pair);
mahphalke 3:6c7324997606 46 int32_t menu_select_input_pair(uint32_t user_input_pair);
mahphalke 3:6c7324997606 47 int32_t menu_open_wire_detection(uint32_t menu_id);
mahphalke 1:48914f9593f1 48 int32_t menu_rw_ad717x_register(uint32_t rw_id);
mahphalke 1:48914f9593f1 49 int32_t menu_single_conversion(uint32_t channel_id);
mahphalke 1:48914f9593f1 50 int32_t menu_continuous_conversion_tabular(uint32_t channel_id);
mahphalke 1:48914f9593f1 51 int32_t menu_continuous_conversion_stream(uint32_t channel_id);
mahphalke 1:48914f9593f1 52 int32_t menu_filter_select(uint32_t user_input_filter_type);
mahphalke 1:48914f9593f1 53 int32_t menu_postfiler_enable_disable(uint32_t user_action);
mahphalke 1:48914f9593f1 54 int32_t menu_postfiler_select(uint32_t user_input_post_filter_type);
mahphalke 1:48914f9593f1 55 int32_t menu_odr_select(uint32_t user_input_odr_val);
mahphalke 1:48914f9593f1 56 int32_t menu_polarity_select(uint32_t user_input_polarity);
mahphalke 1:48914f9593f1 57 int32_t menu_reference_source_select(uint32_t user_input_reference);
mahphalke 3:6c7324997606 58 int32_t menu_ref_buffer_enable_disable(uint32_t user_action);
mahphalke 1:48914f9593f1 59 int32_t menu_input_buffer_enable_disable(uint32_t user_action);
mahphalke 1:48914f9593f1 60
mahphalke 1:48914f9593f1 61
mahphalke 1:48914f9593f1 62 // Define the standard ODR values for the AD717x/AD414x devices
mahphalke 1:48914f9593f1 63 // ODRx value, ODRx string name and ODRx bits
mahphalke 1:48914f9593f1 64
mahphalke 1:48914f9593f1 65 #define ODR_250000 250000.00
mahphalke 1:48914f9593f1 66 #define ODR_250000_STR "250000.00"
mahphalke 1:48914f9593f1 67 #define ODR_250000_BITS 0x00
mahphalke 1:48914f9593f1 68
mahphalke 1:48914f9593f1 69 #define ODR_125000 125000.00
mahphalke 1:48914f9593f1 70 #define ODR_125000_STR "125000.00"
mahphalke 1:48914f9593f1 71 #define ODR_125000_BITS 0x01
mahphalke 1:48914f9593f1 72
mahphalke 1:48914f9593f1 73 #define ODR_62500 62500.00
mahphalke 1:48914f9593f1 74 #define ODR_62500_STR "62500.00"
mahphalke 1:48914f9593f1 75 #define ODR_62500_BITS 0x02
mahphalke 1:48914f9593f1 76
mahphalke 1:48914f9593f1 77 #define ODR_50000 50000.00
mahphalke 1:48914f9593f1 78 #define ODR_50000_STR "50000.00"
mahphalke 1:48914f9593f1 79 #define ODR_50000_BITS 0x03
mahphalke 1:48914f9593f1 80
mahphalke 1:48914f9593f1 81 #define ODR_31250 31250.00
mahphalke 1:48914f9593f1 82 #define ODR_31250_STR "31250.00"
mahphalke 1:48914f9593f1 83 #define ODR_31250_BITS 0x04
mahphalke 1:48914f9593f1 84
mahphalke 1:48914f9593f1 85 #define ODR_25000 25000.00
mahphalke 1:48914f9593f1 86 #define ODR_25000_STR "25000.00"
mahphalke 1:48914f9593f1 87 #define ODR_25000_BITS 0x05
mahphalke 1:48914f9593f1 88
mahphalke 1:48914f9593f1 89 #define ODR_15625 15625.00
mahphalke 1:48914f9593f1 90 #define ODR_15625_STR "15625.00"
mahphalke 1:48914f9593f1 91 #define ODR_15625_BITS 0x06
mahphalke 1:48914f9593f1 92
mahphalke 1:48914f9593f1 93 #define ODR_10417 10417.00
mahphalke 1:48914f9593f1 94 #define ODR_10417_STR "10417.00"
mahphalke 1:48914f9593f1 95 #define ODR_10417_BITS 0x07
mahphalke 1:48914f9593f1 96
mahphalke 1:48914f9593f1 97 #define ODR_10000 10000.00
mahphalke 1:48914f9593f1 98 #define ODR_10000_STR "10000.00"
mahphalke 1:48914f9593f1 99 #define ODR_10000_BITS 0x07
mahphalke 1:48914f9593f1 100
mahphalke 1:48914f9593f1 101 #define ODR_5208 5208.00
mahphalke 1:48914f9593f1 102 #define ODR_5208_STR "5208.00"
mahphalke 1:48914f9593f1 103 #define ODR_5208_BITS 0x08
mahphalke 1:48914f9593f1 104
mahphalke 1:48914f9593f1 105 #define ODR_5000 5000.00
mahphalke 1:48914f9593f1 106 #define ODR_5000_STR "5000.00"
mahphalke 1:48914f9593f1 107 #define ODR_5000_BITS 0x08
mahphalke 1:48914f9593f1 108
mahphalke 1:48914f9593f1 109 #define ODR_3906 3906.00
mahphalke 1:48914f9593f1 110 #define ODR_3906_STR "3906.00"
mahphalke 1:48914f9593f1 111 #define ODR_3906_BITS 0x09
mahphalke 1:48914f9593f1 112
mahphalke 1:48914f9593f1 113 #define ODR_2604 2604.00
mahphalke 1:48914f9593f1 114 #define ODR_2604_STR "2604.00"
mahphalke 1:48914f9593f1 115 #define ODR_2604_BITS 0x09
mahphalke 1:48914f9593f1 116
mahphalke 1:48914f9593f1 117 #define ODR_2597 2597.00
mahphalke 1:48914f9593f1 118 #define ODR_2597_STR "2597.00"
mahphalke 1:48914f9593f1 119 #define ODR_2597_BITS 0x09
mahphalke 1:48914f9593f1 120
mahphalke 1:48914f9593f1 121 #define ODR_2500 2500.00
mahphalke 1:48914f9593f1 122 #define ODR_2500_STR "2500.00"
mahphalke 1:48914f9593f1 123 #define ODR_2500_BITS 0x09
mahphalke 1:48914f9593f1 124
mahphalke 1:48914f9593f1 125 #define ODR_1157 1157.00
mahphalke 1:48914f9593f1 126 #define ODR_1157_STR "1157.00"
mahphalke 1:48914f9593f1 127 #define ODR_1157_BITS 0x0A
mahphalke 1:48914f9593f1 128
mahphalke 1:48914f9593f1 129 #define ODR_1008 1008.00
mahphalke 1:48914f9593f1 130 #define ODR_1008_STR "1008.00"
mahphalke 1:48914f9593f1 131 #define ODR_1008_BITS 0x0A
mahphalke 1:48914f9593f1 132
mahphalke 1:48914f9593f1 133 #define ODR_1007 1007.00
mahphalke 1:48914f9593f1 134 #define ODR_1007_STR "1007.00"
mahphalke 1:48914f9593f1 135 #define ODR_1007_BITS 0x0A
mahphalke 1:48914f9593f1 136
mahphalke 1:48914f9593f1 137 #define ODR_1000 1000.00
mahphalke 1:48914f9593f1 138 #define ODR_1000_STR "1000.00"
mahphalke 1:48914f9593f1 139 #define ODR_1000_BITS 0x0A
mahphalke 1:48914f9593f1 140
mahphalke 1:48914f9593f1 141 #define ODR_539 539.00
mahphalke 1:48914f9593f1 142 #define ODR_539_STR "539.00"
mahphalke 1:48914f9593f1 143 #define ODR_539_BITS 0x0B
mahphalke 1:48914f9593f1 144
mahphalke 1:48914f9593f1 145 #define ODR_504 504.00
mahphalke 1:48914f9593f1 146 #define ODR_504_STR "504.00"
mahphalke 1:48914f9593f1 147 #define ODR_504_BITS 0x0B
mahphalke 1:48914f9593f1 148
mahphalke 1:48914f9593f1 149 #define ODR_503_8 503.80
mahphalke 1:48914f9593f1 150 #define ODR_503_8_STR "503.80"
mahphalke 1:48914f9593f1 151 #define ODR_503_8_BITS 0x0B
mahphalke 1:48914f9593f1 152
mahphalke 1:48914f9593f1 153 #define ODR_500 500.00
mahphalke 1:48914f9593f1 154 #define ODR_500_STR "500.00"
mahphalke 1:48914f9593f1 155 #define ODR_500_BITS 0x0B
mahphalke 1:48914f9593f1 156
mahphalke 1:48914f9593f1 157 #define ODR_401 401.00
mahphalke 1:48914f9593f1 158 #define ODR_401_STR "401.00"
mahphalke 1:48914f9593f1 159 #define ODR_401_BITS 0x0C
mahphalke 1:48914f9593f1 160
mahphalke 1:48914f9593f1 161 #define ODR_400_6 400.60
mahphalke 1:48914f9593f1 162 #define ODR_400_6_STR "400.60"
mahphalke 1:48914f9593f1 163 #define ODR_400_6_BITS 0x0C
mahphalke 1:48914f9593f1 164
mahphalke 1:48914f9593f1 165 #define ODR_400 400.00
mahphalke 1:48914f9593f1 166 #define ODR_400_STR "400.00"
mahphalke 1:48914f9593f1 167 #define ODR_400_BITS 0x0C
mahphalke 1:48914f9593f1 168
mahphalke 1:48914f9593f1 169 #define ODR_397_5 397.50
mahphalke 1:48914f9593f1 170 #define ODR_397_5_STR "397.50"
mahphalke 1:48914f9593f1 171 #define ODR_397_5_BITS 0x0C
mahphalke 1:48914f9593f1 172
mahphalke 1:48914f9593f1 173 #define ODR_397 397.00
mahphalke 1:48914f9593f1 174 #define ODR_397_STR "397.00"
mahphalke 1:48914f9593f1 175 #define ODR_397_BITS 0x0C
mahphalke 1:48914f9593f1 176
mahphalke 1:48914f9593f1 177 #define ODR_381 381.00
mahphalke 1:48914f9593f1 178 #define ODR_381_STR "381.00"
mahphalke 1:48914f9593f1 179 #define ODR_381_BITS 0x0C
mahphalke 1:48914f9593f1 180
mahphalke 1:48914f9593f1 181 #define ODR_206 206.00
mahphalke 1:48914f9593f1 182 #define ODR_206_STR "206.00"
mahphalke 1:48914f9593f1 183 #define ODR_206_BITS 0x0D
mahphalke 1:48914f9593f1 184
mahphalke 1:48914f9593f1 185 #define ODR_200_3 200.3
mahphalke 1:48914f9593f1 186 #define ODR_200_3_STR "200.30"
mahphalke 1:48914f9593f1 187 #define ODR_200_3_BITS 0x0D
mahphalke 1:48914f9593f1 188
mahphalke 1:48914f9593f1 189 #define ODR_200 200.00
mahphalke 1:48914f9593f1 190 #define ODR_200_STR "200.00"
mahphalke 1:48914f9593f1 191 #define ODR_200_BITS 0x0D
mahphalke 1:48914f9593f1 192
mahphalke 1:48914f9593f1 193 #define ODR_102 102.00
mahphalke 1:48914f9593f1 194 #define ODR_102_STR "102.00"
mahphalke 1:48914f9593f1 195 #define ODR_102_BITS 0x0E
mahphalke 1:48914f9593f1 196
mahphalke 1:48914f9593f1 197 #define ODR_100_2 100.20
mahphalke 1:48914f9593f1 198 #define ODR_100_2_STR "100.20"
mahphalke 1:48914f9593f1 199 #define ODR_100_2_BITS 0x0E
mahphalke 1:48914f9593f1 200
mahphalke 1:48914f9593f1 201 #define ODR_100 100.00
mahphalke 1:48914f9593f1 202 #define ODR_100_STR "100.00"
mahphalke 1:48914f9593f1 203 #define ODR_100_BITS 0x0E
mahphalke 1:48914f9593f1 204
mahphalke 1:48914f9593f1 205 #define ODR_60 60.00
mahphalke 1:48914f9593f1 206 #define ODR_60_STR "60.00"
mahphalke 1:48914f9593f1 207 #define ODR_60_BITS 0x0F
mahphalke 1:48914f9593f1 208
mahphalke 1:48914f9593f1 209 #define ODR_59_98 59.98
mahphalke 1:48914f9593f1 210 #define ODR_59_98_STR "59.98"
mahphalke 1:48914f9593f1 211 #define ODR_59_98_BITS 0x0F
mahphalke 1:48914f9593f1 212
mahphalke 1:48914f9593f1 213 #define ODR_59_94 59.94
mahphalke 1:48914f9593f1 214 #define ODR_59_94_STR "59.94"
mahphalke 1:48914f9593f1 215 #define ODR_59_94_BITS 0x0F
mahphalke 1:48914f9593f1 216
mahphalke 1:48914f9593f1 217 #define ODR_59_52 59.52
mahphalke 1:48914f9593f1 218 #define ODR_59_52_STR "59.52"
mahphalke 1:48914f9593f1 219 #define ODR_59_52_BITS 0x0F
mahphalke 1:48914f9593f1 220
mahphalke 1:48914f9593f1 221 #define ODR_50 50.00
mahphalke 1:48914f9593f1 222 #define ODR_50_STR "50.00"
mahphalke 1:48914f9593f1 223 #define ODR_50_BITS 0x10
mahphalke 1:48914f9593f1 224
mahphalke 1:48914f9593f1 225 #define ODR_49_96 49.96
mahphalke 1:48914f9593f1 226 #define ODR_49_96_STR "49.96"
mahphalke 1:48914f9593f1 227 #define ODR_49_96_BITS 0x10
mahphalke 1:48914f9593f1 228
mahphalke 1:48914f9593f1 229 #define ODR_49_68 49.68
mahphalke 1:48914f9593f1 230 #define ODR_49_68_STR "49.68"
mahphalke 1:48914f9593f1 231 #define ODR_49_68_BITS 0x10
mahphalke 1:48914f9593f1 232
mahphalke 1:48914f9593f1 233 #define ODR_20_01 20.01
mahphalke 1:48914f9593f1 234 #define ODR_20_01_STR "20.01"
mahphalke 1:48914f9593f1 235 #define ODR_20_01_BITS 0x11
mahphalke 1:48914f9593f1 236
mahphalke 1:48914f9593f1 237 #define ODR_20 20.00
mahphalke 1:48914f9593f1 238 #define ODR_20_STR "20.00"
mahphalke 1:48914f9593f1 239 #define ODR_20_BITS 0x11
mahphalke 1:48914f9593f1 240
mahphalke 1:48914f9593f1 241 #define ODR_16_63 16.63
mahphalke 1:48914f9593f1 242 #define ODR_16_63_STR "16.63"
mahphalke 1:48914f9593f1 243 #define ODR_16_63_BITS 0x12
mahphalke 1:48914f9593f1 244
mahphalke 1:48914f9593f1 245 #define ODR_16_67 16.67
mahphalke 1:48914f9593f1 246 #define ODR_16_67_STR "16.67"
mahphalke 1:48914f9593f1 247 #define ODR_16_67_BITS 0x12
mahphalke 1:48914f9593f1 248
mahphalke 1:48914f9593f1 249 #define ODR_10 10.00
mahphalke 1:48914f9593f1 250 #define ODR_10_STR "10.00"
mahphalke 1:48914f9593f1 251 #define ODR_10_BITS 0x13
mahphalke 1:48914f9593f1 252
mahphalke 1:48914f9593f1 253 #define ODR_5 5.00
mahphalke 1:48914f9593f1 254 #define ODR_5_STR "5.00"
mahphalke 1:48914f9593f1 255 #define ODR_5_BITS 0x14
mahphalke 1:48914f9593f1 256
mahphalke 1:48914f9593f1 257 #define ODR_2_5 2.50
mahphalke 1:48914f9593f1 258 #define ODR_2_5_STR "2.50"
mahphalke 1:48914f9593f1 259 #define ODR_2_5_BITS 0x15
mahphalke 1:48914f9593f1 260
mahphalke 1:48914f9593f1 261 #define ODR_1_25 1.25
mahphalke 1:48914f9593f1 262 #define ODR_1_25_STR "1.25"
mahphalke 1:48914f9593f1 263 #define ODR_1_25_BITS 0x16
mahphalke 1:48914f9593f1 264
mahphalke 1:48914f9593f1 265 #define ODR_RES_STR "RES"
mahphalke 1:48914f9593f1 266 #define ODR_RES_BITS 0x17
mahphalke 1:48914f9593f1 267
mahphalke 1:48914f9593f1 268
mahphalke 1:48914f9593f1 269 // Analog input bits (0:9) for the AD717x/AD414x devices
mahphalke 1:48914f9593f1 270 #define VIN0_INPUT_BITS 0x00
mahphalke 1:48914f9593f1 271 #define VIN1_INPUT_BITS 0x01
mahphalke 1:48914f9593f1 272 #define VIN2_INPUT_BITS 0x02
mahphalke 1:48914f9593f1 273 #define VIN3_INPUT_BITS 0x03
mahphalke 1:48914f9593f1 274 #define VIN4_INPUT_BITS 0x04
mahphalke 1:48914f9593f1 275 #define VIN5_INPUT_BITS 0x05
mahphalke 1:48914f9593f1 276 #define VIN6_INPUT_BITS 0x06
mahphalke 1:48914f9593f1 277 #define VIN7_INPUT_BITS 0x07
mahphalke 1:48914f9593f1 278 #define VIN8_INPUT_BITS 0x08
mahphalke 1:48914f9593f1 279 #define VIN9_INPUT_BITS 0x09
mahphalke 1:48914f9593f1 280 #define VIN10_INPUT_BITS 0x0A
mahphalke 1:48914f9593f1 281 #define VIN11_INPUT_BITS 0x0B
mahphalke 1:48914f9593f1 282 #define VIN12_INPUT_BITS 0x0C
mahphalke 1:48914f9593f1 283 #define VIN13_INPUT_BITS 0x0D
mahphalke 1:48914f9593f1 284 #define VIN14_INPUT_BITS 0x0E
mahphalke 1:48914f9593f1 285 #define VIN15_INPUT_BITS 0x0F
mahphalke 1:48914f9593f1 286 #define VIN16_INPUT_BITS 0x10
mahphalke 1:48914f9593f1 287 #define VINCOM_INPUT_BITS 0x10
mahphalke 1:48914f9593f1 288 #define IN0N_INPUT_BITS 0x08
mahphalke 1:48914f9593f1 289 #define IN1N_INPUT_BITS 0x09
mahphalke 1:48914f9593f1 290 #define IN2N_INPUT_BITS 0x0A
mahphalke 1:48914f9593f1 291 #define IN3N_INPUT_BITS 0x0B
mahphalke 1:48914f9593f1 292 #define IN3P_INPUT_BITS 0x0C
mahphalke 1:48914f9593f1 293 #define IN2P_INPUT_BITS 0x0D
mahphalke 1:48914f9593f1 294 #define IN1P_INPUT_BITS 0x0E
mahphalke 1:48914f9593f1 295 #define IN0P_INPUT_BITS 0x0F
mahphalke 1:48914f9593f1 296 #define TEMP_SENSOR_POS_INP_BITS 0x11
mahphalke 1:48914f9593f1 297 #define TEMP_SENSOR_NEG_INP_BITS 0x12
mahphalke 1:48914f9593f1 298 #define AVDD1_AVSS_P_BITS 0x13
mahphalke 1:48914f9593f1 299 #define AVDD1_AVSS_N_BITS 0x14
mahphalke 1:48914f9593f1 300 #define REFP_INPUT_BITS 0x15
mahphalke 1:48914f9593f1 301 #define REFN_INPUT_BITS 0x16
mahphalke 1:48914f9593f1 302
mahphalke 1:48914f9593f1 303 // Offset to form VIN+ and VIN- pairs
mahphalke 1:48914f9593f1 304 #define VIN_PAIR_OFFSET 5
mahphalke 1:48914f9593f1 305
mahphalke 1:48914f9593f1 306
mahphalke 3:6c7324997606 307 // Channels define for the AD717x/AD414x devices
mahphalke 3:6c7324997606 308 #define ADC_CHN(x) (x)
mahphalke 3:6c7324997606 309
mahphalke 3:6c7324997606 310 // Offset to form Channel pairs
mahphalke 3:6c7324997606 311 #define CHN_PAIR_OFFSET 4
mahphalke 3:6c7324997606 312 #define CHN_PAIR_MASK 0x0F
mahphalke 3:6c7324997606 313
mahphalke 3:6c7324997606 314
mahphalke 1:48914f9593f1 315 // Device register read/write identifiers
mahphalke 1:48914f9593f1 316 #define DEVICE_REG_READ_ID (uint32_t)1
mahphalke 1:48914f9593f1 317 #define DEVICE_REG_WRITE_ID (uint32_t)2
mahphalke 1:48914f9593f1 318
mahphalke 1:48914f9593f1 319 // Enable/Disable selection identifiers
mahphalke 1:48914f9593f1 320 #define SELECT_DISBLE (uint32_t)0
mahphalke 1:48914f9593f1 321 #define SELECT_ENABLE (uint32_t)1
mahphalke 1:48914f9593f1 322
mahphalke 3:6c7324997606 323 // Input Type selection identifiers
mahphalke 3:6c7324997606 324 #define SINGLE_ENDED_INPUT (uint32_t)0
mahphalke 3:6c7324997606 325 #define DIFF_ENDED_INPUT (uint32_t)1
mahphalke 3:6c7324997606 326
mahphalke 1:48914f9593f1 327 // Analog input select identifiers
mahphalke 1:48914f9593f1 328 #define ANALOG_INP_PAIR_SELECT (uint32_t)0
mahphalke 1:48914f9593f1 329 #define POS_ANALOG_INP_SELECT (uint32_t)1
mahphalke 1:48914f9593f1 330 #define NEG_ANALOG_INP_SELECT (uint32_t)2
mahphalke 1:48914f9593f1 331
mahphalke 1:48914f9593f1 332
mahphalke 1:48914f9593f1 333 // Digital filter type (ORDER0) bits
mahphalke 1:48914f9593f1 334 #define SINC5_SINC1_FILTER (uint32_t)0
mahphalke 1:48914f9593f1 335 #define SINC3_FILTER (uint32_t)1
mahphalke 1:48914f9593f1 336
mahphalke 1:48914f9593f1 337 // SINC5+SINC1 post filter type bits
mahphalke 1:48914f9593f1 338 #define POST_FILTER_NA (uint32_t)0
mahphalke 1:48914f9593f1 339 #define POST_FLTR_27_SPS (uint32_t)2
mahphalke 1:48914f9593f1 340 #define POST_FLTR_25_SPS (uint32_t)3
mahphalke 1:48914f9593f1 341 #define POST_FLTR_20_SPS (uint32_t)5
mahphalke 1:48914f9593f1 342 #define POST_FLTR_16_67_SPS (uint32_t)6
mahphalke 1:48914f9593f1 343
mahphalke 1:48914f9593f1 344 // Reference source type bits
mahphalke 1:48914f9593f1 345 #define EXTERNAL (uint32_t)0
mahphalke 1:48914f9593f1 346 #define INTERNAL (uint32_t)2
mahphalke 1:48914f9593f1 347 #define AVDD_AVSS (uint32_t)3
mahphalke 1:48914f9593f1 348
mahphalke 1:48914f9593f1 349 // Polarity selection bits
mahphalke 1:48914f9593f1 350 #define UNIPOLAR (uint32_t)0
mahphalke 1:48914f9593f1 351 #define BIPOLAR (uint32_t)1
mahphalke 1:48914f9593f1 352
mahphalke 1:48914f9593f1 353 /******************************************************************************/
mahphalke 1:48914f9593f1 354 /********************** Variables and User Defined Data Types *****************/
mahphalke 1:48914f9593f1 355 /******************************************************************************/
mahphalke 1:48914f9593f1 356
mahphalke 1:48914f9593f1 357 // Enable/Disable status names
mahphalke 1:48914f9593f1 358 const char *enable_disable_status[] = {
mahphalke 1:48914f9593f1 359 "Disable",
mahphalke 1:48914f9593f1 360 "Enable"
mahphalke 1:48914f9593f1 361 };
mahphalke 1:48914f9593f1 362
mahphalke 1:48914f9593f1 363 // Polarity names
mahphalke 1:48914f9593f1 364 const char *polarity_status[] = {
mahphalke 1:48914f9593f1 365 "Unipolar",
mahphalke 1:48914f9593f1 366 "Bipolar"
mahphalke 1:48914f9593f1 367 };
mahphalke 1:48914f9593f1 368
mahphalke 1:48914f9593f1 369 // Filter names
mahphalke 1:48914f9593f1 370 const char *filter_name[] = {
mahphalke 1:48914f9593f1 371 "Sinc5+1",
mahphalke 1:48914f9593f1 372 "Sinc3",
mahphalke 1:48914f9593f1 373 };
mahphalke 1:48914f9593f1 374
mahphalke 1:48914f9593f1 375 // Post filter names
mahphalke 1:48914f9593f1 376 const char *postfilter_name[] = {
mahphalke 1:48914f9593f1 377 "NA",
mahphalke 1:48914f9593f1 378 "NA",
mahphalke 1:48914f9593f1 379 "27_SPS",
mahphalke 1:48914f9593f1 380 "25_SPS",
mahphalke 1:48914f9593f1 381 "NA",
mahphalke 1:48914f9593f1 382 "20_SPS",
mahphalke 1:48914f9593f1 383 "16_SPS",
mahphalke 1:48914f9593f1 384 };
mahphalke 1:48914f9593f1 385
mahphalke 1:48914f9593f1 386 // Reference source names
mahphalke 1:48914f9593f1 387 const char *reference_name[] = {
mahphalke 1:48914f9593f1 388 "External",
mahphalke 1:48914f9593f1 389 "External",
mahphalke 1:48914f9593f1 390 "Internal",
mahphalke 1:48914f9593f1 391 "AVDD-AVSS"
mahphalke 1:48914f9593f1 392 };
mahphalke 1:48914f9593f1 393
mahphalke 1:48914f9593f1 394
mahphalke 1:48914f9593f1 395 // Analog Input pin map
mahphalke 1:48914f9593f1 396 const char *input_pin_map[] = {
mahphalke 1:48914f9593f1 397 #if defined(DEV_AD4111) || defined(DEV_AD4112)
mahphalke 1:48914f9593f1 398 "VIN0", "VIN1", "VIN2", "VIN3", "VIN4", "VIN5",
mahphalke 1:48914f9593f1 399 "VIN6", "VIN7", "IN0-", "IN1-", "IN2-", "IN3-",
mahphalke 1:48914f9593f1 400 "IN3+", "IN2+", "IN1+", "IN0+", "VINCOM",
mahphalke 1:48914f9593f1 401 "TEMP+", "TEMP-", "RES", "RES", "REF+", "REF-"
Mahesh Phalke 4:4592cc69bfa6 402 #elif defined(DEV_AD4114) || defined(DEV_AD4115)
Mahesh Phalke 4:4592cc69bfa6 403 "VIN0", "VIN1", "VIN2", "VIN3", "VIN4", "VIN5",
Mahesh Phalke 4:4592cc69bfa6 404 "VIN6", "VIN7", "VIN8", "VIN9", "VIN10", "VIN11",
Mahesh Phalke 4:4592cc69bfa6 405 "VIN12", "VIN13", "VIN14", "VIN15", "VINCOM",
Mahesh Phalke 4:4592cc69bfa6 406 "TEMP+", "TEMP-", "RES", "RES", "REF+", "REF-"
mahphalke 1:48914f9593f1 407 #elif defined(DEV_AD7173_8) || defined(DEV_AD7175_8)
mahphalke 1:48914f9593f1 408 "AIN0", "AIN1", "AIN2", "AIN3", "AIN4", "AIN5",
mahphalke 1:48914f9593f1 409 "AIN6", "AIN7", "AIN8", "AIN9", "AIN10", "AIN11",
mahphalke 1:48914f9593f1 410 "AIN12", "AIN13", "AIN14", "AIN15", "AIN16",
mahphalke 1:48914f9593f1 411 "TEMP+", "TEMP-",
mahphalke 1:48914f9593f1 412 #if defined(DEV_AD7173_8)
mahphalke 1:48914f9593f1 413 "RES", "RES",
mahphalke 1:48914f9593f1 414 #else
mahphalke 1:48914f9593f1 415 "((AVDD1 ? AVSS)/5)+", "((AVDD1 ? AVSS)/5)-",
mahphalke 1:48914f9593f1 416 #endif
mahphalke 1:48914f9593f1 417 "REF+", "REF-"
mahphalke 1:48914f9593f1 418 #elif defined(DEV_AD7172_2) || defined(DEV_AD7177_2) || defined(DEV_AD7175_2)
mahphalke 1:48914f9593f1 419 "AIN0", "AIN1", "AIN2", "AIN3", "AIN4",
mahphalke 1:48914f9593f1 420 "RES", "RES", "RES", "RES", "RES", "RES",
mahphalke 1:48914f9593f1 421 "RES", "RES", "RES", "RES", "RES", "RES",
mahphalke 1:48914f9593f1 422 "TEMP+", "TEMP-", "((AVDD1 ? AVSS)/5)+", "((AVDD1 ? AVSS)/5)-",
mahphalke 1:48914f9593f1 423 "REF+", "REF-"
mahphalke 1:48914f9593f1 424 #elif defined(DEV_AD7172_4)
mahphalke 1:48914f9593f1 425 "AIN0", "AIN1", "AIN2", "AIN3", "AIN4",
mahphalke 1:48914f9593f1 426 "AIN5", "AIN6", "AIN7", "AIN8",
mahphalke 1:48914f9593f1 427 "RES", "RES", "RES", "RES", "RES", "RES",
mahphalke 1:48914f9593f1 428 "TEMP+", "TEMP-", "((AVDD1 ? AVSS)/5)+", "((AVDD1 ? AVSS)/5)-",
mahphalke 1:48914f9593f1 429 "REF+", "REF-"
mahphalke 1:48914f9593f1 430 #elif defined(DEV_AD7176_2)
mahphalke 1:48914f9593f1 431 "AIN0", "AIN1", "AIN2", "AIN3", "AIN4",
mahphalke 1:48914f9593f1 432 "RES", "RES", "RES", "RES", "RES", "RES",
mahphalke 1:48914f9593f1 433 "RES", "RES", "RES", "RES", "RES", "RES",
mahphalke 1:48914f9593f1 434 "RES", "RES", "RES", "RES", "REF+", "REF-"
mahphalke 1:48914f9593f1 435 #endif
mahphalke 1:48914f9593f1 436 };
mahphalke 1:48914f9593f1 437
mahphalke 1:48914f9593f1 438
mahphalke 1:48914f9593f1 439 // SIN5+SINC1 Filter ODR map
mahphalke 1:48914f9593f1 440 const float sinc5_sinc1_odr_map[] = {
Mahesh Phalke 6:28e40a21857f 441 #if defined(DEV_AD4115)
Mahesh Phalke 6:28e40a21857f 442 ODR_125000, ODR_125000, ODR_62500, ODR_62500,
Mahesh Phalke 6:28e40a21857f 443 ODR_31250, ODR_25000, ODR_15625, ODR_10417, ODR_5000,
Mahesh Phalke 6:28e40a21857f 444 ODR_2500, ODR_1000, ODR_500, ODR_397_5, ODR_200, ODR_100,
Mahesh Phalke 6:28e40a21857f 445 ODR_59_98, ODR_49_96, ODR_20, ODR_16_67,
Mahesh Phalke 6:28e40a21857f 446 ODR_10, ODR_5, ODR_2_5, ODR_2_5
Mahesh Phalke 6:28e40a21857f 447 #elif defined(DEV_AD4111) || defined(DEV_AD4112) || defined(DEV_AD4114) || \
Mahesh Phalke 6:28e40a21857f 448 defined(DEV_AD7172_2) || defined(DEV_AD7172_4) || defined(DEV_AD7173_8)
mahphalke 1:48914f9593f1 449 ODR_31250, ODR_31250, ODR_31250, ODR_31250, ODR_31250, ODR_31250,
mahphalke 1:48914f9593f1 450 ODR_15625, ODR_10417, ODR_5208, ODR_2597, ODR_1007, ODR_503_8,
mahphalke 1:48914f9593f1 451 ODR_381, ODR_200_3, ODR_100_2, ODR_59_52, ODR_49_68, ODR_20_01,
mahphalke 1:48914f9593f1 452 ODR_16_63, ODR_10, ODR_5, ODR_2_5, ODR_1_25,
mahphalke 1:48914f9593f1 453 #elif defined(DEV_AD7176_2) || defined(DEV_AD7175_2) || defined(DEV_AD7175_8) ||\
mahphalke 1:48914f9593f1 454 defined(DEV_AD7177_2)
mahphalke 1:48914f9593f1 455 #if (DEV_AD7176_2) || defined(DEV_AD7175_2) || defined(DEV_AD7175_8)
mahphalke 1:48914f9593f1 456 ODR_250000, ODR_125000, ODR_62500, ODR_50000, ODR_31250, ODR_25000, ODR_15625,
mahphalke 1:48914f9593f1 457 #elif defined(DEV_AD7177_2)
mahphalke 1:48914f9593f1 458 ODR_0, ODR_0, ODR_0, ODR_0, ODR_0, ODR_0, ODR_0,
mahphalke 1:48914f9593f1 459 #endif
mahphalke 1:48914f9593f1 460 ODR_10000, ODR_5000, ODR_2500, ODR_1000, ODR_500, ODR_397_5, ODR_200,
mahphalke 1:48914f9593f1 461 ODR_100, ODR_59_94, ODR_49_96, ODR_20, ODR_16_67, ODR_10, ODR_5,
mahphalke 1:48914f9593f1 462 ODR_0, ODR_0,
mahphalke 1:48914f9593f1 463 #endif
mahphalke 1:48914f9593f1 464 };
mahphalke 1:48914f9593f1 465
mahphalke 1:48914f9593f1 466 const float sinc3_odr_map[] = {
Mahesh Phalke 6:28e40a21857f 467 #if defined(DEV_AD4115)
Mahesh Phalke 6:28e40a21857f 468 ODR_125000, ODR_125000, ODR_62500, ODR_62500,
Mahesh Phalke 6:28e40a21857f 469 ODR_31250, ODR_25000, ODR_15625, ODR_10417, ODR_5000,
Mahesh Phalke 6:28e40a21857f 470 ODR_3906, ODR_1157, ODR_539, ODR_401, ODR_206,
Mahesh Phalke 6:28e40a21857f 471 ODR_102, ODR_59_98, ODR_50, ODR_20, ODR_16_67,
Mahesh Phalke 6:28e40a21857f 472 ODR_10, ODR_5, ODR_2_5, ODR_2_5
Mahesh Phalke 6:28e40a21857f 473 #elif defined(DEV_AD4111) || defined(DEV_AD4112) || defined(DEV_AD4114) || \
Mahesh Phalke 6:28e40a21857f 474 defined(DEV_AD7172_2) || defined(DEV_AD7172_4) || defined(DEV_AD7173_8)
mahphalke 1:48914f9593f1 475 ODR_31250, ODR_31250, ODR_31250,
mahphalke 1:48914f9593f1 476 ODR_31250, ODR_31250, ODR_31250,
mahphalke 1:48914f9593f1 477 ODR_15625, ODR_10417, ODR_5208,
Mahesh Phalke 6:28e40a21857f 478 #if defined(DEV_AD4111) || defined(DEV_AD4112) || defined(DEV_AD4114)
mahphalke 1:48914f9593f1 479 ODR_3906, ODR_1157, ODR_539,
mahphalke 1:48914f9593f1 480 ODR_401, ODR_206, ODR_102,
mahphalke 1:48914f9593f1 481 #else
mahphalke 1:48914f9593f1 482 ODR_2604, ODR_1008, ODR_504,
mahphalke 1:48914f9593f1 483 ODR_400_6, ODR_200_3, ODR_100_2,
mahphalke 1:48914f9593f1 484 #endif
mahphalke 1:48914f9593f1 485 ODR_59_98, ODR_50, ODR_20_01,
mahphalke 1:48914f9593f1 486 ODR_16_67, ODR_10, ODR_5,
mahphalke 1:48914f9593f1 487 ODR_2_5, ODR_1_25,
mahphalke 1:48914f9593f1 488 #elif defined(DEV_AD7176_2) || defined(DEV_AD7175_2) || defined(DEV_AD7175_8) ||\
mahphalke 1:48914f9593f1 489 defined(DEV_AD7177_2)
mahphalke 1:48914f9593f1 490 #if (DEV_AD7176_2) || defined(DEV_AD7175_2) || defined(DEV_AD7175_8)
mahphalke 1:48914f9593f1 491 ODR_250000, ODR_125000, ODR_62500,
mahphalke 1:48914f9593f1 492 ODR_50000, ODR_31250, ODR_25000,
mahphalke 1:48914f9593f1 493 ODR_15625,
mahphalke 1:48914f9593f1 494 #elif defined(DEV_AD7177_2)
mahphalke 1:48914f9593f1 495 ODR_0, ODR_0, ODR_0, ODR_0,
mahphalke 1:48914f9593f1 496 ODR_0, ODR_0, ODR_0,
mahphalke 1:48914f9593f1 497 #endif
mahphalke 1:48914f9593f1 498 ODR_10000, ODR_5000, ODR_2500, ODR_1000, ODR_500, ODR_400, ODR_200,
mahphalke 1:48914f9593f1 499 ODR_100, ODR_60, ODR_50, ODR_20, ODR_16_67, ODR_10, ODR_5,
mahphalke 1:48914f9593f1 500 ODR_0, ODR_0,
mahphalke 1:48914f9593f1 501 #endif
mahphalke 1:48914f9593f1 502 };
mahphalke 1:48914f9593f1 503
mahphalke 1:48914f9593f1 504
mahphalke 1:48914f9593f1 505 /*
mahphalke 1:48914f9593f1 506 * Definition of the channel enable/disable menu items and menu itself
mahphalke 1:48914f9593f1 507 */
mahphalke 1:48914f9593f1 508 console_menu_item chn_enable_disable_items[] = {
mahphalke 1:48914f9593f1 509 { "Enable Channels", 'E', menu_channels_enable_disable, SELECT_ENABLE },
mahphalke 1:48914f9593f1 510 { "Disable Channels", 'D', menu_channels_enable_disable, SELECT_DISBLE },
mahphalke 1:48914f9593f1 511 };
mahphalke 1:48914f9593f1 512
mahphalke 1:48914f9593f1 513 console_menu chn_enable_disable_menu = {
mahphalke 1:48914f9593f1 514 .title = "Channel Enable/Disable Menu",
mahphalke 1:48914f9593f1 515 .items = chn_enable_disable_items,
mahphalke 1:48914f9593f1 516 .itemCount = ARRAY_SIZE(chn_enable_disable_items),
mahphalke 1:48914f9593f1 517 .headerItem = NULL,
mahphalke 1:48914f9593f1 518 .footerItem = NULL,
mahphalke 1:48914f9593f1 519 .enableEscapeKey = true
mahphalke 1:48914f9593f1 520 };
mahphalke 1:48914f9593f1 521
mahphalke 1:48914f9593f1 522
mahphalke 1:48914f9593f1 523 /*
mahphalke 1:48914f9593f1 524 * Definition of the analog input connection menu items and menu itself
mahphalke 1:48914f9593f1 525 */
mahphalke 1:48914f9593f1 526 console_menu_item analog_input_connect_items[] = {
Mahesh Phalke 4:4592cc69bfa6 527 #if defined(DEV_AD4111) || defined(DEV_AD4112) || defined(DEV_AD4114) || defined(DEV_AD4115)
mahphalke 1:48914f9593f1 528 // Input pin name/pair Key Menu Function AINP/AINM Bits
mahphalke 1:48914f9593f1 529 //
mahphalke 1:48914f9593f1 530 { "VIN0, VIN1", 'A', menu_analog_input_connect, ((VIN0_INPUT_BITS << VIN_PAIR_OFFSET) | VIN1_INPUT_BITS) },
mahphalke 1:48914f9593f1 531 { "VIN0, VINCOM", 'B', menu_analog_input_connect, ((VIN0_INPUT_BITS << VIN_PAIR_OFFSET) | VINCOM_INPUT_BITS) },
mahphalke 1:48914f9593f1 532 { "VIN1, VIN0", 'C', menu_analog_input_connect, ((VIN1_INPUT_BITS << VIN_PAIR_OFFSET) | VIN0_INPUT_BITS) },
mahphalke 1:48914f9593f1 533 { "VIN1, VINCOM", 'D', menu_analog_input_connect, ((VIN1_INPUT_BITS << VIN_PAIR_OFFSET) | VINCOM_INPUT_BITS) },
mahphalke 1:48914f9593f1 534 { "VIN2, VIN3", 'E', menu_analog_input_connect, ((VIN2_INPUT_BITS << VIN_PAIR_OFFSET) | VIN3_INPUT_BITS) },
mahphalke 1:48914f9593f1 535 { "VIN2, VINCOM", 'F', menu_analog_input_connect, ((VIN2_INPUT_BITS << VIN_PAIR_OFFSET) | VINCOM_INPUT_BITS) },
mahphalke 1:48914f9593f1 536 { "VIN3, VIN2", 'G', menu_analog_input_connect, ((VIN3_INPUT_BITS << VIN_PAIR_OFFSET) | VIN2_INPUT_BITS) },
mahphalke 1:48914f9593f1 537 { "VIN3, VINCOM", 'H', menu_analog_input_connect, ((VIN3_INPUT_BITS << VIN_PAIR_OFFSET) | VINCOM_INPUT_BITS) },
mahphalke 1:48914f9593f1 538 { "VIN4, VIN5", 'I', menu_analog_input_connect, ((VIN4_INPUT_BITS << VIN_PAIR_OFFSET) | VIN5_INPUT_BITS) },
mahphalke 1:48914f9593f1 539 { "VIN4, VINCOM", 'J', menu_analog_input_connect, ((VIN4_INPUT_BITS << VIN_PAIR_OFFSET) | VINCOM_INPUT_BITS) },
mahphalke 1:48914f9593f1 540 { "VIN5, VIN4", 'K', menu_analog_input_connect, ((VIN5_INPUT_BITS << VIN_PAIR_OFFSET) | VIN4_INPUT_BITS) },
mahphalke 1:48914f9593f1 541 { "VIN5, VINCOM", 'L', menu_analog_input_connect, ((VIN5_INPUT_BITS << VIN_PAIR_OFFSET) | VINCOM_INPUT_BITS) },
mahphalke 1:48914f9593f1 542 { "VIN6, VIN7", 'M', menu_analog_input_connect, ((VIN6_INPUT_BITS << VIN_PAIR_OFFSET) | VIN7_INPUT_BITS) },
mahphalke 1:48914f9593f1 543 { "VIN6, VINCOM", 'N', menu_analog_input_connect, ((VIN6_INPUT_BITS << VIN_PAIR_OFFSET) | VINCOM_INPUT_BITS) },
mahphalke 1:48914f9593f1 544 { "VIN7, VIN6", 'O', menu_analog_input_connect, ((VIN7_INPUT_BITS << VIN_PAIR_OFFSET) | VIN6_INPUT_BITS) },
mahphalke 1:48914f9593f1 545 { "VIN7, VINCOM", 'P', menu_analog_input_connect, ((VIN7_INPUT_BITS << VIN_PAIR_OFFSET) | VINCOM_INPUT_BITS) },
Mahesh Phalke 4:4592cc69bfa6 546 #if defined(DEV_AD4111) || defined(DEV_AD4112)
mahphalke 1:48914f9593f1 547 { "IN3+, IN3-", 'Q', menu_analog_input_connect, ((IN3P_INPUT_BITS << VIN_PAIR_OFFSET) | IN3N_INPUT_BITS) },
mahphalke 1:48914f9593f1 548 { "IN2+, IN2-", 'R', menu_analog_input_connect, ((IN2P_INPUT_BITS << VIN_PAIR_OFFSET) | IN2N_INPUT_BITS) },
mahphalke 1:48914f9593f1 549 { "IN1+, IN1-", 'S', menu_analog_input_connect, ((IN1P_INPUT_BITS << VIN_PAIR_OFFSET) | IN1N_INPUT_BITS) },
mahphalke 1:48914f9593f1 550 { "IN0+, IN0-", 'T', menu_analog_input_connect, ((IN0P_INPUT_BITS << VIN_PAIR_OFFSET) | IN0N_INPUT_BITS) },
Mahesh Phalke 4:4592cc69bfa6 551 #else // mapping for AD4114/15
Mahesh Phalke 4:4592cc69bfa6 552 { "VIN8, VIN9", 'Q', menu_analog_input_connect, ((VIN8_INPUT_BITS << VIN_PAIR_OFFSET) | VIN9_INPUT_BITS) },
Mahesh Phalke 4:4592cc69bfa6 553 { "VIN8, VINCOM", 'R', menu_analog_input_connect, ((VIN8_INPUT_BITS << VIN_PAIR_OFFSET) | VINCOM_INPUT_BITS) },
Mahesh Phalke 4:4592cc69bfa6 554 { "VIN9, VIN8", 'S', menu_analog_input_connect, ((VIN9_INPUT_BITS << VIN_PAIR_OFFSET) | VIN8_INPUT_BITS) },
Mahesh Phalke 4:4592cc69bfa6 555 { "VIN9, VINCOM", 'T', menu_analog_input_connect, ((VIN9_INPUT_BITS << VIN_PAIR_OFFSET) | VINCOM_INPUT_BITS) },
Mahesh Phalke 4:4592cc69bfa6 556 { "VIN10, VIN11", 'U', menu_analog_input_connect, ((VIN10_INPUT_BITS << VIN_PAIR_OFFSET) | VIN11_INPUT_BITS) },
Mahesh Phalke 4:4592cc69bfa6 557 { "VIN10, VINCOM", 'V', menu_analog_input_connect, ((VIN10_INPUT_BITS << VIN_PAIR_OFFSET) | VINCOM_INPUT_BITS) },
Mahesh Phalke 4:4592cc69bfa6 558 { "VIN11, VIN10", 'W', menu_analog_input_connect, ((VIN11_INPUT_BITS << VIN_PAIR_OFFSET) | VIN10_INPUT_BITS) },
Mahesh Phalke 4:4592cc69bfa6 559 { "VIN11, VINCOM", 'X', menu_analog_input_connect, ((VIN11_INPUT_BITS << VIN_PAIR_OFFSET) | VINCOM_INPUT_BITS) },
Mahesh Phalke 4:4592cc69bfa6 560 { "VIN12, VIN13", 'Y', menu_analog_input_connect, ((VIN12_INPUT_BITS << VIN_PAIR_OFFSET) | VIN13_INPUT_BITS) },
Mahesh Phalke 4:4592cc69bfa6 561 { "VIN12, VINCOM", 'Z', menu_analog_input_connect, ((VIN12_INPUT_BITS << VIN_PAIR_OFFSET) | VINCOM_INPUT_BITS) },
Mahesh Phalke 4:4592cc69bfa6 562 { "VIN13, VIN12", '1', menu_analog_input_connect, ((VIN13_INPUT_BITS << VIN_PAIR_OFFSET) | VIN12_INPUT_BITS) },
Mahesh Phalke 4:4592cc69bfa6 563 { "VIN13, VINCOM", '2', menu_analog_input_connect, ((VIN13_INPUT_BITS << VIN_PAIR_OFFSET) | VINCOM_INPUT_BITS) },
Mahesh Phalke 4:4592cc69bfa6 564 { "VIN14, VIN15", '3', menu_analog_input_connect, ((VIN14_INPUT_BITS << VIN_PAIR_OFFSET) | VIN15_INPUT_BITS) },
Mahesh Phalke 4:4592cc69bfa6 565 { "VIN14, VINCOM", '4', menu_analog_input_connect, ((VIN14_INPUT_BITS << VIN_PAIR_OFFSET) | VINCOM_INPUT_BITS) },
Mahesh Phalke 4:4592cc69bfa6 566 { "VIN15, VIN14", '5', menu_analog_input_connect, ((VIN15_INPUT_BITS << VIN_PAIR_OFFSET) | VIN14_INPUT_BITS) },
Mahesh Phalke 4:4592cc69bfa6 567 { "VIN15, VINCOM", '6', menu_analog_input_connect, ((VIN15_INPUT_BITS << VIN_PAIR_OFFSET) | VINCOM_INPUT_BITS) },
Mahesh Phalke 4:4592cc69bfa6 568 #endif
Mahesh Phalke 4:4592cc69bfa6 569 { "Temperature Sensor", '7', menu_analog_input_connect, ((TEMP_SENSOR_POS_INP_BITS << VIN_PAIR_OFFSET) | TEMP_SENSOR_NEG_INP_BITS) },
Mahesh Phalke 4:4592cc69bfa6 570 { "Reference", '8', menu_analog_input_connect, ((REFP_INPUT_BITS << VIN_PAIR_OFFSET) | REFN_INPUT_BITS) },
mahphalke 1:48914f9593f1 571 #else
mahphalke 1:48914f9593f1 572 { "AIN0", 'A', menu_analog_input_connect, VIN0_INPUT_BITS },
mahphalke 1:48914f9593f1 573 { "AIN1", 'B', menu_analog_input_connect, VIN1_INPUT_BITS },
mahphalke 1:48914f9593f1 574 { "AIN2", 'C', menu_analog_input_connect, VIN2_INPUT_BITS },
mahphalke 1:48914f9593f1 575 { "AIN3", 'D', menu_analog_input_connect, VIN3_INPUT_BITS },
mahphalke 1:48914f9593f1 576 { "AIN4", 'E', menu_analog_input_connect, VIN4_INPUT_BITS },
mahphalke 1:48914f9593f1 577 #if defined(DEV_AD7172_2) || defined(DEV_AD7177_2) || defined(DEV_AD7175_2)
mahphalke 1:48914f9593f1 578 { "Temperature Sensor+", 'F', menu_analog_input_connect, TEMP_SENSOR_POS_INP_BITS },
mahphalke 1:48914f9593f1 579 { "Temperature Sensor-", 'G', menu_analog_input_connect, TEMP_SENSOR_NEG_INP_BITS },
mahphalke 1:48914f9593f1 580 { "((AVDD1 - AVSS)/5)+ ", 'H', menu_analog_input_connect, AVDD1_AVSS_P_BITS },
mahphalke 1:48914f9593f1 581 { "((AVDD1 - AVSS)/5)-", 'I', menu_analog_input_connect, AVDD1_AVSS_N_BITS },
mahphalke 1:48914f9593f1 582 { "REF+", 'J', menu_analog_input_connect, REFP_INPUT_BITS },
mahphalke 1:48914f9593f1 583 { "REF-", 'K', menu_analog_input_connect, REFN_INPUT_BITS },
mahphalke 1:48914f9593f1 584 #elif defined(DEV_AD7172_4)
mahphalke 1:48914f9593f1 585 { "AIN5", 'F', menu_analog_input_connect, VIN5_INPUT_BITS },
mahphalke 1:48914f9593f1 586 { "AIN6", 'G', menu_analog_input_connect, VIN6_INPUT_BITS },
mahphalke 1:48914f9593f1 587 { "AIN7", 'H', menu_analog_input_connect, VIN7_INPUT_BITS },
mahphalke 1:48914f9593f1 588 { "AIN8", 'I', menu_analog_input_connect, VIN8_INPUT_BITS },
mahphalke 1:48914f9593f1 589 { "((AVDD1 - AVSS)/5)+ ", 'J', menu_analog_input_connect, AVDD1_AVSS_P_BITS },
mahphalke 1:48914f9593f1 590 { "((AVDD1 - AVSS)/5)-", 'K', menu_analog_input_connect, AVDD1_AVSS_N_BITS },
mahphalke 1:48914f9593f1 591 { "REF+", 'L', menu_analog_input_connect, REFP_INPUT_BITS },
mahphalke 1:48914f9593f1 592 { "REF-", 'M', menu_analog_input_connect, REFN_INPUT_BITS },
mahphalke 1:48914f9593f1 593 #elif defined(DEV_AD7176_2)
mahphalke 1:48914f9593f1 594 { "REF+", 'F', menu_analog_input_connect, REFP_INPUT_BITS },
mahphalke 1:48914f9593f1 595 { "REF-", 'G', menu_analog_input_connect, REFN_INPUT_BITS },
mahphalke 1:48914f9593f1 596 #elif defined(DEV_AD7173_8) || defined(DEV_AD7175_8)
mahphalke 1:48914f9593f1 597 { "AIN5", 'F', menu_analog_input_connect, VIN5_INPUT_BITS },
mahphalke 1:48914f9593f1 598 { "AIN6", 'G', menu_analog_input_connect, VIN6_INPUT_BITS },
mahphalke 1:48914f9593f1 599 { "AIN7", 'H', menu_analog_input_connect, VIN7_INPUT_BITS },
mahphalke 1:48914f9593f1 600 { "AIN8", 'I', menu_analog_input_connect, VIN8_INPUT_BITS },
mahphalke 1:48914f9593f1 601 { "AIN9", 'J', menu_analog_input_connect, VIN9_INPUT_BITS },
mahphalke 1:48914f9593f1 602 { "AIN10", 'K', menu_analog_input_connect, VIN10_INPUT_BITS },
mahphalke 1:48914f9593f1 603 { "AIN11", 'L', menu_analog_input_connect, VIN11_INPUT_BITS },
mahphalke 1:48914f9593f1 604 { "AIN12", 'M', menu_analog_input_connect, VIN12_INPUT_BITS },
mahphalke 1:48914f9593f1 605 { "AIN13", 'N', menu_analog_input_connect, VIN13_INPUT_BITS },
mahphalke 1:48914f9593f1 606 { "AIN14", 'O', menu_analog_input_connect, VIN14_INPUT_BITS },
mahphalke 1:48914f9593f1 607 { "AIN15", 'P', menu_analog_input_connect, VIN15_INPUT_BITS },
mahphalke 1:48914f9593f1 608 { "AIN16", 'Q', menu_analog_input_connect, VIN16_INPUT_BITS },
mahphalke 1:48914f9593f1 609 { "Temperature Sensor+", 'R', menu_analog_input_connect, TEMP_SENSOR_POS_INP_BITS },
mahphalke 1:48914f9593f1 610 { "Temperature Sensor-", 'S', menu_analog_input_connect, TEMP_SENSOR_NEG_INP_BITS },
mahphalke 1:48914f9593f1 611 #if (DEV_AD7175_8)
mahphalke 1:48914f9593f1 612 { "((AVDD1 - AVSS)/5)+ ", 'T', menu_analog_input_connect, AVDD1_AVSS_P_BITS },
mahphalke 1:48914f9593f1 613 { "((AVDD1 - AVSS)/5)-", 'U', menu_analog_input_connect, AVDD1_AVSS_N_BITS },
mahphalke 1:48914f9593f1 614 #endif
mahphalke 1:48914f9593f1 615 { "REF+", 'V', menu_analog_input_connect, REFP_INPUT_BITS },
mahphalke 1:48914f9593f1 616 { "REF-", 'W', menu_analog_input_connect, REFN_INPUT_BITS },
mahphalke 1:48914f9593f1 617 #endif
mahphalke 1:48914f9593f1 618 #endif
mahphalke 1:48914f9593f1 619 };
mahphalke 1:48914f9593f1 620
mahphalke 1:48914f9593f1 621 console_menu analog_input_connect_menu = {
mahphalke 1:48914f9593f1 622 .title = "Select Analog Input",
mahphalke 1:48914f9593f1 623 .items = analog_input_connect_items,
mahphalke 1:48914f9593f1 624 .itemCount = ARRAY_SIZE(analog_input_connect_items),
mahphalke 1:48914f9593f1 625 .headerItem = NULL,
mahphalke 1:48914f9593f1 626 .footerItem = NULL,
mahphalke 1:48914f9593f1 627 .enableEscapeKey = true
mahphalke 1:48914f9593f1 628 };
mahphalke 1:48914f9593f1 629
mahphalke 1:48914f9593f1 630
mahphalke 1:48914f9593f1 631 /*
mahphalke 3:6c7324997606 632 * Definition of the open wire detect inputs type menu items and menu itself
mahphalke 3:6c7324997606 633 */
mahphalke 3:6c7324997606 634 console_menu_item open_wire_detect_input_type_items[] = {
mahphalke 3:6c7324997606 635 { "Single Ended Input", 'S', menu_input_type_selection, SINGLE_ENDED_INPUT },
mahphalke 3:6c7324997606 636 { "Differential Ended Input", 'D', menu_input_type_selection, DIFF_ENDED_INPUT },
mahphalke 3:6c7324997606 637 };
mahphalke 3:6c7324997606 638
mahphalke 3:6c7324997606 639 console_menu open_wire_detect_input_type_menu = {
mahphalke 3:6c7324997606 640 .title = "Select Analog Input Type",
mahphalke 3:6c7324997606 641 .items = open_wire_detect_input_type_items,
mahphalke 3:6c7324997606 642 .itemCount = ARRAY_SIZE(open_wire_detect_input_type_items),
mahphalke 3:6c7324997606 643 .headerItem = NULL,
mahphalke 3:6c7324997606 644 .footerItem = NULL,
mahphalke 3:6c7324997606 645 .enableEscapeKey = true
mahphalke 3:6c7324997606 646 };
mahphalke 3:6c7324997606 647
mahphalke 3:6c7324997606 648
mahphalke 3:6c7324997606 649 /*
mahphalke 3:6c7324997606 650 * Definition of the open wire detect single ended input channel pair menu items and menu itself
mahphalke 3:6c7324997606 651 */
mahphalke 3:6c7324997606 652 console_menu_item open_wire_detect_se_channel_items[] = {
mahphalke 3:6c7324997606 653 { "CHN0, CHN15", 'A', menu_select_chn_pair, ((ADC_CHN(0) << CHN_PAIR_OFFSET) | ADC_CHN(15)) },
mahphalke 3:6c7324997606 654 { "CHN1, CHN2", 'B', menu_select_chn_pair, ((ADC_CHN(1) << CHN_PAIR_OFFSET) | ADC_CHN(2)) },
mahphalke 3:6c7324997606 655 { "CHN3, CHN4", 'C', menu_select_chn_pair, ((ADC_CHN(3) << CHN_PAIR_OFFSET) | ADC_CHN(4)) },
mahphalke 3:6c7324997606 656 { "CHN5, CHN6", 'D', menu_select_chn_pair, ((ADC_CHN(5) << CHN_PAIR_OFFSET) | ADC_CHN(6)) },
mahphalke 3:6c7324997606 657 { "CHN7, CHN8", 'E', menu_select_chn_pair, ((ADC_CHN(7) << CHN_PAIR_OFFSET) | ADC_CHN(8)) },
mahphalke 3:6c7324997606 658 { "CHN9, CHN10", 'F', menu_select_chn_pair, ((ADC_CHN(9) << CHN_PAIR_OFFSET) | ADC_CHN(10)) },
mahphalke 3:6c7324997606 659 { "CHN11, CHN12", 'G', menu_select_chn_pair, ((ADC_CHN(11) << CHN_PAIR_OFFSET) | ADC_CHN(12)) },
mahphalke 3:6c7324997606 660 { "CHN13, CHN14", 'H', menu_select_chn_pair, ((ADC_CHN(13) << CHN_PAIR_OFFSET) | ADC_CHN(14)) },
mahphalke 3:6c7324997606 661 };
mahphalke 3:6c7324997606 662
mahphalke 3:6c7324997606 663 console_menu open_wire_detect_se_channel_menu = {
mahphalke 3:6c7324997606 664 .title = "Select Channel Pair",
mahphalke 3:6c7324997606 665 .items = open_wire_detect_se_channel_items,
mahphalke 3:6c7324997606 666 .itemCount = ARRAY_SIZE(open_wire_detect_se_channel_items),
mahphalke 3:6c7324997606 667 .headerItem = NULL,
mahphalke 3:6c7324997606 668 .footerItem = NULL,
mahphalke 3:6c7324997606 669 .enableEscapeKey = true
mahphalke 3:6c7324997606 670 };
mahphalke 3:6c7324997606 671
mahphalke 3:6c7324997606 672
mahphalke 3:6c7324997606 673 /*
mahphalke 3:6c7324997606 674 * Definition of the open wire detect differential ended input channel pair menu items and menu itself
mahphalke 3:6c7324997606 675 */
mahphalke 3:6c7324997606 676 console_menu_item open_wire_detect_de_channel_items[] = {
mahphalke 3:6c7324997606 677 { "CHN1, CHN2", 'A', menu_select_chn_pair, ((ADC_CHN(1) << CHN_PAIR_OFFSET) | ADC_CHN(2)) },
mahphalke 3:6c7324997606 678 { "CHN5, CHN6", 'B', menu_select_chn_pair, ((ADC_CHN(5) << CHN_PAIR_OFFSET) | ADC_CHN(6)) },
mahphalke 3:6c7324997606 679 { "CHN9, CHN10", 'C', menu_select_chn_pair, ((ADC_CHN(9) << CHN_PAIR_OFFSET) | ADC_CHN(10)) },
mahphalke 3:6c7324997606 680 { "CHN13, CHN14", 'D', menu_select_chn_pair, ((ADC_CHN(13) << CHN_PAIR_OFFSET) | ADC_CHN(14)) },
mahphalke 3:6c7324997606 681 };
mahphalke 3:6c7324997606 682
mahphalke 3:6c7324997606 683 console_menu open_wire_detect_de_channel_menu = {
mahphalke 3:6c7324997606 684 .title = "Select Channel Pair",
mahphalke 3:6c7324997606 685 .items = open_wire_detect_de_channel_items,
mahphalke 3:6c7324997606 686 .itemCount = ARRAY_SIZE(open_wire_detect_de_channel_items),
mahphalke 3:6c7324997606 687 .headerItem = NULL,
mahphalke 3:6c7324997606 688 .footerItem = NULL,
mahphalke 3:6c7324997606 689 .enableEscapeKey = true
mahphalke 3:6c7324997606 690 };
mahphalke 3:6c7324997606 691
mahphalke 3:6c7324997606 692
mahphalke 3:6c7324997606 693 /*
mahphalke 3:6c7324997606 694 * Definition of the open wire detect single ended analog inputs menu items and menu itself
mahphalke 3:6c7324997606 695 */
mahphalke 3:6c7324997606 696 console_menu_item open_wire_detect_se_analog_input_items[] = {
mahphalke 3:6c7324997606 697 { "VIN0, VINCOM", 'A', menu_select_input_pair, ((VIN0_INPUT_BITS << VIN_PAIR_OFFSET) | VINCOM_INPUT_BITS) },
mahphalke 3:6c7324997606 698 { "VIN1, VINCOM", 'B', menu_select_input_pair, ((VIN1_INPUT_BITS << VIN_PAIR_OFFSET) | VINCOM_INPUT_BITS) },
mahphalke 3:6c7324997606 699 { "VIN2, VINCOM", 'C', menu_select_input_pair, ((VIN2_INPUT_BITS << VIN_PAIR_OFFSET) | VINCOM_INPUT_BITS) },
mahphalke 3:6c7324997606 700 { "VIN3, VINCOM", 'D', menu_select_input_pair, ((VIN3_INPUT_BITS << VIN_PAIR_OFFSET) | VINCOM_INPUT_BITS) },
mahphalke 3:6c7324997606 701 { "VIN4, VINCOM", 'E', menu_select_input_pair, ((VIN4_INPUT_BITS << VIN_PAIR_OFFSET) | VINCOM_INPUT_BITS) },
mahphalke 3:6c7324997606 702 { "VIN5, VINCOM", 'F', menu_select_input_pair, ((VIN5_INPUT_BITS << VIN_PAIR_OFFSET) | VINCOM_INPUT_BITS) },
mahphalke 3:6c7324997606 703 { "VIN6, VINCOM", 'G', menu_select_input_pair, ((VIN6_INPUT_BITS << VIN_PAIR_OFFSET) | VINCOM_INPUT_BITS) },
mahphalke 3:6c7324997606 704 { "VIN7, VINCOM", 'H', menu_select_input_pair, ((VIN7_INPUT_BITS << VIN_PAIR_OFFSET) | VINCOM_INPUT_BITS) },
mahphalke 3:6c7324997606 705 };
mahphalke 3:6c7324997606 706
mahphalke 3:6c7324997606 707 console_menu open_wire_detect_se_analog_input_menu = {
mahphalke 3:6c7324997606 708 .title = "Select Analog Inputs",
mahphalke 3:6c7324997606 709 .items = open_wire_detect_se_analog_input_items,
mahphalke 3:6c7324997606 710 .itemCount = ARRAY_SIZE(open_wire_detect_se_analog_input_items),
mahphalke 3:6c7324997606 711 .headerItem = NULL,
mahphalke 3:6c7324997606 712 .footerItem = NULL,
mahphalke 3:6c7324997606 713 .enableEscapeKey = true
mahphalke 3:6c7324997606 714 };
mahphalke 3:6c7324997606 715
mahphalke 3:6c7324997606 716
mahphalke 3:6c7324997606 717 /*
mahphalke 3:6c7324997606 718 * Definition of the open wire detect differential ended analog inputs menu items and menu itself
mahphalke 3:6c7324997606 719 */
mahphalke 3:6c7324997606 720 console_menu_item open_wire_detect_de_analog_input_items[] = {
mahphalke 3:6c7324997606 721 { "VIN0, VIN1", 'A', menu_select_input_pair, ((VIN0_INPUT_BITS << VIN_PAIR_OFFSET) | VIN1_INPUT_BITS) },
mahphalke 3:6c7324997606 722 { "VIN2, VIN3", 'B', menu_select_input_pair, ((VIN2_INPUT_BITS << VIN_PAIR_OFFSET) | VIN3_INPUT_BITS) },
mahphalke 3:6c7324997606 723 { "VIN4, VIN5", 'C', menu_select_input_pair, ((VIN4_INPUT_BITS << VIN_PAIR_OFFSET) | VIN5_INPUT_BITS) },
mahphalke 3:6c7324997606 724 { "VIN6, VIN7", 'D', menu_select_input_pair, ((VIN6_INPUT_BITS << VIN_PAIR_OFFSET) | VIN7_INPUT_BITS) },
mahphalke 3:6c7324997606 725 };
mahphalke 3:6c7324997606 726
mahphalke 3:6c7324997606 727 console_menu open_wire_detect_de_analog_input_menu = {
mahphalke 3:6c7324997606 728 .title = "Select Analog Inputs",
mahphalke 3:6c7324997606 729 .items = open_wire_detect_de_analog_input_items,
mahphalke 3:6c7324997606 730 .itemCount = ARRAY_SIZE(open_wire_detect_de_analog_input_items),
mahphalke 3:6c7324997606 731 .headerItem = NULL,
mahphalke 3:6c7324997606 732 .footerItem = NULL,
mahphalke 3:6c7324997606 733 .enableEscapeKey = true
mahphalke 3:6c7324997606 734 };
mahphalke 3:6c7324997606 735
mahphalke 3:6c7324997606 736
mahphalke 3:6c7324997606 737 /*
mahphalke 1:48914f9593f1 738 * Definition of the adc register read/write menu items and menu itself
mahphalke 1:48914f9593f1 739 */
mahphalke 1:48914f9593f1 740 console_menu_item reg_read_write_items[] = {
mahphalke 1:48914f9593f1 741 { "Read Device Register", 'R', menu_rw_ad717x_register, DEVICE_REG_READ_ID },
mahphalke 1:48914f9593f1 742 { "Write Device Register", 'W', menu_rw_ad717x_register, DEVICE_REG_WRITE_ID },
mahphalke 1:48914f9593f1 743 };
mahphalke 1:48914f9593f1 744
mahphalke 1:48914f9593f1 745 console_menu reg_read_write_menu = {
mahphalke 1:48914f9593f1 746 .title = "Register Read/Write Menu",
mahphalke 1:48914f9593f1 747 .items = reg_read_write_items,
mahphalke 1:48914f9593f1 748 .itemCount = ARRAY_SIZE(reg_read_write_items),
mahphalke 1:48914f9593f1 749 .headerItem = NULL,
mahphalke 1:48914f9593f1 750 .footerItem = NULL,
mahphalke 1:48914f9593f1 751 .enableEscapeKey = true
mahphalke 1:48914f9593f1 752 };
mahphalke 1:48914f9593f1 753
mahphalke 1:48914f9593f1 754
mahphalke 1:48914f9593f1 755 /*
mahphalke 1:48914f9593f1 756 * Definition of the sampling menu items and menu itself
mahphalke 1:48914f9593f1 757 */
mahphalke 1:48914f9593f1 758 console_menu_item acquisition_menu_items[] = {
mahphalke 1:48914f9593f1 759 { "Single Conversion Mode", 'S', menu_single_conversion },
mahphalke 1:48914f9593f1 760 { "Continuous Conversion Mode - Table View", 'T', menu_continuous_conversion_tabular },
mahphalke 1:48914f9593f1 761 { "Continuous Conversion Mode - Stream Data", 'C', menu_continuous_conversion_stream },
mahphalke 1:48914f9593f1 762 };
mahphalke 1:48914f9593f1 763
mahphalke 1:48914f9593f1 764 console_menu acquisition_menu = {
mahphalke 1:48914f9593f1 765 .title = "Data Acquisition Menu",
mahphalke 1:48914f9593f1 766 .items = acquisition_menu_items,
mahphalke 1:48914f9593f1 767 .itemCount = ARRAY_SIZE(acquisition_menu_items),
mahphalke 1:48914f9593f1 768 .headerItem = NULL,
mahphalke 1:48914f9593f1 769 .footerItem = NULL,
mahphalke 1:48914f9593f1 770 .enableEscapeKey = true
mahphalke 1:48914f9593f1 771 };
mahphalke 1:48914f9593f1 772
mahphalke 1:48914f9593f1 773
mahphalke 1:48914f9593f1 774 /*
mahphalke 1:48914f9593f1 775 * Definition of the filter select menu items and menu itself
mahphalke 1:48914f9593f1 776 */
mahphalke 1:48914f9593f1 777 console_menu_item filter_select_items[] = {
mahphalke 1:48914f9593f1 778 { "Sinc5+1", 'A', menu_filter_select, SINC5_SINC1_FILTER },
mahphalke 1:48914f9593f1 779 { "Sinc3", 'B', menu_filter_select, SINC3_FILTER },
mahphalke 1:48914f9593f1 780 };
mahphalke 1:48914f9593f1 781
mahphalke 1:48914f9593f1 782 console_menu filter_select_menu = {
mahphalke 1:48914f9593f1 783 .title = "Filter Selection Menu",
mahphalke 1:48914f9593f1 784 .items = filter_select_items,
mahphalke 1:48914f9593f1 785 .itemCount = ARRAY_SIZE(filter_select_items),
mahphalke 1:48914f9593f1 786 .headerItem = NULL,
mahphalke 1:48914f9593f1 787 .footerItem = NULL,
mahphalke 1:48914f9593f1 788 .enableEscapeKey = true
mahphalke 1:48914f9593f1 789 };
mahphalke 1:48914f9593f1 790
mahphalke 1:48914f9593f1 791
mahphalke 1:48914f9593f1 792 /*
mahphalke 1:48914f9593f1 793 * Definition of the postfilter enable/disable menu items and menu itself
mahphalke 1:48914f9593f1 794 */
mahphalke 1:48914f9593f1 795 console_menu_item postfilter_enable_disable_items[] = {
mahphalke 1:48914f9593f1 796 { "Enable", 'E', menu_postfiler_enable_disable, SELECT_ENABLE },
mahphalke 1:48914f9593f1 797 { "Disable", 'D', menu_postfiler_enable_disable, SELECT_DISBLE },
mahphalke 1:48914f9593f1 798 };
mahphalke 1:48914f9593f1 799
mahphalke 1:48914f9593f1 800 console_menu postfilter_enable_disable_menu = {
mahphalke 1:48914f9593f1 801 .title = "Post-filter Enable/Disable Menu",
mahphalke 1:48914f9593f1 802 .items = postfilter_enable_disable_items,
mahphalke 1:48914f9593f1 803 .itemCount = ARRAY_SIZE(postfilter_enable_disable_items),
mahphalke 1:48914f9593f1 804 .headerItem = NULL,
mahphalke 1:48914f9593f1 805 .footerItem = NULL,
mahphalke 1:48914f9593f1 806 .enableEscapeKey = true
mahphalke 1:48914f9593f1 807 };
mahphalke 1:48914f9593f1 808
mahphalke 1:48914f9593f1 809
mahphalke 1:48914f9593f1 810 /*
mahphalke 1:48914f9593f1 811 * Definition of the post-filter select menu items and menu itself
mahphalke 1:48914f9593f1 812 */
mahphalke 1:48914f9593f1 813 console_menu_item postfilter_select_items[] = {
mahphalke 1:48914f9593f1 814 { "27 SPS, 47 dB reject, 36.7 ms settling ",'A', menu_postfiler_select, POST_FLTR_27_SPS },
mahphalke 1:48914f9593f1 815 { "25 SPS, 62 dB reject, 40 ms settling", 'B', menu_postfiler_select, POST_FLTR_25_SPS },
mahphalke 1:48914f9593f1 816 { "20 SPS, 86 dB reject, 50 ms settling", 'C', menu_postfiler_select, POST_FLTR_20_SPS },
mahphalke 1:48914f9593f1 817 { "16.67 SPS, 92 dB reject, 60 ms settling",'D', menu_postfiler_select, POST_FLTR_16_67_SPS },
mahphalke 1:48914f9593f1 818 };
mahphalke 1:48914f9593f1 819
mahphalke 1:48914f9593f1 820 console_menu postfilter_select_menu = {
mahphalke 1:48914f9593f1 821 .title = "Post-filter Selection Menu",
mahphalke 1:48914f9593f1 822 .items = postfilter_select_items,
mahphalke 1:48914f9593f1 823 .itemCount = ARRAY_SIZE(postfilter_select_items),
mahphalke 1:48914f9593f1 824 .headerItem = NULL,
mahphalke 1:48914f9593f1 825 .footerItem = NULL,
mahphalke 1:48914f9593f1 826 .enableEscapeKey = true
mahphalke 1:48914f9593f1 827 };
mahphalke 1:48914f9593f1 828
mahphalke 1:48914f9593f1 829
mahphalke 1:48914f9593f1 830 /*
mahphalke 1:48914f9593f1 831 * Definition of the SINC5+SINC1 ODR select menu items and menu itself
mahphalke 1:48914f9593f1 832 */
mahphalke 1:48914f9593f1 833 console_menu_item sinc5_1_data_rate_select_items[] = {
Mahesh Phalke 6:28e40a21857f 834 #if defined(DEV_AD4115)
Mahesh Phalke 6:28e40a21857f 835 { ODR_125000_STR, 'A', menu_odr_select, ODR_125000_BITS },
Mahesh Phalke 6:28e40a21857f 836 { ODR_62500_STR, 'B', menu_odr_select, ODR_62500_BITS },
Mahesh Phalke 6:28e40a21857f 837 { ODR_31250_STR, 'C', menu_odr_select, ODR_31250_BITS },
Mahesh Phalke 6:28e40a21857f 838 { ODR_25000_STR, 'D', menu_odr_select, ODR_25000_BITS },
Mahesh Phalke 6:28e40a21857f 839 { ODR_15625_STR, 'E', menu_odr_select, ODR_15625_BITS },
Mahesh Phalke 6:28e40a21857f 840 { ODR_10417_STR, 'F', menu_odr_select, ODR_10417_BITS },
Mahesh Phalke 6:28e40a21857f 841 { ODR_5000_STR, 'G', menu_odr_select, ODR_5000_BITS },
Mahesh Phalke 6:28e40a21857f 842 { ODR_2500_STR, 'H', menu_odr_select, ODR_2500_BITS },
Mahesh Phalke 6:28e40a21857f 843 { ODR_1000_STR, 'I', menu_odr_select, ODR_1000_BITS },
Mahesh Phalke 6:28e40a21857f 844 { ODR_500_STR, 'J', menu_odr_select, ODR_500_BITS },
Mahesh Phalke 6:28e40a21857f 845 { ODR_397_5_STR, 'K', menu_odr_select, ODR_397_5_BITS },
Mahesh Phalke 6:28e40a21857f 846 { ODR_200_STR, 'L', menu_odr_select, ODR_200_BITS },
Mahesh Phalke 6:28e40a21857f 847 { ODR_100_STR, 'M', menu_odr_select, ODR_100_BITS },
Mahesh Phalke 6:28e40a21857f 848 { ODR_59_98_STR, 'N', menu_odr_select, ODR_59_98_BITS },
Mahesh Phalke 6:28e40a21857f 849 { ODR_49_96_STR, 'O', menu_odr_select, ODR_49_96_BITS },
Mahesh Phalke 6:28e40a21857f 850 { ODR_20_STR, 'P', menu_odr_select, ODR_20_BITS },
Mahesh Phalke 6:28e40a21857f 851 { ODR_16_67_STR, 'Q', menu_odr_select, ODR_16_67_BITS },
Mahesh Phalke 6:28e40a21857f 852 { ODR_10_STR, 'R', menu_odr_select, ODR_10_BITS },
Mahesh Phalke 6:28e40a21857f 853 { ODR_5_STR, 'S', menu_odr_select, ODR_5_BITS },
Mahesh Phalke 6:28e40a21857f 854 { ODR_2_5_STR, 'T', menu_odr_select, ODR_2_5_BITS },
Mahesh Phalke 6:28e40a21857f 855 #elif defined(DEV_AD4111) || defined(DEV_AD4112) || defined(DEV_AD4114) || \
Mahesh Phalke 6:28e40a21857f 856 defined(DEV_AD7172_2) || defined(DEV_AD7172_4) || defined(DEV_AD7173_8)
mahphalke 1:48914f9593f1 857 { ODR_31250_STR, 'A', menu_odr_select, ODR_31250_BITS },
mahphalke 1:48914f9593f1 858 { ODR_15625_STR, 'B', menu_odr_select, ODR_15625_BITS },
mahphalke 1:48914f9593f1 859 { ODR_10417_STR, 'C', menu_odr_select, ODR_10417_BITS },
mahphalke 1:48914f9593f1 860 { ODR_5208_STR, 'D', menu_odr_select, ODR_5208_BITS },
mahphalke 1:48914f9593f1 861 { ODR_2597_STR, 'E', menu_odr_select, ODR_2597_BITS },
mahphalke 1:48914f9593f1 862 { ODR_1007_STR, 'F', menu_odr_select, ODR_1007_BITS },
mahphalke 1:48914f9593f1 863 { ODR_503_8_STR, 'G', menu_odr_select, ODR_503_8_BITS },
mahphalke 1:48914f9593f1 864 { ODR_381_STR, 'H', menu_odr_select, ODR_381_BITS },
mahphalke 1:48914f9593f1 865 { ODR_200_3_STR, 'I', menu_odr_select, ODR_200_3_BITS },
mahphalke 1:48914f9593f1 866 { ODR_100_2_STR, 'J', menu_odr_select, ODR_100_2_BITS },
mahphalke 1:48914f9593f1 867 { ODR_59_52_STR, 'K', menu_odr_select, ODR_59_52_BITS },
mahphalke 1:48914f9593f1 868 { ODR_49_68_STR, 'L', menu_odr_select, ODR_49_68_BITS },
mahphalke 1:48914f9593f1 869 { ODR_20_01_STR, 'M', menu_odr_select, ODR_20_01_BITS },
mahphalke 1:48914f9593f1 870 { ODR_16_63_STR, 'N', menu_odr_select, ODR_16_63_BITS },
mahphalke 1:48914f9593f1 871 { ODR_10_STR, 'O', menu_odr_select, ODR_10_BITS },
mahphalke 1:48914f9593f1 872 { ODR_5_STR, 'P', menu_odr_select, ODR_5_BITS },
mahphalke 1:48914f9593f1 873 { ODR_2_5_STR, 'Q', menu_odr_select, ODR_2_5_BITS },
mahphalke 1:48914f9593f1 874 { ODR_1_25_STR, 'R', menu_odr_select, ODR_1_25_BITS },
mahphalke 1:48914f9593f1 875 #elif defined(DEV_AD7176_2) || defined(DEV_AD7175_2) || \
mahphalke 1:48914f9593f1 876 defined(DEV_AD7175_8) || defined(DEV_AD7177_2)
mahphalke 1:48914f9593f1 877 #if (DEV_AD7176_2) || defined(DEV_AD7175_2) || defined(DEV_AD7175_8)
mahphalke 1:48914f9593f1 878 { ODR_250000_STR, 'A', menu_odr_select, ODR_250000_BITS },
mahphalke 1:48914f9593f1 879 { ODR_125000_STR, 'B', menu_odr_select, ODR_125000_BITS },
mahphalke 1:48914f9593f1 880 { ODR_62500_STR, 'C', menu_odr_select, ODR_62500_BITS },
mahphalke 1:48914f9593f1 881 { ODR_50000_STR, 'D', menu_odr_select, ODR_50000_BITS },
mahphalke 1:48914f9593f1 882 { ODR_31250_STR, 'E', menu_odr_select, ODR_31250_BITS },
mahphalke 1:48914f9593f1 883 { ODR_25000_STR, 'F', menu_odr_select, ODR_25000_BITS },
mahphalke 1:48914f9593f1 884 { ODR_15625_STR, 'G', menu_odr_select, ODR_15625_BITS },
mahphalke 1:48914f9593f1 885 #endif
mahphalke 1:48914f9593f1 886 { ODR_10000_STR, 'H', menu_odr_select, ODR_10000_BITS },
mahphalke 1:48914f9593f1 887 { ODR_5000_STR, 'I', menu_odr_select, ODR_5000_BITS },
mahphalke 1:48914f9593f1 888 { ODR_2500_STR, 'J', menu_odr_select, ODR_2500_BITS },
mahphalke 1:48914f9593f1 889 { ODR_1000_STR, 'K', menu_odr_select, ODR_1000_BITS },
mahphalke 1:48914f9593f1 890 { ODR_500_STR, 'L', menu_odr_select, ODR_500_BITS },
mahphalke 1:48914f9593f1 891 { ODR_397_5_STR, 'M', menu_odr_select, ODR_397_5_BITS },
mahphalke 1:48914f9593f1 892 { ODR_200_STR, 'N', menu_odr_select, ODR_200_BITS },
mahphalke 1:48914f9593f1 893 { ODR_100_STR, 'O', menu_odr_select, ODR_100_BITS },
mahphalke 1:48914f9593f1 894 { ODR_59_94_STR, 'P', menu_odr_select, ODR_59_94_BITS },
mahphalke 1:48914f9593f1 895 { ODR_49_96_STR, 'Q', menu_odr_select, ODR_49_96_BITS },
mahphalke 1:48914f9593f1 896 { ODR_20_STR, 'R', menu_odr_select, ODR_20_BITS },
mahphalke 1:48914f9593f1 897 { ODR_16_67_STR, 'S', menu_odr_select, ODR_16_67_BITS },
mahphalke 1:48914f9593f1 898 { ODR_10_STR, 'T', menu_odr_select, ODR_10_BITS },
mahphalke 1:48914f9593f1 899 { ODR_5_STR, 'U', menu_odr_select, ODR_5_BITS },
mahphalke 1:48914f9593f1 900 #endif
mahphalke 1:48914f9593f1 901 };
mahphalke 1:48914f9593f1 902
mahphalke 1:48914f9593f1 903 console_menu sinc5_1_data_rate_select_menu = {
mahphalke 1:48914f9593f1 904 .title = "ODR Selection Menu",
mahphalke 1:48914f9593f1 905 .items = sinc5_1_data_rate_select_items,
mahphalke 1:48914f9593f1 906 .itemCount = ARRAY_SIZE(sinc5_1_data_rate_select_items),
mahphalke 1:48914f9593f1 907 .headerItem = NULL,
mahphalke 1:48914f9593f1 908 .footerItem = NULL,
mahphalke 1:48914f9593f1 909 .enableEscapeKey = true
mahphalke 1:48914f9593f1 910 };
mahphalke 1:48914f9593f1 911
mahphalke 1:48914f9593f1 912
mahphalke 1:48914f9593f1 913 /*
mahphalke 1:48914f9593f1 914 * Definition of the SINC3 ODR select menu items and menu itself
mahphalke 1:48914f9593f1 915 */
mahphalke 1:48914f9593f1 916 console_menu_item sinc3_data_rate_select_items[] = {
Mahesh Phalke 6:28e40a21857f 917 #if defined(DEV_AD4115)
Mahesh Phalke 6:28e40a21857f 918 { ODR_125000_STR, 'A', menu_odr_select, ODR_125000_BITS },
Mahesh Phalke 6:28e40a21857f 919 { ODR_62500_STR, 'B', menu_odr_select, ODR_62500_BITS },
Mahesh Phalke 6:28e40a21857f 920 { ODR_31250_STR, 'C', menu_odr_select, ODR_31250_BITS },
Mahesh Phalke 6:28e40a21857f 921 { ODR_25000_STR, 'D', menu_odr_select, ODR_25000_BITS },
Mahesh Phalke 6:28e40a21857f 922 { ODR_15625_STR, 'E', menu_odr_select, ODR_15625_BITS },
Mahesh Phalke 6:28e40a21857f 923 { ODR_10417_STR, 'F', menu_odr_select, ODR_10417_BITS },
Mahesh Phalke 6:28e40a21857f 924 { ODR_5000_STR, 'G', menu_odr_select, ODR_5000_BITS },
Mahesh Phalke 6:28e40a21857f 925 { ODR_3906_STR, 'H', menu_odr_select, ODR_3906_BITS },
Mahesh Phalke 6:28e40a21857f 926 { ODR_1157_STR, 'I', menu_odr_select, ODR_1157_BITS },
Mahesh Phalke 6:28e40a21857f 927 { ODR_539_STR, 'J', menu_odr_select, ODR_539_BITS },
Mahesh Phalke 6:28e40a21857f 928 { ODR_401_STR, 'K', menu_odr_select, ODR_401_BITS },
Mahesh Phalke 6:28e40a21857f 929 { ODR_206_STR, 'L', menu_odr_select, ODR_206_BITS },
Mahesh Phalke 6:28e40a21857f 930 { ODR_102_STR, 'M', menu_odr_select, ODR_102_BITS },
Mahesh Phalke 6:28e40a21857f 931 { ODR_59_98_STR, 'N', menu_odr_select, ODR_59_98_BITS },
Mahesh Phalke 6:28e40a21857f 932 { ODR_50_STR, 'O', menu_odr_select, ODR_50_BITS },
Mahesh Phalke 6:28e40a21857f 933 { ODR_20_STR, 'P', menu_odr_select, ODR_20_BITS },
Mahesh Phalke 6:28e40a21857f 934 { ODR_16_67_STR, 'Q', menu_odr_select, ODR_16_67_BITS },
Mahesh Phalke 6:28e40a21857f 935 { ODR_10_STR, 'R', menu_odr_select, ODR_10_BITS },
Mahesh Phalke 6:28e40a21857f 936 { ODR_5_STR, 'S', menu_odr_select, ODR_5_BITS },
Mahesh Phalke 6:28e40a21857f 937 { ODR_2_5_STR, 'T', menu_odr_select, ODR_2_5_BITS },
Mahesh Phalke 6:28e40a21857f 938 #elif defined(DEV_AD4111) || defined(DEV_AD4112) || defined(DEV_AD4114) || \
Mahesh Phalke 6:28e40a21857f 939 defined(DEV_AD7172_2) || defined(DEV_AD7172_4) || defined(DEV_AD7173_8)
mahphalke 1:48914f9593f1 940 { ODR_31250_STR, 'A', menu_odr_select, ODR_31250_BITS },
mahphalke 1:48914f9593f1 941 { ODR_15625_STR, 'B', menu_odr_select, ODR_15625_BITS },
mahphalke 1:48914f9593f1 942 { ODR_10417_STR, 'C', menu_odr_select, ODR_10417_BITS },
mahphalke 1:48914f9593f1 943 { ODR_5208_STR, 'D', menu_odr_select, ODR_5208_BITS },
Mahesh Phalke 6:28e40a21857f 944 #if defined(DEV_AD4111) || defined(DEV_AD4112) || defined(DEV_AD4114)
mahphalke 1:48914f9593f1 945 { ODR_3906_STR, 'E', menu_odr_select, ODR_3906_BITS },
mahphalke 1:48914f9593f1 946 { ODR_1157_STR, 'F', menu_odr_select, ODR_1157_BITS },
mahphalke 1:48914f9593f1 947 { ODR_539_STR, 'G', menu_odr_select, ODR_539_BITS },
mahphalke 1:48914f9593f1 948 { ODR_401_STR, 'H', menu_odr_select, ODR_401_BITS },
mahphalke 1:48914f9593f1 949 { ODR_206_STR, 'H', menu_odr_select, ODR_206_BITS },
mahphalke 1:48914f9593f1 950 { ODR_102_STR, 'I', menu_odr_select, ODR_102_BITS },
mahphalke 1:48914f9593f1 951 #else
mahphalke 1:48914f9593f1 952 { ODR_2604_STR, 'E', menu_odr_select, ODR_2604_BITS },
mahphalke 1:48914f9593f1 953 { ODR_1008_STR, 'F', menu_odr_select, ODR_1008_BITS },
mahphalke 1:48914f9593f1 954 { ODR_504_STR, 'G', menu_odr_select, ODR_504_BITS },
mahphalke 1:48914f9593f1 955 { ODR_400_6_STR, 'H', menu_odr_select, ODR_400_6_BITS },
mahphalke 1:48914f9593f1 956 { ODR_200_3_STR, 'H', menu_odr_select, ODR_200_3_BITS },
mahphalke 1:48914f9593f1 957 { ODR_100_2_STR, 'I', menu_odr_select, ODR_100_2_BITS },
mahphalke 1:48914f9593f1 958 #endif
mahphalke 1:48914f9593f1 959 { ODR_59_98_STR, 'J', menu_odr_select, ODR_59_98_BITS },
mahphalke 1:48914f9593f1 960 { ODR_50_STR, 'K', menu_odr_select, ODR_50_BITS },
mahphalke 1:48914f9593f1 961 { ODR_20_01_STR, 'L', menu_odr_select, ODR_20_01_BITS },
mahphalke 1:48914f9593f1 962 { ODR_16_67_STR, 'M', menu_odr_select, ODR_16_67_BITS },
mahphalke 1:48914f9593f1 963 { ODR_10_STR, 'N', menu_odr_select, ODR_10_BITS },
mahphalke 1:48914f9593f1 964 { ODR_5_STR, 'O', menu_odr_select, ODR_5_BITS },
mahphalke 1:48914f9593f1 965 { ODR_2_5_STR, 'P', menu_odr_select, ODR_2_5_BITS },
mahphalke 1:48914f9593f1 966 { ODR_1_25_STR, 'Q', menu_odr_select, ODR_1_25_BITS },
mahphalke 1:48914f9593f1 967 #elif defined(DEV_AD7176_2) || defined(DEV_AD7175_2) || \
mahphalke 1:48914f9593f1 968 defined(DEV_AD7175_8) || defined(DEV_AD7177_2)
mahphalke 1:48914f9593f1 969 #if (DEV_AD7176_2) || defined(DEV_AD7175_2) || defined(DEV_AD7175_8)
mahphalke 1:48914f9593f1 970 { ODR_250000_STR, 'A', menu_odr_select, ODR_250000_BITS },
mahphalke 1:48914f9593f1 971 { ODR_125000_STR, 'B', menu_odr_select, ODR_125000_BITS },
mahphalke 1:48914f9593f1 972 { ODR_62500_STR, 'C', menu_odr_select, ODR_62500_BITS },
mahphalke 1:48914f9593f1 973 { ODR_50000_STR, 'D', menu_odr_select, ODR_50000_BITS },
mahphalke 1:48914f9593f1 974 { ODR_31250_STR, 'E', menu_odr_select, ODR_31250_BITS },
mahphalke 1:48914f9593f1 975 { ODR_25000_STR, 'F', menu_odr_select, ODR_25000_BITS },
mahphalke 1:48914f9593f1 976 { ODR_15625_STR, 'G', menu_odr_select, ODR_15625_BITS },
mahphalke 1:48914f9593f1 977 #endif
mahphalke 1:48914f9593f1 978 { ODR_10000_STR, 'H', menu_odr_select, ODR_10000_BITS },
mahphalke 1:48914f9593f1 979 { ODR_5000_STR, 'I', menu_odr_select, ODR_5000_BITS },
mahphalke 1:48914f9593f1 980 { ODR_2500_STR, 'J', menu_odr_select, ODR_2500_BITS },
mahphalke 1:48914f9593f1 981 { ODR_1000_STR, 'K', menu_odr_select, ODR_1000_BITS },
mahphalke 1:48914f9593f1 982 { ODR_500_STR, 'L', menu_odr_select, ODR_500_BITS },
mahphalke 1:48914f9593f1 983 { ODR_400_STR , 'M', menu_odr_select, ODR_400_BITS },
mahphalke 1:48914f9593f1 984 { ODR_200_STR, 'N', menu_odr_select, ODR_200_BITS },
mahphalke 1:48914f9593f1 985 { ODR_100_STR, 'O', menu_odr_select, ODR_100_BITS },
mahphalke 1:48914f9593f1 986 { ODR_60_STR, 'P', menu_odr_select, ODR_60_BITS },
mahphalke 1:48914f9593f1 987 { ODR_50_STR, 'Q', menu_odr_select, ODR_50_BITS },
mahphalke 1:48914f9593f1 988 { ODR_20_STR, 'R', menu_odr_select, ODR_20_BITS },
mahphalke 1:48914f9593f1 989 { ODR_16_67_STR, 'S', menu_odr_select, ODR_16_67_BITS },
mahphalke 1:48914f9593f1 990 { ODR_10_STR, 'T', menu_odr_select, ODR_10_BITS },
mahphalke 1:48914f9593f1 991 { ODR_5_STR, 'U', menu_odr_select, ODR_5_BITS },
mahphalke 1:48914f9593f1 992 #endif
mahphalke 1:48914f9593f1 993 };
mahphalke 1:48914f9593f1 994
mahphalke 1:48914f9593f1 995 console_menu sinc3_data_rate_select_menu = {
mahphalke 1:48914f9593f1 996 .title = "ODR Selection Menu",
mahphalke 1:48914f9593f1 997 .items = sinc3_data_rate_select_items,
mahphalke 1:48914f9593f1 998 .itemCount = ARRAY_SIZE(sinc3_data_rate_select_items),
mahphalke 1:48914f9593f1 999 .headerItem = NULL,
mahphalke 1:48914f9593f1 1000 .footerItem = NULL,
mahphalke 1:48914f9593f1 1001 .enableEscapeKey = true
mahphalke 1:48914f9593f1 1002 };
mahphalke 1:48914f9593f1 1003
mahphalke 1:48914f9593f1 1004
mahphalke 1:48914f9593f1 1005 /*
mahphalke 1:48914f9593f1 1006 * Definition of the polarity select menu items and menu itself
mahphalke 1:48914f9593f1 1007 */
mahphalke 1:48914f9593f1 1008 console_menu_item polarity_select_items[] = {
mahphalke 1:48914f9593f1 1009 { "Unipolar", 'U', menu_polarity_select, UNIPOLAR },
mahphalke 1:48914f9593f1 1010 { "Bipolar", 'B', menu_polarity_select, BIPOLAR },
mahphalke 1:48914f9593f1 1011 };
mahphalke 1:48914f9593f1 1012
mahphalke 1:48914f9593f1 1013 console_menu polarity_select_menu = {
mahphalke 1:48914f9593f1 1014 .title = "Polarity Selection Menu",
mahphalke 1:48914f9593f1 1015 .items = polarity_select_items,
mahphalke 1:48914f9593f1 1016 .itemCount = ARRAY_SIZE(polarity_select_items),
mahphalke 1:48914f9593f1 1017 .headerItem = NULL,
mahphalke 1:48914f9593f1 1018 .footerItem = NULL,
mahphalke 1:48914f9593f1 1019 .enableEscapeKey = true
mahphalke 1:48914f9593f1 1020 };
mahphalke 1:48914f9593f1 1021
mahphalke 1:48914f9593f1 1022
mahphalke 1:48914f9593f1 1023 /*
mahphalke 1:48914f9593f1 1024 * Definition of the refernce source selection menu items and menu itself
mahphalke 1:48914f9593f1 1025 */
mahphalke 1:48914f9593f1 1026 console_menu_item reference_select_items[] = {
mahphalke 1:48914f9593f1 1027 { "External", 'A', menu_reference_source_select, EXTERNAL },
mahphalke 1:48914f9593f1 1028 { "Internal", 'B', menu_reference_source_select, INTERNAL },
mahphalke 1:48914f9593f1 1029 { "AVDD-AVSS", 'C', menu_reference_source_select, AVDD_AVSS },
mahphalke 1:48914f9593f1 1030 };
mahphalke 1:48914f9593f1 1031
mahphalke 1:48914f9593f1 1032 console_menu reference_select_menu = {
mahphalke 1:48914f9593f1 1033 .title = "Reference Selection Menu",
mahphalke 1:48914f9593f1 1034 .items = reference_select_items,
mahphalke 1:48914f9593f1 1035 .itemCount = ARRAY_SIZE(reference_select_items),
mahphalke 1:48914f9593f1 1036 .headerItem = NULL,
mahphalke 1:48914f9593f1 1037 .footerItem = NULL,
mahphalke 1:48914f9593f1 1038 .enableEscapeKey = true
mahphalke 1:48914f9593f1 1039 };
mahphalke 1:48914f9593f1 1040
mahphalke 1:48914f9593f1 1041
mahphalke 1:48914f9593f1 1042 /*
mahphalke 1:48914f9593f1 1043 * Definition of the reference buffer enable/disable menu items and menu itself
mahphalke 1:48914f9593f1 1044 */
mahphalke 1:48914f9593f1 1045 console_menu_item ref_buffer_enable_disable_items[] = {
mahphalke 1:48914f9593f1 1046 { "Enable", 'E', menu_ref_buffer_enable_disable, SELECT_ENABLE },
mahphalke 1:48914f9593f1 1047 { "Disable", 'D', menu_ref_buffer_enable_disable, SELECT_DISBLE },
mahphalke 1:48914f9593f1 1048 };
mahphalke 1:48914f9593f1 1049
mahphalke 1:48914f9593f1 1050 console_menu ref_buffer_enable_disable_menu = {
mahphalke 1:48914f9593f1 1051 .title = "Reference Buffer Enable/Disable Menu",
mahphalke 1:48914f9593f1 1052 .items = ref_buffer_enable_disable_items,
mahphalke 1:48914f9593f1 1053 .itemCount = ARRAY_SIZE(ref_buffer_enable_disable_items),
mahphalke 1:48914f9593f1 1054 .headerItem = NULL,
mahphalke 1:48914f9593f1 1055 .footerItem = NULL,
mahphalke 1:48914f9593f1 1056 .enableEscapeKey = true
mahphalke 1:48914f9593f1 1057 };
mahphalke 1:48914f9593f1 1058
mahphalke 1:48914f9593f1 1059
mahphalke 1:48914f9593f1 1060 /*
mahphalke 1:48914f9593f1 1061 * Definition of the reference buffer enable/disable menu items and menu itself
mahphalke 1:48914f9593f1 1062 */
mahphalke 1:48914f9593f1 1063 console_menu_item input_buffer_enable_disable_items[] = {
mahphalke 1:48914f9593f1 1064 { "Enable", 'E', menu_input_buffer_enable_disable, SELECT_ENABLE },
mahphalke 1:48914f9593f1 1065 { "Disable", 'D', menu_input_buffer_enable_disable, SELECT_DISBLE },
mahphalke 1:48914f9593f1 1066 };
mahphalke 1:48914f9593f1 1067
mahphalke 1:48914f9593f1 1068 console_menu input_buffer_enable_disable_menu = {
mahphalke 1:48914f9593f1 1069 .title = "Input Buffer Enable/Disable Menu",
mahphalke 1:48914f9593f1 1070 .items = input_buffer_enable_disable_items,
mahphalke 1:48914f9593f1 1071 .itemCount = ARRAY_SIZE(input_buffer_enable_disable_items),
mahphalke 1:48914f9593f1 1072 .headerItem = NULL,
mahphalke 1:48914f9593f1 1073 .footerItem = NULL,
mahphalke 1:48914f9593f1 1074 .enableEscapeKey = true
mahphalke 1:48914f9593f1 1075 };
mahphalke 1:48914f9593f1 1076
mahphalke 1:48914f9593f1 1077
mahphalke 1:48914f9593f1 1078 /*
mahphalke 1:48914f9593f1 1079 * Definition of the Main Menu Items and menu itself
mahphalke 1:48914f9593f1 1080 */
mahphalke 1:48914f9593f1 1081 console_menu_item main_menu_items[] = {
mahphalke 1:48914f9593f1 1082 { "Read Device ID", 'A', menu_read_id },
mahphalke 1:48914f9593f1 1083 { "" },
mahphalke 1:48914f9593f1 1084 { "Read Status Register", 'B', menu_read_status },
mahphalke 1:48914f9593f1 1085 { "" },
mahphalke 1:48914f9593f1 1086 { "Sample Channels", 'C', menu_sample_channels },
mahphalke 1:48914f9593f1 1087 { "" },
mahphalke 1:48914f9593f1 1088 { "Enable/Disable Channels", 'D', menu_chn_enable_disable_display },
mahphalke 1:48914f9593f1 1089 { "" },
mahphalke 1:48914f9593f1 1090 { "Connect Analog Inputs to Channel", 'E', menu_input_chn_connect_display },
mahphalke 1:48914f9593f1 1091 { "" },
mahphalke 1:48914f9593f1 1092 { "Configure and Assign Setup", 'F', menu_config_and_assign_setup },
mahphalke 1:48914f9593f1 1093 { "" },
mahphalke 1:48914f9593f1 1094 { "Display setup", 'G', menu_display_setup },
mahphalke 1:48914f9593f1 1095 { "" },
mahphalke 1:48914f9593f1 1096 { "Read Temperature", 'H', menu_read_temperature },
mahphalke 1:48914f9593f1 1097 { "" },
mahphalke 1:48914f9593f1 1098 { "Calibrate ADC (Internal)", 'I', menu_calibrate_adc },
mahphalke 1:48914f9593f1 1099 { "" },
mahphalke 3:6c7324997606 1100 #if defined(DEV_AD4111)
mahphalke 3:6c7324997606 1101 { "Open Wire Detection", 'J', menu_open_wire_detection },
mahphalke 3:6c7324997606 1102 { "" },
mahphalke 3:6c7324997606 1103 #endif
mahphalke 3:6c7324997606 1104 { "Read/Write Device Registers", 'K', menu_read_write_device_regs },
mahphalke 1:48914f9593f1 1105 };
mahphalke 1:48914f9593f1 1106
mahphalke 1:48914f9593f1 1107 console_menu ad717x_main_menu = {
mahphalke 1:48914f9593f1 1108 .title = "Main Menu",
mahphalke 1:48914f9593f1 1109 .items = main_menu_items,
mahphalke 1:48914f9593f1 1110 .itemCount = ARRAY_SIZE(main_menu_items),
mahphalke 1:48914f9593f1 1111 .headerItem = display_main_menu_header,
mahphalke 1:48914f9593f1 1112 .footerItem = NULL,
mahphalke 1:48914f9593f1 1113 .enableEscapeKey = false
mahphalke 1:48914f9593f1 1114 };
mahphalke 1:48914f9593f1 1115
mahphalke 1:48914f9593f1 1116 /******************************************************************************/
mahphalke 1:48914f9593f1 1117 /************************ Public Declarations *********************************/
mahphalke 1:48914f9593f1 1118 /******************************************************************************/
mahphalke 1:48914f9593f1 1119
mahphalke 1:48914f9593f1 1120 #endif /* AD717X_MENU_DEFINES_H_ */