{"id":12167,"date":"2016-10-14T08:36:26","date_gmt":"2016-10-14T12:36:26","guid":{"rendered":"http:\/\/embedded-lab.com\/blog\/?p=12167"},"modified":"2016-12-17T22:32:32","modified_gmt":"2016-12-18T03:32:32","slug":"tiva-c-gpios","status":"publish","type":"post","link":"https:\/\/embedded-lab.com\/blog\/tiva-c-gpios\/","title":{"rendered":"Tiva C GPIOs"},"content":{"rendered":"<p style=\"text-align: justify;\">GPIOs are the basic interfaces of any microcontroller. Without GPIOs we won\u2019t have any other way to use a micro and it will be nothing more different than a chunk of well-fabricated silicon. Through them we can interface both transducers or sensors and actuators. We can also connect other devices like a display, external devices and so on. As with any ARM microcontroller, the GPIOs of TM4C12x Tiva C ARM microcontrollers are very elaborate, having many options that are usually unavailable in common 8-bit microcontrollers. The one we are interested in &#8211; the TM4C123GH6PMI &#8211; is a 64-pin micro with more than 40 usable GPIO pins. Here in this post we will explore the GPIOs of TIVA C micros.<\/p>\n<p style=\"text-align: justify;\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/TM4C123GH6PM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-12175 aligncenter\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/TM4C123GH6PM.png\" alt=\"tm4c123gh6pm\" width=\"447\" height=\"495\" \/><\/a><\/p>\n<p style=\"text-align: justify;\"><!--more--><\/p>\n<h3 style=\"text-align: justify;\">Overview<\/h3>\n<p style=\"text-align: justify;\">Tiva C micros are low power ARM Cortex M4 MCUS and run typically at 3.3V and so you can guess the logic levels of GPIO pins. However, except a few GPIOs (PB0, PB1, PD4 and PD5) all GPIO pins are 5V tolerant. This 5V tolerant feature is a smart addition and most people will simply overlook it or won\u2019t fully realize its potential use. At present microcontrollers are getting more and more energy efficient, and so their operating voltage levels are gradually decreasing. Most modern micros, especially the ARM family don\u2019t operate at 5V and the use of 5V TTL logic level will eventually diminish in the future. The most common new voltage standard is that of a cell phone, i.e. 3.3V. Many microcontrollers like the ATMega16A and the PIC18F252 that usually operate at 5V have the ability to operate at 3.3V or even below. However, there are lots of other devices that can\u2019t operate below 4V. These devices will operate erroneously or may even reset frequently due to brownout. Here the 5V tolerant feature of Tiva C MCUs come to aid, allowing us to use legacy external interfaces and devices like sensors, external modules, legacy microcontrollers, etc. without the need of additional logic level translator circuits or too much consideration about different voltage levels. It is as simple as plug-and-play. Thus, cost, space and size remain at a minimum.<\/p>\n<p style=\"text-align: justify;\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/Logic-Level-Converter.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-12184 aligncenter\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/Logic-Level-Converter-580x315.jpg\" alt=\"logic-level-converter\" width=\"580\" height=\"315\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/Logic-Level-Converter-580x315.jpg 580w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/Logic-Level-Converter.jpg 703w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<p>At this point we need to note a few things:<\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li>Never exceed input logic high voltage of any pin beyond VDD limit unless you are sure that the source will not exceed the 5V limit and you aren\u2019t using the any of the exceptional pins (PB0, PB1, PD4 and PD5). It is better to leave these pins idle unless you have memorized these pin numbers. Fortunately, PD4 and PD5 are inaccessible in the Tiva C Launchpad board.<\/li>\n<li>Likewise, don\u2019t use negative input voltages with any pin. Be sure of polarity.<\/li>\n<li>Some GPIO pins are not accessible in Launchpad board while others are physically non-existent, e.g. PF7 and so don\u2019t try to program them. Leave them alone just like a don\u2019t care bit of a register.<\/li>\n<li>When coding a new project, I recommend adding a delay of about 2 &#8211; 3 seconds at the start of the code to avoid part lockout.<\/li>\n<li>Don\u2019t stress any GPIO pin beyond 10 &#8211; 15mA, although the max limit is 25mA. Use external switching devices like opto-isolators, FETs and BJTs to drive high power loads.<\/li>\n<li>Though most pins are 5V tolerant, it doesn\u2019t necessarily mean that the logic level is based on 5V TTL logic level. The logic level voltage limits are still realized with respect to VDD, 3.3V.<\/li>\n<li>Similarly, when using TIVA C micro\u2019s ADC, the ADC pins can withstand voltages beyond VDD voltage limit but can\u2019t measure voltages beyond VDD or reference voltage level.<\/li>\n<li>GPIO pins have alternate functions and so use Pinmux software to find required GPIO pins. You can also checkout the alternate function pins in the help section of MikroC compiler under the GPIO library. In the compiler, if you type _GPIO and hit CTRL + Space, you\u2019ll see all available options for GPIO.<\/li>\n<\/ul>\n<p><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/MikroC-Help-Section.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-12185 aligncenter\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/MikroC-Help-Section-580x314.png\" alt=\"mikroc-help-section\" width=\"580\" height=\"314\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/MikroC-Help-Section-580x314.png 580w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/MikroC-Help-Section-1024x555.png 1024w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/MikroC-Help-Section.png 1918w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/Pinmux.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-12186 aligncenter\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/Pinmux-580x345.png\" alt=\"pinmux\" width=\"580\" height=\"345\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/Pinmux-580x345.png 580w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/Pinmux-1024x609.png 1024w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/Pinmux.png 1145w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">Both the GPIOs and their registers are all 8-bit wide just like 8-bit micros but there are many registers and options related to each port pin. We can code these registers on our own or use MikroC compiler\u2019s GPIO Library and get GPIOs working. Here I\u2019m preferring the use of MikroC\u2019s library functions because this library allows us to set every option related to GPIOs much more easily and quickly than it would have been otherwise. We will still have an overview of the registers. Please note that neither will you find GPIO Library in the compiler\u2019s Library Manager nor will it be needed to add this library in a project like other built-in libraries. This is because GPIOs are the most common things we use in a micro and so, by default, GPIO Library is added by the compiler whenever we start a new project. The compiler\u2019s help documentation on GPIO Library is as good as the datasheet itself. All we need is the pin map as shown below. The pin names and numbers are also inscribed in the board.<\/p>\n<p style=\"text-align: justify;\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/Board-Pinouts.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-12177 aligncenter\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/Board-Pinouts.png\" alt=\"board-pinouts\" width=\"438\" height=\"394\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">One personal experience I would like to share here. I have been working with STM32 ARMs for quite a long time and I love STM32 family a lot. One key advantage with STM32s is the 16-bit port width. In some applications, this feature helps a lot as we can use the GPIOs to form 16-bit parallel ports intended for 6800 and 8080 interfaces. For example, in popular TFT display like ILI9325, it is required to send\/receive instructions to and from the display as 16-bit chunks. With only one C instruction, we can complete one 16-bit transfer sequence unlike what we have been doing previously in 8-bit systems, i.e. breaking a 16-bit value into two 8-bit values and then transferring it sequentially one after another. This save time and requires less coding. It also makes the displays perform faster than otherwise. However, for Tiva C ARMs and other advanced MCUs like the Atmel ATXMega series, this same task needs to be done twice due to 8-bit port width. This isn\u2019t a design flaw or some kind of serious issue with these MCUs. Having things in 8-bit format isn\u2019t bad, in fact it is often a time-saver in another way. We can easily manipulate 8-bit stuffs more quickly and easily than higher bit order stuffs. It is something we have inherited from our previous 8-bit MCU experiences.<\/p>\n<p style=\"text-align: justify;\">When comparing Tiva C ARMs with respect to the popular STM32F1 series flagship ARMs, we need to look at two things also. STM32F1 series can operate at a max clock speed of 72MHz while Tiva C ARMs are slightly faster and can operate at a max clock speed of 80MHz. STM32F10x series is based on Cortex M3 architecture while Tiva C ARMs are based on Cortex M4 architecture. This gives Tiva C ARMs an edge over the STM32F1s. However, STM32F4 and STM32F7 series, which are also based on Cortex M4, are even better. The point here is not the comparison of MCU families and choice but to show that each family have their own disadvantages and advantages that we only need to consider when things demand so. Every MCU is good and it depends how we are going to use it. Fortunately, MikroC for ARM allows us to try out different ARM families with minimum efforts and low cost.<\/p>\n<h3 style=\"text-align: justify;\">Basic Architecture<\/h3>\n<p style=\"text-align: justify;\">In the block diagram shown below we can see the internal architecture of a Tiva C GPIO pin. The first thing that will strike our mind is the number of registers attached to a pin and thereby the several options a GPIO pin possesses.<\/p>\n<p style=\"text-align: justify;\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/GPIO-Pads.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-12178 aligncenter\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/GPIO-Pads-580x475.png\" alt=\"gpio-pads\" width=\"580\" height=\"475\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/GPIO-Pads-580x475.png 580w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/GPIO-Pads-1024x839.png 1024w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/GPIO-Pads.png 1086w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">Some key highlights of the GPIOs are as follows:<\/p>\n<ul>\n<li style=\"text-align: justify;\">All pins have internal input pull-up and pull-down resistors.<\/li>\n<li style=\"text-align: justify;\">Pins can be configured as GPIOs or as AFIOs for other special purpose like SPI, I2C, etc.<\/li>\n<li style=\"text-align: justify;\">Any pin can be used for external interrupt, ADC trigger and DMA trigger.<\/li>\n<li style=\"text-align: justify;\">Pin states can be retained during hibernation mode.<\/li>\n<li style=\"text-align: justify;\">Schmitt-triggered digital input pins.<\/li>\n<li style=\"text-align: justify;\">GPIO input pins are 5V tolerant.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h3>Registers<\/h3>\n<p style=\"text-align: justify;\">From the internal architecture block diagram, we have seen that every GPIO pin has many registers associated. Shown below is a reduced register map:<\/p>\n<p style=\"text-align: justify;\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/Register-Map.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-12187 aligncenter\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/Register-Map-518x650.png\" alt=\"register-map\" width=\"518\" height=\"650\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/Register-Map-518x650.png 518w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/Register-Map.png 563w\" sizes=\"auto, (max-width: 518px) 100vw, 518px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">As you can see there are too many things to configure and this is still not the complete register map. However, for most applications we\u2019ll need GPIODATA and GPIODIR registers. Their names suggest their purpose. GPIODIR register sets GPIO direction \u2013 input\/output. Clearing its bits set corresponding GPIO pins as inputs and setting them set pins as outputs. GPIODATA register is used to write to\/read from GPIO pins. The rest of the registers are for external interrupts, triggers for DMA and ADC, and for advanced customization of GPIO pins.<\/p>\n<p>When coding in raw level, we also need to take care of enabling\/disabling the clocks of GPIOs. This is one by using the registers of system control block. Check General-Purpose Input\/Output Run Mode Clock Gating Control (RCGCGPIO) register.<\/p>\n<h3 style=\"text-align: justify;\">MikroC GPIO Library<\/h3>\n<p>The following are the built-in GPIO library functions:<\/p>\n<ul>\n<li>GPIO_Clk_Enable<\/li>\n<li>GPIO_Clk_Disable<\/li>\n<li>GPIO_Unlock<\/li>\n<li>GPIO_Lock<\/li>\n<li>GPIO_Config<\/li>\n<li>GPIO_Set_Pin_Mode<\/li>\n<li>GPIO_Digital_Input<\/li>\n<li>GPIO_Digital_Output<\/li>\n<li>GPIO_Analog_Input<\/li>\n<li>GPIO_Alternate_Function_Enable<\/li>\n<li>__mE_Lib_GPIO<\/li>\n<\/ul>\n<p>Of these 11 functions, we\u2019ll need only the following six for most applications:<\/p>\n<ul>\n<li>GPIO_Clk_Enable \u2013 enables a GPIO port\u2019s clock.<\/li>\n<li>GPIO_Clk_Disable \u2013 disables a GPIO port\u2019s clock.<\/li>\n<li>GPIO_Unlock \u2013 unlocks GPIO pins.<\/li>\n<li>GPIO_Lock \u2013 locks GPIO pins<\/li>\n<li>GPIO_Config \u2013 sets up GPIO pin functionalities, direction and properties.<\/li>\n<li>GPIO_Alternate_Function_Enable \u2013 specifies alternate function pins and enables them.<\/li>\n<\/ul>\n<p style=\"text-align: justify;\">The rest, except the __mE_Lib_GPIO\u00a0 are basically extensions of GPIO_Config function and so we won\u2019t be needing them. GPIO_Config function is more than enough.<\/p>\n<p style=\"text-align: justify;\">We will understand well how these functions work when we check out the code examples. For now, have look at the Launchpad boards schematic. Notice the red highlighted areas. We\u2019ll be using these.<\/p>\n<p style=\"text-align: justify;\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/Schematic.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-12188 aligncenter\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/Schematic-580x361.png\" alt=\"schematic\" width=\"580\" height=\"361\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/Schematic-580x361.png 580w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/Schematic-1024x638.png 1024w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/Schematic.png 1385w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<h3 style=\"text-align: justify;\">LM Flash Programmer<\/h3>\n<p style=\"text-align: justify;\">For physically programming the Tiva C Launchpad board, we\u2019ll need a programmer or bootloader.\u00a0 I\u2019m not interested in the latter as all Tiva C Launchpad boards came with on board programmer hardware. Bootloaders are also sometimes unreliable. All we need to use the programmer is a software. LM Flash programmer is that software. It has a simple GUI interface and is quite similar to other program-uploading software. It can be freely downloaded from <a href=\"http:\/\/www.ti.com\/tool\/lmflashprogrammer\" target=\"_blank\">http:\/\/www.ti.com\/tool\/lmflashprogrammer<\/a>.<\/p>\n<p style=\"text-align: justify;\">The only different thing one may encounter is the file format that can be uploaded. So far most of us know that hex files are the ones that are finally uploaded to micros. However, there are other file formats that can be uploaded too. LM Flash programmer requires a binary file instead of a hex file. Uploading a hex file won\u2019t simply work. Thus, we have to instruct our compiler to generate binary (bin) files along with hex files. In MikroC IDE, press F12. Compiler options window will popup. Just tick the checkbox as shown below. Now MikroC compiler will also generate binary images.<\/p>\n<p style=\"text-align: justify;\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/Binary-File-Generation-in-MikroC.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-12176 aligncenter\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/Binary-File-Generation-in-MikroC-580x473.png\" alt=\"binary-file-generation-in-mikroc\" width=\"580\" height=\"473\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/Binary-File-Generation-in-MikroC-580x473.png 580w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/Binary-File-Generation-in-MikroC.png 908w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">LM Flash programmer GUI looks like as shown below.<\/p>\n<p style=\"text-align: justify;\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/LM-FLash-Programmer-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-12182 aligncenter\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/LM-FLash-Programmer-1.png\" alt=\"lm-flash-programmer-1\" width=\"480\" height=\"529\" \/><\/a><\/p>\n<p>It is a very easy to use software. All we need to do is to select the proper Launchpad board and show it the path to the binary file we wish to upload.<\/p>\n<p><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/LM-FLash-Programmer-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-12183 aligncenter\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/LM-FLash-Programmer-2.png\" alt=\"lm-flash-programmer-2\" width=\"481\" height=\"530\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<h3>Code Examples<\/h3>\n<h6>LED Blinking Example<\/h6>\n<p style=\"text-align: justify;\">The very first project that we always do when we try out a new MCU is a simple LED blinking. This is also my first example. In this example, I lit the on-board RGB LED in a colour mixer pattern. Here\u2019s the code:<\/p>\n<pre><span style=\"color: #0000ff;\"><em>void setup_GPIOs();<\/em><\/span><\/pre>\n<pre><\/pre>\n<pre><span style=\"color: #0000ff;\"><em>void main()<\/em><\/span><\/pre>\n<pre><span style=\"color: #0000ff;\"><em>{<\/em><\/span><\/pre>\n<pre><span style=\"color: #0000ff;\"><em>\u00a0\u00a0\u00a0\u00a0 setup_GPIOs();<\/em><\/span><\/pre>\n<pre><\/pre>\n<pre><span style=\"color: #0000ff;\"><em>\u00a0\u00a0\u00a0\u00a0 while(1)<\/em><\/span><\/pre>\n<pre><span style=\"color: #0000ff;\"><em>\u00a0\u00a0\u00a0\u00a0 {<\/em><\/span><\/pre>\n<pre><span style=\"color: #0000ff;\"><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 GPIO_PORTF_DATA1_bit = 1;<\/em><\/span><\/pre>\n<pre><span style=\"color: #0000ff;\"><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 GPIO_PORTF_DATA2_bit = 0;<\/em><\/span><\/pre>\n<pre><span style=\"color: #0000ff;\"><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 GPIO_PORTF_DATA3_bit = 0;<\/em><\/span><\/pre>\n<pre><span style=\"color: #0000ff;\"><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 delay_ms(900);<\/em><\/span><\/pre>\n<pre><\/pre>\n<pre><span style=\"color: #0000ff;\"><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 GPIO_PORTF_DATA1_bit = 1;<\/em><\/span><\/pre>\n<pre><span style=\"color: #0000ff;\"><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 GPIO_PORTF_DATA2_bit = 1;<\/em><\/span><\/pre>\n<pre><span style=\"color: #0000ff;\"><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 GPIO_PORTF_DATA3_bit = 0;<\/em><\/span><\/pre>\n<pre><span style=\"color: #0000ff;\"><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 delay_ms(900);<\/em><\/span><\/pre>\n<pre><\/pre>\n<pre><span style=\"color: #0000ff;\"><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 GPIO_PORTF_DATA1_bit = 0;<\/em><\/span><\/pre>\n<pre><span style=\"color: #0000ff;\"><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 GPIO_PORTF_DATA2_bit = 1;<\/em><\/span><\/pre>\n<pre><span style=\"color: #0000ff;\"><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 GPIO_PORTF_DATA3_bit = 0;<\/em><\/span><\/pre>\n<pre><span style=\"color: #0000ff;\"><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 delay_ms(900);<\/em><\/span><\/pre>\n<pre><\/pre>\n<pre><span style=\"color: #0000ff;\"><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 GPIO_PORTF_DATA1_bit = 0;<\/em><\/span><\/pre>\n<pre><span style=\"color: #0000ff;\"><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 GPIO_PORTF_DATA2_bit = 1;<\/em><\/span><\/pre>\n<pre><span style=\"color: #0000ff;\"><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 GPIO_PORTF_DATA3_bit = 1;<\/em><\/span><\/pre>\n<pre><span style=\"color: #0000ff;\"><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 delay_ms(900);<\/em><\/span><\/pre>\n<pre><\/pre>\n<pre><span style=\"color: #0000ff;\"><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 GPIO_PORTF_DATA1_bit = 0;<\/em><\/span><\/pre>\n<pre><span style=\"color: #0000ff;\"><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 GPIO_PORTF_DATA2_bit = 0;<\/em><\/span><\/pre>\n<pre><span style=\"color: #0000ff;\"><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 GPIO_PORTF_DATA3_bit = 1;<\/em><\/span><\/pre>\n<pre><span style=\"color: #0000ff;\"><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 delay_ms(900);<\/em><\/span><\/pre>\n<pre><\/pre>\n<pre><span style=\"color: #0000ff;\"><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 GPIO_PORTF_DATA1_bit = 1;<\/em><\/span><\/pre>\n<pre><span style=\"color: #0000ff;\"><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 GPIO_PORTF_DATA2_bit = 0;<\/em><\/span><\/pre>\n<pre><span style=\"color: #0000ff;\"><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 GPIO_PORTF_DATA3_bit = 1;<\/em><\/span><\/pre>\n<pre><span style=\"color: #0000ff;\"><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 delay_ms(900);<\/em><\/span><\/pre>\n<pre><\/pre>\n<pre><span style=\"color: #0000ff;\"><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 GPIO_PORTF_DATA1_bit = 1;<\/em><\/span><\/pre>\n<pre><span style=\"color: #0000ff;\"><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 GPIO_PORTF_DATA2_bit = 1;<\/em><\/span><\/pre>\n<pre><span style=\"color: #0000ff;\"><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 GPIO_PORTF_DATA3_bit = 1;<\/em><\/span><\/pre>\n<pre><span style=\"color: #0000ff;\"><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 delay_ms(900);<\/em><\/span><\/pre>\n<pre><span style=\"color: #0000ff;\"><em>\u00a0\u00a0\u00a0\u00a0 }<\/em><\/span><\/pre>\n<pre><span style=\"color: #0000ff;\"><em>}<\/em><\/span><\/pre>\n<pre><\/pre>\n<pre><span style=\"color: #0000ff;\"><em>void setup_GPIOs()<\/em><\/span><\/pre>\n<pre><span style=\"color: #0000ff;\"><em>{<\/em><\/span><\/pre>\n<pre><span style=\"color: #0000ff;\"><em>\u00a0\u00a0\u00a0\u00a0 delay_ms(2000);<\/em><\/span><\/pre>\n<pre><\/pre>\n<pre><span style=\"color: #0000ff;\"><em>\u00a0\u00a0\u00a0\u00a0 GPIO_Clk_Enable(&amp;GPIO_PORTF);<\/em><\/span><\/pre>\n<pre><\/pre>\n<pre><span style=\"color: #0000ff;\"><em>\u00a0\u00a0\u00a0\u00a0 GPIO_Config(&amp;GPIO_PORTF,<\/em><\/span><\/pre>\n<pre><span style=\"color: #0000ff;\"><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 (_GPIO_PINMASK_1 | _GPIO_PINMASK_2 | _GPIO_PINMASK_3),<\/em><\/span><\/pre>\n<pre><span style=\"color: #0000ff;\"><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 _GPIO_DIR_OUTPUT,<\/em><\/span><\/pre>\n<pre><span style=\"color: #0000ff;\"><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 (_GPIO_CFG_DIGITAL_ENABLE | _GPIO_CFG_DRIVE_8mA),<\/em><\/span><\/pre>\n<pre><span style=\"color: #0000ff;\"><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 _GPIO_PINCODE_NONE);<\/em><\/span><\/pre>\n<pre><span style=\"color: #0000ff;\"><em>}\r\n<\/em><\/span><\/pre>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\">As you can see the GPIO_PORTF_DATA registers are being used to light the LEDs. However, we need to configure these pins before we can use them. In the setup_GPIOs() function, pins 1 through 3 of GPIO PORTF are configured as outputs. Firstly, we need to enable the clock for the GPIO that we are wanting to use. Library function GPIO_Clk_Enable() does that. This is followed by actual GPIO setup. We need PF1, PF2 and PF3 \u2013 the RGB LED pins, to be outputs. This is done by GPIO_Config() library function. This function has several argument parameters that define GPIO properties. The first argument states which GPIO port we are concerned with. The second masks the required pins. The third selects GPIO direction. Finally, the last parameters further select what features we want from these pins. More details on what each argument parameter means is detailed in the compiler\u2019s help documentation. Just be sure that you selected the right ARM family. In case of Tiva C MCUs we should check out which functions and options are valid for Stellaris family. Stellaris is the predecessor of Tiva C micros.<\/p>\n<p style=\"text-align: justify;\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/GPIO_Lib1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-12179 aligncenter\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/GPIO_Lib1.png\" alt=\"gpio_lib1\" width=\"306\" height=\"403\" \/><\/a> <a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/GPIO_Lib2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-12180 aligncenter\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/GPIO_Lib2.png\" alt=\"gpio_lib2\" width=\"385\" height=\"176\" \/><\/a> <a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/GPIO_Lib3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-12181 aligncenter\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/GPIO_Lib3-580x559.png\" alt=\"gpio_lib3\" width=\"580\" height=\"559\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/GPIO_Lib3-580x559.png 580w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/GPIO_Lib3.png 712w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">If you remember my previous post on Tiva C clock system, you\u2019ll remember that I stated that we\u2019ll reverify our clock settings in this post. In the example, we saw that at every 900ms the state of the GPIOs changed in a grey-code-like fashion. To verify clock settings, I hooked up an oscilloscope with one GPIO pin. Here\u2019s the result:<\/p>\n<p style=\"text-align: justify;\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/P_20161012_232211_p.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-12170 aligncenter\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/P_20161012_232211_p-580x355.jpg\" alt=\"p_20161012_232211_p\" width=\"580\" height=\"355\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/P_20161012_232211_p-580x355.jpg 580w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/P_20161012_232211_p.jpg 590w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<p>The scope has been set to one second per division. The smaller square waveforms are a bit shorter than one complete division. As can be seen, the timing is perfect and so is our clock setting.<\/p>\n<p><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/P_20161012_232300_p.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-12172 aligncenter\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/P_20161012_232300_p-580x402.jpg\" alt=\"p_20161012_232300_p\" width=\"580\" height=\"402\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/P_20161012_232300_p-580x402.jpg 580w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/P_20161012_232300_p.jpg 590w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a> <a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/P_20161012_232304_p.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-12173 aligncenter\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/P_20161012_232304_p-580x406.jpg\" alt=\"p_20161012_232304_p\" width=\"580\" height=\"406\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/P_20161012_232304_p-580x406.jpg 580w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/P_20161012_232304_p.jpg 590w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a> <a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/P_20161012_232256_p.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-12171 aligncenter\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/P_20161012_232256_p-580x398.jpg\" alt=\"p_20161012_232256_p\" width=\"580\" height=\"398\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/P_20161012_232256_p-580x398.jpg 580w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/P_20161012_232256_p.jpg 590w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Demo video clip: <a href=\"https:\/\/www.youtube.com\/watch?v=4mJ6A8wkbdY\" target=\"_blank\">https:\/\/www.youtube.com\/watch?v=4mJ6A8wkbdY<\/a>.<\/p>\n<p>&nbsp;<\/p>\n<h6>Reading Inputs<\/h6>\n<p style=\"text-align: justify;\">This example demonstrates how to read GPIO pins. Again, refer to the Launchpad board schematic. There are two user buttons on board. In this example, we\u2019ll use both to change the RGB LED\u2019s colour. Apart from configuring the GPIOs, an extra step will be needed.<\/p>\n<p style=\"text-align: justify;\">There are certain special pins in the TM4C123GH6PMI MCU that, by default, can\u2019t be used like other GPIOs. They are attached to important hardware like JTAG, NMI, etc. In terms of hardware, these pins are locked from ordinary uses. Thus, we\u2019ll be needing to unlock them if we are to use them as ordinary GPIOs. The SW2 button on the Tiva C Launchpad board is shared with NMI and we can\u2019t use it unless we unlock it. This is the extra step.<\/p>\n<p style=\"text-align: justify;\">Both SW1 and SW2 \u2013 momentary pushbuttons are attached directly with the PF4 and PF0 respectively. There are no pull-up or pull-down resistor attached with them. Thus, we will be needing to enable internal pull-up resistors. Here\u2019s the code example.<\/p>\n<pre><em><span style=\"color: #0000ff;\">#define user_button1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 GPIO_PORTF_DATA0_bit<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">#define user_button2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 GPIO_PORTF_DATA4_bit<\/span><\/em><\/pre>\n<pre><\/pre>\n<pre><em><span style=\"color: #0000ff;\">#define red_LED\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0GPIO_PORTF_DATA1_bit<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">#define blue_LED\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0GPIO_PORTF_DATA2_bit<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">#define green_LED\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0GPIO_PORTF_DATA3_bit<\/span><\/em><\/pre>\n<pre><\/pre>\n<pre><em><span style=\"color: #0000ff;\">void setup_GPIOs();<\/span><\/em><\/pre>\n<pre><\/pre>\n<pre><em><span style=\"color: #0000ff;\">void main()<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">{<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0 signed char s = 0;<\/span><\/em><\/pre>\n<pre><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0 setup_GPIOs();<\/span><\/em><\/pre>\n<pre><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0 while(1)<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0 {<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 if(user_button1 == 0)<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 while(user_button1 == 0);<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 s++;<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/span><\/em><\/pre>\n<pre><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 if(s &gt; 7)<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 s = 0;<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/span><\/em><\/pre>\n<pre><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0if(user_button2 == 0)<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 while(user_button2 == 0);<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 s--;<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/span><\/em><\/pre>\n<pre><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 if(s &lt; 0)<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 s = 7;<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/span><\/em><\/pre>\n<pre><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 switch(s)<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 case 1:<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 red_LED = 1;<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 green_LED = 0;<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 blue_LED = 0;<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 break;<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 case 2:<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 red_LED = 0;<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 green_LED = 1;<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 blue_LED = 0;<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 break;<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 case 3:<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 red_LED = 0;<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 green_LED = 0;<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 blue_LED = 1;<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 break;<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 case 4:<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 red_LED = 1;<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 green_LED = 1;<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 blue_LED = 0;<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 break;<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 case 5:<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 red_LED = 1;<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0green_LED = 0;<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 blue_LED = 1;<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 break;<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 case 6:<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 red_LED = 0;<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 green_LED = 1;<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 blue_LED = 1;<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 break;<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 case 7:<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 red_LED = 0;<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 green_LED = 0;<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 blue_LED = 0;<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 break;<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 default:<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 red_LED = 1;<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 green_LED = 1;<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 blue_LED = 1;<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 break;<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0 }<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">}<\/span><\/em><\/pre>\n<pre><\/pre>\n<pre><em><span style=\"color: #0000ff;\">void setup_GPIOs()<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">{<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0 delay_ms(2000);<\/span><\/em><\/pre>\n<pre><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0 GPIO_Clk_Enable(&amp;GPIO_PORTF);<\/span><\/em><\/pre>\n<pre><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0 GPIO_Unlock(_GPIO_COMMIT_PIN_F0);<\/span><\/em><\/pre>\n<pre><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0 GPIO_Config(&amp;GPIO_PORTF,<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 (_GPIO_PINMASK_0 | _GPIO_PINMASK_4),<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 _GPIO_DIR_INPUT,<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 (_GPIO_CFG_PULL_UP | _GPIO_CFG_DIGITAL_ENABLE),<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 _GPIO_PINCODE_NONE);<\/span><\/em><\/pre>\n<pre><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0 GPIO_Config(&amp;GPIO_PORTF,<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 (_GPIO_PINMASK_1 | _GPIO_PINMASK_2 | _GPIO_PINMASK_3),<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 _GPIO_DIR_OUTPUT,<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 (_GPIO_CFG_DIGITAL_ENABLE | _GPIO_CFG_DRIVE_8mA),<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 _GPIO_PINCODE_NONE);<\/span><\/em><\/pre>\n<pre><em><span style=\"color: #0000ff;\">}<\/span><\/em><\/pre>\n<p><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/P_20161012_230345_p.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-12168 aligncenter\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/P_20161012_230345_p-580x448.jpg\" alt=\"p_20161012_230345_p\" width=\"580\" height=\"448\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/P_20161012_230345_p-580x448.jpg 580w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/P_20161012_230345_p.jpg 590w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a> <a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/P_20161012_230355_1_p.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-12169 aligncenter\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/P_20161012_230355_1_p-580x446.jpg\" alt=\"p_20161012_230355_1_p\" width=\"580\" height=\"446\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/P_20161012_230355_1_p-580x446.jpg 580w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/P_20161012_230355_1_p.jpg 590w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Demo video clip: <a href=\"https:\/\/www.youtube.com\/watch?v=tyCTbwEJshI\" target=\"_blank\">https:\/\/www.youtube.com\/watch?v=tyCTbwEJshI<\/a>.<\/p>\n<p>&nbsp;<\/p>\n<p>Tiva C GPIO Files:\u00a0<a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/10\/Tiva-C-GPIO-Files1.rar\">tiva-c-gpio-files<\/a>.<\/p>\n<p>&nbsp;<\/p>\n<p>Happy coding.<\/p>\n<p>&nbsp;<\/p>\n<p>Author: Shawon M. Shahryiar<\/p>\n<p><a href=\"https:\/\/www.facebook.com\/MicroArena\" target=\"_blank\">https:\/\/www.facebook.com\/MicroArena\u00a0\u00a0\u00a0\u00a0<\/a><\/p>\n<p>14.10.2016<\/p>\n<pre><em>*Some images are taken from TI\u2019s websites and datasheet, and MikroC for ARM compiler.<\/em><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>GPIOs are the basic interfaces of any microcontroller. Without GPIOs we won\u2019t have any other way to use a micro and it will be nothing more different than a chunk of well-fabricated silicon. Through them we can interface both transducers or sensors and actuators. We can also connect other devices like a display, external devices and so on. As with any ARM microcontroller, the GPIOs of TM4C12x Tiva C ARM microcontrollers are very elaborate, having many options that are usually unavailable in common 8-bit microcontrollers. The one we are interested in &#8211; the TM4C123GH6PMI &#8211; is a 64-pin micro with<\/p>\n","protected":false},"author":5,"featured_media":12193,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1433,1466],"tags":[1499,1415,1419,1416,1432,1417],"class_list":["post-12167","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tiva-c","category-tutorials","tag-gpios","tag-texas-instruments","tag-tiva-c","tag-tiva-c-launchpad","tag-tm4c123gh6pm","tag-tm4c123gxl"],"_links":{"self":[{"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/posts\/12167","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/comments?post=12167"}],"version-history":[{"count":6,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/posts\/12167\/revisions"}],"predecessor-version":[{"id":12885,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/posts\/12167\/revisions\/12885"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/media\/12193"}],"wp:attachment":[{"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/media?parent=12167"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/categories?post=12167"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/tags?post=12167"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}