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

Subversion Repositories gecko3

[/] [gecko3/] [trunk/] [GECKO3COM/] [gecko3com-fw/] [firmware/] [include/] [gecko3com_gpif.h] - Blame information for rev 33

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 9 nussgipfel
/* GECKO3COM
2
 *
3
 * Copyright (C) 2008 by
4
 *   ___    ____  _   _
5
 *  (  _`\ (  __)( ) ( )
6
 *  | (_) )| (_  | |_| |   Bern University of Applied Sciences
7
 *  |  _ <'|  _) |  _  |   School of Engineering and
8
 *  | (_) )| |   | | | |   Information Technology
9
 *  (____/'(_)   (_) (_)
10
 *
11
 *
12
 * This program is free software: you can redistribute it and/or modify
13
 * it under the terms of the GNU General Public License as published by
14
 * the Free Software Foundation, either version 3 of the License, or
15
 * (at your option) any later version.
16
 *
17
 * This program is distributed in the hope that it will be useful,
18
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
 * GNU General Public License for more details.
21
 * You should have received a copy of the GNU General Public License
22
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
23
 */
24
 
25
/*********************************************************************/
26
/** \file     gecko3com_gpif.h
27
 *********************************************************************
28
 * \brief     project specific functions to handle the GPIF
29
 *
30
 *
31
 *
32
 * \author    GNUradio team, Christoph Zimmermann bfh.ch
33
 * \date      2009-4-16
34
 *
35
*/
36
 
37
#ifndef INCLUDED_GECKO3COM_GPIF_H
38
#define INCLUDED_GECKO3COM_GPIF_H
39
 
40 32 nussgipfel
/** signal that a read (data flows from the FPGA to the FX2) in in progress */
41
#define bmGPIF_READ_IN_PROGRESS 1  
42 9 nussgipfel
 
43 32 nussgipfel
/** signal that there is data waiting in the OUT fifo to be handled */
44 9 nussgipfel
#define bmGPIF_PENDING_DATA 2
45
 
46 32 nussgipfel
 
47 19 nussgipfel
/** flag to signal, that the GPIF receives data from the FPGA */
48
volatile static idata uint8_t flGPIF;
49
 
50 9 nussgipfel
/** \brief initialize GPIF system
51
 *
52
 *  initialize GPIF with waveform data.
53
 *  for this init_gpif initializes and hooks up all needed ISR's and configures
54
 *  auto OUT/IN mode.
55
 */
56
void init_gpif (void);
57
 
58
 
59
/** \brief aborts any gpif running gpif transaction  */
60
void abort_gpif(void);
61
 
62
 
63
/** \brief disables gpif system
64
 *
65
 *  disables the GPIF I/O ports, unhooks gpif ISR's and configures
66
 *  manual OUT/IN mode.
67
 */
68
void deactivate_gpif(void);
69
 
70
 
71
#ifdef GECKO3MAIN
72
 
73
/** makro to trigger a fifo read waveform */
74
#define gpif_trigger_read()  \
75
  do {                                                                  \
76
    GPIFREADYCFG |= bmINTRDY; /* set internal ready (INTRDY) signal */  \
77
    SYNCDELAY;                                                          \
78
    setup_flowstate_read();                                             \
79
    SYNCDELAY;                                                          \
80
    GPIFTCB3 = 0x00;                                                    \
81
    GPIFTCB2 = 0x00;                                                    \
82
    GPIFTCB1 = 0x00;                                                    \
83
    GPIFTCB0 = 0x01;                                                    \
84 29 nussgipfel
    GPIFTRIG = bmGPIF_EP6_START | bmGPIF_READ; /* trigger FIFO IN transfer */ \
85 9 nussgipfel
    /*SYNCDELAY;*/                                                      \
86
  } while (0)
87
 
88
 
89
/** makro to trigger a fifo write waveform */
90
#define gpif_trigger_write()  \
91
  do {                                                                  \
92
    GPIFREADYCFG |= bmINTRDY; /* set internal ready (INTRDY) signal */  \
93
    SYNCDELAY;                                                          \
94
    setup_flowstate_write();                                            \
95
    SYNCDELAY;                                                          \
96
    GPIFTCB3 = 0x00;                                                    \
97
    GPIFTCB2 = 0x00;                                                    \
98
    GPIFTCB1 = 0x00;                                                    \
99
    GPIFTCB0 = 0x01;                                                    \
100 29 nussgipfel
    GPIFTRIG = bmGPIF_EP2_START | bmGPIF_WRITE; /* trigger FIFO OUT transfer*/ \
101 9 nussgipfel
    /*SYNCDELAY;*/                                                      \
102
  } while(0)
103
 
104
#endif /* GECKO3MAIN */
105
 
106
#endif /* INCLUDED_GECKO3COM_GPIF_H */

powered by: WebSVN 2.1.0

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