Maxim Integrated MAX5719 20-bit, 0.05nV-sec DAC Test program running on MAX32625MBED. Control through USB Serial commands using a terminal emulator such as teraterm or putty.
Dependencies: MaximTinyTester CmdLine MAX5719 USBDevice
Diff: Test_Menu_MAX5719.cpp
- Revision:
- 29:074e680ba5ea
- Parent:
- 28:bae17ff10fa7
- Child:
- 33:2c675744a01b
--- a/Test_Menu_MAX5719.cpp Tue Jun 08 17:44:53 2021 -0700 +++ b/Test_Menu_MAX5719.cpp Tue Jun 08 23:02:56 2021 -0700 @@ -114,8 +114,8 @@ { g_MAX5719_device.DACCode = DACCode; // update global property value } -#if 1 // "code" is an alias for argument "DACCode"; support DACCodeOfVoltage + { // enclose temporary voltageV double voltageV; // support DACCodeOfVoltage switch (cmdLine.parse_double_or_int32("code", voltageV, DACCode)) { @@ -129,13 +129,7 @@ g_MAX5719_device.DACCode = DACCode; // update global property value break; } -#else - // "code" is an alias for argument "DACCode" - if (cmdLine.parse_int32_dec("code", DACCode)) - { - g_MAX5719_device.DACCode = DACCode; // update global property value - } -#endif + } // enclose temporary voltageV // parse argument double VRef double VRef = g_MAX5719_device.VRef; // default to global property value @@ -289,28 +283,22 @@ { // g_MAX5719_device.__WARNING_no_match_for_argname_dacCodeLsbs_in_MAX5719_device_t__ = dacCodeLsbs; // update global property value } -#if 1 // "code" is an alias for argument "dacCodeLsbs"; support DACCodeOfVoltage + { // enclose temporary voltageV double voltageV; // support DACCodeOfVoltage switch (cmdLine.parse_double_or_uint32("code", voltageV, dacCodeLsbs)) { case 2: // 2: parsed as double // parse_double_or_uint32 returns 1: parsed as integer; 2: parsed as double dacCodeLsbs = g_MAX5719_device.DACCodeOfVoltage((double)voltageV); - // g_MAX5719_device.DACCode = DACCode; // update global property value + // g_MAX5719_device.__WARNING_no_match_for_argname_dacCodeLsbs_in_MAX5719_device_t__ = dacCodeLsbs; // update global property value cmdLine.serial().printf("\r\nDACCodeOfVoltage(%1.6fV)=0x%6.6X\r\n", voltageV, dacCodeLsbs); break; case 1: // 1: parsed as integer - // g_MAX5719_device.DACCode = DACCode; // update global property value + // g_MAX5719_device.__WARNING_no_match_for_argname_dacCodeLsbs_in_MAX5719_device_t__ = dacCodeLsbs; // update global property value break; } -#else - // "code" is an alias for argument "dacCodeLsbs" - if (cmdLine.parse_uint32_dec("code", dacCodeLsbs)) - { - // g_MAX5719_device.__WARNING_no_match_for_argname_dacCodeLsbs_in_MAX5719_device_t__ = dacCodeLsbs; // update global property value - } -#endif + } // enclose temporary voltageV // print arguments cmdLine.serial().printf("CODE"); cmdLine.serial().printf(" dacCodeLsbs=%ld", dacCodeLsbs); @@ -363,28 +351,22 @@ { // g_MAX5719_device.__WARNING_no_match_for_argname_dacCodeLsbs_in_MAX5719_device_t__ = dacCodeLsbs; // update global property value } -#if 1 // "code" is an alias for argument "dacCodeLsbs"; support DACCodeOfVoltage + { // enclose temporary voltageV double voltageV; // support DACCodeOfVoltage switch (cmdLine.parse_double_or_uint32("code", voltageV, dacCodeLsbs)) { case 2: // 2: parsed as double // parse_double_or_uint32 returns 1: parsed as integer; 2: parsed as double dacCodeLsbs = g_MAX5719_device.DACCodeOfVoltage((double)voltageV); - // g_MAX5719_device.DACCode = DACCode; // update global property value + // g_MAX5719_device.__WARNING_no_match_for_argname_dacCodeLsbs_in_MAX5719_device_t__ = dacCodeLsbs; // update global property value cmdLine.serial().printf("\r\nDACCodeOfVoltage(%1.6fV)=0x%6.6X\r\n", voltageV, dacCodeLsbs); break; case 1: // 1: parsed as integer - // g_MAX5719_device.DACCode = DACCode; // update global property value + // g_MAX5719_device.__WARNING_no_match_for_argname_dacCodeLsbs_in_MAX5719_device_t__ = dacCodeLsbs; // update global property value break; } -#else - // "code" is an alias for argument "dacCodeLsbs" - if (cmdLine.parse_uint32_dec("code", dacCodeLsbs)) - { - // g_MAX5719_device.__WARNING_no_match_for_argname_dacCodeLsbs_in_MAX5719_device_t__ = dacCodeLsbs; // update global property value - } -#endif + } // enclose temporary voltageV // print arguments cmdLine.serial().printf("CODE_LOAD"); cmdLine.serial().printf(" dacCodeLsbs=%ld", dacCodeLsbs);