source: PlatformSupport/WARPMAC/util/warp_userio.h

Last change on this file was 1451, checked in by murphpo, 14 years ago

Removing FPGA board v2.2 macros from userio.h (now handled by dedicated pcore/driver)

  • Property svn:executable set to *
File size: 2.1 KB
RevLine 
[1450]1/**********************************************************************
[942]2* This file provides macros and constants for interfacing with
[1451]3* the LEDs, buttons and switches on the WARP FPGA Board v1.2
[942]4*
5* The constants here assume a hardware platform (MHS) built using
[1450]6*  Xilinx EDK 10.1.03 (or later)
[942]7*  Base System Builder
[1451]8*  WARP FPGA Board v1.2 XBD svn rev 1444 (or later)
[1450]9**********************************************************************/
[942]10
11#ifndef USERIO_H
12#define USERIO_H
13
[1369]14#include "warp_fpga_board.h"
[1203]15
[1369]16#ifdef WARP_FPGA_BOARD_V1_2
[1450]17/********************************************************/
18/************* WARP FPGA Board v1.2 macros **************/
19/********************************************************/
[1369]20
[1451]21#define USERIO_MAP_DIPSW(x) ( (unsigned int)( (x & USERIO_MASK_DIPSW) >> USERIO_OFFSET_DIPSW) )
22#define USERIO_MAP_PB(x) ( (unsigned int)( (x & USERIO_MASK_PB) >> USERIO_OFFSET_PB) )
23
24
[1203]25#define USERIO_MAP_LEDS(x) ( (unsigned int)(USERIO_MASK_LEDS & ((unsigned int)x << USERIO_OFFSET_LEDS)) )
26
[1369]27#define USERIO_CHAN_INPUTS  1
28#define USERIO_CHAN_OUTPUTS 2
[1203]29
[942]30//Bit masks for user inputs (buttons & switches)
31#define USERIO_MASK_DIPSW   0x3C000
32#define USERIO_MASK_PB      0x03C00
33#define USERIO_MASK_PBC     0x00400
34#define USERIO_MASK_PBR     0x00800
35#define USERIO_MASK_PBL     0x01000
36#define USERIO_MASK_PBU     0x02000
37#define USERIO_MASK_INPUTS  (USERIO_MASK_DIPSW | USERIO_MASK_PB)
38
39//Offsets for user inputs
40#define USERIO_OFFSET_DIPSW 14
41#define USERIO_OFFSET_PB    10
42
43//Bit masks for user outputs (LEDs and 7-segment displays)
44#define USERIO_MASK_DISPR   0x0003F800
45#define USERIO_MASK_DISPL   0x000007F0
46#define USERIO_MASK_LEDS    0x0000000F
47#define USERIO_MASK_OUTPUTS (USERIO_MASK_DISPL | USERIO_MASK_DISPR | USERIO_MASK_LEDS)
48
49//Offsets for user outputs
50#define USERIO_OFFSET_DISPR 11
51#define USERIO_OFFSET_DISPL 4
52#define USERIO_OFFSET_LEDS  0
53
54#define USERIO_MAP_DISPR(x) ( (unsigned int)(USERIO_MASK_DISPR & ( (unsigned int)x << USERIO_OFFSET_DISPR)) )
55#define USERIO_MAP_DISPL(x) ( (unsigned int)(USERIO_MASK_DISPL & ( (unsigned int)x << USERIO_OFFSET_DISPL)) )
56
[1451]57#endif //ifdef WARP_FPGA_BOARD_V1_2
[1203]58
[942]59#endif //ifndef USERIO_H
Note: See TracBrowser for help on using the repository browser.