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 */
21#ifndef CLIC_H
22#define CLIC_H
23
24#include "cpu_conf.h"
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
35typedef void (*clic_isr_cb_t)(unsigned irq);
36
40typedef struct __attribute((packed)) {
41 volatile uint8_t ip;
42 volatile uint8_t ie;
43 volatile uint8_t attr;
44 volatile uint8_t ctl;
45} clic_clicint_t;
46
50void clic_init(void);
51
58void clic_enable_interrupt(unsigned irq, unsigned priority);
59
65void clic_disable_interrupt(unsigned irq);
66
73void clic_set_priority(unsigned irq, unsigned priority);
74
81void clic_set_handler(unsigned irq, clic_isr_cb_t cb);
82
90void clic_isr_handler(uint32_t irq);
91
92#ifdef __cplusplus
93}
94#endif
95
96#endif /* CLIC_H */
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:35
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:40