Fennix  1.0.0
Full Documentation
Loading...
Searching...
No Matches
device.h
Go to the documentation of this file.
1/*
2 This file is part of Fennix Kernel.
3
4 Fennix Kernel is free software: you can redistribute it and/or
5 modify it under the terms of the GNU General Public License as
6 published by the Free Software Foundation, either version 3 of
7 the License, or (at your option) any later version.
8
9 Fennix Kernel is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with Fennix Kernel. If not, see <https://www.gnu.org/licenses/>.
16*/
17
18#ifndef __FENNIX_API_DEVICE_H__
19#define __FENNIX_API_DEVICE_H__
20
21#include <types.h>
22
23#ifndef __FENNIX_API_FILESYSTEM_H__
24#if __has_include(<interface/fs.h>)
25#include <interface/fs.h>
26#else
27#include <fs.h>
28#endif
29#endif // !__FENNIX_API_FILESYSTEM_H__
30
31typedef enum
32{
33 DEVICE_TYPE_MASK = 0b1111111100000000000000000000000000000000,
34 DEVICE_TYPE_NONE = 0b0000000000000000000000000000000000000000,
35 DEVICE_TYPE_INPUT = 0b0000000100000000000000000000000000000000,
36 DEVICE_TYPE_AUDIO = 0b0000001000000000000000000000000000000000,
37 DEVICE_TYPE_NETWORK = 0b0000010000000000000000000000000000000000,
38 DEVICE_TYPE_BLOCK = 0b0000100000000000000000000000000000000000,
39
49
55
61
71
72#ifndef __kernel__
73EXTERNC dev_t CreateDeviceFile(const char *name, mode_t mode, const struct InodeOperations *Operations);
74EXTERNC dev_t RegisterDevice(DeviceType Type, const struct InodeOperations *Operations);
75EXTERNC int UnregisterDevice(dev_t Device);
76#endif // !__kernel__
77
78#endif // !__FENNIX_API_DEVICE_H__
EXTERNC int UnregisterDevice(dev_t Device)
EXTERNC dev_t RegisterDevice(DeviceType Type, const struct InodeOperations *Operations)
EXTERNC dev_t CreateDeviceFile(const char *name, mode_t mode, const struct InodeOperations *Operations)
DeviceType
Definition device.h:32
@ INPUT_TYPE_TOUCHSCREEN
Definition device.h:44
@ INPUT_TYPE_GYROSCOPE
Definition device.h:47
@ DEVICE_TYPE_MASK
Definition device.h:33
@ DEVICE_TYPE_AUDIO
Definition device.h:36
@ NETWORK_TYPE_BLUETOOTH
Definition device.h:59
@ AUDIO_TYPE_PWM
Definition device.h:51
@ BLOCK_TYPE_NONE
Definition device.h:62
@ DEVICE_TYPE_NONE
Definition device.h:34
@ DEVICE_TYPE_NETWORK
Definition device.h:37
@ NETWORK_TYPE_NONE
Definition device.h:56
@ BLOCK_TYPE_SDCARD
Definition device.h:63
@ DEVICE_TYPE_INPUT
Definition device.h:35
@ NETWORK_TYPE_UART
Definition device.h:60
@ NETWORK_TYPE_WIFI
Definition device.h:58
@ BLOCK_TYPE_USB
Definition device.h:66
@ BLOCK_TYPE_CDROM
Definition device.h:68
@ AUDIO_TYPE_PCM
Definition device.h:53
@ INPUT_TYPE_ACCELEROMETER
Definition device.h:46
@ BLOCK_TYPE_SSD
Definition device.h:65
@ AUDIO_TYPE_DSP
Definition device.h:52
@ INPUT_TYPE_NONE
Definition device.h:40
@ INPUT_TYPE_JOYSTICK
Definition device.h:43
@ INPUT_TYPE_KEYBOARD
Definition device.h:41
@ NETWORK_TYPE_ETHERNET
Definition device.h:57
@ AUDIO_TYPE_MIDI
Definition device.h:54
@ INPUT_TYPE_MOUSE
Definition device.h:42
@ AUDIO_TYPE_NONE
Definition device.h:50
@ INPUT_TYPE_MAGNETOMETER
Definition device.h:48
@ INPUT_TYPE_GAMEPAD
Definition device.h:45
@ DEVICE_TYPE_BLOCK
Definition device.h:38
@ BLOCK_TYPE_NVME
Definition device.h:67
@ BLOCK_TYPE_HDD
Definition device.h:64
@ BLOCK_TYPE_FLOPPY
Definition device.h:69