0.3.1
Interrupt Controller (INTC)

Modules

 Setters
 

Macros

#define CPU_INTC_INTERRUPT_MASTER_BASE   0x0000
 Interrupt vector offset for master CPU.
 
#define CPU_INTC_INTERRUPT_SLAVE_BASE   0x0100
 Interrupt vector offset for slave CPU.
 
#define CPU_INTC_PRIORITY_VBLANK_IN   15
 Interrupts belonging to this priority.
 
#define CPU_INTC_PRIORITY_VBLANK_OUT   14
 Interrupts belonging to this priority.
 
#define CPU_INTC_PRIORITY_HBLANK_IN   13
 Interrupts belonging to this priority.
 
#define CPU_INTC_PRIORITY_TIMER_0   12
 Interrupts belonging to this priority.
 
#define CPU_INTC_PRIORITY_TIMER_1   11
 Interrupts belonging to this priority.
 
#define CPU_INTC_PRIORITY_DSP_END   10
 Interrupts belonging to this priority.
 
#define CPU_INTC_PRIORITY_SOUND_REQUEST   9
 Interrupts belonging to this priority.
 
#define CPU_INTC_PRIORITY_SYSTEM_MANAGER   8
 Interrupts belonging to this priority.
 
#define CPU_INTC_PRIORITY_PAD_INTERRUPT   8
 Interrupts belonging to this priority.
 
#define CPU_INTC_PRIORITY_LEVEL_2_DMA   6
 Interrupts belonging to this priority.
 
#define CPU_INTC_PRIORITY_LEVEL_1_DMA   6
 Interrupts belonging to this priority.
 
#define CPU_INTC_PRIORITY_LEVEL_0_DMA   5
 Interrupts belonging to this priority.
 
#define CPU_INTC_PRIORITY_DMA_ILLEGAL   3
 Interrupts belonging to this priority.
 
#define CPU_INTC_PRIORITY_SPRITE_END   2
 Interrupts belonging to this priority.
 

Typedefs

typedef enum cpu_intc_interrupt cpu_intc_interrupt_t
 Interrupt vectors.
 
typedef void(* cpu_intc_ihr_t) (void)
 Callback type.
 

Enumerations

enum  cpu_intc_interrupt
 Interrupt vectors. More...
 

Functions

static void cpu_intc_ihr_set (cpu_intc_interrupt_t vector, cpu_intc_ihr_t ihr)
 Set the interrupt handler for the specified CPU related interrupt.
 
static void cpu_intc_ihr_clear (cpu_intc_interrupt_t vector)
 Clear the interrupt handler for the specified CPU related interrupt.
 
static cpu_intc_ihr_t cpu_intc_ihr_get (cpu_intc_interrupt_t vector)
 Obtain the interrupt handler for the specified CPU related interrupt.
 
static uint8_t cpu_intc_mask_get (void)
 Obtain the interrupt priority level I mask bits from the sr register.
 
static void cpu_intc_mask_set (uint8_t mask)
 Set the interrupt priority level.
 
static uint16_t cpu_intc_priority_a_get (void)
 Obtain the value of the 2-byte value of the IPRA I/O register.
 
static uint16_t cpu_intc_priority_b_get (void)
 Obtain the value of the 2-byte value of the IPRB I/O register.
 
static void cpu_intc_priority_a_set (uint16_t ipra)
 Write a 2-byte value to the IPRA I/O register.
 
static void cpu_intc_priority_b_set (uint16_t iprb)
 Write a 2-byte value to the IPRB I/O register.
 

Detailed Description

Description goes here.

Typedef Documentation

◆ cpu_intc_ihr_t

typedef void(* cpu_intc_ihr_t) (void)

Callback type.

See also
cpu_intc_ihr_set

Enumeration Type Documentation

◆ cpu_intc_interrupt

Interrupt vectors.

Enumerator
CPU_INTC_INTERRUPT_POWER_ON_RESET_PC 

Interrupt vector.

CPU_INTC_INTERRUPT_POWER_ON_RESET_SP 

Interrupt vector.

CPU_INTC_INTERRUPT_MANUAL_RESET_PC 

Interrupt vector.

CPU_INTC_INTERRUPT_MANUAL_RESET_SP 

Interrupt vector.

CPU_INTC_INTERRUPT_ILLEGAL_INSTRUCTION 

Interrupt vector.

CPU_INTC_INTERRUPT_ILLEGAL_SLOT 

Interrupt vector.

CPU_INTC_INTERRUPT_CPU_ADDRESS_ERROR 

Interrupt vector.

CPU_INTC_INTERRUPT_DMA_ADDRESS_ERROR 

Interrupt vector.

CPU_INTC_INTERRUPT_NMI 

Interrupt vector.

CPU_INTC_INTERRUPT_UBC 

Interrupt vector.

CPU_INTC_INTERRUPT_BREAK 

Interrupt vector.

CPU_INTC_INTERRUPT_NETLINK 

Interrupt vector.

CPU_INTC_INTERRUPT_SCI_ERI 

Interrupt vector.

CPU_INTC_INTERRUPT_SCI_RXI 

Interrupt vector.

CPU_INTC_INTERRUPT_SCI_TXI 

Interrupt vector.

CPU_INTC_INTERRUPT_SCI_TEI 

Interrupt vector.

CPU_INTC_INTERRUPT_FRT_ICI 

Interrupt vector.

CPU_INTC_INTERRUPT_FRT_OCI 

Interrupt vector.

CPU_INTC_INTERRUPT_FRT_OVI 

Interrupt vector.

CPU_INTC_INTERRUPT_FREE_67 

Interrupt vector.

CPU_INTC_INTERRUPT_WDT_ITI 

Interrupt vector.

CPU_INTC_INTERRUPT_BSC 

Interrupt vector.

CPU_INTC_INTERRUPT_FREE_6A 

Interrupt vector.

CPU_INTC_INTERRUPT_FREE_6B 

Interrupt vector.

CPU_INTC_INTERRUPT_DMAC0 

Interrupt vector.

CPU_INTC_INTERRUPT_DMAC1 

Interrupt vector.

CPU_INTC_INTERRUPT_DIVU_OVFI 

Interrupt vector.

CPU_INTC_INTERRUPT_FREE_6F 

Interrupt vector.

CPU_INTC_INTERRUPT_SLAVE_ENTRY 

Interrupt vector.

Function Documentation

◆ cpu_intc_ihr_set()

static void cpu_intc_ihr_set ( cpu_intc_interrupt_t  vector,
cpu_intc_ihr_t  ihr 
)
inlinestatic

Set the interrupt handler for the specified CPU related interrupt.

This is a BIOS call. The function must use rte to return. Use the __interrupt_handler GCC attribute.

To set a handler in the slave CPU vector table, add the offset CPU_INTC_INTERRUPT_SLAVE_BASE to vector.

Warning
Do not use this function to set your interrupt handler, unless there is an explicit need to do so. To see which functions and macros to use for each interrupt, see Setters.
Parameters
vectorThe vector number.
ihrThe interrupt handler.

◆ cpu_intc_ihr_clear()

static void cpu_intc_ihr_clear ( cpu_intc_interrupt_t  vector)
inlinestatic

Clear the interrupt handler for the specified CPU related interrupt.

This is a BIOS call.

To clear a handler in the slave CPU vector table, add the offset CPU_INTC_INTERRUPT_SLAVE_BASE to vector.

Warning
Do not use this function to clear your interrupt handler, unless there is an explicit need to do so. To see which functions and macros to use for each interrupt, see Setters.
Parameters
vectorThe vector number.

◆ cpu_intc_ihr_get()

static cpu_intc_ihr_t cpu_intc_ihr_get ( cpu_intc_interrupt_t  vector)
inlinestatic

Obtain the interrupt handler for the specified CPU related interrupt.

This is a BIOS call.

To get a handler in the slave CPU vector table, add the offset CPU_INTC_INTERRUPT_SLAVE_BASE to vector.

Parameters
vectorThe vector number.
Returns
Not yet documented.

◆ cpu_intc_mask_get()

static uint8_t cpu_intc_mask_get ( void  )
inlinestatic

Obtain the interrupt priority level I mask bits from the sr register.

Returns
The interrupt priority level I mask bits from the sr register.

◆ cpu_intc_mask_set()

static void cpu_intc_mask_set ( uint8_t  mask)
inlinestatic

Set the interrupt priority level.

Parameters
maskThe interrupt priority level.

◆ cpu_intc_priority_a_get()

static uint16_t cpu_intc_priority_a_get ( void  )
inlinestatic

Obtain the value of the 2-byte value of the IPRA I/O register.

Returns
The 2-byte value of the IPRA I/O register.

◆ cpu_intc_priority_b_get()

static uint16_t cpu_intc_priority_b_get ( void  )
inlinestatic

Obtain the value of the 2-byte value of the IPRB I/O register.

Returns
The 2-byte value of the IPRB I/O register.

◆ cpu_intc_priority_a_set()

static void cpu_intc_priority_a_set ( uint16_t  ipra)
inlinestatic

Write a 2-byte value to the IPRA I/O register.

Parameters
ipraThe value to write to.

◆ cpu_intc_priority_b_set()

static void cpu_intc_priority_b_set ( uint16_t  iprb)
inlinestatic

Write a 2-byte value to the IPRB I/O register.

Parameters
iprbThe value to write to.