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 19

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
 
41
#define bmGPIF_READ_IN_PROGRESS 1
42
#define bmGPIF_PENDING_DATA 2
43
 
44 19 nussgipfel
/** flag to signal, that the GPIF receives data from the FPGA */
45
volatile static idata uint8_t flGPIF;
46
 
47 9 nussgipfel
/** \brief initialize GPIF system
48
 *
49
 *  initialize GPIF with waveform data.
50
 *  for this init_gpif initializes and hooks up all needed ISR's and configures
51
 *  auto OUT/IN mode.
52
 */
53
void init_gpif (void);
54
 
55
 
56
/** \brief aborts any gpif running gpif transaction  */
57
void abort_gpif(void);
58
 
59
 
60
/** \brief disables gpif system
61
 *
62
 *  disables the GPIF I/O ports, unhooks gpif ISR's and configures
63
 *  manual OUT/IN mode.
64
 */
65
void deactivate_gpif(void);
66
 
67
 
68
#ifdef GECKO3MAIN
69
 
70
/** makro to trigger a fifo read waveform */
71
#define gpif_trigger_read()  \
72
  do {                                                                  \
73
    GPIFREADYCFG |= bmINTRDY; /* set internal ready (INTRDY) signal */  \
74
    SYNCDELAY;                                                          \
75
    setup_flowstate_read();                                             \
76
    SYNCDELAY;                                                          \
77
    GPIFTCB3 = 0x00;                                                    \
78
    GPIFTCB2 = 0x00;                                                    \
79
    GPIFTCB1 = 0x00;                                                    \
80
    GPIFTCB0 = 0x01;                                                    \
81
    GPIFTRIG = bmGPIF_EP6_START | bmGPIF_READ; /* trigger FIFO out transfer */ \
82
    /*SYNCDELAY;*/                                                      \
83
  } while (0)
84
 
85
 
86
/** makro to trigger a fifo write waveform */
87
#define gpif_trigger_write()  \
88
  do {                                                                  \
89
    GPIFREADYCFG |= bmINTRDY; /* set internal ready (INTRDY) signal */  \
90
    SYNCDELAY;                                                          \
91
    setup_flowstate_write();                                            \
92
    SYNCDELAY;                                                          \
93
    GPIFTCB3 = 0x00;                                                    \
94
    GPIFTCB2 = 0x00;                                                    \
95
    GPIFTCB1 = 0x00;                                                    \
96
    GPIFTCB0 = 0x01;                                                    \
97
    GPIFTRIG = bmGPIF_EP2_START | bmGPIF_WRITE; /* trigger FIFO out transfer */ \
98
    /*SYNCDELAY;*/                                                      \
99
  } while(0)
100
 
101
#endif /* GECKO3MAIN */
102
 
103
#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.