@CHIP-RTOS C Library V2.06 - 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
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
SC1x 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 Interrupt Channel 0 (if DMA is used)
6 = INT6 (external) / DMA Interrupt Channel 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 = (*) DMA Interrupt Channel 2 (internal, not on SC12)
14 = (*) DMA Interrupt Channel 3 (internal, not on SC12)
15 = NMI Powerfail Interrupt (internal/external)
(*) = internal used by @CHIP-RTOS, not available for user interrupt service functions
SC1x3 Parameters
- irq
- HAL interrupt number from following list:
0 = (*) Network controller 0 (internal)
1 = INT1 (external)
2 = SPI controller (internal)
3 = INT3 (external) / (*) USB controller (internal)
4 = (*) Serial port 2 (internal)
5 = DMA Interrupt Channel 0
6 = DMA Interrupt Channel 1
7 = INT5 (external) / (*) Serial port 3 (internal)
8 = Timer0 (internal)
9 = Timer1 (internal)
10 = (*) Timer 1ms (internal)
11 = (*) Serial port 0 (internal)
12 = (*) Serial port 1 (internal)
13 = DMA Interrupt Channel 2
14 = DMA Interrupt Channel 3
15 = PFI Powerfail Interrupt (internal/external)
16 = (*) CAN0 controller (internal) / (*) CAN1 controller (internal)
17 = I2C controller (internal)
18 = Network controller 1 (internal)
(*) = internal used by @CHIP-RTOS, not available for user interrupt service functions
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:
Important Notes:
The RTX ISR is slower than a normal ISR.
The InterruptHandler
vector type is defined as:
typedef void (far *InterruptHandler)(void);
SC1x Comments- Using RTX ISR are not recommended for INT5 or INT6 if DMA is used by the
Fossil
serial ports interface, because the slower RTX ISR could
result in UART receiver character loss.
If you are using a RTX ISR for timer0, timer1, INT5 or INT6 there must not exist
a normal ISR on the system which enables the interrupts during its execution!
Do not install a RTX ISR for the powerfail interrupt!
Also important
: The NMI function of the multifunction
pin 17 (RESET/NMI/LINK_LED) of the IPC@CHIP® SC11/SC12/SC13 is for
power fail purposes only.
It is not possible to use NMI as a "normal" interrupt pin like INT0 for
generating interrupts.
It can only be used as described in the IPC@CHIP® hardware documentation.
SC1x3 Comments- INT1 and network controller 1 share the same interrupt. Due to this fact,
the installed user interrupt service routines for INT1 and network controller 1 must
be of same type. If the network controller 1 is used both ISRs must be of type RTX ISR.
RTOS API
- This library function invokes a RTOS software interrupt.
Refer to this RTOS API function's
documentation
for more details.
Supported since or modified in @CHIP-RTOS version-
SC12 | SC13 | SC11 | SC1x3 |
-
V1.00 | V1.00 | V1.00 | V0.90 |
This API List
List of C Libraries
@CHIP-RTOS Main Index
End of document
|