NEORV32 Software Framework Documentation
The NEORV32 RISC-V Processor
Loading...
Searching...
No Matches
neorv32_xirq.h
Go to the documentation of this file.
1// ================================================================================ //
2// The NEORV32 RISC-V Processor - https://github.com/stnolting/neorv32 //
3// Copyright (c) NEORV32 contributors. //
4// Copyright (c) 2020 - 2024 Stephan Nolting. All rights reserved. //
5// Licensed under the BSD-3-Clause license, see LICENSE for details. //
6// SPDX-License-Identifier: BSD-3-Clause //
7// ================================================================================ //
8
16#ifndef neorv32_xirq_h
17#define neorv32_xirq_h
18
19#include <stdint.h>
20
21
22/**********************************************************************/
27typedef volatile struct __attribute__((packed,aligned(4))) {
28 uint32_t EIE;
29 uint32_t EIP;
30 uint32_t ESC;
31 uint32_t TTYP;
32 uint32_t TPOL;
33 const uint32_t reserved0;
34 const uint32_t reserved1;
35 const uint32_t reserved2;
37
39#define NEORV32_XIRQ ((neorv32_xirq_t*) (NEORV32_XIRQ_BASE))
43/**********************************************************************/
47#define XIRQ_TRIGGER_LEVEL_LOW (0b00) // low-level
48#define XIRQ_TRIGGER_LEVEL_HIGH (0b01) // high-level
49#define XIRQ_TRIGGER_EDGE_FALLING (0b10) // falling-edge
50#define XIRQ_TRIGGER_EDGE_RISING (0b11) // rising-edge
54/**********************************************************************/
59int neorv32_xirq_setup(void);
62int neorv32_xirq_get_num(void);
63void neorv32_xirq_setup_trigger(int channel, int config);
64void neorv32_xirq_clear_pending(int channel);
65void neorv32_xirq_channel_enable(int channel);
66void neorv32_xirq_channel_disable(int channel);
67int neorv32_xirq_install(int channel, void (*handler)(void));
68int neorv32_xirq_uninstall(int channel);
72#endif // neorv32_xirq_h
void neorv32_xirq_setup_trigger(int channel, int config)
Definition neorv32_xirq.c:157
int neorv32_xirq_uninstall(int channel)
Definition neorv32_xirq.c:242
int neorv32_xirq_get_num(void)
Definition neorv32_xirq.c:126
void neorv32_xirq_global_enable(void)
Definition neorv32_xirq.c:102
void neorv32_xirq_clear_pending(int channel)
Definition neorv32_xirq.c:185
int neorv32_xirq_install(int channel, void(*handler)(void))
Definition neorv32_xirq.c:223
int neorv32_xirq_setup(void)
Definition neorv32_xirq.c:81
int neorv32_xirq_available(void)
Definition neorv32_xirq.c:62
void neorv32_xirq_channel_enable(int channel)
Definition neorv32_xirq.c:197
void neorv32_xirq_global_disable(void)
Definition neorv32_xirq.c:114
void neorv32_xirq_channel_disable(int channel)
Definition neorv32_xirq.c:209
Definition neorv32_xirq.h:27
uint32_t TPOL
Definition neorv32_xirq.h:32
uint32_t EIP
Definition neorv32_xirq.h:29
const uint32_t reserved0
Definition neorv32_xirq.h:33
uint32_t TTYP
Definition neorv32_xirq.h:31
const uint32_t reserved1
Definition neorv32_xirq.h:34
uint32_t ESC
Definition neorv32_xirq.h:30
uint32_t EIE
Definition neorv32_xirq.h:28
const uint32_t reserved2
Definition neorv32_xirq.h:35