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 ESC;
30 uint32_t TTYP;
31 uint32_t TPOL;
33
35#define NEORV32_XIRQ ((neorv32_xirq_t*) (NEORV32_XIRQ_BASE))
39/**********************************************************************/
43 XIRQ_TRIGGER_LEVEL_LOW = 0b00, // low-level
44 XIRQ_TRIGGER_LEVEL_HIGH = 0b01, // high-level
45 XIRQ_TRIGGER_EDGE_FALLING = 0b10, // falling-edge
46 XIRQ_TRIGGER_EDGE_RISING = 0b11 // rising-edge
47};
48
49
50/**********************************************************************/
55int neorv32_xirq_setup(void);
58int neorv32_xirq_get_num(void);
59void neorv32_xirq_setup_trigger(int channel, int config);
60void neorv32_xirq_channel_enable(int channel);
61void neorv32_xirq_channel_disable(int channel);
62int neorv32_xirq_install(int channel, void (*handler)(void));
63int neorv32_xirq_uninstall(int channel);
67#endif // neorv32_xirq_h
void neorv32_xirq_setup_trigger(int channel, int config)
Definition neorv32_xirq.c:162
XIRQ_TRIGGER_enum
Definition neorv32_xirq.h:42
int neorv32_xirq_uninstall(int channel)
Definition neorv32_xirq.c:235
int neorv32_xirq_get_num(void)
Definition neorv32_xirq.c:123
void neorv32_xirq_global_enable(void)
Definition neorv32_xirq.c:99
int neorv32_xirq_install(int channel, void(*handler)(void))
Definition neorv32_xirq.c:214
int neorv32_xirq_setup(void)
Definition neorv32_xirq.c:79
int neorv32_xirq_available(void)
Definition neorv32_xirq.c:60
void neorv32_xirq_channel_enable(int channel)
Definition neorv32_xirq.c:190
void neorv32_xirq_global_disable(void)
Definition neorv32_xirq.c:111
void neorv32_xirq_channel_disable(int channel)
Definition neorv32_xirq.c:201
Definition neorv32_xirq.h:27
uint32_t TPOL
Definition neorv32_xirq.h:31
uint32_t TTYP
Definition neorv32_xirq.h:30
uint32_t ESC
Definition neorv32_xirq.h:29
uint32_t EIE
Definition neorv32_xirq.h:28