Example program for AD717x and AD411x family of products.

Dependencies:   adi_console_menu platform_drivers

Committer:
mahphalke
Date:
Tue Mar 31 03:25:23 2020 +0000
Revision:
1:48914f9593f1
Child:
3:6c7324997606
Initial commit for console based AD717x/AD411x mbed example

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