SampleCode\StdDriver\GPIO_INT
下载BSP包,找上面的目录。。
一般像这样配置;:
/* Configure PB.3 as Input mode and enable interrupt by rising edge trigger */
GPIO_SetMode(PB, BIT3, GPIO_PMD_INPUT);
GPIO_EnableInt(PB, 3, GPIO_INT_RISING);
NVIC_EnableIRQ(GPAB_IRQn);
/* Configure PE.5 as Quasi-bidirection mode and enable interrupt by falling edge trigger */
GPIO_SetMode(PE, BIT5, GPIO_PMD_QUASI);
GPIO_EnableInt(PE, 5, GPIO_INT_FALLING);
NVIC_EnableIRQ(GPCDEF_IRQn);
|