| NANO100_BSP V3.05.000 The Board Support Package for Nano100BN Series

NuEdu-Basic01_Interrupt.c
Go to the documentation of this file.
1/**************************************************************************/
12#include <stdio.h>
13#include "NUC200Series.h"
14#include "NuEdu-Basic01_Interrupt.h"
15
16
33 void Initial_EINT1_GPIO(void)
34{
35 /* Set PB.15 as Input */
36 _GPIO_SET_PIN_MODE(PB, 15, GPIO_PMD_INPUT);
37
38 /* Set PB.15 multi-function pins for EINT1 */
39 SYS->GPB_MFP |= SYS_GPB_MFP_PB15_INT1;
40}
41
46 void Open_EINT1(void)
47{
48 Initial_EINT1_GPIO();
49
50 /* Enable interrupt by falling edge trigger */
51 GPIO_EnableInt(PB, 15, GPIO_INT_FALLING);
52 NVIC_EnableIRQ(EINT1_IRQn);
53
54}
55
56 /* end of group Nano130_Basic01_FUNCTIONS Interrupt Exported Functions */
58 /* end of group NuEdu-SDK-Nano130_Basic01 Nano130_Basic01 Library */
60 /* end of group NANO100_Library NANO100 Library */
62
63/*** (C) COPYRIGHT 2014 Nuvoton Technology Corp. ***/
NuEdu-Basic01_Interrupt.h
NuEdu-Basic01_Interrupt.h interrupt driver header file for NuEdu-SDK-Nano130.
EINT1_IRQn
@ EINT1_IRQn
Definition: Nano100Series.h:93
GPIO_PMD_INPUT
#define GPIO_PMD_INPUT
Definition: gpio.h:37
GPIO_INT_FALLING
#define GPIO_INT_FALLING
Definition: gpio.h:45
GPIO_EnableInt
void GPIO_EnableInt(GPIO_T *gpio, uint32_t u32Pin, uint32_t u32IntAttribs)
Enable GPIO interrupt.
Definition: gpio.c:65
PB
#define PB
Pointer to GPIO port B register structure.
Definition: Nano100Series.h:11696
SYS
#define SYS
Pointer to SYS register structure.
Definition: Nano100Series.h:11692
Open_EINT1
void Open_EINT1(void)
This function enables EINT1 interrupt and IRQ handler, and configs trigger condition for falling edge...
Definition: NuEdu-Basic01_Interrupt.c:46
Initial_EINT1_GPIO
void Initial_EINT1_GPIO(void)
This function initializes PB.15 multi-function for EINT1 to detect external interrupt.
Definition: NuEdu-Basic01_Interrupt.c:33