Dallas Semiconductor DS80C400 C Libraries Home Page

Main Page   Data Structures   File List   Data Fields   Globals  

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.

Defines

#define TINI400_ISR_VERSION   2
#define ISR_EXTERNALINT0   0
#define ISR_TIMER0   1
#define ISR_EXTERNALINT1   2
#define ISR_TIMER1   3
#define ISR_SERIAL0   4
#define ISR_TIMER2   5
#define ISR_POWERFAIL   6
#define ISR_SERIAL1   7
#define ISR_EXTERNALINT2345   8
#define ISR_TIMER3   9
#define ISR_SERIAL2   10
#define ISR_WRITEPROTECT   11
#define ISR_WATCHDOG   12
#define ISR_CAN0   13
#define ISR_ETHERNET   14
#define ISR_ETHERNETPOWER   15

Functions

void isr_setinterruptvector (int vector_number, void *function_ptr)
 Installs an interrupt vector.

void * isr_getinterruptvector (int vector_number)
 Gets the current value of an interrupt vector.

unsigned int isr_version (void)
 Returns the version number of this ISR library.


Define Documentation

#define ISR_CAN0   13
 

Interrupt vector number for the CAN 0 interrupt.

See also:
isr_setinterruptvector

isr_getinterruptvector

#define ISR_ETHERNET   14
 

Interrupt vector number for the Ethernet Activity interrupt.

See also:
isr_setinterruptvector

isr_getinterruptvector

#define ISR_ETHERNETPOWER   15
 

Interrupt vector number for the External Power Mode interrupt.

See also:
isr_setinterruptvector

isr_getinterruptvector

#define ISR_EXTERNALINT0   0
 

Interrupt vector number for the External Interrupt 0 interrupt.

See also:
isr_setinterruptvector

isr_getinterruptvector

#define ISR_EXTERNALINT1   2
 

Interrupt vector number for the External Interrupt 1 interrupt.

See also:
isr_setinterruptvector

isr_getinterruptvector

#define ISR_EXTERNALINT2345   8
 

Interrupt vector number for the External Interrupt 2/3/4/5 interrupt.

See also:
isr_setinterruptvector

isr_getinterruptvector

#define ISR_POWERFAIL   6
 

Interrupt vector number for the Power Fail interrupt.

See also:
isr_setinterruptvector

isr_getinterruptvector

#define ISR_SERIAL0   4
 

Interrupt vector number for the Serial Port 0 interrupt.

See also:
isr_setinterruptvector

isr_getinterruptvector

#define ISR_SERIAL1   7
 

Interrupt vector number for the Serial Port 1 interrupt.

See also:
isr_setinterruptvector

isr_getinterruptvector

#define ISR_SERIAL2   10
 

Interrupt vector number for the Serial Port 2 interrupt.

See also:
isr_setinterruptvector

isr_getinterruptvector

#define ISR_TIMER0   1
 

Interrupt vector number for the Timer 0 interrupt.

See also:
isr_setinterruptvector

isr_getinterruptvector

#define ISR_TIMER1   3
 

Interrupt vector number for the Timer 1 interrupt.

See also:
isr_setinterruptvector

isr_getinterruptvector

#define ISR_TIMER2   5
 

Interrupt vector number for the Timer 2 interrupt.

See also:
isr_setinterruptvector

isr_getinterruptvector

#define ISR_TIMER3   9
 

Interrupt vector number for the Timer 3 interrupt.

See also:
isr_setinterruptvector

isr_getinterruptvector

#define ISR_WATCHDOG   12
 

Interrupt vector number for the Watchdog Timer interrupt.

See also:
isr_setinterruptvector

isr_getinterruptvector

#define ISR_WRITEPROTECT   11
 

Interrupt vector number for the Write Protect interrupt.

See also:
isr_setinterruptvector

isr_getinterruptvector

#define TINI400_ISR_VERSION   2
 

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.


Copyright 2004 Dallas Semiconductor, Inc.. Documentation generated by Doxygen.