| Kinetis SDK API Reference Manual 1.0.0-beta Freescale Semiconductor, Inc.

- Introduction
- Related Pages
- API Usage

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Enumerations
fsl_gpio_hal.h File Reference
GPIO HAL driver

GPIO hardware driver configuration. More...

`#include <assert.h>`
`#include <stdint.h>`
`#include <stdbool.h>`
`#include "fsl_gpio_features.h"`
`#include "fsl_device_registers.h"`

## Enumerations
enum | gpio_pin_direction_t { kGpioDigitalInput = 0, kGpioDigitalOutput = 1 }
| GPIO direction definition. More...

## Functions
Configuration
void | gpio_hal_set_pin_direction (uint32_t instance, uint32_t pin, gpio_pin_direction_t direction)
| Sets the individual GPIO pin to general input or output. More...
static void | gpio_hal_set_port_direction (uint32_t instance, uint32_t direction)
| Sets the GPIO port pins to general input or output. More...
Status
static uint32_t | gpio_hal_get_pin_direction (uint32_t instance, uint32_t pin)
| Gets the current direction of the individual GPIO pin. More...
static uint32_t | gpio_hal_get_port_direction (uint32_t instance)
| Gets the GPIO port pins direction. More...
Output Operation
void | gpio_hal_write_pin_output (uint32_t instance, uint32_t pin, uint32_t output)
| Sets the output level of the individual GPIO pin to logic 1 or 0. More...
static uint32_t | gpio_hal_read_pin_output (uint32_t instance, uint32_t pin)
| Reads the current pin output. More...
static void | gpio_hal_set_pin_output (uint32_t instance, uint32_t pin)
| Sets the output level of the individual GPIO pin to logic 1. More...
static void | gpio_hal_clear_pin_output (uint32_t instance, uint32_t pin)
| Clears the output level of the individual GPIO pin to logic 0. More...
static void | gpio_hal_toggle_pin_output (uint32_t instance, uint32_t pin)
| Reverses the current output logic of the individual GPIO pin. More...
static void | gpio_hal_write_port_output (uint32_t instance, uint32_t portOutput)
| Sets the output of the GPIO port to a specific logic value. More...
static uint32_t | gpio_hal_read_port_output (uint32_t instance)
| Reads out all pin output status of the current port. More...
Input Operation
static uint32_t | gpio_hal_read_pin_input (uint32_t instance, uint32_t pin)
| Reads the current input value of the individual GPIO pin. More...
static uint32_t | gpio_hal_read_port_input (uint32_t instance)
| Reads the current input value of a specific GPIO port. More...

## Detailed Description

Use these functions to set the GPIO input/output, set output logic or get input logic. Check the GPIO header file for instance numbers. Each GPIO instance has 32 pins with numbers from 0 to 31.