9 years, 8 months ago.

InterruptIn pins for Nucleo board

Hi I've Nucleo board 401, which pins can be used for InterruptIn function?

Aung

Question relating to:

2 Answers

9 years, 8 months ago.

Hello Aung KL,

the gpio IRQ implementation (comments say which EXTI line are those).

// The irq_index is passed to the function
// EXTI line 0
static void gpio_irq0(void) {
    handle_interrupt_in(0);
}
// EXTI line 1
static void gpio_irq1(void) {
    handle_interrupt_in(1);
}
// EXTI line 2
static void gpio_irq2(void) {
    handle_interrupt_in(2);
}
// EXTI line 3
static void gpio_irq3(void) {
    handle_interrupt_in(3);
}
// EXTI line 4
static void gpio_irq4(void) {
    handle_interrupt_in(4);
}
// EXTI lines 5 to 9
static void gpio_irq5(void) {
    handle_interrupt_in(5);
}
// EXTI lines 10 to 15
static void gpio_irq6(void) {
    handle_interrupt_in(6);
}

Hello Martin, thank for quick response, can you please describe the pin name like D0, D1 or PA_2? In the "InterruptIn Handbook page, https://mbed.org/handbook/InterruptIn ,

Quote:

Certain pins cannot be used for InterruptIn:

mbed NXP LPC1768: Any of the numbered mbed pins can be used as an InterruptIn, except p19 and p20.

mbed FRDM KL25Z: Only the pins of port A and D can be used. (PTA[0-31] and PTD[0-31]).

How about for the pins of nucleo board?

Regards,

Aung

posted by Aung KL 24 Jul 2014

Where can I find " gpio IRQ implementation"?

posted by prabin yadav 24 Jul 2014
9 years, 8 months ago.

IIRC all can. Just not different pins with the same number at the same time (so not for example PTA15 and PTB15 at the same time).

Thank Erik, I've got some info from stm32f401xe.h

/** 
  * @brief   EXTI0 configuration  
  */ 
#define SYSCFG_EXTICR1_EXTI0_PA         ((uint32_t)0x0000) /*!<PA[0] pin */
#define SYSCFG_EXTICR1_EXTI0_PB         ((uint32_t)0x0001) /*!<PB[0] pin */
#define SYSCFG_EXTICR1_EXTI0_PC         ((uint32_t)0x0002) /*!<PC[0] pin */
#define SYSCFG_EXTICR1_EXTI0_PD         ((uint32_t)0x0003) /*!<PD[0] pin */
#define SYSCFG_EXTICR1_EXTI0_PE         ((uint32_t)0x0004) /*!<PE[0] pin */
#define SYSCFG_EXTICR1_EXTI0_PH         ((uint32_t)0x0007) /*!<PH[0] pin */

/** 
  * @brief   EXTI1 configuration  
  */ 
#define SYSCFG_EXTICR1_EXTI1_PA         ((uint32_t)0x0000) /*!<PA[1] pin */
#define SYSCFG_EXTICR1_EXTI1_PB         ((uint32_t)0x0010) /*!<PB[1] pin */
#define SYSCFG_EXTICR1_EXTI1_PC         ((uint32_t)0x0020) /*!<PC[1] pin */
#define SYSCFG_EXTICR1_EXTI1_PD         ((uint32_t)0x0030) /*!<PD[1] pin */
#define SYSCFG_EXTICR1_EXTI1_PE         ((uint32_t)0x0040) /*!<PE[1] pin */
#define SYSCFG_EXTICR1_EXTI1_PH         ((uint32_t)0x0070) /*!<PH[1] pin */
posted by Aung KL 24 Jul 2014