Example program for AD717x and AD411x family of products.

Dependencies:   adi_console_menu platform_drivers

Committer:
mahphalke
Date:
Tue Apr 14 18:14:29 2020 +0000
Revision:
3:6c7324997606
Parent:
1:48914f9593f1
Child:
4:4592cc69bfa6
Implemented the open wire detection functionality for AD4111

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-"
mahphalke 1:48914f9593f1 402 #elif defined(DEV_AD7173_8) || defined(DEV_AD7175_8)
mahphalke 1:48914f9593f1 403 "AIN0", "AIN1", "AIN2", "AIN3", "AIN4", "AIN5",
mahphalke 1:48914f9593f1 404 "AIN6", "AIN7", "AIN8", "AIN9", "AIN10", "AIN11",
mahphalke 1:48914f9593f1 405 "AIN12", "AIN13", "AIN14", "AIN15", "AIN16",
mahphalke 1:48914f9593f1 406 "TEMP+", "TEMP-",
mahphalke 1:48914f9593f1 407 #if defined(DEV_AD7173_8)
mahphalke 1:48914f9593f1 408 "RES", "RES",
mahphalke 1:48914f9593f1 409 #else
mahphalke 1:48914f9593f1 410 "((AVDD1 ? AVSS)/5)+", "((AVDD1 ? AVSS)/5)-",
mahphalke 1:48914f9593f1 411 #endif
mahphalke 1:48914f9593f1 412 "REF+", "REF-"
mahphalke 1:48914f9593f1 413 #elif defined(DEV_AD7172_2) || defined(DEV_AD7177_2) || defined(DEV_AD7175_2)
mahphalke 1:48914f9593f1 414 "AIN0", "AIN1", "AIN2", "AIN3", "AIN4",
mahphalke 1:48914f9593f1 415 "RES", "RES", "RES", "RES", "RES", "RES",
mahphalke 1:48914f9593f1 416 "RES", "RES", "RES", "RES", "RES", "RES",
mahphalke 1:48914f9593f1 417 "TEMP+", "TEMP-", "((AVDD1 ? AVSS)/5)+", "((AVDD1 ? AVSS)/5)-",
mahphalke 1:48914f9593f1 418 "REF+", "REF-"
mahphalke 1:48914f9593f1 419 #elif defined(DEV_AD7172_4)
mahphalke 1:48914f9593f1 420 "AIN0", "AIN1", "AIN2", "AIN3", "AIN4",
mahphalke 1:48914f9593f1 421 "AIN5", "AIN6", "AIN7", "AIN8",
mahphalke 1:48914f9593f1 422 "RES", "RES", "RES", "RES", "RES", "RES",
mahphalke 1:48914f9593f1 423 "TEMP+", "TEMP-", "((AVDD1 ? AVSS)/5)+", "((AVDD1 ? AVSS)/5)-",
mahphalke 1:48914f9593f1 424 "REF+", "REF-"
mahphalke 1:48914f9593f1 425 #elif defined(DEV_AD7176_2)
mahphalke 1:48914f9593f1 426 "AIN0", "AIN1", "AIN2", "AIN3", "AIN4",
mahphalke 1:48914f9593f1 427 "RES", "RES", "RES", "RES", "RES", "RES",
mahphalke 1:48914f9593f1 428 "RES", "RES", "RES", "RES", "RES", "RES",
mahphalke 1:48914f9593f1 429 "RES", "RES", "RES", "RES", "REF+", "REF-"
mahphalke 1:48914f9593f1 430 #endif
mahphalke 1:48914f9593f1 431 };
mahphalke 1:48914f9593f1 432
mahphalke 1:48914f9593f1 433
mahphalke 1:48914f9593f1 434 // SIN5+SINC1 Filter ODR map
mahphalke 1:48914f9593f1 435 const float sinc5_sinc1_odr_map[] = {
mahphalke 1:48914f9593f1 436 #if defined(DEV_AD4111) || defined(DEV_AD4112) || defined(DEV_AD7172_2) || \
mahphalke 1:48914f9593f1 437 defined(DEV_AD7172_4) || defined(DEV_AD7173_8)
mahphalke 1:48914f9593f1 438 ODR_31250, ODR_31250, ODR_31250, ODR_31250, ODR_31250, ODR_31250,
mahphalke 1:48914f9593f1 439 ODR_15625, ODR_10417, ODR_5208, ODR_2597, ODR_1007, ODR_503_8,
mahphalke 1:48914f9593f1 440 ODR_381, ODR_200_3, ODR_100_2, ODR_59_52, ODR_49_68, ODR_20_01,
mahphalke 1:48914f9593f1 441 ODR_16_63, ODR_10, ODR_5, ODR_2_5, ODR_1_25,
mahphalke 1:48914f9593f1 442 #elif defined(DEV_AD7176_2) || defined(DEV_AD7175_2) || defined(DEV_AD7175_8) ||\
mahphalke 1:48914f9593f1 443 defined(DEV_AD7177_2)
mahphalke 1:48914f9593f1 444 #if (DEV_AD7176_2) || defined(DEV_AD7175_2) || defined(DEV_AD7175_8)
mahphalke 1:48914f9593f1 445 ODR_250000, ODR_125000, ODR_62500, ODR_50000, ODR_31250, ODR_25000, ODR_15625,
mahphalke 1:48914f9593f1 446 #elif defined(DEV_AD7177_2)
mahphalke 1:48914f9593f1 447 ODR_0, ODR_0, ODR_0, ODR_0, ODR_0, ODR_0, ODR_0,
mahphalke 1:48914f9593f1 448 #endif
mahphalke 1:48914f9593f1 449 ODR_10000, ODR_5000, ODR_2500, ODR_1000, ODR_500, ODR_397_5, ODR_200,
mahphalke 1:48914f9593f1 450 ODR_100, ODR_59_94, ODR_49_96, ODR_20, ODR_16_67, ODR_10, ODR_5,
mahphalke 1:48914f9593f1 451 ODR_0, ODR_0,
mahphalke 1:48914f9593f1 452 #endif
mahphalke 1:48914f9593f1 453 };
mahphalke 1:48914f9593f1 454
mahphalke 1:48914f9593f1 455 const float sinc3_odr_map[] = {
mahphalke 1:48914f9593f1 456 #if defined(DEV_AD4111) || defined(DEV_AD4112) || defined(DEV_AD7172_2) || \
mahphalke 1:48914f9593f1 457 defined(DEV_AD7172_4) || defined(DEV_AD7173_8)
mahphalke 1:48914f9593f1 458 ODR_31250, ODR_31250, ODR_31250,
mahphalke 1:48914f9593f1 459 ODR_31250, ODR_31250, ODR_31250,
mahphalke 1:48914f9593f1 460 ODR_15625, ODR_10417, ODR_5208,
mahphalke 1:48914f9593f1 461 #if defined(DEV_AD4111) || defined(DEV_AD4112)
mahphalke 1:48914f9593f1 462 ODR_3906, ODR_1157, ODR_539,
mahphalke 1:48914f9593f1 463 ODR_401, ODR_206, ODR_102,
mahphalke 1:48914f9593f1 464 #else
mahphalke 1:48914f9593f1 465 ODR_2604, ODR_1008, ODR_504,
mahphalke 1:48914f9593f1 466 ODR_400_6, ODR_200_3, ODR_100_2,
mahphalke 1:48914f9593f1 467 #endif
mahphalke 1:48914f9593f1 468 ODR_59_98, ODR_50, ODR_20_01,
mahphalke 1:48914f9593f1 469 ODR_16_67, ODR_10, ODR_5,
mahphalke 1:48914f9593f1 470 ODR_2_5, ODR_1_25,
mahphalke 1:48914f9593f1 471 #elif defined(DEV_AD7176_2) || defined(DEV_AD7175_2) || defined(DEV_AD7175_8) ||\
mahphalke 1:48914f9593f1 472 defined(DEV_AD7177_2)
mahphalke 1:48914f9593f1 473 #if (DEV_AD7176_2) || defined(DEV_AD7175_2) || defined(DEV_AD7175_8)
mahphalke 1:48914f9593f1 474 ODR_250000, ODR_125000, ODR_62500,
mahphalke 1:48914f9593f1 475 ODR_50000, ODR_31250, ODR_25000,
mahphalke 1:48914f9593f1 476 ODR_15625,
mahphalke 1:48914f9593f1 477 #elif defined(DEV_AD7177_2)
mahphalke 1:48914f9593f1 478 ODR_0, ODR_0, ODR_0, ODR_0,
mahphalke 1:48914f9593f1 479 ODR_0, ODR_0, ODR_0,
mahphalke 1:48914f9593f1 480 #endif
mahphalke 1:48914f9593f1 481 ODR_10000, ODR_5000, ODR_2500, ODR_1000, ODR_500, ODR_400, ODR_200,
mahphalke 1:48914f9593f1 482 ODR_100, ODR_60, ODR_50, ODR_20, ODR_16_67, ODR_10, ODR_5,
mahphalke 1:48914f9593f1 483 ODR_0, ODR_0,
mahphalke 1:48914f9593f1 484 #endif
mahphalke 1:48914f9593f1 485 };
mahphalke 1:48914f9593f1 486
mahphalke 1:48914f9593f1 487
mahphalke 1:48914f9593f1 488 /*
mahphalke 1:48914f9593f1 489 * Definition of the channel enable/disable menu items and menu itself
mahphalke 1:48914f9593f1 490 */
mahphalke 1:48914f9593f1 491 console_menu_item chn_enable_disable_items[] = {
mahphalke 1:48914f9593f1 492 { "Enable Channels", 'E', menu_channels_enable_disable, SELECT_ENABLE },
mahphalke 1:48914f9593f1 493 { "Disable Channels", 'D', menu_channels_enable_disable, SELECT_DISBLE },
mahphalke 1:48914f9593f1 494 };
mahphalke 1:48914f9593f1 495
mahphalke 1:48914f9593f1 496 console_menu chn_enable_disable_menu = {
mahphalke 1:48914f9593f1 497 .title = "Channel Enable/Disable Menu",
mahphalke 1:48914f9593f1 498 .items = chn_enable_disable_items,
mahphalke 1:48914f9593f1 499 .itemCount = ARRAY_SIZE(chn_enable_disable_items),
mahphalke 1:48914f9593f1 500 .headerItem = NULL,
mahphalke 1:48914f9593f1 501 .footerItem = NULL,
mahphalke 1:48914f9593f1 502 .enableEscapeKey = true
mahphalke 1:48914f9593f1 503 };
mahphalke 1:48914f9593f1 504
mahphalke 1:48914f9593f1 505
mahphalke 1:48914f9593f1 506 /*
mahphalke 1:48914f9593f1 507 * Definition of the analog input connection menu items and menu itself
mahphalke 1:48914f9593f1 508 */
mahphalke 1:48914f9593f1 509 console_menu_item analog_input_connect_items[] = {
mahphalke 1:48914f9593f1 510 #if defined(DEV_AD4111) || defined(DEV_AD4112)
mahphalke 1:48914f9593f1 511 // Input pin name/pair Key Menu Function AINP/AINM Bits
mahphalke 1:48914f9593f1 512 //
mahphalke 1:48914f9593f1 513 { "VIN0, VIN1", 'A', menu_analog_input_connect, ((VIN0_INPUT_BITS << VIN_PAIR_OFFSET) | VIN1_INPUT_BITS) },
mahphalke 1:48914f9593f1 514 { "VIN0, VINCOM", 'B', menu_analog_input_connect, ((VIN0_INPUT_BITS << VIN_PAIR_OFFSET) | VINCOM_INPUT_BITS) },
mahphalke 1:48914f9593f1 515 { "VIN1, VIN0", 'C', menu_analog_input_connect, ((VIN1_INPUT_BITS << VIN_PAIR_OFFSET) | VIN0_INPUT_BITS) },
mahphalke 1:48914f9593f1 516 { "VIN1, VINCOM", 'D', menu_analog_input_connect, ((VIN1_INPUT_BITS << VIN_PAIR_OFFSET) | VINCOM_INPUT_BITS) },
mahphalke 1:48914f9593f1 517 { "VIN2, VIN3", 'E', menu_analog_input_connect, ((VIN2_INPUT_BITS << VIN_PAIR_OFFSET) | VIN3_INPUT_BITS) },
mahphalke 1:48914f9593f1 518 { "VIN2, VINCOM", 'F', menu_analog_input_connect, ((VIN2_INPUT_BITS << VIN_PAIR_OFFSET) | VINCOM_INPUT_BITS) },
mahphalke 1:48914f9593f1 519 { "VIN3, VIN2", 'G', menu_analog_input_connect, ((VIN3_INPUT_BITS << VIN_PAIR_OFFSET) | VIN2_INPUT_BITS) },
mahphalke 1:48914f9593f1 520 { "VIN3, VINCOM", 'H', menu_analog_input_connect, ((VIN3_INPUT_BITS << VIN_PAIR_OFFSET) | VINCOM_INPUT_BITS) },
mahphalke 1:48914f9593f1 521 { "VIN4, VIN5", 'I', menu_analog_input_connect, ((VIN4_INPUT_BITS << VIN_PAIR_OFFSET) | VIN5_INPUT_BITS) },
mahphalke 1:48914f9593f1 522 { "VIN4, VINCOM", 'J', menu_analog_input_connect, ((VIN4_INPUT_BITS << VIN_PAIR_OFFSET) | VINCOM_INPUT_BITS) },
mahphalke 1:48914f9593f1 523 { "VIN5, VIN4", 'K', menu_analog_input_connect, ((VIN5_INPUT_BITS << VIN_PAIR_OFFSET) | VIN4_INPUT_BITS) },
mahphalke 1:48914f9593f1 524 { "VIN5, VINCOM", 'L', menu_analog_input_connect, ((VIN5_INPUT_BITS << VIN_PAIR_OFFSET) | VINCOM_INPUT_BITS) },
mahphalke 1:48914f9593f1 525 { "VIN6, VIN7", 'M', menu_analog_input_connect, ((VIN6_INPUT_BITS << VIN_PAIR_OFFSET) | VIN7_INPUT_BITS) },
mahphalke 1:48914f9593f1 526 { "VIN6, VINCOM", 'N', menu_analog_input_connect, ((VIN6_INPUT_BITS << VIN_PAIR_OFFSET) | VINCOM_INPUT_BITS) },
mahphalke 1:48914f9593f1 527 { "VIN7, VIN6", 'O', menu_analog_input_connect, ((VIN7_INPUT_BITS << VIN_PAIR_OFFSET) | VIN6_INPUT_BITS) },
mahphalke 1:48914f9593f1 528 { "VIN7, VINCOM", 'P', menu_analog_input_connect, ((VIN7_INPUT_BITS << VIN_PAIR_OFFSET) | VINCOM_INPUT_BITS) },
mahphalke 1:48914f9593f1 529 { "IN3+, IN3-", 'Q', menu_analog_input_connect, ((IN3P_INPUT_BITS << VIN_PAIR_OFFSET) | IN3N_INPUT_BITS) },
mahphalke 1:48914f9593f1 530 { "IN2+, IN2-", 'R', menu_analog_input_connect, ((IN2P_INPUT_BITS << VIN_PAIR_OFFSET) | IN2N_INPUT_BITS) },
mahphalke 1:48914f9593f1 531 { "IN1+, IN1-", 'S', menu_analog_input_connect, ((IN1P_INPUT_BITS << VIN_PAIR_OFFSET) | IN1N_INPUT_BITS) },
mahphalke 1:48914f9593f1 532 { "IN0+, IN0-", 'T', menu_analog_input_connect, ((IN0P_INPUT_BITS << VIN_PAIR_OFFSET) | IN0N_INPUT_BITS) },
mahphalke 1:48914f9593f1 533 { "Temperature Sensor", 'U', menu_analog_input_connect, ((TEMP_SENSOR_POS_INP_BITS << VIN_PAIR_OFFSET) | TEMP_SENSOR_NEG_INP_BITS) },
mahphalke 1:48914f9593f1 534 { "Reference", 'V', menu_analog_input_connect, ((REFP_INPUT_BITS << VIN_PAIR_OFFSET) | REFN_INPUT_BITS) },
mahphalke 1:48914f9593f1 535 #else
mahphalke 1:48914f9593f1 536 { "AIN0", 'A', menu_analog_input_connect, VIN0_INPUT_BITS },
mahphalke 1:48914f9593f1 537 { "AIN1", 'B', menu_analog_input_connect, VIN1_INPUT_BITS },
mahphalke 1:48914f9593f1 538 { "AIN2", 'C', menu_analog_input_connect, VIN2_INPUT_BITS },
mahphalke 1:48914f9593f1 539 { "AIN3", 'D', menu_analog_input_connect, VIN3_INPUT_BITS },
mahphalke 1:48914f9593f1 540 { "AIN4", 'E', menu_analog_input_connect, VIN4_INPUT_BITS },
mahphalke 1:48914f9593f1 541 #if defined(DEV_AD7172_2) || defined(DEV_AD7177_2) || defined(DEV_AD7175_2)
mahphalke 1:48914f9593f1 542 { "Temperature Sensor+", 'F', menu_analog_input_connect, TEMP_SENSOR_POS_INP_BITS },
mahphalke 1:48914f9593f1 543 { "Temperature Sensor-", 'G', menu_analog_input_connect, TEMP_SENSOR_NEG_INP_BITS },
mahphalke 1:48914f9593f1 544 { "((AVDD1 - AVSS)/5)+ ", 'H', menu_analog_input_connect, AVDD1_AVSS_P_BITS },
mahphalke 1:48914f9593f1 545 { "((AVDD1 - AVSS)/5)-", 'I', menu_analog_input_connect, AVDD1_AVSS_N_BITS },
mahphalke 1:48914f9593f1 546 { "REF+", 'J', menu_analog_input_connect, REFP_INPUT_BITS },
mahphalke 1:48914f9593f1 547 { "REF-", 'K', menu_analog_input_connect, REFN_INPUT_BITS },
mahphalke 1:48914f9593f1 548 #elif defined(DEV_AD7172_4)
mahphalke 1:48914f9593f1 549 { "AIN5", 'F', menu_analog_input_connect, VIN5_INPUT_BITS },
mahphalke 1:48914f9593f1 550 { "AIN6", 'G', menu_analog_input_connect, VIN6_INPUT_BITS },
mahphalke 1:48914f9593f1 551 { "AIN7", 'H', menu_analog_input_connect, VIN7_INPUT_BITS },
mahphalke 1:48914f9593f1 552 { "AIN8", 'I', menu_analog_input_connect, VIN8_INPUT_BITS },
mahphalke 1:48914f9593f1 553 { "((AVDD1 - AVSS)/5)+ ", 'J', menu_analog_input_connect, AVDD1_AVSS_P_BITS },
mahphalke 1:48914f9593f1 554 { "((AVDD1 - AVSS)/5)-", 'K', menu_analog_input_connect, AVDD1_AVSS_N_BITS },
mahphalke 1:48914f9593f1 555 { "REF+", 'L', menu_analog_input_connect, REFP_INPUT_BITS },
mahphalke 1:48914f9593f1 556 { "REF-", 'M', menu_analog_input_connect, REFN_INPUT_BITS },
mahphalke 1:48914f9593f1 557 #elif defined(DEV_AD7176_2)
mahphalke 1:48914f9593f1 558 { "REF+", 'F', menu_analog_input_connect, REFP_INPUT_BITS },
mahphalke 1:48914f9593f1 559 { "REF-", 'G', menu_analog_input_connect, REFN_INPUT_BITS },
mahphalke 1:48914f9593f1 560 #elif defined(DEV_AD7173_8) || defined(DEV_AD7175_8)
mahphalke 1:48914f9593f1 561 { "AIN5", 'F', menu_analog_input_connect, VIN5_INPUT_BITS },
mahphalke 1:48914f9593f1 562 { "AIN6", 'G', menu_analog_input_connect, VIN6_INPUT_BITS },
mahphalke 1:48914f9593f1 563 { "AIN7", 'H', menu_analog_input_connect, VIN7_INPUT_BITS },
mahphalke 1:48914f9593f1 564 { "AIN8", 'I', menu_analog_input_connect, VIN8_INPUT_BITS },
mahphalke 1:48914f9593f1 565 { "AIN9", 'J', menu_analog_input_connect, VIN9_INPUT_BITS },
mahphalke 1:48914f9593f1 566 { "AIN10", 'K', menu_analog_input_connect, VIN10_INPUT_BITS },
mahphalke 1:48914f9593f1 567 { "AIN11", 'L', menu_analog_input_connect, VIN11_INPUT_BITS },
mahphalke 1:48914f9593f1 568 { "AIN12", 'M', menu_analog_input_connect, VIN12_INPUT_BITS },
mahphalke 1:48914f9593f1 569 { "AIN13", 'N', menu_analog_input_connect, VIN13_INPUT_BITS },
mahphalke 1:48914f9593f1 570 { "AIN14", 'O', menu_analog_input_connect, VIN14_INPUT_BITS },
mahphalke 1:48914f9593f1 571 { "AIN15", 'P', menu_analog_input_connect, VIN15_INPUT_BITS },
mahphalke 1:48914f9593f1 572 { "AIN16", 'Q', menu_analog_input_connect, VIN16_INPUT_BITS },
mahphalke 1:48914f9593f1 573 { "Temperature Sensor+", 'R', menu_analog_input_connect, TEMP_SENSOR_POS_INP_BITS },
mahphalke 1:48914f9593f1 574 { "Temperature Sensor-", 'S', menu_analog_input_connect, TEMP_SENSOR_NEG_INP_BITS },
mahphalke 1:48914f9593f1 575 #if (DEV_AD7175_8)
mahphalke 1:48914f9593f1 576 { "((AVDD1 - AVSS)/5)+ ", 'T', menu_analog_input_connect, AVDD1_AVSS_P_BITS },
mahphalke 1:48914f9593f1 577 { "((AVDD1 - AVSS)/5)-", 'U', menu_analog_input_connect, AVDD1_AVSS_N_BITS },
mahphalke 1:48914f9593f1 578 #endif
mahphalke 1:48914f9593f1 579 { "REF+", 'V', menu_analog_input_connect, REFP_INPUT_BITS },
mahphalke 1:48914f9593f1 580 { "REF-", 'W', menu_analog_input_connect, REFN_INPUT_BITS },
mahphalke 1:48914f9593f1 581 #endif
mahphalke 1:48914f9593f1 582 #endif
mahphalke 1:48914f9593f1 583 };
mahphalke 1:48914f9593f1 584
mahphalke 1:48914f9593f1 585 console_menu analog_input_connect_menu = {
mahphalke 1:48914f9593f1 586 .title = "Select Analog Input",
mahphalke 1:48914f9593f1 587 .items = analog_input_connect_items,
mahphalke 1:48914f9593f1 588 .itemCount = ARRAY_SIZE(analog_input_connect_items),
mahphalke 1:48914f9593f1 589 .headerItem = NULL,
mahphalke 1:48914f9593f1 590 .footerItem = NULL,
mahphalke 1:48914f9593f1 591 .enableEscapeKey = true
mahphalke 1:48914f9593f1 592 };
mahphalke 1:48914f9593f1 593
mahphalke 1:48914f9593f1 594
mahphalke 1:48914f9593f1 595 /*
mahphalke 3:6c7324997606 596 * Definition of the open wire detect inputs type menu items and menu itself
mahphalke 3:6c7324997606 597 */
mahphalke 3:6c7324997606 598 console_menu_item open_wire_detect_input_type_items[] = {
mahphalke 3:6c7324997606 599 { "Single Ended Input", 'S', menu_input_type_selection, SINGLE_ENDED_INPUT },
mahphalke 3:6c7324997606 600 { "Differential Ended Input", 'D', menu_input_type_selection, DIFF_ENDED_INPUT },
mahphalke 3:6c7324997606 601 };
mahphalke 3:6c7324997606 602
mahphalke 3:6c7324997606 603 console_menu open_wire_detect_input_type_menu = {
mahphalke 3:6c7324997606 604 .title = "Select Analog Input Type",
mahphalke 3:6c7324997606 605 .items = open_wire_detect_input_type_items,
mahphalke 3:6c7324997606 606 .itemCount = ARRAY_SIZE(open_wire_detect_input_type_items),
mahphalke 3:6c7324997606 607 .headerItem = NULL,
mahphalke 3:6c7324997606 608 .footerItem = NULL,
mahphalke 3:6c7324997606 609 .enableEscapeKey = true
mahphalke 3:6c7324997606 610 };
mahphalke 3:6c7324997606 611
mahphalke 3:6c7324997606 612
mahphalke 3:6c7324997606 613 /*
mahphalke 3:6c7324997606 614 * Definition of the open wire detect single ended input channel pair menu items and menu itself
mahphalke 3:6c7324997606 615 */
mahphalke 3:6c7324997606 616 console_menu_item open_wire_detect_se_channel_items[] = {
mahphalke 3:6c7324997606 617 { "CHN0, CHN15", 'A', menu_select_chn_pair, ((ADC_CHN(0) << CHN_PAIR_OFFSET) | ADC_CHN(15)) },
mahphalke 3:6c7324997606 618 { "CHN1, CHN2", 'B', menu_select_chn_pair, ((ADC_CHN(1) << CHN_PAIR_OFFSET) | ADC_CHN(2)) },
mahphalke 3:6c7324997606 619 { "CHN3, CHN4", 'C', menu_select_chn_pair, ((ADC_CHN(3) << CHN_PAIR_OFFSET) | ADC_CHN(4)) },
mahphalke 3:6c7324997606 620 { "CHN5, CHN6", 'D', menu_select_chn_pair, ((ADC_CHN(5) << CHN_PAIR_OFFSET) | ADC_CHN(6)) },
mahphalke 3:6c7324997606 621 { "CHN7, CHN8", 'E', menu_select_chn_pair, ((ADC_CHN(7) << CHN_PAIR_OFFSET) | ADC_CHN(8)) },
mahphalke 3:6c7324997606 622 { "CHN9, CHN10", 'F', menu_select_chn_pair, ((ADC_CHN(9) << CHN_PAIR_OFFSET) | ADC_CHN(10)) },
mahphalke 3:6c7324997606 623 { "CHN11, CHN12", 'G', menu_select_chn_pair, ((ADC_CHN(11) << CHN_PAIR_OFFSET) | ADC_CHN(12)) },
mahphalke 3:6c7324997606 624 { "CHN13, CHN14", 'H', menu_select_chn_pair, ((ADC_CHN(13) << CHN_PAIR_OFFSET) | ADC_CHN(14)) },
mahphalke 3:6c7324997606 625 };
mahphalke 3:6c7324997606 626
mahphalke 3:6c7324997606 627 console_menu open_wire_detect_se_channel_menu = {
mahphalke 3:6c7324997606 628 .title = "Select Channel Pair",
mahphalke 3:6c7324997606 629 .items = open_wire_detect_se_channel_items,
mahphalke 3:6c7324997606 630 .itemCount = ARRAY_SIZE(open_wire_detect_se_channel_items),
mahphalke 3:6c7324997606 631 .headerItem = NULL,
mahphalke 3:6c7324997606 632 .footerItem = NULL,
mahphalke 3:6c7324997606 633 .enableEscapeKey = true
mahphalke 3:6c7324997606 634 };
mahphalke 3:6c7324997606 635
mahphalke 3:6c7324997606 636
mahphalke 3:6c7324997606 637 /*
mahphalke 3:6c7324997606 638 * Definition of the open wire detect differential ended input channel pair menu items and menu itself
mahphalke 3:6c7324997606 639 */
mahphalke 3:6c7324997606 640 console_menu_item open_wire_detect_de_channel_items[] = {
mahphalke 3:6c7324997606 641 { "CHN1, CHN2", 'A', menu_select_chn_pair, ((ADC_CHN(1) << CHN_PAIR_OFFSET) | ADC_CHN(2)) },
mahphalke 3:6c7324997606 642 { "CHN5, CHN6", 'B', menu_select_chn_pair, ((ADC_CHN(5) << CHN_PAIR_OFFSET) | ADC_CHN(6)) },
mahphalke 3:6c7324997606 643 { "CHN9, CHN10", 'C', menu_select_chn_pair, ((ADC_CHN(9) << CHN_PAIR_OFFSET) | ADC_CHN(10)) },
mahphalke 3:6c7324997606 644 { "CHN13, CHN14", 'D', menu_select_chn_pair, ((ADC_CHN(13) << CHN_PAIR_OFFSET) | ADC_CHN(14)) },
mahphalke 3:6c7324997606 645 };
mahphalke 3:6c7324997606 646
mahphalke 3:6c7324997606 647 console_menu open_wire_detect_de_channel_menu = {
mahphalke 3:6c7324997606 648 .title = "Select Channel Pair",
mahphalke 3:6c7324997606 649 .items = open_wire_detect_de_channel_items,
mahphalke 3:6c7324997606 650 .itemCount = ARRAY_SIZE(open_wire_detect_de_channel_items),
mahphalke 3:6c7324997606 651 .headerItem = NULL,
mahphalke 3:6c7324997606 652 .footerItem = NULL,
mahphalke 3:6c7324997606 653 .enableEscapeKey = true
mahphalke 3:6c7324997606 654 };
mahphalke 3:6c7324997606 655
mahphalke 3:6c7324997606 656
mahphalke 3:6c7324997606 657 /*
mahphalke 3:6c7324997606 658 * Definition of the open wire detect single ended analog inputs menu items and menu itself
mahphalke 3:6c7324997606 659 */
mahphalke 3:6c7324997606 660 console_menu_item open_wire_detect_se_analog_input_items[] = {
mahphalke 3:6c7324997606 661 { "VIN0, VINCOM", 'A', menu_select_input_pair, ((VIN0_INPUT_BITS << VIN_PAIR_OFFSET) | VINCOM_INPUT_BITS) },
mahphalke 3:6c7324997606 662 { "VIN1, VINCOM", 'B', menu_select_input_pair, ((VIN1_INPUT_BITS << VIN_PAIR_OFFSET) | VINCOM_INPUT_BITS) },
mahphalke 3:6c7324997606 663 { "VIN2, VINCOM", 'C', menu_select_input_pair, ((VIN2_INPUT_BITS << VIN_PAIR_OFFSET) | VINCOM_INPUT_BITS) },
mahphalke 3:6c7324997606 664 { "VIN3, VINCOM", 'D', menu_select_input_pair, ((VIN3_INPUT_BITS << VIN_PAIR_OFFSET) | VINCOM_INPUT_BITS) },
mahphalke 3:6c7324997606 665 { "VIN4, VINCOM", 'E', menu_select_input_pair, ((VIN4_INPUT_BITS << VIN_PAIR_OFFSET) | VINCOM_INPUT_BITS) },
mahphalke 3:6c7324997606 666 { "VIN5, VINCOM", 'F', menu_select_input_pair, ((VIN5_INPUT_BITS << VIN_PAIR_OFFSET) | VINCOM_INPUT_BITS) },
mahphalke 3:6c7324997606 667 { "VIN6, VINCOM", 'G', menu_select_input_pair, ((VIN6_INPUT_BITS << VIN_PAIR_OFFSET) | VINCOM_INPUT_BITS) },
mahphalke 3:6c7324997606 668 { "VIN7, VINCOM", 'H', menu_select_input_pair, ((VIN7_INPUT_BITS << VIN_PAIR_OFFSET) | VINCOM_INPUT_BITS) },
mahphalke 3:6c7324997606 669 };
mahphalke 3:6c7324997606 670
mahphalke 3:6c7324997606 671 console_menu open_wire_detect_se_analog_input_menu = {
mahphalke 3:6c7324997606 672 .title = "Select Analog Inputs",
mahphalke 3:6c7324997606 673 .items = open_wire_detect_se_analog_input_items,
mahphalke 3:6c7324997606 674 .itemCount = ARRAY_SIZE(open_wire_detect_se_analog_input_items),
mahphalke 3:6c7324997606 675 .headerItem = NULL,
mahphalke 3:6c7324997606 676 .footerItem = NULL,
mahphalke 3:6c7324997606 677 .enableEscapeKey = true
mahphalke 3:6c7324997606 678 };
mahphalke 3:6c7324997606 679
mahphalke 3:6c7324997606 680
mahphalke 3:6c7324997606 681 /*
mahphalke 3:6c7324997606 682 * Definition of the open wire detect differential ended analog inputs menu items and menu itself
mahphalke 3:6c7324997606 683 */
mahphalke 3:6c7324997606 684 console_menu_item open_wire_detect_de_analog_input_items[] = {
mahphalke 3:6c7324997606 685 { "VIN0, VIN1", 'A', menu_select_input_pair, ((VIN0_INPUT_BITS << VIN_PAIR_OFFSET) | VIN1_INPUT_BITS) },
mahphalke 3:6c7324997606 686 { "VIN2, VIN3", 'B', menu_select_input_pair, ((VIN2_INPUT_BITS << VIN_PAIR_OFFSET) | VIN3_INPUT_BITS) },
mahphalke 3:6c7324997606 687 { "VIN4, VIN5", 'C', menu_select_input_pair, ((VIN4_INPUT_BITS << VIN_PAIR_OFFSET) | VIN5_INPUT_BITS) },
mahphalke 3:6c7324997606 688 { "VIN6, VIN7", 'D', menu_select_input_pair, ((VIN6_INPUT_BITS << VIN_PAIR_OFFSET) | VIN7_INPUT_BITS) },
mahphalke 3:6c7324997606 689 };
mahphalke 3:6c7324997606 690
mahphalke 3:6c7324997606 691 console_menu open_wire_detect_de_analog_input_menu = {
mahphalke 3:6c7324997606 692 .title = "Select Analog Inputs",
mahphalke 3:6c7324997606 693 .items = open_wire_detect_de_analog_input_items,
mahphalke 3:6c7324997606 694 .itemCount = ARRAY_SIZE(open_wire_detect_de_analog_input_items),
mahphalke 3:6c7324997606 695 .headerItem = NULL,
mahphalke 3:6c7324997606 696 .footerItem = NULL,
mahphalke 3:6c7324997606 697 .enableEscapeKey = true
mahphalke 3:6c7324997606 698 };
mahphalke 3:6c7324997606 699
mahphalke 3:6c7324997606 700
mahphalke 3:6c7324997606 701 /*
mahphalke 1:48914f9593f1 702 * Definition of the adc register read/write menu items and menu itself
mahphalke 1:48914f9593f1 703 */
mahphalke 1:48914f9593f1 704 console_menu_item reg_read_write_items[] = {
mahphalke 1:48914f9593f1 705 { "Read Device Register", 'R', menu_rw_ad717x_register, DEVICE_REG_READ_ID },
mahphalke 1:48914f9593f1 706 { "Write Device Register", 'W', menu_rw_ad717x_register, DEVICE_REG_WRITE_ID },
mahphalke 1:48914f9593f1 707 };
mahphalke 1:48914f9593f1 708
mahphalke 1:48914f9593f1 709 console_menu reg_read_write_menu = {
mahphalke 1:48914f9593f1 710 .title = "Register Read/Write Menu",
mahphalke 1:48914f9593f1 711 .items = reg_read_write_items,
mahphalke 1:48914f9593f1 712 .itemCount = ARRAY_SIZE(reg_read_write_items),
mahphalke 1:48914f9593f1 713 .headerItem = NULL,
mahphalke 1:48914f9593f1 714 .footerItem = NULL,
mahphalke 1:48914f9593f1 715 .enableEscapeKey = true
mahphalke 1:48914f9593f1 716 };
mahphalke 1:48914f9593f1 717
mahphalke 1:48914f9593f1 718
mahphalke 1:48914f9593f1 719 /*
mahphalke 1:48914f9593f1 720 * Definition of the sampling menu items and menu itself
mahphalke 1:48914f9593f1 721 */
mahphalke 1:48914f9593f1 722 console_menu_item acquisition_menu_items[] = {
mahphalke 1:48914f9593f1 723 { "Single Conversion Mode", 'S', menu_single_conversion },
mahphalke 1:48914f9593f1 724 { "Continuous Conversion Mode - Table View", 'T', menu_continuous_conversion_tabular },
mahphalke 1:48914f9593f1 725 { "Continuous Conversion Mode - Stream Data", 'C', menu_continuous_conversion_stream },
mahphalke 1:48914f9593f1 726 };
mahphalke 1:48914f9593f1 727
mahphalke 1:48914f9593f1 728 console_menu acquisition_menu = {
mahphalke 1:48914f9593f1 729 .title = "Data Acquisition Menu",
mahphalke 1:48914f9593f1 730 .items = acquisition_menu_items,
mahphalke 1:48914f9593f1 731 .itemCount = ARRAY_SIZE(acquisition_menu_items),
mahphalke 1:48914f9593f1 732 .headerItem = NULL,
mahphalke 1:48914f9593f1 733 .footerItem = NULL,
mahphalke 1:48914f9593f1 734 .enableEscapeKey = true
mahphalke 1:48914f9593f1 735 };
mahphalke 1:48914f9593f1 736
mahphalke 1:48914f9593f1 737
mahphalke 1:48914f9593f1 738 /*
mahphalke 1:48914f9593f1 739 * Definition of the filter select menu items and menu itself
mahphalke 1:48914f9593f1 740 */
mahphalke 1:48914f9593f1 741 console_menu_item filter_select_items[] = {
mahphalke 1:48914f9593f1 742 { "Sinc5+1", 'A', menu_filter_select, SINC5_SINC1_FILTER },
mahphalke 1:48914f9593f1 743 { "Sinc3", 'B', menu_filter_select, SINC3_FILTER },
mahphalke 1:48914f9593f1 744 };
mahphalke 1:48914f9593f1 745
mahphalke 1:48914f9593f1 746 console_menu filter_select_menu = {
mahphalke 1:48914f9593f1 747 .title = "Filter Selection Menu",
mahphalke 1:48914f9593f1 748 .items = filter_select_items,
mahphalke 1:48914f9593f1 749 .itemCount = ARRAY_SIZE(filter_select_items),
mahphalke 1:48914f9593f1 750 .headerItem = NULL,
mahphalke 1:48914f9593f1 751 .footerItem = NULL,
mahphalke 1:48914f9593f1 752 .enableEscapeKey = true
mahphalke 1:48914f9593f1 753 };
mahphalke 1:48914f9593f1 754
mahphalke 1:48914f9593f1 755
mahphalke 1:48914f9593f1 756 /*
mahphalke 1:48914f9593f1 757 * Definition of the postfilter enable/disable menu items and menu itself
mahphalke 1:48914f9593f1 758 */
mahphalke 1:48914f9593f1 759 console_menu_item postfilter_enable_disable_items[] = {
mahphalke 1:48914f9593f1 760 { "Enable", 'E', menu_postfiler_enable_disable, SELECT_ENABLE },
mahphalke 1:48914f9593f1 761 { "Disable", 'D', menu_postfiler_enable_disable, SELECT_DISBLE },
mahphalke 1:48914f9593f1 762 };
mahphalke 1:48914f9593f1 763
mahphalke 1:48914f9593f1 764 console_menu postfilter_enable_disable_menu = {
mahphalke 1:48914f9593f1 765 .title = "Post-filter Enable/Disable Menu",
mahphalke 1:48914f9593f1 766 .items = postfilter_enable_disable_items,
mahphalke 1:48914f9593f1 767 .itemCount = ARRAY_SIZE(postfilter_enable_disable_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 post-filter select menu items and menu itself
mahphalke 1:48914f9593f1 776 */
mahphalke 1:48914f9593f1 777 console_menu_item postfilter_select_items[] = {
mahphalke 1:48914f9593f1 778 { "27 SPS, 47 dB reject, 36.7 ms settling ",'A', menu_postfiler_select, POST_FLTR_27_SPS },
mahphalke 1:48914f9593f1 779 { "25 SPS, 62 dB reject, 40 ms settling", 'B', menu_postfiler_select, POST_FLTR_25_SPS },
mahphalke 1:48914f9593f1 780 { "20 SPS, 86 dB reject, 50 ms settling", 'C', menu_postfiler_select, POST_FLTR_20_SPS },
mahphalke 1:48914f9593f1 781 { "16.67 SPS, 92 dB reject, 60 ms settling",'D', menu_postfiler_select, POST_FLTR_16_67_SPS },
mahphalke 1:48914f9593f1 782 };
mahphalke 1:48914f9593f1 783
mahphalke 1:48914f9593f1 784 console_menu postfilter_select_menu = {
mahphalke 1:48914f9593f1 785 .title = "Post-filter Selection Menu",
mahphalke 1:48914f9593f1 786 .items = postfilter_select_items,
mahphalke 1:48914f9593f1 787 .itemCount = ARRAY_SIZE(postfilter_select_items),
mahphalke 1:48914f9593f1 788 .headerItem = NULL,
mahphalke 1:48914f9593f1 789 .footerItem = NULL,
mahphalke 1:48914f9593f1 790 .enableEscapeKey = true
mahphalke 1:48914f9593f1 791 };
mahphalke 1:48914f9593f1 792
mahphalke 1:48914f9593f1 793
mahphalke 1:48914f9593f1 794 /*
mahphalke 1:48914f9593f1 795 * Definition of the SINC5+SINC1 ODR select menu items and menu itself
mahphalke 1:48914f9593f1 796 */
mahphalke 1:48914f9593f1 797 console_menu_item sinc5_1_data_rate_select_items[] = {
mahphalke 1:48914f9593f1 798 #if defined(DEV_AD4111) || defined(DEV_AD4112) || defined(DEV_AD7172_2) || \
mahphalke 1:48914f9593f1 799 defined(DEV_AD7172_4) || defined(DEV_AD7173_8)
mahphalke 1:48914f9593f1 800 { ODR_31250_STR, 'A', menu_odr_select, ODR_31250_BITS },
mahphalke 1:48914f9593f1 801 { ODR_15625_STR, 'B', menu_odr_select, ODR_15625_BITS },
mahphalke 1:48914f9593f1 802 { ODR_10417_STR, 'C', menu_odr_select, ODR_10417_BITS },
mahphalke 1:48914f9593f1 803 { ODR_5208_STR, 'D', menu_odr_select, ODR_5208_BITS },
mahphalke 1:48914f9593f1 804 { ODR_2597_STR, 'E', menu_odr_select, ODR_2597_BITS },
mahphalke 1:48914f9593f1 805 { ODR_1007_STR, 'F', menu_odr_select, ODR_1007_BITS },
mahphalke 1:48914f9593f1 806 { ODR_503_8_STR, 'G', menu_odr_select, ODR_503_8_BITS },
mahphalke 1:48914f9593f1 807 { ODR_381_STR, 'H', menu_odr_select, ODR_381_BITS },
mahphalke 1:48914f9593f1 808 { ODR_200_3_STR, 'I', menu_odr_select, ODR_200_3_BITS },
mahphalke 1:48914f9593f1 809 { ODR_100_2_STR, 'J', menu_odr_select, ODR_100_2_BITS },
mahphalke 1:48914f9593f1 810 { ODR_59_52_STR, 'K', menu_odr_select, ODR_59_52_BITS },
mahphalke 1:48914f9593f1 811 { ODR_49_68_STR, 'L', menu_odr_select, ODR_49_68_BITS },
mahphalke 1:48914f9593f1 812 { ODR_20_01_STR, 'M', menu_odr_select, ODR_20_01_BITS },
mahphalke 1:48914f9593f1 813 { ODR_16_63_STR, 'N', menu_odr_select, ODR_16_63_BITS },
mahphalke 1:48914f9593f1 814 { ODR_10_STR, 'O', menu_odr_select, ODR_10_BITS },
mahphalke 1:48914f9593f1 815 { ODR_5_STR, 'P', menu_odr_select, ODR_5_BITS },
mahphalke 1:48914f9593f1 816 { ODR_2_5_STR, 'Q', menu_odr_select, ODR_2_5_BITS },
mahphalke 1:48914f9593f1 817 { ODR_1_25_STR, 'R', menu_odr_select, ODR_1_25_BITS },
mahphalke 1:48914f9593f1 818 #elif defined(DEV_AD7176_2) || defined(DEV_AD7175_2) || \
mahphalke 1:48914f9593f1 819 defined(DEV_AD7175_8) || defined(DEV_AD7177_2)
mahphalke 1:48914f9593f1 820 #if (DEV_AD7176_2) || defined(DEV_AD7175_2) || defined(DEV_AD7175_8)
mahphalke 1:48914f9593f1 821 { ODR_250000_STR, 'A', menu_odr_select, ODR_250000_BITS },
mahphalke 1:48914f9593f1 822 { ODR_125000_STR, 'B', menu_odr_select, ODR_125000_BITS },
mahphalke 1:48914f9593f1 823 { ODR_62500_STR, 'C', menu_odr_select, ODR_62500_BITS },
mahphalke 1:48914f9593f1 824 { ODR_50000_STR, 'D', menu_odr_select, ODR_50000_BITS },
mahphalke 1:48914f9593f1 825 { ODR_31250_STR, 'E', menu_odr_select, ODR_31250_BITS },
mahphalke 1:48914f9593f1 826 { ODR_25000_STR, 'F', menu_odr_select, ODR_25000_BITS },
mahphalke 1:48914f9593f1 827 { ODR_15625_STR, 'G', menu_odr_select, ODR_15625_BITS },
mahphalke 1:48914f9593f1 828 #endif
mahphalke 1:48914f9593f1 829 { ODR_10000_STR, 'H', menu_odr_select, ODR_10000_BITS },
mahphalke 1:48914f9593f1 830 { ODR_5000_STR, 'I', menu_odr_select, ODR_5000_BITS },
mahphalke 1:48914f9593f1 831 { ODR_2500_STR, 'J', menu_odr_select, ODR_2500_BITS },
mahphalke 1:48914f9593f1 832 { ODR_1000_STR, 'K', menu_odr_select, ODR_1000_BITS },
mahphalke 1:48914f9593f1 833 { ODR_500_STR, 'L', menu_odr_select, ODR_500_BITS },
mahphalke 1:48914f9593f1 834 { ODR_397_5_STR, 'M', menu_odr_select, ODR_397_5_BITS },
mahphalke 1:48914f9593f1 835 { ODR_200_STR, 'N', menu_odr_select, ODR_200_BITS },
mahphalke 1:48914f9593f1 836 { ODR_100_STR, 'O', menu_odr_select, ODR_100_BITS },
mahphalke 1:48914f9593f1 837 { ODR_59_94_STR, 'P', menu_odr_select, ODR_59_94_BITS },
mahphalke 1:48914f9593f1 838 { ODR_49_96_STR, 'Q', menu_odr_select, ODR_49_96_BITS },
mahphalke 1:48914f9593f1 839 { ODR_20_STR, 'R', menu_odr_select, ODR_20_BITS },
mahphalke 1:48914f9593f1 840 { ODR_16_67_STR, 'S', menu_odr_select, ODR_16_67_BITS },
mahphalke 1:48914f9593f1 841 { ODR_10_STR, 'T', menu_odr_select, ODR_10_BITS },
mahphalke 1:48914f9593f1 842 { ODR_5_STR, 'U', menu_odr_select, ODR_5_BITS },
mahphalke 1:48914f9593f1 843 #endif
mahphalke 1:48914f9593f1 844 };
mahphalke 1:48914f9593f1 845
mahphalke 1:48914f9593f1 846 console_menu sinc5_1_data_rate_select_menu = {
mahphalke 1:48914f9593f1 847 .title = "ODR Selection Menu",
mahphalke 1:48914f9593f1 848 .items = sinc5_1_data_rate_select_items,
mahphalke 1:48914f9593f1 849 .itemCount = ARRAY_SIZE(sinc5_1_data_rate_select_items),
mahphalke 1:48914f9593f1 850 .headerItem = NULL,
mahphalke 1:48914f9593f1 851 .footerItem = NULL,
mahphalke 1:48914f9593f1 852 .enableEscapeKey = true
mahphalke 1:48914f9593f1 853 };
mahphalke 1:48914f9593f1 854
mahphalke 1:48914f9593f1 855
mahphalke 1:48914f9593f1 856 /*
mahphalke 1:48914f9593f1 857 * Definition of the SINC3 ODR select menu items and menu itself
mahphalke 1:48914f9593f1 858 */
mahphalke 1:48914f9593f1 859 console_menu_item sinc3_data_rate_select_items[] = {
mahphalke 1:48914f9593f1 860 #if defined(DEV_AD4111) || defined(DEV_AD4112) || defined(DEV_AD7172_2) || \
mahphalke 1:48914f9593f1 861 defined(DEV_AD7172_4) || defined(DEV_AD7173_8)
mahphalke 1:48914f9593f1 862 { ODR_31250_STR, 'A', menu_odr_select, ODR_31250_BITS },
mahphalke 1:48914f9593f1 863 { ODR_15625_STR, 'B', menu_odr_select, ODR_15625_BITS },
mahphalke 1:48914f9593f1 864 { ODR_10417_STR, 'C', menu_odr_select, ODR_10417_BITS },
mahphalke 1:48914f9593f1 865 { ODR_5208_STR, 'D', menu_odr_select, ODR_5208_BITS },
mahphalke 1:48914f9593f1 866 #if defined(DEV_AD4111) || defined(DEV_AD4112)
mahphalke 1:48914f9593f1 867 { ODR_3906_STR, 'E', menu_odr_select, ODR_3906_BITS },
mahphalke 1:48914f9593f1 868 { ODR_1157_STR, 'F', menu_odr_select, ODR_1157_BITS },
mahphalke 1:48914f9593f1 869 { ODR_539_STR, 'G', menu_odr_select, ODR_539_BITS },
mahphalke 1:48914f9593f1 870 { ODR_401_STR, 'H', menu_odr_select, ODR_401_BITS },
mahphalke 1:48914f9593f1 871 { ODR_206_STR, 'H', menu_odr_select, ODR_206_BITS },
mahphalke 1:48914f9593f1 872 { ODR_102_STR, 'I', menu_odr_select, ODR_102_BITS },
mahphalke 1:48914f9593f1 873 #else
mahphalke 1:48914f9593f1 874 { ODR_2604_STR, 'E', menu_odr_select, ODR_2604_BITS },
mahphalke 1:48914f9593f1 875 { ODR_1008_STR, 'F', menu_odr_select, ODR_1008_BITS },
mahphalke 1:48914f9593f1 876 { ODR_504_STR, 'G', menu_odr_select, ODR_504_BITS },
mahphalke 1:48914f9593f1 877 { ODR_400_6_STR, 'H', menu_odr_select, ODR_400_6_BITS },
mahphalke 1:48914f9593f1 878 { ODR_200_3_STR, 'H', menu_odr_select, ODR_200_3_BITS },
mahphalke 1:48914f9593f1 879 { ODR_100_2_STR, 'I', menu_odr_select, ODR_100_2_BITS },
mahphalke 1:48914f9593f1 880 #endif
mahphalke 1:48914f9593f1 881 { ODR_59_98_STR, 'J', menu_odr_select, ODR_59_98_BITS },
mahphalke 1:48914f9593f1 882 { ODR_50_STR, 'K', menu_odr_select, ODR_50_BITS },
mahphalke 1:48914f9593f1 883 { ODR_20_01_STR, 'L', menu_odr_select, ODR_20_01_BITS },
mahphalke 1:48914f9593f1 884 { ODR_16_67_STR, 'M', menu_odr_select, ODR_16_67_BITS },
mahphalke 1:48914f9593f1 885 { ODR_10_STR, 'N', menu_odr_select, ODR_10_BITS },
mahphalke 1:48914f9593f1 886 { ODR_5_STR, 'O', menu_odr_select, ODR_5_BITS },
mahphalke 1:48914f9593f1 887 { ODR_2_5_STR, 'P', menu_odr_select, ODR_2_5_BITS },
mahphalke 1:48914f9593f1 888 { ODR_1_25_STR, 'Q', menu_odr_select, ODR_1_25_BITS },
mahphalke 1:48914f9593f1 889 #elif defined(DEV_AD7176_2) || defined(DEV_AD7175_2) || \
mahphalke 1:48914f9593f1 890 defined(DEV_AD7175_8) || defined(DEV_AD7177_2)
mahphalke 1:48914f9593f1 891 #if (DEV_AD7176_2) || defined(DEV_AD7175_2) || defined(DEV_AD7175_8)
mahphalke 1:48914f9593f1 892 { ODR_250000_STR, 'A', menu_odr_select, ODR_250000_BITS },
mahphalke 1:48914f9593f1 893 { ODR_125000_STR, 'B', menu_odr_select, ODR_125000_BITS },
mahphalke 1:48914f9593f1 894 { ODR_62500_STR, 'C', menu_odr_select, ODR_62500_BITS },
mahphalke 1:48914f9593f1 895 { ODR_50000_STR, 'D', menu_odr_select, ODR_50000_BITS },
mahphalke 1:48914f9593f1 896 { ODR_31250_STR, 'E', menu_odr_select, ODR_31250_BITS },
mahphalke 1:48914f9593f1 897 { ODR_25000_STR, 'F', menu_odr_select, ODR_25000_BITS },
mahphalke 1:48914f9593f1 898 { ODR_15625_STR, 'G', menu_odr_select, ODR_15625_BITS },
mahphalke 1:48914f9593f1 899 #endif
mahphalke 1:48914f9593f1 900 { ODR_10000_STR, 'H', menu_odr_select, ODR_10000_BITS },
mahphalke 1:48914f9593f1 901 { ODR_5000_STR, 'I', menu_odr_select, ODR_5000_BITS },
mahphalke 1:48914f9593f1 902 { ODR_2500_STR, 'J', menu_odr_select, ODR_2500_BITS },
mahphalke 1:48914f9593f1 903 { ODR_1000_STR, 'K', menu_odr_select, ODR_1000_BITS },
mahphalke 1:48914f9593f1 904 { ODR_500_STR, 'L', menu_odr_select, ODR_500_BITS },
mahphalke 1:48914f9593f1 905 { ODR_400_STR , 'M', menu_odr_select, ODR_400_BITS },
mahphalke 1:48914f9593f1 906 { ODR_200_STR, 'N', menu_odr_select, ODR_200_BITS },
mahphalke 1:48914f9593f1 907 { ODR_100_STR, 'O', menu_odr_select, ODR_100_BITS },
mahphalke 1:48914f9593f1 908 { ODR_60_STR, 'P', menu_odr_select, ODR_60_BITS },
mahphalke 1:48914f9593f1 909 { ODR_50_STR, 'Q', menu_odr_select, ODR_50_BITS },
mahphalke 1:48914f9593f1 910 { ODR_20_STR, 'R', menu_odr_select, ODR_20_BITS },
mahphalke 1:48914f9593f1 911 { ODR_16_67_STR, 'S', menu_odr_select, ODR_16_67_BITS },
mahphalke 1:48914f9593f1 912 { ODR_10_STR, 'T', menu_odr_select, ODR_10_BITS },
mahphalke 1:48914f9593f1 913 { ODR_5_STR, 'U', menu_odr_select, ODR_5_BITS },
mahphalke 1:48914f9593f1 914 #endif
mahphalke 1:48914f9593f1 915 };
mahphalke 1:48914f9593f1 916
mahphalke 1:48914f9593f1 917 console_menu sinc3_data_rate_select_menu = {
mahphalke 1:48914f9593f1 918 .title = "ODR Selection Menu",
mahphalke 1:48914f9593f1 919 .items = sinc3_data_rate_select_items,
mahphalke 1:48914f9593f1 920 .itemCount = ARRAY_SIZE(sinc3_data_rate_select_items),
mahphalke 1:48914f9593f1 921 .headerItem = NULL,
mahphalke 1:48914f9593f1 922 .footerItem = NULL,
mahphalke 1:48914f9593f1 923 .enableEscapeKey = true
mahphalke 1:48914f9593f1 924 };
mahphalke 1:48914f9593f1 925
mahphalke 1:48914f9593f1 926
mahphalke 1:48914f9593f1 927 /*
mahphalke 1:48914f9593f1 928 * Definition of the polarity select menu items and menu itself
mahphalke 1:48914f9593f1 929 */
mahphalke 1:48914f9593f1 930 console_menu_item polarity_select_items[] = {
mahphalke 1:48914f9593f1 931 { "Unipolar", 'U', menu_polarity_select, UNIPOLAR },
mahphalke 1:48914f9593f1 932 { "Bipolar", 'B', menu_polarity_select, BIPOLAR },
mahphalke 1:48914f9593f1 933 };
mahphalke 1:48914f9593f1 934
mahphalke 1:48914f9593f1 935 console_menu polarity_select_menu = {
mahphalke 1:48914f9593f1 936 .title = "Polarity Selection Menu",
mahphalke 1:48914f9593f1 937 .items = polarity_select_items,
mahphalke 1:48914f9593f1 938 .itemCount = ARRAY_SIZE(polarity_select_items),
mahphalke 1:48914f9593f1 939 .headerItem = NULL,
mahphalke 1:48914f9593f1 940 .footerItem = NULL,
mahphalke 1:48914f9593f1 941 .enableEscapeKey = true
mahphalke 1:48914f9593f1 942 };
mahphalke 1:48914f9593f1 943
mahphalke 1:48914f9593f1 944
mahphalke 1:48914f9593f1 945 /*
mahphalke 1:48914f9593f1 946 * Definition of the refernce source selection menu items and menu itself
mahphalke 1:48914f9593f1 947 */
mahphalke 1:48914f9593f1 948 console_menu_item reference_select_items[] = {
mahphalke 1:48914f9593f1 949 { "External", 'A', menu_reference_source_select, EXTERNAL },
mahphalke 1:48914f9593f1 950 { "Internal", 'B', menu_reference_source_select, INTERNAL },
mahphalke 1:48914f9593f1 951 { "AVDD-AVSS", 'C', menu_reference_source_select, AVDD_AVSS },
mahphalke 1:48914f9593f1 952 };
mahphalke 1:48914f9593f1 953
mahphalke 1:48914f9593f1 954 console_menu reference_select_menu = {
mahphalke 1:48914f9593f1 955 .title = "Reference Selection Menu",
mahphalke 1:48914f9593f1 956 .items = reference_select_items,
mahphalke 1:48914f9593f1 957 .itemCount = ARRAY_SIZE(reference_select_items),
mahphalke 1:48914f9593f1 958 .headerItem = NULL,
mahphalke 1:48914f9593f1 959 .footerItem = NULL,
mahphalke 1:48914f9593f1 960 .enableEscapeKey = true
mahphalke 1:48914f9593f1 961 };
mahphalke 1:48914f9593f1 962
mahphalke 1:48914f9593f1 963
mahphalke 1:48914f9593f1 964 /*
mahphalke 1:48914f9593f1 965 * Definition of the reference buffer enable/disable menu items and menu itself
mahphalke 1:48914f9593f1 966 */
mahphalke 1:48914f9593f1 967 console_menu_item ref_buffer_enable_disable_items[] = {
mahphalke 1:48914f9593f1 968 { "Enable", 'E', menu_ref_buffer_enable_disable, SELECT_ENABLE },
mahphalke 1:48914f9593f1 969 { "Disable", 'D', menu_ref_buffer_enable_disable, SELECT_DISBLE },
mahphalke 1:48914f9593f1 970 };
mahphalke 1:48914f9593f1 971
mahphalke 1:48914f9593f1 972 console_menu ref_buffer_enable_disable_menu = {
mahphalke 1:48914f9593f1 973 .title = "Reference Buffer Enable/Disable Menu",
mahphalke 1:48914f9593f1 974 .items = ref_buffer_enable_disable_items,
mahphalke 1:48914f9593f1 975 .itemCount = ARRAY_SIZE(ref_buffer_enable_disable_items),
mahphalke 1:48914f9593f1 976 .headerItem = NULL,
mahphalke 1:48914f9593f1 977 .footerItem = NULL,
mahphalke 1:48914f9593f1 978 .enableEscapeKey = true
mahphalke 1:48914f9593f1 979 };
mahphalke 1:48914f9593f1 980
mahphalke 1:48914f9593f1 981
mahphalke 1:48914f9593f1 982 /*
mahphalke 1:48914f9593f1 983 * Definition of the reference buffer enable/disable menu items and menu itself
mahphalke 1:48914f9593f1 984 */
mahphalke 1:48914f9593f1 985 console_menu_item input_buffer_enable_disable_items[] = {
mahphalke 1:48914f9593f1 986 { "Enable", 'E', menu_input_buffer_enable_disable, SELECT_ENABLE },
mahphalke 1:48914f9593f1 987 { "Disable", 'D', menu_input_buffer_enable_disable, SELECT_DISBLE },
mahphalke 1:48914f9593f1 988 };
mahphalke 1:48914f9593f1 989
mahphalke 1:48914f9593f1 990 console_menu input_buffer_enable_disable_menu = {
mahphalke 1:48914f9593f1 991 .title = "Input Buffer Enable/Disable Menu",
mahphalke 1:48914f9593f1 992 .items = input_buffer_enable_disable_items,
mahphalke 1:48914f9593f1 993 .itemCount = ARRAY_SIZE(input_buffer_enable_disable_items),
mahphalke 1:48914f9593f1 994 .headerItem = NULL,
mahphalke 1:48914f9593f1 995 .footerItem = NULL,
mahphalke 1:48914f9593f1 996 .enableEscapeKey = true
mahphalke 1:48914f9593f1 997 };
mahphalke 1:48914f9593f1 998
mahphalke 1:48914f9593f1 999
mahphalke 1:48914f9593f1 1000 /*
mahphalke 1:48914f9593f1 1001 * Definition of the Main Menu Items and menu itself
mahphalke 1:48914f9593f1 1002 */
mahphalke 1:48914f9593f1 1003 console_menu_item main_menu_items[] = {
mahphalke 1:48914f9593f1 1004 { "Read Device ID", 'A', menu_read_id },
mahphalke 1:48914f9593f1 1005 { "" },
mahphalke 1:48914f9593f1 1006 { "Read Status Register", 'B', menu_read_status },
mahphalke 1:48914f9593f1 1007 { "" },
mahphalke 1:48914f9593f1 1008 { "Sample Channels", 'C', menu_sample_channels },
mahphalke 1:48914f9593f1 1009 { "" },
mahphalke 1:48914f9593f1 1010 { "Enable/Disable Channels", 'D', menu_chn_enable_disable_display },
mahphalke 1:48914f9593f1 1011 { "" },
mahphalke 1:48914f9593f1 1012 { "Connect Analog Inputs to Channel", 'E', menu_input_chn_connect_display },
mahphalke 1:48914f9593f1 1013 { "" },
mahphalke 1:48914f9593f1 1014 { "Configure and Assign Setup", 'F', menu_config_and_assign_setup },
mahphalke 1:48914f9593f1 1015 { "" },
mahphalke 1:48914f9593f1 1016 { "Display setup", 'G', menu_display_setup },
mahphalke 1:48914f9593f1 1017 { "" },
mahphalke 1:48914f9593f1 1018 { "Read Temperature", 'H', menu_read_temperature },
mahphalke 1:48914f9593f1 1019 { "" },
mahphalke 1:48914f9593f1 1020 { "Calibrate ADC (Internal)", 'I', menu_calibrate_adc },
mahphalke 1:48914f9593f1 1021 { "" },
mahphalke 3:6c7324997606 1022 #if defined(DEV_AD4111)
mahphalke 3:6c7324997606 1023 { "Open Wire Detection", 'J', menu_open_wire_detection },
mahphalke 3:6c7324997606 1024 { "" },
mahphalke 3:6c7324997606 1025 #endif
mahphalke 3:6c7324997606 1026 { "Read/Write Device Registers", 'K', menu_read_write_device_regs },
mahphalke 1:48914f9593f1 1027 };
mahphalke 1:48914f9593f1 1028
mahphalke 1:48914f9593f1 1029 console_menu ad717x_main_menu = {
mahphalke 1:48914f9593f1 1030 .title = "Main Menu",
mahphalke 1:48914f9593f1 1031 .items = main_menu_items,
mahphalke 1:48914f9593f1 1032 .itemCount = ARRAY_SIZE(main_menu_items),
mahphalke 1:48914f9593f1 1033 .headerItem = display_main_menu_header,
mahphalke 1:48914f9593f1 1034 .footerItem = NULL,
mahphalke 1:48914f9593f1 1035 .enableEscapeKey = false
mahphalke 1:48914f9593f1 1036 };
mahphalke 1:48914f9593f1 1037
mahphalke 1:48914f9593f1 1038 /******************************************************************************/
mahphalke 1:48914f9593f1 1039 /************************ Public Declarations *********************************/
mahphalke 1:48914f9593f1 1040 /******************************************************************************/
mahphalke 1:48914f9593f1 1041
mahphalke 1:48914f9593f1 1042 #endif /* AD717X_MENU_DEFINES_H_ */