Kinetis SDK v.1.3 API Reference Manual  Rev. 0
Freescale Semiconductor, Inc.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
fsl_gpio_hal.h File Reference

GPIO hardware driver configuration. More...

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

Enumerations

enum  gpio_pin_direction_t {
  kGpioDigitalInput = 0U,
  kGpioDigitalOutput = 1U
}
 GPIO direction definition. More...
 

Functions

Configuration
void GPIO_HAL_SetPinDir (GPIO_Type *base, uint32_t pin, gpio_pin_direction_t direction)
 Sets the individual GPIO pin to general input or output. More...
 
static void GPIO_HAL_SetPortDir (GPIO_Type *base, uint32_t pinDirectionMap)
 Sets the GPIO port pins to general input or output. More...
 
Status
static gpio_pin_direction_t GPIO_HAL_GetPinDir (GPIO_Type *base, uint32_t pin)
 Gets the current direction of the individual GPIO pin. More...
 
static uint32_t GPIO_HAL_GetPortDir (GPIO_Type *base)
 Gets the GPIO port pins direction. More...
 
Output Operation
void GPIO_HAL_WritePinOutput (GPIO_Type *base, 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_ReadPinOutput (GPIO_Type *base, uint32_t pin)
 Reads the current pin output. More...
 
static void GPIO_HAL_SetPinOutput (GPIO_Type *base, uint32_t pin)
 Sets the output level of the individual GPIO pin to logic 1. More...
 
static void GPIO_HAL_ClearPinOutput (GPIO_Type *base, uint32_t pin)
 Clears the output level of the individual GPIO pin to logic 0. More...
 
static void GPIO_HAL_TogglePinOutput (GPIO_Type *base, uint32_t pin)
 Reverses the current output logic of the individual GPIO pin. More...
 
static void GPIO_HAL_WritePortOutput (GPIO_Type *base, uint32_t portOutput)
 Sets the output of the GPIO port pins to a specific logic value. More...
 
static uint32_t GPIO_HAL_ReadPortOutput (GPIO_Type *base)
 Reads out all pin output status of the current port. More...
 
static void GPIO_HAL_SetPortOutput (GPIO_Type *base, uint32_t portOutput)
 Sets the output level of the GPIO port pins to logic 1. More...
 
static void GPIO_HAL_ClearPortOutput (GPIO_Type *base, uint32_t portOutput)
 Clears the output level of the GPIO port pins to logic 0. More...
 
static void GPIO_HAL_TogglePortOutput (GPIO_Type *base, uint32_t portOutput)
 Reverses the current output logic of the GPIO port pins. More...
 
Input Operation
static uint32_t GPIO_HAL_ReadPinInput (GPIO_Type *base, uint32_t pin)
 Reads the current input value of the individual GPIO pin. More...
 
static uint32_t GPIO_HAL_ReadPortInput (GPIO_Type *base)
 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 base pointer. Each GPIO instance has 32 pins with numbers from 0 to 31.