OpenCores
URL https://opencores.org/ocsvn/w11/w11/trunk

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.61/] [tools/] [fx2/] [src/] [lib/] [fx2utils.c] - Blame information for rev 26

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 17 wfjm
/* -*- c++ -*- */
2
/* $Id: fx2utils.c 395 2011-07-17 22:02:55Z mueller $ */
3
/*-----------------------------------------------------------------------------
4
 * FX2 specific subroutines
5
 *-----------------------------------------------------------------------------
6
 * Code taken from USRP2 firmware (GNU Radio Project), version 3.0.2,
7
 * Copyright 2003 Free Software Foundation, Inc.
8
 *-----------------------------------------------------------------------------
9
 * This code is part of usbjtag. usbjtag is free software; you can redistribute
10
 * it and/or modify it under the terms of the GNU General Public License as
11
 * published by the Free Software Foundation; either version 2 of the License,
12
 * or (at your option) any later version. usbjtag is distributed in the hope
13
 * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
14
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 * GNU General Public License for more details.  You should have received a
16
 * copy of the GNU General Public License along with this program in the file
17
 * COPYING; if not, write to the Free Software Foundation, Inc., 51 Franklin
18
 * St, Fifth Floor, Boston, MA  02110-1301  USA
19
 *-----------------------------------------------------------------------------
20
 */
21
 
22
#include "fx2utils.h"
23
#include "fx2regs.h"
24
#include "delay.h"
25
 
26
void
27
fx2_stall_ep0 (void)
28
{
29
  EP0CS |= bmEPSTALL;
30
}
31
 
32
void
33
fx2_reset_data_toggle (unsigned char ep)
34
{
35
  TOGCTL = ((ep & 0x80) >> 3 | (ep & 0x0f));
36
  TOGCTL |= bmRESETTOGGLE;
37
}
38
 
39
void
40
fx2_renumerate (void)
41
{
42
  USBCS |= bmDISCON | bmRENUM;
43
 
44
  // mdelay (1500);             // FIXME why 1.5 seconds?
45
  mdelay (250);                 // FIXME why 1.5 seconds?
46
 
47
  USBIRQ = 0xff;                // clear any pending USB irqs...
48
  EPIRQ =  0xff;                //   they're from before the renumeration
49
 
50
  EXIF &= ~bmEXIF_USBINT;
51
 
52
  USBCS &= ~bmDISCON;           // reconnect USB
53
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.