Rishka
RISC-V virtual runtime in C/C++ made for ESP32-WROVER
int.h
Go to the documentation of this file.
1/*
2 * This file is part of the Rishka distribution (https://github.com/nthnn/rishka).
3 * Copyright (c) 2024 Nathanne Isip.
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, version 3.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
27#ifndef LIBRISHKA_INT_H
28#define LIBRISHKA_INT_H
29
30#include <librishka/types.h>
31
40typedef enum {
41 INT_CHANGE = 0x1,
43 INT_RISING = 0x3
45
54class Int final {
55public:
61 static void enable();
62
68 static void disable();
69
80 static void attach(u8 pin, void (*callback)(void), int_mode_t mode);
81
90 static void detach(u8 pin);
91};
92
93#endif /* LIBRISHKA_INT_H */
Class for handling interrupt operations in Rishka applications.
Definition: int.h:54
static void detach(u8 pin)
Detach the interrupt handler from a GPIO pin.
Definition: librishka_int.cpp:33
static void disable()
Disable interrupts globally.
Definition: librishka_int.cpp:25
static void attach(u8 pin, void(*callback)(void), int_mode_t mode)
Attach an interrupt handler to a GPIO pin.
Definition: librishka_int.cpp:29
static void enable()
Enable interrupts globally.
Definition: librishka_int.cpp:21
int_mode_t
Enum representing interrupt modes for GPIO pins.
Definition: int.h:40
@ INT_CHANGE
Definition: int.h:41
@ INT_RISING
Definition: int.h:43
@ INT_FAILING
Definition: int.h:42
Header file for common data types used in Rishka applications.
unsigned char u8
Alias for the unsigned 8-bit integer type.
Definition: types.h:70