@CHIP-RTOS C Library V2.00 - Hardware API
hal_install_rtx_isr
Install RTX Interrupt Service Routine InterruptHandler hal_install_rtx_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.
RTX ISR: If you install a RTX ISR you can use the follwing RTX Calls in your ISR:
RTX_RESTART_TASK
RTX_WAKEUP_TASK
RTX_SIGNAL_SEM
RTX_SIGNAL_EVENTS
RTX_SEND_MSG
RTX_START_TIMER
RTX_STOP_TIMER
RTX_REMOVE_TIMER
Important Note:
Notice that a RTX ISR is slower than normal ISR. Also we recommend to do not use
RTX ISR for INT5 and INT6. These interrupts are also used internal for
the fossil interface. Using them linked with RTX ISR characters could be
get lost (because of the longer execution time of a RTX ISR).
If you are using a RTX ISR for timer0, timer1, INT5 or INT6 there must not exist
a normal ISR on the system which frees the interrupts while its execution!
Do not install a RTX ISR for NMI.!
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
|