minimalist hardware testing support
Dependents: MAX5715BOB_Tester MAX11131BOB_Tester MAX5171BOB_Tester MAX11410BOB_Tester ... more
Revision 18:9874cd1e6cb0, committed 2021-06-08
- Comitter:
- whismanoid
- Date:
- Tue Jun 08 04:00:15 2021 -0700
- Parent:
- 17:65fb4afe4991
- Commit message:
- MaximTinyTester AnalogIn5_Read_Report_voltageV() for MAX5719
Changed in this revision
MaximTinyTester.cpp | Show annotated file Show diff for this revision Revisions of this file |
MaximTinyTester.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r 65fb4afe4991 -r 9874cd1e6cb0 MaximTinyTester.cpp --- a/MaximTinyTester.cpp Tue Jun 01 19:43:11 2021 -0700 +++ b/MaximTinyTester.cpp Tue Jun 08 04:00:15 2021 -0700 @@ -1489,6 +1489,151 @@ return false; } + +/** Test an analog voltage input to the platform (output from the device under test) +* and report the measured value to the test log. +* Information only; does not pass or fail. +* +* @return voltage in Volts +* +*/ +double MaximTinyTester::AnalogIn0_Read_Report_voltageV() +{ + float adc_full_scale_voltage = analogInPin_fullScaleVoltage[0]; + + // Platform board uses simple analog inputs + float normValue_0_1 = analogInPin0.read(); + double actual_result = normValue_0_1 * adc_full_scale_voltage; + // Platform board uses simple analog inputs + associatedCmdLine.serial().printf("\r\n AIN0 = %7.3f%% = %1.3fV ", + normValue_0_1 * 100.0, + normValue_0_1 * adc_full_scale_voltage + ); + // + //~ associatedCmdLine.serial().printf("\r\n"); + return actual_result; +} + +/** Test an analog voltage input to the platform (output from the device under test) +* and report the measured value to the test log. +* Information only; does not pass or fail. +* +* @return voltage in Volts +* +*/ +double MaximTinyTester::AnalogIn1_Read_Report_voltageV() +{ + float adc_full_scale_voltage = analogInPin_fullScaleVoltage[1]; + + // Platform board uses simple analog inputs + float normValue_0_1 = analogInPin1.read(); + double actual_result = normValue_0_1 * adc_full_scale_voltage; + // Platform board uses simple analog inputs + associatedCmdLine.serial().printf("\r\n AIN1 = %7.3f%% = %1.3fV ", + normValue_0_1 * 100.0, + normValue_0_1 * adc_full_scale_voltage + ); + // + //~ associatedCmdLine.serial().printf("\r\n"); + return actual_result; +} + +/** Test an analog voltage input to the platform (output from the device under test) +* and report the measured value to the test log. +* Information only; does not pass or fail. +* +* @return voltage in Volts +* +*/ +double MaximTinyTester::AnalogIn2_Read_Report_voltageV() +{ + float adc_full_scale_voltage = analogInPin_fullScaleVoltage[2]; + + // Platform board uses simple analog inputs + float normValue_0_1 = analogInPin2.read(); + double actual_result = normValue_0_1 * adc_full_scale_voltage; + // Platform board uses simple analog inputs + associatedCmdLine.serial().printf("\r\n AIN2 = %7.3f%% = %1.3fV ", + normValue_0_1 * 100.0, + normValue_0_1 * adc_full_scale_voltage + ); + // + //~ associatedCmdLine.serial().printf("\r\n"); + return actual_result; +} + +/** Test an analog voltage input to the platform (output from the device under test) +* and report the measured value to the test log. +* Information only; does not pass or fail. +* +* @return voltage in Volts +* +*/ +double MaximTinyTester::AnalogIn3_Read_Report_voltageV() +{ + float adc_full_scale_voltage = analogInPin_fullScaleVoltage[3]; + + // Platform board uses simple analog inputs + float normValue_0_1 = analogInPin3.read(); + double actual_result = normValue_0_1 * adc_full_scale_voltage; + // Platform board uses simple analog inputs + associatedCmdLine.serial().printf("\r\n AIN3 = %7.3f%% = %1.3fV ", + normValue_0_1 * 100.0, + normValue_0_1 * adc_full_scale_voltage + ); + // + //~ associatedCmdLine.serial().printf("\r\n"); + return actual_result; +} + +/** Test an analog voltage input to the platform (output from the device under test) +* and report the measured value to the test log. +* Information only; does not pass or fail. +* +* @return voltage in Volts +* +*/ +double MaximTinyTester::AnalogIn4_Read_Report_voltageV() +{ + float adc_full_scale_voltage = analogInPin_fullScaleVoltage[4]; + + // Platform board uses simple analog inputs + float normValue_0_1 = analogInPin4.read(); + double actual_result = normValue_0_1 * adc_full_scale_voltage; + // Platform board uses simple analog inputs + associatedCmdLine.serial().printf("\r\n AIN4 = %7.3f%% = %1.3fV ", + normValue_0_1 * 100.0, + normValue_0_1 * adc_full_scale_voltage + ); + // + //~ associatedCmdLine.serial().printf("\r\n"); + return actual_result; +} + +/** Test an analog voltage input to the platform (output from the device under test) +* and report the measured value to the test log. +* Information only; does not pass or fail. +* +* @return voltage in Volts +* +*/ +double MaximTinyTester::AnalogIn5_Read_Report_voltageV() +{ + float adc_full_scale_voltage = analogInPin_fullScaleVoltage[5]; + + // Platform board uses simple analog inputs + float normValue_0_1 = analogInPin5.read(); + double actual_result = normValue_0_1 * adc_full_scale_voltage; + // Platform board uses simple analog inputs + associatedCmdLine.serial().printf("\r\n AIN5 = %7.3f%% = %1.3fV ", + normValue_0_1 * 100.0, + normValue_0_1 * adc_full_scale_voltage + ); + // + //~ associatedCmdLine.serial().printf("\r\n"); + return actual_result; +} + bool MaximTinyTester::DigitalIn_Read_Expect_WarnOnly(DigitalIn& digitalInPin, const char* pinName, int expect_result, const char *expect_description) { int actual_UPO_value = -1;
diff -r 65fb4afe4991 -r 9874cd1e6cb0 MaximTinyTester.h --- a/MaximTinyTester.h Tue Jun 01 19:43:11 2021 -0700 +++ b/MaximTinyTester.h Tue Jun 08 04:00:15 2021 -0700 @@ -251,6 +251,13 @@ bool AnalogIn_Read_Expect_voltageV(AnalogIn& analogInPin, double expect_result); + double AnalogIn0_Read_Report_voltageV(); + double AnalogIn1_Read_Report_voltageV(); + double AnalogIn2_Read_Report_voltageV(); + double AnalogIn3_Read_Report_voltageV(); + double AnalogIn4_Read_Report_voltageV(); + double AnalogIn5_Read_Report_voltageV(); + bool DigitalIn_Read_Expect_WarnOnly(DigitalIn& digitalInPin, const char* pinName, int expect_result, const char *expect_description); int settle_time_msec;