Dallas Semiconductor DS80C400 C Libraries Home Page
tini400_isr.h File Reference
Detailed Description
Interrupt Service Routine installation functions.
This library contains functions that allow processes to install their own ISR's from C programs. Normally, the Keil compiler would automatically install interrupts in their proper locations. However, the act of initializing the ROM sets the entire interrupt vector table, so any interrupt vector that the Keil compiler generates are destroyed. These functions allow programs to restore or update their interrupt vector tables.
To use interrupts written in C with the Keil compiler, functions should be defined with the interrupt keyword. Also, under the Project Target options dialog, under the C51 panel, uncheck the box labeled Interrupt Vectors at Address:. Then make sure to call isr_setinterruptvector sometime after init_rom has been called.
For detailed information on the DS80C400 please see the High-Speed Microcontroller User's Guide: DS80C400 Supplement.
The functions in this library are multi-process safe--that is, if you call the same method from two different processes at the same time, the parameters to the function will not be destroyed.
Go to the source code of this file.
Define Documentation
| #define ISR_CANBUSACTIVITY 15 |
|
| #define ISR_ETHERNETPOWER 15 |
|
| #define ISR_EXTERNALINT0 0 |
|
| #define ISR_EXTERNALINT1 2 |
|
| #define ISR_EXTERNALINT2 8 |
|
| #define ISR_EXTERNALINT2345 8 |
|
| #define ISR_EXTERNALINT3 9 |
|
| #define ISR_EXTERNALINT4 10 |
|
| #define ISR_EXTERNALINT5 11 |
|
| #define ISR_WRITEPROTECT 11 |
|
| #define TINI400_ISR_VERSION 4 |
|
|
|
Version number associated with this header file. Should be the same as the version number returned by the isr_version function. - See also:
- isr_version
|
Function Documentation
| void* isr_getinterruptvector |
( |
int |
vector_number |
) |
|
|
|
|
Gets the current value of an interrupt vector.
Returns a function pointer to the interrupt service routine for the interrupt defined by vector_number. Note that vector_number is NOT the address of the interrupt, but the number corresponding to that interrupt as described in the Keil documentation. For example, a vector_number of 1 corresponds to the interrupt at address 0Bh, which is the timer 0 overflow interrupt. A vector_number of 4 corresponds to the interrupt at address 23h, which is the serial port 0 interrupt.
This file contains several defines for common interrupts that can be used for the vector_number parameter.
- Parameters:
-
| vector_number | ID of the interrupt to be installed. It is up to the user to make sure this parameter is in range |
- Returns:
- function pointer for the interrupt service routine. Returns NULL if the instruction at the interrupt's address is not an
LJMP.
- See also:
- isr_setinterruptvector
|
| void isr_setinterruptvector |
( |
int |
vector_number, |
|
|
void * |
function_ptr |
|
) |
|
|
|
|
Installs an interrupt vector.
Installs the function function_ptr as the interrupt service routine for the interrupt defined by vector_number. Note that vector_number is NOT the address of the interrupt, but the number corresponding to that interrupt as described in the Keil documentation. For example, a vector_number of 1 corresponds to the interrupt at address 0Bh, which is the timer 0 overflow interrupt. A vector_number of 4 corresponds to the interrupt at address 23h, which is the serial port 0 interrupt.
This file contains several defines for common interrupts that can be used for the vector_number parameter.
The function function_ptr should terminate with a reti statement (functions declared with the interrupt keyword in Keil automatically have this).
- Parameters:
-
| vector_number | ID of the interrupt to be installed. It is up to the user to make sure this parameter is in range |
| function_ptr | function that will be the interrupt service routine |
- See also:
- isr_getinterruptvector
|
| unsigned int isr_version |
( |
void |
|
) |
|
|
|
|
Returns the version number of this ISR library.
- Returns:
- Version number of this ISR library.
|