{"id":2480,"date":"2024-04-20T14:49:51","date_gmt":"2024-04-20T14:49:51","guid":{"rendered":"https:\/\/blog.embeddedexpert.io\/?p=2480"},"modified":"2024-04-20T14:49:53","modified_gmt":"2024-04-20T14:49:53","slug":"getting-started-with-stm32g0-and-stm32cubeide-external-interrupt","status":"publish","type":"post","link":"https:\/\/blog.embeddedexpert.io\/?p=2480","title":{"rendered":"Getting Started with STM32G0 and STM32CubeIDE: External Interrupt"},"content":{"rendered":"\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"400\" height=\"400\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/pt156578902-100_original_arm_mcu_stm32g070kbt6_stm32g070_stm32g_lqfp_32_microcontroller.jpg-2-4-2.webp\" alt=\"\" class=\"wp-image-2481\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/pt156578902-100_original_arm_mcu_stm32g070kbt6_stm32g070_stm32g_lqfp_32_microcontroller.jpg-2-4-2.webp 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/pt156578902-100_original_arm_mcu_stm32g070kbt6_stm32g070_stm32g_lqfp_32_microcontroller.jpg-2-4-2-300x300.webp 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/pt156578902-100_original_arm_mcu_stm32g070kbt6_stm32g070_stm32g_lqfp_32_microcontroller.jpg-2-4-2-150x150.webp 150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/pt156578902-100_original_arm_mcu_stm32g070kbt6_stm32g070_stm32g_lqfp_32_microcontroller.jpg-2-4-2-250x250.webp 250w\" sizes=\"(max-width: 400px) 100vw, 400px\" \/><\/figure><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>In this guide, we shall see what is external interrupt and develop a driver to detect the interrupt from external push-button using HAL API on STM32G070.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>In this guide, we shall cover the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>What is external interrupt.<\/li><li>Developing external interrupt driver.<\/li><li>Connection<\/li><li>Results.<\/li><\/ul>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1. What is External Interrupt:<\/h2>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">External Interrupts :&nbsp;<\/h3>\n\n\n\n<p>External interrupts come from input-output I\/O devices.&nbsp;<\/p>\n\n\n\n<p><strong>Some examples that cause external interrupts:&nbsp;<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>&nbsp;I\/O devices requesting transfer of data&nbsp;<\/li><li>&nbsp;I\/O devices finished the transfer of data. When a program executes in an endless loop and thus exceeds its time limit, an external interrupt occurs which is Timeout Interrupt.<\/li><li>While transferring the CPU\u2019s complete state to a non-destructive memory in a few milliseconds before power ceases, then an external interrupt occurs.<\/li><\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Advantages of External Interrupts<\/h4>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Increased Flexibility:&nbsp;<\/strong>External interrupts allow a system to respond to external events, such as a user input or an external sensor, in real-time. This can greatly improve the system\u2019s flexibility, as it is not limited to a fixed operating cycle.<\/li><li><strong>Ability to Respond to External Events:&nbsp;<\/strong>External interrupts provide a mechanism for the system to respond to external events that may occur at any time. This allows the system to perform tasks in response to changes in the environment, such as user input or incoming data, without the need for continuous monitoring.<\/li><li><strong>Improved Performance and Efficiency:&nbsp;<\/strong>By allowing the system to respond to external events in real-time, external interrupts can greatly improve the system\u2019s performance and efficiency, as it is not bogged down by continuous monitoring for changes.<\/li><\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Applications of External Interrupts<\/h4>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Input Devices:&nbsp;<\/strong>External interrupts are commonly used in input devices, such as keyboards, mice, and touchpads, to respond to user input in real-time.<\/li><li><strong>Data Acquisition Systems:&nbsp;<\/strong>External interrupts can be used in data acquisition systems to respond to incoming data and process it in real-time.<\/li><li><strong>Robotics:&nbsp;<\/strong>External interrupts can be used in robotics systems to respond to external events, such as sensor inputs or user commands.<\/li><li><strong>Real-time Systems:&nbsp;<\/strong>External interrupts are commonly used in real-time systems, such as process control systems and medical equipment, to provide a mechanism for responding to external events in real-time.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">2. Developing external interrupt driver:<\/h2>\n\n\n\n<p><\/p>\n\n\n\n<p>We start off by creating a new project with name of external_interrupt, for how to create new project on STM32G070, please refer to <a href=\"https:\/\/blog.embeddedexpert.io\/?p=2299\" data-type=\"URL\" data-id=\"https:\/\/blog.embeddedexpert.io\/?p=2299\" target=\"_blank\" rel=\"noreferrer noopener\">this guide here<\/a>.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Then select pin PA0 as external interrupt as following:<\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"600\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/2024-04-20_16-58-01-1024x600.jpg\" alt=\"\" class=\"wp-image-2482\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/2024-04-20_16-58-01-1024x600.jpg 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/2024-04-20_16-58-01-300x176.jpg 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/2024-04-20_16-58-01-768x450.jpg 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/2024-04-20_16-58-01-1536x900.jpg 1536w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/2024-04-20_16-58-01-2048x1200.jpg 2048w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/2024-04-20_16-58-01-1150x674.jpg 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/2024-04-20_16-58-01-750x439.jpg 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/2024-04-20_16-58-01-400x234.jpg 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/2024-04-20_16-58-01-250x146.jpg 250w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Then from System Core then GPIO, set the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>GPIO mode to External Interrupt Mode with falling edge trigger detection (you could use rising edge since it depends on your application).<\/li><li>Enable the Pull-up.<\/li><\/ul>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"637\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/2024-04-20_17-19-07-1024x637.jpg\" alt=\"\" class=\"wp-image-2483\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/2024-04-20_17-19-07-1024x637.jpg 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/2024-04-20_17-19-07-300x187.jpg 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/2024-04-20_17-19-07-768x478.jpg 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/2024-04-20_17-19-07-1536x955.jpg 1536w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/2024-04-20_17-19-07-2048x1274.jpg 2048w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/2024-04-20_17-19-07-1150x715.jpg 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/2024-04-20_17-19-07-750x466.jpg 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/2024-04-20_17-19-07-400x249.jpg 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/2024-04-20_17-19-07-250x155.jpg 250w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Then from NVIC, enable EXTI0_1 as following:<\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"599\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/2024-04-20_17-18-17-1024x599.jpg\" alt=\"\" class=\"wp-image-2484\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/2024-04-20_17-18-17-1024x599.jpg 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/2024-04-20_17-18-17-300x176.jpg 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/2024-04-20_17-18-17-768x449.jpg 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/2024-04-20_17-18-17-1536x899.jpg 1536w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/2024-04-20_17-18-17-2048x1199.jpg 2048w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/2024-04-20_17-18-17-1150x673.jpg 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/2024-04-20_17-18-17-750x439.jpg 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/2024-04-20_17-18-17-400x234.jpg 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/2024-04-20_17-18-17-250x146.jpg 250w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Also, enable the uart2, you can check this guide for how to enable the UART from <a href=\"https:\/\/blog.embeddedexpert.io\/?p=2316\" data-type=\"URL\" data-id=\"https:\/\/blog.embeddedexpert.io\/?p=2316\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>. <\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>That all for the configuration. Save the project and this shall generate the code.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>In main.c file:<\/p>\n\n\n\n<p>In User begin include, include the stdio header file as following:<\/p>\n\n\n\n<p><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">\/* USER CODE BEGIN Includes *\/\n#include &quot;stdio.h&quot;\n\/* USER CODE END Includes *\/<\/pre><\/div>\n\n\n\n<p>Within user begin PV, declare the following:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">\/* USER CODE BEGIN PV *\/\nvolatile uint8_t interrupted=0;\nuint8_t uart_buffer[50];\n\/* USER CODE END PV *\/<\/pre><\/div>\n\n\n\n<p>The volatile will force the compiler to not optimized the variable and it it could be updated at any time.<\/p>\n\n\n\n<p>second one is just buffer to hold the data to be transmitted.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>In while 1 loop, user code begin 3:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">\t  if(interrupted==1)\n\t  {\n\t\t  uint16_t len;\n\t\t  len = sprintf(uart_buffer, &quot;Interrupt detected\\r\\n&quot;);\n\t\t  HAL_UART_Transmit(&amp;huart2, uart_buffer, len, 100);\n\t\t  interrupted=0;\n\n\t  }<\/pre><\/div>\n\n\n\n<p>If there is a pending interrupt, print an interrupt detected and reset the variable back to zero.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>In STm32G0xx_it.c file:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"549\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/2024-04-20_17-43-27-1024x549.jpg\" alt=\"\" class=\"wp-image-2485\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/2024-04-20_17-43-27-1024x549.jpg 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/2024-04-20_17-43-27-300x161.jpg 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/2024-04-20_17-43-27-768x412.jpg 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/2024-04-20_17-43-27-1536x823.jpg 1536w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/2024-04-20_17-43-27-2048x1098.jpg 2048w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/2024-04-20_17-43-27-1150x616.jpg 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/2024-04-20_17-43-27-750x402.jpg 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/2024-04-20_17-43-27-400x214.jpg 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/2024-04-20_17-43-27-250x134.jpg 250w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>In user code  begin PV, declare the volatile as extern as following:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">extern volatile uint8_t interrupted;<\/pre><\/div>\n\n\n\n<p>In EXTI_0_1 interrupt handler function, in user code begin 1 of the function, set the variable to 1 as following:<\/p>\n\n\n\n<p><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">interrupted=1;<\/pre><\/div>\n\n\n\n<p>Thats all, save the project, build and run it on your MCU.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">3. Connection:<\/h2>\n\n\n\n<p><\/p>\n\n\n\n<p>The connection as following:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"648\" height=\"1024\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-20-at-5.27.05\u202fPM-648x1024.png\" alt=\"\" class=\"wp-image-2486\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-20-at-5.27.05\u202fPM-648x1024.png 648w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-20-at-5.27.05\u202fPM-190x300.png 190w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-20-at-5.27.05\u202fPM-768x1214.png 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-20-at-5.27.05\u202fPM-972x1536.png 972w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-20-at-5.27.05\u202fPM-1150x1817.png 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-20-at-5.27.05\u202fPM-750x1185.png 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-20-at-5.27.05\u202fPM-400x632.png 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-20-at-5.27.05\u202fPM-250x395.png 250w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-20-at-5.27.05\u202fPM.png 1172w\" sizes=\"(max-width: 648px) 100vw, 648px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">4. Results:<\/h2>\n\n\n\n<p><\/p>\n\n\n\n<p>Press the push-button and you should get the following:<\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"736\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-20-at-5.25.02\u202fPM-1024x736.png\" alt=\"\" class=\"wp-image-2487\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-20-at-5.25.02\u202fPM-1024x736.png 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-20-at-5.25.02\u202fPM-300x216.png 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-20-at-5.25.02\u202fPM-768x552.png 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-20-at-5.25.02\u202fPM-1150x826.png 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-20-at-5.25.02\u202fPM-750x539.png 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-20-at-5.25.02\u202fPM-400x287.png 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-20-at-5.25.02\u202fPM-250x180.png 250w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-20-at-5.25.02\u202fPM.png 1172w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Happy coding \ud83d\ude09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this guide, we shall see what is external interrupt and develop a driver to detect the interrupt from external push-button using HAL API on STM32G070. In this guide, we shall cover the following: What is external interrupt. Developing external interrupt driver. Connection Results. 1. What is External Interrupt: External Interrupts :&nbsp; External interrupts come [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,11,12],"tags":[],"class_list":["post-2480","post","type-post","status-publish","format-standard","hentry","category-embedded-systems","category-peripheral-drivers","category-stm32"],"_links":{"self":[{"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/posts\/2480"}],"collection":[{"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2480"}],"version-history":[{"count":1,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/posts\/2480\/revisions"}],"predecessor-version":[{"id":2488,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/posts\/2480\/revisions\/2488"}],"wp:attachment":[{"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2480"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2480"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2480"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}