From 473ecbe2b36bc44da2552cd5814874a495913fc1 Mon Sep 17 00:00:00 2001 From: Daisuke Nojiri Date: Wed, 27 Jul 2016 15:46:42 -0700 Subject: cts: Add real interrupt test Interrupt test checks whether DUT can be interrupted by an interrupt and an interrupt handler can be invoked as expected. Note the previous interrupt test ported from test/interrupt.c runs in an emulated environment on the host, thus does not test the real interrupt capability of the chip. BUG=chromium:653195 BRANCH=none TEST=Run cts.py -m interrupt Change-Id: I21cecff07594f048633d1c1b699fb3a1876379e0 Signed-off-by: Daisuke Nojiri Reviewed-on: https://chromium-review.googlesource.com/363943 Reviewed-by: Randall Spangler --- board/nucleo-f072rb/gpio.inc | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'board/nucleo-f072rb/gpio.inc') diff --git a/board/nucleo-f072rb/gpio.inc b/board/nucleo-f072rb/gpio.inc index 3515d5ca84..31149bf633 100644 --- a/board/nucleo-f072rb/gpio.inc +++ b/board/nucleo-f072rb/gpio.inc @@ -9,6 +9,16 @@ * Note: Those with interrupt handlers must be declared first. */ GPIO_INT(USER_BUTTON, PIN(C, 13), GPIO_INT_FALLING, button_event) +#ifdef CTS_MODULE +#ifndef CTS_MODULE_GPIO +/* Overload C1 for interrupt. Enabled only for non-GPIO suites as + * GPIO tests don't require a separate notification line. */ +GPIO_INT(CTS_IRQ, PIN(C, 1), GPIO_INT_FALLING | GPIO_PULL_UP , cts_irq) +/* Used to disable interrupt. This IRQ# has to match the number used for the + * pin set above */ +#define CTS_IRQ_NUMBER STM32_IRQ_EXTI0_1 +#endif +#endif /* Outputs */ GPIO(LED_U, PIN(A, 5), GPIO_OUT_LOW) @@ -29,6 +39,8 @@ ALTERNATE(PIN_MASK(B, 0x00C0), GPIO_ALT_F1, MODULE_I2C, GPIO_PULL_UP) /* CTS Signals */ GPIO(HANDSHAKE_INPUT, PIN(A, 4), GPIO_INPUT | GPIO_PULL_UP) GPIO(HANDSHAKE_OUTPUT, PIN(B, 0), GPIO_ODR_LOW) +#ifdef CTS_MODULE_GPIO GPIO(INPUT_TEST, PIN(C, 1), GPIO_INPUT | GPIO_PULL_UP) +#endif GPIO(OUTPUT_TEST, PIN(C, 0), GPIO_ODR_LOW) #endif -- cgit v1.2.1