USB-BDI
Defines | Functions
M:/USB-BDI/USB-BDI/Firmware/MPC555-USB-BDI/include/isr.h File Reference

Headerfile for isr.c. More...

Go to the source code of this file.

Defines

#define SV_INT_0   0x03
#define SV_TIMER_0   0x0b
#define SV_INT_1   0x13
#define SV_TIMER_1   0x1b
#define SV_SERIAL_0   0x23
#define SV_TIMER_2   0x2b
#define SV_RESUME   0x33
#define SV_SERIAL_1   0x3b
#define SV_INT_2   0x43
#define SV_I2C   0x4b
#define SV_INT_4   0x53
#define SV_INT_5   0x5b
#define SV_INT_6   0x63
#define SV_MIN   SV_INT_0
#define SV_MAX   SV_INT_6
#define UV_SUDAV   0x00
#define UV_SOF   0x04
#define UV_SUTOK   0x08
#define UV_SUSPEND   0x0c
#define UV_USBRESET   0x10
#define UV_HIGHSPEED   0x14
#define UV_EP0ACK   0x18
#define UV_SPARE_1C   0x1c
#define UV_EP0IN   0x20
#define UV_EP0OUT   0x24
#define UV_EP1IN   0x28
#define UV_EP1OUT   0x2c
#define UV_EP2   0x30
#define UV_EP4   0x34
#define UV_EP6   0x38
#define UV_EP8   0x3c
#define UV_IBN   0x40
#define UV_SPARE_44   0x44
#define UV_EP0PINGNAK   0x48
#define UV_EP1PINGNAK   0x4c
#define UV_EP2PINGNAK   0x50
#define UV_EP4PINGNAK   0x54
#define UV_EP6PINGNAK   0x58
#define UV_EP8PINGNAK   0x5c
#define UV_ERRLIMIT   0x60
#define UV_SPARE_64   0x64
#define UV_SPARE_68   0x68
#define UV_SPARE_6C   0x6c
#define UV_EP2ISOERR   0x70
#define UV_EP4ISOERR   0x74
#define UV_EP6ISOERR   0x78
#define UV_EP8ISOERR   0x7c
#define UV_MIN   UV_SUDAV
#define UV_MAX   UV_EP8ISOERR
#define FGV_EP2PF   0x80
#define FGV_EP4PF   0x84
#define FGV_EP6PF   0x88
#define FGV_EP8PF   0x8c
#define FGV_EP2EF   0x90
#define FGV_EP4EF   0x94
#define FGV_EP6EF   0x98
#define FGV_EP8EF   0x9c
#define FGV_EP2FF   0xa0
#define FGV_EP4FF   0xa4
#define FGV_EP6FF   0xa8
#define FGV_EP8FF   0xac
#define FGV_GPIFDONE   0xb0
#define FGV_GPIFWF   0xb4
#define FGV_MIN   FGV_EP2PF
#define FGV_MAX   FGV_GPIFWF
#define clear_usb_irq()
#define clear_fifo_gpif_irq()

Functions

void hook_sv (unsigned char vector_number, unsigned short addr)
 Hook standard interrupt vector.
void hook_uv (unsigned char vector_number, unsigned short addr)
 Hook usb interrupt vector.
void hook_fgv (unsigned char vector_number, unsigned short addr)
 Hook fifo/gpif interrupt vector.
void setup_autovectors (void)
 One time call to enable autovectoring for both USB and FIFO/GPIF.

Detailed Description

Headerfile for isr.c.

The FX2 has three discrete sets of interrupt vectors. The first set is the standard 8051 vector (13 8-byte entries). The second set is USB interrupt autovector (32 4-byte entries). The third set is the FIFO/GPIF autovector (14 4-byte entries).

Since all the code we're running in the FX2 is ram based, we forego the typical "initialize the interrupt vectors at link time" strategy, in favor of calls at run time that install the correct pointers to functions.

Author:
Schlaepfer Stephan
Version:
1.0
Date:
18.1.2006

Definition in file isr.h.


Define Documentation

#define clear_fifo_gpif_irq ( )
Value:
EXIF &= ~bmEXIF_IE4;            \
        INT4CLR = 0

Must be calledin each fifo/gpif interrupt handler

Definition at line 223 of file isr.h.

#define clear_usb_irq ( )
Value:
EXIF &= ~bmEXIF_USBINT;         \
        INT2CLR = 0

Must be called in each usb interrupt handler

Definition at line 216 of file isr.h.

#define FGV_EP2EF   0x90

See CY7C68013A datasheet under 4.8 FIFO/GPIF InterruptAutovectors

Definition at line 158 of file isr.h.

#define FGV_EP2FF   0xa0

See CY7C68013A datasheet under 4.8 FIFO/GPIF InterruptAutovectors

Definition at line 166 of file isr.h.

#define FGV_EP2PF   0x80

See CY7C68013A datasheet under 4.8 FIFO/GPIF InterruptAutovectors

Definition at line 150 of file isr.h.

#define FGV_EP4EF   0x94

See CY7C68013A datasheet under 4.8 FIFO/GPIF InterruptAutovectors

Definition at line 160 of file isr.h.

#define FGV_EP4FF   0xa4

See CY7C68013A datasheet under 4.8 FIFO/GPIF InterruptAutovectors

Definition at line 168 of file isr.h.

#define FGV_EP4PF   0x84

See CY7C68013A datasheet under 4.8 FIFO/GPIF InterruptAutovectors

Definition at line 152 of file isr.h.

#define FGV_EP6EF   0x98

See CY7C68013A datasheet under 4.8 FIFO/GPIF InterruptAutovectors

Definition at line 162 of file isr.h.

#define FGV_EP6FF   0xa8

See CY7C68013A datasheet under 4.8 FIFO/GPIF InterruptAutovectors

Definition at line 170 of file isr.h.

#define FGV_EP6PF   0x88

See CY7C68013A datasheet under 4.8 FIFO/GPIF InterruptAutovectors

Definition at line 154 of file isr.h.

#define FGV_EP8EF   0x9c

See CY7C68013A datasheet under 4.8 FIFO/GPIF InterruptAutovectors

Definition at line 164 of file isr.h.

#define FGV_EP8FF   0xac

See CY7C68013A datasheet under 4.8 FIFO/GPIF InterruptAutovectors

Definition at line 172 of file isr.h.

#define FGV_EP8PF   0x8c

See CY7C68013A datasheet under 4.8 FIFO/GPIF InterruptAutovectors

Definition at line 156 of file isr.h.

#define FGV_GPIFDONE   0xb0

See CY7C68013A datasheet under 4.8 FIFO/GPIF InterruptAutovectors

Definition at line 174 of file isr.h.

#define FGV_GPIFWF   0xb4

See CY7C68013A datasheet under 4.8 FIFO/GPIF InterruptAutovectors

Definition at line 176 of file isr.h.

#define FGV_MAX   FGV_GPIFWF

Maximum value for the FIFO/GPIF vector number

Definition at line 181 of file isr.h.

#define FGV_MIN   FGV_EP2PF

Minimum value for the FIFO/GPIF vector number

Definition at line 179 of file isr.h.

#define SV_I2C   0x4b

See CY7C68013A datasheet under 4.1 Interrupt Introduction

Definition at line 61 of file isr.h.

#define SV_INT_0   0x03

See CY7C68013A datasheet under 4.1 Interrupt Introduction

Definition at line 43 of file isr.h.

#define SV_INT_1   0x13

See CY7C68013A datasheet under 4.1 Interrupt Introduction

Definition at line 47 of file isr.h.

#define SV_INT_2   0x43

(INT_2) points at USB autovector

Definition at line 59 of file isr.h.

#define SV_INT_4   0x53

(INT_4) points at FIFO/GPIF autovector

Definition at line 63 of file isr.h.

#define SV_INT_5   0x5b

See CY7C68013A datasheet under 4.1 Interrupt Introduction

Definition at line 65 of file isr.h.

#define SV_INT_6   0x63

See CY7C68013A datasheet under 4.1 Interrupt Introduction

Definition at line 67 of file isr.h.

#define SV_MAX   SV_INT_6

Maximum value for the standart vector number

Definition at line 71 of file isr.h.

#define SV_MIN   SV_INT_0

Minimum value for the standart vector number

Definition at line 69 of file isr.h.

#define SV_RESUME   0x33

See CY7C68013A datasheet under 4.1 Interrupt Introduction

Definition at line 55 of file isr.h.

#define SV_SERIAL_0   0x23

See CY7C68013A datasheet under 4.1 Interrupt Introduction

Definition at line 51 of file isr.h.

#define SV_SERIAL_1   0x3b

See CY7C68013A datasheet under 4.1 Interrupt Introduction

Definition at line 57 of file isr.h.

#define SV_TIMER_0   0x0b

See CY7C68013A datasheet under 4.1 Interrupt Introduction

Definition at line 45 of file isr.h.

#define SV_TIMER_1   0x1b

See CY7C68013A datasheet under 4.1 Interrupt Introduction

Definition at line 49 of file isr.h.

#define SV_TIMER_2   0x2b

See CY7C68013A datasheet under 4.1 Interrupt Introduction

Definition at line 53 of file isr.h.

#define UV_EP0ACK   0x18

See CY7C68013A datasheet under 4.5 USB-Interrupt Autovectors

Definition at line 89 of file isr.h.

#define UV_EP0IN   0x20

See CY7C68013A datasheet under 4.5 USB-Interrupt Autovectors

Definition at line 93 of file isr.h.

#define UV_EP0OUT   0x24

See CY7C68013A datasheet under 4.5 USB-Interrupt Autovectors

Definition at line 95 of file isr.h.

#define UV_EP0PINGNAK   0x48

See CY7C68013A datasheet under 4.5 USB-Interrupt Autovectors

Definition at line 113 of file isr.h.

#define UV_EP1IN   0x28

See CY7C68013A datasheet under 4.5 USB-Interrupt Autovectors

Definition at line 97 of file isr.h.

#define UV_EP1OUT   0x2c

See CY7C68013A datasheet under 4.5 USB-Interrupt Autovectors

Definition at line 99 of file isr.h.

#define UV_EP1PINGNAK   0x4c

See CY7C68013A datasheet under 4.5 USB-Interrupt Autovectors

Definition at line 115 of file isr.h.

#define UV_EP2   0x30

See CY7C68013A datasheet under 4.5 USB-Interrupt Autovectors

Definition at line 101 of file isr.h.

#define UV_EP2ISOERR   0x70

See CY7C68013A datasheet under 4.5 USB-Interrupt Autovectors

Definition at line 133 of file isr.h.

#define UV_EP2PINGNAK   0x50

See CY7C68013A datasheet under 4.5 USB-Interrupt Autovectors

Definition at line 117 of file isr.h.

#define UV_EP4   0x34

See CY7C68013A datasheet under 4.5 USB-Interrupt Autovectors

Definition at line 103 of file isr.h.

#define UV_EP4ISOERR   0x74

See CY7C68013A datasheet under 4.5 USB-Interrupt Autovectors

Definition at line 135 of file isr.h.

#define UV_EP4PINGNAK   0x54

See CY7C68013A datasheet under 4.5 USB-Interrupt Autovectors

Definition at line 119 of file isr.h.

#define UV_EP6   0x38

See CY7C68013A datasheet under 4.5 USB-Interrupt Autovectors

Definition at line 105 of file isr.h.

#define UV_EP6ISOERR   0x78

See CY7C68013A datasheet under 4.5 USB-Interrupt Autovectors

Definition at line 137 of file isr.h.

#define UV_EP6PINGNAK   0x58

See CY7C68013A datasheet under 4.5 USB-Interrupt Autovectors

Definition at line 121 of file isr.h.

#define UV_EP8   0x3c

See CY7C68013A datasheet under 4.5 USB-Interrupt Autovectors

Definition at line 107 of file isr.h.

#define UV_EP8ISOERR   0x7c

See CY7C68013A datasheet under 4.5 USB-Interrupt Autovectors

Definition at line 139 of file isr.h.

#define UV_EP8PINGNAK   0x5c

See CY7C68013A datasheet under 4.5 USB-Interrupt Autovectors

Definition at line 123 of file isr.h.

#define UV_ERRLIMIT   0x60

See CY7C68013A datasheet under 4.5 USB-Interrupt Autovectors

Definition at line 125 of file isr.h.

#define UV_HIGHSPEED   0x14

See CY7C68013A datasheet under 4.5 USB-Interrupt Autovectors

Definition at line 87 of file isr.h.

#define UV_IBN   0x40

See CY7C68013A datasheet under 4.5 USB-Interrupt Autovectors

Definition at line 109 of file isr.h.

#define UV_MAX   UV_EP8ISOERR

Maximum value for the usb vector number

Definition at line 143 of file isr.h.

#define UV_MIN   UV_SUDAV

Minimum value for the usb vector number

Definition at line 141 of file isr.h.

#define UV_SOF   0x04

See CY7C68013A datasheet under 4.5 USB-Interrupt Autovectors

Definition at line 79 of file isr.h.

#define UV_SPARE_1C   0x1c

See CY7C68013A datasheet under 4.5 USB-Interrupt Autovectors

Definition at line 91 of file isr.h.

#define UV_SPARE_44   0x44

See CY7C68013A datasheet under 4.5 USB-Interrupt Autovectors

Definition at line 111 of file isr.h.

#define UV_SPARE_64   0x64

See CY7C68013A datasheet under 4.5 USB-Interrupt Autovectors

Definition at line 127 of file isr.h.

#define UV_SPARE_68   0x68

See CY7C68013A datasheet under 4.5 USB-Interrupt Autovectors

Definition at line 129 of file isr.h.

#define UV_SPARE_6C   0x6c

See CY7C68013A datasheet under 4.5 USB-Interrupt Autovectors

Definition at line 131 of file isr.h.

#define UV_SUDAV   0x00

See CY7C68013A datasheet under 4.5 USB-Interrupt Autovectors

Definition at line 77 of file isr.h.

#define UV_SUSPEND   0x0c

See CY7C68013A datasheet under 4.5 USB-Interrupt Autovectors

Definition at line 83 of file isr.h.

#define UV_SUTOK   0x08

See CY7C68013A datasheet under 4.5 USB-Interrupt Autovectors

Definition at line 81 of file isr.h.

#define UV_USBRESET   0x10

See CY7C68013A datasheet under 4.5 USB-Interrupt Autovectors

Definition at line 85 of file isr.h.


Function Documentation

void hook_fgv ( unsigned char  vector_number,
unsigned short  addr 
)

Hook fifo/gpif interrupt vector.

vector_number is from the FGV_<foo> list. addr is the address of the interrupt service routine.

Parameters:
vector_numbervector_number is from the SV_<foo> list in the header file.
addris the address of the interrupt service routine.

Definition at line 103 of file isr.c.

void hook_sv ( unsigned char  vector_number,
unsigned short  addr 
)

Hook standard interrupt vector.

vector_number is from the SV_<foo> list. addr is the address of the interrupt service routine.

Parameters:
vector_numbervector_number is from the SV_<foo> list in the header file.
addris the address of the interrupt service routine.

Definition at line 49 of file isr.c.

void hook_uv ( unsigned char  vector_number,
unsigned short  addr 
)

Hook usb interrupt vector.

vector_number is from the UV_<foo> list. addr is the address of the interrupt service routine.

Parameters:
vector_numbervector_number is from the SV_<foo> list in the header file.
addris the address of the interrupt service routine.

Definition at line 76 of file isr.c.

void setup_autovectors ( void  )

One time call to enable autovectoring for both USB and FIFO/GPIF.

This disables all USB and FIFO/GPIF interrupts and clears any pending interrupts too. It leaves the master USB and FIFO/GPIF interrupts enabled.

Definition at line 129 of file isr.c.

 All Files Functions Variables Defines