fx2ints.h¶
The fx2ints.h
header contains interrupt handler declarations for the Cypress FX2 series.
Interrupt handler resolution¶
By including the fx2ints.h
header, which declares every interrupt handler, your firmware requests the linker to locate a handler for every interrupt. If you provide a handler explicitly, this handler will be used; if you do not, the linker will go through the list of libraries, looking for the first one that includes a handler. The library fx2isrs.lib
provides a default empty handler for every interrupt (as well as autovectoring jump tables) and should be linked last into every firmware.
Core interrupt handlers¶
To define a core interrupt handler, override the corresponding isr_
function and provide the interrupt number in the __interrupt
attribute, e.g. for the TF0
interrupt:
void isr_TF0() __interrupt(_INT_TF0) {
// TIMER0 has overflowed
}
Interrupts with flags in the EXIF
register need to be reset manually:
void isr_I2C() __interrupt(_INT_I2C) {
// I2C is done or errored
CLEAR_I2C_IRQ();
}
Autovectored interrupt handlers¶
To define an autovectored interrupt handler, override the corresponding isr_
function and provide the __interrupt
attribute without a number, e.g. for the SOF
interrupt:
void isr_SOF() __interrupt {
// Start of Frame packet has been received
CLEAR_USB_IRQ();
USBIRQ = _SOF;
}
Note
The order of clearing of the IRQ flags is important.
Reference¶
8051 core interrupts
-
CLEAR_I2C_IRQ()¶
Clears the I2C interrupt request.
-
CLEAR_INT4_IRQ()¶
Clears the INT4# interrupt request.
-
CLEAR_INT5_IRQ()¶
Clears the INT5# interrupt request.
- void isr_IE0 () __interrupt(_INT_IE0)
- void isr_TF0 () __interrupt(_INT_TF0)
- void isr_IE1 () __interrupt(_INT_IE1)
- void isr_TF1 () __interrupt(_INT_TF1)
- void isr_RI_TI_0 () __interrupt(_INT_RI_TI_0)
- void isr_TF2 () __interrupt(_INT_TF2)
- void isr_RESUME () __interrupt(_INT_RESUME)
- void isr_RI_TI_1 () __interrupt(_INT_RI_TI_1)
- void isr_USB () __interrupt(_INT_USB)
- void isr_I2C () __interrupt(_INT_I2C)
- void isr_GPIF_IE4 () __interrupt(_INT_GPIF_IE4)
- void isr_IE5 () __interrupt(_INT_IE5)
- void isr_IE6 () __interrupt(_INT_IE6)
Autovectored USB interrupts
-
ENABLE_USB_AUTOVEC()¶
Enables the autovectored USB interrupt and the corresponding jump table.
-
CLEAR_USB_IRQ()¶
Clears the main USB interrupt request. This must be done before clearing the individual USB interrupt request latch.
- void isr_SUDAV () __interrupt
- void isr_SOF () __interrupt
- void isr_SUTOK () __interrupt
- void isr_SUSPEND () __interrupt
- void isr_USBRESET () __interrupt
- void isr_HISPEED () __interrupt
- void isr_EP0ACK () __interrupt
- void isr_EP0IN () __interrupt
- void isr_EP0OUT () __interrupt
- void isr_EP1IN () __interrupt
- void isr_EP1OUT () __interrupt
- void isr_EP2 () __interrupt
- void isr_EP4 () __interrupt
- void isr_EP6 () __interrupt
- void isr_EP8 () __interrupt
- void isr_IBN () __interrupt
- void isr_EP0PING () __interrupt
- void isr_EP1PING () __interrupt
- void isr_EP2PING () __interrupt
- void isr_EP4PING () __interrupt
- void isr_EP6PING () __interrupt
- void isr_EP8PING () __interrupt
- void isr_ERRLIMIT () __interrupt
- void isr_EP2ISOERR () __interrupt
- void isr_EP4ISOERR () __interrupt
- void isr_EP6ISOERR () __interrupt
- void isr_EP8ISOERR () __interrupt
Autovectored GPIF interrupts
-
ENABLE_GPIF_AUTOVEC()¶
Enables the autovectored GPIF interrupt and the corresponding jump table. Note that this makes it impossible to provide an INT4 handler.
-
CLEAR_GPIF_IRQ()¶
Clears the main GPIF interrupt request. This must be done before clearing the individual GPIF interrupt request latch.
- void isr_EP2PF () __interrupt
- void isr_EP4PF () __interrupt
- void isr_EP6PF () __interrupt
- void isr_EP8PF () __interrupt
- void isr_EP2EF () __interrupt
- void isr_EP4EF () __interrupt
- void isr_EP6EF () __interrupt
- void isr_EP8EF () __interrupt
- void isr_EP2FF () __interrupt
- void isr_EP4FF () __interrupt
- void isr_EP6FF () __interrupt
- void isr_EP8FF () __interrupt
- void isr_GPIFDONE () __interrupt
- void isr_GPIFWF () __interrupt
Enums
-
enum fx2_core_interrupt¶
Values:
-
enumerator _INT_IE0¶
-
enumerator _INT_TF0¶
-
enumerator _INT_IE1¶
-
enumerator _INT_TF1¶
-
enumerator _INT_RI_TI_0¶
-
enumerator _INT_TF2¶
-
enumerator _INT_RESUME¶
-
enumerator _INT_RI_TI_1¶
-
enumerator _INT_USB¶
-
enumerator _INT_I2C¶
-
enumerator _INT_GPIF_IE4¶
-
enumerator _INT_IE5¶
-
enumerator _INT_IE6¶
-
enumerator _INT_IE0¶