Test program running on MAX32625MBED. Control through USB Serial commands using a terminal emulator such as teraterm or putty.
Dependencies: MaximTinyTester MAX11131 CmdLine MAX541 USBDevice
Diff: Test_Main_MAX11131.cpp
- Revision:
- 30:9b4063876773
- Parent:
- 29:c4975953cb65
- Child:
- 31:b9e5a1745cce
--- a/Test_Main_MAX11131.cpp Fri May 28 20:31:01 2021 -0700 +++ b/Test_Main_MAX11131.cpp Sat May 29 03:17:39 2021 -0700 @@ -1883,6 +1883,8 @@ //-------------------------------------------------- // functions tested by SelfTest() extern void fn_MAX11131_Init(void); +extern int fn_MAX11131_ScanStandardExternalClock(void); +extern void fn_MAX11131_ReadAINcode(void); // CODE GENERATOR: Warning: SelfTest can't find function SPIoutputCS signature in Command list, searching ExternFunction list... extern void fn_MAX11131_SPIoutputCS(int isLogicHigh); // CODE GENERATOR: Warning: SelfTest can't find function SPIwrite16bits signature in Command list, searching ExternFunction list... @@ -1973,6 +1975,297 @@ // test-propname-expect-value tinyTester.Expect("MAX11131.VRef", g_MAX11131_device.VRef, /* expect: */ 2.500); // Nominal Full-Scale Voltage Reference + // @test tinyTester.print("4 ch=15 pm=0 id=1 -- ScanStandardExternalClock") + // docTest_item['actionType'] = 'print-string' + // docTest_item['action'] = 'tinyTester.print("4 ch=15 pm=0 id=1 -- ScanStandardExternalClock")' + // docTest_item['arglist'] = '4 ch=15 pm=0 id=1 -- ScanStandardExternalClock' + // print-string + // tinyTesterFuncName = "tinyTester.print" + // tinyTesterPrintStringLiteral = "4 ch=15 pm=0 id=1 -- ScanStandardExternalClock" + tinyTester.print("4 ch=15 pm=0 id=1 -- ScanStandardExternalClock"); + + // @test tinyTester.print("channelNumber_0_15 = 15") + // docTest_item['actionType'] = 'print-string' + // docTest_item['action'] = 'tinyTester.print("channelNumber_0_15 = 15")' + // docTest_item['arglist'] = 'channelNumber_0_15 = 15' + // print-string + // tinyTesterFuncName = "tinyTester.print" + // tinyTesterPrintStringLiteral = "channelNumber_0_15 = 15" + tinyTester.print("channelNumber_0_15 = 15"); + + // @test channelNumber_0_15 = 15 + // docTest_item['actionType'] = 'assign-propname-value' + // docTest_item['action'] = 'channelNumber_0_15 = 15' + // docTest_item['propName'] = 'channelNumber_0_15' + // docTest_item['propValue'] = '15' + // assign-propname-value + // tinyTesterPropName = "channelNumber_0_15" + // tinyTesterPropValue = "15" + g_MAX11131_device.channelNumber_0_15 = 15; + + // @test tinyTester.print("PowerManagement_0_2 = 0") + // docTest_item['actionType'] = 'print-string' + // docTest_item['action'] = 'tinyTester.print("PowerManagement_0_2 = 0")' + // docTest_item['arglist'] = 'PowerManagement_0_2 = 0' + // print-string + // tinyTesterFuncName = "tinyTester.print" + // tinyTesterPrintStringLiteral = "PowerManagement_0_2 = 0" + tinyTester.print("PowerManagement_0_2 = 0"); + + // @test PowerManagement_0_2 = 0 // 0=Normal + // docTest_item['actionType'] = 'assign-propname-value' + // docTest_item['action'] = 'PowerManagement_0_2 = 0' + // docTest_item['remarks'] = '0=Normal' + // docTest_item['propName'] = 'PowerManagement_0_2' + // docTest_item['propValue'] = '0' + // assign-propname-value + // tinyTesterPropName = "PowerManagement_0_2" + // tinyTesterPropValue = "0" + g_MAX11131_device.PowerManagement_0_2 = 0; + + // @test tinyTester.print("chan_id_0_1 = 1") + // docTest_item['actionType'] = 'print-string' + // docTest_item['action'] = 'tinyTester.print("chan_id_0_1 = 1")' + // docTest_item['arglist'] = 'chan_id_0_1 = 1' + // print-string + // tinyTesterFuncName = "tinyTester.print" + // tinyTesterPrintStringLiteral = "chan_id_0_1 = 1" + tinyTester.print("chan_id_0_1 = 1"); + + // @test chan_id_0_1 = 1 // misoData16 = CH[3:0] DATA[11:0] + // docTest_item['actionType'] = 'assign-propname-value' + // docTest_item['action'] = 'chan_id_0_1 = 1' + // docTest_item['remarks'] = 'misoData16 = CH[3:0] DATA[11:0]' + // docTest_item['propName'] = 'chan_id_0_1' + // docTest_item['propValue'] = '1' + // assign-propname-value + // tinyTesterPropName = "chan_id_0_1" + // tinyTesterPropValue = "1" + g_MAX11131_device.chan_id_0_1 = 1; + + // @test tinyTester.print("ScanStandardExternalClock() expect 16") + // docTest_item['actionType'] = 'print-string' + // docTest_item['action'] = 'tinyTester.print("ScanStandardExternalClock() expect 16")' + // docTest_item['arglist'] = 'ScanStandardExternalClock() expect 16' + // print-string + // tinyTesterFuncName = "tinyTester.print" + // tinyTesterPrintStringLiteral = "ScanStandardExternalClock() expect 16" + tinyTester.print("ScanStandardExternalClock() expect 16"); + + // @test ScanStandardExternalClock() expect 16 // Scan_0100_StandardExt + // docTest_item['actionType'] = 'call-function' + // docTest_item['action'] = 'ScanStandardExternalClock() expect 16' + // docTest_item['remarks'] = 'Scan_0100_StandardExt' + // docTest_item['funcName'] = 'ScanStandardExternalClock' + // docTest_item['expect-value'] = '16' + // call-function + // ASSERT_EQ(g_MAX11131_device.ScanStandardExternalClock(()), (int)16); // Scan_0100_StandardExt + tinyTester.FunctionCall_d_Expect("MAX11131.ScanStandardExternalClock", fn_MAX11131_ScanStandardExternalClock, /* empty docTest_argList */ /* expect: */ (int)16); // Scan_0100_StandardExt + + // @test tinyTester.print("NumWords expect 16") + // docTest_item['actionType'] = 'print-string' + // docTest_item['action'] = 'tinyTester.print("NumWords expect 16")' + // docTest_item['arglist'] = 'NumWords expect 16' + // print-string + // tinyTesterFuncName = "tinyTester.print" + // tinyTesterPrintStringLiteral = "NumWords expect 16" + tinyTester.print("NumWords expect 16"); + + // @test NumWords expect 16 + // docTest_item['actionType'] = 'test-propname-expect-value' + // docTest_item['action'] = 'NumWords expect 16' + // docTest_item['expect-value'] = '16' + // docTest_item['propName'] = 'NumWords' + // test-propname-expect-value + tinyTester.Expect("MAX11131.NumWords", g_MAX11131_device.NumWords, /* expect: */ 16); // + + // @test ReadAINcode() + // docTest_item['actionType'] = 'call-function' + // docTest_item['action'] = 'ReadAINcode()' + // docTest_item['funcName'] = 'ReadAINcode' + // call-function + // ASSERT_EQ(g_MAX11131_device.ReadAINcode(()), (void)None); // + // tinyTester.FunctionCall_Expect("MAX11131.ReadAINcode", fn_MAX11131_ReadAINcode, /* empty docTest_argList */ /* empty expect: */ (void)None); // + g_MAX11131_device.ReadAINcode(); // + + // @test tinyTester.print("Verify RAW_misoData16[0..15]>>12&0x000F == 0..15 channelId") + // docTest_item['actionType'] = 'print-string' + // docTest_item['action'] = 'tinyTester.print("Verify RAW_misoData16[0..15]>>12&0x000F == 0..15 channelId")' + // docTest_item['arglist'] = 'Verify RAW_misoData16[0..15]>>12&0x000F == 0..15 channelId' + // print-string + // tinyTesterFuncName = "tinyTester.print" + // tinyTesterPrintStringLiteral = "Verify RAW_misoData16[0..15]>>12&0x000F == 0..15 channelId" + tinyTester.print("Verify RAW_misoData16[0..15]>>12&0x000F == 0..15 channelId"); + + // @test RAW_misoData16[0] expect 0x0000 mask 0xF000 // channelId + // docTest_item['actionType'] = 'test-propname-expect-value' + // docTest_item['action'] = 'RAW_misoData16[0] expect 0x0000 mask 0xF000' + // docTest_item['remarks'] = 'channelId' + // docTest_item['expect-value'] = '0x0000' + // docTest_item['mask-value'] = '0xF000' + // docTest_item['propName'] = 'RAW_misoData16[0]' + // test-propname-expect-value + tinyTester.Expect("MAX11131.RAW_misoData16[0]", (int)((g_MAX11131_device.RAW_misoData16[0]) & /* mask */ (0xF000)), /* expect: */ 0x0000); // channelId + + // @test RAW_misoData16[1] expect 0x1000 mask 0xF000 // channelId + // docTest_item['actionType'] = 'test-propname-expect-value' + // docTest_item['action'] = 'RAW_misoData16[1] expect 0x1000 mask 0xF000' + // docTest_item['remarks'] = 'channelId' + // docTest_item['expect-value'] = '0x1000' + // docTest_item['mask-value'] = '0xF000' + // docTest_item['propName'] = 'RAW_misoData16[1]' + // test-propname-expect-value + tinyTester.Expect("MAX11131.RAW_misoData16[1]", (int)((g_MAX11131_device.RAW_misoData16[1]) & /* mask */ (0xF000)), /* expect: */ 0x1000); // channelId + + // @test RAW_misoData16[2] expect 0x2000 mask 0xF000 // channelId + // docTest_item['actionType'] = 'test-propname-expect-value' + // docTest_item['action'] = 'RAW_misoData16[2] expect 0x2000 mask 0xF000' + // docTest_item['remarks'] = 'channelId' + // docTest_item['expect-value'] = '0x2000' + // docTest_item['mask-value'] = '0xF000' + // docTest_item['propName'] = 'RAW_misoData16[2]' + // test-propname-expect-value + tinyTester.Expect("MAX11131.RAW_misoData16[2]", (int)((g_MAX11131_device.RAW_misoData16[2]) & /* mask */ (0xF000)), /* expect: */ 0x2000); // channelId + + // @test RAW_misoData16[3] expect 0x3000 mask 0xF000 // channelId + // docTest_item['actionType'] = 'test-propname-expect-value' + // docTest_item['action'] = 'RAW_misoData16[3] expect 0x3000 mask 0xF000' + // docTest_item['remarks'] = 'channelId' + // docTest_item['expect-value'] = '0x3000' + // docTest_item['mask-value'] = '0xF000' + // docTest_item['propName'] = 'RAW_misoData16[3]' + // test-propname-expect-value + tinyTester.Expect("MAX11131.RAW_misoData16[3]", (int)((g_MAX11131_device.RAW_misoData16[3]) & /* mask */ (0xF000)), /* expect: */ 0x3000); // channelId + + // @test RAW_misoData16[4] expect 0x4000 mask 0xF000 // channelId + // docTest_item['actionType'] = 'test-propname-expect-value' + // docTest_item['action'] = 'RAW_misoData16[4] expect 0x4000 mask 0xF000' + // docTest_item['remarks'] = 'channelId' + // docTest_item['expect-value'] = '0x4000' + // docTest_item['mask-value'] = '0xF000' + // docTest_item['propName'] = 'RAW_misoData16[4]' + // test-propname-expect-value + tinyTester.Expect("MAX11131.RAW_misoData16[4]", (int)((g_MAX11131_device.RAW_misoData16[4]) & /* mask */ (0xF000)), /* expect: */ 0x4000); // channelId + + // @test RAW_misoData16[5] expect 0x5000 mask 0xF000 // channelId + // docTest_item['actionType'] = 'test-propname-expect-value' + // docTest_item['action'] = 'RAW_misoData16[5] expect 0x5000 mask 0xF000' + // docTest_item['remarks'] = 'channelId' + // docTest_item['expect-value'] = '0x5000' + // docTest_item['mask-value'] = '0xF000' + // docTest_item['propName'] = 'RAW_misoData16[5]' + // test-propname-expect-value + tinyTester.Expect("MAX11131.RAW_misoData16[5]", (int)((g_MAX11131_device.RAW_misoData16[5]) & /* mask */ (0xF000)), /* expect: */ 0x5000); // channelId + + // @test RAW_misoData16[6] expect 0x6000 mask 0xF000 // channelId + // docTest_item['actionType'] = 'test-propname-expect-value' + // docTest_item['action'] = 'RAW_misoData16[6] expect 0x6000 mask 0xF000' + // docTest_item['remarks'] = 'channelId' + // docTest_item['expect-value'] = '0x6000' + // docTest_item['mask-value'] = '0xF000' + // docTest_item['propName'] = 'RAW_misoData16[6]' + // test-propname-expect-value + tinyTester.Expect("MAX11131.RAW_misoData16[6]", (int)((g_MAX11131_device.RAW_misoData16[6]) & /* mask */ (0xF000)), /* expect: */ 0x6000); // channelId + + // @test RAW_misoData16[7] expect 0x7000 mask 0xF000 // channelId + // docTest_item['actionType'] = 'test-propname-expect-value' + // docTest_item['action'] = 'RAW_misoData16[7] expect 0x7000 mask 0xF000' + // docTest_item['remarks'] = 'channelId' + // docTest_item['expect-value'] = '0x7000' + // docTest_item['mask-value'] = '0xF000' + // docTest_item['propName'] = 'RAW_misoData16[7]' + // test-propname-expect-value + tinyTester.Expect("MAX11131.RAW_misoData16[7]", (int)((g_MAX11131_device.RAW_misoData16[7]) & /* mask */ (0xF000)), /* expect: */ 0x7000); // channelId + + // @test RAW_misoData16[8] expect 0x8000 mask 0xF000 // channelId + // docTest_item['actionType'] = 'test-propname-expect-value' + // docTest_item['action'] = 'RAW_misoData16[8] expect 0x8000 mask 0xF000' + // docTest_item['remarks'] = 'channelId' + // docTest_item['expect-value'] = '0x8000' + // docTest_item['mask-value'] = '0xF000' + // docTest_item['propName'] = 'RAW_misoData16[8]' + // test-propname-expect-value + tinyTester.Expect("MAX11131.RAW_misoData16[8]", (int)((g_MAX11131_device.RAW_misoData16[8]) & /* mask */ (0xF000)), /* expect: */ 0x8000); // channelId + + // @test RAW_misoData16[9] expect 0x9000 mask 0xF000 // channelId + // docTest_item['actionType'] = 'test-propname-expect-value' + // docTest_item['action'] = 'RAW_misoData16[9] expect 0x9000 mask 0xF000' + // docTest_item['remarks'] = 'channelId' + // docTest_item['expect-value'] = '0x9000' + // docTest_item['mask-value'] = '0xF000' + // docTest_item['propName'] = 'RAW_misoData16[9]' + // test-propname-expect-value + tinyTester.Expect("MAX11131.RAW_misoData16[9]", (int)((g_MAX11131_device.RAW_misoData16[9]) & /* mask */ (0xF000)), /* expect: */ 0x9000); // channelId + + // @test RAW_misoData16[10] expect 0xA000 mask 0xF000 // channelId + // docTest_item['actionType'] = 'test-propname-expect-value' + // docTest_item['action'] = 'RAW_misoData16[10] expect 0xA000 mask 0xF000' + // docTest_item['remarks'] = 'channelId' + // docTest_item['expect-value'] = '0xA000' + // docTest_item['mask-value'] = '0xF000' + // docTest_item['propName'] = 'RAW_misoData16[10]' + // test-propname-expect-value + tinyTester.Expect("MAX11131.RAW_misoData16[10]", (int)((g_MAX11131_device.RAW_misoData16[10]) & /* mask */ (0xF000)), /* expect: */ 0xA000); // channelId + + // @test RAW_misoData16[11] expect 0xB000 mask 0xF000 // channelId + // docTest_item['actionType'] = 'test-propname-expect-value' + // docTest_item['action'] = 'RAW_misoData16[11] expect 0xB000 mask 0xF000' + // docTest_item['remarks'] = 'channelId' + // docTest_item['expect-value'] = '0xB000' + // docTest_item['mask-value'] = '0xF000' + // docTest_item['propName'] = 'RAW_misoData16[11]' + // test-propname-expect-value + tinyTester.Expect("MAX11131.RAW_misoData16[11]", (int)((g_MAX11131_device.RAW_misoData16[11]) & /* mask */ (0xF000)), /* expect: */ 0xB000); // channelId + + // @test RAW_misoData16[12] expect 0xC000 mask 0xF000 // channelId + // docTest_item['actionType'] = 'test-propname-expect-value' + // docTest_item['action'] = 'RAW_misoData16[12] expect 0xC000 mask 0xF000' + // docTest_item['remarks'] = 'channelId' + // docTest_item['expect-value'] = '0xC000' + // docTest_item['mask-value'] = '0xF000' + // docTest_item['propName'] = 'RAW_misoData16[12]' + // test-propname-expect-value + tinyTester.Expect("MAX11131.RAW_misoData16[12]", (int)((g_MAX11131_device.RAW_misoData16[12]) & /* mask */ (0xF000)), /* expect: */ 0xC000); // channelId + + // @test RAW_misoData16[13] expect 0xD000 mask 0xF000 // channelId + // docTest_item['actionType'] = 'test-propname-expect-value' + // docTest_item['action'] = 'RAW_misoData16[13] expect 0xD000 mask 0xF000' + // docTest_item['remarks'] = 'channelId' + // docTest_item['expect-value'] = '0xD000' + // docTest_item['mask-value'] = '0xF000' + // docTest_item['propName'] = 'RAW_misoData16[13]' + // test-propname-expect-value + tinyTester.Expect("MAX11131.RAW_misoData16[13]", (int)((g_MAX11131_device.RAW_misoData16[13]) & /* mask */ (0xF000)), /* expect: */ 0xD000); // channelId + + // @test RAW_misoData16[14] expect 0xE000 mask 0xF000 // channelId + // docTest_item['actionType'] = 'test-propname-expect-value' + // docTest_item['action'] = 'RAW_misoData16[14] expect 0xE000 mask 0xF000' + // docTest_item['remarks'] = 'channelId' + // docTest_item['expect-value'] = '0xE000' + // docTest_item['mask-value'] = '0xF000' + // docTest_item['propName'] = 'RAW_misoData16[14]' + // test-propname-expect-value + tinyTester.Expect("MAX11131.RAW_misoData16[14]", (int)((g_MAX11131_device.RAW_misoData16[14]) & /* mask */ (0xF000)), /* expect: */ 0xE000); // channelId + + // @test RAW_misoData16[15] expect 0xF000 mask 0xF000 // channelId + // docTest_item['actionType'] = 'test-propname-expect-value' + // docTest_item['action'] = 'RAW_misoData16[15] expect 0xF000 mask 0xF000' + // docTest_item['remarks'] = 'channelId' + // docTest_item['expect-value'] = '0xF000' + // docTest_item['mask-value'] = '0xF000' + // docTest_item['propName'] = 'RAW_misoData16[15]' + // test-propname-expect-value + tinyTester.Expect("MAX11131.RAW_misoData16[15]", (int)((g_MAX11131_device.RAW_misoData16[15]) & /* mask */ (0xF000)), /* expect: */ 0xF000); // channelId + + // @test tinyTester.print("MOSI <-- 1000_0000_0000_0000 ADC_CONFIGURATION REFSEL=0 SPM[1:0]=0 ECHO=0") + // docTest_item['actionType'] = 'print-string' + // docTest_item['action'] = 'tinyTester.print("MOSI <-- 1000_0000_0000_0000 ADC_CONFIGURATION REFSEL=0 SPM[1:0]=0 ECHO=0")' + // docTest_item['arglist'] = 'MOSI <-- 1000_0000_0000_0000 ADC_CONFIGURATION REFSEL=0 SPM[1:0]=0 ECHO=0' + // print-string + // tinyTesterFuncName = "tinyTester.print" + // tinyTesterPrintStringLiteral = "MOSI <-- 1000_0000_0000_0000 ADC_CONFIGURATION REFSEL=0 SPM[1:0]=0 ECHO=0" + tinyTester.print("MOSI <-- 1000_0000_0000_0000 ADC_CONFIGURATION REFSEL=0 SPM[1:0]=0 ECHO=0"); + // @test SPIoutputCS(0) // docTest_item['actionType'] = 'call-function' // docTest_item['action'] = 'SPIoutputCS(0)' @@ -2003,6 +2296,161 @@ // tinyTester.FunctionCall_Expect("MAX11131.SPIoutputCS", fn_MAX11131_SPIoutputCS, (int)1, /* empty expect: */ (void)None); // g_MAX11131_device.SPIoutputCS((int)1); // call-function ExternFunction // + // @test tinyTester.print("MOSI <-- 0010_0111_1010_0100 ADC_MODE_CONTROL Scan_0100_StandardExt CHSEL=15 RESET=1 CHANID=1") + // docTest_item['actionType'] = 'print-string' + // docTest_item['action'] = 'tinyTester.print("MOSI <-- 0010_0111_1010_0100 ADC_MODE_CONTROL Scan_0100_StandardExt CHSEL=15 RESET=1 CHANID=1")' + // docTest_item['arglist'] = 'MOSI <-- 0010_0111_1010_0100 ADC_MODE_CONTROL Scan_0100_StandardExt CHSEL=15 RESET=1 CHANID=1' + // print-string + // tinyTesterFuncName = "tinyTester.print" + // tinyTesterPrintStringLiteral = "MOSI <-- 0010_0111_1010_0100 ADC_MODE_CONTROL Scan_0100_StandardExt CHSEL=15 RESET=1 CHANID=1" + tinyTester.print("MOSI <-- 0010_0111_1010_0100 ADC_MODE_CONTROL Scan_0100_StandardExt CHSEL=15 RESET=1 CHANID=1"); + + // @test SPIoutputCS(0) + // docTest_item['actionType'] = 'call-function' + // docTest_item['action'] = 'SPIoutputCS(0)' + // docTest_item['funcName'] = 'SPIoutputCS' + // docTest_item['arglist'] = '0' + // call-function + // ASSERT_EQ(g_MAX11131_device.SPIoutputCS((int)0), (void)None); // + // tinyTester.FunctionCall_Expect("MAX11131.SPIoutputCS", fn_MAX11131_SPIoutputCS, (int)0, /* empty expect: */ (void)None); // + g_MAX11131_device.SPIoutputCS((int)0); // call-function ExternFunction // + + // @test SPIwrite16bits(0x27a4) + // docTest_item['actionType'] = 'call-function' + // docTest_item['action'] = 'SPIwrite16bits(0x27a4)' + // docTest_item['funcName'] = 'SPIwrite16bits' + // docTest_item['arglist'] = '0x27a4' + // call-function + // ASSERT_EQ(g_MAX11131_device.SPIwrite16bits((int16_t)0x27a4), (void)None); // + // tinyTester.FunctionCall_Expect("MAX11131.SPIwrite16bits", fn_MAX11131_SPIwrite16bits, (int16_t)0x27a4, /* empty expect: */ (void)None); // + g_MAX11131_device.SPIwrite16bits((int16_t)0x27a4); // call-function ExternFunction // + + // @test SPIoutputCS(1) + // docTest_item['actionType'] = 'call-function' + // docTest_item['action'] = 'SPIoutputCS(1)' + // docTest_item['funcName'] = 'SPIoutputCS' + // docTest_item['arglist'] = '1' + // call-function + // ASSERT_EQ(g_MAX11131_device.SPIoutputCS((int)1), (void)None); // + // tinyTester.FunctionCall_Expect("MAX11131.SPIoutputCS", fn_MAX11131_SPIoutputCS, (int)1, /* empty expect: */ (void)None); // + g_MAX11131_device.SPIoutputCS((int)1); // call-function ExternFunction // + + // @test tinyTester.print("1.1: Test Scan_0011_StandardInt -- verify Internal Clock signals (CNVST, EOC)") + // docTest_item['actionType'] = 'print-string' + // docTest_item['action'] = 'tinyTester.print("1.1: Test Scan_0011_StandardInt -- verify Internal Clock signals (CNVST, EOC)")' + // docTest_item['arglist'] = '1.1: Test Scan_0011_StandardInt -- verify Internal Clock signals (CNVST, EOC)' + // print-string + // tinyTesterFuncName = "tinyTester.print" + // tinyTesterPrintStringLiteral = "1.1: Test Scan_0011_StandardInt -- verify Internal Clock signals (CNVST, EOC)" + tinyTester.print("1.1: Test Scan_0011_StandardInt -- verify Internal Clock signals (CNVST, EOC)"); + + // @test Init(); + // docTest_item['actionType'] = 'call-function' + // docTest_item['action'] = 'Init()' + // docTest_item['funcName'] = 'Init' + // call-function + // ASSERT_EQ(g_MAX11131_device.Init(()), (void)None); // + // tinyTester.FunctionCall_Expect("MAX11131.Init", fn_MAX11131_Init, /* empty docTest_argList */ /* empty expect: */ (void)None); // + g_MAX11131_device.Init(); // + + // @test SPIoutputCS(0); // drive CS low + // docTest_item['actionType'] = 'call-function' + // docTest_item['action'] = 'SPIoutputCS(0)' + // docTest_item['funcName'] = 'SPIoutputCS' + // docTest_item['arglist'] = '0' + // call-function + // ASSERT_EQ(g_MAX11131_device.SPIoutputCS((int)0), (void)None); // + // tinyTester.FunctionCall_Expect("MAX11131.SPIoutputCS", fn_MAX11131_SPIoutputCS, (int)0, /* empty expect: */ (void)None); // + g_MAX11131_device.SPIoutputCS((int)0); // call-function ExternFunction // + + // @test SPIoutputCS(1); // drive CS high + // docTest_item['actionType'] = 'call-function' + // docTest_item['action'] = 'SPIoutputCS(1)' + // docTest_item['funcName'] = 'SPIoutputCS' + // docTest_item['arglist'] = '1' + // call-function + // ASSERT_EQ(g_MAX11131_device.SPIoutputCS((int)1), (void)None); // + // tinyTester.FunctionCall_Expect("MAX11131.SPIoutputCS", fn_MAX11131_SPIoutputCS, (int)1, /* empty expect: */ (void)None); // + g_MAX11131_device.SPIoutputCS((int)1); // call-function ExternFunction // + + // @test tinyTester.print("MOSI <-- 1000_0000_0000_0000 ADC_CONFIGURATION REFSEL=0 SPM[1:0]=0 ECHO=0") + // docTest_item['actionType'] = 'print-string' + // docTest_item['action'] = 'tinyTester.print("MOSI <-- 1000_0000_0000_0000 ADC_CONFIGURATION REFSEL=0 SPM[1:0]=0 ECHO=0")' + // docTest_item['arglist'] = 'MOSI <-- 1000_0000_0000_0000 ADC_CONFIGURATION REFSEL=0 SPM[1:0]=0 ECHO=0' + // print-string + // tinyTesterFuncName = "tinyTester.print" + // tinyTesterPrintStringLiteral = "MOSI <-- 1000_0000_0000_0000 ADC_CONFIGURATION REFSEL=0 SPM[1:0]=0 ECHO=0" + tinyTester.print("MOSI <-- 1000_0000_0000_0000 ADC_CONFIGURATION REFSEL=0 SPM[1:0]=0 ECHO=0"); + + // @test SPIoutputCS(0); // drive CS low + // docTest_item['actionType'] = 'call-function' + // docTest_item['action'] = 'SPIoutputCS(0)' + // docTest_item['funcName'] = 'SPIoutputCS' + // docTest_item['arglist'] = '0' + // call-function + // ASSERT_EQ(g_MAX11131_device.SPIoutputCS((int)0), (void)None); // + // tinyTester.FunctionCall_Expect("MAX11131.SPIoutputCS", fn_MAX11131_SPIoutputCS, (int)0, /* empty expect: */ (void)None); // + g_MAX11131_device.SPIoutputCS((int)0); // call-function ExternFunction // + + // @test SPIwrite16bits(0x8000); + // docTest_item['actionType'] = 'call-function' + // docTest_item['action'] = 'SPIwrite16bits(0x8000)' + // docTest_item['funcName'] = 'SPIwrite16bits' + // docTest_item['arglist'] = '0x8000' + // call-function + // ASSERT_EQ(g_MAX11131_device.SPIwrite16bits((int16_t)0x8000), (void)None); // + // tinyTester.FunctionCall_Expect("MAX11131.SPIwrite16bits", fn_MAX11131_SPIwrite16bits, (int16_t)0x8000, /* empty expect: */ (void)None); // + g_MAX11131_device.SPIwrite16bits((int16_t)0x8000); // call-function ExternFunction // + + // @test SPIoutputCS(1); // drive CS high + // docTest_item['actionType'] = 'call-function' + // docTest_item['action'] = 'SPIoutputCS(1)' + // docTest_item['funcName'] = 'SPIoutputCS' + // docTest_item['arglist'] = '1' + // call-function + // ASSERT_EQ(g_MAX11131_device.SPIoutputCS((int)1), (void)None); // + // tinyTester.FunctionCall_Expect("MAX11131.SPIoutputCS", fn_MAX11131_SPIoutputCS, (int)1, /* empty expect: */ (void)None); // + g_MAX11131_device.SPIoutputCS((int)1); // call-function ExternFunction // + + // @test tinyTester.print("MOSI <-- 0001_1001_1010_0000 ADC_MODE_CONTROL Scan_0011_StandardInt CHSEL=3 RESET=1 SWCNV=0") + // docTest_item['actionType'] = 'print-string' + // docTest_item['action'] = 'tinyTester.print("MOSI <-- 0001_1001_1010_0000 ADC_MODE_CONTROL Scan_0011_StandardInt CHSEL=3 RESET=1 SWCNV=0")' + // docTest_item['arglist'] = 'MOSI <-- 0001_1001_1010_0000 ADC_MODE_CONTROL Scan_0011_StandardInt CHSEL=3 RESET=1 SWCNV=0' + // print-string + // tinyTesterFuncName = "tinyTester.print" + // tinyTesterPrintStringLiteral = "MOSI <-- 0001_1001_1010_0000 ADC_MODE_CONTROL Scan_0011_StandardInt CHSEL=3 RESET=1 SWCNV=0" + tinyTester.print("MOSI <-- 0001_1001_1010_0000 ADC_MODE_CONTROL Scan_0011_StandardInt CHSEL=3 RESET=1 SWCNV=0"); + + // @test SPIoutputCS(0); // drive CS low + // docTest_item['actionType'] = 'call-function' + // docTest_item['action'] = 'SPIoutputCS(0)' + // docTest_item['funcName'] = 'SPIoutputCS' + // docTest_item['arglist'] = '0' + // call-function + // ASSERT_EQ(g_MAX11131_device.SPIoutputCS((int)0), (void)None); // + // tinyTester.FunctionCall_Expect("MAX11131.SPIoutputCS", fn_MAX11131_SPIoutputCS, (int)0, /* empty expect: */ (void)None); // + g_MAX11131_device.SPIoutputCS((int)0); // call-function ExternFunction // + + // @test SPIwrite16bits(0x19a0); + // docTest_item['actionType'] = 'call-function' + // docTest_item['action'] = 'SPIwrite16bits(0x19a0)' + // docTest_item['funcName'] = 'SPIwrite16bits' + // docTest_item['arglist'] = '0x19a0' + // call-function + // ASSERT_EQ(g_MAX11131_device.SPIwrite16bits((int16_t)0x19a0), (void)None); // + // tinyTester.FunctionCall_Expect("MAX11131.SPIwrite16bits", fn_MAX11131_SPIwrite16bits, (int16_t)0x19a0, /* empty expect: */ (void)None); // + g_MAX11131_device.SPIwrite16bits((int16_t)0x19a0); // call-function ExternFunction // + + // @test SPIoutputCS(1); // drive CS high + // docTest_item['actionType'] = 'call-function' + // docTest_item['action'] = 'SPIoutputCS(1)' + // docTest_item['funcName'] = 'SPIoutputCS' + // docTest_item['arglist'] = '1' + // call-function + // ASSERT_EQ(g_MAX11131_device.SPIoutputCS((int)1), (void)None); // + // tinyTester.FunctionCall_Expect("MAX11131.SPIoutputCS", fn_MAX11131_SPIoutputCS, (int)1, /* empty expect: */ (void)None); // + g_MAX11131_device.SPIoutputCS((int)1); // call-function ExternFunction // + // #if INJECT_SELFTEST_FAIL // Test of the pass/fail report mechanism @@ -2030,6 +2478,36 @@ } //-------------------------------------------------- +// selfTestFunctionClosures[functionName]['functionName'] = 'ScanStandardExternalClock' +// selfTestFunctionClosures[functionName]['argListDeclaration'] = 'void' +// selfTestFunctionClosures[functionName]['returnType'] = 'int' +// selfTestFunctionClosures[functionName]['argNames'] = '' +// CommandParamIn_declaration = 'void' +// argNames_recast_implementation = '' +//-------------------------------------------------- +// selftest: define function under test +// int MAX11131::ScanStandardExternalClock(void) +int fn_MAX11131_ScanStandardExternalClock(void) +{ + return g_MAX11131_device.ScanStandardExternalClock(); +} + +//-------------------------------------------------- +// selfTestFunctionClosures[functionName]['functionName'] = 'ReadAINcode' +// selfTestFunctionClosures[functionName]['argListDeclaration'] = 'void' +// selfTestFunctionClosures[functionName]['returnType'] = 'void' +// selfTestFunctionClosures[functionName]['argNames'] = '' +// CommandParamIn_declaration = 'void' +// argNames_recast_implementation = '' +//-------------------------------------------------- +// selftest: define function under test +// void MAX11131::ReadAINcode(void) +void fn_MAX11131_ReadAINcode(void) +{ + return g_MAX11131_device.ReadAINcode(); +} + +//-------------------------------------------------- // selfTestFunctionClosures[functionName]['functionName'] = 'SPIoutputCS' // selfTestFunctionClosures[functionName]['argListDeclaration'] = 'int isLogicHigh' // selfTestFunctionClosures[functionName]['returnType'] = 'void'