diff options
| author | Amlal EL Mahrouss <amlalelmahrouss@icloud.com> | 2024-08-15 18:35:34 +0200 |
|---|---|---|
| committer | Amlal EL Mahrouss <amlalelmahrouss@icloud.com> | 2024-08-15 18:35:34 +0200 |
| commit | f3d931aa7cfaf96baef8383b59a8938779541ee7 (patch) | |
| tree | fdb9fc51badb3dbd03e46ab0766a49d9522e13e2 /dev/DDKit/KernelDev.h | |
| parent | 86640816e8b1d3595365f1fcc8a2a9e61fb40ff1 (diff) | |
[IMP] Moved source code into dev/ folder.
Signed-off-by: Amlal EL Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'dev/DDKit/KernelDev.h')
| -rw-r--r-- | dev/DDKit/KernelDev.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/dev/DDKit/KernelDev.h b/dev/DDKit/KernelDev.h new file mode 100644 index 00000000..e99cb0a7 --- /dev/null +++ b/dev/DDKit/KernelDev.h @@ -0,0 +1,32 @@ +/* ------------------------------------------- + + Copyright ZKA Technologies. + + Purpose: DDK Devices. + +------------------------------------------- */ + +#pragma once + +#include <DDKit/KernelStd.h> + +struct _kernelDevice; + +/// @brief Kernel Device driver. +typedef struct _kernelDevice +{ + char name[255]; // the device name. Could be /./DEVICE_NAME/ + void* (*read)(void* arg, int len); // read from device. + void (*write)(void* arg, int len); + void (*wait)(void); // write to device. + struct _kernelDevice* (*open)(const char* path); // open device. + void (*close)(struct _kernelDevice* dev); // close device. +} kernelDevice, *kernelDeviceRef; + +/// @brief Open a new device from path. +/// @param devicePath the device's path. +DK_EXTERN kernelDeviceRef kernelOpenDevice(const char* devicePath); + +/// @brief Close any device. +/// @param device valid device. +DK_EXTERN void kernelCloseDevice(kernelDeviceRef device); |
