From 7ad7527e81a3e89137f8f895204051b7ef881e87 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Tue, 25 Sep 2018 16:17:26 +0900 Subject: [PATCH] Add defninitions of EXTI use for FST-01SZ. --- board/board-fst-01sz.h | 12 +++++++++++- mcu/stm32f103.h | 2 ++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/board/board-fst-01sz.h b/board/board-fst-01sz.h index c161753..78420ed 100644 --- a/board/board-fst-01sz.h +++ b/board/board-fst-01sz.h @@ -22,7 +22,7 @@ * Port A setup. * PA0 - input with pull-up: AN0 for NeuG * PA1 - input with pull-up: AN1 for NeuG - * PA3 - input with pull-up: Hall sensor output + * PA3 - input with pull-up: Hall effect sensor output * PA8 - Push pull output 10MHz 0 default (LED 1:ON 0:OFF) * PA11 - Push Pull output 10MHz 0 default (until USB enabled) (USBDM) * PA12 - Push Pull output 10MHz 0 default (until USB enabled) (USBDP) @@ -35,3 +35,13 @@ #define RCC_ENR_IOP_EN RCC_APB2ENR_IOPAEN #define RCC_RSTR_IOP_RST RCC_APB2RSTR_IOPARST + +#if 0 /* For PA, AFIO setting is not needed. */ +#define AFIO_EXTICR_INDEX 0 +#define AFIO_EXTICR1_EXTIx_Py AFIO_EXTICR1_EXTI3_PA +#endif + +#define EXTI_PR EXTI_PR_PR3 +#define EXTI_IMR EXTI_IMR_MR3 +#define EXTI_RTSR_TR EXTI_RTSR_TR3 +#define INTR_REQ_EXTI EXTI3_IRQ diff --git a/mcu/stm32f103.h b/mcu/stm32f103.h index e271e2e..12cec0d 100644 --- a/mcu/stm32f103.h +++ b/mcu/stm32f103.h @@ -574,6 +574,8 @@ static struct EXTI *const EXTI = (struct EXTI *)EXTI_BASE; #define EXTI0_IRQ 6 #define EXTI1_IRQ 7 #define EXTI2_IRQ 8 +#define EXTI3_IRQ 9 +#define EXTI4_IRQ 10 #define EXTI9_5_IRQ 23 #define TIM2_IRQ 28 #define TIM3_IRQ 29