Test program running on MAX32625MBED. Control through USB Serial commands using a terminal emulator such as teraterm or putty.

Dependencies:   MaximTinyTester MAX11410 CmdLine USBDevice

Committer:
whismanoid
Date:
Mon Mar 30 00:18:53 2020 +0000
Revision:
60:f38c54a91794
Parent:
59:c0376adb6ebc
Child:
61:38ec81c33b7a
Self Test work in progress

Who changed what in which revision?

UserRevisionLine numberNew contents of line
whismanoid 35:8aa5dffe523d 1 // /*******************************************************************************
whismanoid 47:3ce5810551c4 2 // * Copyright (C) 2020 Maxim Integrated Products, Inc., All Rights Reserved.
whismanoid 19:8f951e448ab1 3 // *
whismanoid 19:8f951e448ab1 4 // * Permission is hereby granted, free of charge, to any person obtaining a
whismanoid 19:8f951e448ab1 5 // * copy of this software and associated documentation files (the "Software"),
whismanoid 19:8f951e448ab1 6 // * to deal in the Software without restriction, including without limitation
whismanoid 19:8f951e448ab1 7 // * the rights to use, copy, modify, merge, publish, distribute, sublicense,
whismanoid 19:8f951e448ab1 8 // * and/or sell copies of the Software, and to permit persons to whom the
whismanoid 19:8f951e448ab1 9 // * Software is furnished to do so, subject to the following conditions:
whismanoid 19:8f951e448ab1 10 // *
whismanoid 19:8f951e448ab1 11 // * The above copyright notice and this permission notice shall be included
whismanoid 19:8f951e448ab1 12 // * in all copies or substantial portions of the Software.
whismanoid 19:8f951e448ab1 13 // *
whismanoid 19:8f951e448ab1 14 // * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
whismanoid 19:8f951e448ab1 15 // * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
whismanoid 19:8f951e448ab1 16 // * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
whismanoid 19:8f951e448ab1 17 // * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
whismanoid 19:8f951e448ab1 18 // * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
whismanoid 19:8f951e448ab1 19 // * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
whismanoid 19:8f951e448ab1 20 // * OTHER DEALINGS IN THE SOFTWARE.
whismanoid 19:8f951e448ab1 21 // *
whismanoid 19:8f951e448ab1 22 // * Except as contained in this notice, the name of Maxim Integrated
whismanoid 19:8f951e448ab1 23 // * Products, Inc. shall not be used except as stated in the Maxim Integrated
whismanoid 19:8f951e448ab1 24 // * Products, Inc. Branding Policy.
whismanoid 19:8f951e448ab1 25 // *
whismanoid 19:8f951e448ab1 26 // * The mere transfer of this software does not imply any licenses
whismanoid 19:8f951e448ab1 27 // * of trade secrets, proprietary technology, copyrights, patents,
whismanoid 19:8f951e448ab1 28 // * trademarks, maskwork rights, or any other form of intellectual
whismanoid 19:8f951e448ab1 29 // * property whatsoever. Maxim Integrated Products, Inc. retains all
whismanoid 19:8f951e448ab1 30 // * ownership rights.
whismanoid 19:8f951e448ab1 31 // *******************************************************************************
whismanoid 19:8f951e448ab1 32 // */
whismanoid 35:8aa5dffe523d 33 #include "CmdLine.h"
whismanoid 52:d3fb6f1722bf 34 #include "MaximTinyTester.h"
whismanoid 35:8aa5dffe523d 35 // CODE GENERATOR: class declaration and docstrings
whismanoid 35:8aa5dffe523d 36 // CODE GENERATOR: example code includes
whismanoid 35:8aa5dffe523d 37 // example code includes
whismanoid 35:8aa5dffe523d 38 // standard include for target platform -- Platform_Include_Boilerplate
whismanoid 19:8f951e448ab1 39 #include "mbed.h"
whismanoid 35:8aa5dffe523d 40 // Platforms:
whismanoid 35:8aa5dffe523d 41 // - MAX32625MBED
whismanoid 35:8aa5dffe523d 42 // - supports mbed-os-5.11, requires USBDevice library
whismanoid 35:8aa5dffe523d 43 // - add https://developer.mbed.org/teams/MaximIntegrated/code/USBDevice/
whismanoid 35:8aa5dffe523d 44 // - remove max32630fthr library (if present)
whismanoid 35:8aa5dffe523d 45 // - remove MAX32620FTHR library (if present)
whismanoid 35:8aa5dffe523d 46 // - MAX32600MBED
whismanoid 35:8aa5dffe523d 47 // - remove max32630fthr library (if present)
whismanoid 35:8aa5dffe523d 48 // - remove MAX32620FTHR library (if present)
whismanoid 35:8aa5dffe523d 49 // - Windows 10 note: Don't connect HDK until you are ready to load new firmware into the board.
whismanoid 35:8aa5dffe523d 50 // - NUCLEO_F446RE
whismanoid 35:8aa5dffe523d 51 // - remove USBDevice library
whismanoid 35:8aa5dffe523d 52 // - remove max32630fthr library (if present)
whismanoid 35:8aa5dffe523d 53 // - remove MAX32620FTHR library (if present)
whismanoid 35:8aa5dffe523d 54 // - NUCLEO_F401RE
whismanoid 35:8aa5dffe523d 55 // - remove USBDevice library
whismanoid 35:8aa5dffe523d 56 // - remove max32630fthr library (if present)
whismanoid 35:8aa5dffe523d 57 // - remove MAX32620FTHR library (if present)
whismanoid 35:8aa5dffe523d 58 // - MAX32630FTHR
whismanoid 35:8aa5dffe523d 59 // - #include "max32630fthr.h"
whismanoid 35:8aa5dffe523d 60 // - add http://os.mbed.org/teams/MaximIntegrated/code/max32630fthr/
whismanoid 35:8aa5dffe523d 61 // - remove MAX32620FTHR library (if present)
whismanoid 35:8aa5dffe523d 62 // - MAX32620FTHR
whismanoid 35:8aa5dffe523d 63 // - #include "MAX32620FTHR.h"
whismanoid 35:8aa5dffe523d 64 // - remove max32630fthr library (if present)
whismanoid 35:8aa5dffe523d 65 // - add https://os.mbed.com/teams/MaximIntegrated/code/MAX32620FTHR/
whismanoid 35:8aa5dffe523d 66 // - not tested yet
whismanoid 35:8aa5dffe523d 67 // - MAX32625PICO
whismanoid 35:8aa5dffe523d 68 // - remove max32630fthr library (if present)
whismanoid 35:8aa5dffe523d 69 // - remove MAX32620FTHR library (if present)
whismanoid 35:8aa5dffe523d 70 // - not tested yet
whismanoid 35:8aa5dffe523d 71 //
whismanoid 35:8aa5dffe523d 72 // end Platform_Include_Boilerplate
whismanoid 19:8f951e448ab1 73 #include "MAX11410.h"
whismanoid 19:8f951e448ab1 74 #include "CmdLine.h"
whismanoid 52:d3fb6f1722bf 75 #include "MaximTinyTester.h"
whismanoid 35:8aa5dffe523d 76 // CODE GENERATOR: class declaration statement open
whismanoid 19:8f951e448ab1 77
whismanoid 35:8aa5dffe523d 78 // CODE GENERATOR: Test_Menu externs
whismanoid 35:8aa5dffe523d 79 #include "MAX11410.h"
whismanoid 35:8aa5dffe523d 80 extern MAX11410 g_MAX11410_device; // defined in main.cpp
whismanoid 19:8f951e448ab1 81
whismanoid 35:8aa5dffe523d 82 // CODE GENERATOR: build testMenuCommand list
whismanoid 35:8aa5dffe523d 83 // CODE GENERATOR: build testMenuGlobalArgsDict common/global argument list
whismanoid 35:8aa5dffe523d 84 // CODE GENERATOR: class member function declarations
whismanoid 35:8aa5dffe523d 85 // CODE GENERATOR: MAX11410 Command Name = Init (void) --> uint8_t
whismanoid 35:8aa5dffe523d 86 // CODE GENERATOR: Menu item hint description Menu item '!'
whismanoid 35:8aa5dffe523d 87 // CODE GENERATOR: Menu item '!' -- Menu item !
whismanoid 35:8aa5dffe523d 88 // CODE GENERATOR: test menu case '!':
whismanoid 35:8aa5dffe523d 89 // CODE GENERATOR: helpString '! -- Init'
whismanoid 35:8aa5dffe523d 90 // CODE GENERATOR: CMD_ 'None'
whismanoid 35:8aa5dffe523d 91 // CODE GENERATOR: CommandName 'Init'
whismanoid 35:8aa5dffe523d 92 // CODE GENERATOR: CommandParamIn 'void'
whismanoid 35:8aa5dffe523d 93 // CODE GENERATOR: CommandReturnType 'uint8_t'
whismanoid 35:8aa5dffe523d 94 // CODE GENERATOR: CommandPre ''
whismanoid 37:74aa97afa030 95 // CODE GENERATOR: CommandDocParamIn ''
whismanoid 37:74aa97afa030 96 // CODE GENERATOR: CommandDocParamOut ''
whismanoid 35:8aa5dffe523d 97 // CODE GENERATOR: CommandPost ''
whismanoid 35:8aa5dffe523d 98 // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure'
whismanoid 59:c0376adb6ebc 99 // CODE GENERATOR: CommandDocTest '@test Init() expect 1'
whismanoid 59:c0376adb6ebc 100 // CODE GENERATOR: CommandDocTest 'TODO1: #169 SelfTest support @test tinyTester.print("message")'
whismanoid 60:f38c54a91794 101 // CODE GENERATOR: CommandDocTest '@test RegRead(MAX11410::CMD_r001_0001_xxxx_xxxx_xxxx_xxxx_xxxx_xddd_PART_ID, buffer) expect 1 expect-buffer 0x000F02'
whismanoid 60:f38c54a91794 102 // CODE GENERATOR: CommandDocTest '@test RegRead(MAX11410::CMD_r000_0100_dddd_xddd_GP0_CTRL, buffer) expect 1 expect-buffer 0x00'
whismanoid 60:f38c54a91794 103 // CODE GENERATOR: CommandDocTest '@test RegRead(MAX11410::CMD_r000_0101_dddd_xddd_GP1_CTRL, buffer) expect 1 expect-buffer 0x00'
whismanoid 60:f38c54a91794 104 // CODE GENERATOR: CommandDocTest '@test RegRead(MAX11410::CMD_r000_0111_xddd_dddd_GP_SEQ_ADDR, buffer) expect 1 expect-buffer 0x00003a'
whismanoid 60:f38c54a91794 105 // CODE GENERATOR: CommandDocTest '@test RegRead(MAX11410::CMD_r000_1000_x0dd_dddd_FILTER, buffer) expect 1 expect-buffer 0x00'
whismanoid 60:f38c54a91794 106 // CODE GENERATOR: CommandDocTest '@test RegRead(MAX11410::CMD_r000_1001_dddd_dddd_CTRL, buffer) expect 1 expect-buffer 0x000001'
whismanoid 60:f38c54a91794 107 // CODE GENERATOR: CommandDocTest '@test RegRead(MAX11410::CMD_r000_1010_dddd_dddd_SOURCE, buffer) expect 1 expect-buffer 0x00'
whismanoid 60:f38c54a91794 108 // CODE GENERATOR: CommandDocTest '@test RegRead(MAX11410::CMD_r000_1011_dddd_dddd_MUX_CTRL0, buffer) expect 1 expect-buffer 0x0000ff'
whismanoid 60:f38c54a91794 109 // CODE GENERATOR: CommandDocTest '@test RegRead(MAX11410::CMD_r000_1100_dddd_dddd_MUX_CTRL1, buffer) expect 1 expect-buffer 0x0000ff'
whismanoid 60:f38c54a91794 110 // CODE GENERATOR: CommandDocTest '@test RegRead(MAX11410::CMD_r000_1101_dddd_dddd_MUX_CTRL2, buffer) expect 1 expect-buffer 0x00'
whismanoid 60:f38c54a91794 111 // CODE GENERATOR: CommandDocTest '@test RegRead(MAX11410::CMD_r000_1110_xxdd_xddd_PGA, buffer) expect 1 expect-buffer 0x00'
whismanoid 59:c0376adb6ebc 112 // CODE GENERATOR: CommandDocTest '@test tinyTester.print("check filter register is writeable")'
whismanoid 59:c0376adb6ebc 113 // CODE GENERATOR: CommandDocTest '@test RegWrite(0x08, 0x34) expect 1'
whismanoid 59:c0376adb6ebc 114 // CODE GENERATOR: CommandDocTest '@test tinyTester.print("check filter register is readable")'
whismanoid 59:c0376adb6ebc 115 // CODE GENERATOR: CommandDocTest '@test RegRead(0x08, buffer) expect 1 expect-buffer 0x34'
whismanoid 59:c0376adb6ebc 116 // CODE GENERATOR: CommandDocTest 'TODO1: #169 SelfTest support @test tinyTester.settle_time_msec = 250'
whismanoid 59:c0376adb6ebc 117 // CODE GENERATOR: CommandDocTest '@test tinyTester.settle_time_msec = 250 // default 250'
whismanoid 59:c0376adb6ebc 118 // CODE GENERATOR: CommandDocTest '@test tinyTester.blink_time_msec = 75 // default 75 resume hardware self test'
whismanoid 59:c0376adb6ebc 119 // CODE GENERATOR: CommandDocTest '@test tinyTester.input_timeout_time_msec = 250 // default 250'
whismanoid 59:c0376adb6ebc 120 // CODE GENERATOR: CommandDocTest '@test tinyTester.settle_time_msec = 20 // default 250'
whismanoid 59:c0376adb6ebc 121 // CODE GENERATOR: CommandDocTest '@test tinyTester.blink_time_msec = 20 // quickly speed through the software verification'
whismanoid 59:c0376adb6ebc 122 // CODE GENERATOR: CommandDocTest '@test tinyTester.input_timeout_time_msec = 100 // default 250'
whismanoid 59:c0376adb6ebc 123 // CODE GENERATOR: CommandDocTest 'TODO1: #169 SelfTest support @test tinyTester.Wait_Output_Settling()'
whismanoid 59:c0376adb6ebc 124 // CODE GENERATOR: CommandDocTest '@test tinyTester.Wait_Output_Settling()'
whismanoid 37:74aa97afa030 125 // CODE GENERATOR: MAX11410 Command Name = VoltageOfCode_Unipolar (uint32_t value_u24) --> double
whismanoid 37:74aa97afa030 126 // CODE GENERATOR: no Menu item hint in description
whismanoid 37:74aa97afa030 127 // CODE GENERATOR: MAX11410 Command Name = VoltageOfCode_Bipolar_OffsetBinary (uint32_t value_u24) --> double
whismanoid 37:74aa97afa030 128 // CODE GENERATOR: no Menu item hint in description
whismanoid 37:74aa97afa030 129 // CODE GENERATOR: MAX11410 Command Name = VoltageOfCode_Bipolar_2sComplement (uint32_t value_u24) --> double
whismanoid 37:74aa97afa030 130 // CODE GENERATOR: no Menu item hint in description
whismanoid 37:74aa97afa030 131 // CODE GENERATOR: MAX11410 Command Name = VoltageOfCode (uint32_t value_u24) --> double
whismanoid 35:8aa5dffe523d 132 // CODE GENERATOR: no Menu item hint in description
whismanoid 52:d3fb6f1722bf 133 // CODE GENERATOR: MAX11410 Command Name = RegWrite (MAX11410_CMD_enum_t commandByte, uint32_t regData) --> uint8_t
whismanoid 35:8aa5dffe523d 134 // CODE GENERATOR: no Menu item hint in description
whismanoid 52:d3fb6f1722bf 135 // CODE GENERATOR: MAX11410 Command Name = RegRead (MAX11410_CMD_enum_t commandByte, uint32_t* ptrRegData) --> uint8_t
whismanoid 52:d3fb6f1722bf 136 // CODE GENERATOR: no Menu item hint in description
whismanoid 52:d3fb6f1722bf 137 // CODE GENERATOR: MAX11410 Command Name = RegSize (MAX11410_CMD_enum_t commandByte) --> uint8_t
whismanoid 35:8aa5dffe523d 138 // CODE GENERATOR: no Menu item hint in description
whismanoid 52:d3fb6f1722bf 139 // CODE GENERATOR: MAX11410 Command Name = DecodeCommand (MAX11410_CMD_enum_t commandByte) --> MAX11410::MAX11410_CMDOP_enum_t
whismanoid 52:d3fb6f1722bf 140 // CODE GENERATOR: no Menu item hint in description
whismanoid 52:d3fb6f1722bf 141 // CODE GENERATOR: MAX11410 Command Name = RegAddrOfCommand (MAX11410_CMD_enum_t commandByte) --> uint8_t
whismanoid 35:8aa5dffe523d 142 // CODE GENERATOR: no Menu item hint in description
whismanoid 52:d3fb6f1722bf 143 // CODE GENERATOR: MAX11410 Command Name = IsRegReadCommand (MAX11410_CMD_enum_t commandByte) --> uint8_t
whismanoid 52:d3fb6f1722bf 144 // CODE GENERATOR: no Menu item hint in description
whismanoid 52:d3fb6f1722bf 145 // CODE GENERATOR: MAX11410 Command Name = RegName (MAX11410_CMD_enum_t commandByte) --> const char*
whismanoid 35:8aa5dffe523d 146 // CODE GENERATOR: no Menu item hint in description
whismanoid 37:74aa97afa030 147 // CODE GENERATOR: MAX11410 Command Name = Configure_FILTER (uint8_t linef, uint8_t rate) --> uint8_t
whismanoid 37:74aa97afa030 148 // CODE GENERATOR: Menu item hint description Menu item 'XF'
whismanoid 37:74aa97afa030 149 // CODE GENERATOR: Menu item 'XF' -- Menu item XF
whismanoid 37:74aa97afa030 150 // CODE GENERATOR: MAX11410 help: XF uint8_t linef, uint8_t rate -- Configure_FILTER
whismanoid 37:74aa97afa030 151 // CODE GENERATOR: MAX11410 helpString: 'XF linef=? rate=? -- Configure_FILTER'
whismanoid 37:74aa97afa030 152 // CODE GENERATOR: test menu case 'XF':
whismanoid 37:74aa97afa030 153 // CODE GENERATOR: helpString 'XF linef=? rate=? -- Configure_FILTER'
whismanoid 37:74aa97afa030 154 // CODE GENERATOR: CMD_ 'None'
whismanoid 37:74aa97afa030 155 // CODE GENERATOR: CommandName 'Configure_FILTER'
whismanoid 37:74aa97afa030 156 // CODE GENERATOR: CommandParamIn 'uint8_t linef, uint8_t rate'
whismanoid 37:74aa97afa030 157 // CODE GENERATOR: CommandReturnType 'uint8_t'
whismanoid 37:74aa97afa030 158 // CODE GENERATOR: CommandPre ''
whismanoid 37:74aa97afa030 159 // CODE GENERATOR: CommandDocParamIn '@param[in] linef = filter type, default=MAX11410::MAX11410_LINEF_enum_t::LINEF_11_SINC4'
whismanoid 37:74aa97afa030 160 // CODE GENERATOR: CommandDocParamIn '@param[in] rate = output data rate selection, default=MAX11410::MAX11410_RATE_enum_t::RATE_0100'
whismanoid 37:74aa97afa030 161 // CODE GENERATOR: CommandDocParamOut ''
whismanoid 37:74aa97afa030 162 // CODE GENERATOR: CommandPost ''
whismanoid 37:74aa97afa030 163 // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure'
whismanoid 37:74aa97afa030 164 // CODE GENERATOR: MAX11410 Command Name = Configure_PGA (uint8_t sigpath, uint8_t gain) --> uint8_t
whismanoid 37:74aa97afa030 165 // CODE GENERATOR: Menu item hint description Menu item 'XP'
whismanoid 37:74aa97afa030 166 // CODE GENERATOR: Menu item 'XP' -- Menu item XP
whismanoid 37:74aa97afa030 167 // CODE GENERATOR: MAX11410 help: XP uint8_t sigpath, uint8_t gain -- Configure_PGA
whismanoid 37:74aa97afa030 168 // CODE GENERATOR: MAX11410 helpString: 'XP sigpath=? gain=? -- Configure_PGA'
whismanoid 37:74aa97afa030 169 // CODE GENERATOR: test menu case 'XP':
whismanoid 37:74aa97afa030 170 // CODE GENERATOR: helpString 'XP sigpath=? gain=? -- Configure_PGA'
whismanoid 37:74aa97afa030 171 // CODE GENERATOR: CMD_ 'None'
whismanoid 37:74aa97afa030 172 // CODE GENERATOR: CommandName 'Configure_PGA'
whismanoid 37:74aa97afa030 173 // CODE GENERATOR: CommandParamIn 'uint8_t sigpath, uint8_t gain'
whismanoid 37:74aa97afa030 174 // CODE GENERATOR: CommandReturnType 'uint8_t'
whismanoid 37:74aa97afa030 175 // CODE GENERATOR: CommandPre ''
whismanoid 37:74aa97afa030 176 // CODE GENERATOR: CommandDocParamIn '@param[in] sigpath = signal path, default=MAX11410::MAX11410_SIG_PATH_enum_t::SIG_PATH_00_BUFFERED'
whismanoid 37:74aa97afa030 177 // CODE GENERATOR: CommandDocParamIn '@param[in] gain = gain selection, default=MAX11410::MAX11410_GAIN_enum_t::GAIN_000_1'
whismanoid 37:74aa97afa030 178 // CODE GENERATOR: CommandDocParamOut ''
whismanoid 37:74aa97afa030 179 // CODE GENERATOR: CommandPost ''
whismanoid 37:74aa97afa030 180 // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure'
whismanoid 37:74aa97afa030 181 // CODE GENERATOR: MAX11410 Command Name = Configure_CTRL (uint8_t extclk, uint8_t u_bn, uint8_t format, uint8_t refbufp_en, uint8_t refbufn_en, uint8_t ref_sel) --> uint8_t
whismanoid 37:74aa97afa030 182 // CODE GENERATOR: Menu item hint description Menu item 'XC'
whismanoid 37:74aa97afa030 183 // CODE GENERATOR: Menu item 'XC' -- Menu item XC
whismanoid 37:74aa97afa030 184 // CODE GENERATOR: MAX11410 help: XC uint8_t extclk, uint8_t u_bn, uint8_t format, uint8_t refbufp_en, uint8_t refbufn_en, uint8_t ref_sel -- Configure_CTRL
whismanoid 37:74aa97afa030 185 // CODE GENERATOR: MAX11410 helpString: 'XC extclk=? u_bn=? format=? refbufp_en=? refbufn_en=? ref_sel=? -- Configure_CTRL'
whismanoid 37:74aa97afa030 186 // CODE GENERATOR: test menu case 'XC':
whismanoid 37:74aa97afa030 187 // CODE GENERATOR: helpString 'XC extclk=? u_bn=? format=? refbufp_en=? refbufn_en=? ref_sel=? -- Configure_CTRL'
whismanoid 37:74aa97afa030 188 // CODE GENERATOR: CMD_ 'None'
whismanoid 37:74aa97afa030 189 // CODE GENERATOR: CommandName 'Configure_CTRL'
whismanoid 37:74aa97afa030 190 // CODE GENERATOR: CommandParamIn 'uint8_t extclk, uint8_t u_bn, uint8_t format, uint8_t refbufp_en, uint8_t refbufn_en, uint8_t ref_sel'
whismanoid 37:74aa97afa030 191 // CODE GENERATOR: CommandReturnType 'uint8_t'
whismanoid 37:74aa97afa030 192 // CODE GENERATOR: CommandPre ''
whismanoid 37:74aa97afa030 193 // CODE GENERATOR: CommandDocParamIn '@param[in] extclk = external clock enable, default=0'
whismanoid 37:74aa97afa030 194 // CODE GENERATOR: CommandDocParamIn '@param[in] u_bn = unipolar input range enable, default=0'
whismanoid 37:74aa97afa030 195 // CODE GENERATOR: CommandDocParamIn '@param[in] format = offset binary format enable, default=0'
whismanoid 37:74aa97afa030 196 // CODE GENERATOR: CommandDocParamIn '@param[in] refbufp_en = REFP reference buffer enable, default=0'
whismanoid 37:74aa97afa030 197 // CODE GENERATOR: CommandDocParamIn '@param[in] refbufn_en = REFN reference buffer enable, default=0'
whismanoid 37:74aa97afa030 198 // CODE GENERATOR: CommandDocParamIn '@param[in] ref_sel = reference selection, default=MAX11410::MAX11410_REF_SEL_enum_t::REF_SEL_001_REF1P_REF1N'
whismanoid 37:74aa97afa030 199 // CODE GENERATOR: CommandDocParamOut ''
whismanoid 37:74aa97afa030 200 // CODE GENERATOR: CommandPost ''
whismanoid 37:74aa97afa030 201 // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure'
whismanoid 55:73d886c105f5 202 // CODE GENERATOR: MAX11410 Command Name = Configure_CTRL_REF (uint8_t ref_sel) --> uint8_t
whismanoid 55:73d886c105f5 203 // CODE GENERATOR: Menu item hint description Menu item 'XR'
whismanoid 55:73d886c105f5 204 // CODE GENERATOR: Menu item 'XR' -- Menu item XR
whismanoid 55:73d886c105f5 205 // CODE GENERATOR: MAX11410 help: XR uint8_t ref_sel -- Configure_CTRL_REF
whismanoid 55:73d886c105f5 206 // CODE GENERATOR: MAX11410 helpString: 'XR ref_sel=? -- Configure_CTRL_REF'
whismanoid 55:73d886c105f5 207 // CODE GENERATOR: test menu case 'XR':
whismanoid 55:73d886c105f5 208 // CODE GENERATOR: helpString 'XR ref_sel=? -- Configure_CTRL_REF'
whismanoid 55:73d886c105f5 209 // CODE GENERATOR: CMD_ 'None'
whismanoid 55:73d886c105f5 210 // CODE GENERATOR: CommandName 'Configure_CTRL_REF'
whismanoid 55:73d886c105f5 211 // CODE GENERATOR: CommandParamIn 'uint8_t ref_sel'
whismanoid 55:73d886c105f5 212 // CODE GENERATOR: CommandReturnType 'uint8_t'
whismanoid 55:73d886c105f5 213 // CODE GENERATOR: CommandPre '@pre ctrl = shadow of CTRL register'
whismanoid 55:73d886c105f5 214 // CODE GENERATOR: CommandDocParamIn '@param[in] ref_sel = reference selection, default=MAX11410::MAX11410_REF_SEL_enum_t::REF_SEL_001_REF1P_REF1N'
whismanoid 55:73d886c105f5 215 // CODE GENERATOR: CommandDocParamOut ''
whismanoid 55:73d886c105f5 216 // CODE GENERATOR: CommandPost ''
whismanoid 55:73d886c105f5 217 // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure'
whismanoid 37:74aa97afa030 218 // CODE GENERATOR: MAX11410 Command Name = Configure_SOURCE (uint8_t vbias_mode, uint8_t brn_mode, uint8_t idac_mode) --> uint8_t
whismanoid 37:74aa97afa030 219 // CODE GENERATOR: Menu item hint description Menu item 'XS'
whismanoid 37:74aa97afa030 220 // CODE GENERATOR: Menu item 'XS' -- Menu item XS
whismanoid 37:74aa97afa030 221 // CODE GENERATOR: MAX11410 help: XS uint8_t vbias_mode, uint8_t brn_mode, uint8_t idac_mode -- Configure_SOURCE
whismanoid 37:74aa97afa030 222 // CODE GENERATOR: MAX11410 helpString: 'XS vbias_mode=? brn_mode=? idac_mode=? -- Configure_SOURCE'
whismanoid 37:74aa97afa030 223 // CODE GENERATOR: test menu case 'XS':
whismanoid 37:74aa97afa030 224 // CODE GENERATOR: helpString 'XS vbias_mode=? brn_mode=? idac_mode=? -- Configure_SOURCE'
whismanoid 37:74aa97afa030 225 // CODE GENERATOR: CMD_ 'None'
whismanoid 37:74aa97afa030 226 // CODE GENERATOR: CommandName 'Configure_SOURCE'
whismanoid 37:74aa97afa030 227 // CODE GENERATOR: CommandParamIn 'uint8_t vbias_mode, uint8_t brn_mode, uint8_t idac_mode'
whismanoid 37:74aa97afa030 228 // CODE GENERATOR: CommandReturnType 'uint8_t'
whismanoid 37:74aa97afa030 229 // CODE GENERATOR: CommandPre ''
whismanoid 37:74aa97afa030 230 // CODE GENERATOR: CommandDocParamIn '@param[in] vbias_mode = _______, default=MAX11410::MAX11410_VBIAS_MODE_enum_t::VBIAS_MODE_00_Active'
whismanoid 37:74aa97afa030 231 // CODE GENERATOR: CommandDocParamIn '@param[in] brn_mode = _______, default=MAX11410::MAX11410_BRN_MODE_enum_t::BRN_MODE_00_disabled'
whismanoid 37:74aa97afa030 232 // CODE GENERATOR: CommandDocParamIn '@param[in] idac_mode = _______, default=MAX11410::MAX11410_IDAC_MODE_enum_t::IDAC_MODE_0000_10uA'
whismanoid 37:74aa97afa030 233 // CODE GENERATOR: CommandDocParamOut ''
whismanoid 37:74aa97afa030 234 // CODE GENERATOR: CommandPost ''
whismanoid 37:74aa97afa030 235 // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure'
whismanoid 37:74aa97afa030 236 // CODE GENERATOR: MAX11410 Command Name = Configure_MUX_CTRL0 (uint8_t ainp, uint8_t ainn) --> uint8_t
whismanoid 37:74aa97afa030 237 // CODE GENERATOR: Menu item hint description Menu item 'XM'
whismanoid 37:74aa97afa030 238 // CODE GENERATOR: Menu item 'XM' -- Menu item XM
whismanoid 37:74aa97afa030 239 // CODE GENERATOR: MAX11410 help: XM uint8_t ainp, uint8_t ainn -- Configure_MUX_CTRL0
whismanoid 37:74aa97afa030 240 // CODE GENERATOR: MAX11410 helpString: 'XM ainp=? ainn=? -- Configure_MUX_CTRL0'
whismanoid 37:74aa97afa030 241 // CODE GENERATOR: test menu case 'XM':
whismanoid 37:74aa97afa030 242 // CODE GENERATOR: helpString 'XM ainp=? ainn=? -- Configure_MUX_CTRL0'
whismanoid 37:74aa97afa030 243 // CODE GENERATOR: CMD_ 'None'
whismanoid 37:74aa97afa030 244 // CODE GENERATOR: CommandName 'Configure_MUX_CTRL0'
whismanoid 37:74aa97afa030 245 // CODE GENERATOR: CommandParamIn 'uint8_t ainp, uint8_t ainn'
whismanoid 37:74aa97afa030 246 // CODE GENERATOR: CommandReturnType 'uint8_t'
whismanoid 37:74aa97afa030 247 // CODE GENERATOR: CommandPre ''
whismanoid 37:74aa97afa030 248 // CODE GENERATOR: CommandDocParamIn '@param[in] ainp = channel high side, default=MAX11410::MAX11410_AINP_SEL_enum_t::AINP_SEL_0000_AIN0'
whismanoid 37:74aa97afa030 249 // CODE GENERATOR: CommandDocParamIn '@param[in] ainn = channel low side, default=MAX11410::MAX11410_AINN_SEL_enum_t::AINN_SEL_1010_GND'
whismanoid 37:74aa97afa030 250 // CODE GENERATOR: CommandDocParamOut ''
whismanoid 37:74aa97afa030 251 // CODE GENERATOR: CommandPost ''
whismanoid 37:74aa97afa030 252 // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure'
whismanoid 37:74aa97afa030 253 // CODE GENERATOR: MAX11410 Command Name = Configure_MUX_CTRL1 (uint8_t idac1_sel, uint8_t idac0_sel) --> uint8_t
whismanoid 37:74aa97afa030 254 // CODE GENERATOR: Menu item hint description Menu item 'XI'
whismanoid 37:74aa97afa030 255 // CODE GENERATOR: Menu item 'XI' -- Menu item XI
whismanoid 37:74aa97afa030 256 // CODE GENERATOR: MAX11410 help: XI uint8_t idac1_sel, uint8_t idac0_sel -- Configure_MUX_CTRL1
whismanoid 37:74aa97afa030 257 // CODE GENERATOR: MAX11410 helpString: 'XI idac1_sel=? idac0_sel=? -- Configure_MUX_CTRL1'
whismanoid 37:74aa97afa030 258 // CODE GENERATOR: test menu case 'XI':
whismanoid 37:74aa97afa030 259 // CODE GENERATOR: helpString 'XI idac1_sel=? idac0_sel=? -- Configure_MUX_CTRL1'
whismanoid 37:74aa97afa030 260 // CODE GENERATOR: CMD_ 'None'
whismanoid 37:74aa97afa030 261 // CODE GENERATOR: CommandName 'Configure_MUX_CTRL1'
whismanoid 37:74aa97afa030 262 // CODE GENERATOR: CommandParamIn 'uint8_t idac1_sel, uint8_t idac0_sel'
whismanoid 37:74aa97afa030 263 // CODE GENERATOR: CommandReturnType 'uint8_t'
whismanoid 37:74aa97afa030 264 // CODE GENERATOR: CommandPre ''
whismanoid 37:74aa97afa030 265 // CODE GENERATOR: CommandDocParamIn '@param[in] idac1_sel = channel high side, default=MAX11410::MAX11410_IDAC1_SEL_enum_t::IDAC1_SEL_1111_unconnected'
whismanoid 37:74aa97afa030 266 // CODE GENERATOR: CommandDocParamIn '@param[in] idac0_sel = channel low side, default=MAX11410::MAX11410_IDAC0_SEL_enum_t::IDAC0_SEL_1111_unconnected'
whismanoid 37:74aa97afa030 267 // CODE GENERATOR: CommandDocParamOut ''
whismanoid 37:74aa97afa030 268 // CODE GENERATOR: CommandPost ''
whismanoid 37:74aa97afa030 269 // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure'
whismanoid 37:74aa97afa030 270 // CODE GENERATOR: MAX11410 Command Name = Configure_MUX_CTRL2 (uint8_t vbias_ain7_ain0_bitmap) --> uint8_t
whismanoid 37:74aa97afa030 271 // CODE GENERATOR: Menu item hint description Menu item 'XV'
whismanoid 37:74aa97afa030 272 // CODE GENERATOR: Menu item 'XV' -- Menu item XV
whismanoid 37:74aa97afa030 273 // CODE GENERATOR: MAX11410 help: XV uint8_t vbias_ain7_ain0_bitmap -- Configure_MUX_CTRL2
whismanoid 37:74aa97afa030 274 // CODE GENERATOR: MAX11410 helpString: 'XV vbias_ain7_ain0_bitmap=? -- Configure_MUX_CTRL2'
whismanoid 37:74aa97afa030 275 // CODE GENERATOR: test menu case 'XV':
whismanoid 37:74aa97afa030 276 // CODE GENERATOR: helpString 'XV vbias_ain7_ain0_bitmap=? -- Configure_MUX_CTRL2'
whismanoid 37:74aa97afa030 277 // CODE GENERATOR: CMD_ 'None'
whismanoid 37:74aa97afa030 278 // CODE GENERATOR: CommandName 'Configure_MUX_CTRL2'
whismanoid 37:74aa97afa030 279 // CODE GENERATOR: CommandParamIn 'uint8_t vbias_ain7_ain0_bitmap'
whismanoid 37:74aa97afa030 280 // CODE GENERATOR: CommandReturnType 'uint8_t'
whismanoid 37:74aa97afa030 281 // CODE GENERATOR: CommandPre ''
whismanoid 37:74aa97afa030 282 // CODE GENERATOR: CommandDocParamIn '@param[in] vbias_ain7_ain0_bitmap = bit map of AIN7..AIN0 enables for voltage bias, default=0'
whismanoid 37:74aa97afa030 283 // CODE GENERATOR: CommandDocParamOut ''
whismanoid 37:74aa97afa030 284 // CODE GENERATOR: CommandPost ''
whismanoid 37:74aa97afa030 285 // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure'
whismanoid 37:74aa97afa030 286 // CODE GENERATOR: MAX11410 Command Name = Calibrate_Self_Offset_Gain (void) --> uint8_t
whismanoid 37:74aa97afa030 287 // CODE GENERATOR: Menu item hint description Menu item 'X0'
whismanoid 37:74aa97afa030 288 // CODE GENERATOR: Menu item 'X0' -- Menu item X0
whismanoid 37:74aa97afa030 289 // CODE GENERATOR: test menu case 'X0':
whismanoid 37:74aa97afa030 290 // CODE GENERATOR: helpString 'X0 -- Calibrate_Self_Offset_Gain'
whismanoid 37:74aa97afa030 291 // CODE GENERATOR: CMD_ 'None'
whismanoid 37:74aa97afa030 292 // CODE GENERATOR: CommandName 'Calibrate_Self_Offset_Gain'
whismanoid 37:74aa97afa030 293 // CODE GENERATOR: CommandParamIn 'void'
whismanoid 37:74aa97afa030 294 // CODE GENERATOR: CommandReturnType 'uint8_t'
whismanoid 37:74aa97afa030 295 // CODE GENERATOR: CommandPre ''
whismanoid 37:74aa97afa030 296 // CODE GENERATOR: CommandDocParamIn ''
whismanoid 37:74aa97afa030 297 // CODE GENERATOR: CommandDocParamOut ''
whismanoid 37:74aa97afa030 298 // CODE GENERATOR: CommandPost ''
whismanoid 37:74aa97afa030 299 // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure'
whismanoid 37:74aa97afa030 300 // CODE GENERATOR: MAX11410 Command Name = Calibrate_PGA_Gain (void) --> uint8_t
whismanoid 37:74aa97afa030 301 // CODE GENERATOR: Menu item hint description Menu item 'X1'
whismanoid 37:74aa97afa030 302 // CODE GENERATOR: Menu item 'X1' -- Menu item X1
whismanoid 37:74aa97afa030 303 // CODE GENERATOR: test menu case 'X1':
whismanoid 37:74aa97afa030 304 // CODE GENERATOR: helpString 'X1 -- Calibrate_PGA_Gain'
whismanoid 37:74aa97afa030 305 // CODE GENERATOR: CMD_ 'None'
whismanoid 37:74aa97afa030 306 // CODE GENERATOR: CommandName 'Calibrate_PGA_Gain'
whismanoid 37:74aa97afa030 307 // CODE GENERATOR: CommandParamIn 'void'
whismanoid 37:74aa97afa030 308 // CODE GENERATOR: CommandReturnType 'uint8_t'
whismanoid 37:74aa97afa030 309 // CODE GENERATOR: CommandPre ''
whismanoid 37:74aa97afa030 310 // CODE GENERATOR: CommandDocParamIn ''
whismanoid 37:74aa97afa030 311 // CODE GENERATOR: CommandDocParamOut ''
whismanoid 37:74aa97afa030 312 // CODE GENERATOR: CommandPost ''
whismanoid 37:74aa97afa030 313 // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure'
whismanoid 37:74aa97afa030 314 // CODE GENERATOR: MAX11410 Command Name = Calibrate_System_Offset_A (void) --> uint8_t
whismanoid 37:74aa97afa030 315 // CODE GENERATOR: Menu item hint description Menu item 'X4'
whismanoid 37:74aa97afa030 316 // CODE GENERATOR: Menu item 'X4' -- Menu item X4
whismanoid 37:74aa97afa030 317 // CODE GENERATOR: test menu case 'X4':
whismanoid 37:74aa97afa030 318 // CODE GENERATOR: helpString 'X4 -- Calibrate_System_Offset_A'
whismanoid 37:74aa97afa030 319 // CODE GENERATOR: CMD_ 'None'
whismanoid 37:74aa97afa030 320 // CODE GENERATOR: CommandName 'Calibrate_System_Offset_A'
whismanoid 37:74aa97afa030 321 // CODE GENERATOR: CommandParamIn 'void'
whismanoid 37:74aa97afa030 322 // CODE GENERATOR: CommandReturnType 'uint8_t'
whismanoid 37:74aa97afa030 323 // CODE GENERATOR: CommandPre ''
whismanoid 37:74aa97afa030 324 // CODE GENERATOR: CommandDocParamIn ''
whismanoid 37:74aa97afa030 325 // CODE GENERATOR: CommandDocParamOut ''
whismanoid 37:74aa97afa030 326 // CODE GENERATOR: CommandPost ''
whismanoid 37:74aa97afa030 327 // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure'
whismanoid 37:74aa97afa030 328 // CODE GENERATOR: MAX11410 Command Name = Calibrate_System_Gain_A (void) --> uint8_t
whismanoid 37:74aa97afa030 329 // CODE GENERATOR: Menu item hint description Menu item 'X5'
whismanoid 37:74aa97afa030 330 // CODE GENERATOR: Menu item 'X5' -- Menu item X5
whismanoid 37:74aa97afa030 331 // CODE GENERATOR: test menu case 'X5':
whismanoid 37:74aa97afa030 332 // CODE GENERATOR: helpString 'X5 -- Calibrate_System_Gain_A'
whismanoid 37:74aa97afa030 333 // CODE GENERATOR: CMD_ 'None'
whismanoid 37:74aa97afa030 334 // CODE GENERATOR: CommandName 'Calibrate_System_Gain_A'
whismanoid 37:74aa97afa030 335 // CODE GENERATOR: CommandParamIn 'void'
whismanoid 37:74aa97afa030 336 // CODE GENERATOR: CommandReturnType 'uint8_t'
whismanoid 37:74aa97afa030 337 // CODE GENERATOR: CommandPre ''
whismanoid 37:74aa97afa030 338 // CODE GENERATOR: CommandDocParamIn ''
whismanoid 37:74aa97afa030 339 // CODE GENERATOR: CommandDocParamOut ''
whismanoid 37:74aa97afa030 340 // CODE GENERATOR: CommandPost ''
whismanoid 37:74aa97afa030 341 // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure'
whismanoid 37:74aa97afa030 342 // CODE GENERATOR: MAX11410 Command Name = Calibrate_System_Offset_B (void) --> uint8_t
whismanoid 37:74aa97afa030 343 // CODE GENERATOR: Menu item hint description Menu item 'X6'
whismanoid 37:74aa97afa030 344 // CODE GENERATOR: Menu item 'X6' -- Menu item X6
whismanoid 37:74aa97afa030 345 // CODE GENERATOR: test menu case 'X6':
whismanoid 37:74aa97afa030 346 // CODE GENERATOR: helpString 'X6 -- Calibrate_System_Offset_B'
whismanoid 37:74aa97afa030 347 // CODE GENERATOR: CMD_ 'None'
whismanoid 37:74aa97afa030 348 // CODE GENERATOR: CommandName 'Calibrate_System_Offset_B'
whismanoid 37:74aa97afa030 349 // CODE GENERATOR: CommandParamIn 'void'
whismanoid 37:74aa97afa030 350 // CODE GENERATOR: CommandReturnType 'uint8_t'
whismanoid 37:74aa97afa030 351 // CODE GENERATOR: CommandPre ''
whismanoid 37:74aa97afa030 352 // CODE GENERATOR: CommandDocParamIn ''
whismanoid 37:74aa97afa030 353 // CODE GENERATOR: CommandDocParamOut ''
whismanoid 37:74aa97afa030 354 // CODE GENERATOR: CommandPost ''
whismanoid 37:74aa97afa030 355 // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure'
whismanoid 37:74aa97afa030 356 // CODE GENERATOR: MAX11410 Command Name = Calibrate_System_Gain_B (void) --> uint8_t
whismanoid 37:74aa97afa030 357 // CODE GENERATOR: Menu item hint description Menu item 'X7'
whismanoid 37:74aa97afa030 358 // CODE GENERATOR: Menu item 'X7' -- Menu item X7
whismanoid 37:74aa97afa030 359 // CODE GENERATOR: test menu case 'X7':
whismanoid 37:74aa97afa030 360 // CODE GENERATOR: helpString 'X7 -- Calibrate_System_Gain_B'
whismanoid 37:74aa97afa030 361 // CODE GENERATOR: CMD_ 'None'
whismanoid 37:74aa97afa030 362 // CODE GENERATOR: CommandName 'Calibrate_System_Gain_B'
whismanoid 37:74aa97afa030 363 // CODE GENERATOR: CommandParamIn 'void'
whismanoid 37:74aa97afa030 364 // CODE GENERATOR: CommandReturnType 'uint8_t'
whismanoid 37:74aa97afa030 365 // CODE GENERATOR: CommandPre ''
whismanoid 37:74aa97afa030 366 // CODE GENERATOR: CommandDocParamIn ''
whismanoid 37:74aa97afa030 367 // CODE GENERATOR: CommandDocParamOut ''
whismanoid 37:74aa97afa030 368 // CODE GENERATOR: CommandPost ''
whismanoid 37:74aa97afa030 369 // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure'
whismanoid 37:74aa97afa030 370 // CODE GENERATOR: MAX11410 Command Name = Configure_Voltage (MAX11410_AINP_SEL_enum_t ainp, MAX11410_AINN_SEL_enum_t ainn) --> uint8_t
whismanoid 35:8aa5dffe523d 371 // CODE GENERATOR: no Menu item hint in description
whismanoid 37:74aa97afa030 372 // CODE GENERATOR: MAX11410 Command Name = Read_All_Voltages (void) --> uint8_t
whismanoid 54:ba810c1d6264 373 // CODE GENERATOR: Menu item hint description Menu item '$' -> AINcode[0], AINcode[1], AINcode[2], AINcode[3], AINcode[4], AINcode[5], AINcode[6], AINcode[7], AINcode[8], AINcode[9], AINcode[10]
whismanoid 54:ba810c1d6264 374 // CODE GENERATOR: Menu item '$' -> AINcode[0], AINcode[1], AINcode[2], AINcode[3], AINcode[4], AINcode[5], AINcode[6], AINcode[7], AINcode[8], AINcode[9], AINcode[10] -- Menu item $
whismanoid 37:74aa97afa030 375 // CODE GENERATOR: test menu case '$':
whismanoid 37:74aa97afa030 376 // CODE GENERATOR: helpString '$ -- Read_All_Voltages'
whismanoid 37:74aa97afa030 377 // CODE GENERATOR: CMD_ 'None'
whismanoid 37:74aa97afa030 378 // CODE GENERATOR: CommandName 'Read_All_Voltages'
whismanoid 37:74aa97afa030 379 // CODE GENERATOR: CommandParamIn 'void'
whismanoid 37:74aa97afa030 380 // CODE GENERATOR: CommandReturnType 'uint8_t'
whismanoid 37:74aa97afa030 381 // CODE GENERATOR: CommandPre ''
whismanoid 37:74aa97afa030 382 // CODE GENERATOR: CommandDocParamIn ''
whismanoid 37:74aa97afa030 383 // CODE GENERATOR: CommandDocParamOut ''
whismanoid 51:15d9a9e0b623 384 // CODE GENERATOR: CommandPost '@post AINcode[0..10]: measurement result LSB code'
whismanoid 37:74aa97afa030 385 // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure'
whismanoid 37:74aa97afa030 386 // CODE GENERATOR: MAX11410 Command Name = Measure_Voltage (MAX11410_AINP_SEL_enum_t ainp, MAX11410_AINN_SEL_enum_t ainn) --> double
whismanoid 37:74aa97afa030 387 // CODE GENERATOR: Menu item hint description Menu item 'V'
whismanoid 37:74aa97afa030 388 // CODE GENERATOR: Menu item 'V' -- Menu item V
whismanoid 37:74aa97afa030 389 // CODE GENERATOR: MAX11410 help: V MAX11410_AINP_SEL_enum_t ainp, MAX11410_AINN_SEL_enum_t ainn -- Measure_Voltage
whismanoid 37:74aa97afa030 390 // CODE GENERATOR: MAX11410 helpString: 'V -- Measure_Voltage'
whismanoid 37:74aa97afa030 391 // CODE GENERATOR: test menu case 'V':
whismanoid 37:74aa97afa030 392 // CODE GENERATOR: helpString 'V -- Measure_Voltage'
whismanoid 37:74aa97afa030 393 // CODE GENERATOR: CMD_ 'None'
whismanoid 37:74aa97afa030 394 // CODE GENERATOR: CommandName 'Measure_Voltage'
whismanoid 37:74aa97afa030 395 // CODE GENERATOR: CommandParamIn 'MAX11410_AINP_SEL_enum_t ainp, MAX11410_AINN_SEL_enum_t ainn'
whismanoid 37:74aa97afa030 396 // CODE GENERATOR: CommandReturnType 'double'
whismanoid 37:74aa97afa030 397 // CODE GENERATOR: CommandPre '@pre external connection REF2P-REF2N is a reference voltage'
whismanoid 37:74aa97afa030 398 // CODE GENERATOR: CommandPre '@pre VRef = Voltage of REF input, in Volts'
whismanoid 37:74aa97afa030 399 // CODE GENERATOR: CommandDocParamIn '@param[in] ainp = channel high side, default=AINP_SEL_0000_AIN0'
whismanoid 37:74aa97afa030 400 // CODE GENERATOR: CommandDocParamIn '@param[in] ainn = channel low side, default=AINN_SEL_1010_GND'
whismanoid 37:74aa97afa030 401 // CODE GENERATOR: CommandDocParamOut ''
whismanoid 37:74aa97afa030 402 // CODE GENERATOR: CommandPost '@post AINcode[ainp]: measurement result LSB code'
whismanoid 37:74aa97afa030 403 // CODE GENERATOR: CommandReturn '@return ideal voltage calculated from raw LSB code and reference voltage'
whismanoid 37:74aa97afa030 404 // CODE GENERATOR: MAX11410 Command Name = Measure_RTD (MAX11410_AINP_SEL_enum_t rtd_iout, MAX11410_AINP_SEL_enum_t rtd_ainp, MAX11410_AINN_SEL_enum_t rtd_ainn) --> double
whismanoid 48:2591fcdece5e 405 // CODE GENERATOR: Menu item hint description Menu item 'R' -> rtd_resistance, RTD_Temperature
whismanoid 48:2591fcdece5e 406 // CODE GENERATOR: Menu item 'R' -> rtd_resistance, RTD_Temperature -- Menu item R
whismanoid 48:2591fcdece5e 407 // CODE GENERATOR: MAX11410 help: R MAX11410_AINP_SEL_enum_t rtd_iout, MAX11410_AINP_SEL_enum_t rtd_ainp, MAX11410_AINN_SEL_enum_t rtd_ainn -- Measure_RTD
whismanoid 48:2591fcdece5e 408 // CODE GENERATOR: MAX11410 helpString: 'R -- Measure_RTD'
whismanoid 48:2591fcdece5e 409 // CODE GENERATOR: test menu case 'R':
whismanoid 48:2591fcdece5e 410 // CODE GENERATOR: helpString 'R -- Measure_RTD'
whismanoid 37:74aa97afa030 411 // CODE GENERATOR: CMD_ 'None'
whismanoid 37:74aa97afa030 412 // CODE GENERATOR: CommandName 'Measure_RTD'
whismanoid 37:74aa97afa030 413 // CODE GENERATOR: CommandParamIn 'MAX11410_AINP_SEL_enum_t rtd_iout, MAX11410_AINP_SEL_enum_t rtd_ainp, MAX11410_AINN_SEL_enum_t rtd_ainn'
whismanoid 37:74aa97afa030 414 // CODE GENERATOR: CommandReturnType 'double'
whismanoid 37:74aa97afa030 415 // CODE GENERATOR: CommandPre '@pre external connection REF1P-REF1N is a reference resistor'
whismanoid 37:74aa97afa030 416 // CODE GENERATOR: CommandPre '@pre VRef_REF1 = reference resistance in ohms, default=4999'
whismanoid 37:74aa97afa030 417 // CODE GENERATOR: CommandDocParamIn '@param[in] rtd_iout = channel RTD high side force, default=AINP_SEL_0111_AIN7'
whismanoid 37:74aa97afa030 418 // CODE GENERATOR: CommandDocParamIn '@param[in] rtd_ainp = channel RTD high side sense, default=AINP_SEL_1000_AIN8'
whismanoid 37:74aa97afa030 419 // CODE GENERATOR: CommandDocParamIn '@param[in] rtd_ainn = channel RTD low side, default=AINN_SEL_1001_AIN9'
whismanoid 37:74aa97afa030 420 // CODE GENERATOR: CommandDocParamOut ''
whismanoid 37:74aa97afa030 421 // CODE GENERATOR: CommandPost '@post AINcode[rtd_ainp]: measurement result LSB code'
whismanoid 48:2591fcdece5e 422 // CODE GENERATOR: CommandPost '@post rtd_resistance: measurement result resistance in Ohms'
whismanoid 48:2591fcdece5e 423 // CODE GENERATOR: CommandPost '@post RTD_Temperature: Temperature calculated from RTD Resistance; Thermocouple Cold Junction, in degrees C'
whismanoid 46:79dba7d4110c 424 // CODE GENERATOR: CommandReturn '@return resistance calculated from raw LSB code and reference resistance'
whismanoid 46:79dba7d4110c 425 // CODE GENERATOR: MAX11410 Command Name = TemperatureOfRTD_PT1000 (double rtd_resistance) --> double
whismanoid 48:2591fcdece5e 426 // CODE GENERATOR: no Menu item hint in description
whismanoid 56:6e9c52cc9abe 427 // CODE GENERATOR: MAX11410 Command Name = TemperatureOfRTD_PT100 (double rtd_resistance) --> double
whismanoid 56:6e9c52cc9abe 428 // CODE GENERATOR: no Menu item hint in description
whismanoid 56:6e9c52cc9abe 429 // CODE GENERATOR: MAX11410 Command Name = TemperatureOfRTD (double rtd_resistance) --> double
whismanoid 56:6e9c52cc9abe 430 // CODE GENERATOR: no Menu item hint in description
whismanoid 37:74aa97afa030 431 // CODE GENERATOR: MAX11410 Command Name = Measure_Thermocouple (MAX11410_AINP_SEL_enum_t tc_ainp, MAX11410_AINN_SEL_enum_t tc_ainn, MAX11410_AINP_SEL_enum_t rtd_iout, MAX11410_AINP_SEL_enum_t rtd_ainp, MAX11410_AINN_SEL_enum_t rtd_ainn) --> double
whismanoid 46:79dba7d4110c 432 // CODE GENERATOR: Menu item hint description Menu item 'TM'
whismanoid 46:79dba7d4110c 433 // CODE GENERATOR: Menu item 'TM' -- Menu item TM
whismanoid 46:79dba7d4110c 434 // CODE GENERATOR: MAX11410 help: TM MAX11410_AINP_SEL_enum_t tc_ainp, MAX11410_AINN_SEL_enum_t tc_ainn, MAX11410_AINP_SEL_enum_t rtd_iout, MAX11410_AINP_SEL_enum_t rtd_ainp, MAX11410_AINN_SEL_enum_t rtd_ainn -- Measure_Thermocouple
whismanoid 46:79dba7d4110c 435 // CODE GENERATOR: MAX11410 helpString: 'TM -- Measure_Thermocouple'
whismanoid 46:79dba7d4110c 436 // CODE GENERATOR: test menu case 'TM':
whismanoid 46:79dba7d4110c 437 // CODE GENERATOR: helpString 'TM -- Measure_Thermocouple'
whismanoid 37:74aa97afa030 438 // CODE GENERATOR: CMD_ 'None'
whismanoid 37:74aa97afa030 439 // CODE GENERATOR: CommandName 'Measure_Thermocouple'
whismanoid 37:74aa97afa030 440 // CODE GENERATOR: CommandParamIn 'MAX11410_AINP_SEL_enum_t tc_ainp, MAX11410_AINN_SEL_enum_t tc_ainn, MAX11410_AINP_SEL_enum_t rtd_iout, MAX11410_AINP_SEL_enum_t rtd_ainp, MAX11410_AINN_SEL_enum_t rtd_ainn'
whismanoid 37:74aa97afa030 441 // CODE GENERATOR: CommandReturnType 'double'
whismanoid 37:74aa97afa030 442 // CODE GENERATOR: CommandPre ''
whismanoid 37:74aa97afa030 443 // CODE GENERATOR: CommandDocParamIn '@param[in] tc_ainp = channel of Thermocouple high side, default=AINP_SEL_0101_AIN5'
whismanoid 37:74aa97afa030 444 // CODE GENERATOR: CommandDocParamIn '@param[in] tc_ainn = channel of Thermocouple low side, default=AINN_SEL_0110_AIN6'
whismanoid 37:74aa97afa030 445 // CODE GENERATOR: CommandDocParamIn '@param[in] rtd_iout = channel RTD high side force, default=AINP_SEL_0111_AIN7'
whismanoid 37:74aa97afa030 446 // CODE GENERATOR: CommandDocParamIn '@param[in] rtd_ainp = channel RTD high side sense, default=AINP_SEL_1000_AIN8'
whismanoid 37:74aa97afa030 447 // CODE GENERATOR: CommandDocParamIn '@param[in] rtd_ainn = channel RTD low side, default=AINN_SEL_1001_AIN9'
whismanoid 37:74aa97afa030 448 // CODE GENERATOR: CommandDocParamOut ''
whismanoid 37:74aa97afa030 449 // CODE GENERATOR: CommandPost '@post AINcode[tc_ainp]: measurement result LSB code'
whismanoid 37:74aa97afa030 450 // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure'
whismanoid 46:79dba7d4110c 451 // CODE GENERATOR: MAX11410 Command Name = TemperatureOfTC_TypeK (double tc_voltage) --> double
whismanoid 46:79dba7d4110c 452 // CODE GENERATOR: Menu item hint description Menu item 'TK'
whismanoid 46:79dba7d4110c 453 // CODE GENERATOR: Menu item 'TK' -- Menu item TK
whismanoid 46:79dba7d4110c 454 // CODE GENERATOR: MAX11410 help: TK double tc_voltage -- TemperatureOfTC_TypeK
whismanoid 46:79dba7d4110c 455 // CODE GENERATOR: MAX11410 helpString: 'TK tc_voltage=? -- TemperatureOfTC_TypeK'
whismanoid 46:79dba7d4110c 456 // CODE GENERATOR: test menu case 'TK':
whismanoid 46:79dba7d4110c 457 // CODE GENERATOR: helpString 'TK tc_voltage=? -- TemperatureOfTC_TypeK'
whismanoid 46:79dba7d4110c 458 // CODE GENERATOR: CMD_ 'None'
whismanoid 46:79dba7d4110c 459 // CODE GENERATOR: CommandName 'TemperatureOfTC_TypeK'
whismanoid 46:79dba7d4110c 460 // CODE GENERATOR: CommandParamIn 'double tc_voltage'
whismanoid 46:79dba7d4110c 461 // CODE GENERATOR: CommandReturnType 'double'
whismanoid 46:79dba7d4110c 462 // CODE GENERATOR: CommandPre '@pre {0}.RTD_Temperature = cold junction temperature, in degrees C'
whismanoid 46:79dba7d4110c 463 // CODE GENERATOR: CommandDocParamIn '@param[in] tc_voltage = Thermocouple voltage in volts, default=0.0254'
whismanoid 46:79dba7d4110c 464 // CODE GENERATOR: CommandDocParamOut ''
whismanoid 46:79dba7d4110c 465 // CODE GENERATOR: CommandPost ''
whismanoid 46:79dba7d4110c 466 // CODE GENERATOR: CommandReturn '@return ideal temperature in degrees C, calculated from RTD resistance in ohms'
whismanoid 59:c0376adb6ebc 467 // CODE GENERATOR: CommandDocTest '@test tinyTester.blink_time_msec = 20 // quickly speed through the software verification'
whismanoid 59:c0376adb6ebc 468 // CODE GENERATOR: CommandDocTest '@test group TC_1 TemperatureOfTC_TypeK(0.000e-3) expect 0.0 within 0.1 // TC_TypeK at 0C = 0.000mV'
whismanoid 59:c0376adb6ebc 469 // CODE GENERATOR: CommandDocTest '@test group TC_1 TemperatureOfTC_TypeK(0.039e-3) expect 1.0 within 0.1 // TC_TypeK at 1C = 0.039mV'
whismanoid 59:c0376adb6ebc 470 // CODE GENERATOR: CommandDocTest '@test group TC_1 TemperatureOfTC_TypeK(0.079e-3) expect 2.0 within 0.1 // TC_TypeK at 2C = 0.079mV'
whismanoid 59:c0376adb6ebc 471 // CODE GENERATOR: CommandDocTest '@test group TC_1 TemperatureOfTC_TypeK(0.119e-3) expect 3.0 within 0.1 // TC_TypeK at 3C = 0.119mV'
whismanoid 59:c0376adb6ebc 472 // CODE GENERATOR: CommandDocTest '@test group TC_2 TemperatureOfTC_TypeK(0.158e-3) expect 4.0 within 0.1 // TC_TypeK at 4C = 0.158mV'
whismanoid 59:c0376adb6ebc 473 // CODE GENERATOR: CommandDocTest '@test group TC_2 TemperatureOfTC_TypeK(0.198e-3) expect 5.0 within 0.1 // TC_TypeK at 5C = 0.198mV'
whismanoid 59:c0376adb6ebc 474 // CODE GENERATOR: CommandDocTest '@test group TC_2 TemperatureOfTC_TypeK(0.238e-3) expect 6.0 within 0.1 // TC_TypeK at 6C = 0.238mV'
whismanoid 59:c0376adb6ebc 475 // CODE GENERATOR: CommandDocTest '@test group TC_2 TemperatureOfTC_TypeK(0.2775e-3) expect 7.0 within 0.1 // TC_TypeK at 7C = 0.2775mV'
whismanoid 59:c0376adb6ebc 476 // CODE GENERATOR: CommandDocTest '@test group TC_2 TemperatureOfTC_TypeK(0.317e-3) expect 8.0 within 0.1 // TC_TypeK at 8C = 0.317mV'
whismanoid 59:c0376adb6ebc 477 // CODE GENERATOR: CommandDocTest '@test group TC_2 TemperatureOfTC_TypeK(0.357e-3) expect 9.0 within 0.1 // TC_TypeK at 9C = 0.357mV'
whismanoid 59:c0376adb6ebc 478 // CODE GENERATOR: CommandDocTest '@test group TC_1 TemperatureOfTC_TypeK(0.397e-3) expect 10.0 within 0.1 // TC_TypeK at 10C = 0.397mV'
whismanoid 59:c0376adb6ebc 479 // CODE GENERATOR: CommandDocTest '@test group TC_1 TemperatureOfTC_TypeK(0.798e-3) expect 20.0 within 0.1 // TC_TypeK at 20C = 0.798mV'
whismanoid 59:c0376adb6ebc 480 // CODE GENERATOR: CommandDocTest '@test group TC_1 TemperatureOfTC_TypeK(1.081e-3) expect 27.0 within 0.1 // TC_TypeK at 27C = 1.081mV'
whismanoid 59:c0376adb6ebc 481 // CODE GENERATOR: CommandDocTest '@test group TC_1 TemperatureOfTC_TypeK(1.203e-3) expect 30.0 within 0.1 // TC_TypeK at 30C = 1.203mV'
whismanoid 59:c0376adb6ebc 482 // CODE GENERATOR: CommandDocTest '@test group TC_1 TemperatureOfTC_TypeK(1.612e-3) expect 40.0 within 0.1 // TC_TypeK at 40C = 1.612mV'
whismanoid 59:c0376adb6ebc 483 // CODE GENERATOR: CommandDocTest '@test group TC_1 TemperatureOfTC_TypeK(2.023e-3) expect 50.0 within 0.1 // TC_TypeK at 50C = 2.023mV'
whismanoid 59:c0376adb6ebc 484 // CODE GENERATOR: CommandDocTest '@test group TC_1 TemperatureOfTC_TypeK(2.436e-3) expect 60.0 within 0.1 // TC_TypeK at 60C = 2.436mV'
whismanoid 59:c0376adb6ebc 485 // CODE GENERATOR: CommandDocTest '@test group TC_1 TemperatureOfTC_TypeK(2.851e-3) expect 70.0 within 0.1 // TC_TypeK at 70C = 2.851mV'
whismanoid 59:c0376adb6ebc 486 // CODE GENERATOR: CommandDocTest '@test group TC_1 TemperatureOfTC_TypeK(3.267e-3) expect 80.0 within 0.1 // TC_TypeK at 80C = 3.267mV'
whismanoid 59:c0376adb6ebc 487 // CODE GENERATOR: CommandDocTest '@test group TC_1 TemperatureOfTC_TypeK(3.682e-3) expect 90.0 within 0.1 // TC_TypeK at 90C = 3.682mV'
whismanoid 59:c0376adb6ebc 488 // CODE GENERATOR: CommandDocTest '@test group TC_1 TemperatureOfTC_TypeK(4.096e-3) expect 100.0 within 0.1 // TC_TypeK at 100C = 4.096mV'
whismanoid 59:c0376adb6ebc 489 // CODE GENERATOR: CommandDocTest '@test group TC_2 TemperatureOfTC_TypeK(4.509e-3) expect 110.0 within 0.1 // TC_TypeK at 110C = 4.509mV'
whismanoid 59:c0376adb6ebc 490 // CODE GENERATOR: CommandDocTest '@test group TC_2 TemperatureOfTC_TypeK(4.920e-3) expect 120.0 within 0.1 // TC_TypeK at 120C = 4.920mV'
whismanoid 59:c0376adb6ebc 491 // CODE GENERATOR: CommandDocTest '@test group TC_2 TemperatureOfTC_TypeK(5.328e-3) expect 130.0 within 0.1 // TC_TypeK at 130C = 5.328mV'
whismanoid 59:c0376adb6ebc 492 // CODE GENERATOR: CommandDocTest '@test group TC_2 TemperatureOfTC_TypeK(5.735e-3) expect 140.0 within 0.1 // TC_TypeK at 140C = 5.735mV'
whismanoid 59:c0376adb6ebc 493 // CODE GENERATOR: CommandDocTest '@test group TC_2 TemperatureOfTC_TypeK(6.138e-3) expect 150.0 within 0.1 // TC_TypeK at 150C = 6.138mV'
whismanoid 59:c0376adb6ebc 494 // CODE GENERATOR: CommandDocTest '@test group TC_2 TemperatureOfTC_TypeK(6.540e-3) expect 160.0 within 0.1 // TC_TypeK at 160C = 6.540mV'
whismanoid 59:c0376adb6ebc 495 // CODE GENERATOR: CommandDocTest '@test group TC_2 TemperatureOfTC_TypeK(6.941e-3) expect 170.0 within 0.1 // TC_TypeK at 170C = 6.941mV'
whismanoid 59:c0376adb6ebc 496 // CODE GENERATOR: CommandDocTest '@test group TC_2 TemperatureOfTC_TypeK(7.340e-3) expect 180.0 within 0.1 // TC_TypeK at 180C = 7.340mV'
whismanoid 59:c0376adb6ebc 497 // CODE GENERATOR: CommandDocTest '@test group TC_1 TemperatureOfTC_TypeK(7.739e-3) expect 190.0 within 0.1 // TC_TypeK at 190C = 7.739mV'
whismanoid 59:c0376adb6ebc 498 // CODE GENERATOR: CommandDocTest '@test group TC_1 TemperatureOfTC_TypeK(8.138e-3) expect 200.0 within 0.1 // TC_TypeK at 200C = 8.138mV'
whismanoid 59:c0376adb6ebc 499 // CODE GENERATOR: CommandDocTest '@test group TC_1 TemperatureOfTC_TypeK(8.539e-3) expect 210.0 within 0.1 // TC_TypeK at 210C = 8.539mV'
whismanoid 59:c0376adb6ebc 500 // CODE GENERATOR: CommandDocTest '@test group TC_1 TemperatureOfTC_TypeK(8.940e-3) expect 220.0 within 0.1 // TC_TypeK at 220C = 8.940mV'
whismanoid 59:c0376adb6ebc 501 // CODE GENERATOR: CommandDocTest '@test group TC_2 TemperatureOfTC_TypeK(9.343e-3) expect 230.0 within 0.1 // TC_TypeK at 230C = 9.343mV'
whismanoid 59:c0376adb6ebc 502 // CODE GENERATOR: CommandDocTest '@test group TC_2 TemperatureOfTC_TypeK(9.747e-3) expect 240.0 within 0.1 // TC_TypeK at 240C = 9.747mV'
whismanoid 59:c0376adb6ebc 503 // CODE GENERATOR: CommandDocTest '@test group TC_2 TemperatureOfTC_TypeK(10.153e-3) expect 250.0 within 0.1 // TC_TypeK at 250C = 10.153mV'
whismanoid 59:c0376adb6ebc 504 // CODE GENERATOR: CommandDocTest '@test group TC_2 TemperatureOfTC_TypeK(10.561e-3) expect 260.0 within 0.1 // TC_TypeK at 260C = 10.561mV'
whismanoid 59:c0376adb6ebc 505 // CODE GENERATOR: CommandDocTest '@test group TC_2 TemperatureOfTC_TypeK(10.971e-3) expect 270.0 within 0.1 // TC_TypeK at 270C = 10.971mV'
whismanoid 59:c0376adb6ebc 506 // CODE GENERATOR: CommandDocTest '@test group TC_2 TemperatureOfTC_TypeK(11.382e-3) expect 280.0 within 0.1 // TC_TypeK at 280C = 11.382mV'
whismanoid 59:c0376adb6ebc 507 // CODE GENERATOR: CommandDocTest '@test group TC_2 TemperatureOfTC_TypeK(11.795e-3) expect 290.0 within 0.1 // TC_TypeK at 290C = 11.795mV'
whismanoid 59:c0376adb6ebc 508 // CODE GENERATOR: CommandDocTest '@test group TC_1 TemperatureOfTC_TypeK(12.209e-3) expect 300.0 within 0.1 // TC_TypeK at 300C = 12.209mV'
whismanoid 59:c0376adb6ebc 509 // CODE GENERATOR: CommandDocTest '@test group TC_2 TemperatureOfTC_TypeK(14.293e-3) expect 350.0 within 0.1 // TC_TypeK at 350C = 14.293mV'
whismanoid 59:c0376adb6ebc 510 // CODE GENERATOR: CommandDocTest '@test group TC_1 TemperatureOfTC_TypeK(16.397e-3) expect 400.0 within 0.1 // TC_TypeK at 400C = 16.397mV'
whismanoid 59:c0376adb6ebc 511 // CODE GENERATOR: CommandDocTest '@test group TC_1 TemperatureOfTC_TypeK(18.516e-3) expect 450.0 within 0.1 // TC_TypeK at 450C = 18.516mV'
whismanoid 59:c0376adb6ebc 512 // CODE GENERATOR: CommandDocTest '@test group TC_1 TemperatureOfTC_TypeK(20.218e-3) expect 490.0 // TC_TypeK at 490C = 20.218mV'
whismanoid 59:c0376adb6ebc 513 // CODE GENERATOR: CommandDocTest '@test tinyTester.blink_time_msec = 75 // default 75 resume hardware self test'
whismanoid 47:3ce5810551c4 514 // CODE GENERATOR: MAX11410 Command Name = temperatureDegC_polynomial (double thermocouple_voltage_uV, int num_coefficients, double coefficients[]) --> double
whismanoid 47:3ce5810551c4 515 // CODE GENERATOR: no Menu item hint in description
whismanoid 35:8aa5dffe523d 516 // CODE GENERATOR: testMenuGlobalArgsDict scan global property list g_MAX11410_device
whismanoid 35:8aa5dffe523d 517
whismanoid 37:74aa97afa030 518 // CODE GENERATOR: testMenuGlobalArgsDict add global property g_MAX11410_device.VRef_REF0
whismanoid 37:74aa97afa030 519 // CODE GENERATOR: testMenuGlobalArgsDict add global property g_MAX11410_device.VRef_REF0 argname = VRef_REF0
whismanoid 37:74aa97afa030 520 // CODE GENERATOR: testMenuGlobalArgsDict['VRef_REF0']['alias'] = 'None'
whismanoid 37:74aa97afa030 521 // CODE GENERATOR: testMenuGlobalArgsDict['VRef_REF0']['argtype'] = 'double'
whismanoid 37:74aa97afa030 522 // CODE GENERATOR: testMenuGlobalArgsDict['VRef_REF0']['usedByCommandName'] = 'None'
whismanoid 37:74aa97afa030 523 // CODE GENERATOR: testMenuGlobalArgsDict['VRef_REF0']['usedBytestMenuItemName'] = 'None'
whismanoid 37:74aa97afa030 524
whismanoid 37:74aa97afa030 525 // CODE GENERATOR: testMenuGlobalArgsDict add global property g_MAX11410_device.VRef_REF1
whismanoid 37:74aa97afa030 526 // CODE GENERATOR: testMenuGlobalArgsDict add global property g_MAX11410_device.VRef_REF1 argname = VRef_REF1
whismanoid 37:74aa97afa030 527 // CODE GENERATOR: testMenuGlobalArgsDict['VRef_REF1']['alias'] = 'None'
whismanoid 37:74aa97afa030 528 // CODE GENERATOR: testMenuGlobalArgsDict['VRef_REF1']['argtype'] = 'double'
whismanoid 37:74aa97afa030 529 // CODE GENERATOR: testMenuGlobalArgsDict['VRef_REF1']['usedByCommandName'] = 'None'
whismanoid 37:74aa97afa030 530 // CODE GENERATOR: testMenuGlobalArgsDict['VRef_REF1']['usedBytestMenuItemName'] = 'None'
whismanoid 37:74aa97afa030 531
whismanoid 37:74aa97afa030 532 // CODE GENERATOR: testMenuGlobalArgsDict add global property g_MAX11410_device.VRef_REF2
whismanoid 37:74aa97afa030 533 // CODE GENERATOR: testMenuGlobalArgsDict add global property g_MAX11410_device.VRef_REF2 argname = VRef_REF2
whismanoid 37:74aa97afa030 534 // CODE GENERATOR: testMenuGlobalArgsDict['VRef_REF2']['alias'] = 'None'
whismanoid 37:74aa97afa030 535 // CODE GENERATOR: testMenuGlobalArgsDict['VRef_REF2']['argtype'] = 'double'
whismanoid 37:74aa97afa030 536 // CODE GENERATOR: testMenuGlobalArgsDict['VRef_REF2']['usedByCommandName'] = 'None'
whismanoid 37:74aa97afa030 537 // CODE GENERATOR: testMenuGlobalArgsDict['VRef_REF2']['usedBytestMenuItemName'] = 'None'
whismanoid 37:74aa97afa030 538
whismanoid 37:74aa97afa030 539 // CODE GENERATOR: testMenuGlobalArgsDict add global property g_MAX11410_device.VRef_AVDD
whismanoid 37:74aa97afa030 540 // CODE GENERATOR: testMenuGlobalArgsDict add global property g_MAX11410_device.VRef_AVDD argname = VRef_AVDD
whismanoid 37:74aa97afa030 541 // CODE GENERATOR: testMenuGlobalArgsDict['VRef_AVDD']['alias'] = 'None'
whismanoid 37:74aa97afa030 542 // CODE GENERATOR: testMenuGlobalArgsDict['VRef_AVDD']['argtype'] = 'double'
whismanoid 37:74aa97afa030 543 // CODE GENERATOR: testMenuGlobalArgsDict['VRef_AVDD']['usedByCommandName'] = 'None'
whismanoid 37:74aa97afa030 544 // CODE GENERATOR: testMenuGlobalArgsDict['VRef_AVDD']['usedBytestMenuItemName'] = 'None'
whismanoid 37:74aa97afa030 545
whismanoid 48:2591fcdece5e 546 // CODE GENERATOR: testMenuGlobalArgsDict add global property g_MAX11410_device.rtd_resistance
whismanoid 48:2591fcdece5e 547 // CODE GENERATOR: testMenuGlobalArgsDict add global property g_MAX11410_device.rtd_resistance argname = rtd_resistance
whismanoid 48:2591fcdece5e 548 // CODE GENERATOR: testMenuGlobalArgsDict['rtd_resistance']['alias'] = 'None'
whismanoid 48:2591fcdece5e 549 // CODE GENERATOR: testMenuGlobalArgsDict['rtd_resistance']['argtype'] = 'double'
whismanoid 48:2591fcdece5e 550 // CODE GENERATOR: testMenuGlobalArgsDict['rtd_resistance']['usedByCommandName'] = 'None'
whismanoid 48:2591fcdece5e 551 // CODE GENERATOR: testMenuGlobalArgsDict['rtd_resistance']['usedBytestMenuItemName'] = 'None'
whismanoid 48:2591fcdece5e 552
whismanoid 46:79dba7d4110c 553 // CODE GENERATOR: testMenuGlobalArgsDict add global property g_MAX11410_device.RTD_Temperature
whismanoid 46:79dba7d4110c 554 // CODE GENERATOR: testMenuGlobalArgsDict add global property g_MAX11410_device.RTD_Temperature argname = RTD_Temperature
whismanoid 46:79dba7d4110c 555 // CODE GENERATOR: testMenuGlobalArgsDict['RTD_Temperature']['alias'] = 'None'
whismanoid 46:79dba7d4110c 556 // CODE GENERATOR: testMenuGlobalArgsDict['RTD_Temperature']['argtype'] = 'double'
whismanoid 46:79dba7d4110c 557 // CODE GENERATOR: testMenuGlobalArgsDict['RTD_Temperature']['usedByCommandName'] = 'None'
whismanoid 46:79dba7d4110c 558 // CODE GENERATOR: testMenuGlobalArgsDict['RTD_Temperature']['usedBytestMenuItemName'] = 'None'
whismanoid 46:79dba7d4110c 559
whismanoid 37:74aa97afa030 560 // CODE GENERATOR: testMenuGlobalArgsDict add global property g_MAX11410_device.ctrl
whismanoid 37:74aa97afa030 561 // CODE GENERATOR: testMenuGlobalArgsDict add global property g_MAX11410_device.ctrl shadow of argname = ctrl
whismanoid 37:74aa97afa030 562 // CODE GENERATOR: testMenuGlobalArgsDict add global property g_MAX11410_device.ctrl argname = ctrl
whismanoid 37:74aa97afa030 563 // CODE GENERATOR: testMenuGlobalArgsDict['ctrl']['alias'] = 'None'
whismanoid 37:74aa97afa030 564 // CODE GENERATOR: testMenuGlobalArgsDict['ctrl']['argtype'] = 'uint32_t'
whismanoid 37:74aa97afa030 565 // CODE GENERATOR: testMenuGlobalArgsDict['ctrl']['usedByCommandName'] = 'None'
whismanoid 37:74aa97afa030 566 // CODE GENERATOR: testMenuGlobalArgsDict['ctrl']['usedBytestMenuItemName'] = 'None'
whismanoid 37:74aa97afa030 567
whismanoid 37:74aa97afa030 568 // CODE GENERATOR: testMenuGlobalArgsDict add global property g_MAX11410_device.pgaGain
whismanoid 37:74aa97afa030 569 // CODE GENERATOR: testMenuGlobalArgsDict add global property g_MAX11410_device.pgaGain argname = pgaGain
whismanoid 37:74aa97afa030 570 // CODE GENERATOR: testMenuGlobalArgsDict['pgaGain']['alias'] = 'None'
whismanoid 37:74aa97afa030 571 // CODE GENERATOR: testMenuGlobalArgsDict['pgaGain']['argtype'] = 'uint8_t'
whismanoid 37:74aa97afa030 572 // CODE GENERATOR: testMenuGlobalArgsDict['pgaGain']['usedByCommandName'] = 'None'
whismanoid 37:74aa97afa030 573 // CODE GENERATOR: testMenuGlobalArgsDict['pgaGain']['usedBytestMenuItemName'] = 'None'
whismanoid 35:8aa5dffe523d 574
whismanoid 35:8aa5dffe523d 575 // CODE GENERATOR: testMenuGlobalArgsDict add global property g_MAX11410_device.status
whismanoid 35:8aa5dffe523d 576 // CODE GENERATOR: testMenuGlobalArgsDict add global property g_MAX11410_device.status shadow of argname = status
whismanoid 35:8aa5dffe523d 577 // CODE GENERATOR: testMenuGlobalArgsDict add global property g_MAX11410_device.status argname = status
whismanoid 35:8aa5dffe523d 578 // CODE GENERATOR: testMenuGlobalArgsDict['status']['alias'] = 'None'
whismanoid 35:8aa5dffe523d 579 // CODE GENERATOR: testMenuGlobalArgsDict['status']['argtype'] = 'uint32_t'
whismanoid 35:8aa5dffe523d 580 // CODE GENERATOR: testMenuGlobalArgsDict['status']['usedByCommandName'] = 'None'
whismanoid 35:8aa5dffe523d 581 // CODE GENERATOR: testMenuGlobalArgsDict['status']['usedBytestMenuItemName'] = 'None'
whismanoid 35:8aa5dffe523d 582
whismanoid 35:8aa5dffe523d 583 // CODE GENERATOR: testMenuGlobalArgsDict add global property g_MAX11410_device.data0
whismanoid 35:8aa5dffe523d 584 // CODE GENERATOR: testMenuGlobalArgsDict add global property g_MAX11410_device.data0 shadow of argname = data0
whismanoid 35:8aa5dffe523d 585 // CODE GENERATOR: testMenuGlobalArgsDict add global property g_MAX11410_device.data0 argname = data0
whismanoid 35:8aa5dffe523d 586 // CODE GENERATOR: testMenuGlobalArgsDict['data0']['alias'] = 'None'
whismanoid 35:8aa5dffe523d 587 // CODE GENERATOR: testMenuGlobalArgsDict['data0']['argtype'] = 'uint32_t'
whismanoid 35:8aa5dffe523d 588 // CODE GENERATOR: testMenuGlobalArgsDict['data0']['usedByCommandName'] = 'None'
whismanoid 35:8aa5dffe523d 589 // CODE GENERATOR: testMenuGlobalArgsDict['data0']['usedBytestMenuItemName'] = 'None'
whismanoid 35:8aa5dffe523d 590
whismanoid 51:15d9a9e0b623 591 // CODE GENERATOR: testMenuGlobalArgsDict skip array property g_MAX11410_device.AINcode[11]
whismanoid 35:8aa5dffe523d 592
whismanoid 35:8aa5dffe523d 593 // CODE GENERATOR: scan testMenuCommand list for items that can be shortened to single character
whismanoid 46:79dba7d4110c 594 // CODE GENERATOR: multiple commands begin with character 'T'
whismanoid 37:74aa97afa030 595 // CODE GENERATOR: multiple commands begin with character 'X'
whismanoid 37:74aa97afa030 596 // CODE GENERATOR: multiple commands begin with character 'X'
whismanoid 37:74aa97afa030 597 // CODE GENERATOR: multiple commands begin with character 'X'
whismanoid 37:74aa97afa030 598 // CODE GENERATOR: multiple commands begin with character 'X'
whismanoid 37:74aa97afa030 599 // CODE GENERATOR: multiple commands begin with character 'X'
whismanoid 37:74aa97afa030 600 // CODE GENERATOR: multiple commands begin with character 'X'
whismanoid 37:74aa97afa030 601 // CODE GENERATOR: multiple commands begin with character 'X'
whismanoid 37:74aa97afa030 602 // CODE GENERATOR: multiple commands begin with character 'X'
whismanoid 37:74aa97afa030 603 // CODE GENERATOR: multiple commands begin with character 'X'
whismanoid 37:74aa97afa030 604 // CODE GENERATOR: multiple commands begin with character 'X'
whismanoid 37:74aa97afa030 605 // CODE GENERATOR: multiple commands begin with character 'X'
whismanoid 37:74aa97afa030 606 // CODE GENERATOR: multiple commands begin with character 'X'
whismanoid 55:73d886c105f5 607 // CODE GENERATOR: multiple commands begin with character 'X'
whismanoid 35:8aa5dffe523d 608 // CODE GENERATOR: shorten testMenuCommand to single character if unambiguous
whismanoid 35:8aa5dffe523d 609 // CODE GENERATOR: testMenuCommand '!' already single character
whismanoid 37:74aa97afa030 610 // CODE GENERATOR: testMenuCommand '$' already single character
whismanoid 48:2591fcdece5e 611 // CODE GENERATOR: testMenuCommand 'R' already single character
whismanoid 46:79dba7d4110c 612 // CODE GENERATOR: cannot shorten testMenuCommand 'TK' to single character due to duplicates
whismanoid 46:79dba7d4110c 613 // CODE GENERATOR: cannot shorten testMenuCommand 'TM' to single character due to duplicates
whismanoid 37:74aa97afa030 614 // CODE GENERATOR: testMenuCommand 'V' already single character
whismanoid 37:74aa97afa030 615 // CODE GENERATOR: cannot shorten testMenuCommand 'X0' to single character due to duplicates
whismanoid 37:74aa97afa030 616 // CODE GENERATOR: cannot shorten testMenuCommand 'X1' to single character due to duplicates
whismanoid 37:74aa97afa030 617 // CODE GENERATOR: cannot shorten testMenuCommand 'X4' to single character due to duplicates
whismanoid 37:74aa97afa030 618 // CODE GENERATOR: cannot shorten testMenuCommand 'X5' to single character due to duplicates
whismanoid 37:74aa97afa030 619 // CODE GENERATOR: cannot shorten testMenuCommand 'X6' to single character due to duplicates
whismanoid 37:74aa97afa030 620 // CODE GENERATOR: cannot shorten testMenuCommand 'X7' to single character due to duplicates
whismanoid 37:74aa97afa030 621 // CODE GENERATOR: cannot shorten testMenuCommand 'XC' to single character due to duplicates
whismanoid 37:74aa97afa030 622 // CODE GENERATOR: cannot shorten testMenuCommand 'XF' to single character due to duplicates
whismanoid 37:74aa97afa030 623 // CODE GENERATOR: cannot shorten testMenuCommand 'XI' to single character due to duplicates
whismanoid 37:74aa97afa030 624 // CODE GENERATOR: cannot shorten testMenuCommand 'XM' to single character due to duplicates
whismanoid 37:74aa97afa030 625 // CODE GENERATOR: cannot shorten testMenuCommand 'XP' to single character due to duplicates
whismanoid 55:73d886c105f5 626 // CODE GENERATOR: cannot shorten testMenuCommand 'XR' to single character due to duplicates
whismanoid 37:74aa97afa030 627 // CODE GENERATOR: cannot shorten testMenuCommand 'XS' to single character due to duplicates
whismanoid 37:74aa97afa030 628 // CODE GENERATOR: cannot shorten testMenuCommand 'XV' to single character due to duplicates
whismanoid 35:8aa5dffe523d 629
whismanoid 35:8aa5dffe523d 630 // CODE GENERATOR: help menu
whismanoid 55:73d886c105f5 631 void MAX11410_menu_help(CmdLine & cmdLine)
whismanoid 35:8aa5dffe523d 632 {
whismanoid 35:8aa5dffe523d 633 // CODE GENERATOR: command: !
whismanoid 35:8aa5dffe523d 634 // CODE GENERATOR: help: ! -- Init
whismanoid 35:8aa5dffe523d 635 cmdLine.serial().printf("\r\n ! -- Init");
whismanoid 37:74aa97afa030 636 // CODE GENERATOR: command: $
whismanoid 37:74aa97afa030 637 // CODE GENERATOR: help: $ -- Read_All_Voltages
whismanoid 37:74aa97afa030 638 cmdLine.serial().printf("\r\n $ -- Read_All_Voltages");
whismanoid 48:2591fcdece5e 639 // CODE GENERATOR: command: R
whismanoid 48:2591fcdece5e 640 // CODE GENERATOR: help: R -- Measure_RTD
whismanoid 48:2591fcdece5e 641 cmdLine.serial().printf("\r\n R -- Measure_RTD");
whismanoid 46:79dba7d4110c 642 // CODE GENERATOR: command: TK
whismanoid 46:79dba7d4110c 643 // CODE GENERATOR: help: TK tc_voltage=? -- TemperatureOfTC_TypeK
whismanoid 46:79dba7d4110c 644 cmdLine.serial().printf("\r\n TK tc_voltage=? -- TemperatureOfTC_TypeK");
whismanoid 46:79dba7d4110c 645 // CODE GENERATOR: command: TM
whismanoid 46:79dba7d4110c 646 // CODE GENERATOR: help: TM -- Measure_Thermocouple
whismanoid 46:79dba7d4110c 647 cmdLine.serial().printf("\r\n TM -- Measure_Thermocouple");
whismanoid 37:74aa97afa030 648 // CODE GENERATOR: command: V
whismanoid 37:74aa97afa030 649 // CODE GENERATOR: help: V -- Measure_Voltage
whismanoid 37:74aa97afa030 650 cmdLine.serial().printf("\r\n V -- Measure_Voltage");
whismanoid 37:74aa97afa030 651 // CODE GENERATOR: command: X0
whismanoid 37:74aa97afa030 652 // CODE GENERATOR: help: X0 -- Calibrate_Self_Offset_Gain
whismanoid 37:74aa97afa030 653 cmdLine.serial().printf("\r\n X0 -- Calibrate_Self_Offset_Gain");
whismanoid 37:74aa97afa030 654 // CODE GENERATOR: command: X1
whismanoid 37:74aa97afa030 655 // CODE GENERATOR: help: X1 -- Calibrate_PGA_Gain
whismanoid 37:74aa97afa030 656 cmdLine.serial().printf("\r\n X1 -- Calibrate_PGA_Gain");
whismanoid 37:74aa97afa030 657 // CODE GENERATOR: command: X4
whismanoid 37:74aa97afa030 658 // CODE GENERATOR: help: X4 -- Calibrate_System_Offset_A
whismanoid 37:74aa97afa030 659 cmdLine.serial().printf("\r\n X4 -- Calibrate_System_Offset_A");
whismanoid 37:74aa97afa030 660 // CODE GENERATOR: command: X5
whismanoid 37:74aa97afa030 661 // CODE GENERATOR: help: X5 -- Calibrate_System_Gain_A
whismanoid 37:74aa97afa030 662 cmdLine.serial().printf("\r\n X5 -- Calibrate_System_Gain_A");
whismanoid 37:74aa97afa030 663 // CODE GENERATOR: command: X6
whismanoid 37:74aa97afa030 664 // CODE GENERATOR: help: X6 -- Calibrate_System_Offset_B
whismanoid 37:74aa97afa030 665 cmdLine.serial().printf("\r\n X6 -- Calibrate_System_Offset_B");
whismanoid 37:74aa97afa030 666 // CODE GENERATOR: command: X7
whismanoid 37:74aa97afa030 667 // CODE GENERATOR: help: X7 -- Calibrate_System_Gain_B
whismanoid 37:74aa97afa030 668 cmdLine.serial().printf("\r\n X7 -- Calibrate_System_Gain_B");
whismanoid 37:74aa97afa030 669 // CODE GENERATOR: command: XC
whismanoid 37:74aa97afa030 670 // CODE GENERATOR: help: XC extclk=? u_bn=? format=? refbufp_en=? refbufn_en=? ref_sel=? -- Configure_CTRL
whismanoid 37:74aa97afa030 671 cmdLine.serial().printf("\r\n XC extclk=? u_bn=? format=? refbufp_en=? refbufn_en=? ref_sel=? -- Configure_CTRL");
whismanoid 37:74aa97afa030 672 // CODE GENERATOR: command: XF
whismanoid 37:74aa97afa030 673 // CODE GENERATOR: help: XF linef=? rate=? -- Configure_FILTER
whismanoid 37:74aa97afa030 674 cmdLine.serial().printf("\r\n XF linef=? rate=? -- Configure_FILTER");
whismanoid 37:74aa97afa030 675 // CODE GENERATOR: command: XI
whismanoid 37:74aa97afa030 676 // CODE GENERATOR: help: XI idac1_sel=? idac0_sel=? -- Configure_MUX_CTRL1
whismanoid 37:74aa97afa030 677 cmdLine.serial().printf("\r\n XI idac1_sel=? idac0_sel=? -- Configure_MUX_CTRL1");
whismanoid 37:74aa97afa030 678 // CODE GENERATOR: command: XM
whismanoid 37:74aa97afa030 679 // CODE GENERATOR: help: XM ainp=? ainn=? -- Configure_MUX_CTRL0
whismanoid 37:74aa97afa030 680 cmdLine.serial().printf("\r\n XM ainp=? ainn=? -- Configure_MUX_CTRL0");
whismanoid 37:74aa97afa030 681 // CODE GENERATOR: command: XP
whismanoid 37:74aa97afa030 682 // CODE GENERATOR: help: XP sigpath=? gain=? -- Configure_PGA
whismanoid 37:74aa97afa030 683 cmdLine.serial().printf("\r\n XP sigpath=? gain=? -- Configure_PGA");
whismanoid 55:73d886c105f5 684 // CODE GENERATOR: command: XR
whismanoid 55:73d886c105f5 685 // CODE GENERATOR: help: XR ref_sel=? -- Configure_CTRL_REF
whismanoid 55:73d886c105f5 686 cmdLine.serial().printf("\r\n XR ref_sel=? -- Configure_CTRL_REF");
whismanoid 37:74aa97afa030 687 // CODE GENERATOR: command: XS
whismanoid 37:74aa97afa030 688 // CODE GENERATOR: help: XS vbias_mode=? brn_mode=? idac_mode=? -- Configure_SOURCE
whismanoid 37:74aa97afa030 689 cmdLine.serial().printf("\r\n XS vbias_mode=? brn_mode=? idac_mode=? -- Configure_SOURCE");
whismanoid 37:74aa97afa030 690 // CODE GENERATOR: command: XV
whismanoid 37:74aa97afa030 691 // CODE GENERATOR: help: XV vbias_ain7_ain0_bitmap=? -- Configure_MUX_CTRL2
whismanoid 37:74aa97afa030 692 cmdLine.serial().printf("\r\n XV vbias_ain7_ain0_bitmap=? -- Configure_MUX_CTRL2");
whismanoid 35:8aa5dffe523d 693 //
whismanoid 35:8aa5dffe523d 694 cmdLine.serial().printf("\r\n @ -- print MAX11410 configuration");
whismanoid 47:3ce5810551c4 695
whismanoid 37:74aa97afa030 696 // CODE GENERATOR: help menu if has_register_write_command: *regname? -- read register; *regname=regvalue -- write register
whismanoid 37:74aa97afa030 697 cmdLine.serial().printf("\r\n *regname? -- read register\r\n *regname=regvalue -- write register");
whismanoid 47:3ce5810551c4 698
whismanoid 47:3ce5810551c4 699 //
whismanoid 47:3ce5810551c4 700 // CODE GENERATOR: TODO1: generate GPIO commands for LDAC, CLR, etc. based on device driver function names (menu_help)
whismanoid 47:3ce5810551c4 701 // case 'G'..'Z','g'..'z' are reserved for GPIO commands
whismanoid 47:3ce5810551c4 702 // case 'A'..'F','a'..'f' may be available if not claimed by bitstream commands
whismanoid 52:d3fb6f1722bf 703 // CODE GENERATOR: TODO1: prevent conflict ExternFunctionGPIOPinCommand with reserved case 'A'..'F','a'..'f'
whismanoid 47:3ce5810551c4 704
whismanoid 35:8aa5dffe523d 705 //
whismanoid 35:8aa5dffe523d 706 }
whismanoid 19:8f951e448ab1 707
whismanoid 19:8f951e448ab1 708 bool MAX11410_menu_onEOLcommandParser(CmdLine & cmdLine)
whismanoid 19:8f951e448ab1 709 {
whismanoid 35:8aa5dffe523d 710
whismanoid 35:8aa5dffe523d 711 // CODE GENERATOR: testMenuGlobalArgsDict Consolidate common/global argument parsing
whismanoid 35:8aa5dffe523d 712
whismanoid 46:79dba7d4110c 713 // CODE GENERATOR: testMenuGlobalArgsDict['RTD_Temperature']['alias'] = 'None'
whismanoid 46:79dba7d4110c 714 // CODE GENERATOR: testMenuGlobalArgsDict['RTD_Temperature']['argtype'] = 'double'
whismanoid 46:79dba7d4110c 715 // CODE GENERATOR: testMenuGlobalArgsDict['RTD_Temperature']['usedByCommandName'] = 'None'
whismanoid 46:79dba7d4110c 716 // CODE GENERATOR: testMenuGlobalArgsDict['RTD_Temperature']['usedBytestMenuItemName'] = 'None'
whismanoid 46:79dba7d4110c 717 // parse argument double RTD_Temperature
whismanoid 46:79dba7d4110c 718 double RTD_Temperature = g_MAX11410_device.RTD_Temperature; // default to global property value
whismanoid 46:79dba7d4110c 719 if (cmdLine.parse_double("RTD_Temperature", RTD_Temperature))
whismanoid 46:79dba7d4110c 720 {
whismanoid 46:79dba7d4110c 721 g_MAX11410_device.RTD_Temperature = RTD_Temperature; // update global property value
whismanoid 46:79dba7d4110c 722 }
whismanoid 46:79dba7d4110c 723
whismanoid 37:74aa97afa030 724 // CODE GENERATOR: testMenuGlobalArgsDict['VRef_AVDD']['alias'] = 'None'
whismanoid 37:74aa97afa030 725 // CODE GENERATOR: testMenuGlobalArgsDict['VRef_AVDD']['argtype'] = 'double'
whismanoid 37:74aa97afa030 726 // CODE GENERATOR: testMenuGlobalArgsDict['VRef_AVDD']['usedByCommandName'] = 'None'
whismanoid 37:74aa97afa030 727 // CODE GENERATOR: testMenuGlobalArgsDict['VRef_AVDD']['usedBytestMenuItemName'] = 'None'
whismanoid 37:74aa97afa030 728 // parse argument double VRef_AVDD
whismanoid 37:74aa97afa030 729 double VRef_AVDD = g_MAX11410_device.VRef_AVDD; // default to global property value
whismanoid 37:74aa97afa030 730 if (cmdLine.parse_double("VRef_AVDD", VRef_AVDD))
whismanoid 37:74aa97afa030 731 {
whismanoid 37:74aa97afa030 732 g_MAX11410_device.VRef_AVDD = VRef_AVDD; // update global property value
whismanoid 37:74aa97afa030 733 }
whismanoid 37:74aa97afa030 734
whismanoid 37:74aa97afa030 735 // CODE GENERATOR: testMenuGlobalArgsDict['VRef_REF0']['alias'] = 'None'
whismanoid 37:74aa97afa030 736 // CODE GENERATOR: testMenuGlobalArgsDict['VRef_REF0']['argtype'] = 'double'
whismanoid 37:74aa97afa030 737 // CODE GENERATOR: testMenuGlobalArgsDict['VRef_REF0']['usedByCommandName'] = 'None'
whismanoid 37:74aa97afa030 738 // CODE GENERATOR: testMenuGlobalArgsDict['VRef_REF0']['usedBytestMenuItemName'] = 'None'
whismanoid 37:74aa97afa030 739 // parse argument double VRef_REF0
whismanoid 37:74aa97afa030 740 double VRef_REF0 = g_MAX11410_device.VRef_REF0; // default to global property value
whismanoid 37:74aa97afa030 741 if (cmdLine.parse_double("VRef_REF0", VRef_REF0))
whismanoid 28:d2ee1c57ff81 742 {
whismanoid 37:74aa97afa030 743 g_MAX11410_device.VRef_REF0 = VRef_REF0; // update global property value
whismanoid 37:74aa97afa030 744 }
whismanoid 37:74aa97afa030 745
whismanoid 37:74aa97afa030 746 // CODE GENERATOR: testMenuGlobalArgsDict['VRef_REF1']['alias'] = 'None'
whismanoid 37:74aa97afa030 747 // CODE GENERATOR: testMenuGlobalArgsDict['VRef_REF1']['argtype'] = 'double'
whismanoid 37:74aa97afa030 748 // CODE GENERATOR: testMenuGlobalArgsDict['VRef_REF1']['usedByCommandName'] = 'None'
whismanoid 37:74aa97afa030 749 // CODE GENERATOR: testMenuGlobalArgsDict['VRef_REF1']['usedBytestMenuItemName'] = 'None'
whismanoid 37:74aa97afa030 750 // parse argument double VRef_REF1
whismanoid 37:74aa97afa030 751 double VRef_REF1 = g_MAX11410_device.VRef_REF1; // default to global property value
whismanoid 37:74aa97afa030 752 if (cmdLine.parse_double("VRef_REF1", VRef_REF1))
whismanoid 37:74aa97afa030 753 {
whismanoid 37:74aa97afa030 754 g_MAX11410_device.VRef_REF1 = VRef_REF1; // update global property value
whismanoid 37:74aa97afa030 755 }
whismanoid 37:74aa97afa030 756
whismanoid 37:74aa97afa030 757 // CODE GENERATOR: testMenuGlobalArgsDict['VRef_REF2']['alias'] = 'None'
whismanoid 37:74aa97afa030 758 // CODE GENERATOR: testMenuGlobalArgsDict['VRef_REF2']['argtype'] = 'double'
whismanoid 37:74aa97afa030 759 // CODE GENERATOR: testMenuGlobalArgsDict['VRef_REF2']['usedByCommandName'] = 'None'
whismanoid 37:74aa97afa030 760 // CODE GENERATOR: testMenuGlobalArgsDict['VRef_REF2']['usedBytestMenuItemName'] = 'None'
whismanoid 37:74aa97afa030 761 // parse argument double VRef_REF2
whismanoid 37:74aa97afa030 762 double VRef_REF2 = g_MAX11410_device.VRef_REF2; // default to global property value
whismanoid 37:74aa97afa030 763 if (cmdLine.parse_double("VRef_REF2", VRef_REF2))
whismanoid 37:74aa97afa030 764 {
whismanoid 37:74aa97afa030 765 g_MAX11410_device.VRef_REF2 = VRef_REF2; // update global property value
whismanoid 37:74aa97afa030 766 }
whismanoid 37:74aa97afa030 767
whismanoid 37:74aa97afa030 768 // CODE GENERATOR: testMenuGlobalArgsDict['ctrl']['alias'] = 'None'
whismanoid 37:74aa97afa030 769 // CODE GENERATOR: testMenuGlobalArgsDict['ctrl']['argtype'] = 'uint32_t'
whismanoid 37:74aa97afa030 770 // CODE GENERATOR: testMenuGlobalArgsDict['ctrl']['usedByCommandName'] = 'None'
whismanoid 37:74aa97afa030 771 // CODE GENERATOR: testMenuGlobalArgsDict['ctrl']['usedBytestMenuItemName'] = 'None'
whismanoid 37:74aa97afa030 772 // parse argument uint32_t ctrl
whismanoid 37:74aa97afa030 773 uint32_t ctrl = g_MAX11410_device.ctrl; // default to global property value
whismanoid 37:74aa97afa030 774 if (cmdLine.parse_uint32_dec("ctrl", ctrl))
whismanoid 37:74aa97afa030 775 {
whismanoid 37:74aa97afa030 776 g_MAX11410_device.ctrl = ctrl; // update global property value
whismanoid 28:d2ee1c57ff81 777 }
whismanoid 35:8aa5dffe523d 778
whismanoid 35:8aa5dffe523d 779 // CODE GENERATOR: testMenuGlobalArgsDict['data0']['alias'] = 'None'
whismanoid 35:8aa5dffe523d 780 // CODE GENERATOR: testMenuGlobalArgsDict['data0']['argtype'] = 'uint32_t'
whismanoid 35:8aa5dffe523d 781 // CODE GENERATOR: testMenuGlobalArgsDict['data0']['usedByCommandName'] = 'None'
whismanoid 35:8aa5dffe523d 782 // CODE GENERATOR: testMenuGlobalArgsDict['data0']['usedBytestMenuItemName'] = 'None'
whismanoid 35:8aa5dffe523d 783 // parse argument uint32_t data0
whismanoid 35:8aa5dffe523d 784 uint32_t data0 = g_MAX11410_device.data0; // default to global property value
whismanoid 35:8aa5dffe523d 785 if (cmdLine.parse_uint32_dec("data0", data0))
whismanoid 28:d2ee1c57ff81 786 {
whismanoid 35:8aa5dffe523d 787 g_MAX11410_device.data0 = data0; // update global property value
whismanoid 28:d2ee1c57ff81 788 }
whismanoid 35:8aa5dffe523d 789
whismanoid 37:74aa97afa030 790 // CODE GENERATOR: testMenuGlobalArgsDict['pgaGain']['alias'] = 'None'
whismanoid 37:74aa97afa030 791 // CODE GENERATOR: testMenuGlobalArgsDict['pgaGain']['argtype'] = 'uint8_t'
whismanoid 37:74aa97afa030 792 // CODE GENERATOR: testMenuGlobalArgsDict['pgaGain']['usedByCommandName'] = 'None'
whismanoid 37:74aa97afa030 793 // CODE GENERATOR: testMenuGlobalArgsDict['pgaGain']['usedBytestMenuItemName'] = 'None'
whismanoid 37:74aa97afa030 794 // parse argument uint8_t pgaGain
whismanoid 37:74aa97afa030 795 uint8_t pgaGain = g_MAX11410_device.pgaGain; // default to global property value
whismanoid 37:74aa97afa030 796 if (cmdLine.parse_uint8_dec("pgaGain", pgaGain))
whismanoid 37:74aa97afa030 797 {
whismanoid 37:74aa97afa030 798 g_MAX11410_device.pgaGain = pgaGain; // update global property value
whismanoid 37:74aa97afa030 799 }
whismanoid 37:74aa97afa030 800
whismanoid 48:2591fcdece5e 801 // CODE GENERATOR: testMenuGlobalArgsDict['rtd_resistance']['alias'] = 'None'
whismanoid 48:2591fcdece5e 802 // CODE GENERATOR: testMenuGlobalArgsDict['rtd_resistance']['argtype'] = 'double'
whismanoid 48:2591fcdece5e 803 // CODE GENERATOR: testMenuGlobalArgsDict['rtd_resistance']['usedByCommandName'] = 'None'
whismanoid 48:2591fcdece5e 804 // CODE GENERATOR: testMenuGlobalArgsDict['rtd_resistance']['usedBytestMenuItemName'] = 'None'
whismanoid 48:2591fcdece5e 805 // parse argument double rtd_resistance
whismanoid 48:2591fcdece5e 806 double rtd_resistance = g_MAX11410_device.rtd_resistance; // default to global property value
whismanoid 48:2591fcdece5e 807 if (cmdLine.parse_double("rtd_resistance", rtd_resistance))
whismanoid 48:2591fcdece5e 808 {
whismanoid 48:2591fcdece5e 809 g_MAX11410_device.rtd_resistance = rtd_resistance; // update global property value
whismanoid 48:2591fcdece5e 810 }
whismanoid 48:2591fcdece5e 811
whismanoid 35:8aa5dffe523d 812 // CODE GENERATOR: testMenuGlobalArgsDict['status']['alias'] = 'None'
whismanoid 35:8aa5dffe523d 813 // CODE GENERATOR: testMenuGlobalArgsDict['status']['argtype'] = 'uint32_t'
whismanoid 35:8aa5dffe523d 814 // CODE GENERATOR: testMenuGlobalArgsDict['status']['usedByCommandName'] = 'None'
whismanoid 35:8aa5dffe523d 815 // CODE GENERATOR: testMenuGlobalArgsDict['status']['usedBytestMenuItemName'] = 'None'
whismanoid 35:8aa5dffe523d 816 // parse argument uint32_t status
whismanoid 35:8aa5dffe523d 817 uint32_t status = g_MAX11410_device.status; // default to global property value
whismanoid 35:8aa5dffe523d 818 if (cmdLine.parse_uint32_dec("status", status))
whismanoid 19:8f951e448ab1 819 {
whismanoid 35:8aa5dffe523d 820 g_MAX11410_device.status = status; // update global property value
whismanoid 19:8f951e448ab1 821 }
whismanoid 35:8aa5dffe523d 822
whismanoid 35:8aa5dffe523d 823 switch (cmdLine[0])
whismanoid 35:8aa5dffe523d 824 {
whismanoid 37:74aa97afa030 825 // CODE GENERATOR: generate * command read/write reg *reg? *reg=value
whismanoid 37:74aa97afa030 826 case '*':
whismanoid 37:74aa97afa030 827 {
whismanoid 37:74aa97afa030 828 // if buffer starts with a regName:
whismanoid 37:74aa97afa030 829 // for each reg value (0..n) if(cmdLine.has_keyword(device.regName(r))):
whismanoid 52:d3fb6f1722bf 830 cmdLine.serial().printf(" scan RegName...\r\n");
whismanoid 37:74aa97afa030 831 for (uint8_t regAddress = 0; regAddress < 0x80; regAddress++)
whismanoid 37:74aa97afa030 832 {
whismanoid 37:74aa97afa030 833 uint32_t regData = 0;
whismanoid 37:74aa97afa030 834 bool is_regname_query = false;
whismanoid 37:74aa97afa030 835 bool is_regname_assignment = false;
whismanoid 37:74aa97afa030 836 if (cmdLine.parse_uint32_dec(g_MAX11410_device.RegName((MAX11410::MAX11410_CMD_enum_t)regAddress), regData))
whismanoid 37:74aa97afa030 837 {
whismanoid 37:74aa97afa030 838 cmdLine.serial().printf(" regAddress=0x%2.2X\r\n", (regAddress & 0xFF));
whismanoid 37:74aa97afa030 839 cmdLine.serial().printf(" RegName=%s\r\n", g_MAX11410_device.RegName((MAX11410::MAX11410_CMD_enum_t)regAddress));
whismanoid 41:6f7c8adf9baf 840 // accept regName "?" as "RegRead" by name
whismanoid 37:74aa97afa030 841 is_regname_query = (cmdLine.chSeparator == '?');
whismanoid 37:74aa97afa030 842 is_regname_assignment = (cmdLine.chSeparator == '=');
whismanoid 37:74aa97afa030 843 if (is_regname_query)
whismanoid 37:74aa97afa030 844 {
whismanoid 37:74aa97afa030 845 cmdLine.serial().printf(" RegRead");
whismanoid 37:74aa97afa030 846 g_MAX11410_device.RegRead((MAX11410::MAX11410_CMD_enum_t)regAddress, &regData);
whismanoid 56:6e9c52cc9abe 847 cmdLine.serial().printf("regData=0x%6.6lx\r\n", (regData & 0x00FFFFFF));
whismanoid 42:236e108d8a88 848 return true; // command handled by MAX11410
whismanoid 37:74aa97afa030 849 }
whismanoid 41:6f7c8adf9baf 850 // accept regName "=0x123456" as "RegWrite" by name
whismanoid 37:74aa97afa030 851 if (is_regname_assignment)
whismanoid 37:74aa97afa030 852 {
whismanoid 37:74aa97afa030 853 cmdLine.serial().printf(" RegWrite");
whismanoid 56:6e9c52cc9abe 854 cmdLine.serial().printf("regData=0x%6.6lx\r\n", (regData & 0x00FFFFFF));
whismanoid 37:74aa97afa030 855 g_MAX11410_device.RegWrite((MAX11410::MAX11410_CMD_enum_t)regAddress, regData);
whismanoid 37:74aa97afa030 856 return true; // command handled by MAX11410
whismanoid 37:74aa97afa030 857 }
whismanoid 37:74aa97afa030 858 }
whismanoid 37:74aa97afa030 859 } // end for regAddr
whismanoid 37:74aa97afa030 860 // not a valid register name
whismanoid 52:d3fb6f1722bf 861 Callback<void(size_t, uint8_t*, uint8_t*)> saved_onSPIprint_handler = g_MAX11410_device.onSPIprint;
whismanoid 52:d3fb6f1722bf 862 g_MAX11410_device.onSPIprint = NULL; // temporarily suppress SPI diagnostic messages
whismanoid 37:74aa97afa030 863 // read "all" registers by name
whismanoid 52:d3fb6f1722bf 864 // TODO: KLUDGE: this constant array should live in the device driver, not the menu
whismanoid 52:d3fb6f1722bf 865 const MAX11410::MAX11410_CMD_enum_t readAllStatusList[] = {
whismanoid 52:d3fb6f1722bf 866 MAX11410::CMD_r000_0000_xxxx_xxdd_PD,
whismanoid 52:d3fb6f1722bf 867 MAX11410::CMD_r000_0001_xddd_xxdd_CONV_START,
whismanoid 52:d3fb6f1722bf 868 MAX11410::CMD_r000_0010_xddd_dddd_SEQ_START,
whismanoid 52:d3fb6f1722bf 869 MAX11410::CMD_r000_0011_xxxx_xddd_CAL_START,
whismanoid 52:d3fb6f1722bf 870 MAX11410::CMD_r000_0100_dddd_xddd_GP0_CTRL,
whismanoid 52:d3fb6f1722bf 871 MAX11410::CMD_r000_0101_dddd_xddd_GP1_CTRL,
whismanoid 52:d3fb6f1722bf 872 MAX11410::CMD_r000_0110_xddd_xxdd_GP_CONV,
whismanoid 52:d3fb6f1722bf 873 MAX11410::CMD_r000_0111_xddd_dddd_GP_SEQ_ADDR,
whismanoid 52:d3fb6f1722bf 874 MAX11410::CMD_r000_1000_x0dd_dddd_FILTER,
whismanoid 52:d3fb6f1722bf 875 MAX11410::CMD_r000_1001_dddd_dddd_CTRL,
whismanoid 52:d3fb6f1722bf 876 MAX11410::CMD_r000_1010_dddd_dddd_SOURCE,
whismanoid 52:d3fb6f1722bf 877 MAX11410::CMD_r000_1011_dddd_dddd_MUX_CTRL0,
whismanoid 52:d3fb6f1722bf 878 MAX11410::CMD_r000_1100_dddd_dddd_MUX_CTRL1,
whismanoid 52:d3fb6f1722bf 879 MAX11410::CMD_r000_1101_dddd_dddd_MUX_CTRL2,
whismanoid 52:d3fb6f1722bf 880 MAX11410::CMD_r000_1110_xxdd_xddd_PGA,
whismanoid 52:d3fb6f1722bf 881 MAX11410::CMD_r000_1111_dddd_dddd_WAIT_EXT,
whismanoid 52:d3fb6f1722bf 882 MAX11410::CMD_r001_0000_xxxx_xxxx_WAIT_START,
whismanoid 52:d3fb6f1722bf 883 MAX11410::CMD_r001_0001_xxxx_xxxx_xxxx_xxxx_xxxx_xddd_PART_ID,
whismanoid 52:d3fb6f1722bf 884 MAX11410::CMD_r011_0000_dddd_dddd_dddd_dddd_dddd_dddd_DATA0,
whismanoid 52:d3fb6f1722bf 885 MAX11410::CMD_r011_0001_dddd_dddd_dddd_dddd_dddd_dddd_DATA1,
whismanoid 52:d3fb6f1722bf 886 MAX11410::CMD_r011_0010_dddd_dddd_dddd_dddd_dddd_dddd_DATA2,
whismanoid 52:d3fb6f1722bf 887 MAX11410::CMD_r011_0011_dddd_dddd_dddd_dddd_dddd_dddd_DATA3,
whismanoid 52:d3fb6f1722bf 888 MAX11410::CMD_r011_0100_dddd_dddd_dddd_dddd_dddd_dddd_DATA4,
whismanoid 52:d3fb6f1722bf 889 MAX11410::CMD_r011_0101_dddd_dddd_dddd_dddd_dddd_dddd_DATA5,
whismanoid 52:d3fb6f1722bf 890 MAX11410::CMD_r011_0110_dddd_dddd_dddd_dddd_dddd_dddd_DATA6,
whismanoid 52:d3fb6f1722bf 891 MAX11410::CMD_r011_0111_dddd_dddd_dddd_dddd_dddd_dddd_DATA7,
whismanoid 52:d3fb6f1722bf 892 MAX11410::CMD_r011_1000_dddd_dddd_dddd_dddd_dxxx_dddd_STATUS,
whismanoid 52:d3fb6f1722bf 893 };
whismanoid 52:d3fb6f1722bf 894 for (uint8_t readAllStatusIndex = 0; readAllStatusIndex < (sizeof(readAllStatusList)/sizeof(MAX11410::MAX11410_CMD_enum_t)); readAllStatusIndex++)
whismanoid 37:74aa97afa030 895 {
whismanoid 52:d3fb6f1722bf 896 MAX11410::MAX11410_CMD_enum_t regAddress = readAllStatusList[readAllStatusIndex];
whismanoid 37:74aa97afa030 897 uint32_t regData = 0;
whismanoid 52:d3fb6f1722bf 898 if (g_MAX11410_device.RegSize(regAddress) == 0) continue; // skip undefined regs
whismanoid 52:d3fb6f1722bf 899 if (g_MAX11410_device.RegRead(regAddress, &regData) == 0) continue; // skip unreadable regs
whismanoid 56:6e9c52cc9abe 900 cmdLine.serial().printf("%s=0x%6.6lx\r\n", g_MAX11410_device.RegName(regAddress), regData);
whismanoid 37:74aa97afa030 901 } // end for regAddr
whismanoid 37:74aa97afa030 902 g_MAX11410_device.onSPIprint = saved_onSPIprint_handler;
whismanoid 37:74aa97afa030 903 return true; // command handled by MAX11410
whismanoid 37:74aa97afa030 904 }
whismanoid 37:74aa97afa030 905 break;
whismanoid 37:74aa97afa030 906
whismanoid 35:8aa5dffe523d 907 // CODE GENERATOR: generate @ command print global property values of g_MAX11410_device
whismanoid 29:7d0bc70036be 908 case '@':
whismanoid 29:7d0bc70036be 909 {
whismanoid 37:74aa97afa030 910 // CODE GENERATOR: @ command print double g_MAX11410_device.VRef_REF0
whismanoid 37:74aa97afa030 911 cmdLine.serial().printf("VRef_REF0 = ");
whismanoid 52:d3fb6f1722bf 912 cmdLine.serial().printf("%f\r\n", g_MAX11410_device.VRef_REF0);
whismanoid 37:74aa97afa030 913 // CODE GENERATOR: @ command print double g_MAX11410_device.VRef_REF1
whismanoid 37:74aa97afa030 914 cmdLine.serial().printf("VRef_REF1 = ");
whismanoid 52:d3fb6f1722bf 915 cmdLine.serial().printf("%f\r\n", g_MAX11410_device.VRef_REF1);
whismanoid 37:74aa97afa030 916 // CODE GENERATOR: @ command print double g_MAX11410_device.VRef_REF2
whismanoid 37:74aa97afa030 917 cmdLine.serial().printf("VRef_REF2 = ");
whismanoid 52:d3fb6f1722bf 918 cmdLine.serial().printf("%f\r\n", g_MAX11410_device.VRef_REF2);
whismanoid 37:74aa97afa030 919 // CODE GENERATOR: @ command print double g_MAX11410_device.VRef_AVDD
whismanoid 37:74aa97afa030 920 cmdLine.serial().printf("VRef_AVDD = ");
whismanoid 52:d3fb6f1722bf 921 cmdLine.serial().printf("%f\r\n", g_MAX11410_device.VRef_AVDD);
whismanoid 48:2591fcdece5e 922 // CODE GENERATOR: @ command print double g_MAX11410_device.rtd_resistance
whismanoid 48:2591fcdece5e 923 cmdLine.serial().printf("rtd_resistance = ");
whismanoid 52:d3fb6f1722bf 924 cmdLine.serial().printf("%f\r\n", g_MAX11410_device.rtd_resistance);
whismanoid 46:79dba7d4110c 925 // CODE GENERATOR: @ command print double g_MAX11410_device.RTD_Temperature
whismanoid 46:79dba7d4110c 926 cmdLine.serial().printf("RTD_Temperature = ");
whismanoid 52:d3fb6f1722bf 927 cmdLine.serial().printf("%f\r\n", g_MAX11410_device.RTD_Temperature);
whismanoid 37:74aa97afa030 928 // CODE GENERATOR: @ command print uint32_t g_MAX11410_device.ctrl
whismanoid 37:74aa97afa030 929 cmdLine.serial().printf("ctrl = ");
whismanoid 56:6e9c52cc9abe 930 cmdLine.serial().printf("%ld = 0x%8.8lx\r\n", g_MAX11410_device.ctrl, g_MAX11410_device.ctrl);
whismanoid 37:74aa97afa030 931 // CODE GENERATOR: @ command print uint8_t g_MAX11410_device.pgaGain
whismanoid 37:74aa97afa030 932 cmdLine.serial().printf("pgaGain = ");
whismanoid 52:d3fb6f1722bf 933 cmdLine.serial().printf("%d = 0x%2.2x\r\n", g_MAX11410_device.pgaGain, g_MAX11410_device.pgaGain);
whismanoid 35:8aa5dffe523d 934 // CODE GENERATOR: @ command print uint32_t g_MAX11410_device.status
whismanoid 35:8aa5dffe523d 935 cmdLine.serial().printf("status = ");
whismanoid 56:6e9c52cc9abe 936 cmdLine.serial().printf("%ld = 0x%8.8lx\r\n", g_MAX11410_device.status, g_MAX11410_device.status);
whismanoid 35:8aa5dffe523d 937 // CODE GENERATOR: @ command print uint32_t g_MAX11410_device.data0
whismanoid 35:8aa5dffe523d 938 cmdLine.serial().printf("data0 = ");
whismanoid 56:6e9c52cc9abe 939 cmdLine.serial().printf("%ld = 0x%8.8lx\r\n", g_MAX11410_device.data0, g_MAX11410_device.data0);
whismanoid 51:15d9a9e0b623 940 // CODE GENERATOR: @ command print uint32_t array g_MAX11410_device.AINcode[0..10]
whismanoid 51:15d9a9e0b623 941 for(int index = 0; (index < 11) && (index < 16); index++) {
whismanoid 37:74aa97afa030 942 cmdLine.serial().printf("AINcode[%d] = ", index);
whismanoid 56:6e9c52cc9abe 943 cmdLine.serial().printf("%ld = 0x%8.8lx\r\n", g_MAX11410_device.AINcode[index], g_MAX11410_device.AINcode[index]);
whismanoid 37:74aa97afa030 944 }
whismanoid 35:8aa5dffe523d 945 return true; // command handled by MAX11410
whismanoid 35:8aa5dffe523d 946 break;
whismanoid 35:8aa5dffe523d 947 }
whismanoid 35:8aa5dffe523d 948 // CODE GENERATOR: TODO1: generate GPIO commands for LDAC, CLR, etc. based on device driver function names
whismanoid 35:8aa5dffe523d 949 // case 'G'..'Z','g'..'z' are reserved for GPIO commands
whismanoid 35:8aa5dffe523d 950 // case 'A'..'F','a'..'f' may be available if not claimed by bitstream commands
whismanoid 35:8aa5dffe523d 951
whismanoid 35:8aa5dffe523d 952 // CODE GENERATOR: test menu
whismanoid 35:8aa5dffe523d 953 // case '0'..'9','A'..'F','a'..'f' letters are reserved for bitstream commands
whismanoid 35:8aa5dffe523d 954 // has_register_write_command: case '0'..'9','A'..'F','a'..'f' letters are reserved for bitstream commands
whismanoid 49:5bfa51523bc2 955 // CODE GENERATOR: top of loop: testMenuCommand="!", testMenuFirstCharHandler="None"
whismanoid 35:8aa5dffe523d 956 // CODE GENERATOR: test menu case '!':
whismanoid 35:8aa5dffe523d 957 // CODE GENERATOR: helpString '! -- Init'
whismanoid 60:f38c54a91794 958 // CODE GENERATOR: CMD_ 'None'
whismanoid 35:8aa5dffe523d 959 // CODE GENERATOR: CommandName 'Init'
whismanoid 35:8aa5dffe523d 960 // CODE GENERATOR: CommandParamIn 'void'
whismanoid 35:8aa5dffe523d 961 // CODE GENERATOR: CommandReturnType 'uint8_t'
whismanoid 35:8aa5dffe523d 962 // CODE GENERATOR: CommandPre ''
whismanoid 37:74aa97afa030 963 // CODE GENERATOR: CommandDocParamIn ''
whismanoid 37:74aa97afa030 964 // CODE GENERATOR: CommandDocParamOut ''
whismanoid 35:8aa5dffe523d 965 // CODE GENERATOR: CommandPost ''
whismanoid 35:8aa5dffe523d 966 // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure'
whismanoid 59:c0376adb6ebc 967 // CODE GENERATOR: CommandTest '@test Init() expect 1'
whismanoid 59:c0376adb6ebc 968 // CODE GENERATOR: CommandTest 'TODO1: #169 SelfTest support @test tinyTester.print("message")'
whismanoid 60:f38c54a91794 969 // CODE GENERATOR: CommandTest '@test RegRead(MAX11410::CMD_r001_0001_xxxx_xxxx_xxxx_xxxx_xxxx_xddd_PART_ID, buffer) expect 1 expect-buffer 0x000F02'
whismanoid 60:f38c54a91794 970 // CODE GENERATOR: CommandTest '@test RegRead(MAX11410::CMD_r000_0100_dddd_xddd_GP0_CTRL, buffer) expect 1 expect-buffer 0x00'
whismanoid 60:f38c54a91794 971 // CODE GENERATOR: CommandTest '@test RegRead(MAX11410::CMD_r000_0101_dddd_xddd_GP1_CTRL, buffer) expect 1 expect-buffer 0x00'
whismanoid 60:f38c54a91794 972 // CODE GENERATOR: CommandTest '@test RegRead(MAX11410::CMD_r000_0111_xddd_dddd_GP_SEQ_ADDR, buffer) expect 1 expect-buffer 0x00003a'
whismanoid 60:f38c54a91794 973 // CODE GENERATOR: CommandTest '@test RegRead(MAX11410::CMD_r000_1000_x0dd_dddd_FILTER, buffer) expect 1 expect-buffer 0x00'
whismanoid 60:f38c54a91794 974 // CODE GENERATOR: CommandTest '@test RegRead(MAX11410::CMD_r000_1001_dddd_dddd_CTRL, buffer) expect 1 expect-buffer 0x000001'
whismanoid 60:f38c54a91794 975 // CODE GENERATOR: CommandTest '@test RegRead(MAX11410::CMD_r000_1010_dddd_dddd_SOURCE, buffer) expect 1 expect-buffer 0x00'
whismanoid 60:f38c54a91794 976 // CODE GENERATOR: CommandTest '@test RegRead(MAX11410::CMD_r000_1011_dddd_dddd_MUX_CTRL0, buffer) expect 1 expect-buffer 0x0000ff'
whismanoid 60:f38c54a91794 977 // CODE GENERATOR: CommandTest '@test RegRead(MAX11410::CMD_r000_1100_dddd_dddd_MUX_CTRL1, buffer) expect 1 expect-buffer 0x0000ff'
whismanoid 60:f38c54a91794 978 // CODE GENERATOR: CommandTest '@test RegRead(MAX11410::CMD_r000_1101_dddd_dddd_MUX_CTRL2, buffer) expect 1 expect-buffer 0x00'
whismanoid 60:f38c54a91794 979 // CODE GENERATOR: CommandTest '@test RegRead(MAX11410::CMD_r000_1110_xxdd_xddd_PGA, buffer) expect 1 expect-buffer 0x00'
whismanoid 59:c0376adb6ebc 980 // CODE GENERATOR: CommandTest '@test tinyTester.print("check filter register is writeable")'
whismanoid 59:c0376adb6ebc 981 // CODE GENERATOR: CommandTest '@test RegWrite(0x08, 0x34) expect 1'
whismanoid 59:c0376adb6ebc 982 // CODE GENERATOR: CommandTest '@test tinyTester.print("check filter register is readable")'
whismanoid 59:c0376adb6ebc 983 // CODE GENERATOR: CommandTest '@test RegRead(0x08, buffer) expect 1 expect-buffer 0x34'
whismanoid 59:c0376adb6ebc 984 // CODE GENERATOR: CommandTest 'TODO1: #169 SelfTest support @test tinyTester.settle_time_msec = 250'
whismanoid 59:c0376adb6ebc 985 // CODE GENERATOR: CommandTest '@test tinyTester.settle_time_msec = 250 // default 250'
whismanoid 59:c0376adb6ebc 986 // CODE GENERATOR: CommandTest '@test tinyTester.blink_time_msec = 75 // default 75 resume hardware self test'
whismanoid 59:c0376adb6ebc 987 // CODE GENERATOR: CommandTest '@test tinyTester.input_timeout_time_msec = 250 // default 250'
whismanoid 59:c0376adb6ebc 988 // CODE GENERATOR: CommandTest '@test tinyTester.settle_time_msec = 20 // default 250'
whismanoid 59:c0376adb6ebc 989 // CODE GENERATOR: CommandTest '@test tinyTester.blink_time_msec = 20 // quickly speed through the software verification'
whismanoid 59:c0376adb6ebc 990 // CODE GENERATOR: CommandTest '@test tinyTester.input_timeout_time_msec = 100 // default 250'
whismanoid 59:c0376adb6ebc 991 // CODE GENERATOR: CommandTest 'TODO1: #169 SelfTest support @test tinyTester.Wait_Output_Settling()'
whismanoid 59:c0376adb6ebc 992 // CODE GENERATOR: CommandTest '@test tinyTester.Wait_Output_Settling()'
whismanoid 49:5bfa51523bc2 993 // case '!': // (single character) (testMenuFirstCharHandler="None")
whismanoid 35:8aa5dffe523d 994 case '!':
whismanoid 35:8aa5dffe523d 995 {
whismanoid 35:8aa5dffe523d 996 // test menu command '!' handler:
whismanoid 35:8aa5dffe523d 997 // helpString='! -- Init'
whismanoid 60:f38c54a91794 998 // CMD_='None'
whismanoid 35:8aa5dffe523d 999 // CommandName='Init'
whismanoid 35:8aa5dffe523d 1000 // CommandParamIn='void'
whismanoid 35:8aa5dffe523d 1001 // CommandReturnType='uint8_t'
whismanoid 35:8aa5dffe523d 1002 // @Pre=''
whismanoid 37:74aa97afa030 1003 // @Param[in]=''
whismanoid 37:74aa97afa030 1004 // @Param[out]=''
whismanoid 35:8aa5dffe523d 1005 // @Post=''
whismanoid 60:f38c54a91794 1006 // displayPost=''
whismanoid 35:8aa5dffe523d 1007 // @Return='@return 1 on success; 0 on failure'
whismanoid 59:c0376adb6ebc 1008 // @Test='@test Init() expect 1'
whismanoid 59:c0376adb6ebc 1009 // @Test='TODO1: #169 SelfTest support @test tinyTester.print("message")'
whismanoid 60:f38c54a91794 1010 // @Test='@test RegRead(MAX11410::CMD_r001_0001_xxxx_xxxx_xxxx_xxxx_xxxx_xddd_PART_ID, buffer) expect 1 expect-buffer 0x000F02'
whismanoid 60:f38c54a91794 1011 // @Test='@test RegRead(MAX11410::CMD_r000_0100_dddd_xddd_GP0_CTRL, buffer) expect 1 expect-buffer 0x00'
whismanoid 60:f38c54a91794 1012 // @Test='@test RegRead(MAX11410::CMD_r000_0101_dddd_xddd_GP1_CTRL, buffer) expect 1 expect-buffer 0x00'
whismanoid 60:f38c54a91794 1013 // @Test='@test RegRead(MAX11410::CMD_r000_0111_xddd_dddd_GP_SEQ_ADDR, buffer) expect 1 expect-buffer 0x00003a'
whismanoid 60:f38c54a91794 1014 // @Test='@test RegRead(MAX11410::CMD_r000_1000_x0dd_dddd_FILTER, buffer) expect 1 expect-buffer 0x00'
whismanoid 60:f38c54a91794 1015 // @Test='@test RegRead(MAX11410::CMD_r000_1001_dddd_dddd_CTRL, buffer) expect 1 expect-buffer 0x000001'
whismanoid 60:f38c54a91794 1016 // @Test='@test RegRead(MAX11410::CMD_r000_1010_dddd_dddd_SOURCE, buffer) expect 1 expect-buffer 0x00'
whismanoid 60:f38c54a91794 1017 // @Test='@test RegRead(MAX11410::CMD_r000_1011_dddd_dddd_MUX_CTRL0, buffer) expect 1 expect-buffer 0x0000ff'
whismanoid 60:f38c54a91794 1018 // @Test='@test RegRead(MAX11410::CMD_r000_1100_dddd_dddd_MUX_CTRL1, buffer) expect 1 expect-buffer 0x0000ff'
whismanoid 60:f38c54a91794 1019 // @Test='@test RegRead(MAX11410::CMD_r000_1101_dddd_dddd_MUX_CTRL2, buffer) expect 1 expect-buffer 0x00'
whismanoid 60:f38c54a91794 1020 // @Test='@test RegRead(MAX11410::CMD_r000_1110_xxdd_xddd_PGA, buffer) expect 1 expect-buffer 0x00'
whismanoid 59:c0376adb6ebc 1021 // @Test='@test tinyTester.print("check filter register is writeable")'
whismanoid 59:c0376adb6ebc 1022 // @Test='@test RegWrite(0x08, 0x34) expect 1'
whismanoid 59:c0376adb6ebc 1023 // @Test='@test tinyTester.print("check filter register is readable")'
whismanoid 59:c0376adb6ebc 1024 // @Test='@test RegRead(0x08, buffer) expect 1 expect-buffer 0x34'
whismanoid 59:c0376adb6ebc 1025 // @Test='TODO1: #169 SelfTest support @test tinyTester.settle_time_msec = 250'
whismanoid 59:c0376adb6ebc 1026 // @Test='@test tinyTester.settle_time_msec = 250 // default 250'
whismanoid 59:c0376adb6ebc 1027 // @Test='@test tinyTester.blink_time_msec = 75 // default 75 resume hardware self test'
whismanoid 59:c0376adb6ebc 1028 // @Test='@test tinyTester.input_timeout_time_msec = 250 // default 250'
whismanoid 59:c0376adb6ebc 1029 // @Test='@test tinyTester.settle_time_msec = 20 // default 250'
whismanoid 59:c0376adb6ebc 1030 // @Test='@test tinyTester.blink_time_msec = 20 // quickly speed through the software verification'
whismanoid 59:c0376adb6ebc 1031 // @Test='@test tinyTester.input_timeout_time_msec = 100 // default 250'
whismanoid 59:c0376adb6ebc 1032 // @Test='TODO1: #169 SelfTest support @test tinyTester.Wait_Output_Settling()'
whismanoid 59:c0376adb6ebc 1033 // @Test='@test tinyTester.Wait_Output_Settling()'
whismanoid 35:8aa5dffe523d 1034 cmdLine.serial().printf("Init");
whismanoid 35:8aa5dffe523d 1035 // call function Init
whismanoid 35:8aa5dffe523d 1036 uint8_t result = g_MAX11410_device.Init();
whismanoid 54:ba810c1d6264 1037 cmdLine.serial().printf(" =%d\r\n", result);
whismanoid 35:8aa5dffe523d 1038 return true; // command handled by MAX11410
whismanoid 49:5bfa51523bc2 1039 // CODE GENERATOR: bottom of loop: testMenuCommand="!", testMenuFirstCharHandler="None"
whismanoid 35:8aa5dffe523d 1040 } // end case '!'
whismanoid 35:8aa5dffe523d 1041 break;
whismanoid 35:8aa5dffe523d 1042
whismanoid 49:5bfa51523bc2 1043 // CODE GENERATOR: top of loop: testMenuCommand="$", testMenuFirstCharHandler="None"
whismanoid 37:74aa97afa030 1044 // CODE GENERATOR: test menu case '$':
whismanoid 37:74aa97afa030 1045 // CODE GENERATOR: helpString '$ -- Read_All_Voltages'
whismanoid 37:74aa97afa030 1046 // CODE GENERATOR: CMD_ 'None'
whismanoid 37:74aa97afa030 1047 // CODE GENERATOR: CommandName 'Read_All_Voltages'
whismanoid 37:74aa97afa030 1048 // CODE GENERATOR: CommandParamIn 'void'
whismanoid 37:74aa97afa030 1049 // CODE GENERATOR: CommandReturnType 'uint8_t'
whismanoid 37:74aa97afa030 1050 // CODE GENERATOR: CommandPre ''
whismanoid 37:74aa97afa030 1051 // CODE GENERATOR: CommandDocParamIn ''
whismanoid 37:74aa97afa030 1052 // CODE GENERATOR: CommandDocParamOut ''
whismanoid 51:15d9a9e0b623 1053 // CODE GENERATOR: CommandPost '@post AINcode[0..10]: measurement result LSB code'
whismanoid 37:74aa97afa030 1054 // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure'
whismanoid 49:5bfa51523bc2 1055 // case '$': // (single character) (testMenuFirstCharHandler="None")
whismanoid 37:74aa97afa030 1056 case '$':
whismanoid 37:74aa97afa030 1057 {
whismanoid 37:74aa97afa030 1058 // test menu command '$' handler:
whismanoid 37:74aa97afa030 1059 // helpString='$ -- Read_All_Voltages'
whismanoid 37:74aa97afa030 1060 // CMD_='None'
whismanoid 37:74aa97afa030 1061 // CommandName='Read_All_Voltages'
whismanoid 37:74aa97afa030 1062 // CommandParamIn='void'
whismanoid 37:74aa97afa030 1063 // CommandReturnType='uint8_t'
whismanoid 37:74aa97afa030 1064 // @Pre=''
whismanoid 37:74aa97afa030 1065 // @Param[in]=''
whismanoid 37:74aa97afa030 1066 // @Param[out]=''
whismanoid 51:15d9a9e0b623 1067 // @Post='@post AINcode[0..10]: measurement result LSB code'
whismanoid 54:ba810c1d6264 1068 // displayPost='AINcode[0], AINcode[1], AINcode[2], AINcode[3], AINcode[4], AINcode[5], AINcode[6], AINcode[7], AINcode[8], AINcode[9], AINcode[10]'
whismanoid 37:74aa97afa030 1069 // @Return='@return 1 on success; 0 on failure'
whismanoid 37:74aa97afa030 1070 cmdLine.serial().printf("Read_All_Voltages");
whismanoid 37:74aa97afa030 1071 // call function Read_All_Voltages
whismanoid 37:74aa97afa030 1072 uint8_t result = g_MAX11410_device.Read_All_Voltages();
whismanoid 54:ba810c1d6264 1073 cmdLine.serial().printf(" =%d\r\n", result);
whismanoid 54:ba810c1d6264 1074 // Menu item '$' -> AINcode[0], AINcode[1], AINcode[2], AINcode[3], AINcode[4], AINcode[5], AINcode[6], AINcode[7], AINcode[8], AINcode[9], AINcode[10]
whismanoid 56:6e9c52cc9abe 1075 cmdLine.serial().printf("%s=%ld\r\n", "AINcode[0]", g_MAX11410_device.AINcode[0]);
whismanoid 56:6e9c52cc9abe 1076 cmdLine.serial().printf("%s=%ld\r\n", "AINcode[1]", g_MAX11410_device.AINcode[1]);
whismanoid 56:6e9c52cc9abe 1077 cmdLine.serial().printf("%s=%ld\r\n", "AINcode[2]", g_MAX11410_device.AINcode[2]);
whismanoid 56:6e9c52cc9abe 1078 cmdLine.serial().printf("%s=%ld\r\n", "AINcode[3]", g_MAX11410_device.AINcode[3]);
whismanoid 56:6e9c52cc9abe 1079 cmdLine.serial().printf("%s=%ld\r\n", "AINcode[4]", g_MAX11410_device.AINcode[4]);
whismanoid 56:6e9c52cc9abe 1080 cmdLine.serial().printf("%s=%ld\r\n", "AINcode[5]", g_MAX11410_device.AINcode[5]);
whismanoid 56:6e9c52cc9abe 1081 cmdLine.serial().printf("%s=%ld\r\n", "AINcode[6]", g_MAX11410_device.AINcode[6]);
whismanoid 56:6e9c52cc9abe 1082 cmdLine.serial().printf("%s=%ld\r\n", "AINcode[7]", g_MAX11410_device.AINcode[7]);
whismanoid 56:6e9c52cc9abe 1083 cmdLine.serial().printf("%s=%ld\r\n", "AINcode[8]", g_MAX11410_device.AINcode[8]);
whismanoid 56:6e9c52cc9abe 1084 cmdLine.serial().printf("%s=%ld\r\n", "AINcode[9]", g_MAX11410_device.AINcode[9]);
whismanoid 56:6e9c52cc9abe 1085 cmdLine.serial().printf("%s=%ld\r\n", "AINcode[10]", g_MAX11410_device.AINcode[10]);
whismanoid 37:74aa97afa030 1086 return true; // command handled by MAX11410
whismanoid 49:5bfa51523bc2 1087 // CODE GENERATOR: bottom of loop: testMenuCommand="$", testMenuFirstCharHandler="None"
whismanoid 37:74aa97afa030 1088 } // end case '$'
whismanoid 37:74aa97afa030 1089 break;
whismanoid 37:74aa97afa030 1090
whismanoid 49:5bfa51523bc2 1091 // CODE GENERATOR: top of loop: testMenuCommand="R", testMenuFirstCharHandler="None"
whismanoid 48:2591fcdece5e 1092 // CODE GENERATOR: test menu case 'R':
whismanoid 48:2591fcdece5e 1093 // CODE GENERATOR: helpString 'R -- Measure_RTD'
whismanoid 37:74aa97afa030 1094 // CODE GENERATOR: CMD_ 'None'
whismanoid 37:74aa97afa030 1095 // CODE GENERATOR: CommandName 'Measure_RTD'
whismanoid 37:74aa97afa030 1096 // CODE GENERATOR: CommandParamIn 'MAX11410_AINP_SEL_enum_t rtd_iout, MAX11410_AINP_SEL_enum_t rtd_ainp, MAX11410_AINN_SEL_enum_t rtd_ainn'
whismanoid 37:74aa97afa030 1097 // CODE GENERATOR: CommandReturnType 'double'
whismanoid 37:74aa97afa030 1098 // CODE GENERATOR: CommandPre '@pre external connection REF1P-REF1N is a reference resistor'
whismanoid 37:74aa97afa030 1099 // CODE GENERATOR: CommandPre '@pre VRef_REF1 = reference resistance in ohms, default=4999'
whismanoid 37:74aa97afa030 1100 // CODE GENERATOR: CommandDocParamIn '@param[in] rtd_iout = channel RTD high side force, default=AINP_SEL_0111_AIN7'
whismanoid 37:74aa97afa030 1101 // CODE GENERATOR: CommandDocParamIn '@param[in] rtd_ainp = channel RTD high side sense, default=AINP_SEL_1000_AIN8'
whismanoid 37:74aa97afa030 1102 // CODE GENERATOR: CommandDocParamIn '@param[in] rtd_ainn = channel RTD low side, default=AINN_SEL_1001_AIN9'
whismanoid 37:74aa97afa030 1103 // CODE GENERATOR: CommandDocParamOut ''
whismanoid 37:74aa97afa030 1104 // CODE GENERATOR: CommandPost '@post AINcode[rtd_ainp]: measurement result LSB code'
whismanoid 48:2591fcdece5e 1105 // CODE GENERATOR: CommandPost '@post rtd_resistance: measurement result resistance in Ohms'
whismanoid 48:2591fcdece5e 1106 // CODE GENERATOR: CommandPost '@post RTD_Temperature: Temperature calculated from RTD Resistance; Thermocouple Cold Junction, in degrees C'
whismanoid 46:79dba7d4110c 1107 // CODE GENERATOR: CommandReturn '@return resistance calculated from raw LSB code and reference resistance'
whismanoid 49:5bfa51523bc2 1108 // case 'R': // (single character) (testMenuFirstCharHandler="None")
whismanoid 37:74aa97afa030 1109 case 'R':
whismanoid 37:74aa97afa030 1110 {
whismanoid 48:2591fcdece5e 1111 // test menu command 'R' handler:
whismanoid 48:2591fcdece5e 1112 // helpString='R -- Measure_RTD'
whismanoid 37:74aa97afa030 1113 // CMD_='None'
whismanoid 37:74aa97afa030 1114 // CommandName='Measure_RTD'
whismanoid 37:74aa97afa030 1115 // CommandParamIn='MAX11410_AINP_SEL_enum_t rtd_iout, MAX11410_AINP_SEL_enum_t rtd_ainp, MAX11410_AINN_SEL_enum_t rtd_ainn'
whismanoid 37:74aa97afa030 1116 // CommandReturnType='double'
whismanoid 37:74aa97afa030 1117 // @Pre='@pre external connection REF1P-REF1N is a reference resistor'
whismanoid 37:74aa97afa030 1118 // @Pre='@pre VRef_REF1 = reference resistance in ohms, default=4999'
whismanoid 37:74aa97afa030 1119 // @Param[in]='@param[in] rtd_iout = channel RTD high side force, default=AINP_SEL_0111_AIN7'
whismanoid 37:74aa97afa030 1120 // @Param[in]='@param[in] rtd_ainp = channel RTD high side sense, default=AINP_SEL_1000_AIN8'
whismanoid 37:74aa97afa030 1121 // @Param[in]='@param[in] rtd_ainn = channel RTD low side, default=AINN_SEL_1001_AIN9'
whismanoid 37:74aa97afa030 1122 // @Param[out]=''
whismanoid 37:74aa97afa030 1123 // @Post='@post AINcode[rtd_ainp]: measurement result LSB code'
whismanoid 48:2591fcdece5e 1124 // @Post='@post rtd_resistance: measurement result resistance in Ohms'
whismanoid 48:2591fcdece5e 1125 // @Post='@post RTD_Temperature: Temperature calculated from RTD Resistance; Thermocouple Cold Junction, in degrees C'
whismanoid 48:2591fcdece5e 1126 // displayPost='rtd_resistance, RTD_Temperature'
whismanoid 46:79dba7d4110c 1127 // @Return='@return resistance calculated from raw LSB code and reference resistance'
whismanoid 37:74aa97afa030 1128 // parse argument list
whismanoid 37:74aa97afa030 1129 // argname default_argvalue symbolic enum name specified in CommandDocParamIn @Param[in]='@param[in] rtd_iout = channel RTD high side force, default=AINP_SEL_0111_AIN7'
whismanoid 37:74aa97afa030 1130 // parse argument MAX11410::MAX11410_AINP_SEL_enum_t rtd_iout
whismanoid 37:74aa97afa030 1131 MAX11410::MAX11410_AINP_SEL_enum_t rtd_iout = MAX11410::AINP_SEL_0111_AIN7; // --- g_MAX11410_device.__WARNING_no_match_for_argname_rtd_iout_in_MAX11410_device_t__; // default to global property value
whismanoid 37:74aa97afa030 1132 if (cmdLine.parse_uint8_dec("rtd_iout", (uint8_t&)rtd_iout))
whismanoid 37:74aa97afa030 1133 {
whismanoid 37:74aa97afa030 1134 // g_MAX11410_device.__WARNING_no_match_for_argname_rtd_iout_in_MAX11410_device_t__ = rtd_iout; // update global property value
whismanoid 37:74aa97afa030 1135 }
whismanoid 37:74aa97afa030 1136 // argname default_argvalue symbolic enum name specified in CommandDocParamIn @Param[in]='@param[in] rtd_ainp = channel RTD high side sense, default=AINP_SEL_1000_AIN8'
whismanoid 37:74aa97afa030 1137 // parse argument MAX11410::MAX11410_AINP_SEL_enum_t rtd_ainp
whismanoid 37:74aa97afa030 1138 MAX11410::MAX11410_AINP_SEL_enum_t rtd_ainp = MAX11410::AINP_SEL_1000_AIN8; // --- g_MAX11410_device.__WARNING_no_match_for_argname_rtd_ainp_in_MAX11410_device_t__; // default to global property value
whismanoid 37:74aa97afa030 1139 if (cmdLine.parse_uint8_dec("rtd_ainp", (uint8_t&)rtd_ainp))
whismanoid 37:74aa97afa030 1140 {
whismanoid 37:74aa97afa030 1141 // g_MAX11410_device.__WARNING_no_match_for_argname_rtd_ainp_in_MAX11410_device_t__ = rtd_ainp; // update global property value
whismanoid 37:74aa97afa030 1142 }
whismanoid 37:74aa97afa030 1143 // argname default_argvalue symbolic enum name specified in CommandDocParamIn @Param[in]='@param[in] rtd_ainn = channel RTD low side, default=AINN_SEL_1001_AIN9'
whismanoid 37:74aa97afa030 1144 // parse argument MAX11410::MAX11410_AINN_SEL_enum_t rtd_ainn
whismanoid 37:74aa97afa030 1145 MAX11410::MAX11410_AINN_SEL_enum_t rtd_ainn = MAX11410::AINN_SEL_1001_AIN9; // --- g_MAX11410_device.__WARNING_no_match_for_argname_rtd_ainn_in_MAX11410_device_t__; // default to global property value
whismanoid 37:74aa97afa030 1146 if (cmdLine.parse_uint8_dec("rtd_ainn", (uint8_t&)rtd_ainn))
whismanoid 37:74aa97afa030 1147 {
whismanoid 37:74aa97afa030 1148 // g_MAX11410_device.__WARNING_no_match_for_argname_rtd_ainn_in_MAX11410_device_t__ = rtd_ainn; // update global property value
whismanoid 37:74aa97afa030 1149 }
whismanoid 37:74aa97afa030 1150 // print arguments
whismanoid 37:74aa97afa030 1151 cmdLine.serial().printf("Measure_RTD");
whismanoid 37:74aa97afa030 1152 cmdLine.serial().printf(" rtd_iout=%d", rtd_iout);
whismanoid 37:74aa97afa030 1153 cmdLine.serial().printf(" rtd_ainp=%d", rtd_ainp);
whismanoid 37:74aa97afa030 1154 cmdLine.serial().printf(" rtd_ainn=%d", rtd_ainn);
whismanoid 37:74aa97afa030 1155 cmdLine.serial().printf(" Measure_RTD"); // unique suffix
whismanoid 37:74aa97afa030 1156 cmdLine.serial().printf("\r\n");
whismanoid 37:74aa97afa030 1157 // call function Measure_RTD(rtd_iout, rtd_ainp, rtd_ainn)
whismanoid 37:74aa97afa030 1158 double result = g_MAX11410_device.Measure_RTD(rtd_iout, rtd_ainp, rtd_ainn);
whismanoid 45:8af4549476aa 1159 cmdLine.serial().printf(" =%f\r\n", result);
whismanoid 48:2591fcdece5e 1160 // Menu item 'R' -> rtd_resistance, RTD_Temperature
whismanoid 48:2591fcdece5e 1161 cmdLine.serial().printf("%s=%f\r\n", "rtd_resistance", g_MAX11410_device.rtd_resistance);
whismanoid 48:2591fcdece5e 1162 cmdLine.serial().printf("%s=%f\r\n", "RTD_Temperature", g_MAX11410_device.RTD_Temperature);
whismanoid 37:74aa97afa030 1163 return true; // command handled by MAX11410
whismanoid 49:5bfa51523bc2 1164 // CODE GENERATOR: bottom of loop: testMenuCommand="R", testMenuFirstCharHandler="None"
whismanoid 48:2591fcdece5e 1165 } // end case 'R'
whismanoid 48:2591fcdece5e 1166 break;
whismanoid 37:74aa97afa030 1167
whismanoid 49:5bfa51523bc2 1168 // CODE GENERATOR: top of loop: testMenuCommand="TK", testMenuFirstCharHandler="None"
whismanoid 46:79dba7d4110c 1169 // CODE GENERATOR: test menu case 'TK':
whismanoid 46:79dba7d4110c 1170 // CODE GENERATOR: helpString 'TK tc_voltage=? -- TemperatureOfTC_TypeK'
whismanoid 46:79dba7d4110c 1171 // CODE GENERATOR: CMD_ 'None'
whismanoid 46:79dba7d4110c 1172 // CODE GENERATOR: CommandName 'TemperatureOfTC_TypeK'
whismanoid 46:79dba7d4110c 1173 // CODE GENERATOR: CommandParamIn 'double tc_voltage'
whismanoid 46:79dba7d4110c 1174 // CODE GENERATOR: CommandReturnType 'double'
whismanoid 46:79dba7d4110c 1175 // CODE GENERATOR: CommandPre '@pre {0}.RTD_Temperature = cold junction temperature, in degrees C'
whismanoid 46:79dba7d4110c 1176 // CODE GENERATOR: CommandDocParamIn '@param[in] tc_voltage = Thermocouple voltage in volts, default=0.0254'
whismanoid 46:79dba7d4110c 1177 // CODE GENERATOR: CommandDocParamOut ''
whismanoid 46:79dba7d4110c 1178 // CODE GENERATOR: CommandPost ''
whismanoid 46:79dba7d4110c 1179 // CODE GENERATOR: CommandReturn '@return ideal temperature in degrees C, calculated from RTD resistance in ohms'
whismanoid 59:c0376adb6ebc 1180 // CODE GENERATOR: CommandTest '@test tinyTester.blink_time_msec = 20 // quickly speed through the software verification'
whismanoid 59:c0376adb6ebc 1181 // CODE GENERATOR: CommandTest '@test group TC_1 TemperatureOfTC_TypeK(0.000e-3) expect 0.0 within 0.1 // TC_TypeK at 0C = 0.000mV'
whismanoid 59:c0376adb6ebc 1182 // CODE GENERATOR: CommandTest '@test group TC_1 TemperatureOfTC_TypeK(0.039e-3) expect 1.0 within 0.1 // TC_TypeK at 1C = 0.039mV'
whismanoid 59:c0376adb6ebc 1183 // CODE GENERATOR: CommandTest '@test group TC_1 TemperatureOfTC_TypeK(0.079e-3) expect 2.0 within 0.1 // TC_TypeK at 2C = 0.079mV'
whismanoid 59:c0376adb6ebc 1184 // CODE GENERATOR: CommandTest '@test group TC_1 TemperatureOfTC_TypeK(0.119e-3) expect 3.0 within 0.1 // TC_TypeK at 3C = 0.119mV'
whismanoid 59:c0376adb6ebc 1185 // CODE GENERATOR: CommandTest '@test group TC_2 TemperatureOfTC_TypeK(0.158e-3) expect 4.0 within 0.1 // TC_TypeK at 4C = 0.158mV'
whismanoid 59:c0376adb6ebc 1186 // CODE GENERATOR: CommandTest '@test group TC_2 TemperatureOfTC_TypeK(0.198e-3) expect 5.0 within 0.1 // TC_TypeK at 5C = 0.198mV'
whismanoid 59:c0376adb6ebc 1187 // CODE GENERATOR: CommandTest '@test group TC_2 TemperatureOfTC_TypeK(0.238e-3) expect 6.0 within 0.1 // TC_TypeK at 6C = 0.238mV'
whismanoid 59:c0376adb6ebc 1188 // CODE GENERATOR: CommandTest '@test group TC_2 TemperatureOfTC_TypeK(0.2775e-3) expect 7.0 within 0.1 // TC_TypeK at 7C = 0.2775mV'
whismanoid 59:c0376adb6ebc 1189 // CODE GENERATOR: CommandTest '@test group TC_2 TemperatureOfTC_TypeK(0.317e-3) expect 8.0 within 0.1 // TC_TypeK at 8C = 0.317mV'
whismanoid 59:c0376adb6ebc 1190 // CODE GENERATOR: CommandTest '@test group TC_2 TemperatureOfTC_TypeK(0.357e-3) expect 9.0 within 0.1 // TC_TypeK at 9C = 0.357mV'
whismanoid 59:c0376adb6ebc 1191 // CODE GENERATOR: CommandTest '@test group TC_1 TemperatureOfTC_TypeK(0.397e-3) expect 10.0 within 0.1 // TC_TypeK at 10C = 0.397mV'
whismanoid 59:c0376adb6ebc 1192 // CODE GENERATOR: CommandTest '@test group TC_1 TemperatureOfTC_TypeK(0.798e-3) expect 20.0 within 0.1 // TC_TypeK at 20C = 0.798mV'
whismanoid 59:c0376adb6ebc 1193 // CODE GENERATOR: CommandTest '@test group TC_1 TemperatureOfTC_TypeK(1.081e-3) expect 27.0 within 0.1 // TC_TypeK at 27C = 1.081mV'
whismanoid 59:c0376adb6ebc 1194 // CODE GENERATOR: CommandTest '@test group TC_1 TemperatureOfTC_TypeK(1.203e-3) expect 30.0 within 0.1 // TC_TypeK at 30C = 1.203mV'
whismanoid 59:c0376adb6ebc 1195 // CODE GENERATOR: CommandTest '@test group TC_1 TemperatureOfTC_TypeK(1.612e-3) expect 40.0 within 0.1 // TC_TypeK at 40C = 1.612mV'
whismanoid 59:c0376adb6ebc 1196 // CODE GENERATOR: CommandTest '@test group TC_1 TemperatureOfTC_TypeK(2.023e-3) expect 50.0 within 0.1 // TC_TypeK at 50C = 2.023mV'
whismanoid 59:c0376adb6ebc 1197 // CODE GENERATOR: CommandTest '@test group TC_1 TemperatureOfTC_TypeK(2.436e-3) expect 60.0 within 0.1 // TC_TypeK at 60C = 2.436mV'
whismanoid 59:c0376adb6ebc 1198 // CODE GENERATOR: CommandTest '@test group TC_1 TemperatureOfTC_TypeK(2.851e-3) expect 70.0 within 0.1 // TC_TypeK at 70C = 2.851mV'
whismanoid 59:c0376adb6ebc 1199 // CODE GENERATOR: CommandTest '@test group TC_1 TemperatureOfTC_TypeK(3.267e-3) expect 80.0 within 0.1 // TC_TypeK at 80C = 3.267mV'
whismanoid 59:c0376adb6ebc 1200 // CODE GENERATOR: CommandTest '@test group TC_1 TemperatureOfTC_TypeK(3.682e-3) expect 90.0 within 0.1 // TC_TypeK at 90C = 3.682mV'
whismanoid 59:c0376adb6ebc 1201 // CODE GENERATOR: CommandTest '@test group TC_1 TemperatureOfTC_TypeK(4.096e-3) expect 100.0 within 0.1 // TC_TypeK at 100C = 4.096mV'
whismanoid 59:c0376adb6ebc 1202 // CODE GENERATOR: CommandTest '@test group TC_2 TemperatureOfTC_TypeK(4.509e-3) expect 110.0 within 0.1 // TC_TypeK at 110C = 4.509mV'
whismanoid 59:c0376adb6ebc 1203 // CODE GENERATOR: CommandTest '@test group TC_2 TemperatureOfTC_TypeK(4.920e-3) expect 120.0 within 0.1 // TC_TypeK at 120C = 4.920mV'
whismanoid 59:c0376adb6ebc 1204 // CODE GENERATOR: CommandTest '@test group TC_2 TemperatureOfTC_TypeK(5.328e-3) expect 130.0 within 0.1 // TC_TypeK at 130C = 5.328mV'
whismanoid 59:c0376adb6ebc 1205 // CODE GENERATOR: CommandTest '@test group TC_2 TemperatureOfTC_TypeK(5.735e-3) expect 140.0 within 0.1 // TC_TypeK at 140C = 5.735mV'
whismanoid 59:c0376adb6ebc 1206 // CODE GENERATOR: CommandTest '@test group TC_2 TemperatureOfTC_TypeK(6.138e-3) expect 150.0 within 0.1 // TC_TypeK at 150C = 6.138mV'
whismanoid 59:c0376adb6ebc 1207 // CODE GENERATOR: CommandTest '@test group TC_2 TemperatureOfTC_TypeK(6.540e-3) expect 160.0 within 0.1 // TC_TypeK at 160C = 6.540mV'
whismanoid 59:c0376adb6ebc 1208 // CODE GENERATOR: CommandTest '@test group TC_2 TemperatureOfTC_TypeK(6.941e-3) expect 170.0 within 0.1 // TC_TypeK at 170C = 6.941mV'
whismanoid 59:c0376adb6ebc 1209 // CODE GENERATOR: CommandTest '@test group TC_2 TemperatureOfTC_TypeK(7.340e-3) expect 180.0 within 0.1 // TC_TypeK at 180C = 7.340mV'
whismanoid 59:c0376adb6ebc 1210 // CODE GENERATOR: CommandTest '@test group TC_1 TemperatureOfTC_TypeK(7.739e-3) expect 190.0 within 0.1 // TC_TypeK at 190C = 7.739mV'
whismanoid 59:c0376adb6ebc 1211 // CODE GENERATOR: CommandTest '@test group TC_1 TemperatureOfTC_TypeK(8.138e-3) expect 200.0 within 0.1 // TC_TypeK at 200C = 8.138mV'
whismanoid 59:c0376adb6ebc 1212 // CODE GENERATOR: CommandTest '@test group TC_1 TemperatureOfTC_TypeK(8.539e-3) expect 210.0 within 0.1 // TC_TypeK at 210C = 8.539mV'
whismanoid 59:c0376adb6ebc 1213 // CODE GENERATOR: CommandTest '@test group TC_1 TemperatureOfTC_TypeK(8.940e-3) expect 220.0 within 0.1 // TC_TypeK at 220C = 8.940mV'
whismanoid 59:c0376adb6ebc 1214 // CODE GENERATOR: CommandTest '@test group TC_2 TemperatureOfTC_TypeK(9.343e-3) expect 230.0 within 0.1 // TC_TypeK at 230C = 9.343mV'
whismanoid 59:c0376adb6ebc 1215 // CODE GENERATOR: CommandTest '@test group TC_2 TemperatureOfTC_TypeK(9.747e-3) expect 240.0 within 0.1 // TC_TypeK at 240C = 9.747mV'
whismanoid 59:c0376adb6ebc 1216 // CODE GENERATOR: CommandTest '@test group TC_2 TemperatureOfTC_TypeK(10.153e-3) expect 250.0 within 0.1 // TC_TypeK at 250C = 10.153mV'
whismanoid 59:c0376adb6ebc 1217 // CODE GENERATOR: CommandTest '@test group TC_2 TemperatureOfTC_TypeK(10.561e-3) expect 260.0 within 0.1 // TC_TypeK at 260C = 10.561mV'
whismanoid 59:c0376adb6ebc 1218 // CODE GENERATOR: CommandTest '@test group TC_2 TemperatureOfTC_TypeK(10.971e-3) expect 270.0 within 0.1 // TC_TypeK at 270C = 10.971mV'
whismanoid 59:c0376adb6ebc 1219 // CODE GENERATOR: CommandTest '@test group TC_2 TemperatureOfTC_TypeK(11.382e-3) expect 280.0 within 0.1 // TC_TypeK at 280C = 11.382mV'
whismanoid 59:c0376adb6ebc 1220 // CODE GENERATOR: CommandTest '@test group TC_2 TemperatureOfTC_TypeK(11.795e-3) expect 290.0 within 0.1 // TC_TypeK at 290C = 11.795mV'
whismanoid 59:c0376adb6ebc 1221 // CODE GENERATOR: CommandTest '@test group TC_1 TemperatureOfTC_TypeK(12.209e-3) expect 300.0 within 0.1 // TC_TypeK at 300C = 12.209mV'
whismanoid 59:c0376adb6ebc 1222 // CODE GENERATOR: CommandTest '@test group TC_2 TemperatureOfTC_TypeK(14.293e-3) expect 350.0 within 0.1 // TC_TypeK at 350C = 14.293mV'
whismanoid 59:c0376adb6ebc 1223 // CODE GENERATOR: CommandTest '@test group TC_1 TemperatureOfTC_TypeK(16.397e-3) expect 400.0 within 0.1 // TC_TypeK at 400C = 16.397mV'
whismanoid 59:c0376adb6ebc 1224 // CODE GENERATOR: CommandTest '@test group TC_1 TemperatureOfTC_TypeK(18.516e-3) expect 450.0 within 0.1 // TC_TypeK at 450C = 18.516mV'
whismanoid 59:c0376adb6ebc 1225 // CODE GENERATOR: CommandTest '@test group TC_1 TemperatureOfTC_TypeK(20.218e-3) expect 490.0 // TC_TypeK at 490C = 20.218mV'
whismanoid 59:c0376adb6ebc 1226 // CODE GENERATOR: CommandTest '@test tinyTester.blink_time_msec = 75 // default 75 resume hardware self test'
whismanoid 49:5bfa51523bc2 1227 case 'T': // (multiple characters) (testMenuFirstCharHandler="T"):
whismanoid 46:79dba7d4110c 1228 {
whismanoid 46:79dba7d4110c 1229 switch (cmdLine[1])
whismanoid 46:79dba7d4110c 1230 {
whismanoid 49:5bfa51523bc2 1231 case 'K': // (nested inside case 'T')
whismanoid 46:79dba7d4110c 1232 {
whismanoid 46:79dba7d4110c 1233 // test menu command 'TK' handler:
whismanoid 46:79dba7d4110c 1234 // helpString='TK tc_voltage=? -- TemperatureOfTC_TypeK'
whismanoid 46:79dba7d4110c 1235 // CMD_='None'
whismanoid 46:79dba7d4110c 1236 // CommandName='TemperatureOfTC_TypeK'
whismanoid 46:79dba7d4110c 1237 // CommandParamIn='double tc_voltage'
whismanoid 46:79dba7d4110c 1238 // CommandReturnType='double'
whismanoid 46:79dba7d4110c 1239 // @Pre='@pre {0}.RTD_Temperature = cold junction temperature, in degrees C'
whismanoid 46:79dba7d4110c 1240 // @Param[in]='@param[in] tc_voltage = Thermocouple voltage in volts, default=0.0254'
whismanoid 46:79dba7d4110c 1241 // @Param[out]=''
whismanoid 46:79dba7d4110c 1242 // @Post=''
whismanoid 48:2591fcdece5e 1243 // displayPost=''
whismanoid 46:79dba7d4110c 1244 // @Return='@return ideal temperature in degrees C, calculated from RTD resistance in ohms'
whismanoid 59:c0376adb6ebc 1245 // @Test='@test tinyTester.blink_time_msec = 20 // quickly speed through the software verification'
whismanoid 59:c0376adb6ebc 1246 // @Test='@test group TC_1 TemperatureOfTC_TypeK(0.000e-3) expect 0.0 within 0.1 // TC_TypeK at 0C = 0.000mV'
whismanoid 59:c0376adb6ebc 1247 // @Test='@test group TC_1 TemperatureOfTC_TypeK(0.039e-3) expect 1.0 within 0.1 // TC_TypeK at 1C = 0.039mV'
whismanoid 59:c0376adb6ebc 1248 // @Test='@test group TC_1 TemperatureOfTC_TypeK(0.079e-3) expect 2.0 within 0.1 // TC_TypeK at 2C = 0.079mV'
whismanoid 59:c0376adb6ebc 1249 // @Test='@test group TC_1 TemperatureOfTC_TypeK(0.119e-3) expect 3.0 within 0.1 // TC_TypeK at 3C = 0.119mV'
whismanoid 59:c0376adb6ebc 1250 // @Test='@test group TC_2 TemperatureOfTC_TypeK(0.158e-3) expect 4.0 within 0.1 // TC_TypeK at 4C = 0.158mV'
whismanoid 59:c0376adb6ebc 1251 // @Test='@test group TC_2 TemperatureOfTC_TypeK(0.198e-3) expect 5.0 within 0.1 // TC_TypeK at 5C = 0.198mV'
whismanoid 59:c0376adb6ebc 1252 // @Test='@test group TC_2 TemperatureOfTC_TypeK(0.238e-3) expect 6.0 within 0.1 // TC_TypeK at 6C = 0.238mV'
whismanoid 59:c0376adb6ebc 1253 // @Test='@test group TC_2 TemperatureOfTC_TypeK(0.2775e-3) expect 7.0 within 0.1 // TC_TypeK at 7C = 0.2775mV'
whismanoid 59:c0376adb6ebc 1254 // @Test='@test group TC_2 TemperatureOfTC_TypeK(0.317e-3) expect 8.0 within 0.1 // TC_TypeK at 8C = 0.317mV'
whismanoid 59:c0376adb6ebc 1255 // @Test='@test group TC_2 TemperatureOfTC_TypeK(0.357e-3) expect 9.0 within 0.1 // TC_TypeK at 9C = 0.357mV'
whismanoid 59:c0376adb6ebc 1256 // @Test='@test group TC_1 TemperatureOfTC_TypeK(0.397e-3) expect 10.0 within 0.1 // TC_TypeK at 10C = 0.397mV'
whismanoid 59:c0376adb6ebc 1257 // @Test='@test group TC_1 TemperatureOfTC_TypeK(0.798e-3) expect 20.0 within 0.1 // TC_TypeK at 20C = 0.798mV'
whismanoid 59:c0376adb6ebc 1258 // @Test='@test group TC_1 TemperatureOfTC_TypeK(1.081e-3) expect 27.0 within 0.1 // TC_TypeK at 27C = 1.081mV'
whismanoid 59:c0376adb6ebc 1259 // @Test='@test group TC_1 TemperatureOfTC_TypeK(1.203e-3) expect 30.0 within 0.1 // TC_TypeK at 30C = 1.203mV'
whismanoid 59:c0376adb6ebc 1260 // @Test='@test group TC_1 TemperatureOfTC_TypeK(1.612e-3) expect 40.0 within 0.1 // TC_TypeK at 40C = 1.612mV'
whismanoid 59:c0376adb6ebc 1261 // @Test='@test group TC_1 TemperatureOfTC_TypeK(2.023e-3) expect 50.0 within 0.1 // TC_TypeK at 50C = 2.023mV'
whismanoid 59:c0376adb6ebc 1262 // @Test='@test group TC_1 TemperatureOfTC_TypeK(2.436e-3) expect 60.0 within 0.1 // TC_TypeK at 60C = 2.436mV'
whismanoid 59:c0376adb6ebc 1263 // @Test='@test group TC_1 TemperatureOfTC_TypeK(2.851e-3) expect 70.0 within 0.1 // TC_TypeK at 70C = 2.851mV'
whismanoid 59:c0376adb6ebc 1264 // @Test='@test group TC_1 TemperatureOfTC_TypeK(3.267e-3) expect 80.0 within 0.1 // TC_TypeK at 80C = 3.267mV'
whismanoid 59:c0376adb6ebc 1265 // @Test='@test group TC_1 TemperatureOfTC_TypeK(3.682e-3) expect 90.0 within 0.1 // TC_TypeK at 90C = 3.682mV'
whismanoid 59:c0376adb6ebc 1266 // @Test='@test group TC_1 TemperatureOfTC_TypeK(4.096e-3) expect 100.0 within 0.1 // TC_TypeK at 100C = 4.096mV'
whismanoid 59:c0376adb6ebc 1267 // @Test='@test group TC_2 TemperatureOfTC_TypeK(4.509e-3) expect 110.0 within 0.1 // TC_TypeK at 110C = 4.509mV'
whismanoid 59:c0376adb6ebc 1268 // @Test='@test group TC_2 TemperatureOfTC_TypeK(4.920e-3) expect 120.0 within 0.1 // TC_TypeK at 120C = 4.920mV'
whismanoid 59:c0376adb6ebc 1269 // @Test='@test group TC_2 TemperatureOfTC_TypeK(5.328e-3) expect 130.0 within 0.1 // TC_TypeK at 130C = 5.328mV'
whismanoid 59:c0376adb6ebc 1270 // @Test='@test group TC_2 TemperatureOfTC_TypeK(5.735e-3) expect 140.0 within 0.1 // TC_TypeK at 140C = 5.735mV'
whismanoid 59:c0376adb6ebc 1271 // @Test='@test group TC_2 TemperatureOfTC_TypeK(6.138e-3) expect 150.0 within 0.1 // TC_TypeK at 150C = 6.138mV'
whismanoid 59:c0376adb6ebc 1272 // @Test='@test group TC_2 TemperatureOfTC_TypeK(6.540e-3) expect 160.0 within 0.1 // TC_TypeK at 160C = 6.540mV'
whismanoid 59:c0376adb6ebc 1273 // @Test='@test group TC_2 TemperatureOfTC_TypeK(6.941e-3) expect 170.0 within 0.1 // TC_TypeK at 170C = 6.941mV'
whismanoid 59:c0376adb6ebc 1274 // @Test='@test group TC_2 TemperatureOfTC_TypeK(7.340e-3) expect 180.0 within 0.1 // TC_TypeK at 180C = 7.340mV'
whismanoid 59:c0376adb6ebc 1275 // @Test='@test group TC_1 TemperatureOfTC_TypeK(7.739e-3) expect 190.0 within 0.1 // TC_TypeK at 190C = 7.739mV'
whismanoid 59:c0376adb6ebc 1276 // @Test='@test group TC_1 TemperatureOfTC_TypeK(8.138e-3) expect 200.0 within 0.1 // TC_TypeK at 200C = 8.138mV'
whismanoid 59:c0376adb6ebc 1277 // @Test='@test group TC_1 TemperatureOfTC_TypeK(8.539e-3) expect 210.0 within 0.1 // TC_TypeK at 210C = 8.539mV'
whismanoid 59:c0376adb6ebc 1278 // @Test='@test group TC_1 TemperatureOfTC_TypeK(8.940e-3) expect 220.0 within 0.1 // TC_TypeK at 220C = 8.940mV'
whismanoid 59:c0376adb6ebc 1279 // @Test='@test group TC_2 TemperatureOfTC_TypeK(9.343e-3) expect 230.0 within 0.1 // TC_TypeK at 230C = 9.343mV'
whismanoid 59:c0376adb6ebc 1280 // @Test='@test group TC_2 TemperatureOfTC_TypeK(9.747e-3) expect 240.0 within 0.1 // TC_TypeK at 240C = 9.747mV'
whismanoid 59:c0376adb6ebc 1281 // @Test='@test group TC_2 TemperatureOfTC_TypeK(10.153e-3) expect 250.0 within 0.1 // TC_TypeK at 250C = 10.153mV'
whismanoid 59:c0376adb6ebc 1282 // @Test='@test group TC_2 TemperatureOfTC_TypeK(10.561e-3) expect 260.0 within 0.1 // TC_TypeK at 260C = 10.561mV'
whismanoid 59:c0376adb6ebc 1283 // @Test='@test group TC_2 TemperatureOfTC_TypeK(10.971e-3) expect 270.0 within 0.1 // TC_TypeK at 270C = 10.971mV'
whismanoid 59:c0376adb6ebc 1284 // @Test='@test group TC_2 TemperatureOfTC_TypeK(11.382e-3) expect 280.0 within 0.1 // TC_TypeK at 280C = 11.382mV'
whismanoid 59:c0376adb6ebc 1285 // @Test='@test group TC_2 TemperatureOfTC_TypeK(11.795e-3) expect 290.0 within 0.1 // TC_TypeK at 290C = 11.795mV'
whismanoid 59:c0376adb6ebc 1286 // @Test='@test group TC_1 TemperatureOfTC_TypeK(12.209e-3) expect 300.0 within 0.1 // TC_TypeK at 300C = 12.209mV'
whismanoid 59:c0376adb6ebc 1287 // @Test='@test group TC_2 TemperatureOfTC_TypeK(14.293e-3) expect 350.0 within 0.1 // TC_TypeK at 350C = 14.293mV'
whismanoid 59:c0376adb6ebc 1288 // @Test='@test group TC_1 TemperatureOfTC_TypeK(16.397e-3) expect 400.0 within 0.1 // TC_TypeK at 400C = 16.397mV'
whismanoid 59:c0376adb6ebc 1289 // @Test='@test group TC_1 TemperatureOfTC_TypeK(18.516e-3) expect 450.0 within 0.1 // TC_TypeK at 450C = 18.516mV'
whismanoid 59:c0376adb6ebc 1290 // @Test='@test group TC_1 TemperatureOfTC_TypeK(20.218e-3) expect 490.0 // TC_TypeK at 490C = 20.218mV'
whismanoid 59:c0376adb6ebc 1291 // @Test='@test tinyTester.blink_time_msec = 75 // default 75 resume hardware self test'
whismanoid 46:79dba7d4110c 1292 // parse argument list
whismanoid 46:79dba7d4110c 1293 // argname default_argvalue numeric literal specified in CommandDocParamIn @Param[in]='@param[in] tc_voltage = Thermocouple voltage in volts, default=0.0254'
whismanoid 46:79dba7d4110c 1294 // parse argument double tc_voltage
whismanoid 46:79dba7d4110c 1295 double tc_voltage = (double)0; // --- g_MAX11410_device.__WARNING_no_match_for_argname_tc_voltage_in_MAX11410_device_t__; // default to global property value
whismanoid 46:79dba7d4110c 1296 if (cmdLine.parse_double("tc_voltage", tc_voltage))
whismanoid 46:79dba7d4110c 1297 {
whismanoid 46:79dba7d4110c 1298 // g_MAX11410_device.__WARNING_no_match_for_argname_tc_voltage_in_MAX11410_device_t__ = tc_voltage; // update global property value
whismanoid 46:79dba7d4110c 1299 }
whismanoid 46:79dba7d4110c 1300 // print arguments
whismanoid 46:79dba7d4110c 1301 cmdLine.serial().printf("TemperatureOfTC_TypeK");
whismanoid 56:6e9c52cc9abe 1302 cmdLine.serial().printf(" tc_voltage=%f", tc_voltage);
whismanoid 46:79dba7d4110c 1303 cmdLine.serial().printf("\r\n");
whismanoid 46:79dba7d4110c 1304 // call function TemperatureOfTC_TypeK(tc_voltage)
whismanoid 46:79dba7d4110c 1305 double result = g_MAX11410_device.TemperatureOfTC_TypeK(tc_voltage);
whismanoid 46:79dba7d4110c 1306 cmdLine.serial().printf(" =%f\r\n", result);
whismanoid 46:79dba7d4110c 1307 return true; // command handled by MAX11410
whismanoid 49:5bfa51523bc2 1308 // CODE GENERATOR: bottom of loop: testMenuCommand="TK", testMenuFirstCharHandler="T"
whismanoid 46:79dba7d4110c 1309 } // end nested case 'TK'
whismanoid 46:79dba7d4110c 1310 break;
whismanoid 46:79dba7d4110c 1311
whismanoid 49:5bfa51523bc2 1312 // CODE GENERATOR: top of loop: testMenuCommand="TM", testMenuFirstCharHandler="T"
whismanoid 49:5bfa51523bc2 1313 // CODE GENERATOR: top of loop: nested switch "T" is currently open
whismanoid 46:79dba7d4110c 1314 // CODE GENERATOR: test menu case 'TM':
whismanoid 46:79dba7d4110c 1315 // CODE GENERATOR: helpString 'TM -- Measure_Thermocouple'
whismanoid 37:74aa97afa030 1316 // CODE GENERATOR: CMD_ 'None'
whismanoid 37:74aa97afa030 1317 // CODE GENERATOR: CommandName 'Measure_Thermocouple'
whismanoid 37:74aa97afa030 1318 // CODE GENERATOR: CommandParamIn 'MAX11410_AINP_SEL_enum_t tc_ainp, MAX11410_AINN_SEL_enum_t tc_ainn, MAX11410_AINP_SEL_enum_t rtd_iout, MAX11410_AINP_SEL_enum_t rtd_ainp, MAX11410_AINN_SEL_enum_t rtd_ainn'
whismanoid 37:74aa97afa030 1319 // CODE GENERATOR: CommandReturnType 'double'
whismanoid 37:74aa97afa030 1320 // CODE GENERATOR: CommandPre ''
whismanoid 37:74aa97afa030 1321 // CODE GENERATOR: CommandDocParamIn '@param[in] tc_ainp = channel of Thermocouple high side, default=AINP_SEL_0101_AIN5'
whismanoid 37:74aa97afa030 1322 // CODE GENERATOR: CommandDocParamIn '@param[in] tc_ainn = channel of Thermocouple low side, default=AINN_SEL_0110_AIN6'
whismanoid 37:74aa97afa030 1323 // CODE GENERATOR: CommandDocParamIn '@param[in] rtd_iout = channel RTD high side force, default=AINP_SEL_0111_AIN7'
whismanoid 37:74aa97afa030 1324 // CODE GENERATOR: CommandDocParamIn '@param[in] rtd_ainp = channel RTD high side sense, default=AINP_SEL_1000_AIN8'
whismanoid 37:74aa97afa030 1325 // CODE GENERATOR: CommandDocParamIn '@param[in] rtd_ainn = channel RTD low side, default=AINN_SEL_1001_AIN9'
whismanoid 37:74aa97afa030 1326 // CODE GENERATOR: CommandDocParamOut ''
whismanoid 37:74aa97afa030 1327 // CODE GENERATOR: CommandPost '@post AINcode[tc_ainp]: measurement result LSB code'
whismanoid 37:74aa97afa030 1328 // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure'
whismanoid 49:5bfa51523bc2 1329 case 'M': // (nested inside case 'T')
whismanoid 46:79dba7d4110c 1330 {
whismanoid 46:79dba7d4110c 1331 // test menu command 'TM' handler:
whismanoid 46:79dba7d4110c 1332 // helpString='TM -- Measure_Thermocouple'
whismanoid 37:74aa97afa030 1333 // CMD_='None'
whismanoid 37:74aa97afa030 1334 // CommandName='Measure_Thermocouple'
whismanoid 37:74aa97afa030 1335 // CommandParamIn='MAX11410_AINP_SEL_enum_t tc_ainp, MAX11410_AINN_SEL_enum_t tc_ainn, MAX11410_AINP_SEL_enum_t rtd_iout, MAX11410_AINP_SEL_enum_t rtd_ainp, MAX11410_AINN_SEL_enum_t rtd_ainn'
whismanoid 37:74aa97afa030 1336 // CommandReturnType='double'
whismanoid 37:74aa97afa030 1337 // @Pre=''
whismanoid 37:74aa97afa030 1338 // @Param[in]='@param[in] tc_ainp = channel of Thermocouple high side, default=AINP_SEL_0101_AIN5'
whismanoid 37:74aa97afa030 1339 // @Param[in]='@param[in] tc_ainn = channel of Thermocouple low side, default=AINN_SEL_0110_AIN6'
whismanoid 37:74aa97afa030 1340 // @Param[in]='@param[in] rtd_iout = channel RTD high side force, default=AINP_SEL_0111_AIN7'
whismanoid 37:74aa97afa030 1341 // @Param[in]='@param[in] rtd_ainp = channel RTD high side sense, default=AINP_SEL_1000_AIN8'
whismanoid 37:74aa97afa030 1342 // @Param[in]='@param[in] rtd_ainn = channel RTD low side, default=AINN_SEL_1001_AIN9'
whismanoid 37:74aa97afa030 1343 // @Param[out]=''
whismanoid 37:74aa97afa030 1344 // @Post='@post AINcode[tc_ainp]: measurement result LSB code'
whismanoid 48:2591fcdece5e 1345 // displayPost=''
whismanoid 37:74aa97afa030 1346 // @Return='@return 1 on success; 0 on failure'
whismanoid 37:74aa97afa030 1347 // parse argument list
whismanoid 37:74aa97afa030 1348 // argname default_argvalue symbolic enum name specified in CommandDocParamIn @Param[in]='@param[in] tc_ainp = channel of Thermocouple high side, default=AINP_SEL_0101_AIN5'
whismanoid 37:74aa97afa030 1349 // parse argument MAX11410::MAX11410_AINP_SEL_enum_t tc_ainp
whismanoid 37:74aa97afa030 1350 MAX11410::MAX11410_AINP_SEL_enum_t tc_ainp = MAX11410::AINP_SEL_0101_AIN5; // --- g_MAX11410_device.__WARNING_no_match_for_argname_tc_ainp_in_MAX11410_device_t__; // default to global property value
whismanoid 37:74aa97afa030 1351 if (cmdLine.parse_uint8_dec("tc_ainp", (uint8_t&)tc_ainp))
whismanoid 37:74aa97afa030 1352 {
whismanoid 37:74aa97afa030 1353 // g_MAX11410_device.__WARNING_no_match_for_argname_tc_ainp_in_MAX11410_device_t__ = tc_ainp; // update global property value
whismanoid 37:74aa97afa030 1354 }
whismanoid 37:74aa97afa030 1355 // argname default_argvalue symbolic enum name specified in CommandDocParamIn @Param[in]='@param[in] tc_ainn = channel of Thermocouple low side, default=AINN_SEL_0110_AIN6'
whismanoid 37:74aa97afa030 1356 // parse argument MAX11410::MAX11410_AINN_SEL_enum_t tc_ainn
whismanoid 37:74aa97afa030 1357 MAX11410::MAX11410_AINN_SEL_enum_t tc_ainn = MAX11410::AINN_SEL_0110_AIN6; // --- g_MAX11410_device.__WARNING_no_match_for_argname_tc_ainn_in_MAX11410_device_t__; // default to global property value
whismanoid 37:74aa97afa030 1358 if (cmdLine.parse_uint8_dec("tc_ainn", (uint8_t&)tc_ainn))
whismanoid 37:74aa97afa030 1359 {
whismanoid 37:74aa97afa030 1360 // g_MAX11410_device.__WARNING_no_match_for_argname_tc_ainn_in_MAX11410_device_t__ = tc_ainn; // update global property value
whismanoid 37:74aa97afa030 1361 }
whismanoid 37:74aa97afa030 1362 // argname default_argvalue symbolic enum name specified in CommandDocParamIn @Param[in]='@param[in] rtd_iout = channel RTD high side force, default=AINP_SEL_0111_AIN7'
whismanoid 37:74aa97afa030 1363 // parse argument MAX11410::MAX11410_AINP_SEL_enum_t rtd_iout
whismanoid 37:74aa97afa030 1364 MAX11410::MAX11410_AINP_SEL_enum_t rtd_iout = MAX11410::AINP_SEL_0111_AIN7; // --- g_MAX11410_device.__WARNING_no_match_for_argname_rtd_iout_in_MAX11410_device_t__; // default to global property value
whismanoid 37:74aa97afa030 1365 if (cmdLine.parse_uint8_dec("rtd_iout", (uint8_t&)rtd_iout))
whismanoid 37:74aa97afa030 1366 {
whismanoid 37:74aa97afa030 1367 // g_MAX11410_device.__WARNING_no_match_for_argname_rtd_iout_in_MAX11410_device_t__ = rtd_iout; // update global property value
whismanoid 37:74aa97afa030 1368 }
whismanoid 37:74aa97afa030 1369 // argname default_argvalue symbolic enum name specified in CommandDocParamIn @Param[in]='@param[in] rtd_ainp = channel RTD high side sense, default=AINP_SEL_1000_AIN8'
whismanoid 37:74aa97afa030 1370 // parse argument MAX11410::MAX11410_AINP_SEL_enum_t rtd_ainp
whismanoid 37:74aa97afa030 1371 MAX11410::MAX11410_AINP_SEL_enum_t rtd_ainp = MAX11410::AINP_SEL_1000_AIN8; // --- g_MAX11410_device.__WARNING_no_match_for_argname_rtd_ainp_in_MAX11410_device_t__; // default to global property value
whismanoid 37:74aa97afa030 1372 if (cmdLine.parse_uint8_dec("rtd_ainp", (uint8_t&)rtd_ainp))
whismanoid 37:74aa97afa030 1373 {
whismanoid 37:74aa97afa030 1374 // g_MAX11410_device.__WARNING_no_match_for_argname_rtd_ainp_in_MAX11410_device_t__ = rtd_ainp; // update global property value
whismanoid 37:74aa97afa030 1375 }
whismanoid 37:74aa97afa030 1376 // argname default_argvalue symbolic enum name specified in CommandDocParamIn @Param[in]='@param[in] rtd_ainn = channel RTD low side, default=AINN_SEL_1001_AIN9'
whismanoid 37:74aa97afa030 1377 // parse argument MAX11410::MAX11410_AINN_SEL_enum_t rtd_ainn
whismanoid 37:74aa97afa030 1378 MAX11410::MAX11410_AINN_SEL_enum_t rtd_ainn = MAX11410::AINN_SEL_1001_AIN9; // --- g_MAX11410_device.__WARNING_no_match_for_argname_rtd_ainn_in_MAX11410_device_t__; // default to global property value
whismanoid 37:74aa97afa030 1379 if (cmdLine.parse_uint8_dec("rtd_ainn", (uint8_t&)rtd_ainn))
whismanoid 37:74aa97afa030 1380 {
whismanoid 37:74aa97afa030 1381 // g_MAX11410_device.__WARNING_no_match_for_argname_rtd_ainn_in_MAX11410_device_t__ = rtd_ainn; // update global property value
whismanoid 37:74aa97afa030 1382 }
whismanoid 37:74aa97afa030 1383 // print arguments
whismanoid 37:74aa97afa030 1384 cmdLine.serial().printf("Measure_Thermocouple");
whismanoid 37:74aa97afa030 1385 cmdLine.serial().printf(" tc_ainp=%d", tc_ainp);
whismanoid 37:74aa97afa030 1386 cmdLine.serial().printf(" tc_ainn=%d", tc_ainn);
whismanoid 37:74aa97afa030 1387 cmdLine.serial().printf(" rtd_iout=%d", rtd_iout);
whismanoid 37:74aa97afa030 1388 cmdLine.serial().printf(" rtd_ainp=%d", rtd_ainp);
whismanoid 37:74aa97afa030 1389 cmdLine.serial().printf(" rtd_ainn=%d", rtd_ainn);
whismanoid 37:74aa97afa030 1390 cmdLine.serial().printf(" Measure_Thermocouple"); // unique suffix
whismanoid 37:74aa97afa030 1391 cmdLine.serial().printf("\r\n");
whismanoid 37:74aa97afa030 1392 // call function Measure_Thermocouple(tc_ainp, tc_ainn, rtd_iout, rtd_ainp, rtd_ainn)
whismanoid 37:74aa97afa030 1393 double result = g_MAX11410_device.Measure_Thermocouple(tc_ainp, tc_ainn, rtd_iout, rtd_ainp, rtd_ainn);
whismanoid 45:8af4549476aa 1394 cmdLine.serial().printf(" =%f\r\n", result);
whismanoid 37:74aa97afa030 1395 return true; // command handled by MAX11410
whismanoid 49:5bfa51523bc2 1396 // CODE GENERATOR: bottom of loop: testMenuCommand="TM", testMenuFirstCharHandler="T"
whismanoid 46:79dba7d4110c 1397 } // end nested case 'TM'
whismanoid 46:79dba7d4110c 1398 break;
whismanoid 37:74aa97afa030 1399
whismanoid 49:5bfa51523bc2 1400 // CODE GENERATOR: top of loop: testMenuCommand="V", testMenuFirstCharHandler="T"
whismanoid 49:5bfa51523bc2 1401 // CODE GENERATOR: top of loop: nested switch "T" is currently open
whismanoid 49:5bfa51523bc2 1402 // CODE GENERATOR: top of loop: need to close nested switch "T"
whismanoid 49:5bfa51523bc2 1403 } // end nested switch (cmdLine[1]) inside case 'T'
whismanoid 49:5bfa51523bc2 1404 break;
whismanoid 49:5bfa51523bc2 1405 } // end case 'T'
whismanoid 37:74aa97afa030 1406 // CODE GENERATOR: test menu case 'V':
whismanoid 37:74aa97afa030 1407 // CODE GENERATOR: helpString 'V -- Measure_Voltage'
whismanoid 37:74aa97afa030 1408 // CODE GENERATOR: CMD_ 'None'
whismanoid 37:74aa97afa030 1409 // CODE GENERATOR: CommandName 'Measure_Voltage'
whismanoid 37:74aa97afa030 1410 // CODE GENERATOR: CommandParamIn 'MAX11410_AINP_SEL_enum_t ainp, MAX11410_AINN_SEL_enum_t ainn'
whismanoid 37:74aa97afa030 1411 // CODE GENERATOR: CommandReturnType 'double'
whismanoid 37:74aa97afa030 1412 // CODE GENERATOR: CommandPre '@pre external connection REF2P-REF2N is a reference voltage'
whismanoid 37:74aa97afa030 1413 // CODE GENERATOR: CommandPre '@pre VRef = Voltage of REF input, in Volts'
whismanoid 37:74aa97afa030 1414 // CODE GENERATOR: CommandDocParamIn '@param[in] ainp = channel high side, default=AINP_SEL_0000_AIN0'
whismanoid 37:74aa97afa030 1415 // CODE GENERATOR: CommandDocParamIn '@param[in] ainn = channel low side, default=AINN_SEL_1010_GND'
whismanoid 37:74aa97afa030 1416 // CODE GENERATOR: CommandDocParamOut ''
whismanoid 37:74aa97afa030 1417 // CODE GENERATOR: CommandPost '@post AINcode[ainp]: measurement result LSB code'
whismanoid 37:74aa97afa030 1418 // CODE GENERATOR: CommandReturn '@return ideal voltage calculated from raw LSB code and reference voltage'
whismanoid 49:5bfa51523bc2 1419 // case 'V': // (single character) (testMenuFirstCharHandler="None")
whismanoid 37:74aa97afa030 1420 case 'V':
whismanoid 37:74aa97afa030 1421 {
whismanoid 37:74aa97afa030 1422 // test menu command 'V' handler:
whismanoid 37:74aa97afa030 1423 // helpString='V -- Measure_Voltage'
whismanoid 37:74aa97afa030 1424 // CMD_='None'
whismanoid 37:74aa97afa030 1425 // CommandName='Measure_Voltage'
whismanoid 37:74aa97afa030 1426 // CommandParamIn='MAX11410_AINP_SEL_enum_t ainp, MAX11410_AINN_SEL_enum_t ainn'
whismanoid 37:74aa97afa030 1427 // CommandReturnType='double'
whismanoid 37:74aa97afa030 1428 // @Pre='@pre external connection REF2P-REF2N is a reference voltage'
whismanoid 37:74aa97afa030 1429 // @Pre='@pre VRef = Voltage of REF input, in Volts'
whismanoid 37:74aa97afa030 1430 // @Param[in]='@param[in] ainp = channel high side, default=AINP_SEL_0000_AIN0'
whismanoid 37:74aa97afa030 1431 // @Param[in]='@param[in] ainn = channel low side, default=AINN_SEL_1010_GND'
whismanoid 37:74aa97afa030 1432 // @Param[out]=''
whismanoid 37:74aa97afa030 1433 // @Post='@post AINcode[ainp]: measurement result LSB code'
whismanoid 48:2591fcdece5e 1434 // displayPost=''
whismanoid 37:74aa97afa030 1435 // @Return='@return ideal voltage calculated from raw LSB code and reference voltage'
whismanoid 37:74aa97afa030 1436 // parse argument list
whismanoid 37:74aa97afa030 1437 // argname default_argvalue symbolic enum name specified in CommandDocParamIn @Param[in]='@param[in] ainp = channel high side, default=AINP_SEL_0000_AIN0'
whismanoid 37:74aa97afa030 1438 // parse argument MAX11410::MAX11410_AINP_SEL_enum_t ainp
whismanoid 37:74aa97afa030 1439 MAX11410::MAX11410_AINP_SEL_enum_t ainp = MAX11410::AINP_SEL_0000_AIN0; // --- g_MAX11410_device.__WARNING_no_match_for_argname_ainp_in_MAX11410_device_t__; // default to global property value
whismanoid 37:74aa97afa030 1440 if (cmdLine.parse_uint8_dec("ainp", (uint8_t&)ainp))
whismanoid 37:74aa97afa030 1441 {
whismanoid 37:74aa97afa030 1442 // g_MAX11410_device.__WARNING_no_match_for_argname_ainp_in_MAX11410_device_t__ = ainp; // update global property value
whismanoid 37:74aa97afa030 1443 }
whismanoid 37:74aa97afa030 1444 // argname default_argvalue symbolic enum name specified in CommandDocParamIn @Param[in]='@param[in] ainn = channel low side, default=AINN_SEL_1010_GND'
whismanoid 37:74aa97afa030 1445 // parse argument MAX11410::MAX11410_AINN_SEL_enum_t ainn
whismanoid 37:74aa97afa030 1446 MAX11410::MAX11410_AINN_SEL_enum_t ainn = MAX11410::AINN_SEL_1010_GND; // --- g_MAX11410_device.__WARNING_no_match_for_argname_ainn_in_MAX11410_device_t__; // default to global property value
whismanoid 37:74aa97afa030 1447 if (cmdLine.parse_uint8_dec("ainn", (uint8_t&)ainn))
whismanoid 37:74aa97afa030 1448 {
whismanoid 37:74aa97afa030 1449 // g_MAX11410_device.__WARNING_no_match_for_argname_ainn_in_MAX11410_device_t__ = ainn; // update global property value
whismanoid 37:74aa97afa030 1450 }
whismanoid 37:74aa97afa030 1451 // print arguments
whismanoid 37:74aa97afa030 1452 cmdLine.serial().printf("Measure_Voltage");
whismanoid 37:74aa97afa030 1453 cmdLine.serial().printf(" ainp=%d", ainp);
whismanoid 37:74aa97afa030 1454 cmdLine.serial().printf(" ainn=%d", ainn);
whismanoid 37:74aa97afa030 1455 cmdLine.serial().printf(" Measure_Voltage"); // unique suffix
whismanoid 37:74aa97afa030 1456 cmdLine.serial().printf("\r\n");
whismanoid 37:74aa97afa030 1457 // call function Measure_Voltage(ainp, ainn)
whismanoid 37:74aa97afa030 1458 double result = g_MAX11410_device.Measure_Voltage(ainp, ainn);
whismanoid 45:8af4549476aa 1459 cmdLine.serial().printf(" =%f\r\n", result);
whismanoid 37:74aa97afa030 1460 return true; // command handled by MAX11410
whismanoid 49:5bfa51523bc2 1461 // CODE GENERATOR: bottom of loop: testMenuCommand="V", testMenuFirstCharHandler="None"
whismanoid 37:74aa97afa030 1462 } // end case 'V'
whismanoid 37:74aa97afa030 1463 break;
whismanoid 37:74aa97afa030 1464
whismanoid 49:5bfa51523bc2 1465 // CODE GENERATOR: top of loop: testMenuCommand="X0", testMenuFirstCharHandler="None"
whismanoid 37:74aa97afa030 1466 // CODE GENERATOR: test menu case 'X0':
whismanoid 37:74aa97afa030 1467 // CODE GENERATOR: helpString 'X0 -- Calibrate_Self_Offset_Gain'
whismanoid 37:74aa97afa030 1468 // CODE GENERATOR: CMD_ 'None'
whismanoid 37:74aa97afa030 1469 // CODE GENERATOR: CommandName 'Calibrate_Self_Offset_Gain'
whismanoid 37:74aa97afa030 1470 // CODE GENERATOR: CommandParamIn 'void'
whismanoid 37:74aa97afa030 1471 // CODE GENERATOR: CommandReturnType 'uint8_t'
whismanoid 37:74aa97afa030 1472 // CODE GENERATOR: CommandPre ''
whismanoid 37:74aa97afa030 1473 // CODE GENERATOR: CommandDocParamIn ''
whismanoid 37:74aa97afa030 1474 // CODE GENERATOR: CommandDocParamOut ''
whismanoid 37:74aa97afa030 1475 // CODE GENERATOR: CommandPost ''
whismanoid 37:74aa97afa030 1476 // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure'
whismanoid 49:5bfa51523bc2 1477 case 'X': // (multiple characters) (testMenuFirstCharHandler="X"):
whismanoid 37:74aa97afa030 1478 {
whismanoid 37:74aa97afa030 1479 switch (cmdLine[1])
whismanoid 37:74aa97afa030 1480 {
whismanoid 49:5bfa51523bc2 1481 case '0': // (nested inside case 'X')
whismanoid 37:74aa97afa030 1482 {
whismanoid 37:74aa97afa030 1483 // test menu command 'X0' handler:
whismanoid 37:74aa97afa030 1484 // helpString='X0 -- Calibrate_Self_Offset_Gain'
whismanoid 37:74aa97afa030 1485 // CMD_='None'
whismanoid 37:74aa97afa030 1486 // CommandName='Calibrate_Self_Offset_Gain'
whismanoid 37:74aa97afa030 1487 // CommandParamIn='void'
whismanoid 37:74aa97afa030 1488 // CommandReturnType='uint8_t'
whismanoid 37:74aa97afa030 1489 // @Pre=''
whismanoid 37:74aa97afa030 1490 // @Param[in]=''
whismanoid 37:74aa97afa030 1491 // @Param[out]=''
whismanoid 37:74aa97afa030 1492 // @Post=''
whismanoid 48:2591fcdece5e 1493 // displayPost=''
whismanoid 37:74aa97afa030 1494 // @Return='@return 1 on success; 0 on failure'
whismanoid 37:74aa97afa030 1495 cmdLine.serial().printf("Calibrate_Self_Offset_Gain");
whismanoid 37:74aa97afa030 1496 // call function Calibrate_Self_Offset_Gain
whismanoid 37:74aa97afa030 1497 uint8_t result = g_MAX11410_device.Calibrate_Self_Offset_Gain();
whismanoid 54:ba810c1d6264 1498 cmdLine.serial().printf(" =%d\r\n", result);
whismanoid 37:74aa97afa030 1499 return true; // command handled by MAX11410
whismanoid 49:5bfa51523bc2 1500 // CODE GENERATOR: bottom of loop: testMenuCommand="X0", testMenuFirstCharHandler="X"
whismanoid 37:74aa97afa030 1501 } // end nested case 'X0'
whismanoid 37:74aa97afa030 1502 break;
whismanoid 37:74aa97afa030 1503
whismanoid 49:5bfa51523bc2 1504 // CODE GENERATOR: top of loop: testMenuCommand="X1", testMenuFirstCharHandler="X"
whismanoid 49:5bfa51523bc2 1505 // CODE GENERATOR: top of loop: nested switch "X" is currently open
whismanoid 37:74aa97afa030 1506 // CODE GENERATOR: test menu case 'X1':
whismanoid 37:74aa97afa030 1507 // CODE GENERATOR: helpString 'X1 -- Calibrate_PGA_Gain'
whismanoid 37:74aa97afa030 1508 // CODE GENERATOR: CMD_ 'None'
whismanoid 37:74aa97afa030 1509 // CODE GENERATOR: CommandName 'Calibrate_PGA_Gain'
whismanoid 37:74aa97afa030 1510 // CODE GENERATOR: CommandParamIn 'void'
whismanoid 37:74aa97afa030 1511 // CODE GENERATOR: CommandReturnType 'uint8_t'
whismanoid 37:74aa97afa030 1512 // CODE GENERATOR: CommandPre ''
whismanoid 37:74aa97afa030 1513 // CODE GENERATOR: CommandDocParamIn ''
whismanoid 37:74aa97afa030 1514 // CODE GENERATOR: CommandDocParamOut ''
whismanoid 37:74aa97afa030 1515 // CODE GENERATOR: CommandPost ''
whismanoid 37:74aa97afa030 1516 // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure'
whismanoid 49:5bfa51523bc2 1517 case '1': // (nested inside case 'X')
whismanoid 37:74aa97afa030 1518 {
whismanoid 37:74aa97afa030 1519 // test menu command 'X1' handler:
whismanoid 37:74aa97afa030 1520 // helpString='X1 -- Calibrate_PGA_Gain'
whismanoid 37:74aa97afa030 1521 // CMD_='None'
whismanoid 37:74aa97afa030 1522 // CommandName='Calibrate_PGA_Gain'
whismanoid 37:74aa97afa030 1523 // CommandParamIn='void'
whismanoid 37:74aa97afa030 1524 // CommandReturnType='uint8_t'
whismanoid 37:74aa97afa030 1525 // @Pre=''
whismanoid 37:74aa97afa030 1526 // @Param[in]=''
whismanoid 37:74aa97afa030 1527 // @Param[out]=''
whismanoid 37:74aa97afa030 1528 // @Post=''
whismanoid 48:2591fcdece5e 1529 // displayPost=''
whismanoid 37:74aa97afa030 1530 // @Return='@return 1 on success; 0 on failure'
whismanoid 37:74aa97afa030 1531 cmdLine.serial().printf("Calibrate_PGA_Gain");
whismanoid 37:74aa97afa030 1532 // call function Calibrate_PGA_Gain
whismanoid 37:74aa97afa030 1533 uint8_t result = g_MAX11410_device.Calibrate_PGA_Gain();
whismanoid 54:ba810c1d6264 1534 cmdLine.serial().printf(" =%d\r\n", result);
whismanoid 37:74aa97afa030 1535 return true; // command handled by MAX11410
whismanoid 49:5bfa51523bc2 1536 // CODE GENERATOR: bottom of loop: testMenuCommand="X1", testMenuFirstCharHandler="X"
whismanoid 37:74aa97afa030 1537 } // end nested case 'X1'
whismanoid 37:74aa97afa030 1538 break;
whismanoid 37:74aa97afa030 1539
whismanoid 49:5bfa51523bc2 1540 // CODE GENERATOR: top of loop: testMenuCommand="X4", testMenuFirstCharHandler="X"
whismanoid 49:5bfa51523bc2 1541 // CODE GENERATOR: top of loop: nested switch "X" is currently open
whismanoid 37:74aa97afa030 1542 // CODE GENERATOR: test menu case 'X4':
whismanoid 37:74aa97afa030 1543 // CODE GENERATOR: helpString 'X4 -- Calibrate_System_Offset_A'
whismanoid 37:74aa97afa030 1544 // CODE GENERATOR: CMD_ 'None'
whismanoid 37:74aa97afa030 1545 // CODE GENERATOR: CommandName 'Calibrate_System_Offset_A'
whismanoid 37:74aa97afa030 1546 // CODE GENERATOR: CommandParamIn 'void'
whismanoid 37:74aa97afa030 1547 // CODE GENERATOR: CommandReturnType 'uint8_t'
whismanoid 37:74aa97afa030 1548 // CODE GENERATOR: CommandPre ''
whismanoid 37:74aa97afa030 1549 // CODE GENERATOR: CommandDocParamIn ''
whismanoid 37:74aa97afa030 1550 // CODE GENERATOR: CommandDocParamOut ''
whismanoid 37:74aa97afa030 1551 // CODE GENERATOR: CommandPost ''
whismanoid 37:74aa97afa030 1552 // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure'
whismanoid 49:5bfa51523bc2 1553 case '4': // (nested inside case 'X')
whismanoid 37:74aa97afa030 1554 {
whismanoid 37:74aa97afa030 1555 // test menu command 'X4' handler:
whismanoid 37:74aa97afa030 1556 // helpString='X4 -- Calibrate_System_Offset_A'
whismanoid 37:74aa97afa030 1557 // CMD_='None'
whismanoid 37:74aa97afa030 1558 // CommandName='Calibrate_System_Offset_A'
whismanoid 37:74aa97afa030 1559 // CommandParamIn='void'
whismanoid 37:74aa97afa030 1560 // CommandReturnType='uint8_t'
whismanoid 37:74aa97afa030 1561 // @Pre=''
whismanoid 37:74aa97afa030 1562 // @Param[in]=''
whismanoid 37:74aa97afa030 1563 // @Param[out]=''
whismanoid 37:74aa97afa030 1564 // @Post=''
whismanoid 48:2591fcdece5e 1565 // displayPost=''
whismanoid 37:74aa97afa030 1566 // @Return='@return 1 on success; 0 on failure'
whismanoid 37:74aa97afa030 1567 cmdLine.serial().printf("Calibrate_System_Offset_A");
whismanoid 37:74aa97afa030 1568 // call function Calibrate_System_Offset_A
whismanoid 37:74aa97afa030 1569 uint8_t result = g_MAX11410_device.Calibrate_System_Offset_A();
whismanoid 54:ba810c1d6264 1570 cmdLine.serial().printf(" =%d\r\n", result);
whismanoid 37:74aa97afa030 1571 return true; // command handled by MAX11410
whismanoid 49:5bfa51523bc2 1572 // CODE GENERATOR: bottom of loop: testMenuCommand="X4", testMenuFirstCharHandler="X"
whismanoid 37:74aa97afa030 1573 } // end nested case 'X4'
whismanoid 37:74aa97afa030 1574 break;
whismanoid 37:74aa97afa030 1575
whismanoid 49:5bfa51523bc2 1576 // CODE GENERATOR: top of loop: testMenuCommand="X5", testMenuFirstCharHandler="X"
whismanoid 49:5bfa51523bc2 1577 // CODE GENERATOR: top of loop: nested switch "X" is currently open
whismanoid 37:74aa97afa030 1578 // CODE GENERATOR: test menu case 'X5':
whismanoid 37:74aa97afa030 1579 // CODE GENERATOR: helpString 'X5 -- Calibrate_System_Gain_A'
whismanoid 37:74aa97afa030 1580 // CODE GENERATOR: CMD_ 'None'
whismanoid 37:74aa97afa030 1581 // CODE GENERATOR: CommandName 'Calibrate_System_Gain_A'
whismanoid 37:74aa97afa030 1582 // CODE GENERATOR: CommandParamIn 'void'
whismanoid 37:74aa97afa030 1583 // CODE GENERATOR: CommandReturnType 'uint8_t'
whismanoid 37:74aa97afa030 1584 // CODE GENERATOR: CommandPre ''
whismanoid 37:74aa97afa030 1585 // CODE GENERATOR: CommandDocParamIn ''
whismanoid 37:74aa97afa030 1586 // CODE GENERATOR: CommandDocParamOut ''
whismanoid 37:74aa97afa030 1587 // CODE GENERATOR: CommandPost ''
whismanoid 37:74aa97afa030 1588 // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure'
whismanoid 49:5bfa51523bc2 1589 case '5': // (nested inside case 'X')
whismanoid 37:74aa97afa030 1590 {
whismanoid 37:74aa97afa030 1591 // test menu command 'X5' handler:
whismanoid 37:74aa97afa030 1592 // helpString='X5 -- Calibrate_System_Gain_A'
whismanoid 37:74aa97afa030 1593 // CMD_='None'
whismanoid 37:74aa97afa030 1594 // CommandName='Calibrate_System_Gain_A'
whismanoid 37:74aa97afa030 1595 // CommandParamIn='void'
whismanoid 37:74aa97afa030 1596 // CommandReturnType='uint8_t'
whismanoid 37:74aa97afa030 1597 // @Pre=''
whismanoid 37:74aa97afa030 1598 // @Param[in]=''
whismanoid 37:74aa97afa030 1599 // @Param[out]=''
whismanoid 37:74aa97afa030 1600 // @Post=''
whismanoid 48:2591fcdece5e 1601 // displayPost=''
whismanoid 37:74aa97afa030 1602 // @Return='@return 1 on success; 0 on failure'
whismanoid 37:74aa97afa030 1603 cmdLine.serial().printf("Calibrate_System_Gain_A");
whismanoid 37:74aa97afa030 1604 // call function Calibrate_System_Gain_A
whismanoid 37:74aa97afa030 1605 uint8_t result = g_MAX11410_device.Calibrate_System_Gain_A();
whismanoid 54:ba810c1d6264 1606 cmdLine.serial().printf(" =%d\r\n", result);
whismanoid 37:74aa97afa030 1607 return true; // command handled by MAX11410
whismanoid 49:5bfa51523bc2 1608 // CODE GENERATOR: bottom of loop: testMenuCommand="X5", testMenuFirstCharHandler="X"
whismanoid 37:74aa97afa030 1609 } // end nested case 'X5'
whismanoid 37:74aa97afa030 1610 break;
whismanoid 37:74aa97afa030 1611
whismanoid 49:5bfa51523bc2 1612 // CODE GENERATOR: top of loop: testMenuCommand="X6", testMenuFirstCharHandler="X"
whismanoid 49:5bfa51523bc2 1613 // CODE GENERATOR: top of loop: nested switch "X" is currently open
whismanoid 37:74aa97afa030 1614 // CODE GENERATOR: test menu case 'X6':
whismanoid 37:74aa97afa030 1615 // CODE GENERATOR: helpString 'X6 -- Calibrate_System_Offset_B'
whismanoid 37:74aa97afa030 1616 // CODE GENERATOR: CMD_ 'None'
whismanoid 37:74aa97afa030 1617 // CODE GENERATOR: CommandName 'Calibrate_System_Offset_B'
whismanoid 37:74aa97afa030 1618 // CODE GENERATOR: CommandParamIn 'void'
whismanoid 37:74aa97afa030 1619 // CODE GENERATOR: CommandReturnType 'uint8_t'
whismanoid 37:74aa97afa030 1620 // CODE GENERATOR: CommandPre ''
whismanoid 37:74aa97afa030 1621 // CODE GENERATOR: CommandDocParamIn ''
whismanoid 37:74aa97afa030 1622 // CODE GENERATOR: CommandDocParamOut ''
whismanoid 37:74aa97afa030 1623 // CODE GENERATOR: CommandPost ''
whismanoid 37:74aa97afa030 1624 // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure'
whismanoid 49:5bfa51523bc2 1625 case '6': // (nested inside case 'X')
whismanoid 37:74aa97afa030 1626 {
whismanoid 37:74aa97afa030 1627 // test menu command 'X6' handler:
whismanoid 37:74aa97afa030 1628 // helpString='X6 -- Calibrate_System_Offset_B'
whismanoid 37:74aa97afa030 1629 // CMD_='None'
whismanoid 37:74aa97afa030 1630 // CommandName='Calibrate_System_Offset_B'
whismanoid 37:74aa97afa030 1631 // CommandParamIn='void'
whismanoid 37:74aa97afa030 1632 // CommandReturnType='uint8_t'
whismanoid 37:74aa97afa030 1633 // @Pre=''
whismanoid 37:74aa97afa030 1634 // @Param[in]=''
whismanoid 37:74aa97afa030 1635 // @Param[out]=''
whismanoid 37:74aa97afa030 1636 // @Post=''
whismanoid 48:2591fcdece5e 1637 // displayPost=''
whismanoid 37:74aa97afa030 1638 // @Return='@return 1 on success; 0 on failure'
whismanoid 37:74aa97afa030 1639 cmdLine.serial().printf("Calibrate_System_Offset_B");
whismanoid 37:74aa97afa030 1640 // call function Calibrate_System_Offset_B
whismanoid 37:74aa97afa030 1641 uint8_t result = g_MAX11410_device.Calibrate_System_Offset_B();
whismanoid 54:ba810c1d6264 1642 cmdLine.serial().printf(" =%d\r\n", result);
whismanoid 37:74aa97afa030 1643 return true; // command handled by MAX11410
whismanoid 49:5bfa51523bc2 1644 // CODE GENERATOR: bottom of loop: testMenuCommand="X6", testMenuFirstCharHandler="X"
whismanoid 37:74aa97afa030 1645 } // end nested case 'X6'
whismanoid 37:74aa97afa030 1646 break;
whismanoid 37:74aa97afa030 1647
whismanoid 49:5bfa51523bc2 1648 // CODE GENERATOR: top of loop: testMenuCommand="X7", testMenuFirstCharHandler="X"
whismanoid 49:5bfa51523bc2 1649 // CODE GENERATOR: top of loop: nested switch "X" is currently open
whismanoid 37:74aa97afa030 1650 // CODE GENERATOR: test menu case 'X7':
whismanoid 37:74aa97afa030 1651 // CODE GENERATOR: helpString 'X7 -- Calibrate_System_Gain_B'
whismanoid 37:74aa97afa030 1652 // CODE GENERATOR: CMD_ 'None'
whismanoid 37:74aa97afa030 1653 // CODE GENERATOR: CommandName 'Calibrate_System_Gain_B'
whismanoid 37:74aa97afa030 1654 // CODE GENERATOR: CommandParamIn 'void'
whismanoid 37:74aa97afa030 1655 // CODE GENERATOR: CommandReturnType 'uint8_t'
whismanoid 37:74aa97afa030 1656 // CODE GENERATOR: CommandPre ''
whismanoid 37:74aa97afa030 1657 // CODE GENERATOR: CommandDocParamIn ''
whismanoid 37:74aa97afa030 1658 // CODE GENERATOR: CommandDocParamOut ''
whismanoid 37:74aa97afa030 1659 // CODE GENERATOR: CommandPost ''
whismanoid 37:74aa97afa030 1660 // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure'
whismanoid 49:5bfa51523bc2 1661 case '7': // (nested inside case 'X')
whismanoid 37:74aa97afa030 1662 {
whismanoid 37:74aa97afa030 1663 // test menu command 'X7' handler:
whismanoid 37:74aa97afa030 1664 // helpString='X7 -- Calibrate_System_Gain_B'
whismanoid 37:74aa97afa030 1665 // CMD_='None'
whismanoid 37:74aa97afa030 1666 // CommandName='Calibrate_System_Gain_B'
whismanoid 37:74aa97afa030 1667 // CommandParamIn='void'
whismanoid 37:74aa97afa030 1668 // CommandReturnType='uint8_t'
whismanoid 37:74aa97afa030 1669 // @Pre=''
whismanoid 37:74aa97afa030 1670 // @Param[in]=''
whismanoid 37:74aa97afa030 1671 // @Param[out]=''
whismanoid 37:74aa97afa030 1672 // @Post=''
whismanoid 48:2591fcdece5e 1673 // displayPost=''
whismanoid 37:74aa97afa030 1674 // @Return='@return 1 on success; 0 on failure'
whismanoid 37:74aa97afa030 1675 cmdLine.serial().printf("Calibrate_System_Gain_B");
whismanoid 37:74aa97afa030 1676 // call function Calibrate_System_Gain_B
whismanoid 37:74aa97afa030 1677 uint8_t result = g_MAX11410_device.Calibrate_System_Gain_B();
whismanoid 54:ba810c1d6264 1678 cmdLine.serial().printf(" =%d\r\n", result);
whismanoid 37:74aa97afa030 1679 return true; // command handled by MAX11410
whismanoid 49:5bfa51523bc2 1680 // CODE GENERATOR: bottom of loop: testMenuCommand="X7", testMenuFirstCharHandler="X"
whismanoid 37:74aa97afa030 1681 } // end nested case 'X7'
whismanoid 37:74aa97afa030 1682 break;
whismanoid 37:74aa97afa030 1683
whismanoid 49:5bfa51523bc2 1684 // CODE GENERATOR: top of loop: testMenuCommand="XC", testMenuFirstCharHandler="X"
whismanoid 49:5bfa51523bc2 1685 // CODE GENERATOR: top of loop: nested switch "X" is currently open
whismanoid 37:74aa97afa030 1686 // CODE GENERATOR: test menu case 'XC':
whismanoid 37:74aa97afa030 1687 // CODE GENERATOR: helpString 'XC extclk=? u_bn=? format=? refbufp_en=? refbufn_en=? ref_sel=? -- Configure_CTRL'
whismanoid 37:74aa97afa030 1688 // CODE GENERATOR: CMD_ 'None'
whismanoid 37:74aa97afa030 1689 // CODE GENERATOR: CommandName 'Configure_CTRL'
whismanoid 37:74aa97afa030 1690 // CODE GENERATOR: CommandParamIn 'uint8_t extclk, uint8_t u_bn, uint8_t format, uint8_t refbufp_en, uint8_t refbufn_en, uint8_t ref_sel'
whismanoid 37:74aa97afa030 1691 // CODE GENERATOR: CommandReturnType 'uint8_t'
whismanoid 37:74aa97afa030 1692 // CODE GENERATOR: CommandPre ''
whismanoid 37:74aa97afa030 1693 // CODE GENERATOR: CommandDocParamIn '@param[in] extclk = external clock enable, default=0'
whismanoid 37:74aa97afa030 1694 // CODE GENERATOR: CommandDocParamIn '@param[in] u_bn = unipolar input range enable, default=0'
whismanoid 37:74aa97afa030 1695 // CODE GENERATOR: CommandDocParamIn '@param[in] format = offset binary format enable, default=0'
whismanoid 37:74aa97afa030 1696 // CODE GENERATOR: CommandDocParamIn '@param[in] refbufp_en = REFP reference buffer enable, default=0'
whismanoid 37:74aa97afa030 1697 // CODE GENERATOR: CommandDocParamIn '@param[in] refbufn_en = REFN reference buffer enable, default=0'
whismanoid 37:74aa97afa030 1698 // CODE GENERATOR: CommandDocParamIn '@param[in] ref_sel = reference selection, default=MAX11410::MAX11410_REF_SEL_enum_t::REF_SEL_001_REF1P_REF1N'
whismanoid 37:74aa97afa030 1699 // CODE GENERATOR: CommandDocParamOut ''
whismanoid 37:74aa97afa030 1700 // CODE GENERATOR: CommandPost ''
whismanoid 37:74aa97afa030 1701 // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure'
whismanoid 49:5bfa51523bc2 1702 case 'C': // (nested inside case 'X')
whismanoid 37:74aa97afa030 1703 {
whismanoid 37:74aa97afa030 1704 // test menu command 'XC' handler:
whismanoid 37:74aa97afa030 1705 // helpString='XC extclk=? u_bn=? format=? refbufp_en=? refbufn_en=? ref_sel=? -- Configure_CTRL'
whismanoid 37:74aa97afa030 1706 // CMD_='None'
whismanoid 37:74aa97afa030 1707 // CommandName='Configure_CTRL'
whismanoid 37:74aa97afa030 1708 // CommandParamIn='uint8_t extclk, uint8_t u_bn, uint8_t format, uint8_t refbufp_en, uint8_t refbufn_en, uint8_t ref_sel'
whismanoid 37:74aa97afa030 1709 // CommandReturnType='uint8_t'
whismanoid 37:74aa97afa030 1710 // @Pre=''
whismanoid 37:74aa97afa030 1711 // @Param[in]='@param[in] extclk = external clock enable, default=0'
whismanoid 37:74aa97afa030 1712 // @Param[in]='@param[in] u_bn = unipolar input range enable, default=0'
whismanoid 37:74aa97afa030 1713 // @Param[in]='@param[in] format = offset binary format enable, default=0'
whismanoid 37:74aa97afa030 1714 // @Param[in]='@param[in] refbufp_en = REFP reference buffer enable, default=0'
whismanoid 37:74aa97afa030 1715 // @Param[in]='@param[in] refbufn_en = REFN reference buffer enable, default=0'
whismanoid 37:74aa97afa030 1716 // @Param[in]='@param[in] ref_sel = reference selection, default=MAX11410::MAX11410_REF_SEL_enum_t::REF_SEL_001_REF1P_REF1N'
whismanoid 37:74aa97afa030 1717 // @Param[out]=''
whismanoid 37:74aa97afa030 1718 // @Post=''
whismanoid 48:2591fcdece5e 1719 // displayPost=''
whismanoid 37:74aa97afa030 1720 // @Return='@return 1 on success; 0 on failure'
whismanoid 37:74aa97afa030 1721 // parse argument list
whismanoid 37:74aa97afa030 1722 // argname default_argvalue numeric literal specified in CommandDocParamIn @Param[in]='@param[in] extclk = external clock enable, default=0'
whismanoid 37:74aa97afa030 1723 // parse argument uint8_t extclk
whismanoid 37:74aa97afa030 1724 uint8_t extclk = (uint8_t)0; // --- g_MAX11410_device.__WARNING_no_match_for_argname_extclk_in_MAX11410_device_t__; // default to global property value
whismanoid 37:74aa97afa030 1725 if (cmdLine.parse_uint8_dec("extclk", extclk))
whismanoid 37:74aa97afa030 1726 {
whismanoid 37:74aa97afa030 1727 // g_MAX11410_device.__WARNING_no_match_for_argname_extclk_in_MAX11410_device_t__ = extclk; // update global property value
whismanoid 37:74aa97afa030 1728 }
whismanoid 37:74aa97afa030 1729 // argname default_argvalue numeric literal specified in CommandDocParamIn @Param[in]='@param[in] u_bn = unipolar input range enable, default=0'
whismanoid 37:74aa97afa030 1730 // parse argument uint8_t u_bn
whismanoid 37:74aa97afa030 1731 uint8_t u_bn = (uint8_t)0; // --- g_MAX11410_device.__WARNING_no_match_for_argname_u_bn_in_MAX11410_device_t__; // default to global property value
whismanoid 37:74aa97afa030 1732 if (cmdLine.parse_uint8_dec("u_bn", u_bn))
whismanoid 37:74aa97afa030 1733 {
whismanoid 37:74aa97afa030 1734 // g_MAX11410_device.__WARNING_no_match_for_argname_u_bn_in_MAX11410_device_t__ = u_bn; // update global property value
whismanoid 37:74aa97afa030 1735 }
whismanoid 37:74aa97afa030 1736 // argname default_argvalue numeric literal specified in CommandDocParamIn @Param[in]='@param[in] format = offset binary format enable, default=0'
whismanoid 37:74aa97afa030 1737 // parse argument uint8_t format
whismanoid 37:74aa97afa030 1738 uint8_t format = (uint8_t)0; // --- g_MAX11410_device.__WARNING_no_match_for_argname_format_in_MAX11410_device_t__; // default to global property value
whismanoid 37:74aa97afa030 1739 if (cmdLine.parse_uint8_dec("format", format))
whismanoid 37:74aa97afa030 1740 {
whismanoid 37:74aa97afa030 1741 // g_MAX11410_device.__WARNING_no_match_for_argname_format_in_MAX11410_device_t__ = format; // update global property value
whismanoid 37:74aa97afa030 1742 }
whismanoid 37:74aa97afa030 1743 // argname default_argvalue numeric literal specified in CommandDocParamIn @Param[in]='@param[in] refbufp_en = REFP reference buffer enable, default=0'
whismanoid 37:74aa97afa030 1744 // parse argument uint8_t refbufp_en
whismanoid 37:74aa97afa030 1745 uint8_t refbufp_en = (uint8_t)0; // --- g_MAX11410_device.__WARNING_no_match_for_argname_refbufp_en_in_MAX11410_device_t__; // default to global property value
whismanoid 37:74aa97afa030 1746 if (cmdLine.parse_uint8_dec("refbufp_en", refbufp_en))
whismanoid 37:74aa97afa030 1747 {
whismanoid 37:74aa97afa030 1748 // g_MAX11410_device.__WARNING_no_match_for_argname_refbufp_en_in_MAX11410_device_t__ = refbufp_en; // update global property value
whismanoid 37:74aa97afa030 1749 }
whismanoid 37:74aa97afa030 1750 // argname default_argvalue numeric literal specified in CommandDocParamIn @Param[in]='@param[in] refbufn_en = REFN reference buffer enable, default=0'
whismanoid 37:74aa97afa030 1751 // parse argument uint8_t refbufn_en
whismanoid 37:74aa97afa030 1752 uint8_t refbufn_en = (uint8_t)0; // --- g_MAX11410_device.__WARNING_no_match_for_argname_refbufn_en_in_MAX11410_device_t__; // default to global property value
whismanoid 37:74aa97afa030 1753 if (cmdLine.parse_uint8_dec("refbufn_en", refbufn_en))
whismanoid 37:74aa97afa030 1754 {
whismanoid 37:74aa97afa030 1755 // g_MAX11410_device.__WARNING_no_match_for_argname_refbufn_en_in_MAX11410_device_t__ = refbufn_en; // update global property value
whismanoid 37:74aa97afa030 1756 }
whismanoid 37:74aa97afa030 1757 // argname default_argvalue symbolic name specified in CommandDocParamIn @Param[in]='@param[in] ref_sel = reference selection, default=MAX11410::MAX11410_REF_SEL_enum_t::REF_SEL_001_REF1P_REF1N'
whismanoid 37:74aa97afa030 1758 // parse argument uint8_t ref_sel
whismanoid 37:74aa97afa030 1759 uint8_t ref_sel = (uint8_t)MAX11410::REF_SEL_001_REF1P_REF1N; // --- g_MAX11410_device.__WARNING_no_match_for_argname_ref_sel_in_MAX11410_device_t__; // default to global property value
whismanoid 37:74aa97afa030 1760 if (cmdLine.parse_uint8_dec("ref_sel", ref_sel))
whismanoid 37:74aa97afa030 1761 {
whismanoid 37:74aa97afa030 1762 // g_MAX11410_device.__WARNING_no_match_for_argname_ref_sel_in_MAX11410_device_t__ = ref_sel; // update global property value
whismanoid 37:74aa97afa030 1763 }
whismanoid 37:74aa97afa030 1764 // print arguments
whismanoid 37:74aa97afa030 1765 cmdLine.serial().printf("Configure_CTRL");
whismanoid 37:74aa97afa030 1766 cmdLine.serial().printf(" extclk=%d", extclk);
whismanoid 37:74aa97afa030 1767 cmdLine.serial().printf(" u_bn=%d", u_bn);
whismanoid 37:74aa97afa030 1768 cmdLine.serial().printf(" format=%d", format);
whismanoid 37:74aa97afa030 1769 cmdLine.serial().printf(" refbufp_en=%d", refbufp_en);
whismanoid 37:74aa97afa030 1770 cmdLine.serial().printf(" refbufn_en=%d", refbufn_en);
whismanoid 37:74aa97afa030 1771 cmdLine.serial().printf(" ref_sel=%d", ref_sel);
whismanoid 37:74aa97afa030 1772 cmdLine.serial().printf("\r\n");
whismanoid 37:74aa97afa030 1773 // call function Configure_CTRL(extclk, u_bn, format, refbufp_en, refbufn_en, ref_sel)
whismanoid 37:74aa97afa030 1774 uint8_t result = g_MAX11410_device.Configure_CTRL(extclk, u_bn, format, refbufp_en, refbufn_en, ref_sel);
whismanoid 45:8af4549476aa 1775 cmdLine.serial().printf(" =%d\r\n", result);
whismanoid 37:74aa97afa030 1776 return true; // command handled by MAX11410
whismanoid 49:5bfa51523bc2 1777 // CODE GENERATOR: bottom of loop: testMenuCommand="XC", testMenuFirstCharHandler="X"
whismanoid 37:74aa97afa030 1778 } // end nested case 'XC'
whismanoid 37:74aa97afa030 1779 break;
whismanoid 37:74aa97afa030 1780
whismanoid 49:5bfa51523bc2 1781 // CODE GENERATOR: top of loop: testMenuCommand="XF", testMenuFirstCharHandler="X"
whismanoid 49:5bfa51523bc2 1782 // CODE GENERATOR: top of loop: nested switch "X" is currently open
whismanoid 37:74aa97afa030 1783 // CODE GENERATOR: test menu case 'XF':
whismanoid 37:74aa97afa030 1784 // CODE GENERATOR: helpString 'XF linef=? rate=? -- Configure_FILTER'
whismanoid 37:74aa97afa030 1785 // CODE GENERATOR: CMD_ 'None'
whismanoid 37:74aa97afa030 1786 // CODE GENERATOR: CommandName 'Configure_FILTER'
whismanoid 37:74aa97afa030 1787 // CODE GENERATOR: CommandParamIn 'uint8_t linef, uint8_t rate'
whismanoid 37:74aa97afa030 1788 // CODE GENERATOR: CommandReturnType 'uint8_t'
whismanoid 37:74aa97afa030 1789 // CODE GENERATOR: CommandPre ''
whismanoid 37:74aa97afa030 1790 // CODE GENERATOR: CommandDocParamIn '@param[in] linef = filter type, default=MAX11410::MAX11410_LINEF_enum_t::LINEF_11_SINC4'
whismanoid 37:74aa97afa030 1791 // CODE GENERATOR: CommandDocParamIn '@param[in] rate = output data rate selection, default=MAX11410::MAX11410_RATE_enum_t::RATE_0100'
whismanoid 37:74aa97afa030 1792 // CODE GENERATOR: CommandDocParamOut ''
whismanoid 37:74aa97afa030 1793 // CODE GENERATOR: CommandPost ''
whismanoid 37:74aa97afa030 1794 // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure'
whismanoid 49:5bfa51523bc2 1795 case 'F': // (nested inside case 'X')
whismanoid 37:74aa97afa030 1796 {
whismanoid 37:74aa97afa030 1797 // test menu command 'XF' handler:
whismanoid 37:74aa97afa030 1798 // helpString='XF linef=? rate=? -- Configure_FILTER'
whismanoid 37:74aa97afa030 1799 // CMD_='None'
whismanoid 37:74aa97afa030 1800 // CommandName='Configure_FILTER'
whismanoid 37:74aa97afa030 1801 // CommandParamIn='uint8_t linef, uint8_t rate'
whismanoid 37:74aa97afa030 1802 // CommandReturnType='uint8_t'
whismanoid 37:74aa97afa030 1803 // @Pre=''
whismanoid 37:74aa97afa030 1804 // @Param[in]='@param[in] linef = filter type, default=MAX11410::MAX11410_LINEF_enum_t::LINEF_11_SINC4'
whismanoid 37:74aa97afa030 1805 // @Param[in]='@param[in] rate = output data rate selection, default=MAX11410::MAX11410_RATE_enum_t::RATE_0100'
whismanoid 37:74aa97afa030 1806 // @Param[out]=''
whismanoid 37:74aa97afa030 1807 // @Post=''
whismanoid 48:2591fcdece5e 1808 // displayPost=''
whismanoid 37:74aa97afa030 1809 // @Return='@return 1 on success; 0 on failure'
whismanoid 37:74aa97afa030 1810 // parse argument list
whismanoid 37:74aa97afa030 1811 // argname default_argvalue symbolic name specified in CommandDocParamIn @Param[in]='@param[in] linef = filter type, default=MAX11410::MAX11410_LINEF_enum_t::LINEF_11_SINC4'
whismanoid 37:74aa97afa030 1812 // parse argument uint8_t linef
whismanoid 37:74aa97afa030 1813 uint8_t linef = (uint8_t)MAX11410::LINEF_11_SINC4; // --- g_MAX11410_device.__WARNING_no_match_for_argname_linef_in_MAX11410_device_t__; // default to global property value
whismanoid 37:74aa97afa030 1814 if (cmdLine.parse_uint8_dec("linef", linef))
whismanoid 37:74aa97afa030 1815 {
whismanoid 37:74aa97afa030 1816 // g_MAX11410_device.__WARNING_no_match_for_argname_linef_in_MAX11410_device_t__ = linef; // update global property value
whismanoid 37:74aa97afa030 1817 }
whismanoid 37:74aa97afa030 1818 // argname default_argvalue symbolic name specified in CommandDocParamIn @Param[in]='@param[in] rate = output data rate selection, default=MAX11410::MAX11410_RATE_enum_t::RATE_0100'
whismanoid 37:74aa97afa030 1819 // parse argument uint8_t rate
whismanoid 37:74aa97afa030 1820 uint8_t rate = (uint8_t)MAX11410::RATE_0100; // --- g_MAX11410_device.__WARNING_no_match_for_argname_rate_in_MAX11410_device_t__; // default to global property value
whismanoid 37:74aa97afa030 1821 if (cmdLine.parse_uint8_dec("rate", rate))
whismanoid 37:74aa97afa030 1822 {
whismanoid 37:74aa97afa030 1823 // g_MAX11410_device.__WARNING_no_match_for_argname_rate_in_MAX11410_device_t__ = rate; // update global property value
whismanoid 37:74aa97afa030 1824 }
whismanoid 37:74aa97afa030 1825 // print arguments
whismanoid 37:74aa97afa030 1826 cmdLine.serial().printf("Configure_FILTER");
whismanoid 37:74aa97afa030 1827 cmdLine.serial().printf(" linef=%d", linef);
whismanoid 37:74aa97afa030 1828 cmdLine.serial().printf(" rate=%d", rate);
whismanoid 37:74aa97afa030 1829 cmdLine.serial().printf("\r\n");
whismanoid 37:74aa97afa030 1830 // call function Configure_FILTER(linef, rate)
whismanoid 37:74aa97afa030 1831 uint8_t result = g_MAX11410_device.Configure_FILTER(linef, rate);
whismanoid 45:8af4549476aa 1832 cmdLine.serial().printf(" =%d\r\n", result);
whismanoid 37:74aa97afa030 1833 return true; // command handled by MAX11410
whismanoid 49:5bfa51523bc2 1834 // CODE GENERATOR: bottom of loop: testMenuCommand="XF", testMenuFirstCharHandler="X"
whismanoid 37:74aa97afa030 1835 } // end nested case 'XF'
whismanoid 37:74aa97afa030 1836 break;
whismanoid 37:74aa97afa030 1837
whismanoid 49:5bfa51523bc2 1838 // CODE GENERATOR: top of loop: testMenuCommand="XI", testMenuFirstCharHandler="X"
whismanoid 49:5bfa51523bc2 1839 // CODE GENERATOR: top of loop: nested switch "X" is currently open
whismanoid 37:74aa97afa030 1840 // CODE GENERATOR: test menu case 'XI':
whismanoid 37:74aa97afa030 1841 // CODE GENERATOR: helpString 'XI idac1_sel=? idac0_sel=? -- Configure_MUX_CTRL1'
whismanoid 37:74aa97afa030 1842 // CODE GENERATOR: CMD_ 'None'
whismanoid 37:74aa97afa030 1843 // CODE GENERATOR: CommandName 'Configure_MUX_CTRL1'
whismanoid 37:74aa97afa030 1844 // CODE GENERATOR: CommandParamIn 'uint8_t idac1_sel, uint8_t idac0_sel'
whismanoid 37:74aa97afa030 1845 // CODE GENERATOR: CommandReturnType 'uint8_t'
whismanoid 37:74aa97afa030 1846 // CODE GENERATOR: CommandPre ''
whismanoid 37:74aa97afa030 1847 // CODE GENERATOR: CommandDocParamIn '@param[in] idac1_sel = channel high side, default=MAX11410::MAX11410_IDAC1_SEL_enum_t::IDAC1_SEL_1111_unconnected'
whismanoid 37:74aa97afa030 1848 // CODE GENERATOR: CommandDocParamIn '@param[in] idac0_sel = channel low side, default=MAX11410::MAX11410_IDAC0_SEL_enum_t::IDAC0_SEL_1111_unconnected'
whismanoid 37:74aa97afa030 1849 // CODE GENERATOR: CommandDocParamOut ''
whismanoid 37:74aa97afa030 1850 // CODE GENERATOR: CommandPost ''
whismanoid 37:74aa97afa030 1851 // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure'
whismanoid 49:5bfa51523bc2 1852 case 'I': // (nested inside case 'X')
whismanoid 37:74aa97afa030 1853 {
whismanoid 37:74aa97afa030 1854 // test menu command 'XI' handler:
whismanoid 37:74aa97afa030 1855 // helpString='XI idac1_sel=? idac0_sel=? -- Configure_MUX_CTRL1'
whismanoid 37:74aa97afa030 1856 // CMD_='None'
whismanoid 37:74aa97afa030 1857 // CommandName='Configure_MUX_CTRL1'
whismanoid 37:74aa97afa030 1858 // CommandParamIn='uint8_t idac1_sel, uint8_t idac0_sel'
whismanoid 37:74aa97afa030 1859 // CommandReturnType='uint8_t'
whismanoid 37:74aa97afa030 1860 // @Pre=''
whismanoid 37:74aa97afa030 1861 // @Param[in]='@param[in] idac1_sel = channel high side, default=MAX11410::MAX11410_IDAC1_SEL_enum_t::IDAC1_SEL_1111_unconnected'
whismanoid 37:74aa97afa030 1862 // @Param[in]='@param[in] idac0_sel = channel low side, default=MAX11410::MAX11410_IDAC0_SEL_enum_t::IDAC0_SEL_1111_unconnected'
whismanoid 37:74aa97afa030 1863 // @Param[out]=''
whismanoid 37:74aa97afa030 1864 // @Post=''
whismanoid 48:2591fcdece5e 1865 // displayPost=''
whismanoid 37:74aa97afa030 1866 // @Return='@return 1 on success; 0 on failure'
whismanoid 37:74aa97afa030 1867 // parse argument list
whismanoid 37:74aa97afa030 1868 // argname default_argvalue symbolic name specified in CommandDocParamIn @Param[in]='@param[in] idac1_sel = channel high side, default=MAX11410::MAX11410_IDAC1_SEL_enum_t::IDAC1_SEL_1111_unconnected'
whismanoid 37:74aa97afa030 1869 // parse argument uint8_t idac1_sel
whismanoid 37:74aa97afa030 1870 uint8_t idac1_sel = (uint8_t)MAX11410::IDAC1_SEL_1111_unconnected; // --- g_MAX11410_device.__WARNING_no_match_for_argname_idac1_sel_in_MAX11410_device_t__; // default to global property value
whismanoid 37:74aa97afa030 1871 if (cmdLine.parse_uint8_dec("idac1_sel", idac1_sel))
whismanoid 37:74aa97afa030 1872 {
whismanoid 37:74aa97afa030 1873 // g_MAX11410_device.__WARNING_no_match_for_argname_idac1_sel_in_MAX11410_device_t__ = idac1_sel; // update global property value
whismanoid 37:74aa97afa030 1874 }
whismanoid 37:74aa97afa030 1875 // argname default_argvalue symbolic name specified in CommandDocParamIn @Param[in]='@param[in] idac0_sel = channel low side, default=MAX11410::MAX11410_IDAC0_SEL_enum_t::IDAC0_SEL_1111_unconnected'
whismanoid 37:74aa97afa030 1876 // parse argument uint8_t idac0_sel
whismanoid 37:74aa97afa030 1877 uint8_t idac0_sel = (uint8_t)MAX11410::IDAC0_SEL_1111_unconnected; // --- g_MAX11410_device.__WARNING_no_match_for_argname_idac0_sel_in_MAX11410_device_t__; // default to global property value
whismanoid 37:74aa97afa030 1878 if (cmdLine.parse_uint8_dec("idac0_sel", idac0_sel))
whismanoid 37:74aa97afa030 1879 {
whismanoid 37:74aa97afa030 1880 // g_MAX11410_device.__WARNING_no_match_for_argname_idac0_sel_in_MAX11410_device_t__ = idac0_sel; // update global property value
whismanoid 37:74aa97afa030 1881 }
whismanoid 37:74aa97afa030 1882 // print arguments
whismanoid 37:74aa97afa030 1883 cmdLine.serial().printf("Configure_MUX_CTRL1");
whismanoid 37:74aa97afa030 1884 cmdLine.serial().printf(" idac1_sel=%d", idac1_sel);
whismanoid 37:74aa97afa030 1885 cmdLine.serial().printf(" idac0_sel=%d", idac0_sel);
whismanoid 37:74aa97afa030 1886 cmdLine.serial().printf("\r\n");
whismanoid 37:74aa97afa030 1887 // call function Configure_MUX_CTRL1(idac1_sel, idac0_sel)
whismanoid 37:74aa97afa030 1888 uint8_t result = g_MAX11410_device.Configure_MUX_CTRL1(idac1_sel, idac0_sel);
whismanoid 45:8af4549476aa 1889 cmdLine.serial().printf(" =%d\r\n", result);
whismanoid 37:74aa97afa030 1890 return true; // command handled by MAX11410
whismanoid 49:5bfa51523bc2 1891 // CODE GENERATOR: bottom of loop: testMenuCommand="XI", testMenuFirstCharHandler="X"
whismanoid 37:74aa97afa030 1892 } // end nested case 'XI'
whismanoid 37:74aa97afa030 1893 break;
whismanoid 37:74aa97afa030 1894
whismanoid 49:5bfa51523bc2 1895 // CODE GENERATOR: top of loop: testMenuCommand="XM", testMenuFirstCharHandler="X"
whismanoid 49:5bfa51523bc2 1896 // CODE GENERATOR: top of loop: nested switch "X" is currently open
whismanoid 37:74aa97afa030 1897 // CODE GENERATOR: test menu case 'XM':
whismanoid 37:74aa97afa030 1898 // CODE GENERATOR: helpString 'XM ainp=? ainn=? -- Configure_MUX_CTRL0'
whismanoid 37:74aa97afa030 1899 // CODE GENERATOR: CMD_ 'None'
whismanoid 37:74aa97afa030 1900 // CODE GENERATOR: CommandName 'Configure_MUX_CTRL0'
whismanoid 37:74aa97afa030 1901 // CODE GENERATOR: CommandParamIn 'uint8_t ainp, uint8_t ainn'
whismanoid 37:74aa97afa030 1902 // CODE GENERATOR: CommandReturnType 'uint8_t'
whismanoid 37:74aa97afa030 1903 // CODE GENERATOR: CommandPre ''
whismanoid 37:74aa97afa030 1904 // CODE GENERATOR: CommandDocParamIn '@param[in] ainp = channel high side, default=MAX11410::MAX11410_AINP_SEL_enum_t::AINP_SEL_0000_AIN0'
whismanoid 37:74aa97afa030 1905 // CODE GENERATOR: CommandDocParamIn '@param[in] ainn = channel low side, default=MAX11410::MAX11410_AINN_SEL_enum_t::AINN_SEL_1010_GND'
whismanoid 37:74aa97afa030 1906 // CODE GENERATOR: CommandDocParamOut ''
whismanoid 37:74aa97afa030 1907 // CODE GENERATOR: CommandPost ''
whismanoid 37:74aa97afa030 1908 // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure'
whismanoid 49:5bfa51523bc2 1909 case 'M': // (nested inside case 'X')
whismanoid 37:74aa97afa030 1910 {
whismanoid 37:74aa97afa030 1911 // test menu command 'XM' handler:
whismanoid 37:74aa97afa030 1912 // helpString='XM ainp=? ainn=? -- Configure_MUX_CTRL0'
whismanoid 37:74aa97afa030 1913 // CMD_='None'
whismanoid 37:74aa97afa030 1914 // CommandName='Configure_MUX_CTRL0'
whismanoid 37:74aa97afa030 1915 // CommandParamIn='uint8_t ainp, uint8_t ainn'
whismanoid 37:74aa97afa030 1916 // CommandReturnType='uint8_t'
whismanoid 37:74aa97afa030 1917 // @Pre=''
whismanoid 37:74aa97afa030 1918 // @Param[in]='@param[in] ainp = channel high side, default=MAX11410::MAX11410_AINP_SEL_enum_t::AINP_SEL_0000_AIN0'
whismanoid 37:74aa97afa030 1919 // @Param[in]='@param[in] ainn = channel low side, default=MAX11410::MAX11410_AINN_SEL_enum_t::AINN_SEL_1010_GND'
whismanoid 37:74aa97afa030 1920 // @Param[out]=''
whismanoid 37:74aa97afa030 1921 // @Post=''
whismanoid 48:2591fcdece5e 1922 // displayPost=''
whismanoid 37:74aa97afa030 1923 // @Return='@return 1 on success; 0 on failure'
whismanoid 37:74aa97afa030 1924 // parse argument list
whismanoid 37:74aa97afa030 1925 // argname default_argvalue symbolic name specified in CommandDocParamIn @Param[in]='@param[in] ainp = channel high side, default=MAX11410::MAX11410_AINP_SEL_enum_t::AINP_SEL_0000_AIN0'
whismanoid 37:74aa97afa030 1926 // parse argument uint8_t ainp
whismanoid 37:74aa97afa030 1927 uint8_t ainp = (uint8_t)MAX11410::AINP_SEL_0000_AIN0; // --- g_MAX11410_device.__WARNING_no_match_for_argname_ainp_in_MAX11410_device_t__; // default to global property value
whismanoid 37:74aa97afa030 1928 if (cmdLine.parse_uint8_dec("ainp", ainp))
whismanoid 37:74aa97afa030 1929 {
whismanoid 37:74aa97afa030 1930 // g_MAX11410_device.__WARNING_no_match_for_argname_ainp_in_MAX11410_device_t__ = ainp; // update global property value
whismanoid 37:74aa97afa030 1931 }
whismanoid 37:74aa97afa030 1932 // argname default_argvalue symbolic name specified in CommandDocParamIn @Param[in]='@param[in] ainn = channel low side, default=MAX11410::MAX11410_AINN_SEL_enum_t::AINN_SEL_1010_GND'
whismanoid 37:74aa97afa030 1933 // parse argument uint8_t ainn
whismanoid 37:74aa97afa030 1934 uint8_t ainn = (uint8_t)MAX11410::AINN_SEL_1010_GND; // --- g_MAX11410_device.__WARNING_no_match_for_argname_ainn_in_MAX11410_device_t__; // default to global property value
whismanoid 37:74aa97afa030 1935 if (cmdLine.parse_uint8_dec("ainn", ainn))
whismanoid 37:74aa97afa030 1936 {
whismanoid 37:74aa97afa030 1937 // g_MAX11410_device.__WARNING_no_match_for_argname_ainn_in_MAX11410_device_t__ = ainn; // update global property value
whismanoid 37:74aa97afa030 1938 }
whismanoid 37:74aa97afa030 1939 // print arguments
whismanoid 37:74aa97afa030 1940 cmdLine.serial().printf("Configure_MUX_CTRL0");
whismanoid 37:74aa97afa030 1941 cmdLine.serial().printf(" ainp=%d", ainp);
whismanoid 37:74aa97afa030 1942 cmdLine.serial().printf(" ainn=%d", ainn);
whismanoid 37:74aa97afa030 1943 cmdLine.serial().printf("\r\n");
whismanoid 37:74aa97afa030 1944 // call function Configure_MUX_CTRL0(ainp, ainn)
whismanoid 37:74aa97afa030 1945 uint8_t result = g_MAX11410_device.Configure_MUX_CTRL0(ainp, ainn);
whismanoid 45:8af4549476aa 1946 cmdLine.serial().printf(" =%d\r\n", result);
whismanoid 37:74aa97afa030 1947 return true; // command handled by MAX11410
whismanoid 49:5bfa51523bc2 1948 // CODE GENERATOR: bottom of loop: testMenuCommand="XM", testMenuFirstCharHandler="X"
whismanoid 37:74aa97afa030 1949 } // end nested case 'XM'
whismanoid 37:74aa97afa030 1950 break;
whismanoid 37:74aa97afa030 1951
whismanoid 49:5bfa51523bc2 1952 // CODE GENERATOR: top of loop: testMenuCommand="XP", testMenuFirstCharHandler="X"
whismanoid 49:5bfa51523bc2 1953 // CODE GENERATOR: top of loop: nested switch "X" is currently open
whismanoid 37:74aa97afa030 1954 // CODE GENERATOR: test menu case 'XP':
whismanoid 37:74aa97afa030 1955 // CODE GENERATOR: helpString 'XP sigpath=? gain=? -- Configure_PGA'
whismanoid 37:74aa97afa030 1956 // CODE GENERATOR: CMD_ 'None'
whismanoid 37:74aa97afa030 1957 // CODE GENERATOR: CommandName 'Configure_PGA'
whismanoid 37:74aa97afa030 1958 // CODE GENERATOR: CommandParamIn 'uint8_t sigpath, uint8_t gain'
whismanoid 37:74aa97afa030 1959 // CODE GENERATOR: CommandReturnType 'uint8_t'
whismanoid 37:74aa97afa030 1960 // CODE GENERATOR: CommandPre ''
whismanoid 37:74aa97afa030 1961 // CODE GENERATOR: CommandDocParamIn '@param[in] sigpath = signal path, default=MAX11410::MAX11410_SIG_PATH_enum_t::SIG_PATH_00_BUFFERED'
whismanoid 37:74aa97afa030 1962 // CODE GENERATOR: CommandDocParamIn '@param[in] gain = gain selection, default=MAX11410::MAX11410_GAIN_enum_t::GAIN_000_1'
whismanoid 37:74aa97afa030 1963 // CODE GENERATOR: CommandDocParamOut ''
whismanoid 37:74aa97afa030 1964 // CODE GENERATOR: CommandPost ''
whismanoid 37:74aa97afa030 1965 // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure'
whismanoid 49:5bfa51523bc2 1966 case 'P': // (nested inside case 'X')
whismanoid 37:74aa97afa030 1967 {
whismanoid 37:74aa97afa030 1968 // test menu command 'XP' handler:
whismanoid 37:74aa97afa030 1969 // helpString='XP sigpath=? gain=? -- Configure_PGA'
whismanoid 37:74aa97afa030 1970 // CMD_='None'
whismanoid 37:74aa97afa030 1971 // CommandName='Configure_PGA'
whismanoid 37:74aa97afa030 1972 // CommandParamIn='uint8_t sigpath, uint8_t gain'
whismanoid 37:74aa97afa030 1973 // CommandReturnType='uint8_t'
whismanoid 37:74aa97afa030 1974 // @Pre=''
whismanoid 37:74aa97afa030 1975 // @Param[in]='@param[in] sigpath = signal path, default=MAX11410::MAX11410_SIG_PATH_enum_t::SIG_PATH_00_BUFFERED'
whismanoid 37:74aa97afa030 1976 // @Param[in]='@param[in] gain = gain selection, default=MAX11410::MAX11410_GAIN_enum_t::GAIN_000_1'
whismanoid 37:74aa97afa030 1977 // @Param[out]=''
whismanoid 37:74aa97afa030 1978 // @Post=''
whismanoid 48:2591fcdece5e 1979 // displayPost=''
whismanoid 37:74aa97afa030 1980 // @Return='@return 1 on success; 0 on failure'
whismanoid 37:74aa97afa030 1981 // parse argument list
whismanoid 37:74aa97afa030 1982 // argname default_argvalue symbolic name specified in CommandDocParamIn @Param[in]='@param[in] sigpath = signal path, default=MAX11410::MAX11410_SIG_PATH_enum_t::SIG_PATH_00_BUFFERED'
whismanoid 37:74aa97afa030 1983 // parse argument uint8_t sigpath
whismanoid 37:74aa97afa030 1984 uint8_t sigpath = (uint8_t)MAX11410::SIG_PATH_00_BUFFERED; // --- g_MAX11410_device.__WARNING_no_match_for_argname_sigpath_in_MAX11410_device_t__; // default to global property value
whismanoid 37:74aa97afa030 1985 if (cmdLine.parse_uint8_dec("sigpath", sigpath))
whismanoid 37:74aa97afa030 1986 {
whismanoid 37:74aa97afa030 1987 // g_MAX11410_device.__WARNING_no_match_for_argname_sigpath_in_MAX11410_device_t__ = sigpath; // update global property value
whismanoid 37:74aa97afa030 1988 }
whismanoid 37:74aa97afa030 1989 // argname default_argvalue symbolic name specified in CommandDocParamIn @Param[in]='@param[in] gain = gain selection, default=MAX11410::MAX11410_GAIN_enum_t::GAIN_000_1'
whismanoid 37:74aa97afa030 1990 // parse argument uint8_t gain
whismanoid 37:74aa97afa030 1991 uint8_t gain = (uint8_t)MAX11410::GAIN_000_1; // --- g_MAX11410_device.__WARNING_no_match_for_argname_gain_in_MAX11410_device_t__; // default to global property value
whismanoid 37:74aa97afa030 1992 if (cmdLine.parse_uint8_dec("gain", gain))
whismanoid 37:74aa97afa030 1993 {
whismanoid 37:74aa97afa030 1994 // g_MAX11410_device.__WARNING_no_match_for_argname_gain_in_MAX11410_device_t__ = gain; // update global property value
whismanoid 37:74aa97afa030 1995 }
whismanoid 37:74aa97afa030 1996 // print arguments
whismanoid 37:74aa97afa030 1997 cmdLine.serial().printf("Configure_PGA");
whismanoid 37:74aa97afa030 1998 cmdLine.serial().printf(" sigpath=%d", sigpath);
whismanoid 37:74aa97afa030 1999 cmdLine.serial().printf(" gain=%d", gain);
whismanoid 37:74aa97afa030 2000 cmdLine.serial().printf("\r\n");
whismanoid 37:74aa97afa030 2001 // call function Configure_PGA(sigpath, gain)
whismanoid 37:74aa97afa030 2002 uint8_t result = g_MAX11410_device.Configure_PGA(sigpath, gain);
whismanoid 45:8af4549476aa 2003 cmdLine.serial().printf(" =%d\r\n", result);
whismanoid 37:74aa97afa030 2004 return true; // command handled by MAX11410
whismanoid 49:5bfa51523bc2 2005 // CODE GENERATOR: bottom of loop: testMenuCommand="XP", testMenuFirstCharHandler="X"
whismanoid 37:74aa97afa030 2006 } // end nested case 'XP'
whismanoid 37:74aa97afa030 2007 break;
whismanoid 37:74aa97afa030 2008
whismanoid 55:73d886c105f5 2009 // CODE GENERATOR: top of loop: testMenuCommand="XR", testMenuFirstCharHandler="X"
whismanoid 55:73d886c105f5 2010 // CODE GENERATOR: top of loop: nested switch "X" is currently open
whismanoid 55:73d886c105f5 2011 // CODE GENERATOR: test menu case 'XR':
whismanoid 55:73d886c105f5 2012 // CODE GENERATOR: helpString 'XR ref_sel=? -- Configure_CTRL_REF'
whismanoid 55:73d886c105f5 2013 // CODE GENERATOR: CMD_ 'None'
whismanoid 55:73d886c105f5 2014 // CODE GENERATOR: CommandName 'Configure_CTRL_REF'
whismanoid 55:73d886c105f5 2015 // CODE GENERATOR: CommandParamIn 'uint8_t ref_sel'
whismanoid 55:73d886c105f5 2016 // CODE GENERATOR: CommandReturnType 'uint8_t'
whismanoid 55:73d886c105f5 2017 // CODE GENERATOR: CommandPre '@pre ctrl = shadow of CTRL register'
whismanoid 55:73d886c105f5 2018 // CODE GENERATOR: CommandDocParamIn '@param[in] ref_sel = reference selection, default=MAX11410::MAX11410_REF_SEL_enum_t::REF_SEL_001_REF1P_REF1N'
whismanoid 55:73d886c105f5 2019 // CODE GENERATOR: CommandDocParamOut ''
whismanoid 55:73d886c105f5 2020 // CODE GENERATOR: CommandPost ''
whismanoid 55:73d886c105f5 2021 // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure'
whismanoid 55:73d886c105f5 2022 case 'R': // (nested inside case 'X')
whismanoid 55:73d886c105f5 2023 {
whismanoid 55:73d886c105f5 2024 // test menu command 'XR' handler:
whismanoid 55:73d886c105f5 2025 // helpString='XR ref_sel=? -- Configure_CTRL_REF'
whismanoid 55:73d886c105f5 2026 // CMD_='None'
whismanoid 55:73d886c105f5 2027 // CommandName='Configure_CTRL_REF'
whismanoid 55:73d886c105f5 2028 // CommandParamIn='uint8_t ref_sel'
whismanoid 55:73d886c105f5 2029 // CommandReturnType='uint8_t'
whismanoid 55:73d886c105f5 2030 // @Pre='@pre ctrl = shadow of CTRL register'
whismanoid 55:73d886c105f5 2031 // @Param[in]='@param[in] ref_sel = reference selection, default=MAX11410::MAX11410_REF_SEL_enum_t::REF_SEL_001_REF1P_REF1N'
whismanoid 55:73d886c105f5 2032 // @Param[out]=''
whismanoid 55:73d886c105f5 2033 // @Post=''
whismanoid 55:73d886c105f5 2034 // displayPost=''
whismanoid 55:73d886c105f5 2035 // @Return='@return 1 on success; 0 on failure'
whismanoid 55:73d886c105f5 2036 // parse argument list
whismanoid 55:73d886c105f5 2037 // argname default_argvalue symbolic name specified in CommandDocParamIn @Param[in]='@param[in] ref_sel = reference selection, default=MAX11410::MAX11410_REF_SEL_enum_t::REF_SEL_001_REF1P_REF1N'
whismanoid 55:73d886c105f5 2038 // parse argument uint8_t ref_sel
whismanoid 55:73d886c105f5 2039 uint8_t ref_sel = (uint8_t)MAX11410::REF_SEL_001_REF1P_REF1N; // --- g_MAX11410_device.__WARNING_no_match_for_argname_ref_sel_in_MAX11410_device_t__; // default to global property value
whismanoid 55:73d886c105f5 2040 if (cmdLine.parse_uint8_dec("ref_sel", ref_sel))
whismanoid 55:73d886c105f5 2041 {
whismanoid 55:73d886c105f5 2042 // g_MAX11410_device.__WARNING_no_match_for_argname_ref_sel_in_MAX11410_device_t__ = ref_sel; // update global property value
whismanoid 55:73d886c105f5 2043 }
whismanoid 55:73d886c105f5 2044 // print arguments
whismanoid 55:73d886c105f5 2045 cmdLine.serial().printf("Configure_CTRL_REF");
whismanoid 55:73d886c105f5 2046 cmdLine.serial().printf(" ref_sel=%d", ref_sel);
whismanoid 55:73d886c105f5 2047 cmdLine.serial().printf("\r\n");
whismanoid 55:73d886c105f5 2048 // call function Configure_CTRL_REF(ref_sel)
whismanoid 55:73d886c105f5 2049 uint8_t result = g_MAX11410_device.Configure_CTRL_REF(ref_sel);
whismanoid 55:73d886c105f5 2050 cmdLine.serial().printf(" =%d\r\n", result);
whismanoid 55:73d886c105f5 2051 return true; // command handled by MAX11410
whismanoid 55:73d886c105f5 2052 // CODE GENERATOR: bottom of loop: testMenuCommand="XR", testMenuFirstCharHandler="X"
whismanoid 55:73d886c105f5 2053 } // end nested case 'XR'
whismanoid 55:73d886c105f5 2054 break;
whismanoid 55:73d886c105f5 2055
whismanoid 49:5bfa51523bc2 2056 // CODE GENERATOR: top of loop: testMenuCommand="XS", testMenuFirstCharHandler="X"
whismanoid 49:5bfa51523bc2 2057 // CODE GENERATOR: top of loop: nested switch "X" is currently open
whismanoid 37:74aa97afa030 2058 // CODE GENERATOR: test menu case 'XS':
whismanoid 37:74aa97afa030 2059 // CODE GENERATOR: helpString 'XS vbias_mode=? brn_mode=? idac_mode=? -- Configure_SOURCE'
whismanoid 37:74aa97afa030 2060 // CODE GENERATOR: CMD_ 'None'
whismanoid 37:74aa97afa030 2061 // CODE GENERATOR: CommandName 'Configure_SOURCE'
whismanoid 37:74aa97afa030 2062 // CODE GENERATOR: CommandParamIn 'uint8_t vbias_mode, uint8_t brn_mode, uint8_t idac_mode'
whismanoid 37:74aa97afa030 2063 // CODE GENERATOR: CommandReturnType 'uint8_t'
whismanoid 37:74aa97afa030 2064 // CODE GENERATOR: CommandPre ''
whismanoid 37:74aa97afa030 2065 // CODE GENERATOR: CommandDocParamIn '@param[in] vbias_mode = _______, default=MAX11410::MAX11410_VBIAS_MODE_enum_t::VBIAS_MODE_00_Active'
whismanoid 37:74aa97afa030 2066 // CODE GENERATOR: CommandDocParamIn '@param[in] brn_mode = _______, default=MAX11410::MAX11410_BRN_MODE_enum_t::BRN_MODE_00_disabled'
whismanoid 37:74aa97afa030 2067 // CODE GENERATOR: CommandDocParamIn '@param[in] idac_mode = _______, default=MAX11410::MAX11410_IDAC_MODE_enum_t::IDAC_MODE_0000_10uA'
whismanoid 37:74aa97afa030 2068 // CODE GENERATOR: CommandDocParamOut ''
whismanoid 37:74aa97afa030 2069 // CODE GENERATOR: CommandPost ''
whismanoid 37:74aa97afa030 2070 // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure'
whismanoid 49:5bfa51523bc2 2071 case 'S': // (nested inside case 'X')
whismanoid 37:74aa97afa030 2072 {
whismanoid 37:74aa97afa030 2073 // test menu command 'XS' handler:
whismanoid 37:74aa97afa030 2074 // helpString='XS vbias_mode=? brn_mode=? idac_mode=? -- Configure_SOURCE'
whismanoid 37:74aa97afa030 2075 // CMD_='None'
whismanoid 37:74aa97afa030 2076 // CommandName='Configure_SOURCE'
whismanoid 37:74aa97afa030 2077 // CommandParamIn='uint8_t vbias_mode, uint8_t brn_mode, uint8_t idac_mode'
whismanoid 37:74aa97afa030 2078 // CommandReturnType='uint8_t'
whismanoid 37:74aa97afa030 2079 // @Pre=''
whismanoid 37:74aa97afa030 2080 // @Param[in]='@param[in] vbias_mode = _______, default=MAX11410::MAX11410_VBIAS_MODE_enum_t::VBIAS_MODE_00_Active'
whismanoid 37:74aa97afa030 2081 // @Param[in]='@param[in] brn_mode = _______, default=MAX11410::MAX11410_BRN_MODE_enum_t::BRN_MODE_00_disabled'
whismanoid 37:74aa97afa030 2082 // @Param[in]='@param[in] idac_mode = _______, default=MAX11410::MAX11410_IDAC_MODE_enum_t::IDAC_MODE_0000_10uA'
whismanoid 37:74aa97afa030 2083 // @Param[out]=''
whismanoid 37:74aa97afa030 2084 // @Post=''
whismanoid 48:2591fcdece5e 2085 // displayPost=''
whismanoid 37:74aa97afa030 2086 // @Return='@return 1 on success; 0 on failure'
whismanoid 37:74aa97afa030 2087 // parse argument list
whismanoid 37:74aa97afa030 2088 // argname default_argvalue symbolic name specified in CommandDocParamIn @Param[in]='@param[in] vbias_mode = _______, default=MAX11410::MAX11410_VBIAS_MODE_enum_t::VBIAS_MODE_00_Active'
whismanoid 37:74aa97afa030 2089 // parse argument uint8_t vbias_mode
whismanoid 37:74aa97afa030 2090 uint8_t vbias_mode = (uint8_t)MAX11410::VBIAS_MODE_00_Active; // --- g_MAX11410_device.__WARNING_no_match_for_argname_vbias_mode_in_MAX11410_device_t__; // default to global property value
whismanoid 37:74aa97afa030 2091 if (cmdLine.parse_uint8_dec("vbias_mode", vbias_mode))
whismanoid 37:74aa97afa030 2092 {
whismanoid 37:74aa97afa030 2093 // g_MAX11410_device.__WARNING_no_match_for_argname_vbias_mode_in_MAX11410_device_t__ = vbias_mode; // update global property value
whismanoid 37:74aa97afa030 2094 }
whismanoid 37:74aa97afa030 2095 // argname default_argvalue symbolic name specified in CommandDocParamIn @Param[in]='@param[in] brn_mode = _______, default=MAX11410::MAX11410_BRN_MODE_enum_t::BRN_MODE_00_disabled'
whismanoid 37:74aa97afa030 2096 // parse argument uint8_t brn_mode
whismanoid 37:74aa97afa030 2097 uint8_t brn_mode = (uint8_t)MAX11410::BRN_MODE_00_disabled; // --- g_MAX11410_device.__WARNING_no_match_for_argname_brn_mode_in_MAX11410_device_t__; // default to global property value
whismanoid 37:74aa97afa030 2098 if (cmdLine.parse_uint8_dec("brn_mode", brn_mode))
whismanoid 37:74aa97afa030 2099 {
whismanoid 37:74aa97afa030 2100 // g_MAX11410_device.__WARNING_no_match_for_argname_brn_mode_in_MAX11410_device_t__ = brn_mode; // update global property value
whismanoid 37:74aa97afa030 2101 }
whismanoid 37:74aa97afa030 2102 // argname default_argvalue symbolic name specified in CommandDocParamIn @Param[in]='@param[in] idac_mode = _______, default=MAX11410::MAX11410_IDAC_MODE_enum_t::IDAC_MODE_0000_10uA'
whismanoid 37:74aa97afa030 2103 // parse argument uint8_t idac_mode
whismanoid 37:74aa97afa030 2104 uint8_t idac_mode = (uint8_t)MAX11410::IDAC_MODE_0000_10uA; // --- g_MAX11410_device.__WARNING_no_match_for_argname_idac_mode_in_MAX11410_device_t__; // default to global property value
whismanoid 37:74aa97afa030 2105 if (cmdLine.parse_uint8_dec("idac_mode", idac_mode))
whismanoid 37:74aa97afa030 2106 {
whismanoid 37:74aa97afa030 2107 // g_MAX11410_device.__WARNING_no_match_for_argname_idac_mode_in_MAX11410_device_t__ = idac_mode; // update global property value
whismanoid 37:74aa97afa030 2108 }
whismanoid 37:74aa97afa030 2109 // print arguments
whismanoid 37:74aa97afa030 2110 cmdLine.serial().printf("Configure_SOURCE");
whismanoid 37:74aa97afa030 2111 cmdLine.serial().printf(" vbias_mode=%d", vbias_mode);
whismanoid 37:74aa97afa030 2112 cmdLine.serial().printf(" brn_mode=%d", brn_mode);
whismanoid 37:74aa97afa030 2113 cmdLine.serial().printf(" idac_mode=%d", idac_mode);
whismanoid 37:74aa97afa030 2114 cmdLine.serial().printf("\r\n");
whismanoid 37:74aa97afa030 2115 // call function Configure_SOURCE(vbias_mode, brn_mode, idac_mode)
whismanoid 37:74aa97afa030 2116 uint8_t result = g_MAX11410_device.Configure_SOURCE(vbias_mode, brn_mode, idac_mode);
whismanoid 45:8af4549476aa 2117 cmdLine.serial().printf(" =%d\r\n", result);
whismanoid 37:74aa97afa030 2118 return true; // command handled by MAX11410
whismanoid 49:5bfa51523bc2 2119 // CODE GENERATOR: bottom of loop: testMenuCommand="XS", testMenuFirstCharHandler="X"
whismanoid 37:74aa97afa030 2120 } // end nested case 'XS'
whismanoid 37:74aa97afa030 2121 break;
whismanoid 37:74aa97afa030 2122
whismanoid 49:5bfa51523bc2 2123 // CODE GENERATOR: top of loop: testMenuCommand="XV", testMenuFirstCharHandler="X"
whismanoid 49:5bfa51523bc2 2124 // CODE GENERATOR: top of loop: nested switch "X" is currently open
whismanoid 37:74aa97afa030 2125 // CODE GENERATOR: test menu case 'XV':
whismanoid 37:74aa97afa030 2126 // CODE GENERATOR: helpString 'XV vbias_ain7_ain0_bitmap=? -- Configure_MUX_CTRL2'
whismanoid 37:74aa97afa030 2127 // CODE GENERATOR: CMD_ 'None'
whismanoid 37:74aa97afa030 2128 // CODE GENERATOR: CommandName 'Configure_MUX_CTRL2'
whismanoid 37:74aa97afa030 2129 // CODE GENERATOR: CommandParamIn 'uint8_t vbias_ain7_ain0_bitmap'
whismanoid 37:74aa97afa030 2130 // CODE GENERATOR: CommandReturnType 'uint8_t'
whismanoid 37:74aa97afa030 2131 // CODE GENERATOR: CommandPre ''
whismanoid 37:74aa97afa030 2132 // CODE GENERATOR: CommandDocParamIn '@param[in] vbias_ain7_ain0_bitmap = bit map of AIN7..AIN0 enables for voltage bias, default=0'
whismanoid 37:74aa97afa030 2133 // CODE GENERATOR: CommandDocParamOut ''
whismanoid 37:74aa97afa030 2134 // CODE GENERATOR: CommandPost ''
whismanoid 37:74aa97afa030 2135 // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure'
whismanoid 49:5bfa51523bc2 2136 case 'V': // (nested inside case 'X')
whismanoid 37:74aa97afa030 2137 {
whismanoid 37:74aa97afa030 2138 // test menu command 'XV' handler:
whismanoid 37:74aa97afa030 2139 // helpString='XV vbias_ain7_ain0_bitmap=? -- Configure_MUX_CTRL2'
whismanoid 37:74aa97afa030 2140 // CMD_='None'
whismanoid 37:74aa97afa030 2141 // CommandName='Configure_MUX_CTRL2'
whismanoid 37:74aa97afa030 2142 // CommandParamIn='uint8_t vbias_ain7_ain0_bitmap'
whismanoid 37:74aa97afa030 2143 // CommandReturnType='uint8_t'
whismanoid 37:74aa97afa030 2144 // @Pre=''
whismanoid 37:74aa97afa030 2145 // @Param[in]='@param[in] vbias_ain7_ain0_bitmap = bit map of AIN7..AIN0 enables for voltage bias, default=0'
whismanoid 37:74aa97afa030 2146 // @Param[out]=''
whismanoid 37:74aa97afa030 2147 // @Post=''
whismanoid 48:2591fcdece5e 2148 // displayPost=''
whismanoid 37:74aa97afa030 2149 // @Return='@return 1 on success; 0 on failure'
whismanoid 37:74aa97afa030 2150 // parse argument list
whismanoid 37:74aa97afa030 2151 // argname default_argvalue numeric literal specified in CommandDocParamIn @Param[in]='@param[in] vbias_ain7_ain0_bitmap = bit map of AIN7..AIN0 enables for voltage bias, default=0'
whismanoid 37:74aa97afa030 2152 // parse argument uint8_t vbias_ain7_ain0_bitmap
whismanoid 37:74aa97afa030 2153 uint8_t vbias_ain7_ain0_bitmap = (uint8_t)0; // --- g_MAX11410_device.__WARNING_no_match_for_argname_vbias_ain7_ain0_bitmap_in_MAX11410_device_t__; // default to global property value
whismanoid 37:74aa97afa030 2154 if (cmdLine.parse_uint8_dec("vbias_ain7_ain0_bitmap", vbias_ain7_ain0_bitmap))
whismanoid 37:74aa97afa030 2155 {
whismanoid 37:74aa97afa030 2156 // g_MAX11410_device.__WARNING_no_match_for_argname_vbias_ain7_ain0_bitmap_in_MAX11410_device_t__ = vbias_ain7_ain0_bitmap; // update global property value
whismanoid 37:74aa97afa030 2157 }
whismanoid 37:74aa97afa030 2158 // print arguments
whismanoid 37:74aa97afa030 2159 cmdLine.serial().printf("Configure_MUX_CTRL2");
whismanoid 37:74aa97afa030 2160 cmdLine.serial().printf(" vbias_ain7_ain0_bitmap=%d", vbias_ain7_ain0_bitmap);
whismanoid 37:74aa97afa030 2161 cmdLine.serial().printf("\r\n");
whismanoid 37:74aa97afa030 2162 // call function Configure_MUX_CTRL2(vbias_ain7_ain0_bitmap)
whismanoid 37:74aa97afa030 2163 uint8_t result = g_MAX11410_device.Configure_MUX_CTRL2(vbias_ain7_ain0_bitmap);
whismanoid 45:8af4549476aa 2164 cmdLine.serial().printf(" =%d\r\n", result);
whismanoid 37:74aa97afa030 2165 return true; // command handled by MAX11410
whismanoid 49:5bfa51523bc2 2166 // CODE GENERATOR: bottom of loop: testMenuCommand="XV", testMenuFirstCharHandler="X"
whismanoid 37:74aa97afa030 2167 } // end nested case 'XV'
whismanoid 37:74aa97afa030 2168 break;
whismanoid 37:74aa97afa030 2169
whismanoid 49:5bfa51523bc2 2170 } // end nested switch (cmdLine[1]) inside case 'X'
whismanoid 37:74aa97afa030 2171 break;
whismanoid 37:74aa97afa030 2172 } // end case 'X'
whismanoid 35:8aa5dffe523d 2173 // has_register_write_command: case '0'..'9','A'..'F','a'..'f' letters are reserved for bitstream commands
whismanoid 35:8aa5dffe523d 2174 case '0': case '1': case '2': case '3': case '4':
whismanoid 35:8aa5dffe523d 2175 case '5': case '6': case '7': case '8': case '9':
whismanoid 35:8aa5dffe523d 2176 case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
whismanoid 35:8aa5dffe523d 2177 case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
whismanoid 35:8aa5dffe523d 2178 {
whismanoid 35:8aa5dffe523d 2179 // hexadecimal codes get parsed as bytecodes
whismanoid 30:9eb6eff512e7 2180 //
whismanoid 35:8aa5dffe523d 2181 // parse_byteCount_byteList_dec() assumes all keyword args have already been removed from the buffer
whismanoid 35:8aa5dffe523d 2182 // parse cmdLine byte list --> int byteCount; int mosiData[MAX_SPI_BYTE_COUNT];
whismanoid 35:8aa5dffe523d 2183 #define MAX_SPI_BYTE_COUNT 32
whismanoid 35:8aa5dffe523d 2184 size_t byteCount = byteCount;
whismanoid 35:8aa5dffe523d 2185 static char mosiData[MAX_SPI_BYTE_COUNT];
whismanoid 35:8aa5dffe523d 2186 static char misoData[MAX_SPI_BYTE_COUNT];
whismanoid 35:8aa5dffe523d 2187 if (cmdLine.parse_byteCount_byteList_hex(byteCount, mosiData,
whismanoid 35:8aa5dffe523d 2188 MAX_SPI_BYTE_COUNT))
whismanoid 35:8aa5dffe523d 2189 {
whismanoid 52:d3fb6f1722bf 2190 // TODO: decode operation from commandByte
whismanoid 52:d3fb6f1722bf 2191 // TODO: OVERSIMPLIFICATION: if length is 1 byte then operation is RegRead, otherwise RegWrite
whismanoid 52:d3fb6f1722bf 2192 // register_read_function 'IsRegReadCommand'
whismanoid 35:8aa5dffe523d 2193 // register_write_function 'RegWrite'
whismanoid 35:8aa5dffe523d 2194 // register_name_function 'RegName'
whismanoid 35:8aa5dffe523d 2195 // register_size_function 'RegSize'
whismanoid 52:d3fb6f1722bf 2196 // CODE GENERATOR: does the chip have a defined CMDOP_1aaa_aaaa_ReadRegister bit?
whismanoid 52:d3fb6f1722bf 2197 // MAX11410::MAX11410_CMD_enum_t regAddress = (MAX11410::MAX11410_CMD_enum_t)((mosiData[0] &~ MAX11410::CMDOP_1aaa_aaaa_ReadRegister) & 0xFF);
whismanoid 52:d3fb6f1722bf 2198 MAX11410::MAX11410_CMD_enum_t commandByte = (MAX11410::MAX11410_CMD_enum_t)(mosiData[0]);
whismanoid 52:d3fb6f1722bf 2199 MAX11410::MAX11410_CMDOP_enum_t commandOp = g_MAX11410_device.DecodeCommand(commandByte);
whismanoid 52:d3fb6f1722bf 2200 int regAddress = g_MAX11410_device.RegAddrOfCommand(commandByte);
whismanoid 35:8aa5dffe523d 2201 cmdLine.serial().printf(" regAddress=0x%2.2x\r\n", (regAddress & 0xFF));
whismanoid 52:d3fb6f1722bf 2202 cmdLine.serial().printf(" RegName=%s\r\n", g_MAX11410_device.RegName(commandByte));
whismanoid 35:8aa5dffe523d 2203 uint32_t regData = 0;
whismanoid 52:d3fb6f1722bf 2204 int regSize = g_MAX11410_device.RegSize(commandByte);
whismanoid 35:8aa5dffe523d 2205 cmdLine.serial().printf(" RegSize=%d\r\n", regSize);
whismanoid 35:8aa5dffe523d 2206 switch(regSize)
whismanoid 35:8aa5dffe523d 2207 {
whismanoid 35:8aa5dffe523d 2208 case 8:
whismanoid 35:8aa5dffe523d 2209 regData = ((uint32_t)mosiData[1] & 0xFF);
whismanoid 35:8aa5dffe523d 2210 break;
whismanoid 35:8aa5dffe523d 2211 case 16:
whismanoid 35:8aa5dffe523d 2212 regData = (((uint32_t)mosiData[1] & 0xFF) << 8) + ((uint32_t)mosiData[2] & 0xFF);
whismanoid 35:8aa5dffe523d 2213 break;
whismanoid 35:8aa5dffe523d 2214 case 24:
whismanoid 35:8aa5dffe523d 2215 regData = (((uint32_t)mosiData[1] & 0xFF) << 16) + (((uint32_t)mosiData[2] & 0xFF) << 8) + ((uint32_t)mosiData[3] & 0xFF);
whismanoid 35:8aa5dffe523d 2216 break;
whismanoid 35:8aa5dffe523d 2217 }
whismanoid 52:d3fb6f1722bf 2218 // CODE GENERATOR: does the chip have a defined CMDOP_1aaa_aaaa_ReadRegister bit?
whismanoid 52:d3fb6f1722bf 2219 // if ((byteCount == 1) || (regAddress & MAX11410::CMDOP_1aaa_aaaa_ReadRegister))
whismanoid 52:d3fb6f1722bf 2220 if ((byteCount == 1) || g_MAX11410_device.IsRegReadCommand(commandByte))
whismanoid 35:8aa5dffe523d 2221 {
whismanoid 35:8aa5dffe523d 2222 cmdLine.serial().printf(" RegRead");
whismanoid 52:d3fb6f1722bf 2223 g_MAX11410_device.RegRead(commandByte, &regData);
whismanoid 56:6e9c52cc9abe 2224 cmdLine.serial().printf("regData=0x%6.6lx\r\n", (regData & 0x00FFFFFF));
whismanoid 35:8aa5dffe523d 2225 }
whismanoid 35:8aa5dffe523d 2226 else
whismanoid 35:8aa5dffe523d 2227 {
whismanoid 56:6e9c52cc9abe 2228 cmdLine.serial().printf(" RegWrite regData=0x%6.6lX\r\n", (regData & 0x00FFFFFF));
whismanoid 52:d3fb6f1722bf 2229 g_MAX11410_device.RegWrite(commandByte, regData);
whismanoid 35:8aa5dffe523d 2230 }
whismanoid 35:8aa5dffe523d 2231 // is there support function shadow regValue of regAddr?
whismanoid 35:8aa5dffe523d 2232 }
whismanoid 35:8aa5dffe523d 2233 return true; // command handled by MAX11410
whismanoid 30:9eb6eff512e7 2234 //
whismanoid 35:8aa5dffe523d 2235 } // end case '0'..'9','A'..'F','a'..'f'
whismanoid 29:7d0bc70036be 2236 break;
whismanoid 19:8f951e448ab1 2237 } // end switch (cmdLine[0])
whismanoid 35:8aa5dffe523d 2238 return false; // command not handled by MAX11410
whismanoid 19:8f951e448ab1 2239 } // end bool MAX11410_menu_onEOLcommandParser(CmdLine & cmdLine)
whismanoid 35:8aa5dffe523d 2240
whismanoid 35:8aa5dffe523d 2241 // CODE GENERATOR: class declaration statement close