91
#include "socal/alt_gpio.h"
LED and KEY Control
Figure 6-4
shows the HPS users LED and KEY pin assignment for the DE1_SoC board. The LED
is connected to HPS_GPIO53, KEY is connected to HPS_GPIO54, which are controlled by the
GPIO1 controller, which also controls HPS_GPIO29 ~ HPS_GPIO57.
Figure 6-4 LED and KEY Pin Assignment
Figure 6-5
shows the
gpio_swporta_ddr
register of the GPIO1 controller. The bit-0 controls the
pin direction of HPS_GPIO29. The bit-24 controls the pin direction of HPS_GPIO53, which
connects to the HPS_LED, the bits-25 controls the pin direction of HPS_GPIO54 which connects to
the HPS_KEY, and so on. In summary, the pin direction of HPS_LED, HPS_KEY are controlled by
the bit-24, bit-25 in the
gpio_swporta_ddr
register of the GPIO1 controller, respectively. Similarly,
the output status of HPS_LED is controlled by the bit-24 in the
gpio_swporta_dr
register of the
GPIO1 controller. The status of KEY can be queried by reading the value of the bit-24 in the
gpio_ext_porta
register of the GPIO1 controller.
Figure 6-5
gpio_swporta_ddr
Register in the GPIO1
Summary of Contents for DE1-SOC
Page 1: ...1...
Page 108: ...107 Figure 8 4 Select Devices Page...