Core Local Interruptor (CLINT) driver.
This module provides functions to configure and control CLINT input/output and interrupt behavior.
Usage & Initialization.
This is an example show how to utilize API Functions and enable software interrupt using IRQ Controller Driver.
static uint32_t counter = 0;
timerCmp += TIMER_TICK_DELAY;
return 1;
}
void isrInit(){
initTimer();
}
#define ANSI_YELLOW
Yellow text.
#define ANSI_RESET
Reset to default color.
@ MSIP_ENABLE
Enable Software Interrupt */.
void clint_setCmp(u64 cmp, u32 hart_id)
This function sets the compare value for the CLINT CMP register for a specific hardware thread.
void clint_setSoftInterrupt(clint_msip_t enable, u32 hart_id)
Sets the software interrupt state for a specific hart.
void trap_entry(void)
The Main Trap Entry Point (Naked).
int irq_handleTimer(void)
Handlers for CPU interrupts (Timer).
void irq_enable(void)
Enable Global Interrupts (MIE bit).
void irq_setType(cpu_irq_t enable)
Enable specific CPU interrupt sources.
void irq_setTrapVector(void(*trap_vector)(void))
Set the Machine Trap Vector (mtvec).
RISC-V Core Interrupt Handling and Vector Table.
This is an example show how to utilize API Functions and enable timer interrupt using IRQ Controller Driver.
static uint32_t counter = 0;
timerCmp += TIMER_TICK_DELAY;
return 1;
}
void isrInit(){
initTimer();
}
- See also
- Example CLINT Timer Interrupt Demo - Learn how to use the driver for timer interrupt operations