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 9

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