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:
- 72:118719cf19c6
- Parent:
- 70:9e6b01c6ea37
- Child:
- 74:17ac42cd832e
--- a/Test_Menu_MAX11410.cpp Fri Apr 24 11:39:53 2020 +0000 +++ b/Test_Menu_MAX11410.cpp Fri May 08 05:39:05 2020 +0000 @@ -170,6 +170,8 @@ // CODE GENERATOR: no Menu item hint in description // CODE GENERATOR: MAX11410 Command Name = IsRegReadCommand (MAX11410_CMD_enum_t commandByte) --> uint8_t // CODE GENERATOR: no Menu item hint in description +// CODE GENERATOR: MAX11410 Command Name = IsRegWriteCommand (MAX11410_CMD_enum_t commandByte) --> uint8_t +// CODE GENERATOR: no Menu item hint in description // CODE GENERATOR: MAX11410 Command Name = RegName (MAX11410_CMD_enum_t commandByte) --> const char* // CODE GENERATOR: no Menu item hint in description // CODE GENERATOR: MAX11410 Command Name = Configure_FILTER (uint8_t linef, uint8_t rate) --> uint8_t @@ -255,9 +257,9 @@ // CODE GENERATOR: CommandParamIn 'uint8_t vbias_mode, uint8_t brn_mode, uint8_t idac_mode' // CODE GENERATOR: CommandReturnType 'uint8_t' // CODE GENERATOR: CommandPre '' -// CODE GENERATOR: CommandDocParamIn '@param[in] vbias_mode = _______, default=MAX11410::MAX11410_VBIAS_MODE_enum_t::VBIAS_MODE_00_Active' -// CODE GENERATOR: CommandDocParamIn '@param[in] brn_mode = _______, default=MAX11410::MAX11410_BRN_MODE_enum_t::BRN_MODE_00_disabled' -// CODE GENERATOR: CommandDocParamIn '@param[in] idac_mode = _______, default=MAX11410::MAX11410_IDAC_MODE_enum_t::IDAC_MODE_0000_10uA' +// CODE GENERATOR: CommandDocParamIn '@param[in] vbias_mode = bias voltage mode, default=MAX11410::MAX11410_VBIAS_MODE_enum_t::VBIAS_MODE_00_Active' +// CODE GENERATOR: CommandDocParamIn '@param[in] brn_mode = burnout source mode, default=MAX11410::MAX11410_BRN_MODE_enum_t::BRN_MODE_00_disabled' +// CODE GENERATOR: CommandDocParamIn '@param[in] idac_mode = current source value, default=MAX11410::MAX11410_IDAC_MODE_enum_t::IDAC_MODE_0000_10uA' // CODE GENERATOR: CommandDocParamOut '' // CODE GENERATOR: CommandPost '' // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure' @@ -340,61 +342,13 @@ // CODE GENERATOR: CommandPost '' // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure' // CODE GENERATOR: MAX11410 Command Name = Calibrate_System_Offset_A (void) --> uint8_t -// CODE GENERATOR: Menu item hint description Menu item 'X4' -// CODE GENERATOR: Menu item 'X4' -- Menu item X4 -// CODE GENERATOR: test menu case 'X4': -// CODE GENERATOR: helpString 'X4 -- Calibrate_System_Offset_A' -// CODE GENERATOR: CMD_ 'None' -// CODE GENERATOR: CommandName 'Calibrate_System_Offset_A' -// CODE GENERATOR: CommandParamIn 'void' -// CODE GENERATOR: CommandReturnType 'uint8_t' -// CODE GENERATOR: CommandPre '' -// CODE GENERATOR: CommandDocParamIn '' -// CODE GENERATOR: CommandDocParamOut '' -// CODE GENERATOR: CommandPost '' -// CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure' +// CODE GENERATOR: no Menu item hint in description // CODE GENERATOR: MAX11410 Command Name = Calibrate_System_Gain_A (void) --> uint8_t -// CODE GENERATOR: Menu item hint description Menu item 'X5' -// CODE GENERATOR: Menu item 'X5' -- Menu item X5 -// CODE GENERATOR: test menu case 'X5': -// CODE GENERATOR: helpString 'X5 -- Calibrate_System_Gain_A' -// CODE GENERATOR: CMD_ 'None' -// CODE GENERATOR: CommandName 'Calibrate_System_Gain_A' -// CODE GENERATOR: CommandParamIn 'void' -// CODE GENERATOR: CommandReturnType 'uint8_t' -// CODE GENERATOR: CommandPre '' -// CODE GENERATOR: CommandDocParamIn '' -// CODE GENERATOR: CommandDocParamOut '' -// CODE GENERATOR: CommandPost '' -// CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure' +// CODE GENERATOR: no Menu item hint in description // CODE GENERATOR: MAX11410 Command Name = Calibrate_System_Offset_B (void) --> uint8_t -// CODE GENERATOR: Menu item hint description Menu item 'X6' -// CODE GENERATOR: Menu item 'X6' -- Menu item X6 -// CODE GENERATOR: test menu case 'X6': -// CODE GENERATOR: helpString 'X6 -- Calibrate_System_Offset_B' -// CODE GENERATOR: CMD_ 'None' -// CODE GENERATOR: CommandName 'Calibrate_System_Offset_B' -// CODE GENERATOR: CommandParamIn 'void' -// CODE GENERATOR: CommandReturnType 'uint8_t' -// CODE GENERATOR: CommandPre '' -// CODE GENERATOR: CommandDocParamIn '' -// CODE GENERATOR: CommandDocParamOut '' -// CODE GENERATOR: CommandPost '' -// CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure' +// CODE GENERATOR: no Menu item hint in description // CODE GENERATOR: MAX11410 Command Name = Calibrate_System_Gain_B (void) --> uint8_t -// CODE GENERATOR: Menu item hint description Menu item 'X7' -// CODE GENERATOR: Menu item 'X7' -- Menu item X7 -// CODE GENERATOR: test menu case 'X7': -// CODE GENERATOR: helpString 'X7 -- Calibrate_System_Gain_B' -// CODE GENERATOR: CMD_ 'None' -// CODE GENERATOR: CommandName 'Calibrate_System_Gain_B' -// CODE GENERATOR: CommandParamIn 'void' -// CODE GENERATOR: CommandReturnType 'uint8_t' -// CODE GENERATOR: CommandPre '' -// CODE GENERATOR: CommandDocParamIn '' -// CODE GENERATOR: CommandDocParamOut '' -// CODE GENERATOR: CommandPost '' -// CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure' +// CODE GENERATOR: no Menu item hint in description // CODE GENERATOR: MAX11410 Command Name = Read_All_Voltages (void) --> uint8_t // CODE GENERATOR: Menu item hint description Menu item '$' -> AINcode[0], AINcode[1], AINcode[2], AINcode[3], AINcode[4], AINcode[5], AINcode[6], AINcode[7], AINcode[8], AINcode[9], AINcode[10] // CODE GENERATOR: Menu item '$' -> AINcode[0], AINcode[1], AINcode[2], AINcode[3], AINcode[4], AINcode[5], AINcode[6], AINcode[7], AINcode[8], AINcode[9], AINcode[10] -- Menu item $ @@ -615,10 +569,6 @@ // CODE GENERATOR: multiple commands begin with character 'X' // CODE GENERATOR: multiple commands begin with character 'X' // CODE GENERATOR: multiple commands begin with character 'X' -// CODE GENERATOR: multiple commands begin with character 'X' -// CODE GENERATOR: multiple commands begin with character 'X' -// CODE GENERATOR: multiple commands begin with character 'X' -// CODE GENERATOR: multiple commands begin with character 'X' // CODE GENERATOR: shorten testMenuCommand to single character if unambiguous // CODE GENERATOR: testMenuCommand '!' already single character // CODE GENERATOR: testMenuCommand '$' already single character @@ -629,10 +579,6 @@ // 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 -// CODE GENERATOR: cannot shorten testMenuCommand 'X4' to single character due to duplicates -// CODE GENERATOR: cannot shorten testMenuCommand 'X5' to single character due to duplicates -// CODE GENERATOR: cannot shorten testMenuCommand 'X6' to single character due to duplicates -// CODE GENERATOR: cannot shorten testMenuCommand 'X7' to single character due to duplicates // CODE GENERATOR: cannot shorten testMenuCommand 'XC' to single character due to duplicates // CODE GENERATOR: cannot shorten testMenuCommand 'XF' to single character due to duplicates // CODE GENERATOR: cannot shorten testMenuCommand 'XI' to single character due to duplicates @@ -666,18 +612,6 @@ // CODE GENERATOR: command: X1 // CODE GENERATOR: help: X1 -- Calibrate_PGA_Gain cmdLine.serial().printf("\r\n X1 -- Calibrate_PGA_Gain"); - // CODE GENERATOR: command: X4 - // CODE GENERATOR: help: X4 -- Calibrate_System_Offset_A - cmdLine.serial().printf("\r\n X4 -- Calibrate_System_Offset_A"); - // CODE GENERATOR: command: X5 - // CODE GENERATOR: help: X5 -- Calibrate_System_Gain_A - cmdLine.serial().printf("\r\n X5 -- Calibrate_System_Gain_A"); - // CODE GENERATOR: command: X6 - // CODE GENERATOR: help: X6 -- Calibrate_System_Offset_B - cmdLine.serial().printf("\r\n X6 -- Calibrate_System_Offset_B"); - // CODE GENERATOR: command: X7 - // CODE GENERATOR: help: X7 -- Calibrate_System_Gain_B - cmdLine.serial().printf("\r\n X7 -- Calibrate_System_Gain_B"); // CODE GENERATOR: command: XC // CODE GENERATOR: help: XC extclk=? u_bn=? format=? refbufp_en=? refbufn_en=? ref_sel=? -- Configure_CTRL cmdLine.serial().printf("\r\n XC extclk=? u_bn=? format=? refbufp_en=? refbufn_en=? ref_sel=? -- Configure_CTRL"); @@ -706,7 +640,10 @@ cmdLine.serial().printf("\r\n @ -- print MAX11410 configuration"); // CODE GENERATOR: help menu if has_register_write_command: *regname? -- read register; *regname=regvalue -- write register - cmdLine.serial().printf("\r\n *regname? -- read register\r\n *regname=regvalue -- write register"); + cmdLine.serial().printf("\r\n * -- read core registers"); + cmdLine.serial().printf("\r\n *regname? -- read register"); + cmdLine.serial().printf("\r\n *regname=regvalue -- write register"); + cmdLine.serial().printf("\r\n 01 23 45 67 89 ab cd ef -- write and read raw hex codes"); // // CODE GENERATOR: TODO1: generate GPIO commands for LDAC, CLR, etc. based on device driver function names (menu_help) @@ -1558,150 +1495,6 @@ } // 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' -// CODE GENERATOR: CommandName 'Calibrate_System_Offset_A' -// CODE GENERATOR: CommandParamIn 'void' -// CODE GENERATOR: CommandReturnType 'uint8_t' -// CODE GENERATOR: CommandPre '' -// CODE GENERATOR: CommandDocParamIn '' -// CODE GENERATOR: CommandDocParamOut '' -// CODE GENERATOR: CommandPost '' -// CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure' - case '4': // (nested inside case 'X') - { - // test menu command 'X4' handler: - // helpString='X4 -- Calibrate_System_Offset_A' - // CMD_='None' - // CommandName='Calibrate_System_Offset_A' - // CommandParamIn='void' - // CommandReturnType='uint8_t' - // @Pre='' - // @Param[in]='' - // @Param[out]='' - // @Post='' - // displayPost='' - // @Return='@return 1 on success; 0 on failure' - cmdLine.serial().printf("Calibrate_System_Offset_A"); - // call function Calibrate_System_Offset_A - uint8_t result = g_MAX11410_device.Calibrate_System_Offset_A(); - cmdLine.serial().printf(" =%d\r\n", 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' -// CODE GENERATOR: CommandName 'Calibrate_System_Gain_A' -// CODE GENERATOR: CommandParamIn 'void' -// CODE GENERATOR: CommandReturnType 'uint8_t' -// CODE GENERATOR: CommandPre '' -// CODE GENERATOR: CommandDocParamIn '' -// CODE GENERATOR: CommandDocParamOut '' -// CODE GENERATOR: CommandPost '' -// CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure' - case '5': // (nested inside case 'X') - { - // test menu command 'X5' handler: - // helpString='X5 -- Calibrate_System_Gain_A' - // CMD_='None' - // CommandName='Calibrate_System_Gain_A' - // CommandParamIn='void' - // CommandReturnType='uint8_t' - // @Pre='' - // @Param[in]='' - // @Param[out]='' - // @Post='' - // displayPost='' - // @Return='@return 1 on success; 0 on failure' - cmdLine.serial().printf("Calibrate_System_Gain_A"); - // call function Calibrate_System_Gain_A - uint8_t result = g_MAX11410_device.Calibrate_System_Gain_A(); - cmdLine.serial().printf(" =%d\r\n", 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' -// CODE GENERATOR: CommandName 'Calibrate_System_Offset_B' -// CODE GENERATOR: CommandParamIn 'void' -// CODE GENERATOR: CommandReturnType 'uint8_t' -// CODE GENERATOR: CommandPre '' -// CODE GENERATOR: CommandDocParamIn '' -// CODE GENERATOR: CommandDocParamOut '' -// CODE GENERATOR: CommandPost '' -// CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure' - case '6': // (nested inside case 'X') - { - // test menu command 'X6' handler: - // helpString='X6 -- Calibrate_System_Offset_B' - // CMD_='None' - // CommandName='Calibrate_System_Offset_B' - // CommandParamIn='void' - // CommandReturnType='uint8_t' - // @Pre='' - // @Param[in]='' - // @Param[out]='' - // @Post='' - // displayPost='' - // @Return='@return 1 on success; 0 on failure' - cmdLine.serial().printf("Calibrate_System_Offset_B"); - // call function Calibrate_System_Offset_B - uint8_t result = g_MAX11410_device.Calibrate_System_Offset_B(); - cmdLine.serial().printf(" =%d\r\n", 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' -// CODE GENERATOR: CommandName 'Calibrate_System_Gain_B' -// CODE GENERATOR: CommandParamIn 'void' -// CODE GENERATOR: CommandReturnType 'uint8_t' -// CODE GENERATOR: CommandPre '' -// CODE GENERATOR: CommandDocParamIn '' -// CODE GENERATOR: CommandDocParamOut '' -// CODE GENERATOR: CommandPost '' -// CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure' - case '7': // (nested inside case 'X') - { - // test menu command 'X7' handler: - // helpString='X7 -- Calibrate_System_Gain_B' - // CMD_='None' - // CommandName='Calibrate_System_Gain_B' - // CommandParamIn='void' - // CommandReturnType='uint8_t' - // @Pre='' - // @Param[in]='' - // @Param[out]='' - // @Post='' - // displayPost='' - // @Return='@return 1 on success; 0 on failure' - cmdLine.serial().printf("Calibrate_System_Gain_B"); - // call function Calibrate_System_Gain_B - uint8_t result = g_MAX11410_device.Calibrate_System_Gain_B(); - cmdLine.serial().printf(" =%d\r\n", 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': @@ -2083,9 +1876,9 @@ // CODE GENERATOR: CommandParamIn 'uint8_t vbias_mode, uint8_t brn_mode, uint8_t idac_mode' // CODE GENERATOR: CommandReturnType 'uint8_t' // CODE GENERATOR: CommandPre '' -// CODE GENERATOR: CommandDocParamIn '@param[in] vbias_mode = _______, default=MAX11410::MAX11410_VBIAS_MODE_enum_t::VBIAS_MODE_00_Active' -// CODE GENERATOR: CommandDocParamIn '@param[in] brn_mode = _______, default=MAX11410::MAX11410_BRN_MODE_enum_t::BRN_MODE_00_disabled' -// CODE GENERATOR: CommandDocParamIn '@param[in] idac_mode = _______, default=MAX11410::MAX11410_IDAC_MODE_enum_t::IDAC_MODE_0000_10uA' +// CODE GENERATOR: CommandDocParamIn '@param[in] vbias_mode = bias voltage mode, default=MAX11410::MAX11410_VBIAS_MODE_enum_t::VBIAS_MODE_00_Active' +// CODE GENERATOR: CommandDocParamIn '@param[in] brn_mode = burnout source mode, default=MAX11410::MAX11410_BRN_MODE_enum_t::BRN_MODE_00_disabled' +// CODE GENERATOR: CommandDocParamIn '@param[in] idac_mode = current source value, default=MAX11410::MAX11410_IDAC_MODE_enum_t::IDAC_MODE_0000_10uA' // CODE GENERATOR: CommandDocParamOut '' // CODE GENERATOR: CommandPost '' // CODE GENERATOR: CommandReturn '@return 1 on success; 0 on failure' @@ -2098,29 +1891,29 @@ // CommandParamIn='uint8_t vbias_mode, uint8_t brn_mode, uint8_t idac_mode' // CommandReturnType='uint8_t' // @Pre='' - // @Param[in]='@param[in] vbias_mode = _______, default=MAX11410::MAX11410_VBIAS_MODE_enum_t::VBIAS_MODE_00_Active' - // @Param[in]='@param[in] brn_mode = _______, default=MAX11410::MAX11410_BRN_MODE_enum_t::BRN_MODE_00_disabled' - // @Param[in]='@param[in] idac_mode = _______, default=MAX11410::MAX11410_IDAC_MODE_enum_t::IDAC_MODE_0000_10uA' + // @Param[in]='@param[in] vbias_mode = bias voltage mode, default=MAX11410::MAX11410_VBIAS_MODE_enum_t::VBIAS_MODE_00_Active' + // @Param[in]='@param[in] brn_mode = burnout source mode, default=MAX11410::MAX11410_BRN_MODE_enum_t::BRN_MODE_00_disabled' + // @Param[in]='@param[in] idac_mode = current source value, default=MAX11410::MAX11410_IDAC_MODE_enum_t::IDAC_MODE_0000_10uA' // @Param[out]='' // @Post='' // displayPost='' // @Return='@return 1 on success; 0 on failure' // parse argument list - // argname default_argvalue symbolic name specified in CommandDocParamIn @Param[in]='@param[in] vbias_mode = _______, default=MAX11410::MAX11410_VBIAS_MODE_enum_t::VBIAS_MODE_00_Active' + // argname default_argvalue symbolic name specified in CommandDocParamIn @Param[in]='@param[in] vbias_mode = bias voltage mode, default=MAX11410::MAX11410_VBIAS_MODE_enum_t::VBIAS_MODE_00_Active' // parse argument uint8_t vbias_mode uint8_t vbias_mode = (uint8_t)MAX11410::VBIAS_MODE_00_Active; // --- g_MAX11410_device.__WARNING_no_match_for_argname_vbias_mode_in_MAX11410_device_t__; // default to global property value if (cmdLine.parse_uint8_dec("vbias_mode", vbias_mode)) { // g_MAX11410_device.__WARNING_no_match_for_argname_vbias_mode_in_MAX11410_device_t__ = vbias_mode; // update global property value } - // argname default_argvalue symbolic name specified in CommandDocParamIn @Param[in]='@param[in] brn_mode = _______, default=MAX11410::MAX11410_BRN_MODE_enum_t::BRN_MODE_00_disabled' + // argname default_argvalue symbolic name specified in CommandDocParamIn @Param[in]='@param[in] brn_mode = burnout source mode, default=MAX11410::MAX11410_BRN_MODE_enum_t::BRN_MODE_00_disabled' // parse argument uint8_t brn_mode uint8_t brn_mode = (uint8_t)MAX11410::BRN_MODE_00_disabled; // --- g_MAX11410_device.__WARNING_no_match_for_argname_brn_mode_in_MAX11410_device_t__; // default to global property value if (cmdLine.parse_uint8_dec("brn_mode", brn_mode)) { // g_MAX11410_device.__WARNING_no_match_for_argname_brn_mode_in_MAX11410_device_t__ = brn_mode; // update global property value } - // argname default_argvalue symbolic name specified in CommandDocParamIn @Param[in]='@param[in] idac_mode = _______, default=MAX11410::MAX11410_IDAC_MODE_enum_t::IDAC_MODE_0000_10uA' + // argname default_argvalue symbolic name specified in CommandDocParamIn @Param[in]='@param[in] idac_mode = current source value, default=MAX11410::MAX11410_IDAC_MODE_enum_t::IDAC_MODE_0000_10uA' // parse argument uint8_t idac_mode uint8_t idac_mode = (uint8_t)MAX11410::IDAC_MODE_0000_10uA; // --- g_MAX11410_device.__WARNING_no_match_for_argname_idac_mode_in_MAX11410_device_t__; // default to global property value if (cmdLine.parse_uint8_dec("idac_mode", idac_mode)) @@ -2204,20 +1997,17 @@ #define MAX_SPI_BYTE_COUNT 32 size_t byteCount = byteCount; static char mosiData[MAX_SPI_BYTE_COUNT]; - static char misoData[MAX_SPI_BYTE_COUNT]; if (cmdLine.parse_byteCount_byteList_hex(byteCount, mosiData, MAX_SPI_BYTE_COUNT)) { // TODO: decode operation from commandByte // TODO: OVERSIMPLIFICATION: if length is 1 byte then operation is RegRead, otherwise RegWrite // register_read_function 'IsRegReadCommand' - // register_write_function 'RegWrite' + // register_write_function 'IsRegWriteCommand' // register_name_function 'RegName' // register_size_function 'RegSize' // CODE GENERATOR: does the chip have a defined CMDOP_1aaa_aaaa_ReadRegister bit? - // MAX11410::MAX11410_CMD_enum_t regAddress = (MAX11410::MAX11410_CMD_enum_t)((mosiData[0] &~ MAX11410::CMDOP_1aaa_aaaa_ReadRegister) & 0xFF); MAX11410::MAX11410_CMD_enum_t commandByte = (MAX11410::MAX11410_CMD_enum_t)(mosiData[0]); - MAX11410::MAX11410_CMDOP_enum_t commandOp = g_MAX11410_device.DecodeCommand(commandByte); int regAddress = g_MAX11410_device.RegAddrOfCommand(commandByte); cmdLine.serial().printf(" regAddress=0x%2.2x\r\n", (regAddress & 0xFF)); cmdLine.serial().printf(" RegName=%s\r\n", g_MAX11410_device.RegName(commandByte)); @@ -2237,14 +2027,13 @@ break; } // CODE GENERATOR: does the chip have a defined CMDOP_1aaa_aaaa_ReadRegister bit? - // if ((byteCount == 1) || (regAddress & MAX11410::CMDOP_1aaa_aaaa_ReadRegister)) if ((byteCount == 1) || g_MAX11410_device.IsRegReadCommand(commandByte)) { cmdLine.serial().printf(" RegRead"); g_MAX11410_device.RegRead(commandByte, ®Data); cmdLine.serial().printf("regData=0x%6.6lx\r\n", (regData & 0x00FFFFFF)); } - else + else if (g_MAX11410_device.IsRegWriteCommand(commandByte)) { cmdLine.serial().printf(" RegWrite regData=0x%6.6lX\r\n", (regData & 0x00FFFFFF)); g_MAX11410_device.RegWrite(commandByte, regData);