Test program running on MAX32625MBED. Control through USB Serial commands using a terminal emulator such as teraterm or putty.
Dependencies: MaximTinyTester MAX11410 CmdLine USBDevice
Diff: Test_Menu_MAX11410.cpp
- Revision:
- 49:5bfa51523bc2
- Parent:
- 48:2591fcdece5e
- Child:
- 51:15d9a9e0b623
--- a/Test_Menu_MAX11410.cpp Fri Jan 10 01:55:55 2020 +0000 +++ b/Test_Menu_MAX11410.cpp Fri Jan 10 22:45:28 2020 +0000 @@ -869,6 +869,7 @@ // CODE GENERATOR: test menu // case '0'..'9','A'..'F','a'..'f' letters are reserved for bitstream commands // has_register_write_command: case '0'..'9','A'..'F','a'..'f' letters are reserved for bitstream commands +// CODE GENERATOR: top of loop: testMenuCommand="!", testMenuFirstCharHandler="None" // CODE GENERATOR: test menu case '!': // CODE GENERATOR: helpString '! -- Init' // CODE GENERATOR: CMD_ 'None' @@ -880,6 +881,7 @@ // CODE GENERATOR: CommandDocParamOut '' // CODE GENERATOR: CommandPost '' // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure' + // case '!': // (single character) (testMenuFirstCharHandler="None") case '!': { // test menu command '!' handler: @@ -899,9 +901,11 @@ uint8_t result = g_MAX11410_device.Init(); cmdLine.serial().printf(" =%d", result); return true; // command handled by MAX11410 +// CODE GENERATOR: bottom of loop: testMenuCommand="!", testMenuFirstCharHandler="None" } // end case '!' break; +// CODE GENERATOR: top of loop: testMenuCommand="$", testMenuFirstCharHandler="None" // CODE GENERATOR: test menu case '$': // CODE GENERATOR: helpString '$ -- Read_All_Voltages' // CODE GENERATOR: CMD_ 'None' @@ -913,6 +917,7 @@ // CODE GENERATOR: CommandDocParamOut '' // CODE GENERATOR: CommandPost '@post AINcode[0..9]: measurement result LSB code' // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure' + // case '$': // (single character) (testMenuFirstCharHandler="None") case '$': { // test menu command '$' handler: @@ -932,9 +937,11 @@ uint8_t result = g_MAX11410_device.Read_All_Voltages(); cmdLine.serial().printf(" =%d", result); return true; // command handled by MAX11410 +// CODE GENERATOR: bottom of loop: testMenuCommand="$", testMenuFirstCharHandler="None" } // end case '$' break; +// CODE GENERATOR: top of loop: testMenuCommand="R", testMenuFirstCharHandler="None" // CODE GENERATOR: test menu case 'R': // CODE GENERATOR: helpString 'R -- Measure_RTD' // CODE GENERATOR: CMD_ 'None' @@ -951,6 +958,7 @@ // CODE GENERATOR: CommandPost '@post rtd_resistance: measurement result resistance in Ohms' // CODE GENERATOR: CommandPost '@post RTD_Temperature: Temperature calculated from RTD Resistance; Thermocouple Cold Junction, in degrees C' // CODE GENERATOR: CommandReturn '@return resistance calculated from raw LSB code and reference resistance' + // case 'R': // (single character) (testMenuFirstCharHandler="None") case 'R': { // test menu command 'R' handler: @@ -1006,9 +1014,11 @@ 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); 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' @@ -1065,11 +1075,11 @@ // 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' - case 'T': + case 'T': // (multiple characters) (testMenuFirstCharHandler="T"): { switch (cmdLine[1]) { - case 'K': + case 'K': // (nested inside case 'T') { // test menu command 'TK' handler: // helpString='TK tc_voltage=? -- TemperatureOfTC_TypeK' @@ -1144,9 +1154,12 @@ 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: CMD_ 'None' @@ -1162,7 +1175,7 @@ // 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 'M': + case 'M': // (nested inside case 'T') { // test menu command 'TM' handler: // helpString='TM -- Measure_Thermocouple' @@ -1229,9 +1242,16 @@ 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 +// CODE GENERATOR: bottom of loop: testMenuCommand="TM", testMenuFirstCharHandler="T" } // end nested case 'TM' 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: test menu case 'V': // CODE GENERATOR: helpString 'V -- Measure_Voltage' // CODE GENERATOR: CMD_ 'None' @@ -1245,6 +1265,7 @@ // CODE GENERATOR: CommandDocParamOut '' // CODE GENERATOR: CommandPost '@post AINcode[ainp]: measurement result LSB code' // CODE GENERATOR: CommandReturn '@return ideal voltage calculated from raw LSB code and reference voltage' + // case 'V': // (single character) (testMenuFirstCharHandler="None") case 'V': { // test menu command 'V' handler: @@ -1286,12 +1307,11 @@ 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' +// CODE GENERATOR: bottom of loop: testMenuCommand="V", testMenuFirstCharHandler="None" } // end case 'V' break; +// CODE GENERATOR: top of loop: testMenuCommand="X0", testMenuFirstCharHandler="None" // CODE GENERATOR: test menu case 'X0': // CODE GENERATOR: helpString 'X0 -- Calibrate_Self_Offset_Gain' // CODE GENERATOR: CMD_ 'None' @@ -1303,11 +1323,11 @@ // CODE GENERATOR: CommandDocParamOut '' // CODE GENERATOR: CommandPost '' // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure' - case 'X': + case 'X': // (multiple characters) (testMenuFirstCharHandler="X"): { switch (cmdLine[1]) { - case '0': + case '0': // (nested inside case 'X') { // test menu command 'X0' handler: // helpString='X0 -- Calibrate_Self_Offset_Gain' @@ -1326,9 +1346,12 @@ uint8_t result = g_MAX11410_device.Calibrate_Self_Offset_Gain(); cmdLine.serial().printf(" =%d", result); return true; // command handled by MAX11410 +// CODE GENERATOR: bottom of loop: testMenuCommand="X0", testMenuFirstCharHandler="X" } // end nested case 'X0' break; +// CODE GENERATOR: top of loop: testMenuCommand="X1", testMenuFirstCharHandler="X" +// CODE GENERATOR: top of loop: nested switch "X" is currently open // CODE GENERATOR: test menu case 'X1': // CODE GENERATOR: helpString 'X1 -- Calibrate_PGA_Gain' // CODE GENERATOR: CMD_ 'None' @@ -1340,7 +1363,7 @@ // CODE GENERATOR: CommandDocParamOut '' // CODE GENERATOR: CommandPost '' // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure' - case '1': + case '1': // (nested inside case 'X') { // test menu command 'X1' handler: // helpString='X1 -- Calibrate_PGA_Gain' @@ -1359,9 +1382,12 @@ uint8_t result = g_MAX11410_device.Calibrate_PGA_Gain(); cmdLine.serial().printf(" =%d", result); return true; // command handled by MAX11410 +// CODE GENERATOR: bottom of loop: testMenuCommand="X1", testMenuFirstCharHandler="X" } // end nested case 'X1' break; +// CODE GENERATOR: top of loop: testMenuCommand="X4", testMenuFirstCharHandler="X" +// CODE GENERATOR: top of loop: nested switch "X" is currently open // CODE GENERATOR: test menu case 'X4': // CODE GENERATOR: helpString 'X4 -- Calibrate_System_Offset_A' // CODE GENERATOR: CMD_ 'None' @@ -1373,7 +1399,7 @@ // CODE GENERATOR: CommandDocParamOut '' // CODE GENERATOR: CommandPost '' // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure' - case '4': + case '4': // (nested inside case 'X') { // test menu command 'X4' handler: // helpString='X4 -- Calibrate_System_Offset_A' @@ -1392,9 +1418,12 @@ uint8_t result = g_MAX11410_device.Calibrate_System_Offset_A(); cmdLine.serial().printf(" =%d", result); return true; // command handled by MAX11410 +// CODE GENERATOR: bottom of loop: testMenuCommand="X4", testMenuFirstCharHandler="X" } // end nested case 'X4' break; +// CODE GENERATOR: top of loop: testMenuCommand="X5", testMenuFirstCharHandler="X" +// CODE GENERATOR: top of loop: nested switch "X" is currently open // CODE GENERATOR: test menu case 'X5': // CODE GENERATOR: helpString 'X5 -- Calibrate_System_Gain_A' // CODE GENERATOR: CMD_ 'None' @@ -1406,7 +1435,7 @@ // CODE GENERATOR: CommandDocParamOut '' // CODE GENERATOR: CommandPost '' // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure' - case '5': + case '5': // (nested inside case 'X') { // test menu command 'X5' handler: // helpString='X5 -- Calibrate_System_Gain_A' @@ -1425,9 +1454,12 @@ uint8_t result = g_MAX11410_device.Calibrate_System_Gain_A(); cmdLine.serial().printf(" =%d", result); return true; // command handled by MAX11410 +// CODE GENERATOR: bottom of loop: testMenuCommand="X5", testMenuFirstCharHandler="X" } // end nested case 'X5' break; +// CODE GENERATOR: top of loop: testMenuCommand="X6", testMenuFirstCharHandler="X" +// CODE GENERATOR: top of loop: nested switch "X" is currently open // CODE GENERATOR: test menu case 'X6': // CODE GENERATOR: helpString 'X6 -- Calibrate_System_Offset_B' // CODE GENERATOR: CMD_ 'None' @@ -1439,7 +1471,7 @@ // CODE GENERATOR: CommandDocParamOut '' // CODE GENERATOR: CommandPost '' // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure' - case '6': + case '6': // (nested inside case 'X') { // test menu command 'X6' handler: // helpString='X6 -- Calibrate_System_Offset_B' @@ -1458,9 +1490,12 @@ uint8_t result = g_MAX11410_device.Calibrate_System_Offset_B(); cmdLine.serial().printf(" =%d", result); return true; // command handled by MAX11410 +// CODE GENERATOR: bottom of loop: testMenuCommand="X6", testMenuFirstCharHandler="X" } // end nested case 'X6' break; +// CODE GENERATOR: top of loop: testMenuCommand="X7", testMenuFirstCharHandler="X" +// CODE GENERATOR: top of loop: nested switch "X" is currently open // CODE GENERATOR: test menu case 'X7': // CODE GENERATOR: helpString 'X7 -- Calibrate_System_Gain_B' // CODE GENERATOR: CMD_ 'None' @@ -1472,7 +1507,7 @@ // CODE GENERATOR: CommandDocParamOut '' // CODE GENERATOR: CommandPost '' // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure' - case '7': + case '7': // (nested inside case 'X') { // test menu command 'X7' handler: // helpString='X7 -- Calibrate_System_Gain_B' @@ -1491,9 +1526,12 @@ uint8_t result = g_MAX11410_device.Calibrate_System_Gain_B(); cmdLine.serial().printf(" =%d", result); return true; // command handled by MAX11410 +// CODE GENERATOR: bottom of loop: testMenuCommand="X7", testMenuFirstCharHandler="X" } // end nested case 'X7' break; +// CODE GENERATOR: top of loop: testMenuCommand="XC", testMenuFirstCharHandler="X" +// CODE GENERATOR: top of loop: nested switch "X" is currently open // CODE GENERATOR: test menu case 'XC': // CODE GENERATOR: helpString 'XC extclk=? u_bn=? format=? refbufp_en=? refbufn_en=? ref_sel=? -- Configure_CTRL' // CODE GENERATOR: CMD_ 'None' @@ -1510,7 +1548,7 @@ // CODE GENERATOR: CommandDocParamOut '' // CODE GENERATOR: CommandPost '' // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure' - case 'C': + case 'C': // (nested inside case 'X') { // test menu command 'XC' handler: // helpString='XC extclk=? u_bn=? format=? refbufp_en=? refbufn_en=? ref_sel=? -- Configure_CTRL' @@ -1585,9 +1623,12 @@ uint8_t result = g_MAX11410_device.Configure_CTRL(extclk, u_bn, format, refbufp_en, refbufn_en, ref_sel); cmdLine.serial().printf(" =%d\r\n", result); return true; // command handled by MAX11410 +// CODE GENERATOR: bottom of loop: testMenuCommand="XC", testMenuFirstCharHandler="X" } // end nested case 'XC' break; +// CODE GENERATOR: top of loop: testMenuCommand="XF", testMenuFirstCharHandler="X" +// CODE GENERATOR: top of loop: nested switch "X" is currently open // CODE GENERATOR: test menu case 'XF': // CODE GENERATOR: helpString 'XF linef=? rate=? -- Configure_FILTER' // CODE GENERATOR: CMD_ 'None' @@ -1600,7 +1641,7 @@ // CODE GENERATOR: CommandDocParamOut '' // CODE GENERATOR: CommandPost '' // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure' - case 'F': + case 'F': // (nested inside case 'X') { // test menu command 'XF' handler: // helpString='XF linef=? rate=? -- Configure_FILTER' @@ -1639,9 +1680,12 @@ uint8_t result = g_MAX11410_device.Configure_FILTER(linef, rate); cmdLine.serial().printf(" =%d\r\n", result); return true; // command handled by MAX11410 +// CODE GENERATOR: bottom of loop: testMenuCommand="XF", testMenuFirstCharHandler="X" } // end nested case 'XF' break; +// CODE GENERATOR: top of loop: testMenuCommand="XI", testMenuFirstCharHandler="X" +// CODE GENERATOR: top of loop: nested switch "X" is currently open // CODE GENERATOR: test menu case 'XI': // CODE GENERATOR: helpString 'XI idac1_sel=? idac0_sel=? -- Configure_MUX_CTRL1' // CODE GENERATOR: CMD_ 'None' @@ -1654,7 +1698,7 @@ // CODE GENERATOR: CommandDocParamOut '' // CODE GENERATOR: CommandPost '' // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure' - case 'I': + case 'I': // (nested inside case 'X') { // test menu command 'XI' handler: // helpString='XI idac1_sel=? idac0_sel=? -- Configure_MUX_CTRL1' @@ -1693,9 +1737,12 @@ uint8_t result = g_MAX11410_device.Configure_MUX_CTRL1(idac1_sel, idac0_sel); cmdLine.serial().printf(" =%d\r\n", result); return true; // command handled by MAX11410 +// CODE GENERATOR: bottom of loop: testMenuCommand="XI", testMenuFirstCharHandler="X" } // end nested case 'XI' break; +// CODE GENERATOR: top of loop: testMenuCommand="XM", testMenuFirstCharHandler="X" +// CODE GENERATOR: top of loop: nested switch "X" is currently open // CODE GENERATOR: test menu case 'XM': // CODE GENERATOR: helpString 'XM ainp=? ainn=? -- Configure_MUX_CTRL0' // CODE GENERATOR: CMD_ 'None' @@ -1708,7 +1755,7 @@ // CODE GENERATOR: CommandDocParamOut '' // CODE GENERATOR: CommandPost '' // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure' - case 'M': + case 'M': // (nested inside case 'X') { // test menu command 'XM' handler: // helpString='XM ainp=? ainn=? -- Configure_MUX_CTRL0' @@ -1747,9 +1794,12 @@ uint8_t result = g_MAX11410_device.Configure_MUX_CTRL0(ainp, ainn); cmdLine.serial().printf(" =%d\r\n", result); return true; // command handled by MAX11410 +// CODE GENERATOR: bottom of loop: testMenuCommand="XM", testMenuFirstCharHandler="X" } // end nested case 'XM' break; +// CODE GENERATOR: top of loop: testMenuCommand="XP", testMenuFirstCharHandler="X" +// CODE GENERATOR: top of loop: nested switch "X" is currently open // CODE GENERATOR: test menu case 'XP': // CODE GENERATOR: helpString 'XP sigpath=? gain=? -- Configure_PGA' // CODE GENERATOR: CMD_ 'None' @@ -1762,7 +1812,7 @@ // CODE GENERATOR: CommandDocParamOut '' // CODE GENERATOR: CommandPost '' // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure' - case 'P': + case 'P': // (nested inside case 'X') { // test menu command 'XP' handler: // helpString='XP sigpath=? gain=? -- Configure_PGA' @@ -1801,9 +1851,12 @@ uint8_t result = g_MAX11410_device.Configure_PGA(sigpath, gain); cmdLine.serial().printf(" =%d\r\n", result); return true; // command handled by MAX11410 +// CODE GENERATOR: bottom of loop: testMenuCommand="XP", testMenuFirstCharHandler="X" } // end nested case 'XP' break; +// CODE GENERATOR: top of loop: testMenuCommand="XS", testMenuFirstCharHandler="X" +// CODE GENERATOR: top of loop: nested switch "X" is currently open // CODE GENERATOR: test menu case 'XS': // CODE GENERATOR: helpString 'XS vbias_mode=? brn_mode=? idac_mode=? -- Configure_SOURCE' // CODE GENERATOR: CMD_ 'None' @@ -1817,7 +1870,7 @@ // CODE GENERATOR: CommandDocParamOut '' // CODE GENERATOR: CommandPost '' // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure' - case 'S': + case 'S': // (nested inside case 'X') { // test menu command 'XS' handler: // helpString='XS vbias_mode=? brn_mode=? idac_mode=? -- Configure_SOURCE' @@ -1865,9 +1918,12 @@ uint8_t result = g_MAX11410_device.Configure_SOURCE(vbias_mode, brn_mode, idac_mode); cmdLine.serial().printf(" =%d\r\n", result); return true; // command handled by MAX11410 +// CODE GENERATOR: bottom of loop: testMenuCommand="XS", testMenuFirstCharHandler="X" } // end nested case 'XS' break; +// CODE GENERATOR: top of loop: testMenuCommand="XV", testMenuFirstCharHandler="X" +// CODE GENERATOR: top of loop: nested switch "X" is currently open // CODE GENERATOR: test menu case 'XV': // CODE GENERATOR: helpString 'XV vbias_ain7_ain0_bitmap=? -- Configure_MUX_CTRL2' // CODE GENERATOR: CMD_ 'None' @@ -1879,7 +1935,7 @@ // CODE GENERATOR: CommandDocParamOut '' // CODE GENERATOR: CommandPost '' // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure' - case 'V': + case 'V': // (nested inside case 'X') { // test menu command 'XV' handler: // helpString='XV vbias_ain7_ain0_bitmap=? -- Configure_MUX_CTRL2' @@ -1909,10 +1965,11 @@ uint8_t result = g_MAX11410_device.Configure_MUX_CTRL2(vbias_ain7_ain0_bitmap); cmdLine.serial().printf(" =%d\r\n", result); return true; // command handled by MAX11410 +// CODE GENERATOR: bottom of loop: testMenuCommand="XV", testMenuFirstCharHandler="X" } // end nested case 'XV' break; - } // end nested switch (cmdLine[1]) + } // end nested switch (cmdLine[1]) inside case 'X' break; } // end case 'X' // has_register_write_command: case '0'..'9','A'..'F','a'..'f' letters are reserved for bitstream commands