Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2301_76519099
rt-thread
提交
a70eb560
R
rt-thread
项目概览
2301_76519099
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
3
Star
1
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a70eb560
编写于
10月 22, 2021
作者:
mysterywolf
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[stm32l475] upgrade lvgl porting
上级
bcdd4a62
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
117 addition
and
49 deletion
+117
-49
bsp/stm32/stm32l475-atk-pandora/board/ports/lvgl/SConscript
bsp/stm32/stm32l475-atk-pandora/board/ports/lvgl/SConscript
+1
-1
bsp/stm32/stm32l475-atk-pandora/board/ports/lvgl/lv_demo.c
bsp/stm32/stm32l475-atk-pandora/board/ports/lvgl/lv_demo.c
+1
-48
bsp/stm32/stm32l475-atk-pandora/board/ports/lvgl/lv_port_disp.c
...m32/stm32l475-atk-pandora/board/ports/lvgl/lv_port_disp.c
+55
-0
bsp/stm32/stm32l475-atk-pandora/board/ports/lvgl/lv_port_disp.h
...m32/stm32l475-atk-pandora/board/ports/lvgl/lv_port_disp.h
+23
-0
bsp/stm32/stm32l475-atk-pandora/board/ports/lvgl/lv_port_indev.c
...32/stm32l475-atk-pandora/board/ports/lvgl/lv_port_indev.c
+14
-0
bsp/stm32/stm32l475-atk-pandora/board/ports/lvgl/lv_port_indev.h
...32/stm32l475-atk-pandora/board/ports/lvgl/lv_port_indev.h
+23
-0
未找到文件。
bsp/stm32/stm32l475-atk-pandora/board/ports/lvgl/SConscript
浏览文件 @
a70eb560
...
...
@@ -5,5 +5,5 @@ cwd = GetCurrentDir()
src
=
Glob
(
'*.c'
)
CPPPATH
=
[
cwd
]
group
=
DefineGroup
(
'LVGL'
,
src
,
depend
=
[
'BSP_USING_LVGL'
],
CPPPATH
=
CPPPATH
)
group
=
DefineGroup
(
'LVGL
-port
'
,
src
,
depend
=
[
'BSP_USING_LVGL'
],
CPPPATH
=
CPPPATH
)
Return
(
'group'
)
bsp/stm32/stm32l475-atk-pandora/board/ports/lvgl/lv
gl
_demo.c
→
bsp/stm32/stm32l475-atk-pandora/board/ports/lvgl/lv_demo.c
浏览文件 @
a70eb560
...
...
@@ -10,10 +10,6 @@
#include <rtthread.h>
#include <lvgl.h>
#include <drv_lcd.h>
#define DBG_TAG "LVGL"
#define DBG_LVL DBG_INFO
#include <rtdbg.h>
#ifndef LV_THREAD_STACK_SIZE
#define LV_THREAD_STACK_SIZE 2048
...
...
@@ -26,51 +22,8 @@
static
void
lv_example_get_started_1
(
void
);
static
void
lv_example_get_started_3
(
void
);
#define MY_DISP_HOR_RES 240
/* 240*240 */
/*A static or global variable to store the buffers*/
static
lv_disp_draw_buf_t
disp_buf
;
/*Static or global buffer(s). The second buffer is optional*/
static
lv_color_t
buf_1
[
MY_DISP_HOR_RES
*
10
];
static
lv_color_t
buf_2
[
MY_DISP_HOR_RES
*
10
];
static
lv_disp_drv_t
disp_drv
;
/*Descriptor of a display driver*/
/*Flush the content of the internal buffer the specific area on the display
*You can use DMA or any hardware acceleration to do this operation in the background but
*'lv_disp_flush_ready()' has to be called when finished.*/
static
void
disp_flush
(
lv_disp_drv_t
*
disp_drv
,
const
lv_area_t
*
area
,
lv_color_t
*
color_p
)
{
lcd_fill_array
(
area
->
x1
,
area
->
y1
,
area
->
x2
,
area
->
y2
,
color_p
);
/*IMPORTANT!!!
*Inform the graphics library that you are ready with the flushing*/
lv_disp_flush_ready
(
disp_drv
);
}
static
void
lvgl_thread
(
void
*
parameter
)
{
lv_init
();
/*Initialize `disp_buf` with the buffer(s). With only one buffer use NULL instead buf_2 */
lv_disp_draw_buf_init
(
&
disp_buf
,
buf_1
,
buf_2
,
MY_DISP_HOR_RES
*
10
);
lv_disp_drv_init
(
&
disp_drv
);
/*Basic initialization*/
/*Set the resolution of the display*/
disp_drv
.
hor_res
=
MY_DISP_HOR_RES
;
disp_drv
.
ver_res
=
MY_DISP_HOR_RES
;
/*Set a display buffer*/
disp_drv
.
draw_buf
=
&
disp_buf
;
/*Used to copy the buffer's content to the display*/
disp_drv
.
flush_cb
=
disp_flush
;
/*Finally register the driver*/
lv_disp_drv_register
(
&
disp_drv
);
lv_example_get_started_1
();
lv_example_get_started_3
();
...
...
@@ -90,7 +43,7 @@ static int lvgl_demo_init(void)
return
0
;
}
INIT_
COMPONENT
_EXPORT
(
lvgl_demo_init
);
INIT_
APP
_EXPORT
(
lvgl_demo_init
);
/* ------------------- demo1 ----------------------- */
...
...
bsp/stm32/stm32l475-atk-pandora/board/ports/lvgl/lv_port_disp.c
0 → 100644
浏览文件 @
a70eb560
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2021-10-18 Meco Man The first version
*/
#include <lvgl.h>
#include <drv_lcd.h>
#define MY_DISP_HOR_RES LCD_W
/*A static or global variable to store the buffers*/
static
lv_disp_draw_buf_t
disp_buf
;
/*Static or global buffer(s). The second buffer is optional*/
static
lv_color_t
buf_1
[
MY_DISP_HOR_RES
*
LCD_W
/
5
];
static
lv_color_t
buf_2
[
MY_DISP_HOR_RES
*
LCD_W
/
5
];
static
lv_disp_drv_t
disp_drv
;
/*Descriptor of a display driver*/
/*Flush the content of the internal buffer the specific area on the display
*You can use DMA or any hardware acceleration to do this operation in the background but
*'lv_disp_flush_ready()' has to be called when finished.*/
static
void
disp_flush
(
lv_disp_drv_t
*
disp_drv
,
const
lv_area_t
*
area
,
lv_color_t
*
color_p
)
{
lcd_fill_array
(
area
->
x1
,
area
->
y1
,
area
->
x2
,
area
->
y2
,
color_p
);
/*IMPORTANT!!!
*Inform the graphics library that you are ready with the flushing*/
lv_disp_flush_ready
(
disp_drv
);
}
void
lv_port_disp_init
(
void
)
{
/*Initialize `disp_buf` with the buffer(s). With only one buffer use NULL instead buf_2 */
lv_disp_draw_buf_init
(
&
disp_buf
,
buf_1
,
buf_2
,
MY_DISP_HOR_RES
*
10
);
lv_disp_drv_init
(
&
disp_drv
);
/*Basic initialization*/
/*Set the resolution of the display*/
disp_drv
.
hor_res
=
MY_DISP_HOR_RES
;
disp_drv
.
ver_res
=
MY_DISP_HOR_RES
;
/*Set a display buffer*/
disp_drv
.
draw_buf
=
&
disp_buf
;
/*Used to copy the buffer's content to the display*/
disp_drv
.
flush_cb
=
disp_flush
;
/*Finally register the driver*/
lv_disp_drv_register
(
&
disp_drv
);
}
bsp/stm32/stm32l475-atk-pandora/board/ports/lvgl/lv_port_disp.h
0 → 100644
浏览文件 @
a70eb560
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2021-10-18 Meco Man The first version
*/
#ifndef LV_PORT_DISP_H
#define LV_PORT_DISP_H
#ifdef __cplusplus
extern
"C"
{
#endif
void
lv_port_disp_init
(
void
);
#ifdef __cplusplus
}
/*extern "C"*/
#endif
#endif
bsp/stm32/stm32l475-atk-pandora/board/ports/lvgl/lv_port_indev.c
0 → 100644
浏览文件 @
a70eb560
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2021-10-18 Meco Man The first version
*/
void
lv_port_indev_init
(
void
)
{
}
bsp/stm32/stm32l475-atk-pandora/board/ports/lvgl/lv_port_indev.h
0 → 100644
浏览文件 @
a70eb560
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2021-10-18 Meco Man The first version
*/
#ifndef LV_PORT_INDEV_H
#define LV_PORT_INDEV_H
#ifdef __cplusplus
extern
"C"
{
#endif
void
lv_port_indev_init
(
void
);
#ifdef __cplusplus
}
/*extern "C"*/
#endif
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录