Presentation is loading. Please wait.

Presentation is loading. Please wait.

Raul Cabrera Khaldon Batnij Isaac Zavala

Similar presentations


Presentation on theme: "Raul Cabrera Khaldon Batnij Isaac Zavala"— Presentation transcript:

1 Raul Cabrera Khaldon Batnij Isaac Zavala
GPIO Tiva C® Series Raul Cabrera Khaldon Batnij Isaac Zavala

2 Introduction to GPIO General-purpose input/output (GPIO) peripherals provide pins that can be configured for either input or output. Output: able to write to an internal register to control the state driven on the output pin. Input: can detect the state of the input by reading the state of an internal register

3 General Information 6 GPIO ports 48 GPIO pins
PC0-PC3 are protected against accidental programming for JTAG/SWD PD7&PF0 Non Maskable Interrupts NMI GPIO Blocks are labeled as Port A-F All pins are only 5v tolerant except PD4, PD5, PB0, PB1 which are limited to 3.6v

4 TM4C123GH6PM I/O pins

5 GPIO Driver The GPIO module allows you to manage General Purpose I/O pins and ports via simple and portable APIs. The application needs to supply a GPIO_Config structure to the module.

6 EK_TM4C123GXL.c EK_TM4C123GXL_initGPIO() function needed to initialize the board specified GPIO peripheral settings. Declares the GPIO_config structure for pin input/output configuration Configurations should be set before calling GPIO_init()

7 APIs • GPIO_init() sets up the configured GPIO ports and pins.
The following are the GPIO APIs: #include <ti/drivers/GPIO.h> • GPIO_init() sets up the configured GPIO ports and pins. • GPIO_read() gets the current state of the specified GPIO pin. • GPIO_write() sets the state of the specified GPIO pin to on or off. • GPIO_toggle() toggles the state of the specified GPIO pin. • GPIO_setupCallbacks() sets up the hardware interrupt and callback table for a GPIO port. • GPIO_clearInt() clears the interrupt flag for the specified GPIO pin. • GPIO_disableInt() disables interrupts on the specified GPIO pin. • GPIO_enableInt() enables interrupts on the specified GPIO pin for the specified pin event.

8 PinMux Provides a simple graphical way to initialize port pins with collision and error control Gives users the ability to select from a list of supported peripherals and automatically generate code for the required peripheral functions Provides protection for JTAG pins Generates fully-commented code that implements Driver Library API calls to enable the required peripheral clocks and to configure the pins for the chosen function Allows manual selection of port functions and automatic selection of peripherals with the ability to lock/unlock specific port functions

9 Example

10 Example

11 Questions?

12 References and further reading
TM4C123GH6PM Data sheet - TI-RTOS User guide-


Download ppt "Raul Cabrera Khaldon Batnij Isaac Zavala"

Similar presentations


Ads by Google