| |||
| Home > Hardware Description > FPGA peripherals > User switches and LEDs | |||
The FPGA provides a switch and LED register that enables you to read the general-purpose pushbutton switch and the user switches (S6) and light the user LEDs (located next to switch S6). See Figure 2.1 for the location of the switches and LEDs.
The Boot Monitor reads switches S6-1 and S6-3 to determine start-up settings after reset. See Boot Monitor configuration.
Set bits [7:0] in the SYS_LED register at 0x10000008 to
illuminate LEDs 7-0. The state of the user switches S6[8:1] is present
on bits [7:0] of the SYS_SW register at 0x10000004.
The state of the general-purpose pushbutton S3 can be read
from bit 4 of the SYS_MISC register at 0x10000060.
Setting bit 3 of SYS_MISC causes a S3 depression to generate a PWRFAIL
interrupt. The interrupt can be used to test auto-shutdown code
or to awaken the processor from sleep mode. See Miscellaneous System Control Register,
SYS_MISC.