尹小舟 发表于 2025-1-5 22:32

基于NXP MCUXpresso SDK的GPIO控制与中断处理示例

<div id="yoCo-1736085835304" yne-bulb-block="heading" yne-bulb-level="4">
<article data-content="[{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;qCc6-1736082583134&quot;,&quot;name&quot;:&quot;heading&quot;,&quot;data&quot;:{&quot;version&quot;:1,&quot;level&quot;:&quot;h4&quot;,&quot;style&quot;:{&quot;lineHeight&quot;:&quot;1.7&quot;}},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;fklv-1736082583135&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;引言&quot;,&quot;marks&quot;:[]}]}],&quot;state&quot;:{}},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;6kkC-1736082584115&quot;,&quot;name&quot;:&quot;paragraph&quot;,&quot;data&quot;:{&quot;version&quot;:1,&quot;style&quot;:{&quot;lineHeight&quot;:&quot;1.7&quot;}},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;0Iqv-1736082584114&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;欢迎来到本次的技术分享!今天,我们将一起探讨一个基于NXP MCUXpresso SDK开发的GPIO(通用输入输出)控制与中断处理示例程序。这个程序展示了如何通过配置GPIO引脚来实现LED灯的闪烁以及按钮按下时的中断响应。&quot;,&quot;marks&quot;:[]}]}],&quot;state&quot;:{}},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;urdJ-1736082787010&quot;,&quot;name&quot;:&quot;heading&quot;,&quot;data&quot;:{&quot;version&quot;:1,&quot;level&quot;:&quot;h4&quot;,&quot;style&quot;:{&quot;lineHeight&quot;:&quot;1.7&quot;}},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;bmyu-1736082787009&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;程序概述&quot;,&quot;marks&quot;:[]}]}],&quot;state&quot;:{}},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;yAJG-1736082788113&quot;,&quot;name&quot;:&quot;paragraph&quot;,&quot;data&quot;:{&quot;version&quot;:1,&quot;style&quot;:{&quot;lineHeight&quot;:&quot;1.7&quot;}},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;mhDr-1736082788112&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;该程序主要实现了以下功能:&quot;,&quot;marks&quot;:[]}]}],&quot;state&quot;:{}},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;UJbS-1736082788115&quot;,&quot;name&quot;:&quot;list-item&quot;,&quot;data&quot;:{&quot;version&quot;:1,&quot;listId&quot;:&quot;7pCV-1736082788118&quot;,&quot;listLevel&quot;:1,&quot;listType&quot;:&quot;ordered&quot;,&quot;style&quot;:{&quot;lineHeight&quot;:&quot;1.7&quot;}},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;sEDE-1736082788114&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;LED灯控制:通过GPIO引脚控制板载LED灯的闪烁。&quot;,&quot;marks&quot;:[]}]}],&quot;state&quot;:{&quot;index&quot;:1}},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;NA5p-1736082788117&quot;,&quot;name&quot;:&quot;list-item&quot;,&quot;data&quot;:{&quot;version&quot;:1,&quot;listId&quot;:&quot;7pCV-1736082788118&quot;,&quot;listLevel&quot;:1,&quot;listType&quot;:&quot;ordered&quot;,&quot;style&quot;:{&quot;lineHeight&quot;:&quot;1.7&quot;}},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;Qe2i-1736082788116&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;按钮中断处理:配置GPIO引脚为中断输入,当按钮被按下时,触发中断并响应相应的动作(如切换LED灯状态)。&quot;,&quot;marks&quot;:[]}]}],&quot;state&quot;:{&quot;index&quot;:2}},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;bLbe-1736082793192&quot;,&quot;name&quot;:&quot;heading&quot;,&quot;data&quot;:{&quot;version&quot;:1,&quot;level&quot;:&quot;h4&quot;,&quot;style&quot;:{&quot;lineHeight&quot;:&quot;1.7&quot;}},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;8FdB-1736082793191&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;关键组件与配置&quot;,&quot;marks&quot;:[]}]}],&quot;state&quot;:{}},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;5CaP-1733974035579&quot;,&quot;name&quot;:&quot;heading&quot;,&quot;data&quot;:{&quot;level&quot;:&quot;h5&quot;},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;q4jo-1733974035580&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;外部中断号&quot;,&quot;marks&quot;:[{&quot;type&quot;:&quot;bold&quot;}]}]}],&quot;state&quot;:{}},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;r6jc-1736082273792&quot;,&quot;name&quot;:&quot;paragraph&quot;,&quot;data&quot;:{&quot;version&quot;:1},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;Zn17-1736082273790&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;          一组GPIO 可以使能2个中断&quot;,&quot;marks&quot;:[{&quot;type&quot;:&quot;bold&quot;}]}]}],&quot;state&quot;:{}},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;ulYT-1733469395843&quot;,&quot;name&quot;:&quot;image&quot;,&quot;data&quot;:{&quot;version&quot;:1,&quot;url&quot;:&quot;https://note.youdao.com/yws/res/10028/WEBRESOURCEe10891008202b479d99531197eecf755&quot;,&quot;width&quot;:736,&quot;height&quot;:617,&quot;fromIdentity&quot;:&quot;&quot;},&quot;nodes&quot;:[],&quot;state&quot;:{&quot;renderSource&quot;:&quot;https://note.youdao.com/yws/res/10028/WEBRESOURCEe10891008202b479d99531197eecf755&quot;,&quot;initialSize&quot;:{&quot;width&quot;:736,&quot;height&quot;:617},&quot;loading&quot;:false}},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;yvlW-1733469395848&quot;,&quot;name&quot;:&quot;paragraph&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;R7l6-1733469395847&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;&quot;,&quot;marks&quot;:[]}]}],&quot;state&quot;:{}},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;PvZ1-1733973921625&quot;,&quot;name&quot;:&quot;paragraph&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;H6bW-1733973921623&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;&quot;,&quot;marks&quot;:[]}]}],&quot;state&quot;:{}},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;VfNJ-1733973921786&quot;,&quot;name&quot;:&quot;heading&quot;,&quot;data&quot;:{&quot;level&quot;:&quot;h5&quot;},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;hS30-1733973921785&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;&quot;,&quot;marks&quot;:[]}]}],&quot;state&quot;:{}},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;fvnp-1733974566847&quot;,&quot;name&quot;:&quot;heading&quot;,&quot;data&quot;:{&quot;level&quot;:&quot;h5&quot;},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;pjo1-1733974566845&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;ISF  中断状态标志&quot;,&quot;marks&quot;:[]}]}],&quot;state&quot;:{}},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;2D4r-1733974186831&quot;,&quot;name&quot;:&quot;paragraph&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;2ICq-1733974186830&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;&quot;,&quot;marks&quot;:[]}]}],&quot;state&quot;:{}},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;48R7-1734066920189&quot;,&quot;name&quot;:&quot;image&quot;,&quot;data&quot;:{&quot;version&quot;:1,&quot;url&quot;:&quot;https://note.youdao.com/yws/res/10056/WEBRESOURCE048b0523cf086271e8ba5d83c5cb2624&quot;,&quot;width&quot;:671,&quot;height&quot;:762,&quot;fromIdentity&quot;:&quot;&quot;},&quot;nodes&quot;:[],&quot;state&quot;:{&quot;renderSource&quot;:&quot;https://note.youdao.com/yws/res/10056/WEBRESOURCE048b0523cf086271e8ba5d83c5cb2624&quot;,&quot;initialSize&quot;:{&quot;width&quot;:671,&quot;height&quot;:762},&quot;loading&quot;:false}},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;LuaW-1734067000468&quot;,&quot;name&quot;:&quot;paragraph&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;nlMw-1734067000469&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;GPIO_PinGetInterruptFlag:&quot;,&quot;marks&quot;:[{&quot;type&quot;:&quot;fontSize&quot;,&quot;value&quot;:14},{&quot;type&quot;:&quot;fontFamily&quot;,&quot;value&quot;:&quot;SimHei&quot;},{&quot;type&quot;:&quot;bold&quot;}]},{&quot;text&quot;:&quot;读单个引脚的中断状态标志&quot;,&quot;marks&quot;:[{&quot;type&quot;:&quot;color&quot;,&quot;value&quot;:&quot;#2a2b2e&quot;},{&quot;type&quot;:&quot;backgroundColor&quot;,&quot;value&quot;:&quot;rgb(255, 255, 255)&quot;},{&quot;type&quot;:&quot;fontSize&quot;,&quot;value&quot;:14},{&quot;type&quot;:&quot;fontFamily&quot;,&quot;value&quot;:&quot;SimHei&quot;},{&quot;type&quot;:&quot;bold&quot;}]}]}],&quot;state&quot;:{}},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;ubR5-1734067000467&quot;,&quot;name&quot;:&quot;code&quot;,&quot;data&quot;:{&quot;wrap&quot;:false,&quot;language&quot;:&quot;&quot;,&quot;theme&quot;:&quot;default&quot;},&quot;nodes&quot;:[{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;zD5f-1734067000466&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;UxPq-1734067000464&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;qbAp-1734067025855&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;Y0a6-1734067025853&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;#define GPIO_ICR_ISF_SHIFT                       (24U)&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;SwRg-1734067026213&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;HT3G-1734067026212&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;46F7-1734067026399&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;cDHK-1734067026398&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;/*!\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;IQ3c-1734067001938&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;S8o9-1734067001937&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot; * brief Read individual pin's interrupt status flag.\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;2zdy-1734067001940&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;WzfL-1734067001939&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot; *\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;AV6N-1734067001942&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;dAoK-1734067001941&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot; * param base GPIO peripheral base pointer. (GPIOA, GPIOB, GPIOC, and so on)\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;AwJN-1734067001944&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;Shka-1734067001943&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot; * param pin GPIO specific pin number.\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;zY1p-1734067001946&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;BZYo-1734067001945&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot; * return The current selected pin's interrupt status flag.\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;XeNI-1734067001948&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;FTie-1734067001947&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot; */\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;m7hW-1734067001950&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;dmp1-1734067001949&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;uint8_t GPIO_PinGetInterruptFlag(GPIO_Type *base, uint32_t pin)\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;rtl9-1734067001952&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;tLdX-1734067001951&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;{\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;8Ckd-1734067001954&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;2j6K-1734067001953&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;    return (uint8_t)((base-&gt;ICR &amp; GPIO_ICR_ISF_MASK) &gt;&gt; GPIO_ICR_ISF_SHIFT);\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;O9eY-1734067001956&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;EaPy-1734067001955&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;}&quot;,&quot;marks&quot;:[]}]}]}],&quot;state&quot;:{}},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;0LpX-1734067000470&quot;,&quot;name&quot;:&quot;paragraph&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;bkYT-1734067000471&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;&quot;,&quot;marks&quot;:[]}]}],&quot;state&quot;:{}},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;Rfv7-1736055668229&quot;,&quot;name&quot;:&quot;heading&quot;,&quot;data&quot;:{&quot;version&quot;:1,&quot;level&quot;:&quot;h4&quot;,&quot;style&quot;:{&quot;lineHeight&quot;:&quot;1.7&quot;}},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;MxAo-1736055668227&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;程序结构详解&quot;,&quot;marks&quot;:[]}]}],&quot;state&quot;:{}},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;AbGE-1736084245127&quot;,&quot;name&quot;:&quot;list-item&quot;,&quot;data&quot;:{&quot;version&quot;:1,&quot;listId&quot;:&quot;Fd2e-1736084245994&quot;,&quot;listLevel&quot;:1,&quot;listType&quot;:&quot;ordered&quot;,&quot;style&quot;:{&quot;lineHeight&quot;:&quot;1.7&quot;}},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;gmQV-1736084245128&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;头文件包含:&quot;,&quot;marks&quot;:[]}]}],&quot;state&quot;:{&quot;index&quot;:1}},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;o6fr-1736084245987&quot;,&quot;name&quot;:&quot;list-item&quot;,&quot;data&quot;:{&quot;version&quot;:1,&quot;listId&quot;:&quot;tNMT-1736084245995&quot;,&quot;listLevel&quot;:2,&quot;listType&quot;:&quot;unordered&quot;,&quot;style&quot;:{&quot;lineHeight&quot;:&quot;1.7&quot;}},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;KGHi-1736084245986&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;包含了必要的头文件,如&quot;,&quot;marks&quot;:[]},{&quot;text&quot;:&quot;fsl_debug_console.h&quot;,&quot;marks&quot;:[{&quot;type&quot;:&quot;backgroundColor&quot;,&quot;value&quot;:&quot;rgba(27, 31, 35, 0.05)&quot;},{&quot;type&quot;:&quot;fontSize&quot;,&quot;value&quot;:12},{&quot;type&quot;:&quot;fontFamily&quot;,&quot;value&quot;:&quot;Courier New&quot;}]},{&quot;text&quot;:&quot;用于调试输出,&quot;,&quot;marks&quot;:[]},{&quot;text&quot;:&quot;fsl_gpio.h&quot;,&quot;marks&quot;:[{&quot;type&quot;:&quot;backgroundColor&quot;,&quot;value&quot;:&quot;rgba(27, 31, 35, 0.05)&quot;},{&quot;type&quot;:&quot;fontSize&quot;,&quot;value&quot;:12},{&quot;type&quot;:&quot;fontFamily&quot;,&quot;value&quot;:&quot;Courier New&quot;}]},{&quot;text&quot;:&quot;用于GPIO控制等。&quot;,&quot;marks&quot;:[]}]}],&quot;state&quot;:{&quot;index&quot;:1}},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;1MGx-1736084288707&quot;,&quot;name&quot;:&quot;code&quot;,&quot;data&quot;:{&quot;wrap&quot;:false,&quot;language&quot;:&quot;&quot;,&quot;theme&quot;:&quot;default&quot;},&quot;nodes&quot;:[{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;aJJS-1736084288706&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;sNxK-1736084288705&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;#include \&quot;fsl_debug_console.h\&quot;\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;mEOd-1736084290281&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;iHGy-1736084290280&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;#if defined(FSL_FEATURE_SOC_PORT_COUNT) &amp;&amp; (FSL_FEATURE_SOC_PORT_COUNT)\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;heAZ-1736084290283&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;XemU-1736084290282&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;#include \&quot;fsl_port.h\&quot;\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;D9bH-1736084290285&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;kRIy-1736084290284&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;#endif\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;Ruvn-1736084290288&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;h8of-1736084290287&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;#include \&quot;fsl_gpio.h\&quot;\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;f9C6-1736084290290&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;0rRr-1736084290289&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;#include \&quot;fsl_common.h\&quot;\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;v2uh-1736084290292&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;grik-1736084290291&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;#include \&quot;pin_mux.h\&quot;\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;8cW9-1736084290294&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;qEvC-1736084290293&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;#include \&quot;clock_config.h\&quot;\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;zzah-1736084290296&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;3Bva-1736084290295&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;#include \&quot;board.h\&quot;\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;WBUR-1736084290298&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;K0LM-1736084290297&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;          &quot;,&quot;marks&quot;:[]}]}]}],&quot;state&quot;:{}},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;oAmg-1736084245989&quot;,&quot;name&quot;:&quot;list-item&quot;,&quot;data&quot;:{&quot;version&quot;:1,&quot;listId&quot;:&quot;Fd2e-1736084245994&quot;,&quot;listLevel&quot;:1,&quot;listType&quot;:&quot;ordered&quot;,&quot;style&quot;:{&quot;lineHeight&quot;:&quot;1.7&quot;}},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;jUec-1736084245988&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;宏定义与变量声明:&quot;,&quot;marks&quot;:[]}]}],&quot;state&quot;:{&quot;index&quot;:2}},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;qNxs-1736084245991&quot;,&quot;name&quot;:&quot;list-item&quot;,&quot;data&quot;:{&quot;version&quot;:1,&quot;listId&quot;:&quot;UsuB-1736084245996&quot;,&quot;listLevel&quot;:2,&quot;listType&quot;:&quot;unordered&quot;,&quot;style&quot;:{&quot;lineHeight&quot;:&quot;1.7&quot;}},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;eqQr-1736084245990&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;定义了LED和按钮对应的GPIO引脚。&quot;,&quot;marks&quot;:[]}]}],&quot;state&quot;:{&quot;index&quot;:1}},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;Wa0x-1736084245993&quot;,&quot;name&quot;:&quot;list-item&quot;,&quot;data&quot;:{&quot;version&quot;:1,&quot;listId&quot;:&quot;UsuB-1736084245996&quot;,&quot;listLevel&quot;:2,&quot;listType&quot;:&quot;unordered&quot;,&quot;style&quot;:{&quot;lineHeight&quot;:&quot;1.7&quot;}},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;ZrXF-1736084245992&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;声明了用于标记按钮按下状态的变量。&quot;,&quot;marks&quot;:[]}]}],&quot;state&quot;:{&quot;index&quot;:2}},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;5RIS-1736084353595&quot;,&quot;name&quot;:&quot;code&quot;,&quot;data&quot;:{&quot;wrap&quot;:false,&quot;language&quot;:&quot;&quot;,&quot;theme&quot;:&quot;default&quot;},&quot;nodes&quot;:[{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;KoyB-1736084353594&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;QZ6U-1736084353593&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;volatile bool g_ButtonPress = false;\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;3d8s-1736084354681&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;sE4J-1736084354680&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;volatile bool g_ButtonPress1 = false;\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;i4KF-1736084354683&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;E35c-1736084354682&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;volatile bool g_ButtonPress2 = false;&quot;,&quot;marks&quot;:[]}]}]}],&quot;state&quot;:{}},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;BEsd-1736084879944&quot;,&quot;name&quot;:&quot;paragraph&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;hkfK-1736084879945&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;3.中断服务函数实现:&quot;,&quot;marks&quot;:[{&quot;type&quot;:&quot;color&quot;,&quot;value&quot;:&quot;#05073b&quot;},{&quot;type&quot;:&quot;backgroundColor&quot;,&quot;value&quot;:&quot;rgb(253, 253, 254)&quot;},{&quot;type&quot;:&quot;fontSize&quot;,&quot;value&quot;:15},{&quot;type&quot;:&quot;fontFamily&quot;,&quot;value&quot;:&quot;Arial&quot;}]}]}],&quot;state&quot;:{}},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;iyj5-1736084879943&quot;,&quot;name&quot;:&quot;code&quot;,&quot;data&quot;:{&quot;wrap&quot;:false,&quot;language&quot;:&quot;&quot;,&quot;theme&quot;:&quot;default&quot;},&quot;nodes&quot;:[{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;IMW3-1736084879942&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;wxTN-1736084879941&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;void BOARD_SW_IRQ_HANDLER(void)\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;XDvk-1736084904475&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;x0XE-1736084904474&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;{\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;TAIJ-1736084904477&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;Z6kC-1736084904476&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;\tif(GPIO_PinGetInterruptFlag(GPIO0,6))\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;IbPh-1736084904479&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;IfGy-1736084904478&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;\t{\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;Lmbi-1736084904481&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;BEva-1736084904480&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;\t    #if (defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) &amp;&amp; FSL_FEATURE_PORT_HAS_NO_INTERRUPT) || \\\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;ctFQ-1736084904483&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;YjpD-1736084904482&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;            (!defined(FSL_FEATURE_SOC_PORT_COUNT))\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;shFF-1736084904485&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;n5Wv-1736084904484&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;            /* Clear external interrupt flag. */\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;UKDk-1736084904487&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;yKIv-1736084904486&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;            GPIO_GpioClearInterruptFlags(BOARD_SW_GPIO, 1U &lt;&lt; BOARD_SW_GPIO_PIN);\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;Te72-1736084904489&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;4H8D-1736084904488&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;            #else\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;ltdO-1736084904491&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;aRG4-1736084904490&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;            /* Clear external interrupt flag. */\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;sqR8-1736084904493&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;wKwg-1736084904492&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;            GPIO_PortClearInterruptFlags(BOARD_SW_GPIO, 1U &lt;&lt; BOARD_SW_GPIO_PIN);\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;V89f-1736084904495&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;MBJE-1736084904494&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;            #endif\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;0Wgg-1736084904497&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;LKb2-1736084904496&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;            /* Change state of button. */\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;2Boy-1736084904499&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;FPa5-1736084904498&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;            g_ButtonPress = true;\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;0qft-1736084904501&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;b7VD-1736084904500&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;\t\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;wlHR-1736084904503&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;N1gI-1736084904502&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;\t}\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;V3ex-1736084904505&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;MdJ1-1736084904504&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;\t\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;nuOT-1736084904507&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;mWeP-1736084904506&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;\tif(GPIO_PinGetInterruptFlag(GPIO0,29))\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;o5J2-1736084904509&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;auf4-1736084904508&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;\t{\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;Mbrg-1736084904511&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;da44-1736084904510&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;\t   #if (defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) &amp;&amp; FSL_FEATURE_PORT_HAS_NO_INTERRUPT) || \\\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;keKF-1736084904513&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;lEzK-1736084904512&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;            (!defined(FSL_FEATURE_SOC_PORT_COUNT))\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;XVXv-1736084904515&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;EgwE-1736084904514&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;            /* Clear external interrupt flag. */\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;kpaW-1736084904517&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;62qQ-1736084904516&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;            GPIO_GpioClearInterruptFlags(GPIO0, 1U &lt;&lt; 29);\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;Z8Ob-1736084904519&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;Zp7q-1736084904518&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;            #else\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;4HcW-1736084904521&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;lPHP-1736084904520&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;            /* Clear external interrupt flag. */\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;ce7c-1736084904523&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;lgdJ-1736084904522&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;            GPIO_PortClearInterruptFlags(BOARD_SW_GPIO, 1U &lt;&lt; BOARD_SW_GPIO_PIN);\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;HXKq-1736084904525&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;TPMw-1736084904524&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;            #endif\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;ASJT-1736084904527&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;aDrL-1736084904526&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;            /* Change state of button. */\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;asWW-1736084904529&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;sXi2-1736084904528&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;            g_ButtonPress1 = true;\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;SKyJ-1736084904531&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;XsjA-1736084904530&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;\t\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;tI1n-1736084904533&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;h5BK-1736084904532&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;\t}\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;aBn8-1736084904535&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;cNJQ-1736084904534&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;\t\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;dOsz-1736084904537&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;wTsG-1736084904536&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;\tif(GPIO_PinGetInterruptFlag(GPIO1,23))\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;tEy9-1736084904539&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;9vwe-1736084904538&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;\t{\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;dRgN-1736084904541&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;Hluz-1736084904540&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;\t    #if (defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) &amp;&amp; FSL_FEATURE_PORT_HAS_NO_INTERRUPT) || \\\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;RVij-1736084904543&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;ASbm-1736084904542&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;            (!defined(FSL_FEATURE_SOC_PORT_COUNT))\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;52gX-1736084904545&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;vVGl-1736084904544&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;            /* Clear external interrupt flag. */\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;yWQM-1736084904547&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;pi8j-1736084904546&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;            GPIO_GpioClearInterruptFlags(GPIO1, 1U &lt;&lt; 23);\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;GxJE-1736084904549&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;GMat-1736084904548&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;            #else\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;Y7t2-1736084904551&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;RmOV-1736084904550&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;            /* Clear external interrupt flag. */\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;oY1x-1736084904553&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;gqep-1736084904552&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;            GPIO_PortClearInterruptFlags(BOARD_SW_GPIO, 1U &lt;&lt; BOARD_SW_GPIO_PIN);\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;Qlhg-1736084904555&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;r9wX-1736084904554&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;            #endif\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;j64H-1736084904557&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;OgRy-1736084904556&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;            /* Change state of button. */\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;yayz-1736084904559&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;COMi-1736084904558&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;            g_ButtonPress2 = true;\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;Ns7b-1736084904561&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;kNT7-1736084904560&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;\t\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;hpxf-1736084904563&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;XRBc-1736084904562&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;\t}\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;UzNZ-1736084904565&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;yn71-1736084904564&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;T2UC-1736084904567&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;Ge4a-1736084904566&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;    SDK_ISR_EXIT_BARRIER;\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;oQdw-1736084904569&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;RmjL-1736084904568&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;}\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;Q9Mn-1736084904571&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;q8VO-1736084904570&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;&quot;,&quot;marks&quot;:[]}]}]}],&quot;state&quot;:{}},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;Y1Ha-1736055668504&quot;,&quot;name&quot;:&quot;paragraph&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;GMex-1736055668502&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;&quot;,&quot;marks&quot;:[]}]}],&quot;state&quot;:{}},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;eARf-1736085263467&quot;,&quot;name&quot;:&quot;paragraph&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;yEiQ-1736085263465&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;4.主函数实现:&quot;,&quot;marks&quot;:[{&quot;type&quot;:&quot;color&quot;,&quot;value&quot;:&quot;#05073b&quot;},{&quot;type&quot;:&quot;backgroundColor&quot;,&quot;value&quot;:&quot;rgb(253, 253, 254)&quot;},{&quot;type&quot;:&quot;fontSize&quot;,&quot;value&quot;:15},{&quot;type&quot;:&quot;fontFamily&quot;,&quot;value&quot;:&quot;Arial&quot;}]}]}],&quot;state&quot;:{}},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;fmz8-1736085268508&quot;,&quot;name&quot;:&quot;code&quot;,&quot;data&quot;:{&quot;wrap&quot;:false,&quot;language&quot;:&quot;&quot;,&quot;theme&quot;:&quot;default&quot;},&quot;nodes&quot;:[{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;yLHT-1736085268507&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;lMyL-1736085268506&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;int main(void)\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;pid3-1736085269828&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;xbNW-1736085269827&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;{\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;lRuE-1736085269830&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;DVj5-1736085269829&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;    /* Define the init structure for the output LED pin*/\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;TECg-1736085269832&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;7NUt-1736085269831&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;    gpio_pin_config_t led_config = {\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;H2fE-1736085269834&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;AzQw-1736085269833&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;        kGPIO_DigitalOutput,\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;YwuZ-1736085269836&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;FJAb-1736085269835&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;        0,\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;19xb-1736085269838&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;HfhF-1736085269837&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;    };\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;PfUJ-1736085269840&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;WA2h-1736085269839&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;\t\t\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;BKt3-1736085269842&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;Tc6D-1736085269841&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;\t\t    /* Define the init structure for the input switch pin */\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;QOnJ-1736085269844&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;CZeG-1736085269843&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;    gpio_pin_config_t sw_config = {\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;2sEr-1736085269846&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;qvgv-1736085269845&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;        kGPIO_DigitalInput,\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;yuGr-1736085269848&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;a0Ak-1736085269847&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;        0,\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;JDgq-1736085269850&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;YZHR-1736085269849&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;    };\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;7Q3I-1736085269852&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;4pRk-1736085269851&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;THKx-1736085269854&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;ouEG-1736085269853&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;    /* Board pin, clock, debug console init */\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;JLqi-1736085269856&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;nr89-1736085269855&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;    /* attach FRO 12M to FLEXCOMM4 (debug console) */\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;ypy1-1736085269858&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;eZ0K-1736085269857&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;    CLOCK_SetClkDiv(kCLOCK_DivFlexcom4Clk, 1u);\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;ipRY-1736085269860&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;V4Hs-1736085269859&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;    CLOCK_AttachClk(BOARD_DEBUG_UART_CLK_ATTACH);\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;pKki-1736085269862&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;OquH-1736085269861&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;Ka7i-1736085269864&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;76iu-1736085269863&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;    /* enable clock for GPIO*/\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;UeOM-1736085269866&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;sOVI-1736085269865&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;    CLOCK_EnableClock(kCLOCK_Gpio0);\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;orYL-1736085269868&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;JXnt-1736085269867&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;\t\tCLOCK_EnableClock(kCLOCK_Gpio1);\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;wTqR-1736085269870&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;v2tq-1736085269869&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;cyQm-1736085269872&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;mJcX-1736085269871&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;    BOARD_InitPins();\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;uTF0-1736085269874&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;rGov-1736085269873&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;    BOARD_InitBootClocks();\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;dL7G-1736085269876&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;0IUt-1736085269875&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;    BOARD_InitDebugConsole();\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;VGHM-1736085269878&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;8Lax-1736085269877&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;Q0ye-1736085269880&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;Ie4R-1736085269879&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;    /* Print a note to terminal. */\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;bXMD-1736085269882&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;p72N-1736085269881&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;    PRINTF(\&quot;\\r\\n GPIO Driver example\\r\\n\&quot;);\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;PNf1-1736085269884&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;Ch55-1736085269883&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;    PRINTF(\&quot;\\r\\n The LED is blinking.\\r\\n\&quot;);\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;4kJi-1736085269886&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;dah3-1736085269885&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;    \r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;Nu3J-1736085269888&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;I9Uq-1736085269887&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;\t\tGPIO_SetPinInterruptConfig(BOARD_SW_GPIO, BOARD_SW_GPIO_PIN, kGPIO_InterruptFallingEdge);\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;refa-1736085269890&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;2teS-1736085269889&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;\t\tGPIO_SetPinInterruptConfig(GPIO0, 29, kGPIO_InterruptFallingEdge);\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;dppd-1736085269893&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;vjhL-1736085269892&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;\t\tGPIO_SetPinInterruptChannel(GPIO0, 29,kGPIO_InterruptOutput0);\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;h7l7-1736085269895&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;c7GZ-1736085269894&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;\t\t\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;0oxN-1736085269897&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;PUf1-1736085269896&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;\t\tGPIO_SetPinInterruptConfig(GPIO1, 23, kGPIO_InterruptFallingEdge);\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;eknO-1736085269899&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;nDQX-1736085269898&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;\t\tGPIO_SetPinInterruptChannel(GPIO1, 23,kGPIO_InterruptOutput0);\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;IqDB-1736085269901&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;oNr6-1736085269900&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;\t\t\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;5VjN-1736085269903&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;HwcC-1736085269902&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;\t\t\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;OYiF-1736085269905&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;fAly-1736085269904&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;\t\tEnableIRQ(BOARD_SW_IRQ);\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;8jT2-1736085269907&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;hCJS-1736085269906&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;\t\tEnableIRQ(GPIO10_IRQn);\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;QQ4y-1736085269909&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;pEWo-1736085269908&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;    GPIO_PinInit(BOARD_SW_GPIO, BOARD_SW_GPIO_PIN, &amp;sw_config);\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;dUr2-1736085269911&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;37Tk-1736085269910&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;    GPIO_PinInit(GPIO0, 29, &amp;sw_config);\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;lmnU-1736085269913&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;DtJO-1736085269912&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;\t\tGPIO_PinInit(GPIO1, 23, &amp;sw_config);\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;QFGs-1736085269915&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;vN9q-1736085269914&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;\t\tGPIO_PinInit(BOARD_LED_GPIO, BOARD_LED_GPIO_PIN, &amp;led_config);\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;is0X-1736085269917&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;FRYw-1736085269916&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;\t\tGPIO_PinInit(GPIO0, 25, &amp;led_config);\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;vqqf-1736085269919&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;VAh8-1736085269918&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;    GPIO_PinInit(GPIO0, 26, &amp;led_config);\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;XXvU-1736085269921&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;umXo-1736085269920&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;WgAf-1736085269923&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;MVE4-1736085269922&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;wUcA-1736085269925&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;hUg1-1736085269924&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;    while (1)\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;a5Ey-1736085269927&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;ypIG-1736085269926&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;    {\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;fb3B-1736085269929&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;8o9W-1736085269928&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;//        delay();\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;w3Pm-1736085269931&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;gU0A-1736085269930&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;//       GPIO_PortToggle(BOARD_LED_GPIO, 1u &lt;&lt; BOARD_LED_GPIO_PIN);\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;vcQ9-1736085269933&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;fdC6-1736085269932&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;//\t\t\t GPIO_PortToggle(GPIO0, 1u &lt;&lt; 25);\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;p9uc-1736085269935&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;F2LO-1736085269934&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;//\t\t\t GPIO_PortToggle(GPIO0, 1u &lt;&lt; 26);\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;Wdqp-1736085269937&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;UT1D-1736085269936&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;\t\t\t\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;6isC-1736085269939&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;jGMs-1736085269938&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;\t\t\t if (g_ButtonPress)\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;1KN1-1736085269941&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;6Y6Y-1736085269940&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;        {\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;qJH2-1736085269943&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;7jeS-1736085269942&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;            PRINTF(\&quot; %s is pressed \\r\\n\&quot;, BOARD_SW_NAME);\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;4WLs-1736085269945&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;7zpi-1736085269944&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;            /* Toggle LED. */\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;MQAy-1736085269947&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;xczo-1736085269946&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;            GPIO_PortToggle(BOARD_LED_GPIO, 1U &lt;&lt; BOARD_LED_GPIO_PIN);\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;4s1U-1736085269949&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;TmjK-1736085269948&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;            /* Reset state of button. */\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;UuZE-1736085269951&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;l31Y-1736085269950&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;            g_ButtonPress = false;\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;HAp6-1736085269953&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;TD9C-1736085269952&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;        }\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;RsPD-1736085269955&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;K7OG-1736085269954&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;\t\t\t\t\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;UJiD-1736085269957&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;QDoJ-1736085269956&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;\t\t\t\t if (g_ButtonPress1)\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;5kRB-1736085269959&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;tm8A-1736085269958&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;        {\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;gp95-1736085269961&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;PEmH-1736085269960&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;            PRINTF(\&quot; %s is pressed \\r\\n\&quot;, \&quot;GPIO0_29\&quot;);\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;QUGd-1736085269963&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;UfFp-1736085269962&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;            /* Toggle LED. */\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;gqW4-1736085269965&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;fNib-1736085269964&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;            GPIO_PortToggle(GPIO0, 1u &lt;&lt; 25);\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;3vOv-1736085269967&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;cYjn-1736085269966&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;            /* Reset state of button. */\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;CPiC-1736085269969&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;UwmJ-1736085269968&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;            g_ButtonPress1 = false;\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;6XRY-1736085269971&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;4UFH-1736085269970&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;        }\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;AjPR-1736085269973&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;olKW-1736085269972&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;\t\t\t\t\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;oO3v-1736085269975&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;gsBc-1736085269974&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;\t\t\t\tif (g_ButtonPress2)\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;byF4-1736085269977&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;hEBw-1736085269976&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;        {\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;9UCj-1736085269979&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;zvjT-1736085269978&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;            PRINTF(\&quot; %s is pressed \\r\\n\&quot;, \&quot;GPIO0_23\&quot;);\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;AU90-1736085269981&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;v3AF-1736085269980&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;            /* Toggle LED. */\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;sJnu-1736085269983&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;wGRZ-1736085269982&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;            GPIO_PortToggle(GPIO0, 1u &lt;&lt; 26);\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;494W-1736085269985&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;upl5-1736085269984&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;            /* Reset state of button. */\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;JG6B-1736085269987&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;2kFq-1736085269986&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;            g_ButtonPress2 = false;\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;gXTg-1736085269989&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;OQBz-1736085269988&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;        }\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;aJUI-1736085269991&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;bqKh-1736085269990&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;    }\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;Ir5q-1736085269993&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;BtUT-1736085269992&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;}\r&quot;,&quot;marks&quot;:[]}]}]},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;MCFO-1736085269995&quot;,&quot;name&quot;:&quot;code-line&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;Dw6s-1736085269994&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;&quot;,&quot;marks&quot;:[]}]}]}],&quot;state&quot;:{}}]">
<p>&nbsp;</p>

<p>5abca5892f45a06eeeed506b9a4b77c6<br />
&nbsp;</p>

<p><strong>引言</strong></p>

<p>欢迎来到本次的技术分享!今天,我们将一起探讨一个基于NXP MCUXpresso SDK开发的GPIO(通用输入输出)控制与中断处理示例程序。这个程序展示了如何通过配置GPIO引脚来实现LED灯的闪烁以及按钮按下时的中断响应。</p>

<p><strong>程序概述</strong></p>

<p>该程序主要实现了以下功能:</p>

<ol yne-block-type="list">
        <li>LED灯控制:通过GPIO引脚控制板载LED灯的闪烁。</li>
        <li>按钮中断处理:配置GPIO引脚为中断输入,当按钮被按下时,触发中断并响应相应的动作(如切换LED灯状态)。</li>
</ol>

<p><strong>关键组件与配置</strong></p>

<article data-content="[{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;5CaP-1733974035579&quot;,&quot;name&quot;:&quot;heading&quot;,&quot;data&quot;:{&quot;level&quot;:&quot;h5&quot;},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;q4jo-1733974035580&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;外部中断号&quot;,&quot;marks&quot;:[{&quot;type&quot;:&quot;bold&quot;}]}]}],&quot;state&quot;:{}},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;r6jc-1736082273792&quot;,&quot;name&quot;:&quot;paragraph&quot;,&quot;data&quot;:{&quot;version&quot;:1},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;Zn17-1736082273790&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;          一组GPIO 可以使能2个中断&quot;,&quot;marks&quot;:[{&quot;type&quot;:&quot;bold&quot;}]}]}],&quot;state&quot;:{}}]">
<p>外部中断号</p>

<p>一组GPIO 可以使能2个中断</p>
</article>
</article>
</div>

<div id="Aqow-1736085835316" yne-bulb-block="heading" yne-bulb-level="4"> &nbsp;</div>

<div yne-bulb-block="heading" yne-bulb-level="4">
<article data-content="[{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;fvnp-1733974566847&quot;,&quot;name&quot;:&quot;heading&quot;,&quot;data&quot;:{&quot;level&quot;:&quot;h5&quot;},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;pjo1-1733974566845&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;ISF  中断状态标志&quot;,&quot;marks&quot;:[{&quot;type&quot;:&quot;bold&quot;},{&quot;type&quot;:&quot;fontSize&quot;,&quot;value&quot;:16}]}]}]}]">
<p>ISF 中断状态标志</p>
</article>
</div>

<div yne-bulb-block="heading" yne-bulb-level="4"> &nbsp;</div>

<div yne-bulb-block="heading" yne-bulb-level="4">
<article data-content="[{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;LuaW-1734067000468&quot;,&quot;name&quot;:&quot;paragraph&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;nlMw-1734067000469&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;GPIO_PinGetInterruptFlag:&quot;,&quot;marks&quot;:[{&quot;type&quot;:&quot;fontSize&quot;,&quot;value&quot;:14},{&quot;type&quot;:&quot;fontFamily&quot;,&quot;value&quot;:&quot;SimHei&quot;},{&quot;type&quot;:&quot;bold&quot;}]},{&quot;text&quot;:&quot;读单个引脚的中断状态标志&quot;,&quot;marks&quot;:[{&quot;type&quot;:&quot;color&quot;,&quot;value&quot;:&quot;#2a2b2e&quot;},{&quot;type&quot;:&quot;backgroundColor&quot;,&quot;value&quot;:&quot;rgb(255, 255, 255)&quot;},{&quot;type&quot;:&quot;fontSize&quot;,&quot;value&quot;:14},{&quot;type&quot;:&quot;fontFamily&quot;,&quot;value&quot;:&quot;SimHei&quot;},{&quot;type&quot;:&quot;bold&quot;}]}]}],&quot;state&quot;:{}}]">
<p>GPIO_PinGetInterruptFlag:读单个引脚的中断状态标志</p>

<p>&nbsp;</p>

<pre>
<code>
#define GPIO_ICR_ISF_SHIFT                     (24U)

/*!
* brief Read individual pin's interrupt status flag.
*
* param base GPIO peripheral base pointer. (GPIOA, GPIOB, GPIOC, and so on)
* param pin GPIO specific pin number.
* return The current selected pin's interrupt status flag.
*/
uint8_t GPIO_PinGetInterruptFlag(GPIO_Type *base, uint32_t pin)
{
    return (uint8_t)((base-&gt;ICR &amp; GPIO_ICR_ISF_MASK) &gt;&gt; GPIO_ICR_ISF_SHIFT);
}</code></pre>

<article data-content="[{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;Rfv7-1736055668229&quot;,&quot;name&quot;:&quot;heading&quot;,&quot;data&quot;:{&quot;version&quot;:1,&quot;level&quot;:&quot;h4&quot;,&quot;style&quot;:{&quot;lineHeight&quot;:&quot;1.7&quot;}},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;MxAo-1736055668227&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;程序结构详解&quot;,&quot;marks&quot;:[]}]}],&quot;state&quot;:{}},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;AbGE-1736084245127&quot;,&quot;name&quot;:&quot;list-item&quot;,&quot;data&quot;:{&quot;version&quot;:1,&quot;listId&quot;:&quot;Fd2e-1736084245994&quot;,&quot;listLevel&quot;:1,&quot;listType&quot;:&quot;ordered&quot;,&quot;style&quot;:{&quot;lineHeight&quot;:&quot;1.7&quot;}},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;gmQV-1736084245128&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;头文件包含:&quot;,&quot;marks&quot;:[]}]}],&quot;state&quot;:{&quot;index&quot;:1}},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;o6fr-1736084245987&quot;,&quot;name&quot;:&quot;list-item&quot;,&quot;data&quot;:{&quot;version&quot;:1,&quot;listId&quot;:&quot;tNMT-1736084245995&quot;,&quot;listLevel&quot;:2,&quot;listType&quot;:&quot;unordered&quot;,&quot;style&quot;:{&quot;lineHeight&quot;:&quot;1.7&quot;}},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;KGHi-1736084245986&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;包含了必要的头文件,如&quot;,&quot;marks&quot;:[]},{&quot;text&quot;:&quot;fsl_debug_console.h&quot;,&quot;marks&quot;:[{&quot;type&quot;:&quot;backgroundColor&quot;,&quot;value&quot;:&quot;rgba(27, 31, 35, 0.05)&quot;},{&quot;type&quot;:&quot;fontSize&quot;,&quot;value&quot;:12},{&quot;type&quot;:&quot;fontFamily&quot;,&quot;value&quot;:&quot;Courier New&quot;}]},{&quot;text&quot;:&quot;用于调试输出,&quot;,&quot;marks&quot;:[]},{&quot;text&quot;:&quot;fsl_gpio.h&quot;,&quot;marks&quot;:[{&quot;type&quot;:&quot;backgroundColor&quot;,&quot;value&quot;:&quot;rgba(27, 31, 35, 0.05)&quot;},{&quot;type&quot;:&quot;fontSize&quot;,&quot;value&quot;:12},{&quot;type&quot;:&quot;fontFamily&quot;,&quot;value&quot;:&quot;Courier New&quot;}]},{&quot;text&quot;:&quot;用于GPIO控制等。&quot;,&quot;marks&quot;:[]}]}],&quot;state&quot;:{}}]">
<p>程序结构详解</p>

<ol yne-block-type="list">
        <li>头文件包含:</li>
</ol>

<ul yne-block-type="list">
        <li>包含了必要的头文件,如fsl_debug_console.h用于调试输出,fsl_gpio.h用于GPIO控制等。</li>
</ul>

<pre>
<code>#include "fsl_debug_console.h"
#if defined(FSL_FEATURE_SOC_PORT_COUNT) &amp;&amp; (FSL_FEATURE_SOC_PORT_COUNT)
#include "fsl_port.h"
#endif
#include "fsl_gpio.h"
#include "fsl_common.h"
#include "pin_mux.h"
#include "clock_config.h"
#include "board.h"</code></pre>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>2.宏定义与变量声明:</p>
</article>
</article>
</div>

<div yne-bulb-block="heading" yne-bulb-level="4">
<article data-content="[{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;oAmg-1736084245989&quot;,&quot;name&quot;:&quot;list-item&quot;,&quot;data&quot;:{&quot;version&quot;:1,&quot;listId&quot;:&quot;Fd2e-1736084245994&quot;,&quot;listLevel&quot;:1,&quot;listType&quot;:&quot;ordered&quot;,&quot;style&quot;:{&quot;lineHeight&quot;:&quot;1.7&quot;}},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;jUec-1736084245988&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;宏定义与变量声明:&quot;,&quot;marks&quot;:[]}]}],&quot;state&quot;:{}}]">
<article data-content="[{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;qNxs-1736084245991&quot;,&quot;name&quot;:&quot;list-item&quot;,&quot;data&quot;:{&quot;version&quot;:1,&quot;listId&quot;:&quot;UsuB-1736084245996&quot;,&quot;listLevel&quot;:2,&quot;listType&quot;:&quot;unordered&quot;,&quot;style&quot;:{&quot;lineHeight&quot;:&quot;1.7&quot;}},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;eqQr-1736084245990&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;定义了LED和按钮对应的GPIO引脚。&quot;,&quot;marks&quot;:[]}]}],&quot;state&quot;:{}},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;Wa0x-1736084245993&quot;,&quot;name&quot;:&quot;list-item&quot;,&quot;data&quot;:{&quot;version&quot;:1,&quot;listId&quot;:&quot;UsuB-1736084245996&quot;,&quot;listLevel&quot;:2,&quot;listType&quot;:&quot;unordered&quot;,&quot;style&quot;:{&quot;lineHeight&quot;:&quot;1.7&quot;}},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;ZrXF-1736084245992&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;声明了用于标记按钮按下状态的变量。&quot;,&quot;marks&quot;:[]}]}],&quot;state&quot;:{}}]">
<article data-content="[{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;BEsd-1736084879944&quot;,&quot;name&quot;:&quot;paragraph&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;hkfK-1736084879945&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;3.中断服务函数实现:&quot;,&quot;marks&quot;:[{&quot;type&quot;:&quot;color&quot;,&quot;value&quot;:&quot;#05073b&quot;},{&quot;type&quot;:&quot;backgroundColor&quot;,&quot;value&quot;:&quot;rgb(253, 253, 254)&quot;},{&quot;type&quot;:&quot;fontSize&quot;,&quot;value&quot;:15},{&quot;type&quot;:&quot;fontFamily&quot;,&quot;value&quot;:&quot;Arial&quot;}]}]}],&quot;state&quot;:{}}]">
<article data-content="[{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;qNxs-1736084245991&quot;,&quot;name&quot;:&quot;list-item&quot;,&quot;data&quot;:{&quot;version&quot;:1,&quot;listId&quot;:&quot;UsuB-1736084245996&quot;,&quot;listLevel&quot;:2,&quot;listType&quot;:&quot;unordered&quot;,&quot;style&quot;:{&quot;lineHeight&quot;:&quot;1.7&quot;}},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;eqQr-1736084245990&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;定义了LED和按钮对应的GPIO引脚。&quot;,&quot;marks&quot;:[]}]}],&quot;state&quot;:{}},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;Wa0x-1736084245993&quot;,&quot;name&quot;:&quot;list-item&quot;,&quot;data&quot;:{&quot;version&quot;:1,&quot;listId&quot;:&quot;UsuB-1736084245996&quot;,&quot;listLevel&quot;:2,&quot;listType&quot;:&quot;unordered&quot;,&quot;style&quot;:{&quot;lineHeight&quot;:&quot;1.7&quot;}},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;ZrXF-1736084245992&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;声明了用于标记按钮按下状态的变量。&quot;,&quot;marks&quot;:[]}]}],&quot;state&quot;:{}}]">
<p>&nbsp;</p>

<ol>
        <li>定义了LED和按钮对应的GPIO引脚。</li>
        <li>声明了用于标记按钮按下状态的变量。</li>
</ol>
</article>

<p>3.中断服务函数实现:</p>

<pre>
<code>*!
* <a href="home.php?mod=space&amp;uid=159083" target="_blank">@brief </a> Interrupt service fuction of switch.
*
* This function toggles the LED
*/
void BOARD_SW_IRQ_HANDLER(void)
{
        if(GPIO_PinGetInterruptFlag(GPIO0,6))
        {
           #if (defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) &amp;&amp; FSL_FEATURE_PORT_HAS_NO_INTERRUPT) || \
    (!defined(FSL_FEATURE_SOC_PORT_COUNT))
    /* Clear external interrupt flag. */
    GPIO_GpioClearInterruptFlags(BOARD_SW_GPIO, 1U &lt;&lt; BOARD_SW_GPIO_PIN);
    #else
    /* Clear external interrupt flag. */
    GPIO_PortClearInterruptFlags(BOARD_SW_GPIO, 1U &lt;&lt; BOARD_SW_GPIO_PIN);
    #endif
    /* Change state of button. */
    g_ButtonPress = true;
       
        }
       
        if(GPIO_PinGetInterruptFlag(GPIO0,29))
        {
           #if (defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) &amp;&amp; FSL_FEATURE_PORT_HAS_NO_INTERRUPT) || \
    (!defined(FSL_FEATURE_SOC_PORT_COUNT))
    /* Clear external interrupt flag. */
    GPIO_GpioClearInterruptFlags(GPIO0, 1U &lt;&lt; 29);
    #else
    /* Clear external interrupt flag. */
    GPIO_PortClearInterruptFlags(BOARD_SW_GPIO, 1U &lt;&lt; BOARD_SW_GPIO_PIN);
    #endif
    /* Change state of button. */
    g_ButtonPress1 = true;
       
        }
       
        if(GPIO_PinGetInterruptFlag(GPIO1,23))
        {
           #if (defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) &amp;&amp; FSL_FEATURE_PORT_HAS_NO_INTERRUPT) || \
    (!defined(FSL_FEATURE_SOC_PORT_COUNT))
    /* Clear external interrupt flag. */
    GPIO_GpioClearInterruptFlags(GPIO1, 1U &lt;&lt; 23);
    #else
    /* Clear external interrupt flag. */
    GPIO_PortClearInterruptFlags(BOARD_SW_GPIO, 1U &lt;&lt; BOARD_SW_GPIO_PIN);
    #endif
    /* Change state of button. */
    g_ButtonPress2 = true;
       
        }

    SDK_ISR_EXIT_BARRIER;
}

void GPIO10_IRQHandler(void)
{

       
        if(GPIO_PinGetInterruptFlag(GPIO1,23))
        {
          
    /* Clear external interrupt flag. */
    GPIO_GpioClearInterruptFlags(GPIO1, 1U &lt;&lt; 23);
   
    /* Change state of button. */
    g_ButtonPress2 = true;
       
        }

    SDK_ISR_EXIT_BARRIER;
}</code></pre>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<article data-content="[{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;Y1Ha-1736055668504&quot;,&quot;name&quot;:&quot;paragraph&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;GMex-1736055668502&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;&quot;,&quot;marks&quot;:[]}]}],&quot;state&quot;:{}},{&quot;type&quot;:&quot;block&quot;,&quot;id&quot;:&quot;eARf-1736085263467&quot;,&quot;name&quot;:&quot;paragraph&quot;,&quot;data&quot;:{},&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;yEiQ-1736085263465&quot;,&quot;leaves&quot;:[{&quot;text&quot;:&quot;4.主函数实现:&quot;,&quot;marks&quot;:[{&quot;type&quot;:&quot;color&quot;,&quot;value&quot;:&quot;#05073b&quot;},{&quot;type&quot;:&quot;backgroundColor&quot;,&quot;value&quot;:&quot;rgb(253, 253, 254)&quot;},{&quot;type&quot;:&quot;fontSize&quot;,&quot;value&quot;:15},{&quot;type&quot;:&quot;fontFamily&quot;,&quot;value&quot;:&quot;Arial&quot;}]}]}],&quot;state&quot;:{}}]">
<p>4.主函数实现:</p>
</article>

<pre>
<code>/*!
* @brief Main function
*/
int main(void)
{
    /* Define the init structure for the output LED pin*/
    gpio_pin_config_t led_config = {
      kGPIO_DigitalOutput,
      0,
    };
               
                  /* Define the init structure for the input switch pin */
    gpio_pin_config_t sw_config = {
      kGPIO_DigitalInput,
      0,
    };

    /* Board pin, clock, debug console init */
    /* attach FRO 12M to FLEXCOMM4 (debug console) */
    CLOCK_SetClkDiv(kCLOCK_DivFlexcom4Clk, 1u);
    CLOCK_AttachClk(BOARD_DEBUG_UART_CLK_ATTACH);

    /* enable clock for GPIO*/
    CLOCK_EnableClock(kCLOCK_Gpio0);
                CLOCK_EnableClock(kCLOCK_Gpio1);

    BOARD_InitPins();
    BOARD_InitBootClocks();
    BOARD_InitDebugConsole();

    /* Print a note to terminal. */
    PRINTF("\r\n GPIO Driver example\r\n");
    PRINTF("\r\n The LED is blinking.\r\n");
   
                GPIO_SetPinInterruptConfig(BOARD_SW_GPIO, BOARD_SW_GPIO_PIN, kGPIO_InterruptFallingEdge);
                GPIO_SetPinInterruptConfig(GPIO0, 29, kGPIO_InterruptFallingEdge);
                GPIO_SetPinInterruptChannel(GPIO0, 29,kGPIO_InterruptOutput0);
               
                GPIO_SetPinInterruptConfig(GPIO1, 23, kGPIO_InterruptFallingEdge);
                GPIO_SetPinInterruptChannel(GPIO1, 23,kGPIO_InterruptOutput0);
               
               
                EnableIRQ(BOARD_SW_IRQ);
                EnableIRQ(GPIO10_IRQn);
    GPIO_PinInit(BOARD_SW_GPIO, BOARD_SW_GPIO_PIN, &amp;sw_config);
    GPIO_PinInit(GPIO0, 29, &amp;sw_config);
                GPIO_PinInit(GPIO1, 23, &amp;sw_config);
                GPIO_PinInit(BOARD_LED_GPIO, BOARD_LED_GPIO_PIN, &amp;led_config);
                GPIO_PinInit(GPIO0, 25, &amp;led_config);
    GPIO_PinInit(GPIO0, 26, &amp;led_config);


    while (1)
    {
//      delay();
//       GPIO_PortToggle(BOARD_LED_GPIO, 1u &lt;&lt; BOARD_LED_GPIO_PIN);
//                       GPIO_PortToggle(GPIO0, 1u &lt;&lt; 25);
//                       GPIO_PortToggle(GPIO0, 1u &lt;&lt; 26);
                       
                       if (g_ButtonPress)
      {
            PRINTF(" %s is pressed \r\n", BOARD_SW_NAME);
            /* Toggle LED. */
            GPIO_PortToggle(BOARD_LED_GPIO, 1U &lt;&lt; BOARD_LED_GPIO_PIN);
            /* Reset state of button. */
            g_ButtonPress = false;
      }
                               
                               if (g_ButtonPress1)
      {
            PRINTF(" %s is pressed \r\n", "GPIO0_29");
            /* Toggle LED. */
            GPIO_PortToggle(GPIO0, 1u &lt;&lt; 25);
            /* Reset state of button. */
            g_ButtonPress1 = false;
      }
                               
                                if (g_ButtonPress2)
      {
            PRINTF(" %s is pressed \r\n", "GPIO0_23");
            /* Toggle LED. */
            GPIO_PortToggle(GPIO0, 1u &lt;&lt; 26);
            /* Reset state of button. */
            g_ButtonPress2 = false;
      }
    }
}
</code></pre>
</article>

<p>附:源文件</p>

<div></div>
</article>
</article>
</div>

秦天qintian0303 发表于 2025-1-8 09:13

<p>不同的IDE其实用的解释器都是一样的,只不过写法不同,这个是需要适应的地方</p>
页: [1]
查看完整版本: 基于NXP MCUXpresso SDK的GPIO控制与中断处理示例