www.beck-ipc.com

@CHIP-RTOS C Library - Hardware API


hal_install_isr

Install Interrupt Service Routine.

InterruptHandler hal_install_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)

    (*) = used internally 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)

    (*) = used internally by @CHIP-RTOS, not available for user interrupt service functions

SC2x 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)

    (*) = used internally 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.

The InterruptHandler vector type is defined as:

    typedef void huge (far *InterruptHandler)(void);

See Also

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

    SC12SC13SC11SC1x3SC2x
    V1.00V1.00V1.00V0.90V1.00

This API List
List of C Libraries
@CHIP-RTOS Main Index


End of document