Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: MaximTinyTester MAX11410 CmdLine USBDevice
Diff: Test_Menu_MAX11410.cpp
- Revision:
- 61:38ec81c33b7a
- Parent:
- 60:f38c54a91794
- Child:
- 62:2fec85611ebe
--- a/Test_Menu_MAX11410.cpp Mon Mar 30 00:18:53 2020 +0000 +++ b/Test_Menu_MAX11410.cpp Mon Apr 06 11:19:35 2020 +0000 @@ -30,8 +30,6 @@ // * ownership rights. // ******************************************************************************* // */ -#include "CmdLine.h" -#include "MaximTinyTester.h" // CODE GENERATOR: class declaration and docstrings // CODE GENERATOR: example code includes // example code includes @@ -97,7 +95,6 @@ // CODE GENERATOR: CommandPost '' // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure' // CODE GENERATOR: CommandDocTest '@test Init() expect 1' -// CODE GENERATOR: CommandDocTest 'TODO1: #169 SelfTest support @test tinyTester.print("message")' // CODE GENERATOR: CommandDocTest '@test RegRead(MAX11410::CMD_r001_0001_xxxx_xxxx_xxxx_xxxx_xxxx_xddd_PART_ID, buffer) expect 1 expect-buffer 0x000F02' // CODE GENERATOR: CommandDocTest '@test RegRead(MAX11410::CMD_r000_0100_dddd_xddd_GP0_CTRL, buffer) expect 1 expect-buffer 0x00' // CODE GENERATOR: CommandDocTest '@test RegRead(MAX11410::CMD_r000_0101_dddd_xddd_GP1_CTRL, buffer) expect 1 expect-buffer 0x00' @@ -113,14 +110,12 @@ // CODE GENERATOR: CommandDocTest '@test RegWrite(0x08, 0x34) expect 1' // CODE GENERATOR: CommandDocTest '@test tinyTester.print("check filter register is readable")' // CODE GENERATOR: CommandDocTest '@test RegRead(0x08, buffer) expect 1 expect-buffer 0x34' -// CODE GENERATOR: CommandDocTest 'TODO1: #169 SelfTest support @test tinyTester.settle_time_msec = 250' // CODE GENERATOR: CommandDocTest '@test tinyTester.settle_time_msec = 250 // default 250' // CODE GENERATOR: CommandDocTest '@test tinyTester.blink_time_msec = 75 // default 75 resume hardware self test' // CODE GENERATOR: CommandDocTest '@test tinyTester.input_timeout_time_msec = 250 // default 250' // CODE GENERATOR: CommandDocTest '@test tinyTester.settle_time_msec = 20 // default 250' // CODE GENERATOR: CommandDocTest '@test tinyTester.blink_time_msec = 20 // quickly speed through the software verification' // CODE GENERATOR: CommandDocTest '@test tinyTester.input_timeout_time_msec = 100 // default 250' -// CODE GENERATOR: CommandDocTest 'TODO1: #169 SelfTest support @test tinyTester.Wait_Output_Settling()' // CODE GENERATOR: CommandDocTest '@test tinyTester.Wait_Output_Settling()' // CODE GENERATOR: MAX11410 Command Name = VoltageOfCode_Unipolar (uint32_t value_u24) --> double // CODE GENERATOR: no Menu item hint in description @@ -429,8 +424,8 @@ // CODE GENERATOR: MAX11410 Command Name = TemperatureOfRTD (double rtd_resistance) --> double // CODE GENERATOR: no Menu item hint in description // 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 -// CODE GENERATOR: Menu item hint description Menu item 'TM' -// CODE GENERATOR: Menu item 'TM' -- Menu item TM +// CODE GENERATOR: Menu item hint description Menu item 'TM' -> tc_voltage, tc_deltaT, tc_Temperature +// CODE GENERATOR: Menu item 'TM' -> tc_voltage, tc_deltaT, tc_Temperature -- Menu item TM // 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 // CODE GENERATOR: MAX11410 helpString: 'TM -- Measure_Thermocouple' // CODE GENERATOR: test menu case 'TM': @@ -447,70 +442,12 @@ // CODE GENERATOR: CommandDocParamIn '@param[in] rtd_ainn = channel RTD low side, default=AINN_SEL_1001_AIN9' // CODE GENERATOR: CommandDocParamOut '' // CODE GENERATOR: CommandPost '@post AINcode[tc_ainp]: measurement result LSB code' +// CODE GENERATOR: CommandPost '@post tc_voltage: raw thermocouple voltage in Volts' +// CODE GENERATOR: CommandPost '@post tc_deltaT: temperature in degC above cold junction' +// CODE GENERATOR: CommandPost '@post tc_Temperature: temperature in degC' // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure' // CODE GENERATOR: MAX11410 Command Name = TemperatureOfTC_TypeK (double tc_voltage) --> double -// CODE GENERATOR: Menu item hint description Menu item 'TK' -// CODE GENERATOR: Menu item 'TK' -- Menu item TK -// CODE GENERATOR: MAX11410 help: TK double tc_voltage -- TemperatureOfTC_TypeK -// CODE GENERATOR: MAX11410 helpString: 'TK tc_voltage=? -- TemperatureOfTC_TypeK' -// CODE GENERATOR: test menu case 'TK': -// CODE GENERATOR: helpString 'TK tc_voltage=? -- TemperatureOfTC_TypeK' -// CODE GENERATOR: CMD_ 'None' -// CODE GENERATOR: CommandName 'TemperatureOfTC_TypeK' -// CODE GENERATOR: CommandParamIn 'double tc_voltage' -// CODE GENERATOR: CommandReturnType 'double' -// CODE GENERATOR: CommandPre '@pre {0}.RTD_Temperature = cold junction temperature, in degrees C' -// CODE GENERATOR: CommandDocParamIn '@param[in] tc_voltage = Thermocouple voltage in volts, default=0.0254' -// CODE GENERATOR: CommandDocParamOut '' -// CODE GENERATOR: CommandPost '' -// CODE GENERATOR: CommandReturn '@return ideal temperature in degrees C, calculated from RTD resistance in ohms' -// CODE GENERATOR: CommandDocTest '@test tinyTester.blink_time_msec = 20 // quickly speed through the software verification' -// CODE GENERATOR: CommandDocTest '@test group TC_1 TemperatureOfTC_TypeK(0.000e-3) expect 0.0 within 0.1 // TC_TypeK at 0C = 0.000mV' -// CODE GENERATOR: CommandDocTest '@test group TC_1 TemperatureOfTC_TypeK(0.039e-3) expect 1.0 within 0.1 // TC_TypeK at 1C = 0.039mV' -// CODE GENERATOR: CommandDocTest '@test group TC_1 TemperatureOfTC_TypeK(0.079e-3) expect 2.0 within 0.1 // TC_TypeK at 2C = 0.079mV' -// CODE GENERATOR: CommandDocTest '@test group TC_1 TemperatureOfTC_TypeK(0.119e-3) expect 3.0 within 0.1 // TC_TypeK at 3C = 0.119mV' -// CODE GENERATOR: CommandDocTest '@test group TC_2 TemperatureOfTC_TypeK(0.158e-3) expect 4.0 within 0.1 // TC_TypeK at 4C = 0.158mV' -// CODE GENERATOR: CommandDocTest '@test group TC_2 TemperatureOfTC_TypeK(0.198e-3) expect 5.0 within 0.1 // TC_TypeK at 5C = 0.198mV' -// CODE GENERATOR: CommandDocTest '@test group TC_2 TemperatureOfTC_TypeK(0.238e-3) expect 6.0 within 0.1 // TC_TypeK at 6C = 0.238mV' -// CODE GENERATOR: CommandDocTest '@test group TC_2 TemperatureOfTC_TypeK(0.2775e-3) expect 7.0 within 0.1 // TC_TypeK at 7C = 0.2775mV' -// CODE GENERATOR: CommandDocTest '@test group TC_2 TemperatureOfTC_TypeK(0.317e-3) expect 8.0 within 0.1 // TC_TypeK at 8C = 0.317mV' -// CODE GENERATOR: CommandDocTest '@test group TC_2 TemperatureOfTC_TypeK(0.357e-3) expect 9.0 within 0.1 // TC_TypeK at 9C = 0.357mV' -// CODE GENERATOR: CommandDocTest '@test group TC_1 TemperatureOfTC_TypeK(0.397e-3) expect 10.0 within 0.1 // TC_TypeK at 10C = 0.397mV' -// CODE GENERATOR: CommandDocTest '@test group TC_1 TemperatureOfTC_TypeK(0.798e-3) expect 20.0 within 0.1 // TC_TypeK at 20C = 0.798mV' -// CODE GENERATOR: CommandDocTest '@test group TC_1 TemperatureOfTC_TypeK(1.081e-3) expect 27.0 within 0.1 // TC_TypeK at 27C = 1.081mV' -// CODE GENERATOR: CommandDocTest '@test group TC_1 TemperatureOfTC_TypeK(1.203e-3) expect 30.0 within 0.1 // TC_TypeK at 30C = 1.203mV' -// CODE GENERATOR: CommandDocTest '@test group TC_1 TemperatureOfTC_TypeK(1.612e-3) expect 40.0 within 0.1 // TC_TypeK at 40C = 1.612mV' -// CODE GENERATOR: CommandDocTest '@test group TC_1 TemperatureOfTC_TypeK(2.023e-3) expect 50.0 within 0.1 // TC_TypeK at 50C = 2.023mV' -// CODE GENERATOR: CommandDocTest '@test group TC_1 TemperatureOfTC_TypeK(2.436e-3) expect 60.0 within 0.1 // TC_TypeK at 60C = 2.436mV' -// CODE GENERATOR: CommandDocTest '@test group TC_1 TemperatureOfTC_TypeK(2.851e-3) expect 70.0 within 0.1 // TC_TypeK at 70C = 2.851mV' -// CODE GENERATOR: CommandDocTest '@test group TC_1 TemperatureOfTC_TypeK(3.267e-3) expect 80.0 within 0.1 // TC_TypeK at 80C = 3.267mV' -// CODE GENERATOR: CommandDocTest '@test group TC_1 TemperatureOfTC_TypeK(3.682e-3) expect 90.0 within 0.1 // TC_TypeK at 90C = 3.682mV' -// CODE GENERATOR: CommandDocTest '@test group TC_1 TemperatureOfTC_TypeK(4.096e-3) expect 100.0 within 0.1 // TC_TypeK at 100C = 4.096mV' -// CODE GENERATOR: CommandDocTest '@test group TC_2 TemperatureOfTC_TypeK(4.509e-3) expect 110.0 within 0.1 // TC_TypeK at 110C = 4.509mV' -// CODE GENERATOR: CommandDocTest '@test group TC_2 TemperatureOfTC_TypeK(4.920e-3) expect 120.0 within 0.1 // TC_TypeK at 120C = 4.920mV' -// CODE GENERATOR: CommandDocTest '@test group TC_2 TemperatureOfTC_TypeK(5.328e-3) expect 130.0 within 0.1 // TC_TypeK at 130C = 5.328mV' -// CODE GENERATOR: CommandDocTest '@test group TC_2 TemperatureOfTC_TypeK(5.735e-3) expect 140.0 within 0.1 // TC_TypeK at 140C = 5.735mV' -// CODE GENERATOR: CommandDocTest '@test group TC_2 TemperatureOfTC_TypeK(6.138e-3) expect 150.0 within 0.1 // TC_TypeK at 150C = 6.138mV' -// CODE GENERATOR: CommandDocTest '@test group TC_2 TemperatureOfTC_TypeK(6.540e-3) expect 160.0 within 0.1 // TC_TypeK at 160C = 6.540mV' -// CODE GENERATOR: CommandDocTest '@test group TC_2 TemperatureOfTC_TypeK(6.941e-3) expect 170.0 within 0.1 // TC_TypeK at 170C = 6.941mV' -// CODE GENERATOR: CommandDocTest '@test group TC_2 TemperatureOfTC_TypeK(7.340e-3) expect 180.0 within 0.1 // TC_TypeK at 180C = 7.340mV' -// CODE GENERATOR: CommandDocTest '@test group TC_1 TemperatureOfTC_TypeK(7.739e-3) expect 190.0 within 0.1 // TC_TypeK at 190C = 7.739mV' -// CODE GENERATOR: CommandDocTest '@test group TC_1 TemperatureOfTC_TypeK(8.138e-3) expect 200.0 within 0.1 // TC_TypeK at 200C = 8.138mV' -// CODE GENERATOR: CommandDocTest '@test group TC_1 TemperatureOfTC_TypeK(8.539e-3) expect 210.0 within 0.1 // TC_TypeK at 210C = 8.539mV' -// CODE GENERATOR: CommandDocTest '@test group TC_1 TemperatureOfTC_TypeK(8.940e-3) expect 220.0 within 0.1 // TC_TypeK at 220C = 8.940mV' -// CODE GENERATOR: CommandDocTest '@test group TC_2 TemperatureOfTC_TypeK(9.343e-3) expect 230.0 within 0.1 // TC_TypeK at 230C = 9.343mV' -// CODE GENERATOR: CommandDocTest '@test group TC_2 TemperatureOfTC_TypeK(9.747e-3) expect 240.0 within 0.1 // TC_TypeK at 240C = 9.747mV' -// CODE GENERATOR: CommandDocTest '@test group TC_2 TemperatureOfTC_TypeK(10.153e-3) expect 250.0 within 0.1 // TC_TypeK at 250C = 10.153mV' -// CODE GENERATOR: CommandDocTest '@test group TC_2 TemperatureOfTC_TypeK(10.561e-3) expect 260.0 within 0.1 // TC_TypeK at 260C = 10.561mV' -// CODE GENERATOR: CommandDocTest '@test group TC_2 TemperatureOfTC_TypeK(10.971e-3) expect 270.0 within 0.1 // TC_TypeK at 270C = 10.971mV' -// CODE GENERATOR: CommandDocTest '@test group TC_2 TemperatureOfTC_TypeK(11.382e-3) expect 280.0 within 0.1 // TC_TypeK at 280C = 11.382mV' -// CODE GENERATOR: CommandDocTest '@test group TC_2 TemperatureOfTC_TypeK(11.795e-3) expect 290.0 within 0.1 // TC_TypeK at 290C = 11.795mV' -// CODE GENERATOR: CommandDocTest '@test group TC_1 TemperatureOfTC_TypeK(12.209e-3) expect 300.0 within 0.1 // TC_TypeK at 300C = 12.209mV' -// CODE GENERATOR: CommandDocTest '@test group TC_2 TemperatureOfTC_TypeK(14.293e-3) expect 350.0 within 0.1 // TC_TypeK at 350C = 14.293mV' -// CODE GENERATOR: CommandDocTest '@test group TC_1 TemperatureOfTC_TypeK(16.397e-3) expect 400.0 within 0.1 // TC_TypeK at 400C = 16.397mV' -// CODE GENERATOR: CommandDocTest '@test group TC_1 TemperatureOfTC_TypeK(18.516e-3) expect 450.0 within 0.1 // TC_TypeK at 450C = 18.516mV' -// CODE GENERATOR: CommandDocTest '@test group TC_1 TemperatureOfTC_TypeK(20.218e-3) expect 490.0 // TC_TypeK at 490C = 20.218mV' -// CODE GENERATOR: CommandDocTest '@test tinyTester.blink_time_msec = 75 // default 75 resume hardware self test' +// CODE GENERATOR: no Menu item hint in description // CODE GENERATOR: MAX11410 Command Name = temperatureDegC_polynomial (double thermocouple_voltage_uV, int num_coefficients, double coefficients[]) --> double // CODE GENERATOR: no Menu item hint in description // CODE GENERATOR: testMenuGlobalArgsDict scan global property list g_MAX11410_device @@ -557,6 +494,27 @@ // CODE GENERATOR: testMenuGlobalArgsDict['RTD_Temperature']['usedByCommandName'] = 'None' // CODE GENERATOR: testMenuGlobalArgsDict['RTD_Temperature']['usedBytestMenuItemName'] = 'None' +// CODE GENERATOR: testMenuGlobalArgsDict add global property g_MAX11410_device.tc_voltage +// CODE GENERATOR: testMenuGlobalArgsDict add global property g_MAX11410_device.tc_voltage argname = tc_voltage +// CODE GENERATOR: testMenuGlobalArgsDict['tc_voltage']['alias'] = 'None' +// CODE GENERATOR: testMenuGlobalArgsDict['tc_voltage']['argtype'] = 'double' +// CODE GENERATOR: testMenuGlobalArgsDict['tc_voltage']['usedByCommandName'] = 'None' +// CODE GENERATOR: testMenuGlobalArgsDict['tc_voltage']['usedBytestMenuItemName'] = 'None' + +// CODE GENERATOR: testMenuGlobalArgsDict add global property g_MAX11410_device.tc_deltaT +// CODE GENERATOR: testMenuGlobalArgsDict add global property g_MAX11410_device.tc_deltaT argname = tc_deltaT +// CODE GENERATOR: testMenuGlobalArgsDict['tc_deltaT']['alias'] = 'None' +// CODE GENERATOR: testMenuGlobalArgsDict['tc_deltaT']['argtype'] = 'double' +// CODE GENERATOR: testMenuGlobalArgsDict['tc_deltaT']['usedByCommandName'] = 'None' +// CODE GENERATOR: testMenuGlobalArgsDict['tc_deltaT']['usedBytestMenuItemName'] = 'None' + +// CODE GENERATOR: testMenuGlobalArgsDict add global property g_MAX11410_device.tc_Temperature +// CODE GENERATOR: testMenuGlobalArgsDict add global property g_MAX11410_device.tc_Temperature argname = tc_Temperature +// CODE GENERATOR: testMenuGlobalArgsDict['tc_Temperature']['alias'] = 'None' +// CODE GENERATOR: testMenuGlobalArgsDict['tc_Temperature']['argtype'] = 'double' +// CODE GENERATOR: testMenuGlobalArgsDict['tc_Temperature']['usedByCommandName'] = 'None' +// CODE GENERATOR: testMenuGlobalArgsDict['tc_Temperature']['usedBytestMenuItemName'] = 'None' + // CODE GENERATOR: testMenuGlobalArgsDict add global property g_MAX11410_device.ctrl // CODE GENERATOR: testMenuGlobalArgsDict add global property g_MAX11410_device.ctrl shadow of argname = ctrl // CODE GENERATOR: testMenuGlobalArgsDict add global property g_MAX11410_device.ctrl argname = ctrl @@ -589,9 +547,29 @@ // CODE GENERATOR: testMenuGlobalArgsDict['data0']['usedBytestMenuItemName'] = 'None' // CODE GENERATOR: testMenuGlobalArgsDict skip array property g_MAX11410_device.AINcode[11] +// CODE GENERATOR: testMenuGlobalArgsDict add global property g_MAX11410_device.futility_countdown_limit +// CODE GENERATOR: testMenuGlobalArgsDict add global property g_MAX11410_device.futility_countdown_limit argname = futility_countdown_limit +// CODE GENERATOR: testMenuGlobalArgsDict['futility_countdown_limit']['alias'] = 'None' +// CODE GENERATOR: testMenuGlobalArgsDict['futility_countdown_limit']['argtype'] = 'int' +// CODE GENERATOR: testMenuGlobalArgsDict['futility_countdown_limit']['usedByCommandName'] = 'None' +// CODE GENERATOR: testMenuGlobalArgsDict['futility_countdown_limit']['usedBytestMenuItemName'] = 'None' + +// CODE GENERATOR: testMenuGlobalArgsDict add global property g_MAX11410_device.readAllStatusList +// CODE GENERATOR: testMenuGlobalArgsDict add global property g_MAX11410_device.readAllStatusList argname = readAllStatusList +// CODE GENERATOR: testMenuGlobalArgsDict['readAllStatusList']['alias'] = 'None' +// CODE GENERATOR: testMenuGlobalArgsDict['readAllStatusList']['argtype'] = 'MAX11410::MAX11410_CMD_enum_t*' +// CODE GENERATOR: testMenuGlobalArgsDict['readAllStatusList']['usedByCommandName'] = 'None' +// CODE GENERATOR: testMenuGlobalArgsDict['readAllStatusList']['usedBytestMenuItemName'] = 'None' + +// CODE GENERATOR: testMenuGlobalArgsDict add global property g_MAX11410_device.readAllStatusListLen +// CODE GENERATOR: testMenuGlobalArgsDict add global property g_MAX11410_device.readAllStatusListLen argname = readAllStatusListLen +// CODE GENERATOR: testMenuGlobalArgsDict['readAllStatusListLen']['alias'] = 'None' +// CODE GENERATOR: testMenuGlobalArgsDict['readAllStatusListLen']['argtype'] = 'uint8_t' +// CODE GENERATOR: testMenuGlobalArgsDict['readAllStatusListLen']['usedByCommandName'] = 'None' +// CODE GENERATOR: testMenuGlobalArgsDict['readAllStatusListLen']['usedBytestMenuItemName'] = 'None' + // CODE GENERATOR: scan testMenuCommand list for items that can be shortened to single character -// CODE GENERATOR: multiple commands begin with character 'T' // CODE GENERATOR: multiple commands begin with character 'X' // CODE GENERATOR: multiple commands begin with character 'X' // CODE GENERATOR: multiple commands begin with character 'X' @@ -609,8 +587,9 @@ // CODE GENERATOR: testMenuCommand '!' already single character // CODE GENERATOR: testMenuCommand '$' already single character // CODE GENERATOR: testMenuCommand 'R' already single character -// CODE GENERATOR: cannot shorten testMenuCommand 'TK' to single character due to duplicates -// CODE GENERATOR: cannot shorten testMenuCommand 'TM' to single character due to duplicates +// CODE GENERATOR: shorten testMenuCommand 'TM' to single character 'T' +// CODE GENERATOR: re.sub pattern:'TM' with repl:'T' in helpString 'TM -- Measure_Thermocouple' +// CODE GENERATOR: updated 'T' help string to 'T -- Measure_Thermocouple' // CODE GENERATOR: testMenuCommand 'V' already single character // CODE GENERATOR: cannot shorten testMenuCommand 'X0' to single character due to duplicates // CODE GENERATOR: cannot shorten testMenuCommand 'X1' to single character due to duplicates @@ -639,12 +618,9 @@ // CODE GENERATOR: command: R // CODE GENERATOR: help: R -- Measure_RTD cmdLine.serial().printf("\r\n R -- Measure_RTD"); - // CODE GENERATOR: command: TK - // CODE GENERATOR: help: TK tc_voltage=? -- TemperatureOfTC_TypeK - cmdLine.serial().printf("\r\n TK tc_voltage=? -- TemperatureOfTC_TypeK"); - // CODE GENERATOR: command: TM - // CODE GENERATOR: help: TM -- Measure_Thermocouple - cmdLine.serial().printf("\r\n TM -- Measure_Thermocouple"); + // CODE GENERATOR: command: T + // CODE GENERATOR: help: T -- Measure_Thermocouple + cmdLine.serial().printf("\r\n T -- Measure_Thermocouple"); // CODE GENERATOR: command: V // CODE GENERATOR: help: V -- Measure_Voltage cmdLine.serial().printf("\r\n V -- Measure_Voltage"); @@ -787,6 +763,17 @@ g_MAX11410_device.data0 = data0; // update global property value } +// CODE GENERATOR: testMenuGlobalArgsDict['futility_countdown_limit']['alias'] = 'None' +// CODE GENERATOR: testMenuGlobalArgsDict['futility_countdown_limit']['argtype'] = 'int' +// CODE GENERATOR: testMenuGlobalArgsDict['futility_countdown_limit']['usedByCommandName'] = 'None' +// CODE GENERATOR: testMenuGlobalArgsDict['futility_countdown_limit']['usedBytestMenuItemName'] = 'None' + // parse argument int futility_countdown_limit + int futility_countdown_limit = g_MAX11410_device.futility_countdown_limit; // default to global property value + if (cmdLine.parse_int_dec("futility_countdown_limit", futility_countdown_limit)) + { + g_MAX11410_device.futility_countdown_limit = futility_countdown_limit; // update global property value + } + // CODE GENERATOR: testMenuGlobalArgsDict['pgaGain']['alias'] = 'None' // CODE GENERATOR: testMenuGlobalArgsDict['pgaGain']['argtype'] = 'uint8_t' // CODE GENERATOR: testMenuGlobalArgsDict['pgaGain']['usedByCommandName'] = 'None' @@ -798,6 +785,17 @@ g_MAX11410_device.pgaGain = pgaGain; // update global property value } +// CODE GENERATOR: testMenuGlobalArgsDict['readAllStatusListLen']['alias'] = 'None' +// CODE GENERATOR: testMenuGlobalArgsDict['readAllStatusListLen']['argtype'] = 'uint8_t' +// CODE GENERATOR: testMenuGlobalArgsDict['readAllStatusListLen']['usedByCommandName'] = 'None' +// CODE GENERATOR: testMenuGlobalArgsDict['readAllStatusListLen']['usedBytestMenuItemName'] = 'None' + // parse argument uint8_t readAllStatusListLen + uint8_t readAllStatusListLen = g_MAX11410_device.readAllStatusListLen; // default to global property value + if (cmdLine.parse_uint8_dec("readAllStatusListLen", readAllStatusListLen)) + { + g_MAX11410_device.readAllStatusListLen = readAllStatusListLen; // update global property value + } + // CODE GENERATOR: testMenuGlobalArgsDict['rtd_resistance']['alias'] = 'None' // CODE GENERATOR: testMenuGlobalArgsDict['rtd_resistance']['argtype'] = 'double' // CODE GENERATOR: testMenuGlobalArgsDict['rtd_resistance']['usedByCommandName'] = 'None' @@ -820,6 +818,39 @@ g_MAX11410_device.status = status; // update global property value } +// CODE GENERATOR: testMenuGlobalArgsDict['tc_Temperature']['alias'] = 'None' +// CODE GENERATOR: testMenuGlobalArgsDict['tc_Temperature']['argtype'] = 'double' +// CODE GENERATOR: testMenuGlobalArgsDict['tc_Temperature']['usedByCommandName'] = 'None' +// CODE GENERATOR: testMenuGlobalArgsDict['tc_Temperature']['usedBytestMenuItemName'] = 'None' + // parse argument double tc_Temperature + double tc_Temperature = g_MAX11410_device.tc_Temperature; // default to global property value + if (cmdLine.parse_double("tc_Temperature", tc_Temperature)) + { + g_MAX11410_device.tc_Temperature = tc_Temperature; // update global property value + } + +// CODE GENERATOR: testMenuGlobalArgsDict['tc_deltaT']['alias'] = 'None' +// CODE GENERATOR: testMenuGlobalArgsDict['tc_deltaT']['argtype'] = 'double' +// CODE GENERATOR: testMenuGlobalArgsDict['tc_deltaT']['usedByCommandName'] = 'None' +// CODE GENERATOR: testMenuGlobalArgsDict['tc_deltaT']['usedBytestMenuItemName'] = 'None' + // parse argument double tc_deltaT + double tc_deltaT = g_MAX11410_device.tc_deltaT; // default to global property value + if (cmdLine.parse_double("tc_deltaT", tc_deltaT)) + { + g_MAX11410_device.tc_deltaT = tc_deltaT; // update global property value + } + +// CODE GENERATOR: testMenuGlobalArgsDict['tc_voltage']['alias'] = 'None' +// CODE GENERATOR: testMenuGlobalArgsDict['tc_voltage']['argtype'] = 'double' +// CODE GENERATOR: testMenuGlobalArgsDict['tc_voltage']['usedByCommandName'] = 'None' +// CODE GENERATOR: testMenuGlobalArgsDict['tc_voltage']['usedBytestMenuItemName'] = 'None' + // parse argument double tc_voltage + double tc_voltage = g_MAX11410_device.tc_voltage; // default to global property value + if (cmdLine.parse_double("tc_voltage", tc_voltage)) + { + g_MAX11410_device.tc_voltage = tc_voltage; // update global property value + } + switch (cmdLine[0]) { // CODE GENERATOR: generate * command read/write reg *reg? *reg=value @@ -861,39 +892,9 @@ Callback<void(size_t, uint8_t*, uint8_t*)> saved_onSPIprint_handler = g_MAX11410_device.onSPIprint; g_MAX11410_device.onSPIprint = NULL; // temporarily suppress SPI diagnostic messages // read "all" registers by name - // TODO: KLUDGE: this constant array should live in the device driver, not the menu - const MAX11410::MAX11410_CMD_enum_t readAllStatusList[] = { - MAX11410::CMD_r000_0000_xxxx_xxdd_PD, - MAX11410::CMD_r000_0001_xddd_xxdd_CONV_START, - MAX11410::CMD_r000_0010_xddd_dddd_SEQ_START, - MAX11410::CMD_r000_0011_xxxx_xddd_CAL_START, - MAX11410::CMD_r000_0100_dddd_xddd_GP0_CTRL, - MAX11410::CMD_r000_0101_dddd_xddd_GP1_CTRL, - MAX11410::CMD_r000_0110_xddd_xxdd_GP_CONV, - MAX11410::CMD_r000_0111_xddd_dddd_GP_SEQ_ADDR, - MAX11410::CMD_r000_1000_x0dd_dddd_FILTER, - MAX11410::CMD_r000_1001_dddd_dddd_CTRL, - MAX11410::CMD_r000_1010_dddd_dddd_SOURCE, - MAX11410::CMD_r000_1011_dddd_dddd_MUX_CTRL0, - MAX11410::CMD_r000_1100_dddd_dddd_MUX_CTRL1, - MAX11410::CMD_r000_1101_dddd_dddd_MUX_CTRL2, - MAX11410::CMD_r000_1110_xxdd_xddd_PGA, - MAX11410::CMD_r000_1111_dddd_dddd_WAIT_EXT, - MAX11410::CMD_r001_0000_xxxx_xxxx_WAIT_START, - MAX11410::CMD_r001_0001_xxxx_xxxx_xxxx_xxxx_xxxx_xddd_PART_ID, - MAX11410::CMD_r011_0000_dddd_dddd_dddd_dddd_dddd_dddd_DATA0, - MAX11410::CMD_r011_0001_dddd_dddd_dddd_dddd_dddd_dddd_DATA1, - MAX11410::CMD_r011_0010_dddd_dddd_dddd_dddd_dddd_dddd_DATA2, - MAX11410::CMD_r011_0011_dddd_dddd_dddd_dddd_dddd_dddd_DATA3, - MAX11410::CMD_r011_0100_dddd_dddd_dddd_dddd_dddd_dddd_DATA4, - MAX11410::CMD_r011_0101_dddd_dddd_dddd_dddd_dddd_dddd_DATA5, - MAX11410::CMD_r011_0110_dddd_dddd_dddd_dddd_dddd_dddd_DATA6, - MAX11410::CMD_r011_0111_dddd_dddd_dddd_dddd_dddd_dddd_DATA7, - MAX11410::CMD_r011_1000_dddd_dddd_dddd_dddd_dxxx_dddd_STATUS, - }; - for (uint8_t readAllStatusIndex = 0; readAllStatusIndex < (sizeof(readAllStatusList)/sizeof(MAX11410::MAX11410_CMD_enum_t)); readAllStatusIndex++) + for (uint8_t readAllStatusIndex = 0; readAllStatusIndex < g_MAX11410_device.readAllStatusListLen; readAllStatusIndex++) { - MAX11410::MAX11410_CMD_enum_t regAddress = readAllStatusList[readAllStatusIndex]; + MAX11410::MAX11410_CMD_enum_t regAddress = g_MAX11410_device.readAllStatusList[readAllStatusIndex]; uint32_t regData = 0; if (g_MAX11410_device.RegSize(regAddress) == 0) continue; // skip undefined regs if (g_MAX11410_device.RegRead(regAddress, ®Data) == 0) continue; // skip unreadable regs @@ -925,6 +926,15 @@ // CODE GENERATOR: @ command print double g_MAX11410_device.RTD_Temperature cmdLine.serial().printf("RTD_Temperature = "); cmdLine.serial().printf("%f\r\n", g_MAX11410_device.RTD_Temperature); +// CODE GENERATOR: @ command print double g_MAX11410_device.tc_voltage + cmdLine.serial().printf("tc_voltage = "); + cmdLine.serial().printf("%f\r\n", g_MAX11410_device.tc_voltage); +// CODE GENERATOR: @ command print double g_MAX11410_device.tc_deltaT + cmdLine.serial().printf("tc_deltaT = "); + cmdLine.serial().printf("%f\r\n", g_MAX11410_device.tc_deltaT); +// CODE GENERATOR: @ command print double g_MAX11410_device.tc_Temperature + cmdLine.serial().printf("tc_Temperature = "); + cmdLine.serial().printf("%f\r\n", g_MAX11410_device.tc_Temperature); // CODE GENERATOR: @ command print uint32_t g_MAX11410_device.ctrl cmdLine.serial().printf("ctrl = "); cmdLine.serial().printf("%ld = 0x%8.8lx\r\n", g_MAX11410_device.ctrl, g_MAX11410_device.ctrl); @@ -942,6 +952,9 @@ cmdLine.serial().printf("AINcode[%d] = ", index); cmdLine.serial().printf("%ld = 0x%8.8lx\r\n", g_MAX11410_device.AINcode[index], g_MAX11410_device.AINcode[index]); } +// CODE GENERATOR: @ command print int g_MAX11410_device.futility_countdown_limit + cmdLine.serial().printf("futility_countdown_limit = "); + cmdLine.serial().printf("%ld = 0x%8.8lx\r\n", g_MAX11410_device.futility_countdown_limit, g_MAX11410_device.futility_countdown_limit); return true; // command handled by MAX11410 break; } @@ -965,7 +978,6 @@ // CODE GENERATOR: CommandPost '' // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure' // CODE GENERATOR: CommandTest '@test Init() expect 1' -// CODE GENERATOR: CommandTest 'TODO1: #169 SelfTest support @test tinyTester.print("message")' // CODE GENERATOR: CommandTest '@test RegRead(MAX11410::CMD_r001_0001_xxxx_xxxx_xxxx_xxxx_xxxx_xddd_PART_ID, buffer) expect 1 expect-buffer 0x000F02' // CODE GENERATOR: CommandTest '@test RegRead(MAX11410::CMD_r000_0100_dddd_xddd_GP0_CTRL, buffer) expect 1 expect-buffer 0x00' // CODE GENERATOR: CommandTest '@test RegRead(MAX11410::CMD_r000_0101_dddd_xddd_GP1_CTRL, buffer) expect 1 expect-buffer 0x00' @@ -981,14 +993,12 @@ // CODE GENERATOR: CommandTest '@test RegWrite(0x08, 0x34) expect 1' // CODE GENERATOR: CommandTest '@test tinyTester.print("check filter register is readable")' // CODE GENERATOR: CommandTest '@test RegRead(0x08, buffer) expect 1 expect-buffer 0x34' -// CODE GENERATOR: CommandTest 'TODO1: #169 SelfTest support @test tinyTester.settle_time_msec = 250' // CODE GENERATOR: CommandTest '@test tinyTester.settle_time_msec = 250 // default 250' // CODE GENERATOR: CommandTest '@test tinyTester.blink_time_msec = 75 // default 75 resume hardware self test' // CODE GENERATOR: CommandTest '@test tinyTester.input_timeout_time_msec = 250 // default 250' // CODE GENERATOR: CommandTest '@test tinyTester.settle_time_msec = 20 // default 250' // CODE GENERATOR: CommandTest '@test tinyTester.blink_time_msec = 20 // quickly speed through the software verification' // CODE GENERATOR: CommandTest '@test tinyTester.input_timeout_time_msec = 100 // default 250' -// CODE GENERATOR: CommandTest 'TODO1: #169 SelfTest support @test tinyTester.Wait_Output_Settling()' // CODE GENERATOR: CommandTest '@test tinyTester.Wait_Output_Settling()' // case '!': // (single character) (testMenuFirstCharHandler="None") case '!': @@ -1006,7 +1016,6 @@ // displayPost='' // @Return='@return 1 on success; 0 on failure' // @Test='@test Init() expect 1' - // @Test='TODO1: #169 SelfTest support @test tinyTester.print("message")' // @Test='@test RegRead(MAX11410::CMD_r001_0001_xxxx_xxxx_xxxx_xxxx_xxxx_xddd_PART_ID, buffer) expect 1 expect-buffer 0x000F02' // @Test='@test RegRead(MAX11410::CMD_r000_0100_dddd_xddd_GP0_CTRL, buffer) expect 1 expect-buffer 0x00' // @Test='@test RegRead(MAX11410::CMD_r000_0101_dddd_xddd_GP1_CTRL, buffer) expect 1 expect-buffer 0x00' @@ -1022,14 +1031,12 @@ // @Test='@test RegWrite(0x08, 0x34) expect 1' // @Test='@test tinyTester.print("check filter register is readable")' // @Test='@test RegRead(0x08, buffer) expect 1 expect-buffer 0x34' - // @Test='TODO1: #169 SelfTest support @test tinyTester.settle_time_msec = 250' // @Test='@test tinyTester.settle_time_msec = 250 // default 250' // @Test='@test tinyTester.blink_time_msec = 75 // default 75 resume hardware self test' // @Test='@test tinyTester.input_timeout_time_msec = 250 // default 250' // @Test='@test tinyTester.settle_time_msec = 20 // default 250' // @Test='@test tinyTester.blink_time_msec = 20 // quickly speed through the software verification' // @Test='@test tinyTester.input_timeout_time_msec = 100 // default 250' - // @Test='TODO1: #169 SelfTest support @test tinyTester.Wait_Output_Settling()' // @Test='@test tinyTester.Wait_Output_Settling()' cmdLine.serial().printf("Init"); // call function Init @@ -1158,161 +1165,16 @@ double result = g_MAX11410_device.Measure_RTD(rtd_iout, rtd_ainp, rtd_ainn); cmdLine.serial().printf(" =%f\r\n", result); // Menu item 'R' -> rtd_resistance, RTD_Temperature - cmdLine.serial().printf("%s=%f\r\n", "rtd_resistance", g_MAX11410_device.rtd_resistance); - cmdLine.serial().printf("%s=%f\r\n", "RTD_Temperature", g_MAX11410_device.RTD_Temperature); + cmdLine.serial().printf("%s=%1.6f\r\n", "rtd_resistance", g_MAX11410_device.rtd_resistance); + cmdLine.serial().printf("%s=%1.6f\r\n", "RTD_Temperature", g_MAX11410_device.RTD_Temperature); return true; // command handled by MAX11410 // CODE GENERATOR: bottom of loop: testMenuCommand="R", testMenuFirstCharHandler="None" } // end case 'R' break; -// CODE GENERATOR: top of loop: testMenuCommand="TK", testMenuFirstCharHandler="None" -// CODE GENERATOR: test menu case 'TK': -// CODE GENERATOR: helpString 'TK tc_voltage=? -- TemperatureOfTC_TypeK' -// CODE GENERATOR: CMD_ 'None' -// CODE GENERATOR: CommandName 'TemperatureOfTC_TypeK' -// CODE GENERATOR: CommandParamIn 'double tc_voltage' -// CODE GENERATOR: CommandReturnType 'double' -// CODE GENERATOR: CommandPre '@pre {0}.RTD_Temperature = cold junction temperature, in degrees C' -// CODE GENERATOR: CommandDocParamIn '@param[in] tc_voltage = Thermocouple voltage in volts, default=0.0254' -// CODE GENERATOR: CommandDocParamOut '' -// CODE GENERATOR: CommandPost '' -// CODE GENERATOR: CommandReturn '@return ideal temperature in degrees C, calculated from RTD resistance in ohms' -// CODE GENERATOR: CommandTest '@test tinyTester.blink_time_msec = 20 // quickly speed through the software verification' -// CODE GENERATOR: CommandTest '@test group TC_1 TemperatureOfTC_TypeK(0.000e-3) expect 0.0 within 0.1 // TC_TypeK at 0C = 0.000mV' -// CODE GENERATOR: CommandTest '@test group TC_1 TemperatureOfTC_TypeK(0.039e-3) expect 1.0 within 0.1 // TC_TypeK at 1C = 0.039mV' -// CODE GENERATOR: CommandTest '@test group TC_1 TemperatureOfTC_TypeK(0.079e-3) expect 2.0 within 0.1 // TC_TypeK at 2C = 0.079mV' -// CODE GENERATOR: CommandTest '@test group TC_1 TemperatureOfTC_TypeK(0.119e-3) expect 3.0 within 0.1 // TC_TypeK at 3C = 0.119mV' -// CODE GENERATOR: CommandTest '@test group TC_2 TemperatureOfTC_TypeK(0.158e-3) expect 4.0 within 0.1 // TC_TypeK at 4C = 0.158mV' -// CODE GENERATOR: CommandTest '@test group TC_2 TemperatureOfTC_TypeK(0.198e-3) expect 5.0 within 0.1 // TC_TypeK at 5C = 0.198mV' -// CODE GENERATOR: CommandTest '@test group TC_2 TemperatureOfTC_TypeK(0.238e-3) expect 6.0 within 0.1 // TC_TypeK at 6C = 0.238mV' -// CODE GENERATOR: CommandTest '@test group TC_2 TemperatureOfTC_TypeK(0.2775e-3) expect 7.0 within 0.1 // TC_TypeK at 7C = 0.2775mV' -// CODE GENERATOR: CommandTest '@test group TC_2 TemperatureOfTC_TypeK(0.317e-3) expect 8.0 within 0.1 // TC_TypeK at 8C = 0.317mV' -// CODE GENERATOR: CommandTest '@test group TC_2 TemperatureOfTC_TypeK(0.357e-3) expect 9.0 within 0.1 // TC_TypeK at 9C = 0.357mV' -// CODE GENERATOR: CommandTest '@test group TC_1 TemperatureOfTC_TypeK(0.397e-3) expect 10.0 within 0.1 // TC_TypeK at 10C = 0.397mV' -// CODE GENERATOR: CommandTest '@test group TC_1 TemperatureOfTC_TypeK(0.798e-3) expect 20.0 within 0.1 // TC_TypeK at 20C = 0.798mV' -// CODE GENERATOR: CommandTest '@test group TC_1 TemperatureOfTC_TypeK(1.081e-3) expect 27.0 within 0.1 // TC_TypeK at 27C = 1.081mV' -// CODE GENERATOR: CommandTest '@test group TC_1 TemperatureOfTC_TypeK(1.203e-3) expect 30.0 within 0.1 // TC_TypeK at 30C = 1.203mV' -// CODE GENERATOR: CommandTest '@test group TC_1 TemperatureOfTC_TypeK(1.612e-3) expect 40.0 within 0.1 // TC_TypeK at 40C = 1.612mV' -// CODE GENERATOR: CommandTest '@test group TC_1 TemperatureOfTC_TypeK(2.023e-3) expect 50.0 within 0.1 // TC_TypeK at 50C = 2.023mV' -// CODE GENERATOR: CommandTest '@test group TC_1 TemperatureOfTC_TypeK(2.436e-3) expect 60.0 within 0.1 // TC_TypeK at 60C = 2.436mV' -// CODE GENERATOR: CommandTest '@test group TC_1 TemperatureOfTC_TypeK(2.851e-3) expect 70.0 within 0.1 // TC_TypeK at 70C = 2.851mV' -// CODE GENERATOR: CommandTest '@test group TC_1 TemperatureOfTC_TypeK(3.267e-3) expect 80.0 within 0.1 // TC_TypeK at 80C = 3.267mV' -// CODE GENERATOR: CommandTest '@test group TC_1 TemperatureOfTC_TypeK(3.682e-3) expect 90.0 within 0.1 // TC_TypeK at 90C = 3.682mV' -// CODE GENERATOR: CommandTest '@test group TC_1 TemperatureOfTC_TypeK(4.096e-3) expect 100.0 within 0.1 // TC_TypeK at 100C = 4.096mV' -// CODE GENERATOR: CommandTest '@test group TC_2 TemperatureOfTC_TypeK(4.509e-3) expect 110.0 within 0.1 // TC_TypeK at 110C = 4.509mV' -// CODE GENERATOR: CommandTest '@test group TC_2 TemperatureOfTC_TypeK(4.920e-3) expect 120.0 within 0.1 // TC_TypeK at 120C = 4.920mV' -// CODE GENERATOR: CommandTest '@test group TC_2 TemperatureOfTC_TypeK(5.328e-3) expect 130.0 within 0.1 // TC_TypeK at 130C = 5.328mV' -// CODE GENERATOR: CommandTest '@test group TC_2 TemperatureOfTC_TypeK(5.735e-3) expect 140.0 within 0.1 // TC_TypeK at 140C = 5.735mV' -// CODE GENERATOR: CommandTest '@test group TC_2 TemperatureOfTC_TypeK(6.138e-3) expect 150.0 within 0.1 // TC_TypeK at 150C = 6.138mV' -// CODE GENERATOR: CommandTest '@test group TC_2 TemperatureOfTC_TypeK(6.540e-3) expect 160.0 within 0.1 // TC_TypeK at 160C = 6.540mV' -// CODE GENERATOR: CommandTest '@test group TC_2 TemperatureOfTC_TypeK(6.941e-3) expect 170.0 within 0.1 // TC_TypeK at 170C = 6.941mV' -// CODE GENERATOR: CommandTest '@test group TC_2 TemperatureOfTC_TypeK(7.340e-3) expect 180.0 within 0.1 // TC_TypeK at 180C = 7.340mV' -// CODE GENERATOR: CommandTest '@test group TC_1 TemperatureOfTC_TypeK(7.739e-3) expect 190.0 within 0.1 // TC_TypeK at 190C = 7.739mV' -// CODE GENERATOR: CommandTest '@test group TC_1 TemperatureOfTC_TypeK(8.138e-3) expect 200.0 within 0.1 // TC_TypeK at 200C = 8.138mV' -// CODE GENERATOR: CommandTest '@test group TC_1 TemperatureOfTC_TypeK(8.539e-3) expect 210.0 within 0.1 // TC_TypeK at 210C = 8.539mV' -// CODE GENERATOR: CommandTest '@test group TC_1 TemperatureOfTC_TypeK(8.940e-3) expect 220.0 within 0.1 // TC_TypeK at 220C = 8.940mV' -// CODE GENERATOR: CommandTest '@test group TC_2 TemperatureOfTC_TypeK(9.343e-3) expect 230.0 within 0.1 // TC_TypeK at 230C = 9.343mV' -// CODE GENERATOR: CommandTest '@test group TC_2 TemperatureOfTC_TypeK(9.747e-3) expect 240.0 within 0.1 // TC_TypeK at 240C = 9.747mV' -// CODE GENERATOR: CommandTest '@test group TC_2 TemperatureOfTC_TypeK(10.153e-3) expect 250.0 within 0.1 // TC_TypeK at 250C = 10.153mV' -// CODE GENERATOR: CommandTest '@test group TC_2 TemperatureOfTC_TypeK(10.561e-3) expect 260.0 within 0.1 // TC_TypeK at 260C = 10.561mV' -// CODE GENERATOR: CommandTest '@test group TC_2 TemperatureOfTC_TypeK(10.971e-3) expect 270.0 within 0.1 // TC_TypeK at 270C = 10.971mV' -// CODE GENERATOR: CommandTest '@test group TC_2 TemperatureOfTC_TypeK(11.382e-3) expect 280.0 within 0.1 // TC_TypeK at 280C = 11.382mV' -// CODE GENERATOR: CommandTest '@test group TC_2 TemperatureOfTC_TypeK(11.795e-3) expect 290.0 within 0.1 // TC_TypeK at 290C = 11.795mV' -// CODE GENERATOR: CommandTest '@test group TC_1 TemperatureOfTC_TypeK(12.209e-3) expect 300.0 within 0.1 // TC_TypeK at 300C = 12.209mV' -// CODE GENERATOR: CommandTest '@test group TC_2 TemperatureOfTC_TypeK(14.293e-3) expect 350.0 within 0.1 // TC_TypeK at 350C = 14.293mV' -// CODE GENERATOR: CommandTest '@test group TC_1 TemperatureOfTC_TypeK(16.397e-3) expect 400.0 within 0.1 // TC_TypeK at 400C = 16.397mV' -// CODE GENERATOR: CommandTest '@test group TC_1 TemperatureOfTC_TypeK(18.516e-3) expect 450.0 within 0.1 // TC_TypeK at 450C = 18.516mV' -// CODE GENERATOR: CommandTest '@test group TC_1 TemperatureOfTC_TypeK(20.218e-3) expect 490.0 // TC_TypeK at 490C = 20.218mV' -// CODE GENERATOR: CommandTest '@test tinyTester.blink_time_msec = 75 // default 75 resume hardware self test' - case 'T': // (multiple characters) (testMenuFirstCharHandler="T"): - { - switch (cmdLine[1]) - { - case 'K': // (nested inside case 'T') - { - // test menu command 'TK' handler: - // helpString='TK tc_voltage=? -- TemperatureOfTC_TypeK' - // CMD_='None' - // CommandName='TemperatureOfTC_TypeK' - // CommandParamIn='double tc_voltage' - // CommandReturnType='double' - // @Pre='@pre {0}.RTD_Temperature = cold junction temperature, in degrees C' - // @Param[in]='@param[in] tc_voltage = Thermocouple voltage in volts, default=0.0254' - // @Param[out]='' - // @Post='' - // displayPost='' - // @Return='@return ideal temperature in degrees C, calculated from RTD resistance in ohms' - // @Test='@test tinyTester.blink_time_msec = 20 // quickly speed through the software verification' - // @Test='@test group TC_1 TemperatureOfTC_TypeK(0.000e-3) expect 0.0 within 0.1 // TC_TypeK at 0C = 0.000mV' - // @Test='@test group TC_1 TemperatureOfTC_TypeK(0.039e-3) expect 1.0 within 0.1 // TC_TypeK at 1C = 0.039mV' - // @Test='@test group TC_1 TemperatureOfTC_TypeK(0.079e-3) expect 2.0 within 0.1 // TC_TypeK at 2C = 0.079mV' - // @Test='@test group TC_1 TemperatureOfTC_TypeK(0.119e-3) expect 3.0 within 0.1 // TC_TypeK at 3C = 0.119mV' - // @Test='@test group TC_2 TemperatureOfTC_TypeK(0.158e-3) expect 4.0 within 0.1 // TC_TypeK at 4C = 0.158mV' - // @Test='@test group TC_2 TemperatureOfTC_TypeK(0.198e-3) expect 5.0 within 0.1 // TC_TypeK at 5C = 0.198mV' - // @Test='@test group TC_2 TemperatureOfTC_TypeK(0.238e-3) expect 6.0 within 0.1 // TC_TypeK at 6C = 0.238mV' - // @Test='@test group TC_2 TemperatureOfTC_TypeK(0.2775e-3) expect 7.0 within 0.1 // TC_TypeK at 7C = 0.2775mV' - // @Test='@test group TC_2 TemperatureOfTC_TypeK(0.317e-3) expect 8.0 within 0.1 // TC_TypeK at 8C = 0.317mV' - // @Test='@test group TC_2 TemperatureOfTC_TypeK(0.357e-3) expect 9.0 within 0.1 // TC_TypeK at 9C = 0.357mV' - // @Test='@test group TC_1 TemperatureOfTC_TypeK(0.397e-3) expect 10.0 within 0.1 // TC_TypeK at 10C = 0.397mV' - // @Test='@test group TC_1 TemperatureOfTC_TypeK(0.798e-3) expect 20.0 within 0.1 // TC_TypeK at 20C = 0.798mV' - // @Test='@test group TC_1 TemperatureOfTC_TypeK(1.081e-3) expect 27.0 within 0.1 // TC_TypeK at 27C = 1.081mV' - // @Test='@test group TC_1 TemperatureOfTC_TypeK(1.203e-3) expect 30.0 within 0.1 // TC_TypeK at 30C = 1.203mV' - // @Test='@test group TC_1 TemperatureOfTC_TypeK(1.612e-3) expect 40.0 within 0.1 // TC_TypeK at 40C = 1.612mV' - // @Test='@test group TC_1 TemperatureOfTC_TypeK(2.023e-3) expect 50.0 within 0.1 // TC_TypeK at 50C = 2.023mV' - // @Test='@test group TC_1 TemperatureOfTC_TypeK(2.436e-3) expect 60.0 within 0.1 // TC_TypeK at 60C = 2.436mV' - // @Test='@test group TC_1 TemperatureOfTC_TypeK(2.851e-3) expect 70.0 within 0.1 // TC_TypeK at 70C = 2.851mV' - // @Test='@test group TC_1 TemperatureOfTC_TypeK(3.267e-3) expect 80.0 within 0.1 // TC_TypeK at 80C = 3.267mV' - // @Test='@test group TC_1 TemperatureOfTC_TypeK(3.682e-3) expect 90.0 within 0.1 // TC_TypeK at 90C = 3.682mV' - // @Test='@test group TC_1 TemperatureOfTC_TypeK(4.096e-3) expect 100.0 within 0.1 // TC_TypeK at 100C = 4.096mV' - // @Test='@test group TC_2 TemperatureOfTC_TypeK(4.509e-3) expect 110.0 within 0.1 // TC_TypeK at 110C = 4.509mV' - // @Test='@test group TC_2 TemperatureOfTC_TypeK(4.920e-3) expect 120.0 within 0.1 // TC_TypeK at 120C = 4.920mV' - // @Test='@test group TC_2 TemperatureOfTC_TypeK(5.328e-3) expect 130.0 within 0.1 // TC_TypeK at 130C = 5.328mV' - // @Test='@test group TC_2 TemperatureOfTC_TypeK(5.735e-3) expect 140.0 within 0.1 // TC_TypeK at 140C = 5.735mV' - // @Test='@test group TC_2 TemperatureOfTC_TypeK(6.138e-3) expect 150.0 within 0.1 // TC_TypeK at 150C = 6.138mV' - // @Test='@test group TC_2 TemperatureOfTC_TypeK(6.540e-3) expect 160.0 within 0.1 // TC_TypeK at 160C = 6.540mV' - // @Test='@test group TC_2 TemperatureOfTC_TypeK(6.941e-3) expect 170.0 within 0.1 // TC_TypeK at 170C = 6.941mV' - // @Test='@test group TC_2 TemperatureOfTC_TypeK(7.340e-3) expect 180.0 within 0.1 // TC_TypeK at 180C = 7.340mV' - // @Test='@test group TC_1 TemperatureOfTC_TypeK(7.739e-3) expect 190.0 within 0.1 // TC_TypeK at 190C = 7.739mV' - // @Test='@test group TC_1 TemperatureOfTC_TypeK(8.138e-3) expect 200.0 within 0.1 // TC_TypeK at 200C = 8.138mV' - // @Test='@test group TC_1 TemperatureOfTC_TypeK(8.539e-3) expect 210.0 within 0.1 // TC_TypeK at 210C = 8.539mV' - // @Test='@test group TC_1 TemperatureOfTC_TypeK(8.940e-3) expect 220.0 within 0.1 // TC_TypeK at 220C = 8.940mV' - // @Test='@test group TC_2 TemperatureOfTC_TypeK(9.343e-3) expect 230.0 within 0.1 // TC_TypeK at 230C = 9.343mV' - // @Test='@test group TC_2 TemperatureOfTC_TypeK(9.747e-3) expect 240.0 within 0.1 // TC_TypeK at 240C = 9.747mV' - // @Test='@test group TC_2 TemperatureOfTC_TypeK(10.153e-3) expect 250.0 within 0.1 // TC_TypeK at 250C = 10.153mV' - // @Test='@test group TC_2 TemperatureOfTC_TypeK(10.561e-3) expect 260.0 within 0.1 // TC_TypeK at 260C = 10.561mV' - // @Test='@test group TC_2 TemperatureOfTC_TypeK(10.971e-3) expect 270.0 within 0.1 // TC_TypeK at 270C = 10.971mV' - // @Test='@test group TC_2 TemperatureOfTC_TypeK(11.382e-3) expect 280.0 within 0.1 // TC_TypeK at 280C = 11.382mV' - // @Test='@test group TC_2 TemperatureOfTC_TypeK(11.795e-3) expect 290.0 within 0.1 // TC_TypeK at 290C = 11.795mV' - // @Test='@test group TC_1 TemperatureOfTC_TypeK(12.209e-3) expect 300.0 within 0.1 // TC_TypeK at 300C = 12.209mV' - // @Test='@test group TC_2 TemperatureOfTC_TypeK(14.293e-3) expect 350.0 within 0.1 // TC_TypeK at 350C = 14.293mV' - // @Test='@test group TC_1 TemperatureOfTC_TypeK(16.397e-3) expect 400.0 within 0.1 // TC_TypeK at 400C = 16.397mV' - // @Test='@test group TC_1 TemperatureOfTC_TypeK(18.516e-3) expect 450.0 within 0.1 // TC_TypeK at 450C = 18.516mV' - // @Test='@test group TC_1 TemperatureOfTC_TypeK(20.218e-3) expect 490.0 // TC_TypeK at 490C = 20.218mV' - // @Test='@test tinyTester.blink_time_msec = 75 // default 75 resume hardware self test' - // parse argument list - // argname default_argvalue numeric literal specified in CommandDocParamIn @Param[in]='@param[in] tc_voltage = Thermocouple voltage in volts, default=0.0254' - // parse argument double tc_voltage - double tc_voltage = (double)0; // --- g_MAX11410_device.__WARNING_no_match_for_argname_tc_voltage_in_MAX11410_device_t__; // default to global property value - if (cmdLine.parse_double("tc_voltage", tc_voltage)) - { - // g_MAX11410_device.__WARNING_no_match_for_argname_tc_voltage_in_MAX11410_device_t__ = tc_voltage; // update global property value - } - // print arguments - cmdLine.serial().printf("TemperatureOfTC_TypeK"); - cmdLine.serial().printf(" tc_voltage=%f", tc_voltage); - cmdLine.serial().printf("\r\n"); - // call function TemperatureOfTC_TypeK(tc_voltage) - double result = g_MAX11410_device.TemperatureOfTC_TypeK(tc_voltage); - cmdLine.serial().printf(" =%f\r\n", result); - return true; // command handled by MAX11410 -// CODE GENERATOR: bottom of loop: testMenuCommand="TK", testMenuFirstCharHandler="T" - } // end nested case 'TK' - break; - -// CODE GENERATOR: top of loop: testMenuCommand="TM", testMenuFirstCharHandler="T" -// CODE GENERATOR: top of loop: nested switch "T" is currently open -// CODE GENERATOR: test menu case 'TM': -// CODE GENERATOR: helpString 'TM -- Measure_Thermocouple' +// CODE GENERATOR: top of loop: testMenuCommand="T", testMenuFirstCharHandler="None" +// CODE GENERATOR: test menu case 'T': +// CODE GENERATOR: helpString 'T -- Measure_Thermocouple' // CODE GENERATOR: CMD_ 'None' // CODE GENERATOR: CommandName 'Measure_Thermocouple' // 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' @@ -1325,11 +1187,15 @@ // CODE GENERATOR: CommandDocParamIn '@param[in] rtd_ainn = channel RTD low side, default=AINN_SEL_1001_AIN9' // CODE GENERATOR: CommandDocParamOut '' // CODE GENERATOR: CommandPost '@post AINcode[tc_ainp]: measurement result LSB code' +// CODE GENERATOR: CommandPost '@post tc_voltage: raw thermocouple voltage in Volts' +// CODE GENERATOR: CommandPost '@post tc_deltaT: temperature in degC above cold junction' +// CODE GENERATOR: CommandPost '@post tc_Temperature: temperature in degC' // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure' - case 'M': // (nested inside case 'T') - { - // test menu command 'TM' handler: - // helpString='TM -- Measure_Thermocouple' + // case 'T': // (single character) (testMenuFirstCharHandler="None") + case 'T': + { + // test menu command 'T' handler: + // helpString='T -- Measure_Thermocouple' // CMD_='None' // CommandName='Measure_Thermocouple' // 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' @@ -1342,7 +1208,10 @@ // @Param[in]='@param[in] rtd_ainn = channel RTD low side, default=AINN_SEL_1001_AIN9' // @Param[out]='' // @Post='@post AINcode[tc_ainp]: measurement result LSB code' - // displayPost='' + // @Post='@post tc_voltage: raw thermocouple voltage in Volts' + // @Post='@post tc_deltaT: temperature in degC above cold junction' + // @Post='@post tc_Temperature: temperature in degC' + // displayPost='tc_voltage, tc_deltaT, tc_Temperature' // @Return='@return 1 on success; 0 on failure' // parse argument list // 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' @@ -1392,17 +1261,16 @@ // call function Measure_Thermocouple(tc_ainp, tc_ainn, rtd_iout, rtd_ainp, rtd_ainn) double result = g_MAX11410_device.Measure_Thermocouple(tc_ainp, tc_ainn, rtd_iout, rtd_ainp, rtd_ainn); cmdLine.serial().printf(" =%f\r\n", result); + // Menu item 'T' -> tc_voltage, tc_deltaT, tc_Temperature + cmdLine.serial().printf("%s=%1.6f\r\n", "tc_voltage", g_MAX11410_device.tc_voltage); + cmdLine.serial().printf("%s=%1.6f\r\n", "tc_deltaT", g_MAX11410_device.tc_deltaT); + cmdLine.serial().printf("%s=%1.6f\r\n", "tc_Temperature", g_MAX11410_device.tc_Temperature); return true; // command handled by MAX11410 -// CODE GENERATOR: bottom of loop: testMenuCommand="TM", testMenuFirstCharHandler="T" - } // end nested case 'TM' - break; +// CODE GENERATOR: bottom of loop: testMenuCommand="T", testMenuFirstCharHandler="None" + } // end case 'T' + break; -// CODE GENERATOR: top of loop: testMenuCommand="V", testMenuFirstCharHandler="T" -// CODE GENERATOR: top of loop: nested switch "T" is currently open -// CODE GENERATOR: top of loop: need to close nested switch "T" - } // end nested switch (cmdLine[1]) inside case 'T' - break; - } // end case 'T' +// CODE GENERATOR: top of loop: testMenuCommand="V", testMenuFirstCharHandler="None" // CODE GENERATOR: test menu case 'V': // CODE GENERATOR: helpString 'V -- Measure_Voltage' // CODE GENERATOR: CMD_ 'None'