How do I configure a GPIO pin as an external interrupt in a Target Support Package?
2 次查看(过去 30 天)
显示 更早的评论
I would like to configure GPIO pin as external interrupt for F28335 board. I would like an example or demo for this.
采纳的回答
MathWorks Support Team
2013-1-17
The attached model configures GPIO0 as external interrupt to trigger the blinking of LED. The custom code in the System Initialize block assigns GPIO0 as an input to trigger the XINT1 interrupt:
EALLOW;
GpioCtrlRegs.GPAMUX1.bit.GPIO0 = 0;
GpioIntRegs.GPIOXINT1SEL.bit.GPIOSEL = 0;
EDIS;
XIntruptRegs.XINT1CR.bit.ENABLE = 1;
XIntruptRegs.XINT1CR.bit.POLARITY = 1;
The ISR toggles the LED based on a rising edge of GPIO00. Connect GPIO to 3V and GND in order to blink the LED.
0 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!