GNU Radio 3.3.0 C++ API
|
00001 /* 00002 * USRP - Universal Software Radio Peripheral 00003 * 00004 * Copyright (C) 2003,2006 Free Software Foundation, Inc. 00005 * 00006 * This program is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 3 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 51 Franklin Street, Boston, MA 02110-1301 USA 00019 */ 00020 00021 /* 00022 * common defines and prototypes for USRP 00023 * 00024 * In comments below "TRM" refers to the EZ-USB FX2 Technical Reference Manual 00025 */ 00026 00027 #ifndef _USRPCOMMON_H_ 00028 #define _USRPCOMMON_H_ 00029 00030 #include <usrp_config.h> 00031 #include <usrp_rev2_regs.h> 00032 #include <syncdelay.h> 00033 00034 /* 00035 * From TRM page 15-105: 00036 * 00037 * Under certain conditions, some read and write access to the FX2 00038 * registers must be separated by a "synchronization delay". The 00039 * delay is necessary only under the following conditions: 00040 * 00041 * - between a write to any register in the 0xE600 - 0xE6FF range 00042 * and a write to one of the registers listed below. 00043 * 00044 * - between a write to one of the registers listed below and a read 00045 * from any register in the 0xE600 - 0xE6FF range. 00046 * 00047 * Registers which require a synchronization delay: 00048 * 00049 * FIFORESET FIFOPINPOLAR 00050 * INPKTEND EPxBCH:L 00051 * EPxFIFOPFH:L EPxAUTOINLENH:L 00052 * EPxFIFOCFG EPxGPIFFLGSEL 00053 * PINFLAGSAB PINFLAGSCD 00054 * EPxFIFOIE EPxFIFOIRQ 00055 * GPIFIE GPIFIRQ 00056 * UDMACRCH:L GPIFADRH:L 00057 * GPIFTRIG EPxGPIFTRIG 00058 * OUTPKTEND REVCTL 00059 * GPIFTCB3 GPIFTCB2 00060 * GPIFTCB1 GPIFTCB0 00061 */ 00062 00063 #define TRUE 1 00064 #define FALSE 0 00065 00066 00067 void init_usrp (void); 00068 void init_gpif (void); 00069 00070 void set_led_0 (unsigned char on); 00071 void set_led_1 (unsigned char on); 00072 void toggle_led_0 (void); 00073 void toggle_led_1 (void); 00074 00075 #define la_trace(v) 00076 00077 #endif /* _USRPCOMMON_H_ */