beautypg.com

3 display density, 4 gpios, temperatures, backlight and bootcounter, Ktt20/pitx software guide – Kontron KTT20-pITX User Manual

Page 46: 1 gpios

background image

KTD-S0045-D

Page 42

AndroidTM BSP


KTT20/pITX Software Guide

10.3 Display Density

In the system file

'

/system/build.prop

' the entry '

ro.sf.lcd_density

' can change the density on both graphic

units (DVI

®

and LCD panel) for a better look. The lower the value (e.g. 180, 160 or 130), the higher density

and smaller font your screen will have but it is possible that the navigation bar disappears.

10.4 GPIOs, Temperatures, Backlight and Bootcounter

The Android

TM

BSP does not support the KEAPI interface. Some special functions are realized with the

sysfs

in-memory filesystem which allows the kernel to export information to a user space. All following examples
can be executed with the serial remote connection (e.g. with TeraTerm on a desktop PC).

10.4.1 GPIOs

For correlation between GPIO numbers and physical pins refer the 'KTT20/pITX Users Guide' chapter 'Digi-
tal I/O Interface'.

’

Please use the export function before you access a GPIO pin.

echo

>/sys/class/gpio/export

Example for GPIO16:

echo

16

>/sys/class/gpio/export

’

Check the GPIO pin direction:

cat

/sys/class/gpio/gpio

/direction

Example for GPIO16:

cat

/sys/class/gpio/gpio16/direction

’

Set the GPIO pin direction:

echo

in

>/sys/class/gpio/gpio

/direction

set direction to input

echo

out

>/sys/class/gpio/gpio

/direction

set direction to output

Example for GPIO16:

echo

in

>/sys/class/gpio/gpio16/direction

echo

out

>/sys/class/gpio/gpio16/direction

’

Get an input value:

cat

/sys/class/gpio/gpio

/value

Example for GPIO16:

cat

/sys/class/gpio/gpio16/value

’

Set an output value:

echo -n 0 >/sys/class/gpio/gpio

/value

set output to low level

echo -n 1 >/sys/class/gpio/gpio

/value

set output to high level

Example for GPIO16:

echo -n 0 >/sys/class/gpio/gpio16/value

echo -n 1 >/sys/class/gpio/gpio16/value

’

Release the GPIO pin:

echo

>/sys/class/gpio/unexport

Example for GPIO16:

echo

16

>/sys/class/gpio/unexport

This manual is related to the following products: