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

Dependencies:   MaximTinyTester CmdLine MAX5171 USBDevice

Committer:
whismanoid
Date:
Fri May 15 08:38:12 2020 +0000
Revision:
24:3ef3dd32c7b5
Parent:
23:abd02fed1ae4
Support MAX5171BOB Self Test

Who changed what in which revision?

UserRevisionLine numberNew contents of line
whismanoid 22:a14c19b97d0b 1 // /*******************************************************************************
whismanoid 22:a14c19b97d0b 2 // * Copyright (C) 2020 Maxim Integrated Products, Inc., All Rights Reserved.
whismanoid 11:48aefcaa1d29 3 // *
whismanoid 11:48aefcaa1d29 4 // * Permission is hereby granted, free of charge, to any person obtaining a
whismanoid 11:48aefcaa1d29 5 // * copy of this software and associated documentation files (the "Software"),
whismanoid 11:48aefcaa1d29 6 // * to deal in the Software without restriction, including without limitation
whismanoid 11:48aefcaa1d29 7 // * the rights to use, copy, modify, merge, publish, distribute, sublicense,
whismanoid 11:48aefcaa1d29 8 // * and/or sell copies of the Software, and to permit persons to whom the
whismanoid 11:48aefcaa1d29 9 // * Software is furnished to do so, subject to the following conditions:
whismanoid 11:48aefcaa1d29 10 // *
whismanoid 11:48aefcaa1d29 11 // * The above copyright notice and this permission notice shall be included
whismanoid 11:48aefcaa1d29 12 // * in all copies or substantial portions of the Software.
whismanoid 11:48aefcaa1d29 13 // *
whismanoid 11:48aefcaa1d29 14 // * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
whismanoid 11:48aefcaa1d29 15 // * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
whismanoid 11:48aefcaa1d29 16 // * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
whismanoid 11:48aefcaa1d29 17 // * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
whismanoid 11:48aefcaa1d29 18 // * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
whismanoid 11:48aefcaa1d29 19 // * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
whismanoid 11:48aefcaa1d29 20 // * OTHER DEALINGS IN THE SOFTWARE.
whismanoid 11:48aefcaa1d29 21 // *
whismanoid 11:48aefcaa1d29 22 // * Except as contained in this notice, the name of Maxim Integrated
whismanoid 11:48aefcaa1d29 23 // * Products, Inc. shall not be used except as stated in the Maxim Integrated
whismanoid 11:48aefcaa1d29 24 // * Products, Inc. Branding Policy.
whismanoid 11:48aefcaa1d29 25 // *
whismanoid 11:48aefcaa1d29 26 // * The mere transfer of this software does not imply any licenses
whismanoid 11:48aefcaa1d29 27 // * of trade secrets, proprietary technology, copyrights, patents,
whismanoid 11:48aefcaa1d29 28 // * trademarks, maskwork rights, or any other form of intellectual
whismanoid 11:48aefcaa1d29 29 // * property whatsoever. Maxim Integrated Products, Inc. retains all
whismanoid 11:48aefcaa1d29 30 // * ownership rights.
whismanoid 11:48aefcaa1d29 31 // *******************************************************************************
whismanoid 11:48aefcaa1d29 32 // */
whismanoid 22:a14c19b97d0b 33 // example code includes
whismanoid 22:a14c19b97d0b 34 // standard include for target platform -- Platform_Include_Boilerplate
whismanoid 11:48aefcaa1d29 35 #include "mbed.h"
whismanoid 22:a14c19b97d0b 36 // Platforms:
whismanoid 22:a14c19b97d0b 37 // - MAX32625MBED
whismanoid 22:a14c19b97d0b 38 // - supports mbed-os-5.11, requires USBDevice library
whismanoid 22:a14c19b97d0b 39 // - add https://developer.mbed.org/teams/MaximIntegrated/code/USBDevice/
whismanoid 22:a14c19b97d0b 40 // - remove max32630fthr library (if present)
whismanoid 22:a14c19b97d0b 41 // - remove MAX32620FTHR library (if present)
whismanoid 22:a14c19b97d0b 42 // - MAX32600MBED
whismanoid 22:a14c19b97d0b 43 // - remove max32630fthr library (if present)
whismanoid 22:a14c19b97d0b 44 // - remove MAX32620FTHR library (if present)
whismanoid 22:a14c19b97d0b 45 // - Windows 10 note: Don't connect HDK until you are ready to load new firmware into the board.
whismanoid 22:a14c19b97d0b 46 // - NUCLEO_F446RE
whismanoid 22:a14c19b97d0b 47 // - remove USBDevice library
whismanoid 22:a14c19b97d0b 48 // - remove max32630fthr library (if present)
whismanoid 22:a14c19b97d0b 49 // - remove MAX32620FTHR library (if present)
whismanoid 22:a14c19b97d0b 50 // - NUCLEO_F401RE
whismanoid 22:a14c19b97d0b 51 // - remove USBDevice library
whismanoid 22:a14c19b97d0b 52 // - remove max32630fthr library (if present)
whismanoid 22:a14c19b97d0b 53 // - remove MAX32620FTHR library (if present)
whismanoid 22:a14c19b97d0b 54 // - MAX32630FTHR
whismanoid 22:a14c19b97d0b 55 // - #include "max32630fthr.h"
whismanoid 22:a14c19b97d0b 56 // - add http://os.mbed.org/teams/MaximIntegrated/code/max32630fthr/
whismanoid 22:a14c19b97d0b 57 // - remove MAX32620FTHR library (if present)
whismanoid 22:a14c19b97d0b 58 // - MAX32620FTHR
whismanoid 22:a14c19b97d0b 59 // - #include "MAX32620FTHR.h"
whismanoid 22:a14c19b97d0b 60 // - remove max32630fthr library (if present)
whismanoid 22:a14c19b97d0b 61 // - add https://os.mbed.com/teams/MaximIntegrated/code/MAX32620FTHR/
whismanoid 22:a14c19b97d0b 62 // - not tested yet
whismanoid 22:a14c19b97d0b 63 // - MAX32625PICO
whismanoid 22:a14c19b97d0b 64 // - remove max32630fthr library (if present)
whismanoid 22:a14c19b97d0b 65 // - remove MAX32620FTHR library (if present)
whismanoid 22:a14c19b97d0b 66 // - not tested yet
whismanoid 22:a14c19b97d0b 67 //
whismanoid 22:a14c19b97d0b 68 // end Platform_Include_Boilerplate
whismanoid 11:48aefcaa1d29 69 #include "MAX5171.h"
whismanoid 11:48aefcaa1d29 70 #include "CmdLine.h"
whismanoid 22:a14c19b97d0b 71 #include "MaximTinyTester.h"
whismanoid 11:48aefcaa1d29 72
whismanoid 22:a14c19b97d0b 73 #include "MAX5171.h"
whismanoid 22:a14c19b97d0b 74 extern MAX5171 g_MAX5171_device; // defined in main.cpp
whismanoid 22:a14c19b97d0b 75
whismanoid 22:a14c19b97d0b 76
whismanoid 11:48aefcaa1d29 77
whismanoid 22:a14c19b97d0b 78 void MAX5171_menu_help(CmdLine & cmdLine)
whismanoid 22:a14c19b97d0b 79 {
whismanoid 22:a14c19b97d0b 80 cmdLine.serial().printf("\r\n ! -- Init");
whismanoid 22:a14c19b97d0b 81 cmdLine.serial().printf("\r\n 0 code=? -- CODE");
whismanoid 22:a14c19b97d0b 82 cmdLine.serial().printf("\r\n 4 code=? -- CODE_LOAD");
whismanoid 22:a14c19b97d0b 83 cmdLine.serial().printf("\r\n 8 -- LOAD");
whismanoid 22:a14c19b97d0b 84 cmdLine.serial().printf("\r\n c -- NOP");
whismanoid 22:a14c19b97d0b 85 cmdLine.serial().printf("\r\n d -- SHUTDOWN");
whismanoid 22:a14c19b97d0b 86 cmdLine.serial().printf("\r\n e0 -- UPO_LOW");
whismanoid 22:a14c19b97d0b 87 cmdLine.serial().printf("\r\n e8 -- UPO_HIGH");
whismanoid 22:a14c19b97d0b 88 cmdLine.serial().printf("\r\n f0 -- MODE1_DOUT_SCLK_RISING_EDGE");
whismanoid 22:a14c19b97d0b 89 cmdLine.serial().printf("\r\n f8 -- MODE0_DOUT_SCLK_FALLING_EDGE");
whismanoid 22:a14c19b97d0b 90 //
whismanoid 22:a14c19b97d0b 91 cmdLine.serial().printf("\r\n @ -- print MAX5171 configuration");
whismanoid 22:a14c19b97d0b 92
whismanoid 22:a14c19b97d0b 93 //
whismanoid 22:a14c19b97d0b 94 // case 'G'..'Z','g'..'z' are reserved for GPIO commands
whismanoid 22:a14c19b97d0b 95 // case 'A'..'F','a'..'f' may be available if not claimed by bitstream commands
whismanoid 22:a14c19b97d0b 96
whismanoid 22:a14c19b97d0b 97 //
whismanoid 22:a14c19b97d0b 98 }
whismanoid 11:48aefcaa1d29 99
whismanoid 11:48aefcaa1d29 100 bool MAX5171_menu_onEOLcommandParser(CmdLine & cmdLine)
whismanoid 11:48aefcaa1d29 101 {
whismanoid 22:a14c19b97d0b 102
whismanoid 22:a14c19b97d0b 103
whismanoid 22:a14c19b97d0b 104 // parse argument int16_t DACCode
whismanoid 22:a14c19b97d0b 105 int16_t DACCode = g_MAX5171_device.DACCode; // default to global property value
whismanoid 22:a14c19b97d0b 106 if (cmdLine.parse_int16_dec("DACCode", DACCode))
whismanoid 22:a14c19b97d0b 107 {
whismanoid 22:a14c19b97d0b 108 g_MAX5171_device.DACCode = DACCode; // update global property value
whismanoid 22:a14c19b97d0b 109 }
whismanoid 22:a14c19b97d0b 110 // "code" is an alias for argument "DACCode"
whismanoid 22:a14c19b97d0b 111 if (cmdLine.parse_int16_dec("code", DACCode))
whismanoid 22:a14c19b97d0b 112 {
whismanoid 22:a14c19b97d0b 113 g_MAX5171_device.DACCode = DACCode; // update global property value
whismanoid 22:a14c19b97d0b 114 }
whismanoid 22:a14c19b97d0b 115
whismanoid 22:a14c19b97d0b 116 // parse argument double VRef
whismanoid 22:a14c19b97d0b 117 double VRef = g_MAX5171_device.VRef; // default to global property value
whismanoid 22:a14c19b97d0b 118 if (cmdLine.parse_double("VRef", VRef))
whismanoid 22:a14c19b97d0b 119 {
whismanoid 22:a14c19b97d0b 120 g_MAX5171_device.VRef = VRef; // update global property value
whismanoid 22:a14c19b97d0b 121 }
whismanoid 22:a14c19b97d0b 122
whismanoid 22:a14c19b97d0b 123 // parse argument uint16_t dacCodeLsbs
whismanoid 22:a14c19b97d0b 124 uint16_t dacCodeLsbs = g_MAX5171_device.DACCode; // default to global property value
whismanoid 22:a14c19b97d0b 125 if (cmdLine.parse_uint16_dec("dacCodeLsbs", dacCodeLsbs))
whismanoid 22:a14c19b97d0b 126 {
whismanoid 22:a14c19b97d0b 127 g_MAX5171_device.DACCode = dacCodeLsbs; // update global property value
whismanoid 22:a14c19b97d0b 128 }
whismanoid 22:a14c19b97d0b 129 // "code" is an alias for argument "dacCodeLsbs"
whismanoid 22:a14c19b97d0b 130 if (cmdLine.parse_uint16_dec("code", dacCodeLsbs))
whismanoid 22:a14c19b97d0b 131 {
whismanoid 22:a14c19b97d0b 132 g_MAX5171_device.DACCode = dacCodeLsbs; // update global property value
whismanoid 22:a14c19b97d0b 133 }
whismanoid 22:a14c19b97d0b 134
whismanoid 11:48aefcaa1d29 135 switch (cmdLine[0])
whismanoid 11:48aefcaa1d29 136 {
whismanoid 22:a14c19b97d0b 137 case '@':
whismanoid 22:a14c19b97d0b 138 {
whismanoid 22:a14c19b97d0b 139 cmdLine.serial().printf("VRef = ");
whismanoid 24:3ef3dd32c7b5 140 cmdLine.serial().printf("%1.6f\r\n", g_MAX5171_device.VRef);
whismanoid 22:a14c19b97d0b 141 cmdLine.serial().printf("DACCode = ");
whismanoid 22:a14c19b97d0b 142 cmdLine.serial().printf("%d = 0x%4.4x\r\n", g_MAX5171_device.DACCode, g_MAX5171_device.DACCode);
whismanoid 22:a14c19b97d0b 143 return true; // command handled by MAX5171
whismanoid 22:a14c19b97d0b 144 break;
whismanoid 22:a14c19b97d0b 145 }
whismanoid 22:a14c19b97d0b 146 // case 'G'..'Z','g'..'z' are reserved for GPIO commands
whismanoid 22:a14c19b97d0b 147 // case 'A'..'F','a'..'f' may be available if not claimed by bitstream commands
whismanoid 22:a14c19b97d0b 148 // case '0'..'9','A'..'F','a'..'f' letters are reserved for bitstream commands
whismanoid 22:a14c19b97d0b 149 case '!':
whismanoid 22:a14c19b97d0b 150 {
whismanoid 22:a14c19b97d0b 151 // test menu command '!' handler:
whismanoid 22:a14c19b97d0b 152 // helpString='! -- Init'
whismanoid 22:a14c19b97d0b 153 // CMD_='None'
whismanoid 22:a14c19b97d0b 154 // CommandName='Init'
whismanoid 22:a14c19b97d0b 155 // CommandParamIn='void'
whismanoid 23:abd02fed1ae4 156 // CommandReturnType='void'
whismanoid 22:a14c19b97d0b 157 // @Pre=''
whismanoid 22:a14c19b97d0b 158 // @Param[in]=''
whismanoid 22:a14c19b97d0b 159 // @Param[out]=''
whismanoid 22:a14c19b97d0b 160 // @Post=''
whismanoid 22:a14c19b97d0b 161 // displayPost=''
whismanoid 23:abd02fed1ae4 162 // @Return=''
whismanoid 23:abd02fed1ae4 163 // @Test='@test group DACCodeOfVoltage // Verify function DACCodeOfVoltage (enabled by default)'
whismanoid 23:abd02fed1ae4 164 // @Test='@test group DACCodeOfVoltage tinyTester.blink_time_msec = 20 // quickly speed through the software verification'
whismanoid 23:abd02fed1ae4 165 // @Test='@test group DACCodeOfVoltage tinyTester.print("VRef = 2.500 MAX5171 14-bit LSB = 0.00015V")'
whismanoid 23:abd02fed1ae4 166 // @Test='@test group DACCodeOfVoltage VRef = 2.500'
whismanoid 23:abd02fed1ae4 167 // @Test='@test group DACCodeOfVoltage tinyTester.err_threshold = 0.00015259720441921504 // 14-bit LSB (2.500/16383)'
whismanoid 23:abd02fed1ae4 168 // @Test='@test group DACCodeOfVoltage DACCodeOfVoltage(2.499847412109375) expect 0x3FFF'
whismanoid 23:abd02fed1ae4 169 // @Test='@test group DACCodeOfVoltage DACCodeOfVoltage(2.49969482421875) expect 0x3FFE'
whismanoid 23:abd02fed1ae4 170 // @Test='@test group DACCodeOfVoltage DACCodeOfVoltage(2.499542236328125) expect 0x3FFD'
whismanoid 23:abd02fed1ae4 171 // @Test='@test group DACCodeOfVoltage DACCodeOfVoltage(2.4993896484375) expect 0x3FFC'
whismanoid 23:abd02fed1ae4 172 // @Test='@test group DACCodeOfVoltage DACCodeOfVoltage(1.250152587890625) expect 0x2001'
whismanoid 23:abd02fed1ae4 173 // @Test='@test group DACCodeOfVoltage DACCodeOfVoltage(1.25) expect 0x2000'
whismanoid 23:abd02fed1ae4 174 // @Test='@test group DACCodeOfVoltage DACCodeOfVoltage(1.249847412109375) expect 0x1FFF'
whismanoid 23:abd02fed1ae4 175 // @Test='@test group DACCodeOfVoltage DACCodeOfVoltage(1.24969482421875) expect 0x1FFE'
whismanoid 23:abd02fed1ae4 176 // @Test='@test group DACCodeOfVoltage DACCodeOfVoltage(0.000457763671875) expect 0x0003'
whismanoid 23:abd02fed1ae4 177 // @Test='@test group DACCodeOfVoltage DACCodeOfVoltage(0.00030517578125) expect 0x0002'
whismanoid 23:abd02fed1ae4 178 // @Test='@test group DACCodeOfVoltage DACCodeOfVoltage(0.000152587890625) expect 0x0001'
whismanoid 23:abd02fed1ae4 179 // @Test='@test group DACCodeOfVoltage DACCodeOfVoltage(0.00000) expect 0x0000'
whismanoid 23:abd02fed1ae4 180 // @Test='@test group DACCodeOfVoltage tinyTester.blink_time_msec = 75 // default 75 resume hardware self test'
whismanoid 23:abd02fed1ae4 181 // @Test='@test group VoltageOfCode // Verify function VoltageOfCode (enabled by default)'
whismanoid 23:abd02fed1ae4 182 // @Test='@test group VoltageOfCode tinyTester.blink_time_msec = 20 // quickly speed through the software verification'
whismanoid 23:abd02fed1ae4 183 // @Test='@test group VoltageOfCode tinyTester.print("VRef = 2.500 MAX5171 14-bit LSB = 0.00015V")'
whismanoid 23:abd02fed1ae4 184 // @Test='@test group VoltageOfCode VRef = 2.500'
whismanoid 23:abd02fed1ae4 185 // @Test='@test group VoltageOfCode tinyTester.err_threshold = 0.00015259720441921504 // 14-bit LSB (2.500/16383)'
whismanoid 23:abd02fed1ae4 186 // @Test='@test group VoltageOfCode VoltageOfCode(0x3FFF) expect 2.499847412109375'
whismanoid 23:abd02fed1ae4 187 // @Test='@test group VoltageOfCode VoltageOfCode(0x3FFE) expect 2.49969482421875'
whismanoid 23:abd02fed1ae4 188 // @Test='@test group VoltageOfCode VoltageOfCode(0x3FFD) expect 2.499542236328125'
whismanoid 23:abd02fed1ae4 189 // @Test='@test group VoltageOfCode VoltageOfCode(0x3FFC) expect 2.4993896484375'
whismanoid 23:abd02fed1ae4 190 // @Test='@test group VoltageOfCode VoltageOfCode(0x2001) expect 1.250152587890625'
whismanoid 23:abd02fed1ae4 191 // @Test='@test group VoltageOfCode VoltageOfCode(0x2000) expect 1.25'
whismanoid 23:abd02fed1ae4 192 // @Test='@test group VoltageOfCode VoltageOfCode(0x1FFF) expect 1.249847412109375'
whismanoid 23:abd02fed1ae4 193 // @Test='@test group VoltageOfCode VoltageOfCode(0x1FFE) expect 1.24969482421875'
whismanoid 23:abd02fed1ae4 194 // @Test='@test group VoltageOfCode VoltageOfCode(0x0003) expect 0.000457763671875'
whismanoid 23:abd02fed1ae4 195 // @Test='@test group VoltageOfCode VoltageOfCode(0x0002) expect 0.00030517578125'
whismanoid 23:abd02fed1ae4 196 // @Test='@test group VoltageOfCode VoltageOfCode(0x0001) expect 0.000152587890625'
whismanoid 23:abd02fed1ae4 197 // @Test='@test group VoltageOfCode VoltageOfCode(0x0000) expect 0.00000'
whismanoid 23:abd02fed1ae4 198 // @Test='@test group VoltageOfCode tinyTester.blink_time_msec = 75 // default 75 resume hardware self test'
whismanoid 23:abd02fed1ae4 199 // @Test='@test group CODE_LOAD // Verify function CODE_LOAD (enabled by default)'
whismanoid 23:abd02fed1ae4 200 // @Test='@test group CODE_LOAD tinyTester.blink_time_msec = 75 // default 75 resume hardware self test'
whismanoid 23:abd02fed1ae4 201 // @Test='@test group CODE_LOAD tinyTester.settle_time_msec = 500'
whismanoid 23:abd02fed1ae4 202 // @Test='@test Init()'
whismanoid 23:abd02fed1ae4 203 // @Test='@test VRef expect 2.500 // Nominal Full-Scale Voltage Reference'
whismanoid 23:abd02fed1ae4 204 // @Test='@test group CODE_LOAD tinyTester.err_threshold = 0.050'
whismanoid 23:abd02fed1ae4 205 // @Test='@test group CODE_LOAD tinyTester.print("100.0% of full scale REF(2.50V) = 2.50V Jumper FB=1-2")'
whismanoid 23:abd02fed1ae4 206 // @Test='@test group CODE_LOAD CODE_LOAD(0x3FFF) // 100.0% of full scale REF(2.50V) = 2.50V'
whismanoid 23:abd02fed1ae4 207 // @Test='@test group CODE_LOAD tinyTester.Wait_Output_Settling()'
whismanoid 23:abd02fed1ae4 208 // @Test='@test group CODE_LOAD tinyTester.AnalogIn0_Read_Expect_voltageV(2.500)'
whismanoid 23:abd02fed1ae4 209 // @Test='@test group CODE_LOAD tinyTester.print("0.0% of full scale REF(2.50V) = 0.000V")'
whismanoid 23:abd02fed1ae4 210 // @Test='@test group CODE_LOAD CODE_LOAD(0x0000) // 0.0% of full scale REF(2.50V) = 0.000V'
whismanoid 23:abd02fed1ae4 211 // @Test='@test group CODE_LOAD tinyTester.Wait_Output_Settling()'
whismanoid 23:abd02fed1ae4 212 // @Test='@test group CODE_LOAD tinyTester.AnalogIn0_Read_Expect_voltageV(0.0000)'
whismanoid 23:abd02fed1ae4 213 // @Test='@test group CODE_LOAD tinyTester.print("50.0% of full scale REF(2.50V) = 1.25V")'
whismanoid 23:abd02fed1ae4 214 // @Test='@test group CODE_LOAD CODE_LOAD(0x1FFF) // 50.0% of full scale REF(2.50V) = 1.25V'
whismanoid 23:abd02fed1ae4 215 // @Test='@test group CODE_LOAD tinyTester.Wait_Output_Settling()'
whismanoid 23:abd02fed1ae4 216 // @Test='@test group CODE_LOAD tinyTester.AnalogIn0_Read_Expect_voltageV(1.2500)'
whismanoid 23:abd02fed1ae4 217 // @Test='@test group UPO // Verify User Programmable Output functions UPO_HIGH and UPO_LOW (enabled by default)'
whismanoid 23:abd02fed1ae4 218 // @Test='@test group UPO tinyTester.blink_time_msec = 75 // default 75 resume hardware self test'
whismanoid 23:abd02fed1ae4 219 // @Test='@test group UPO tinyTester.settle_time_msec = 500 // default 250'
whismanoid 23:abd02fed1ae4 220 // @Test='@test group UPO UPO_HIGH()'
whismanoid 23:abd02fed1ae4 221 // @Test='@test group UPO tinyTester.Wait_Output_Settling()'
whismanoid 23:abd02fed1ae4 222 // @Test='@test group CODE_LOAD tinyTester.DigitalIn_Read_Expect_WarnOnly(UPO_pin, "UPO", 1, "UPO_pin is high after MAX5171 UPO_HIGH command")'
whismanoid 23:abd02fed1ae4 223 // @Test='@test group UPO UPO_LOW()'
whismanoid 23:abd02fed1ae4 224 // @Test='@test group UPO tinyTester.Wait_Output_Settling()'
whismanoid 23:abd02fed1ae4 225 // @Test='@test group CODE_LOAD tinyTester.DigitalIn_Read_Expect_WarnOnly(UPO_pin, "UPO", 0, "UPO_pin is low after MAX5171 UPO_LOW command")'
whismanoid 23:abd02fed1ae4 226 // @Test='@test group UPO UPO_HIGH()'
whismanoid 23:abd02fed1ae4 227 // @Test='@test group UPO tinyTester.Wait_Output_Settling()'
whismanoid 23:abd02fed1ae4 228 // @Test='@test group CODE_LOAD tinyTester.DigitalIn_Read_Expect_WarnOnly(UPO_pin, "UPO", 1, "UPO_pin is high after MAX5171 UPO_HIGH command")'
whismanoid 22:a14c19b97d0b 229 cmdLine.serial().printf("Init");
whismanoid 22:a14c19b97d0b 230 // call function Init
whismanoid 23:abd02fed1ae4 231 g_MAX5171_device.Init();
whismanoid 22:a14c19b97d0b 232 return true; // command handled by MAX5171
whismanoid 22:a14c19b97d0b 233 } // end case '!'
whismanoid 22:a14c19b97d0b 234 break;
whismanoid 11:48aefcaa1d29 235 case '0':
whismanoid 11:48aefcaa1d29 236 {
whismanoid 22:a14c19b97d0b 237 // test menu command '0' handler:
whismanoid 22:a14c19b97d0b 238 // helpString='0 code=? -- CODE'
whismanoid 22:a14c19b97d0b 239 // CMD_='CMD_00dd_dddd_dddd_dddd_CODE'
whismanoid 22:a14c19b97d0b 240 // CommandName='CODE'
whismanoid 22:a14c19b97d0b 241 // CommandParamIn='uint16_t dacCodeLsbs'
whismanoid 22:a14c19b97d0b 242 // CommandReturnType='uint8_t'
whismanoid 22:a14c19b97d0b 243 // @Pre=''
whismanoid 22:a14c19b97d0b 244 // @Param[in]=''
whismanoid 22:a14c19b97d0b 245 // @Param[out]=''
whismanoid 22:a14c19b97d0b 246 // @Post=''
whismanoid 22:a14c19b97d0b 247 // @Return='@return 1 on success; 0 on failure'
whismanoid 22:a14c19b97d0b 248 // parse argument list
whismanoid 22:a14c19b97d0b 249 // argument dacCodeLsbs alias code already parsed
whismanoid 22:a14c19b97d0b 250 // print arguments
whismanoid 22:a14c19b97d0b 251 cmdLine.serial().printf("CODE");
whismanoid 22:a14c19b97d0b 252 cmdLine.serial().printf(" dacCodeLsbs=%d", dacCodeLsbs);
whismanoid 22:a14c19b97d0b 253 cmdLine.serial().printf("\r\n");
whismanoid 22:a14c19b97d0b 254 // call function CODE(dacCodeLsbs)
whismanoid 22:a14c19b97d0b 255 uint8_t result = g_MAX5171_device.CODE(dacCodeLsbs);
whismanoid 22:a14c19b97d0b 256 cmdLine.serial().printf(" =%d\r\n", result);
whismanoid 22:a14c19b97d0b 257 return true; // command handled by MAX5171
whismanoid 22:a14c19b97d0b 258 } // end case '0'
whismanoid 11:48aefcaa1d29 259 break;
whismanoid 11:48aefcaa1d29 260 case '4':
whismanoid 11:48aefcaa1d29 261 {
whismanoid 22:a14c19b97d0b 262 // test menu command '4' handler:
whismanoid 22:a14c19b97d0b 263 // helpString='4 code=? -- CODE_LOAD'
whismanoid 22:a14c19b97d0b 264 // CMD_='CMD_01dd_dddd_dddd_dddd_CODE_LOAD'
whismanoid 22:a14c19b97d0b 265 // CommandName='CODE_LOAD'
whismanoid 22:a14c19b97d0b 266 // CommandParamIn='uint16_t dacCodeLsbs'
whismanoid 22:a14c19b97d0b 267 // CommandReturnType='uint8_t'
whismanoid 22:a14c19b97d0b 268 // @Pre=''
whismanoid 22:a14c19b97d0b 269 // @Param[in]=''
whismanoid 22:a14c19b97d0b 270 // @Param[out]=''
whismanoid 22:a14c19b97d0b 271 // @Post=''
whismanoid 22:a14c19b97d0b 272 // @Return='@return 1 on success; 0 on failure'
whismanoid 22:a14c19b97d0b 273 // parse argument list
whismanoid 22:a14c19b97d0b 274 // argument dacCodeLsbs alias code already parsed
whismanoid 22:a14c19b97d0b 275 // print arguments
whismanoid 22:a14c19b97d0b 276 cmdLine.serial().printf("CODE_LOAD");
whismanoid 22:a14c19b97d0b 277 cmdLine.serial().printf(" dacCodeLsbs=%d", dacCodeLsbs);
whismanoid 22:a14c19b97d0b 278 cmdLine.serial().printf("\r\n");
whismanoid 22:a14c19b97d0b 279 // call function CODE_LOAD(dacCodeLsbs)
whismanoid 22:a14c19b97d0b 280 uint8_t result = g_MAX5171_device.CODE_LOAD(dacCodeLsbs);
whismanoid 22:a14c19b97d0b 281 cmdLine.serial().printf(" =%d\r\n", result);
whismanoid 22:a14c19b97d0b 282 return true; // command handled by MAX5171
whismanoid 22:a14c19b97d0b 283 } // end case '4'
whismanoid 11:48aefcaa1d29 284 break;
whismanoid 11:48aefcaa1d29 285 case '8':
whismanoid 11:48aefcaa1d29 286 {
whismanoid 22:a14c19b97d0b 287 // test menu command '8' handler:
whismanoid 22:a14c19b97d0b 288 // helpString='8 -- LOAD'
whismanoid 22:a14c19b97d0b 289 // CMD_='CMD_10xx_xxxx_xxxx_xxxx_LOAD'
whismanoid 22:a14c19b97d0b 290 // CommandName='LOAD'
whismanoid 22:a14c19b97d0b 291 // CommandParamIn='void'
whismanoid 22:a14c19b97d0b 292 // CommandReturnType='uint8_t'
whismanoid 22:a14c19b97d0b 293 // @Pre=''
whismanoid 22:a14c19b97d0b 294 // @Param[in]=''
whismanoid 22:a14c19b97d0b 295 // @Param[out]=''
whismanoid 22:a14c19b97d0b 296 // @Post=''
whismanoid 22:a14c19b97d0b 297 // @Return='@return 1 on success; 0 on failure'
whismanoid 22:a14c19b97d0b 298 cmdLine.serial().printf("LOAD");
whismanoid 22:a14c19b97d0b 299 // call function LOAD
whismanoid 22:a14c19b97d0b 300 uint8_t result = g_MAX5171_device.LOAD();
whismanoid 22:a14c19b97d0b 301 cmdLine.serial().printf(" =%d\r\n", result);
whismanoid 22:a14c19b97d0b 302 return true; // command handled by MAX5171
whismanoid 22:a14c19b97d0b 303 } // end case '8'
whismanoid 11:48aefcaa1d29 304 break;
whismanoid 22:a14c19b97d0b 305 case 'c':
whismanoid 11:48aefcaa1d29 306 {
whismanoid 22:a14c19b97d0b 307 // test menu command 'c' handler:
whismanoid 22:a14c19b97d0b 308 // helpString='c -- NOP'
whismanoid 22:a14c19b97d0b 309 // CMD_='CMD_1100_xxxx_xxxx_xxxx_NOP'
whismanoid 22:a14c19b97d0b 310 // CommandName='NOP'
whismanoid 22:a14c19b97d0b 311 // CommandParamIn='void'
whismanoid 22:a14c19b97d0b 312 // CommandReturnType='uint8_t'
whismanoid 22:a14c19b97d0b 313 // @Pre=''
whismanoid 22:a14c19b97d0b 314 // @Param[in]=''
whismanoid 22:a14c19b97d0b 315 // @Param[out]=''
whismanoid 22:a14c19b97d0b 316 // @Post=''
whismanoid 22:a14c19b97d0b 317 // @Return='@return 1 on success; 0 on failure'
whismanoid 22:a14c19b97d0b 318 cmdLine.serial().printf("NOP");
whismanoid 22:a14c19b97d0b 319 // call function NOP
whismanoid 22:a14c19b97d0b 320 uint8_t result = g_MAX5171_device.NOP();
whismanoid 22:a14c19b97d0b 321 cmdLine.serial().printf(" =%d\r\n", result);
whismanoid 22:a14c19b97d0b 322 return true; // command handled by MAX5171
whismanoid 22:a14c19b97d0b 323 } // end case 'c'
whismanoid 11:48aefcaa1d29 324 break;
whismanoid 22:a14c19b97d0b 325 case 'd':
whismanoid 11:48aefcaa1d29 326 {
whismanoid 22:a14c19b97d0b 327 // test menu command 'd' handler:
whismanoid 22:a14c19b97d0b 328 // helpString='d -- SHUTDOWN'
whismanoid 22:a14c19b97d0b 329 // CMD_='CMD_1101_xxxx_xxxx_xxxx_SHUTDOWN'
whismanoid 22:a14c19b97d0b 330 // CommandName='SHUTDOWN'
whismanoid 22:a14c19b97d0b 331 // CommandParamIn='void'
whismanoid 22:a14c19b97d0b 332 // CommandReturnType='uint8_t'
whismanoid 22:a14c19b97d0b 333 // @Pre=''
whismanoid 22:a14c19b97d0b 334 // @Param[in]=''
whismanoid 22:a14c19b97d0b 335 // @Param[out]=''
whismanoid 22:a14c19b97d0b 336 // @Post=''
whismanoid 22:a14c19b97d0b 337 // @Return='@return 1 on success; 0 on failure'
whismanoid 22:a14c19b97d0b 338 cmdLine.serial().printf("SHUTDOWN");
whismanoid 22:a14c19b97d0b 339 // call function SHUTDOWN
whismanoid 22:a14c19b97d0b 340 uint8_t result = g_MAX5171_device.SHUTDOWN();
whismanoid 22:a14c19b97d0b 341 cmdLine.serial().printf(" =%d\r\n", result);
whismanoid 22:a14c19b97d0b 342 return true; // command handled by MAX5171
whismanoid 22:a14c19b97d0b 343 } // end case 'd'
whismanoid 11:48aefcaa1d29 344 break;
whismanoid 22:a14c19b97d0b 345 case 'e': // (multiple characters) (testMenuFirstCharHandler="e"):
whismanoid 11:48aefcaa1d29 346 {
whismanoid 11:48aefcaa1d29 347 switch (cmdLine[1])
whismanoid 11:48aefcaa1d29 348 {
whismanoid 22:a14c19b97d0b 349 case '0': // (nested inside case 'e')
whismanoid 11:48aefcaa1d29 350 {
whismanoid 22:a14c19b97d0b 351 // test menu command 'e0' handler:
whismanoid 22:a14c19b97d0b 352 // helpString='e0 -- UPO_LOW'
whismanoid 22:a14c19b97d0b 353 // CMD_='CMD_1110_0xxx_xxxx_xxxx_UPO_LOW'
whismanoid 22:a14c19b97d0b 354 // CommandName='UPO_LOW'
whismanoid 22:a14c19b97d0b 355 // CommandParamIn='void'
whismanoid 22:a14c19b97d0b 356 // CommandReturnType='uint8_t'
whismanoid 22:a14c19b97d0b 357 // @Pre=''
whismanoid 22:a14c19b97d0b 358 // @Param[in]=''
whismanoid 22:a14c19b97d0b 359 // @Param[out]=''
whismanoid 22:a14c19b97d0b 360 // @Post=''
whismanoid 22:a14c19b97d0b 361 // @Return='@return 1 on success; 0 on failure'
whismanoid 11:48aefcaa1d29 362 cmdLine.serial().printf("UPO_LOW");
whismanoid 22:a14c19b97d0b 363 // call function UPO_LOW
whismanoid 22:a14c19b97d0b 364 uint8_t result = g_MAX5171_device.UPO_LOW();
whismanoid 22:a14c19b97d0b 365 cmdLine.serial().printf(" =%d\r\n", result);
whismanoid 22:a14c19b97d0b 366 return true; // command handled by MAX5171
whismanoid 22:a14c19b97d0b 367 } // end nested case 'e0'
whismanoid 11:48aefcaa1d29 368 break;
whismanoid 22:a14c19b97d0b 369 case '8': // (nested inside case 'e')
whismanoid 11:48aefcaa1d29 370 {
whismanoid 22:a14c19b97d0b 371 // test menu command 'e8' handler:
whismanoid 22:a14c19b97d0b 372 // helpString='e8 -- UPO_HIGH'
whismanoid 22:a14c19b97d0b 373 // CMD_='CMD_1110_1xxx_xxxx_xxxx_UPO_HIGH'
whismanoid 22:a14c19b97d0b 374 // CommandName='UPO_HIGH'
whismanoid 22:a14c19b97d0b 375 // CommandParamIn='void'
whismanoid 22:a14c19b97d0b 376 // CommandReturnType='uint8_t'
whismanoid 22:a14c19b97d0b 377 // @Pre=''
whismanoid 22:a14c19b97d0b 378 // @Param[in]=''
whismanoid 22:a14c19b97d0b 379 // @Param[out]=''
whismanoid 22:a14c19b97d0b 380 // @Post=''
whismanoid 22:a14c19b97d0b 381 // @Return='@return 1 on success; 0 on failure'
whismanoid 11:48aefcaa1d29 382 cmdLine.serial().printf("UPO_HIGH");
whismanoid 22:a14c19b97d0b 383 // call function UPO_HIGH
whismanoid 22:a14c19b97d0b 384 uint8_t result = g_MAX5171_device.UPO_HIGH();
whismanoid 22:a14c19b97d0b 385 cmdLine.serial().printf(" =%d\r\n", result);
whismanoid 22:a14c19b97d0b 386 return true; // command handled by MAX5171
whismanoid 22:a14c19b97d0b 387 } // end nested case 'e8'
whismanoid 11:48aefcaa1d29 388 break;
whismanoid 22:a14c19b97d0b 389 } // end nested switch (cmdLine[1]) inside case 'e'
whismanoid 22:a14c19b97d0b 390 break;
whismanoid 22:a14c19b97d0b 391 } // end case 'e'
whismanoid 22:a14c19b97d0b 392 case 'f': // (multiple characters) (testMenuFirstCharHandler="f"):
whismanoid 11:48aefcaa1d29 393 {
whismanoid 11:48aefcaa1d29 394 switch (cmdLine[1])
whismanoid 11:48aefcaa1d29 395 {
whismanoid 22:a14c19b97d0b 396 case '0': // (nested inside case 'f')
whismanoid 11:48aefcaa1d29 397 {
whismanoid 22:a14c19b97d0b 398 // test menu command 'f0' handler:
whismanoid 22:a14c19b97d0b 399 // helpString='f0 -- MODE1_DOUT_SCLK_RISING_EDGE'
whismanoid 22:a14c19b97d0b 400 // CMD_='CMD_1111_0xxx_xxxx_xxxx_MODE1_DOUT_SCLK_RISING_EDGE'
whismanoid 22:a14c19b97d0b 401 // CommandName='MODE1_DOUT_SCLK_RISING_EDGE'
whismanoid 22:a14c19b97d0b 402 // CommandParamIn='void'
whismanoid 22:a14c19b97d0b 403 // CommandReturnType='uint8_t'
whismanoid 22:a14c19b97d0b 404 // @Pre=''
whismanoid 22:a14c19b97d0b 405 // @Param[in]=''
whismanoid 22:a14c19b97d0b 406 // @Param[out]=''
whismanoid 22:a14c19b97d0b 407 // @Post=''
whismanoid 22:a14c19b97d0b 408 // @Return='@return 1 on success; 0 on failure'
whismanoid 11:48aefcaa1d29 409 cmdLine.serial().printf("MODE1_DOUT_SCLK_RISING_EDGE");
whismanoid 22:a14c19b97d0b 410 // call function MODE1_DOUT_SCLK_RISING_EDGE
whismanoid 22:a14c19b97d0b 411 uint8_t result = g_MAX5171_device.MODE1_DOUT_SCLK_RISING_EDGE();
whismanoid 22:a14c19b97d0b 412 cmdLine.serial().printf(" =%d\r\n", result);
whismanoid 22:a14c19b97d0b 413 return true; // command handled by MAX5171
whismanoid 22:a14c19b97d0b 414 } // end nested case 'f0'
whismanoid 11:48aefcaa1d29 415 break;
whismanoid 22:a14c19b97d0b 416 case '8': // (nested inside case 'f')
whismanoid 22:a14c19b97d0b 417 {
whismanoid 22:a14c19b97d0b 418 // test menu command 'f8' handler:
whismanoid 22:a14c19b97d0b 419 // helpString='f8 -- MODE0_DOUT_SCLK_FALLING_EDGE'
whismanoid 22:a14c19b97d0b 420 // CMD_='CMD_1111_1xxx_xxxx_xxxx_MODE0_DOUT_SCLK_FALLING_EDGE'
whismanoid 22:a14c19b97d0b 421 // CommandName='MODE0_DOUT_SCLK_FALLING_EDGE'
whismanoid 22:a14c19b97d0b 422 // CommandParamIn='void'
whismanoid 22:a14c19b97d0b 423 // CommandReturnType='uint8_t'
whismanoid 22:a14c19b97d0b 424 // @Pre=''
whismanoid 22:a14c19b97d0b 425 // @Param[in]=''
whismanoid 22:a14c19b97d0b 426 // @Param[out]=''
whismanoid 22:a14c19b97d0b 427 // @Post=''
whismanoid 22:a14c19b97d0b 428 // @Return='@return 1 on success; 0 on failure'
whismanoid 22:a14c19b97d0b 429 cmdLine.serial().printf("MODE0_DOUT_SCLK_FALLING_EDGE");
whismanoid 22:a14c19b97d0b 430 // call function MODE0_DOUT_SCLK_FALLING_EDGE
whismanoid 22:a14c19b97d0b 431 uint8_t result = g_MAX5171_device.MODE0_DOUT_SCLK_FALLING_EDGE();
whismanoid 22:a14c19b97d0b 432 cmdLine.serial().printf(" =%d\r\n", result);
whismanoid 22:a14c19b97d0b 433 return true; // command handled by MAX5171
whismanoid 22:a14c19b97d0b 434 } // end nested case 'f8'
whismanoid 22:a14c19b97d0b 435 break;
whismanoid 22:a14c19b97d0b 436 } // end nested switch (cmdLine[1]) inside case 'f'
whismanoid 22:a14c19b97d0b 437 break;
whismanoid 22:a14c19b97d0b 438 } // end case 'f'
whismanoid 11:48aefcaa1d29 439 } // end switch (cmdLine[0])
whismanoid 22:a14c19b97d0b 440 return false; // command not handled by MAX5171
whismanoid 11:48aefcaa1d29 441 } // end bool MAX5171_menu_onEOLcommandParser(CmdLine & cmdLine)
whismanoid 11:48aefcaa1d29 442