Actions

EmSys

Difference between revisions of "Tm4clib-gpio"

From EdWiki

m
m
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
__NOTOC__
 +
== Introduction ==
 +
The GPIO module provides control for up to eight independent GPIO pins (the actual number present depend upon the GPIO port and part number). Each pin has the following capabilities:
 +
* Can be configured as an input or an output. On reset, GPIOs default to being inputs.
 +
* In input mode, can generate interrupts on high level, low level, rising edge, falling edge, or both edges.
 +
* In output mode, can be configured for 2-mA, 4-mA, or 8-mA drive strength. The 8-mA drive strength configuration has optional slew rate control to limit the rise and fall times of the signal. On reset, GPIOs default to 2-mA drive strength.
 +
* Optional weak pull-up or pull-down resistors. On reset, GPIOs default to no pull-up or pull-down resistors.
 +
* Optional open-drain operation. On reset, GPIOs default to standard push/pull operation.
 +
* Can be configured to be a GPIO or a peripheral pin. On reset, the default is GPIO. Note that not all pins on all parts have peripheral functions, in which case the pin is only useful as a GPIO.
 +
 
== GPIO ==
 
== GPIO ==
 +
'''Attention'''<br />
 +
An important aspect to consider is that tm4clib uses the AHB aperture for accessing the GPIO registers on the TM4C. The AHB must be explicitly enabled with a call to [[EmSys:Tm4clib-gpio-functions#gpio_enable_ahb_aperture()|gpio_enable_ahb_aperture()]] before accessing any GPIO functionality.
 +
 +
Please see the individual GPIO modules for more details. To use the GPIO, the ''gpio.h'' header needs to be included:
 +
 +
<nowiki>#</nowiki>include <gpio.h>
 +
 
=== Modules ===
 
=== Modules ===
 
*[[EmSys:tm4clib_GPIO_pin_configuration | GPIO pin configuration]]
 
*[[EmSys:tm4clib_GPIO_pin_configuration | GPIO pin configuration]]
:Enabling and configuring GPIO pins
+
*:Enabling and configuring GPIO pins
 
*[[EmSys:tm4clib_GPIO_pin_control | GPIO pin control]]
 
*[[EmSys:tm4clib_GPIO_pin_control | GPIO pin control]]
 
*:Controlling GPIO pins  
 
*:Controlling GPIO pins  
 
*[[EmSys:tm4clib_GPIO_Interrupt_control | GPIO Interrupt control]]
 
*[[EmSys:tm4clib_GPIO_Interrupt_control | GPIO Interrupt control]]
:Configuring interrupts from GPIO pins  
+
*:Configuring interrupts from GPIO pins  
 +
----
 
* [[EmSys:Tm4clib-gpio-functions | GPIO Functions]]
 
* [[EmSys:Tm4clib-gpio-functions | GPIO Functions]]
 
* [[EmSys:Tm4clib-gpio-defines | GPIO Defines]]
 
* [[EmSys:Tm4clib-gpio-defines | GPIO Defines]]
 +
* [[EmSys:tm4clib-GPIO-Register-Base-Addresses | GPIO register base addresses]]<br />
 +
* [[EmSys:tm4clib-GPIO-Pin-Identifiers | GPIO pin identifiers]]
  
 
== Macros ==
 
== Macros ==
 
'''GPIO_LOCK_UNLOCK_CODE''' <br />
 
'''GPIO_LOCK_UNLOCK_CODE''' <br />
 
  <nowiki>#</nowiki>define GPIO_LOCK_UNLOCK_CODE  0x4C4F434B
 
  <nowiki>#</nowiki>define GPIO_LOCK_UNLOCK_CODE  0x4C4F434B
 
'''Attention'''<br />
 
An important aspect to consider is that tm4clib uses the AHB aperture for accessing the GPIO registers on the TM4C. The AHB must be explicitly enabled with a call to gpio_enable_ahb_aperture() before accessing any GPIO functionality.
 
 
Please see the individual GPIO modules for more details. To use the GPIO, the ''gpio.h'' header needs to be included:
 
 
<nowiki>#</nowiki>include <gpio.h>
 

Latest revision as of 11:09, 27 December 2018

Introduction

The GPIO module provides control for up to eight independent GPIO pins (the actual number present depend upon the GPIO port and part number). Each pin has the following capabilities:

  • Can be configured as an input or an output. On reset, GPIOs default to being inputs.
  • In input mode, can generate interrupts on high level, low level, rising edge, falling edge, or both edges.
  • In output mode, can be configured for 2-mA, 4-mA, or 8-mA drive strength. The 8-mA drive strength configuration has optional slew rate control to limit the rise and fall times of the signal. On reset, GPIOs default to 2-mA drive strength.
  • Optional weak pull-up or pull-down resistors. On reset, GPIOs default to no pull-up or pull-down resistors.
  • Optional open-drain operation. On reset, GPIOs default to standard push/pull operation.
  • Can be configured to be a GPIO or a peripheral pin. On reset, the default is GPIO. Note that not all pins on all parts have peripheral functions, in which case the pin is only useful as a GPIO.

GPIO

Attention
An important aspect to consider is that tm4clib uses the AHB aperture for accessing the GPIO registers on the TM4C. The AHB must be explicitly enabled with a call to gpio_enable_ahb_aperture() before accessing any GPIO functionality.

Please see the individual GPIO modules for more details. To use the GPIO, the gpio.h header needs to be included:

#include <gpio.h>

Modules


Macros

GPIO_LOCK_UNLOCK_CODE

#define GPIO_LOCK_UNLOCK_CODE   0x4C4F434B