{"id":1883,"date":"2023-07-09T05:33:22","date_gmt":"2023-07-09T05:33:22","guid":{"rendered":"https:\/\/blog.embeddedexpert.io\/?p=1883"},"modified":"2023-07-09T05:33:51","modified_gmt":"2023-07-09T05:33:51","slug":"building-board-support-package-bsp-for-stm32f411-nucleo64-part4-gpio-in-alternate-function","status":"publish","type":"post","link":"https:\/\/blog.embeddedexpert.io\/?p=1883","title":{"rendered":"Building Board Support Package (BSP) for STM32F411-Nucleo64 Part4: GPIO In Alternate Function"},"content":{"rendered":"\n<p><\/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=\"683\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/AdobeStock_128586024-2-1024x683.jpeg\" alt=\"\" class=\"wp-image-1884\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/AdobeStock_128586024-2-1024x683.jpeg 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/AdobeStock_128586024-2-300x200.jpeg 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/AdobeStock_128586024-2-768x512.jpeg 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/AdobeStock_128586024-2-1536x1024.jpeg 1536w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/AdobeStock_128586024-2-2048x1365.jpeg 2048w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/AdobeStock_128586024-2-1150x767.jpeg 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/AdobeStock_128586024-2-750x500.jpeg 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/AdobeStock_128586024-2-400x267.jpeg 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/AdobeStock_128586024-2-250x167.jpeg 250w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>In the previous part of this guide (<a rel=\"noreferrer noopener\" href=\"https:\/\/blog.embeddedexpert.io\/?p=1879\" data-type=\"URL\" data-id=\"https:\/\/blog.embeddedexpert.io\/?p=1879\" target=\"_blank\">here<\/a>), we took a look at how to configure the SysTick to generate ticks for the system for timing, delay etc. Also, in part 1 (<a rel=\"noreferrer noopener\" href=\"https:\/\/blog.embeddedexpert.io\/?p=1858\" data-type=\"URL\" data-id=\"https:\/\/blog.embeddedexpert.io\/?p=1858\" target=\"_blank\">here<\/a>), we saw how to configure the GPIO in analog mode, input and output. In this guide, we shall see how to configure the pin in alternate functuon.<\/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>GPIO configuration in alternate mode.<\/li><li>Code.<\/li><li>Results.<\/li><\/ul>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1. GPIO Configuration in alternate function:<\/h2>\n\n\n\n<p><\/p>\n\n\n\n<p>Within the following function , bsp.c source code:<\/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;}\">void GPIO_Initialization(GPIO_TypeDef *GPIO,GPIO_Configure_Typedef * GPIO_Config)<\/pre><\/div>\n\n\n\n<p>We shall check if the pin mode is alternate function 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;}\">if (GPIO_Config-&gt;Mode == Alternate_function)<\/pre><\/div>\n\n\n\n<p>If it is, set the required pin mode to 00 (general purpose input) 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;}\">GPIO-&gt;MODER &amp;=~((0x03&lt;&lt;(GPIO_Config-&gt;PinNumber*2)));<\/pre><\/div>\n\n\n\n<p>Set the mode:<\/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;}\">GPIO-&gt;MODER|= (GPIO_Config-&gt;Mode&lt;&lt; GPIO_Config-&gt;PinNumber*2);<\/pre><\/div>\n\n\n\n<p>Set the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Speed.<\/li><li>Pull up pull down.<\/li><li>Output type.<\/li><\/ul>\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\tGPIO-&gt;OTYPER|= (GPIO_Config-&gt;OutputType&lt;&lt;GPIO_Config-&gt;PinNumber);\n\n\t\tGPIO-&gt;OSPEEDR|= (GPIO_Config-&gt;OutPutspeed&lt;&lt; GPIO_Config-&gt;PinNumber*2);\n\n\t\tGPIO-&gt;PUPDR|= (GPIO_Config-&gt;PullUp_PullDown&lt;&lt; GPIO_Config-&gt;PinNumber*2);<\/pre><\/div>\n\n\n\n<p>Now, we shall set the type of the alternate function.<\/p>\n\n\n\n<p>First check if the pin between 0 and 7 or between 8 and 15.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>The reason behind this checking since the AFR register is divided in low and high part as following:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"341\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-09-at-8.17.07-AM-1024x341.png\" alt=\"\" class=\"wp-image-1885\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-09-at-8.17.07-AM-1024x341.png 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-09-at-8.17.07-AM-300x100.png 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-09-at-8.17.07-AM-768x256.png 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-09-at-8.17.07-AM-1536x512.png 1536w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-09-at-8.17.07-AM-2048x683.png 2048w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-09-at-8.17.07-AM-1150x383.png 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-09-at-8.17.07-AM-750x250.png 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-09-at-8.17.07-AM-400x133.png 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-09-at-8.17.07-AM-250x83.png 250w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/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=\"341\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-09-at-8.17.15-AM-1024x341.png\" alt=\"\" class=\"wp-image-1886\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-09-at-8.17.15-AM-1024x341.png 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-09-at-8.17.15-AM-300x100.png 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-09-at-8.17.15-AM-768x256.png 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-09-at-8.17.15-AM-1536x512.png 1536w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-09-at-8.17.15-AM-2048x683.png 2048w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-09-at-8.17.15-AM-1150x383.png 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-09-at-8.17.15-AM-750x250.png 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-09-at-8.17.15-AM-400x133.png 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-09-at-8.17.15-AM-250x83.png 250w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>The low will handle the pins from 0 to 7 while  high part will handle pins from 8 to 15.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>First if the pin between pin 0 and pin 7:<\/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;}\">\t\tif (GPIO_Config-&gt;PinNumber &lt;=pin7)\n\t\t{\n\t\t\tGPIO-&gt;AFR[0]= (GPIO_Config-&gt;AlternateType &lt;&lt; GPIO_Config-&gt;PinNumber *4);\n\t\t}<\/pre><\/div>\n\n\n\n<p>Since the settings is 4-bit wide, we shall multiply the pin number by 4 which will set the required pin to alternate number function.<\/p>\n\n\n\n<p>If the pin between 8 and 15:<\/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;}\">\t\tif (GPIO_Config-&gt;PinNumber&gt;pin7 &amp;&amp; GPIO_Config-&gt;PinNumber&lt;=pin15)\n\t\t{\n\t\t\tGPIO-&gt;AFR[1]= (GPIO_Config-&gt;AlternateType &lt;&lt; (GPIO_Config-&gt;PinNumber-8) *4);\n\t\t}<\/pre><\/div>\n\n\n\n<p>Hence, the part of alternate function 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;}\">\tif (GPIO_Config-&gt;Mode == Alternate_function)\n\t{\n\t\tGPIO-&gt;MODER &amp;=~((0x03&lt;&lt;(GPIO_Config-&gt;PinNumber*2)));\n\t\tGPIO-&gt;MODER|= (GPIO_Config-&gt;Mode&lt;&lt; GPIO_Config-&gt;PinNumber*2);\n\n\t\tGPIO-&gt;OTYPER|= (GPIO_Config-&gt;OutputType&lt;&lt;GPIO_Config-&gt;PinNumber);\n\n\t\tGPIO-&gt;OSPEEDR|= (GPIO_Config-&gt;OutPutspeed&lt;&lt; GPIO_Config-&gt;PinNumber*2);\n\n\t\tGPIO-&gt;PUPDR|= (GPIO_Config-&gt;PullUp_PullDown&lt;&lt; GPIO_Config-&gt;PinNumber*2);\n\n\t\tif (GPIO_Config-&gt;PinNumber &lt;=pin7)\n\t\t{\n\t\t\tGPIO-&gt;AFR[0]= (GPIO_Config-&gt;AlternateType &lt;&lt; GPIO_Config-&gt;PinNumber *4);\n\t\t}\n\n\t\tif (GPIO_Config-&gt;PinNumber&gt;pin7 &amp;&amp; GPIO_Config-&gt;PinNumber&lt;=pin15)\n\t\t{\n\t\t\tGPIO-&gt;AFR[1]= (GPIO_Config-&gt;AlternateType &lt;&lt; (GPIO_Config-&gt;PinNumber-8) *4);\n\t\t}\n\n\t}<\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">2. Code:<\/h2>\n\n\n\n<p>You may get the code from this github repository:<\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/hussamaldean\/Board-Support-Package-for-STM32F411RE-Nucleo64\" data-type=\"URL\" data-id=\"https:\/\/github.com\/hussamaldean\/Board-Support-Package-for-STM32F411RE-Nucleo64\" target=\"_blank\" rel=\"noreferrer noopener\">Board-Support-Package-for-STM32F411RE-Nucleo64<\/a><\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">3. Results:<\/h2>\n\n\n\n<p>For testing purposes, we shall set PA2 and PA9 to alternate function AF7 as following in main.c:<\/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;}\">GPIO_Configure_Typedef PA2_ALT;\n\n\tPA2_ALT.PinNumber=pin2;\n\tPA2_ALT.Mode=Alternate_function;\n\tPA2_ALT.AlternateType=AF7;\n\n\tGPIO_Initialization(GPIOA,&amp;PA2_ALT);\n\n\n\tGPIO_Configure_Typedef PA9_ALT;\n\n\tPA9_ALT.PinNumber=pin9;\n\tPA9_ALT.Mode=Alternate_function;\n\tPA9_ALT.AlternateType=AF7;\n\n\tGPIO_Initialization(GPIOA,&amp;PA9_ALT);\n<\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>From debugging session we can see that PA2 and PA7 are set to alternate function and AF7 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=\"923\" height=\"1024\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-09-at-8.31.04-AM-923x1024.png\" alt=\"\" class=\"wp-image-1887\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-09-at-8.31.04-AM-923x1024.png 923w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-09-at-8.31.04-AM-270x300.png 270w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-09-at-8.31.04-AM-768x852.png 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-09-at-8.31.04-AM-1384x1536.png 1384w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-09-at-8.31.04-AM-1150x1276.png 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-09-at-8.31.04-AM-750x832.png 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-09-at-8.31.04-AM-400x444.png 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-09-at-8.31.04-AM-250x277.png 250w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-09-at-8.31.04-AM.png 1422w\" sizes=\"(max-width: 923px) 100vw, 923px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Happy coding \ud83d\ude42 <\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the previous part of this guide (here), we took a look at how to configure the SysTick to generate ticks for the system for timing, delay etc. Also, in part 1 (here), we saw how to configure the GPIO in analog mode, input and output. In this guide, we shall see how to configure [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,2,11,12],"tags":[],"class_list":["post-1883","post","type-post","status-publish","format-standard","hentry","category-data-structures","category-embedded-systems","category-peripheral-drivers","category-stm32"],"_links":{"self":[{"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/posts\/1883"}],"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=1883"}],"version-history":[{"count":1,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/posts\/1883\/revisions"}],"predecessor-version":[{"id":1888,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/posts\/1883\/revisions\/1888"}],"wp:attachment":[{"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1883"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1883"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1883"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}