SoCKit User Manual
79
www.terasic.com
December 1, 2015
connected to H_SW3, and the bit-18 represents the input value of HPS_GPI5, which is connected to
H_SW2, and so on. The bit-21 represents the input value of HPS_GPI8, which is connected to
H_KEY0, and the bit-22 represents the input value of HPS_GPI9 which is connected to H_KEY1,
and so on. In summary, the input value of H_SW0, H_SW1, H_SW2, and H_SW3 are controlled by
the bit-20, bit-19, bit-18, and bit-17 in the
gpio_extra_porta
register of the GPIO2 controller,
respectively. The input value of H_KEY0, H_KEY1, H_KEY2, and H_KEY3 are controlled by the
bit-21, bit-22, bit-23, and bit-24 in the
gpio_extra_porta
register of the GPIO2 controller,
respectively.
Figure 6-7 gpio_swpport_ddr Register in the GPIO1 Controller
In the demo code, the following bit mask is defined to check the input status of switches and keys.