NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.

StarterWare GPIO

From Texas Instruments Wiki
Jump to: navigation, search

Introduction[edit]

The GPIO peripheral is used to interface with external devices and peripherals. The GPIO pins can act as general purpose inputs to read digital signals from other devices or as general purpose outputs to control or signal to other devices.

The 144 GPIO pins are divided into 9 banks of 16 pins each. The pins can be programmed as input or output by using direction control registers. In output mode, a pin can be set or cleared by writing into separate set or clear registers without modifying the states of other pins. All GPIO pins can be programmed to generate CPU interrupts with configurable edge detection. All GPIO pins can also be programmed to generate events to the EDMA controller. StarterWare provides APIs to access GPIO pins in input or output mode. These APIs are listed in include/gpio.h.

Programming Sequence[edit]

General programming guidelines for GPIO are given below.

  • Perform system specific settings such as power domain, clock or reset configurations.
  • Perform platform specific settings like Pin Multiplexing to ensure that the required GPIO pin(s) is (are) available for use.
  • The direction of a GPIO pin can be configured using the API GPIODirModeSet (). A GPIO pin can be configured as an input or an output pin.
  • When a GPIO pin is configured as an input pin, the following configuration steps become relevant.
    • GPIO peripheral can generate an interrupt to the CPU when a specified logic transition is detected on the GPIO input pin. This trigger type for interrupt generation is configured using the API GPIOIntTypeSet (). The trigger type thus set is for a particular pin. Different GPIO input pins can be set with different interrupt trigger types.
    • Enable host interrupts of ARM processor. Further initialize the Interrupt Controller (INTC), register the ISR in context with the INTC and set the priority of the interrupt.
    • Enable the system interrupt in INTC corresponding to the GPIO peripheral interrupt.
    • Enable interrupts for the bank to which the GPIO pin belongs to using the API GPIOBankIntEnable ().
  • When a GPIO pin is configured as an output pin, the following configurations become relevant.
    • Drive logic high or a logic low on the desired pin using the API GPIOPinWrite (). To write to multiple pins in the same bank at a time, use the API GPIOBankPinsWrite ().
E2e.jpg {{
  1. switchcategory:MultiCore=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article StarterWare GPIO here.

Keystone=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article StarterWare GPIO here.

C2000=For technical support on the C2000 please post your questions on The C2000 Forum. Please post only comments about the article StarterWare GPIO here. DaVinci=For technical support on DaVincoplease post your questions on The DaVinci Forum. Please post only comments about the article StarterWare GPIO here. MSP430=For technical support on MSP430 please post your questions on The MSP430 Forum. Please post only comments about the article StarterWare GPIO here. OMAP35x=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article StarterWare GPIO here. OMAPL1=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article StarterWare GPIO here. MAVRK=For technical support on MAVRK please post your questions on The MAVRK Toolbox Forum. Please post only comments about the article StarterWare GPIO here. For technical support please post your questions at http://e2e.ti.com. Please post only comments about the article StarterWare GPIO here.

}}

Hyperlink blue.png Links

Amplifiers & Linear
Audio
Broadband RF/IF & Digital Radio
Clocks & Timers
Data Converters

DLP & MEMS
High-Reliability
Interface
Logic
Power Management

Processors

Switches & Multiplexers
Temperature Sensors & Control ICs
Wireless Connectivity