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

Subversion Repositories gecko3

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 9 nussgipfel
/* GECKO3COM
2
 *
3
 * Copyright (C) 2008 by
4
 *   ___    ____  _   _
5
 *  (  _`\ (  __)( ) ( )
6
 *  | (_) )| (_  | |_| |   Berne 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_common.h
27
 *********************************************************************
28
 * \brief     common defines and prototypes for GECKO3COM
29
 *
30
 * \author    GNUradio, Christoph Zimmermann bfh.ch
31
 * \date
32
 *
33
*/
34
 
35
#ifndef _GECKO3COMCOMMON_H_
36
#define _GECKO3COMCOMMON_H_
37
 
38
#include <stdint.h>
39
#include "syncdelay.h"
40
#include "gecko3com_regs.h"
41
#include "i2c.h"
42
#include "gecko3com_i2c.h"
43
 
44 32 nussgipfel
#define TRUE            1     /**< TRUE */
45
#define FALSE           0     /**< FALSE */
46 9 nussgipfel
 
47
/* Defines for LED output colors */
48
#define RED                                     0x02  /**< Switch bi-color LED to RED */
49
#define GREEN                                   0x04  /**< Switch bi-color LED to GREEN */
50
#define ORANGE                                  0x06  /**< Switch bi-color LED to ORANGE */
51
#define LEDS_OFF                                0x00  /**< Switch bi-color LED off */
52
 
53 32 nussgipfel
/** flag to store the state of the LED */
54 9 nussgipfel
extern volatile uint8_t flLED;
55
 
56
 
57
/* defines and global variable for context switching between EZ-USB and GPIF/FPGA */
58 32 nussgipfel
#define GECKO3COM_LOCAL       0 /**< firmware parses commands */
59
#define GECKO3COM_REMOTE      1 /**< no commands parsed, data passed to fpga */
60 9 nussgipfel
 
61 32 nussgipfel
/** flag to signal who interpretes TMC messages */
62
extern volatile uint8_t flLOCAL;
63 9 nussgipfel
 
64
 
65
 
66
/** initialize all board specific stuff */
67
void init_gecko3com (void);
68
 
69
/** initialize the GPIF system of the EZ-USB FX2 */
70
void init_gpif (void);
71
 
72
/** resets the connected FPGA and the connected modules */
73
void gecko3com_system_reset(void);
74
 
75
/** switch LED0 on or off
76
 * \param[in] on this value is active low, write 0 to activate LED0 */
77
void set_led_0 (const uint8_t on);
78
 
79
/** switch LED1 on or off
80
 * \param[in] on this value is active low, write 0 to activate LED1 */
81
void set_led_1 (const uint8_t on);
82
 
83
/** toogles LED0. Connected to Port C. Debug purpose only! */
84
void toggle_led_0 (void);
85
 
86
/** toogles LED1  Connected to Port C. Debug purpose only! */
87
void toggle_led_1 (void);
88
 
89
/** initialize the external I2C I/O Expander */
90
void init_io_ext (void);
91
 
92
/** function that write to external LEDs (connected through I2C I/O Expander) */
93
void set_led_ext (const uint8_t color);
94
 
95
/** function that read the external switch (connected through I2C I/O Expander) */
96
uint8_t get_switch (void);
97
 
98
#endif /* _GECKO3COMCOMMON_H_ */

powered by: WebSVN 2.1.0

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