Fx2lib
0.2
|
00001 // Copyright (C) 2009 Ubixum, Inc. 00002 // 00003 // This library is free software; you can redistribute it and/or 00004 // modify it under the terms of the GNU Lesser General Public 00005 // License as published by the Free Software Foundation; either 00006 // version 2.1 of the License, or (at your option) any later version. 00007 // 00008 // This library is distributed in the hope that it will be useful, 00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 // Lesser General Public License for more details. 00012 // 00013 // You should have received a copy of the GNU Lesser General Public 00014 // License along with this library; if not, write to the Free Software 00015 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00016 00025 #ifndef GPIF_H 00026 #define GPIF_H 00027 00028 #include "fx2types.h" 00029 00030 #define GPIFDONE (GPIFTRIG&0x80) 00031 #define GPIFTC16 (MAKEWORD(GPIFTCB1,GPIFTCB0)) 00032 #define GPIFTC32 (MAKEDWORD(MAKEWORD(GPIFTCB3,GPIFTCB2),MAKEWORD(GPIFTCB1,GPIFTCB0))) 00033 00034 00049 void gpif_init( BYTE* waveform, BYTE* initdata ); 00050 00060 void gpif_setflowstate( BYTE* flowstates, BYTE bank); 00061 00062 00063 00065 #define GPIFTRGWR 0 00066 #define GPIFTRGRD 4 00067 typedef enum { 00068 GPIF_EP2 = 0, 00069 GPIF_EP4 = 1, 00070 GPIF_EP6 = 2, 00071 GPIF_EP8 = 3 00072 } GPIF_EP_NUM; 00073 00079 void gpif_set_tc32(DWORD tc); 00084 void gpif_set_tc16(WORD tc); 00085 00086 00095 void gpif_single_read16( WORD* res , WORD len); 00096 00104 void gpif_single_write16( WORD* dat, WORD len); 00105 00106 void gpif_fifo_read ( GPIF_EP_NUM ep_num ); 00107 00108 void gpif_fifo_write( GPIF_EP_NUM ep_num ); 00109 00110 #endif