Skip to content

Commit 879d891

Browse files
committed
FPGA Analogin test: Remove test case which can not be executed
The test case which checks full range cannot be executed at the moment due to a hardware bug in FPGA-Test-Shield. This test case will be restored when the final version of FPGA-Test-Shield is ready.
1 parent c016f2a commit 879d891

File tree

1 file changed

+0
-72
lines changed
  • TESTS/mbed_hal_fpga_ci_test_shield/analogin

1 file changed

+0
-72
lines changed

TESTS/mbed_hal_fpga_ci_test_shield/analogin/main.cpp

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -72,81 +72,9 @@ void analogin_test(PinName pin)
7272
tester.gpio_write(MbedTester::LogicalPinGPIO0, 0, false);
7373
}
7474

75-
void analogin_full_test(PinName pin)
76-
{
77-
/* Test analog input */
78-
79-
printf("Testing AnalogIn\r\n");
80-
81-
// Remap pins for test
82-
tester.reset();
83-
84-
// Reset tester stats and select GPIO
85-
tester.peripherals_reset();
86-
tester.select_peripheral(MbedTester::PeripheralGPIO);
87-
88-
analogin_t analogin;
89-
analogin_init(&analogin, pin);
90-
91-
//enable analog MUX
92-
tester.set_mux_enable(true);
93-
94-
//set MUX address
95-
tester.set_mux_addr(pin);
96-
97-
float voltage = 0.0;
98-
bool enable = true;
99-
uint32_t period = 100;
100-
uint32_t duty_cycle = 0;
101-
//enable FPGA system PWM
102-
tester.set_analog_out(voltage, enable);
103-
104-
TEST_ASSERT_EQUAL(true, tester.get_pwm_enable());
105-
TEST_ASSERT_EQUAL(period, tester.get_pwm_period());
106-
TEST_ASSERT_EQUAL(duty_cycle, tester.get_pwm_cycles_high());
107-
// test duty cycles 0-100% at 1000ns period
108-
for (int i = 0; i < 11; i += 1) {
109-
voltage = (float)i * 0.1f;
110-
duty_cycle = 10 * i;
111-
tester.set_analog_out(voltage, enable);
112-
wait_us(10);
113-
//read analog input
114-
//assert pwm duty_cycle is correct based on set analog voltage
115-
TEST_ASSERT_EQUAL(duty_cycle, tester.get_pwm_cycles_high());
116-
TEST_ASSERT_FLOAT_WITHIN(DELTA_FLOAT, 0.01f * (float)duty_cycle, analogin_read(&analogin));
117-
}
118-
tester.set_pwm_enable(false);
119-
TEST_ASSERT_EQUAL(false, tester.get_pwm_enable());
120-
wait_us(10);
121-
122-
// assert Mbed pin correctly drives AnalogMuxIn
123-
tester.pin_map_set(pin, MbedTester::LogicalPinGPIO0);
124-
125-
tester.gpio_write(MbedTester::LogicalPinGPIO0, 0, true);
126-
TEST_ASSERT_EQUAL(0, tester.sys_pin_read(MbedTester::AnalogMuxIn));
127-
wait_us(10);
128-
tester.gpio_write(MbedTester::LogicalPinGPIO0, 1, true);
129-
TEST_ASSERT_EQUAL(1, tester.sys_pin_read(MbedTester::AnalogMuxIn));
130-
wait_us(10);
131-
tester.gpio_write(MbedTester::LogicalPinGPIO0, 0, true);
132-
TEST_ASSERT_EQUAL(0, tester.sys_pin_read(MbedTester::AnalogMuxIn));
133-
wait_us(10);
134-
tester.gpio_write(MbedTester::LogicalPinGPIO0, 0, false);
135-
wait_us(10);
136-
tester.set_mux_enable(false);
137-
wait_us(10);
138-
139-
TEST_ASSERT_EQUAL(1, tester.self_test_control_current());//assert control channel still functioning properly
140-
}
141-
14275
Case cases[] = {
14376
// This will be run for all pins
14477
Case("AnalogIn - init test", all_ports<AnaloginPort, DefaultFormFactor, analogin_init>),
145-
// This test case is disabled for now due to hardware issue in the first rev of FPGA Test Shield
146-
#if 0
147-
Case("AnalogIn - full test", all_ports<AnaloginPort, DefaultFormFactor, analogin_full_test>),
148-
#endif
149-
15078
// This will be run for single pin
15179
Case("AnalogIn - read test", all_ports<AnaloginPort, DefaultFormFactor, analogin_test>),
15280
};

0 commit comments

Comments
 (0)