diff --git a/tests/psoc6/hw_ext/adc.py b/tests/psoc6/hw_ext/adc.py index f2d42d59165b6..9f0e383b26617 100644 --- a/tests/psoc6/hw_ext/adc.py +++ b/tests/psoc6/hw_ext/adc.py @@ -21,15 +21,15 @@ adc_pin_max = "P10_0" adc_wrong_pin_name = "P13_7" # Enable after DUT setup - print("SKIP") - raise SystemExit + # print("SKIP") + # raise SystemExit elif "CY8CPROTO-063-BLE" in machine: - adc_pin_gnd = "P10_1" + adc_pin_gnd = "P10_2" adc_pin_mid = "P10_3" - adc_pin_max = "P10_0" + adc_pin_max = "P10_4" adc_wrong_pin_name = "P13_7" - print("SKIP") - raise SystemExit + # print("SKIP") + # raise SystemExit # 0.35V tolerance_uv = 350000 @@ -41,22 +41,18 @@ def validate_adc_uv_value(adc_pin, exp_volt, act_volt): print( - "\nExpected voltage - ", + "Expected voltage - ", exp_volt, - "(uV) on pin ", - adc_pin, - "is approx same as obtained voltage(uV): ", + "(uV) is approx same as obtained voltage(uV): ", (exp_volt - tolerance_uv) < act_volt < (exp_volt + tolerance_uv), ) def validate_adc_raw_value(adc_pin, exp_volt, act_volt): print( - "\nExpected voltage - ", + "Expected voltage - ", exp_volt, - "(raw) on pin ", - adc_pin, - "is approx same as obtained voltage(raw): ", + "(raw) is approx same as obtained voltage(raw): ", (exp_volt - tolerance_raw) < act_volt < (exp_volt + tolerance_raw), ) @@ -67,30 +63,24 @@ def validate_adc_raw_value(adc_pin, exp_volt, act_volt): except: print("Invalid ADC Pin\n") -adc0 = ADC(adc_pin_gnd, sample_ns=1000) -print(adc0) block = ADCBlock(0, bits=12) # ADCBlock.connect(channel) adc1 = block.connect(3) -print("\nADCBlock.connect(channel): ", adc1) block.deinit() -print("ADCBlock.deinit(): ", block) # ADCBlock.connect(source) block = ADCBlock(0, bits=12) adc1 = block.connect(adc_pin_mid) -print("ADCBlock.connect(source): ", adc1) block.deinit() -print("ADCBlock.deinit(): ", block) + +adc0 = ADC(adc_pin_gnd, sample_ns=1000) # ADCBlock.connect(channel,source) block = ADCBlock(0, bits=12) adc1 = block.connect(3, adc_pin_mid) -print("ADCBlock.connect(channel,source)", adc1) adc2 = ADC(adc_pin_max, sample_ns=1000) -print("\n", adc2) adc0_value_uv = adc0.read_uv() validate_adc_uv_value(adc_pin_gnd, 0, adc0_value_uv) @@ -108,8 +98,5 @@ def validate_adc_raw_value(adc_pin, exp_volt, act_volt): validate_adc_raw_value(adc_pin_max, 32767, adc2_value_raw) adc0.deinit() -print("\n", adc0) adc1.deinit() -print(adc1) adc2.deinit() -print(adc2) diff --git a/tests/psoc6/hw_ext/adc.py.exp b/tests/psoc6/hw_ext/adc.py.exp index 89feb142fb2cb..9c571ab2dc8c2 100644 --- a/tests/psoc6/hw_ext/adc.py.exp +++ b/tests/psoc6/hw_ext/adc.py.exp @@ -1,27 +1,8 @@ Invalid ADC Pin - - -ADCBlock.connect(channel): -ADCBlock.deinit(): ADCBlock(0, bits=12) -ADCBlock.connect(source): -ADCBlock.deinit(): ADCBlock(0, bits=12) -ADCBlock.connect(channel,source) - - - -Expected voltage - 0 (uV) on pin P10_1 is approx same as obtained voltage(uV): True - -Expected voltage - 0 (raw) on pin P10_1 is approx same as obtained voltage(raw): True - -Expected voltage - 1650000 (uV) on pin P10_3 is approx same as obtained voltage(uV): True - -Expected voltage - 16385 (raw) on pin P10_3 is approx same as obtained voltage(raw): True - -Expected voltage - 3300000 (uV) on pin P10_0 is approx same as obtained voltage(uV): True - -Expected voltage - 32767 (raw) on pin P10_0 is approx same as obtained voltage(raw): True - - - - +Expected voltage - 0 (uV) is approx same as obtained voltage(uV): True +Expected voltage - 0 (raw) is approx same as obtained voltage(raw): True +Expected voltage - 1650000 (uV) is approx same as obtained voltage(uV): True +Expected voltage - 16385 (raw) is approx same as obtained voltage(raw): True +Expected voltage - 3300000 (uV) is approx same as obtained voltage(uV): True +Expected voltage - 32767 (raw) is approx same as obtained voltage(raw): True