@CHIP-RTOS C Library V2.00 - Hardware API
hal_install_isr
Install Interrupt Service Routine InterruptHandler hal_install_isr ( unsigned short irq,
unsigned short count,
InterruptHandler handler ); Parameters
irq
- HAL interrupt number from following list:
0 = INT0 (external)
1 = Network controller (internal) (*)
2 = INT2 (external)
3 = INT3 (external)
4 = INT4 (external)
5 = INT5 (external) / DMA Channel Interrupt 0 (if DMA is used)
6 = INT6 (external) / DMA Channel Interrupt 1 (if DMA is used)
7 = reserved
8 = Timer0 (internal)
9 = Timer1 (internal)
10 = Timer 1ms (internal) (*)
11 = Serial port 0 (internal) (*)
12 = Serial port 1 (internal) (*)
13 = reserved
14 = reserved
15 = NMI (internal/external)
(* = internal used by @CHIP-RTOS, not available for user interrupt service functions)
count
- Number of interrupts generated before new
user interrupt service routine is called.
count = 0 disables the user ISR (same as a NULL in handler)
handler
- far pointer to user interrupt service routine
if pointer is NULL user ISR is disabled
Return Value
- Far pointer to old ISR handler
Comments
- The user-defined ISR is called from a system ISR with the interrupt
identifier number in the BX CPU register, thus allowing for a single user ISR to
handle multiple interrupt sources. The user ISR can be declared in either
of the following forms:
void huge My_ISR(void) ; // More efficient form
void interrupt My_ISR(void) ; // Tolerated form
The more efficient huge procedures are recommended.
The user ISR function must preserve only the DS and BP registers, so
there is no requirement for the full register save/restore provided by the
interrupt declarations.
Any required EOI signal is issued by the system ISR which calls your user ISR
function. This EOI is issued after your function returns.
The InterruptHandler
vector type is defined as:
typedef void (far *InterruptHandler)(void);
RTOS API
- This library function invokes a RTOS software interrupt.
Refer to this RTOS API function's
documentation
for more details.
This API List
List of C Libraries
@CHIP-RTOS Main Index
End of document
|