Loading...
Searching...
No Matches
clic.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2020 Koen Zandberg <koen@bergzand.net>
3 *
4 * This file is subject to the terms and conditions of the GNU Lesser General
5 * Public License v2.1. See the file LICENSE in the top level directory for more
6 * details.
7 */
8
9#pragma once
10
24
25#include "cpu_conf.h"
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
36typedef void (*clic_isr_cb_t)(unsigned irq);
37
41typedef struct __attribute((packed)) {
42 volatile uint8_t ip;
43 volatile uint8_t ie;
44 volatile uint8_t attr;
45 volatile uint8_t ctl;
46} clic_clicint_t;
47
51void clic_init(void);
52
59void clic_enable_interrupt(unsigned irq, unsigned priority);
60
66void clic_disable_interrupt(unsigned irq);
67
74void clic_set_priority(unsigned irq, unsigned priority);
75
82void clic_set_handler(unsigned irq, clic_isr_cb_t cb);
83
91void clic_isr_handler(uint32_t irq);
92
93#ifdef __cplusplus
94}
95#endif
96
void clic_set_handler(unsigned irq, clic_isr_cb_t cb)
Set the handler for an interrupt.
void clic_isr_handler(uint32_t irq)
CLIC interrupt handler.
void(* clic_isr_cb_t)(unsigned irq)
CLIC callback declaration.
Definition clic.h:36
void clic_init(void)
Initialize the CLIC interrupt controller.
void clic_set_priority(unsigned irq, unsigned priority)
Set the priority of an interrupt.
void clic_disable_interrupt(unsigned irq)
Disable a single interrupt.
void clic_enable_interrupt(unsigned irq, unsigned priority)
Enable a single interrupt.
struct __attribute((packed))
RISC-V CLIC per interrupt configuration registers.
Definition clic.h:41