== Custom User I/O Control Core == A custom core for user I/O control is available in the [source:/PlatformSupport/CustomPeripherals/pcores/warp_v4_userio_v1_00_a repository] and during the [//svn/WARP/Documentation/Tutorials/XPS_Intro/html/XPS_Intro.html base system builder] process. The core allows the user to control the LEDs, read the push buttons and DIP switches and output patterns to the 7-segment displays. The core also implements the mapping of 4-bit hexadecimal characters to 7-bit patterns used to drive the 7-segment displays. This mapping is enabled per display at runtime by user designs. === Register Bank === The core has 5 registers that enable the I/O functionality. Register 0 and 1 are the output and input registers for the dedicated I/O, namely the LEDs, the push buttons and the DIP switch. [[Image(HardwareUsersGuides/FPGABoard_v2.2/Files:reg0reg1.jpg)]] === Functions === As we know, there are four peripherals controlled by the UserIO controller. '''Dedicated LEDs:''' The following function call directly writes to the LED outputs. The ''value'' should be 8-bits wide and the ''baseaddress'' is the base address of the UserIO core. The least significant bit corresponds to LED0. {{{ WarpV4_UserIO_Leds(baseaddress, value) }}} '''Push Buttons:''' The push button values can be read using the following function. {{{ WarpV4_UserIO_PushB(baseaddress) }}} where ''baseaddress'' is the base address of the UserIO core. As noted previously, the bottom push button is used as the reset button in all XPS designs, hence the function returns a four bit value. The returned vector is arranged as follows: [Up, Left, Right, Center]. '''Dip Switch:''' The dip switches can be read using the following function: {{{ WarpV4_UserIO_DipSw(baseaddress) }}} where ''baseaddress'' is the base address of the UserIO core. The returned value is four bits wide.