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

Dependencies:   MaximTinyTester MAX11410 CmdLine USBDevice

Revision:
46:79dba7d4110c
Parent:
45:8af4549476aa
Child:
47:3ce5810551c4
--- a/Test_Menu_MAX11410.cpp	Mon Dec 23 21:26:08 2019 +0000
+++ b/Test_Menu_MAX11410.cpp	Tue Dec 24 00:09:59 2019 +0000
@@ -358,12 +358,12 @@
 // CODE GENERATOR: MAX11410 Command Name = Configure_RTD (MAX11410_AINP_SEL_enum_t rtd_iout, MAX11410_AINP_SEL_enum_t rtd_ainp, MAX11410_AINN_SEL_enum_t rtd_ainn) --> uint8_t
 // CODE GENERATOR: no Menu item hint in description
 // 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
-// CODE GENERATOR: Menu item hint description Menu item 'R'
-// CODE GENERATOR: Menu item 'R' -- Menu item R
-// 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
-// CODE GENERATOR: MAX11410 helpString: 'R  -- Measure_RTD'
-// CODE GENERATOR: test menu case 'R':
-// CODE GENERATOR:           helpString 'R  -- Measure_RTD'
+// CODE GENERATOR: Menu item hint description Menu item 'RM'
+// CODE GENERATOR: Menu item 'RM' -- Menu item RM
+// CODE GENERATOR: MAX11410 help: RM MAX11410_AINP_SEL_enum_t rtd_iout, MAX11410_AINP_SEL_enum_t rtd_ainp, MAX11410_AINN_SEL_enum_t rtd_ainn -- Measure_RTD
+// CODE GENERATOR: MAX11410 helpString: 'RM  -- Measure_RTD'
+// CODE GENERATOR: test menu case 'RM':
+// CODE GENERATOR:           helpString 'RM  -- Measure_RTD'
 // CODE GENERATOR:           CMD_ 'None'
 // CODE GENERATOR:           CommandName 'Measure_RTD'
 // CODE GENERATOR:           CommandParamIn 'MAX11410_AINP_SEL_enum_t rtd_iout, MAX11410_AINP_SEL_enum_t rtd_ainp, MAX11410_AINN_SEL_enum_t rtd_ainn'
@@ -375,16 +375,34 @@
 // CODE GENERATOR:           CommandDocParamIn '@param[in] rtd_ainn = channel RTD low side, default=AINN_SEL_1001_AIN9'
 // CODE GENERATOR:           CommandDocParamOut ''
 // CODE GENERATOR:           CommandPost '@post AINcode[rtd_ainp]: measurement result LSB code'
-// CODE GENERATOR:           CommandReturn '@return ideal voltage calculated from raw LSB code and reference voltage'
+// CODE GENERATOR:           CommandReturn '@return resistance calculated from raw LSB code and reference resistance'
+// CODE GENERATOR: MAX11410 Command Name = TemperatureOfRTD_PT1000 (double rtd_resistance) --> double
+// CODE GENERATOR: Menu item hint description Menu item 'RT'
+// CODE GENERATOR: Menu item 'RT' -- Menu item RT
+// CODE GENERATOR: MAX11410 help: RT double rtd_resistance -- TemperatureOfRTD_PT1000
+// CODE GENERATOR: MAX11410 helpString: 'RT rtd_resistance=? -- TemperatureOfRTD_PT1000'
+// CODE GENERATOR: test menu case 'RT':
+// CODE GENERATOR:           helpString 'RT rtd_resistance=? -- TemperatureOfRTD_PT1000'
+// CODE GENERATOR:           CMD_ 'None'
+// CODE GENERATOR:           CommandName 'TemperatureOfRTD_PT1000'
+// CODE GENERATOR:           CommandParamIn 'double rtd_resistance'
+// CODE GENERATOR:           CommandReturnType 'double'
+// CODE GENERATOR:           CommandPre ''
+// CODE GENERATOR:           CommandDocParamIn '@param[in] rtd_resistance = RTD resistance in ohms, default=1000'
+// 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 TemperatureOfRTD_PT1000(1000.0) expect 0.00             PT1000 at 0 deg C'
+// CODE GENERATOR:           CommandDocTest '@test TemperatureOfRTD_PT1000(1100.0) expect 25.00            PT1000 at 25 deg C'
 // CODE GENERATOR: MAX11410 Command Name = Configure_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) --> uint8_t
 // 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 'T'
-// CODE GENERATOR: Menu item 'T' -- Menu item T
-// CODE GENERATOR: MAX11410 help: T 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: 'T  -- Measure_Thermocouple'
-// CODE GENERATOR: test menu case 'T':
-// CODE GENERATOR:           helpString 'T  -- Measure_Thermocouple'
+// CODE GENERATOR: Menu item hint description Menu item 'TM'
+// CODE GENERATOR: Menu item 'TM' -- 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':
+// CODE GENERATOR:           helpString 'TM  -- 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'
@@ -398,6 +416,24 @@
 // CODE GENERATOR:           CommandDocParamOut ''
 // CODE GENERATOR:           CommandPost '@post AINcode[tc_ainp]: measurement result LSB code'
 // 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 TemperatureOfTC_TypeK(0.123) expect 0.00             TC_TypeK at 0 deg C'
+// CODE GENERATOR:           CommandDocTest '@test TemperatureOfTC_TypeK(0.456) expect 25.00            TC_TypeK at 25 deg C'
 // CODE GENERATOR: testMenuGlobalArgsDict scan global property list g_MAX11410_device
 
 // CODE GENERATOR: testMenuGlobalArgsDict add global property g_MAX11410_device.VRef_REF0
@@ -428,6 +464,13 @@
 // CODE GENERATOR: testMenuGlobalArgsDict['VRef_AVDD']['usedByCommandName'] = 'None'
 // CODE GENERATOR: testMenuGlobalArgsDict['VRef_AVDD']['usedBytestMenuItemName'] = 'None'
 
+// CODE GENERATOR: testMenuGlobalArgsDict add global property g_MAX11410_device.RTD_Temperature
+// CODE GENERATOR: testMenuGlobalArgsDict add global property g_MAX11410_device.RTD_Temperature argname = RTD_Temperature
+// CODE GENERATOR: testMenuGlobalArgsDict['RTD_Temperature']['alias'] = 'None'
+// CODE GENERATOR: testMenuGlobalArgsDict['RTD_Temperature']['argtype'] = 'double'
+// CODE GENERATOR: testMenuGlobalArgsDict['RTD_Temperature']['usedByCommandName'] = 'None'
+// CODE GENERATOR: testMenuGlobalArgsDict['RTD_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
@@ -462,6 +505,8 @@
 // CODE GENERATOR: testMenuGlobalArgsDict skip array property g_MAX11410_device.AINcode[10]
 
 // CODE GENERATOR: scan testMenuCommand list for items that can be shortened to single character
+// CODE GENERATOR: multiple commands begin with character 'R'
+// 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'
@@ -477,8 +522,10 @@
 // CODE GENERATOR: shorten testMenuCommand to single character if unambiguous
 // CODE GENERATOR: testMenuCommand '!' already single character
 // CODE GENERATOR: testMenuCommand '$' already single character
-// CODE GENERATOR: testMenuCommand 'R' already single character
-// CODE GENERATOR: testMenuCommand 'T' already single character
+// CODE GENERATOR: cannot shorten testMenuCommand 'RM' to single character due to duplicates
+// CODE GENERATOR: cannot shorten testMenuCommand 'RT' to single character due to duplicates
+// 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: 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
@@ -503,12 +550,18 @@
     // CODE GENERATOR: command: $
     // CODE GENERATOR: help: $ -- Read_All_Voltages
     cmdLine.serial().printf("\r\n $ -- Read_All_Voltages");
-    // CODE GENERATOR: command: R
-    // CODE GENERATOR: help: R  -- Measure_RTD
-    cmdLine.serial().printf("\r\n R  -- Measure_RTD");
-    // CODE GENERATOR: command: T
-    // CODE GENERATOR: help: T  -- Measure_Thermocouple
-    cmdLine.serial().printf("\r\n T  -- Measure_Thermocouple");
+    // CODE GENERATOR: command: RM
+    // CODE GENERATOR: help: RM  -- Measure_RTD
+    cmdLine.serial().printf("\r\n RM  -- Measure_RTD");
+    // CODE GENERATOR: command: RT
+    // CODE GENERATOR: help: RT rtd_resistance=? -- TemperatureOfRTD_PT1000
+    cmdLine.serial().printf("\r\n RT rtd_resistance=? -- TemperatureOfRTD_PT1000");
+    // 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: V
     // CODE GENERATOR: help: V  -- Measure_Voltage
     cmdLine.serial().printf("\r\n V  -- Measure_Voltage");
@@ -563,6 +616,17 @@
 
 // CODE GENERATOR: testMenuGlobalArgsDict Consolidate common/global argument parsing
 
+// CODE GENERATOR: testMenuGlobalArgsDict['RTD_Temperature']['alias'] = 'None'
+// CODE GENERATOR: testMenuGlobalArgsDict['RTD_Temperature']['argtype'] = 'double'
+// CODE GENERATOR: testMenuGlobalArgsDict['RTD_Temperature']['usedByCommandName'] = 'None'
+// CODE GENERATOR: testMenuGlobalArgsDict['RTD_Temperature']['usedBytestMenuItemName'] = 'None'
+                    // parse argument double RTD_Temperature
+        double RTD_Temperature = g_MAX11410_device.RTD_Temperature; // default to global property value
+        if (cmdLine.parse_double("RTD_Temperature", RTD_Temperature))
+        {
+            g_MAX11410_device.RTD_Temperature = RTD_Temperature; // update global property value
+        }
+
 // CODE GENERATOR: testMenuGlobalArgsDict['VRef_AVDD']['alias'] = 'None'
 // CODE GENERATOR: testMenuGlobalArgsDict['VRef_AVDD']['argtype'] = 'double'
 // CODE GENERATOR: testMenuGlobalArgsDict['VRef_AVDD']['usedByCommandName'] = 'None'
@@ -721,6 +785,9 @@
 // CODE GENERATOR: @ command print double g_MAX11410_device.VRef_AVDD
                     cmdLine.serial().printf("VRef_AVDD = ");
                     cmdLine.serial().printf("%f\n", g_MAX11410_device.VRef_AVDD);
+// CODE GENERATOR: @ command print double g_MAX11410_device.RTD_Temperature
+                    cmdLine.serial().printf("RTD_Temperature = ");
+                    cmdLine.serial().printf("%f\n", g_MAX11410_device.RTD_Temperature);
 // CODE GENERATOR: @ command print uint32_t g_MAX11410_device.ctrl
                     cmdLine.serial().printf("ctrl = ");
                     cmdLine.serial().printf("%d = 0x%8.8x\n", g_MAX11410_device.ctrl, g_MAX11410_device.ctrl);
@@ -812,8 +879,8 @@
         } // end case '$'
         break;
 
-// CODE GENERATOR: test menu case 'R':
-// CODE GENERATOR:           helpString 'R  -- Measure_RTD'
+// CODE GENERATOR: test menu case 'RM':
+// CODE GENERATOR:           helpString 'RM  -- Measure_RTD'
 // CODE GENERATOR:           CMD_ 'None'
 // CODE GENERATOR:           CommandName 'Measure_RTD'
 // CODE GENERATOR:           CommandParamIn 'MAX11410_AINP_SEL_enum_t rtd_iout, MAX11410_AINP_SEL_enum_t rtd_ainp, MAX11410_AINN_SEL_enum_t rtd_ainn'
@@ -825,11 +892,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[rtd_ainp]: measurement result LSB code'
-// CODE GENERATOR:           CommandReturn '@return ideal voltage calculated from raw LSB code and reference voltage'
+// CODE GENERATOR:           CommandReturn '@return resistance calculated from raw LSB code and reference resistance'
         case 'R':
         {
-                    // test menu command 'R' handler:
-                    // helpString='R  -- Measure_RTD'
+            switch (cmdLine[1])
+            {
+                case 'M':
+                {
+                    // test menu command 'RM' handler:
+                    // helpString='RM  -- Measure_RTD'
                     // CMD_='None'
                     // CommandName='Measure_RTD'
                     // CommandParamIn='MAX11410_AINP_SEL_enum_t rtd_iout, MAX11410_AINP_SEL_enum_t rtd_ainp, MAX11410_AINN_SEL_enum_t rtd_ainn'
@@ -841,7 +912,7 @@
                     // @Param[in]='@param[in] rtd_ainn = channel RTD low side, default=AINN_SEL_1001_AIN9'
                     // @Param[out]=''
                     // @Post='@post AINcode[rtd_ainp]: measurement result LSB code'
-                    // @Return='@return ideal voltage calculated from raw LSB code and reference voltage'
+                    // @Return='@return resistance calculated from raw LSB code and reference resistance'
                     // parse argument list
 // CODE GENERATOR: searching TypedefEnum 'MAX11410::MAX11410_AINP_SEL_enum_t' for constant 'Measure_RTD'
 // CODE GENERATOR: comparing TypedefEnum 'MAX11410::MAX11410_AINP_SEL_enum_t::AINP_SEL_0000_AIN0' vs constant 'Measure_RTD'
@@ -926,11 +997,112 @@
                     double result = g_MAX11410_device.Measure_RTD(rtd_iout, rtd_ainp, rtd_ainn);
                     cmdLine.serial().printf(" =%f\r\n", result);
                     return true; // command handled by MAX11410
-        } // end case 'R'
-        break;
+                } // end nested case 'RM'
+                break;
+
+// CODE GENERATOR: test menu case 'RT':
+// CODE GENERATOR:           helpString 'RT rtd_resistance=? -- TemperatureOfRTD_PT1000'
+// CODE GENERATOR:           CMD_ 'None'
+// CODE GENERATOR:           CommandName 'TemperatureOfRTD_PT1000'
+// CODE GENERATOR:           CommandParamIn 'double rtd_resistance'
+// CODE GENERATOR:           CommandReturnType 'double'
+// CODE GENERATOR:           CommandPre ''
+// CODE GENERATOR:           CommandDocParamIn '@param[in] rtd_resistance = RTD resistance in ohms, default=1000'
+// 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 TemperatureOfRTD_PT1000(1000.0) expect 0.00             PT1000 at 0 deg C'
+// CODE GENERATOR:           CommandTest '@test TemperatureOfRTD_PT1000(1100.0) expect 25.00            PT1000 at 25 deg C'
+                case 'T':
+                {
+                    // test menu command 'RT' handler:
+                    // helpString='RT rtd_resistance=? -- TemperatureOfRTD_PT1000'
+                    // CMD_='None'
+                    // CommandName='TemperatureOfRTD_PT1000'
+                    // CommandParamIn='double rtd_resistance'
+                    // CommandReturnType='double'
+                    // @Pre=''
+                    // @Param[in]='@param[in] rtd_resistance = RTD resistance in ohms, default=1000'
+                    // @Param[out]=''
+                    // @Post=''
+                    // @Return='@return ideal temperature in degrees C, calculated from RTD resistance in ohms'
+                    // @Test='@test TemperatureOfRTD_PT1000(1000.0) expect 0.00             PT1000 at 0 deg C'
+                    // @Test='@test TemperatureOfRTD_PT1000(1100.0) expect 25.00            PT1000 at 25 deg C'
+                    // parse argument list
+                    // argname default_argvalue numeric literal specified in CommandDocParamIn @Param[in]='@param[in] rtd_resistance = RTD resistance in ohms, default=1000'
+                    // parse argument double rtd_resistance
+                    double rtd_resistance = (double)1000; // --- g_MAX11410_device.__WARNING_no_match_for_argname_rtd_resistance_in_MAX11410_device_t__; // default to global property value
+                    if (cmdLine.parse_double("rtd_resistance", rtd_resistance))
+                    {
+                        // g_MAX11410_device.__WARNING_no_match_for_argname_rtd_resistance_in_MAX11410_device_t__ = rtd_resistance; // update global property value
+                    }
+                    // print arguments
+                    cmdLine.serial().printf("TemperatureOfRTD_PT1000");
+                    cmdLine.serial().printf(" rtd_resistance=%d", rtd_resistance);
+                    cmdLine.serial().printf("\r\n");
+                    // call function TemperatureOfRTD_PT1000(rtd_resistance)
+                    double result = g_MAX11410_device.TemperatureOfRTD_PT1000(rtd_resistance);
+                    cmdLine.serial().printf(" =%f\r\n", result);
+                    return true; // command handled by MAX11410
+                } // end nested case 'RT'
+                break;
 
-// CODE GENERATOR: test menu case 'T':
-// CODE GENERATOR:           helpString 'T  -- Measure_Thermocouple'
+// 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 TemperatureOfTC_TypeK(0.123) expect 0.00             TC_TypeK at 0 deg C'
+// CODE GENERATOR:           CommandTest '@test TemperatureOfTC_TypeK(0.456) expect 25.00            TC_TypeK at 25 deg C'
+            } // end nested switch (cmdLine[1])
+            break;
+        } // end case 'R'
+        case 'T':
+        {
+            switch (cmdLine[1])
+            {
+                case 'K':
+                {
+                    // 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=''
+                    // @Return='@return ideal temperature in degrees C, calculated from RTD resistance in ohms'
+                    // @Test='@test TemperatureOfTC_TypeK(0.123) expect 0.00             TC_TypeK at 0 deg C'
+                    // @Test='@test TemperatureOfTC_TypeK(0.456) expect 25.00            TC_TypeK at 25 deg C'
+                    // 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=%d", 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
+                } // end nested case 'TK'
+                break;
+
+// CODE GENERATOR: test menu case 'TM':
+// CODE GENERATOR:           helpString 'TM  -- 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'
@@ -944,10 +1116,10 @@
 // CODE GENERATOR:           CommandDocParamOut ''
 // CODE GENERATOR:           CommandPost '@post AINcode[tc_ainp]: measurement result LSB code'
 // CODE GENERATOR:           CommandReturn '@return 1 on success; 0 on failure'
-        case 'T':
-        {
-                    // test menu command 'T' handler:
-                    // helpString='T  -- Measure_Thermocouple'
+                case 'M':
+                {
+                    // test menu command 'TM' handler:
+                    // helpString='TM  -- 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'
@@ -1095,8 +1267,8 @@
                     double result = g_MAX11410_device.Measure_Thermocouple(tc_ainp, tc_ainn, rtd_iout, rtd_ainp, rtd_ainn);
                     cmdLine.serial().printf(" =%f\r\n", result);
                     return true; // command handled by MAX11410
-        } // end case 'T'
-        break;
+                } // end nested case 'TM'
+                break;
 
 // CODE GENERATOR: test menu case 'V':
 // CODE GENERATOR:           helpString 'V  -- Measure_Voltage'
@@ -1185,6 +1357,9 @@
                     double result = g_MAX11410_device.Measure_Voltage(ainp, ainn);
                     cmdLine.serial().printf(" =%f\r\n", result);
                     return true; // command handled by MAX11410
+        } // end nested switch (cmdLine[1])
+        break;
+    } // end case 'T'
         } // end case 'V'
         break;