2 * USRP - Universal Software Radio Peripheral
4 * Copyright (C) 2003,2006 Free Software Foundation, Inc.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Boston, MA 02110-1301 USA
22 * common defines and prototypes for USRP
24 * In comments below "TRM" refers to the EZ-USB FX2 Technical Reference Manual
27 #ifndef _USRPCOMMON_H_
28 #define _USRPCOMMON_H_
30 #include <usrp_config.h>
31 #include <usrp_rev2_regs.h>
32 #include <syncdelay.h>
35 * From TRM page 15-105:
37 * Under certain conditions, some read and write access to the FX2
38 * registers must be separated by a "synchronization delay". The
39 * delay is necessary only under the following conditions:
41 * - between a write to any register in the 0xE600 - 0xE6FF range
42 * and a write to one of the registers listed below.
44 * - between a write to one of the registers listed below and a read
45 * from any register in the 0xE600 - 0xE6FF range.
47 * Registers which require a synchronization delay:
49 * FIFORESET FIFOPINPOLAR
51 * EPxFIFOPFH:L EPxAUTOINLENH:L
52 * EPxFIFOCFG EPxGPIFFLGSEL
53 * PINFLAGSAB PINFLAGSCD
54 * EPxFIFOIE EPxFIFOIRQ
56 * UDMACRCH:L GPIFADRH:L
57 * GPIFTRIG EPxGPIFTRIG
67 void init_usrp (void);
68 void init_gpif (void);
70 void set_led_0 (unsigned char on);
71 void set_led_1 (unsigned char on);
72 void toggle_led_0 (void);
73 void toggle_led_1 (void);
77 #endif /* _USRPCOMMON_H_ */