hsk-libs-dev  270
High Speed Karlsruhe XC878 library collection
Macros | Functions | Variables
hsk_isr.c File Reference

HSK Shared Interrupt Service Routine implementation. More...

#include <Infineon/XC878.h>
#include "hsk_isr.h"
Include dependency graph for hsk_isr.c:

Macros

#define BIT_RMAP   0
 SYSCON0 Special Function Register Map Control bit. More...
 
#define BIT_TF2   7
 T2_T2CON Timer 2 Overflow bit. More...
 
#define BIT_EXF2   6
 T2_T2CON T2EX bit. More...
 
#define BIT_CCTOVF   3
 T2CCU_CCTCON CCT Overflow bit. More...
 
#define BIT_NDOV   2
 FDCON Normal Divider Overflow bit. More...
 
#define BIT_EOFSYN   4
 FDCON End of Syn Byte bit. More...
 
#define BIT_ERRSYN   5
 FDCON Syn Byte Error bit. More...
 
#define BIT_CANSRC0   0
 IRCON2 MultiCAN Node 0 bit. More...
 
#define BIT_CANSRC1   5
 IRCON1 Interrupt Flag 1 for MultiCAN bit. More...
 
#define BIT_CANSRC2   6
 IRCON1 Interrupt Flag 2 for MultiCAN bit. More...
 
#define BIT_ADCSR0   3
 IRCON1 Interrupt Flag 0 for ADC bit. More...
 
#define BIT_ADCSR1   4
 IRCON1 Interrupt Flag 1 for ADC bit. More...
 
#define BIT_EXINT2   2
 IRCON0 Interrupt Flag for External Interrupt 2 bit. More...
 
#define BIT_RI   0
 SCON Serial Interface Receiver Interrupt Flag. More...
 
#define BIT_TI   1
 SCON Serial Interface Transmitter Interrupt Flag. More...
 
#define BIT_TF2   7
 T2_T2CON Timer 2 Overflow bit. More...
 
#define BIT_EXF2   6
 T2_T2CON T2EX bit. More...
 
#define BIT_NDOV   2
 FDCON Normal Divider Overflow bit. More...
 
#define BIT_EOC   2
 CD_STATC End of Calculation Flag. More...
 
#define BIT_IRDY   0
 MDU_MDUSTAT Interrupt on Result Ready bit. More...
 
#define BIT_IERR   1
 MDU_MDUSTAT Interrupt on Error bit. More...
 
#define BIT_EXINT3   3
 IRCON0 Interrupt Flag for External Interrupt 3 or T2CC0 Capture/Compare Channel bit. More...
 
#define BIT_EXINT4   4
 IRCON0 Interrupt Flag for External Interrupt 4 or T2CC1 Capture/Compare Channel bit. More...
 
#define BIT_EXINT5   5
 IRCON0 Interrupt Flag for External Interrupt 5 or T2CC2 Capture/Compare Channel bit. More...
 
#define BIT_EXINT6   6
 IRCON0 Interrupt Flag for External Interrupt 6 or T2CC3 Capture/Compare Channel bit. More...
 
#define BIT_CANSRC3   4
 IRCON2 Interrupt Flag 3 for MultiCAN bit. More...
 
#define BIT_NMIWDT   0
 NMISR Watchdog Timer NMI Flag bit. More...
 
#define BIT_NMIPLL   1
 NMISR PLL NMI Flag bit. More...
 
#define BIT_NMIFLASH   2
 NMISR FLASH Timer NMI Flag bit. More...
 
#define BIT_NMIVDDP   5
 NMISR VDDP Prewarning NMI Flag bit. More...
 
#define BIT_NMIECC   6
 NMISR ECC NMI Flag bit. More...
 

Functions

void hsk_isr_root1 (void)
 This is a dummy function used for putting register bank 1 using ISRs into a common call tree for C51. More...
 
void dummy (void)
 This is a dummy function to point unused function pointers to. More...
 
void nmidummy (void)
 This is a dummy function to point unused function pointers to. More...
 
void ISR_hsk_isr5 (void)
 Shared interrupt 5 routine. More...
 
void ISR_hsk_isr6 (void)
 Shared interrupt 6 routine. More...
 
void ISR_hsk_isr8 (void)
 Shared interrupt 8 routine. More...
 
void ISR_hsk_isr9 (void)
 Shared interrupt 9 routine. More...
 
void ISR_hsk_isr14 (void)
 Shared non-maskable interrupt routine. More...
 

Variables

volatile struct hsk_isr5_callback hsk_isr5 = {&dummy, &dummy, &dummy, &dummy, &dummy, &dummy, &dummy}
 Define callback function pointers for ISR 5. More...
 
volatile struct hsk_isr6_callback hsk_isr6 = {&dummy, &dummy, &dummy, &dummy}
 Define callback function pointers for ISR 6. More...
 
volatile struct hsk_isr8_callback hsk_isr8 = {&dummy, &dummy, &dummy, &dummy, &dummy, &dummy, &dummy, &dummy, &dummy}
 Define callback function pointers for ISR 8. More...
 
volatile struct hsk_isr9_callback hsk_isr9 = {&dummy, &dummy, &dummy, &dummy, &dummy}
 Define callback function pointers for ISR 9. More...
 
volatile struct hsk_isr14_callback hsk_isr14 = {&nmidummy, &nmidummy, &nmidummy, &nmidummy, &nmidummy}
 Define callback function pointers for NMI ISR. More...
 

Detailed Description

HSK Shared Interrupt Service Routine implementation.

This contains interrupts, shared between several interrupt sources. These interrupt sources can hook into the ISRs by storing a callback function in the hsk_isr* data structures.

Author
kami

ISR Callback Reaction Time

The following table describes what happens up to the point that the NMI ISR starts operation (based on SDCC code):

CCLK CyclesTask Instruction Duration
0 Core: Poll interrupt request 2
2 Core: Call ISR lcall 1 x 4
6 ISR setup: Push registers 6 x push 6 x 4
30 ISR setup: Reset PSW 1 x mov dir,# 1 x 4
34 ISR: Backup RMAP 3 x 2 + 4
44 ISR: Reset RMAP 2 x 2 + 4
52 ISR: Select callback

Macro Definition Documentation

§ BIT_ADCSR0

#define BIT_ADCSR0   3

IRCON1 Interrupt Flag 0 for ADC bit.

§ BIT_ADCSR1

#define BIT_ADCSR1   4

IRCON1 Interrupt Flag 1 for ADC bit.

§ BIT_CANSRC0

#define BIT_CANSRC0   0

IRCON2 MultiCAN Node 0 bit.

§ BIT_CANSRC1

#define BIT_CANSRC1   5

IRCON1 Interrupt Flag 1 for MultiCAN bit.

§ BIT_CANSRC2

#define BIT_CANSRC2   6

IRCON1 Interrupt Flag 2 for MultiCAN bit.

§ BIT_CANSRC3

#define BIT_CANSRC3   4

IRCON2 Interrupt Flag 3 for MultiCAN bit.

§ BIT_CCTOVF

#define BIT_CCTOVF   3

T2CCU_CCTCON CCT Overflow bit.

§ BIT_EOC

#define BIT_EOC   2

CD_STATC End of Calculation Flag.

§ BIT_EOFSYN

#define BIT_EOFSYN   4

FDCON End of Syn Byte bit.

§ BIT_ERRSYN

#define BIT_ERRSYN   5

FDCON Syn Byte Error bit.

§ BIT_EXF2 [1/2]

#define BIT_EXF2   6

T2_T2CON T2EX bit.

T2_T2CON Timer 2 External Flag.

§ BIT_EXF2 [2/2]

#define BIT_EXF2   6

T2_T2CON T2EX bit.

T2_T2CON Timer 2 External Flag.

§ BIT_EXINT2

#define BIT_EXINT2   2

IRCON0 Interrupt Flag for External Interrupt 2 bit.

§ BIT_EXINT3

#define BIT_EXINT3   3

IRCON0 Interrupt Flag for External Interrupt 3 or T2CC0 Capture/Compare Channel bit.

§ BIT_EXINT4

#define BIT_EXINT4   4

IRCON0 Interrupt Flag for External Interrupt 4 or T2CC1 Capture/Compare Channel bit.

§ BIT_EXINT5

#define BIT_EXINT5   5

IRCON0 Interrupt Flag for External Interrupt 5 or T2CC2 Capture/Compare Channel bit.

§ BIT_EXINT6

#define BIT_EXINT6   6

IRCON0 Interrupt Flag for External Interrupt 6 or T2CC3 Capture/Compare Channel bit.

§ BIT_IERR

#define BIT_IERR   1

MDU_MDUSTAT Interrupt on Error bit.

§ BIT_IRDY

#define BIT_IRDY   0

MDU_MDUSTAT Interrupt on Result Ready bit.

§ BIT_NDOV [1/2]

#define BIT_NDOV   2

FDCON Normal Divider Overflow bit.

FDCON Overflow Flag in Normal Divider Mode.

§ BIT_NDOV [2/2]

#define BIT_NDOV   2

FDCON Normal Divider Overflow bit.

FDCON Overflow Flag in Normal Divider Mode.

§ BIT_NMIECC

#define BIT_NMIECC   6

NMISR ECC NMI Flag bit.

§ BIT_NMIFLASH

#define BIT_NMIFLASH   2

NMISR FLASH Timer NMI Flag bit.

§ BIT_NMIPLL

#define BIT_NMIPLL   1

NMISR PLL NMI Flag bit.

§ BIT_NMIVDDP

#define BIT_NMIVDDP   5

NMISR VDDP Prewarning NMI Flag bit.

§ BIT_NMIWDT

#define BIT_NMIWDT   0

NMISR Watchdog Timer NMI Flag bit.

§ BIT_RI

#define BIT_RI   0

SCON Serial Interface Receiver Interrupt Flag.

§ BIT_RMAP

#define BIT_RMAP   0

SYSCON0 Special Function Register Map Control bit.

§ BIT_TF2 [1/2]

#define BIT_TF2   7

T2_T2CON Timer 2 Overflow bit.

T2_T2CON Timer 2 Overflow/Underflow Flag.

§ BIT_TF2 [2/2]

#define BIT_TF2   7

T2_T2CON Timer 2 Overflow bit.

T2_T2CON Timer 2 Overflow/Underflow Flag.

§ BIT_TI

#define BIT_TI   1

SCON Serial Interface Transmitter Interrupt Flag.

Function Documentation

§ dummy()

void dummy ( void  )
private

This is a dummy function to point unused function pointers to.

§ hsk_isr_root1()

void hsk_isr_root1 ( void  )

This is a dummy function used for putting register bank 1 using ISRs into a common call tree for C51.

§ ISR_hsk_isr14()

void ISR_hsk_isr14 ( void  )
private

Shared non-maskable interrupt routine.

This interrupt has the following sources:

  • Watchdog Timer NMI (NMIWDT)
  • PLL NMI (NMIPLL)
  • Flash Timer NMI (NMIFLASH)
  • VDDP Prewarning NMI (NMIVDDP)
  • Flash ECC NMI (NMIECC)

§ ISR_hsk_isr5()

void ISR_hsk_isr5 ( void  )
private

Shared interrupt 5 routine.

Activate the interrupt by setting ET2 = 1.

This interrupt has the following sources:

  • Timer 2 Overflow (TF2)
  • Timer 2 External Event (EXF2)
  • T2CCU CCT Overflow (CCTOVF)
  • Normal Divider Overflow (NDOV)
  • End of Syn Byte (EOFSYN)
  • Syn Byte Error (ERRSYN)
  • CAN Interrupt 0 (CANSRC0)

§ ISR_hsk_isr6()

void ISR_hsk_isr6 ( void  )
private

Shared interrupt 6 routine.

Activate the interrupt by setting EADC = 1.

This interrupt has the following sources:

  • CANSRC1
  • CANSRC2
  • ADCSR0
  • ADCSR1

§ ISR_hsk_isr8()

void ISR_hsk_isr8 ( void  )
private

Shared interrupt 8 routine.

Activate the interrupt by setting EX2 = 1.

This interrupt has the following sources:

  • External Interrupt 2 (EXINT2)
  • UART1 (RI)
  • UART1 (TI)
  • Timer 21 Overflow (TF2)
  • T21EX (EXF2)
  • UART1 Fractional Divider (Normal Divider Overflow) (NDOV)
  • CORDIC (EOC)
  • MDU Result Ready (IRDY)
  • MDU Error (IERR)

§ ISR_hsk_isr9()

void ISR_hsk_isr9 ( void  )
private

Shared interrupt 9 routine.

Activate the interrupt by setting EXM = 1.

This interrupt has the following sources:

  • EXINT3/T2CC0
  • EXINT4/T2CC1
  • EXINT5/T2CC2
  • EXINT6/T2CC3
  • CANSRC3

§ nmidummy()

void nmidummy ( void  )
private

This is a dummy function to point unused function pointers to.

Variable Documentation

§ hsk_isr14

volatile struct hsk_isr14_callback hsk_isr14 = {&nmidummy, &nmidummy, &nmidummy, &nmidummy, &nmidummy}

Define callback function pointers for NMI ISR.

Introduce callback function pointers for NMI ISR.

§ hsk_isr5

volatile struct hsk_isr5_callback hsk_isr5 = {&dummy, &dummy, &dummy, &dummy, &dummy, &dummy, &dummy}

Define callback function pointers for ISR 5.

Introduce callback function pointers for ISR 5.

§ hsk_isr6

volatile struct hsk_isr6_callback hsk_isr6 = {&dummy, &dummy, &dummy, &dummy}

Define callback function pointers for ISR 6.

Introduce callback function pointers for ISR 6.

§ hsk_isr8

volatile struct hsk_isr8_callback hsk_isr8 = {&dummy, &dummy, &dummy, &dummy, &dummy, &dummy, &dummy, &dummy, &dummy}

Define callback function pointers for ISR 8.

Introduce callback function pointers for ISR 8.

§ hsk_isr9

volatile struct hsk_isr9_callback hsk_isr9 = {&dummy, &dummy, &dummy, &dummy, &dummy}

Define callback function pointers for ISR 9.

Introduce callback function pointers for ISR 9.