pure sdk for main

This commit is contained in:
divadiow
2025-08-27 09:51:58 +01:00
parent f0d033f1c9
commit 0571416e7c
3283 changed files with 1577720 additions and 1 deletions
+55
View File
@@ -0,0 +1,55 @@
#include "typesdef.h"
#include "list.h"
#include "errno.h"
#include "dev.h"
#include "hal/tk.h"
int32 tk_open(struct tk_device *tk)
{
if (tk)
{
return ((const struct tk_hal_ops *)tk->dev.ops)->open(tk);
}
return RET_ERR;
}
int32 tk_ioctl(struct tk_device *tk, enum touchkey_ioctl_cmd ioctl_cmd, uint32 param)
{
if (tk && ((const struct tk_hal_ops *)tk->dev.ops)->ioctl)
{
return ((const struct tk_hal_ops *)tk->dev.ops)->ioctl(tk, ioctl_cmd, param);
}
return RET_ERR;
}
int32 tk_irq_request(struct tk_device *tk, tk_irq_hdl irq_hdl, uint32 irq_flag, uint32 irq_data)
{
if (tk && ((const struct tk_hal_ops *)tk->dev.ops)->request_irq)
{
return ((const struct tk_hal_ops *)tk->dev.ops)->request_irq(tk, irq_hdl, irq_flag, irq_data);
}
return RET_ERR;
}
int32 tk_irq_release(struct tk_device *tk, uint32 irq_flag)
{
if (tk && ((const struct tk_hal_ops *)tk->dev.ops)->release_irq)
{
return ((const struct tk_hal_ops *)tk->dev.ops)->release_irq(tk, irq_flag);
}
return RET_ERR;
}
int32 tk_close(struct tk_device *tk)
{
if (tk)
{
return ((const struct tk_hal_ops *)tk->dev.ops)->close(tk);
}
return RET_ERR;
}