RV32 SoC DS UG
High-Perf RV32 SoC DS UG
RV64 SoC DS UG API and Examples
Embedded IDE UG
Loading...
Searching...
No Matches
PLIC Controller Driver

Overview

Platform-Level Interrupt Controller (PLIC) driver.

This module provides functions to configure and control PLIC input/output and interrupt behavior.

Usage & Initialization.

This is an example show how to instantiate PLIC Controller Driver for interrupt configuration.

To set interrupt type and enable global interrupt, refer to IRQ Controller Driver.

#include "timer/timer.h"
#include "irq.h"
plic_instance_t timer0_plic = {
// Configure the interrupt source
.target = BSP_PLIC_CPU_0,
.gateway = SYSTEM_USER_TIMER_0_INTERRUPTS_0,
.priority = 0x1U,
.enable = 0x1U,
.threshold = 0x0U,
};
void isrInit(){
plic_applyConfig(&timer0_plic);
}
#define BSP_PLIC_CPU_0
Primary PLIC CPU 0 External Interrupt base address.
Definition bsp.h:51
void irq_enable(void)
Enable Global Interrupts (MIE bit).
Definition irq.c:56
void irq_setType(cpu_irq_t enable)
Enable specific CPU interrupt sources.
Definition irq.c:76
@ IRQ_EXTERNAL
Definition irq.h:122
void plic_applyConfig(plic_instance_t *inst)
Apply stored PLIC configuration to hardware.
Definition plic.c:83
RISC-V Core Interrupt Handling and Vector Table.
PLIC instance. Holds the software registers and hardware pointer.
Definition plic.h:137
User Timer driver API definitions.

Topics

 API Functions
 Function definitions for PLIC driver.
 Data Structures
 Structs used by the driver.