[bsp][phytium ] support dc driver with ops

修改bsp/phytium中DC驱动接口,利用ops注册相关驱动
This commit is contained in:
Wangzongqiang 2024-02-20 10:51:58 +08:00 committed by GitHub
parent bd228eb9c5
commit 28f3e037b6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 20 additions and 15 deletions

View File

@ -90,16 +90,31 @@ static rt_err_t rt_dc_control(rt_device_t dev, int cmd, void *args)
}
return RT_EOK;
}
#ifdef RT_USING_DEVICE_OPS
const static struct rt_device_ops dc_ops =
{
rt_dc_init,
RT_NULL,
RT_NULL,
RT_NULL,
RT_NULL,
rt_dc_control
};
#endif
static void rt_hw_dc_register(struct phytium_dc_bus *dc_control_bus, const char *name, rt_uint32_t flag, void *data)
{
RT_ASSERT(dc_control_bus != RT_NULL);
struct rt_device *dc;
dc = &(dc_control_bus->parent);
dc->type = RT_Device_Class_Graphic;
#ifdef RT_USING_DEVICE_OPS
dc->ops = &dc_ops;
#else
dc->init = rt_dc_init;
dc->open = RT_NULL;
dc->close = RT_NULL;
dc->control = rt_dc_control;
#endif
dc->user_data = data;
/* register Display Controller device to RT-Thread */
rt_device_register(dc, "dc", RT_DEVICE_FLAG_RDWR);
@ -145,4 +160,3 @@ int rt_hw_dc_init(void)
}
INIT_DEVICE_EXPORT(rt_hw_dc_init);

View File

@ -19,6 +19,6 @@ def clone_repository(branch, commit_hash):
if __name__ == "__main__":
branch_to_clone = "master"
commit_to_clone = "822fc36aff031d54e7c80f254fb64206ab187981"
commit_to_clone = "13657081faf9f2d504592f7110159c4e63dc6f29"
clone_repository(branch_to_clone, commit_to_clone)

View File

@ -13,7 +13,7 @@
*
* FilePath: fdrivers_port.h
* Created Date: 2023-10-16 17:02:35
* Last Modified: 2024-01-05 14:51:14
* Last Modified: Tue Feb 20 2024
* Description: This file is for drive layer code decoupling
*
* Modify History:
@ -25,22 +25,13 @@
#ifndef FDRIVERS_PORT_H
#define FDRIVERS_PORT_H
#ifdef __aarch64__
#include "faarch64.h"
#else
#include "faarch32.h"
#endif
#include <rtthread.h>
/***************************** Include Files *********************************/
#include "rtconfig.h"
#include "ftypes.h"
#include "drv_log.h"
#include "fkernel.h"
#ifdef __aarch64__
#include "faarch64.h"
#else
#include "faarch32.h"
#endif
#include "faarch.h"
#ifdef __cplusplus
extern "C"