Previously, the PWM control buzzer was used to change the frequency of the buzzer. A bad thing is that the buzzer keeps ringing and can be closed in an interactive way. Select the buttons here. There are four buttons on the Development Board, corresponding to the four external interrupt eint0, eint1, eint2 and eint4 (why not eint0 ~ 3)
To use external interrupt, initialize the External Interrupt first. The external interrupt is reused with the external pins F and G. Configure the corresponding pins as the interrupt mode:
After configuring the pins, you also need to configure the specific interrupt function. We need to enable the shielding of a certain interruption so that we can respond to the interrupt. The corresponding register is intmsk. Some bits correspond to multiple external interruptions;
Because the bits correspond to multiple external interruptions, such as eint4 ~ 7 eint8 ~ 23 corresponds to a shielding bit of intmsk, so to precisely open an external interrupt, you need to configure eintmask. The following figure only lists some of them. For eint4 ~ 23 is applicable.
There must also be a trigger Method for external interruptions. Select low level, high level, rising edge, falling edge trigger, and so on. In this case, you must configure the extint register.
As described in the interrupt section of the S3C2440 processor in the previous blog post gun-UCOS, the hardware will set srcpnd and intpnd to 1 when the interrupt occurs, therefore, we need to clear the corresponding bit (reset by 1), and determine the specific external interrupt for the external interrupt, which depends on the eintpend register. This register also needs to be cleared by setting 1.