beautypg.com

1 hardware components compatibility, 2 gpio declarations, Ktt20/pitx software guide – Kontron KTT20-pITX User Manual

Page 33

background image

KTD-S0045-D

Page 29

U-Boot Compilation


KTT20/pITX Software Guide

8.1

Hardware Components Compatibility

Between the KTT20/pITX and the 'Harmony' evaluation board there are following conformities/differences:

Component

KTT20/pITX vs. 'Harmony' Evalboard

SDRAM

Compatible

NAND

Compatible

SPI

TM

Flash

Compatible

PMU

Compatible

LAN

Compatible

DVI

®

DVI

®

vs. HDMI

®

CRT

Compatible

LVDS

Compatible

USB Client

Compatible

USB

Nearly compatible

microSD

TM

(MMC)

Compatible

Audio

Compatible

PCI Express

®

Compatible

I

2

C

TM

Not compatible

UARTs

Not compatible

GPIOs

Not compatible

Temperature Sensor

Compatible

8.2

GPIO Declarations

The directory 'drivers/gpio' contains a module named 'tegra2_gpio.c'. It disposes of all needed routines to
declare a GPIO as input or output respectively to read or write a value. An overview:

int gpio_request

// Configure as GPIO (only in older versions)

int gpio_direction_input

// Set GPIO as input

int gpio_direction_output

// Set GPIO as output

int gpio_get_value

// Read input value

void gpio_set_value

// Set output value


Example (symbolic names see 'arch/arm/include/asm/arch-tegra2/gpio.h'):

// gpio_request is a function from older U-Boot versions - possibly not necessary

ret = gpio_request (GPIO_PT1, NULL);

// define GPIO33 as GPIO, also labeled T.01

if (ret) {

do something;

// Error

}

gpio_direction_input (GPIO_PT1);

// Set GPIO as input

ret = gpio_get_value (GPIO_PT1);

// Read value, result is always Bit 0

This manual is related to the following products: