
DE10-Standard
User Manual
96
www.terasic.com
January 19, 2017
Yocto Linux.
Type "
./hps_gpio
" in the UART terminal of PuTTY to start the program.
HPS_LED will flash twice and users can control the user LED with push-button.
Press HPS_KEY to light up HPS_LED.
Press "CTRL + C" to terminate the application.
6
6
.
.
3
3
I
I
2
2
C
C
I
I
n
n
t
t
e
e
r
r
f
f
a
a
c
c
e
e
d
d
G
G
-
-
s
s
e
e
n
n
s
s
o
o
r
r
This demonstration shows how to control the G-sensor by accessing its registers through the built-in
I2C kernel driver in
Altera Soc Yocto Powered Embedded Linux
.
Function Block Diagram
Figure 6-6
s
hows the function block diagram of this demonstration. The G-sensor on the DE1_SoC
board is connected to the
I2C0
controller in HPS. The G-Sensor I2C 7-bit device address is 0x53.
The system I2C bus driver is used to access the register files in the G-sensor. The G-sensor interrupt
signal is connected to the PIO controller. This demonstration uses polling method to read the
register data.
Figure 6-6 Block diagram of the G-sensor demonstration
I2C Driver
The procedures to read a register value from G-sensor register files by the existing I2C bus driver in