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

Subversion Repositories usb_fpga_2_14

[/] [usb_fpga_2_14/] [trunk/] [fx2/] [ezintavecs.h] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 ZTEX
/*%
2
   ZTEX Firmware Kit for EZ-USB FX2 Microcontrollers
3
   Copyright (C) 2009-2017 ZTEX GmbH.
4
   http://www.ztex.de
5
 
6
   This Source Code Form is subject to the terms of the Mozilla Public
7
   License, v. 2.0. If a copy of the MPL was not distributed with this file,
8
   You can obtain one at http://mozilla.org/MPL/2.0/.
9
 
10
   Alternatively, the contents of this file may be used under the terms
11
   of the GNU General Public License Version 3, as described below:
12
 
13
   This program is free software; you can redistribute it and/or modify
14
   it under the terms of the GNU General Public License version 3 as
15
   published by the Free Software Foundation.
16
 
17
   This program is distributed in the hope that it will be useful, but
18
   WITHOUT ANY WARRANTY; without even the implied warranty of
19
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20
   General Public License for more details.
21
 
22
   You should have received a copy of the GNU General Public License
23
   along with this program; if not, see http://www.gnu.org/licenses/.
24
%*/
25
 
26
/*
27
   EZ-USB Autovectors
28
*/
29
 
30
#ifndef[EZINTAVECS_H]
31
#define[EZINTAVECS_H]
32
 
33
#include[ztex-utils.h]
34
 
35
struct INTVEC {
36
    BYTE op;
37
    BYTE addrH;
38
    BYTE addrL;
39
};
40
 
41
#define[INTVECS;][DEFINE_INTVEC(0x0003,INT0VEC_IE0);
42
DEFINE_INTVEC(0x000b,INT1VEC_T0);
43
DEFINE_INTVEC(0x0013,INT2VEC_IE1);
44
DEFINE_INTVEC(0x001b,INT3VEC_T1);
45
DEFINE_INTVEC(0x0023,INT4VEC_USART0);
46
DEFINE_INTVEC(0x002b,INT5VEC_T2);
47
DEFINE_INTVEC(0x0033,INT6VEC_RESUME);
48
DEFINE_INTVEC(0x003b,INT7VEC_USART1);
49
DEFINE_INTVEC(0x0043,INT8VEC_USB);
50
DEFINE_INTVEC(0x004b,INT9VEC_I2C);
51
DEFINE_INTVEC(0x0053,INT10VEC_GPIF);
52
DEFINE_INTVEC(0x005b,INT11VEC_IE5);
53
DEFINE_INTVEC(0x0063,INT12VEC_IE6);
54
DEFINE_INTVEC(0x0100,INTVEC_SUDAV);
55
DEFINE_INTVEC(0x0104,INTVEC_SOF);
56
DEFINE_INTVEC(0x0108,INTVEC_SUTOK);
57
DEFINE_INTVEC(0x010C,INTVEC_SUSPEND);
58
DEFINE_INTVEC(0x0110,INTVEC_USBRESET);
59
DEFINE_INTVEC(0x0114,INTVEC_HISPEED);
60
DEFINE_INTVEC(0x0118,INTVEC_EP0ACK);
61
DEFINE_INTVEC(0x0120,INTVEC_EP0IN);
62
DEFINE_INTVEC(0x0124,INTVEC_EP0OUT);
63
DEFINE_INTVEC(0x0128,INTVEC_EP1IN);
64
DEFINE_INTVEC(0x012C,INTVEC_EP1OUT);
65
DEFINE_INTVEC(0x0130,INTVEC_EP2);
66
DEFINE_INTVEC(0x0134,INTVEC_EP4);
67
DEFINE_INTVEC(0x0138,INTVEC_EP6);
68
DEFINE_INTVEC(0x013C,INTVEC_EP8);
69
DEFINE_INTVEC(0x0140,INTVEC_IBN);
70
DEFINE_INTVEC(0x0148,INTVEC_EP0PING);
71
DEFINE_INTVEC(0x014C,INTVEC_EP1PING);
72
DEFINE_INTVEC(0x0150,INTVEC_EP2PING);
73
DEFINE_INTVEC(0x0154,INTVEC_EP4PING);
74
DEFINE_INTVEC(0x0158,INTVEC_EP6PING);
75
DEFINE_INTVEC(0x015C,INTVEC_EP8PING);
76
DEFINE_INTVEC(0x0160,INTVEC_ERRLIMIT);
77
DEFINE_INTVEC(0x0170,INTVEC_EP2ISOERR);
78
DEFINE_INTVEC(0x0174,INTVEC_EP4ISOERR);
79
DEFINE_INTVEC(0x0178,INTVEC_EP6ISOERR);
80
DEFINE_INTVEC(0x017C,INTVEC_EP8ISOERR);
81
DEFINE_INTVEC(0x0180,INTVEC_EP2PF);
82
DEFINE_INTVEC(0x0184,INTVEC_EP4PF);
83
DEFINE_INTVEC(0x0188,INTVEC_EP6PF);
84
DEFINE_INTVEC(0x018C,INTVEC_EP8PF);
85
DEFINE_INTVEC(0x0190,INTVEC_EP2EF);
86
DEFINE_INTVEC(0x0194,INTVEC_EP4EF);
87
DEFINE_INTVEC(0x0198,INTVEC_EP6EF);
88
DEFINE_INTVEC(0x019C,INTVEC_EP8EF);
89
DEFINE_INTVEC(0x01A0,INTVEC_EP2FF);
90
DEFINE_INTVEC(0x01A8,INTVEC_EP6FF);
91
DEFINE_INTVEC(0x01AC,INTVEC_EP8FF);
92
DEFINE_INTVEC(0x01B0,INTVEC_GPIFDONE);
93
DEFINE_INTVEC(0x01B4,INTVEC_GPIFWF);]
94
 
95
#define[DEFINE_INTVEC(][,$1);][__xdata __at $0 struct INTVEC $1;]
96
INTVECS;
97
#udefine[DEFINE_INTVEC(]
98
 
99
void abscode_intvec()// _naked
100
{
101
#define[DEFINE_INTVEC(][,$1);][    .org $0
102
        reti]
103
    __asm
104
    .area ABSCODE (ABS,CODE)
105
    .org 0x0000
106
ENTRY:
107
        ljmp #0x0200
108
INTVECS;
109
    .org 0x01b8
110
INTVEC_DUMMY:
111
        reti
112
    .area CSEG    (CODE)
113
    __endasm;
114
}
115
 
116
#udefine[INTVECS;]
117
#udefine[DEFINE_INTVEC(]
118
 
119
 
120
/* Init an interrupt vector */
121
#define[INIT_INTERRUPT_VECTOR(][,$1);][{
122
    $0.op=0x02;
123
    $0.addrH=((unsigned short)(&$1)) >> 8;
124
    $0.addrL=(unsigned short)(&$1);
125
}]
126
 
127
 
128
/* Enable USB autovectors */
129
#define[ENABLE_AVUSB;][{
130
    INT8VEC_USB.op=0x02;
131
    INT8VEC_USB.addrH = 0x01;
132
    INT8VEC_USB.addrL = 0xb8;
133
    INTSETUP |= 8;
134
}]
135
 
136
 
137
/* Disable USB autovectors */
138
#define[DISABLE_AVUSB;][INTSETUP &= ~8;]
139
 
140
 
141
/* Enable GPIF autovectors */
142
#define[ENABLE_AVGPIF;][{
143
    INT10VEC_GPIF.op=0x02;
144
    INT10VEC_GPIF.addrH = 0x01;
145
    INT10VEC_GPIF.addrL = 0xb8;
146
    INTSETUP |= 3;
147
}]
148
 
149
 
150
/* Disable GPIF autovectors */
151
#define[DISABLE_AVPGIF;][INTSETUP &= ~3;]
152
 
153
 
154
#endif   /* INTAVECS_H */

powered by: WebSVN 2.1.0

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