移植 lvgl
2026-07-15
LVGL V8.3.11对于资源的要求
- 最低配置
- FLASH ~32 KB 仅基础核心 + 1-2 个控件,无字体,无图像解码
- RAM ~8 KB 仅用于基本缓冲区,无帧缓冲
- 典型配置
- FLASH ~100-150 KB 核心库 + 常用控件(按钮、标签、滑块、列表等)+ 1-2种字体 + 基础图像解码
- RAM ~10-32 KB 显示缓冲区(通常 1/10 屏幕大小)+ 控件对象内存
- 完整功能
- FLASH ~500 KB - 1 MB+ 全部控件 + 多种字体 + 图像解码器(PNG/JPEG/BMP/GIF)+ 动画引擎 + 抗锯齿
- RAM ~50 KB - 200 KB+ 完整帧缓冲 + 控件对象 + 动画数据
本次移植采用FreeRTOS移植章节为基础,即stm32f103c8t6展示添加LVGLUI库的移植。 STM32F103C8T6 FLASH=64KB RAM=20KB, 资源非常紧张。 选取的LVGL版本为体积更小的V8.3.11版本,裁剪到动画等功能,并且通过Release优化体积,才勉强能够运行。 所以在实际项目中,应该选取更大的FLASH及RAM。或更换U8g2更小的图形库。
下载源码
下载 LVGL 版本V8.3.11
移植
添加屏幕驱动及测试
- 这里的屏幕采用的是
SSD1315,参照以下内容添加文件及内容 - 同时在
main.c中添加了,对于屏幕的测试 - 编译下载、成功后屏幕应该能够正常刷新
project# 工程根目录
.vscode# vscode配置目录
…
CMSIS# 架构库目录
…
STM32F10x_StdPeriph_Driver# 标准外设库 目录
…
FreeRTOS-Kernel# FREEROTS 内核目录
…
build# 编译输出目录
…
main.c# LED点亮示例代码
CMakeLists.txt# CMAKE编译配置文件
stlink-dap.cfg# 仿真器配置文件
stm32f1x.cfg# 目标芯片配置文件
STM32F103xx_FLASH.ld# 链接脚本文件
STM32F103xx.svd# 目标芯片寄存器
stm32f10x_conf.h# 标准外设库配置文件
ssd1315.c# SSD1315驱动源文件
ssd1315.h# SSD1315驱动头文件
#ifndef __SSD1315_H
#define __SSD1315_H
#include "stm32f10x.h"
/* SSD1315 I2C地址(7位地址 0x3C,左移1位为0x78)*/
#define SSD1315_I2C_ADDR 0x78
#define SSD1315_I2C I2C2
/* 引脚定义 */
#define SSD1315_I2C_SCL_GPIO GPIOB
#define SSD1315_I2C_SCL_PIN GPIO_Pin_10
#define SSD1315_I2C_SDA_GPIO GPIOB
#define SSD1315_I2C_SDA_PIN GPIO_Pin_11
/* 简化宏定义 */
uint8_t SSD1315_WriteByte(uint8_t reg, uint8_t data);
void SSD1315_SetCursor(uint8_t page, uint8_t col);
void SSD1315_Clear(void);
void SSD1315_Init(void);
#define SSD1315_WriteCmd(cmd) SSD1315_WriteByte(0x00, cmd)
#define SSD1315_WriteData(data) SSD1315_WriteByte(0x40, data)
#endif#include "ssd1315.h"
/**
* @brief I2C2 初始化
*/
static void SSD1315_I2C_Init(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
I2C_InitTypeDef I2C_InitStructure;
/* 1. 开启时钟 */
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB | RCC_APB2Periph_AFIO, ENABLE);
RCC_APB1PeriphClockCmd(RCC_APB1Periph_I2C2, ENABLE);
/* 2. 配置I2C引脚:开漏输出 */
GPIO_InitStructure.GPIO_Pin = SSD1315_I2C_SCL_PIN | SSD1315_I2C_SDA_PIN;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_OD; // 复用开漏输出
GPIO_Init(SSD1315_I2C_SCL_GPIO, &GPIO_InitStructure);
/* 3. I2C2配置 */
I2C_DeInit(SSD1315_I2C);
I2C_InitStructure.I2C_Mode = I2C_Mode_I2C;
I2C_InitStructure.I2C_DutyCycle = I2C_DutyCycle_2; // 标准模式
I2C_InitStructure.I2C_OwnAddress1 = 0x00; // 主机无需地址
I2C_InitStructure.I2C_Ack = I2C_Ack_Enable;
I2C_InitStructure.I2C_AcknowledgedAddress = I2C_AcknowledgedAddress_7bit;
I2C_InitStructure.I2C_ClockSpeed = 400000; // 400kHz 快速模式
I2C_Init(SSD1315_I2C, &I2C_InitStructure);
/* 4. 使能I2C2 */
I2C_Cmd(SSD1315_I2C, ENABLE);
}
/**
* @brief I2C2 写单字节到SSD1315
* @param reg: 控制字节(0x00=命令, 0x40=数据)
* @param data: 要写入的数据
* @retval 0=成功, 1=失败
*/
uint8_t SSD1315_WriteByte(uint8_t reg, uint8_t data)
{
/* 等待I2C空闲 */
while (I2C_GetFlagStatus(SSD1315_I2C, I2C_FLAG_BUSY))
;
/* 起始信号 */
I2C_GenerateSTART(SSD1315_I2C, ENABLE);
while (!I2C_CheckEvent(SSD1315_I2C, I2C_EVENT_MASTER_MODE_SELECT))
;
/* 发送从机地址 + 写 */
I2C_Send7bitAddress(SSD1315_I2C, SSD1315_I2C_ADDR, I2C_Direction_Transmitter);
while (!I2C_CheckEvent(SSD1315_I2C, I2C_EVENT_MASTER_TRANSMITTER_MODE_SELECTED))
;
/* 发送控制字节(命令/数据标识)*/
I2C_SendData(SSD1315_I2C, reg);
while (!I2C_CheckEvent(SSD1315_I2C, I2C_EVENT_MASTER_BYTE_TRANSMITTED))
;
/* 发送数据 */
I2C_SendData(SSD1315_I2C, data);
while (!I2C_CheckEvent(SSD1315_I2C, I2C_EVENT_MASTER_BYTE_TRANSMITTED))
;
/* 停止信号 */
I2C_GenerateSTOP(SSD1315_I2C, ENABLE);
return 0;
}
/**
* @brief I2C2 写多字节到SSD1315
* @param reg: 控制字节(0x00=命令, 0x40=数据)
* @param pData: 数据缓冲区指针
* @param len: 数据长度
* @retval 0=成功, 1=失败
*/
uint8_t SSD1315_WriteMultiByte(uint8_t reg, uint8_t *pData, uint16_t len)
{
uint16_t i;
while (I2C_GetFlagStatus(SSD1315_I2C, I2C_FLAG_BUSY))
;
I2C_GenerateSTART(SSD1315_I2C, ENABLE);
while (!I2C_CheckEvent(SSD1315_I2C, I2C_EVENT_MASTER_MODE_SELECT))
;
I2C_Send7bitAddress(SSD1315_I2C, SSD1315_I2C_ADDR, I2C_Direction_Transmitter);
while (!I2C_CheckEvent(SSD1315_I2C, I2C_EVENT_MASTER_TRANSMITTER_MODE_SELECTED))
;
I2C_SendData(SSD1315_I2C, reg);
while (!I2C_CheckEvent(SSD1315_I2C, I2C_EVENT_MASTER_BYTE_TRANSMITTED))
;
for (i = 0; i < len; i++)
{
I2C_SendData(SSD1315_I2C, pData[i]);
while (!I2C_CheckEvent(SSD1315_I2C, I2C_EVENT_MASTER_BYTE_TRANSMITTED))
;
}
I2C_GenerateSTOP(SSD1315_I2C, ENABLE);
return 0;
}
/**
* @brief 设置SSD1315页地址和列地址
* @param page: 页号 0~7 (128x64 = 8页)
* @param col: 列号 0~127
* @retval 无
*/
void SSD1315_SetCursor(uint8_t page, uint8_t col)
{
/* 设置页地址 (0xB0 ~ 0xB7) */
SSD1315_WriteCmd(0xB0 + page);
/* 设置列地址低4位 */
SSD1315_WriteCmd(0x00 + (col & 0x0F));
/* 设置列地址高4位 */
SSD1315_WriteCmd(0x10 + ((col >> 4) & 0x0F));
}
/**
* @brief 清空整个OLED屏幕
* @retval 无
*/
void SSD1315_Clear(void)
{
uint8_t page, col;
for (page = 0; page < 8; page++)
{ // 8页
SSD1315_SetCursor(page, 0); // 修正参数顺序:x, y
for (col = 0; col < 128; col++)
{
SSD1315_WriteData(0x00); // 0x00 = 全黑,0xFF = 全亮
}
}
}
void SSD1315_Init(void)
{
/* 上电延时,等待OLED稳定 */
// for(int32_t i = 0; i < 10000; i++) {}
/* 初始化I2C2 */
SSD1315_I2C_Init();
/* ---- 初始化命令序列 ---- */
/* 关闭显示 */
SSD1315_WriteCmd(0xAE);
/* 设置显示时钟分频/振荡频率 */
SSD1315_WriteCmd(0xD5);
SSD1315_WriteCmd(0x80); // 默认值
/* 设置复用率(MUX)*/
SSD1315_WriteCmd(0xA8);
SSD1315_WriteCmd(0x3F); // 64行 (0x3F = 63+1)
/* 设置显示偏移 */
SSD1315_WriteCmd(0xD3);
SSD1315_WriteCmd(0x00); // 无偏移
/* 设置显示起始行 */
SSD1315_WriteCmd(0x40); // 起始行=0
/* 设置电荷泵 */
SSD1315_WriteCmd(0x8D);
SSD1315_WriteCmd(0x14); // 使能电荷泵
/* 设置内存地址模式 */
SSD1315_WriteCmd(0x20);
SSD1315_WriteCmd(0x02); // 水平寻址模式
/* 设置段重映射(左右翻转)*/
SSD1315_WriteCmd(0xA1); // 列地址127映射到SEG0 (A0=不翻转, A1=翻转)
/* 设置COM扫描方向(上下翻转)*/
SSD1315_WriteCmd(0xC8); // C0=正常, C8=翻转
/* 设置COM引脚硬件配置 */
SSD1315_WriteCmd(0xDA);
SSD1315_WriteCmd(0x12); // 128x64: 0x12
/* 设置对比度 */
SSD1315_WriteCmd(0x81);
SSD1315_WriteCmd(0x7F); // 对比度 0~255
/* 设置预充电周期 */
SSD1315_WriteCmd(0xD9);
SSD1315_WriteCmd(0xF1); // [3:0]=相位1, [7:4]=相位2
/* 设置VCOMH反压 */
SSD1315_WriteCmd(0xDB);
SSD1315_WriteCmd(0x40); // 0x20=0.77xVcc, 0x30=0.83xVcc, 0x40=1.00xVcc
/* 全屏显示关闭(正常显示)*/
SSD1315_WriteCmd(0xA4); // A4=正常, A5=全亮
/* 设置显示模式(正常)*/
SSD1315_WriteCmd(0xA6); // A6=正常, A7=反色
/* 清屏 */
SSD1315_Clear();
/* 开启显示 */
SSD1315_WriteCmd(0xAF);
}#include "stm32f10x.h"
#include "FreeRTOS.h"
#include "task.h"
#include "ssd1315.h"
static TaskHandle_t xHandle1 = NULL, xHandle2 = NULL;
void vTask1(void *param)
{
while (1)
{
vTaskDelay(pdMS_TO_TICKS(300));
GPIO_SetBits(GPIOC, GPIO_Pin_13);
vTaskDelay(pdMS_TO_TICKS(300));
GPIO_ResetBits(GPIOC, GPIO_Pin_13);
}
}
void vTask2(void *param)
{
while (1)
{
uint8_t page, col;
for (page = 0; page < 8; page++)
{
SSD1315_SetCursor(page, 0);
for (col = 0; col < 128; col++)
{
SSD1315_WriteData(0xff); // 0x00 = 全黑,0xFF = 全亮
vTaskDelay(pdMS_TO_TICKS(10));
}
}
for (page = 0; page < 8; page++)
{
SSD1315_SetCursor(page, 0);
for (col = 0; col < 128; col++)
{
SSD1315_WriteData(0x00); // 0x00 = 全黑,0xFF = 全亮
// vTaskDelay(pdMS_TO_TICKS(10));
}
}
}
}
int main(void)
{
SSD1315_Init();
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC | RCC_APB2Periph_AFIO, ENABLE);
GPIO_InitTypeDef GPIO_InitStruct = {
.GPIO_Pin = GPIO_Pin_13,
.GPIO_Mode = GPIO_Mode_Out_PP,
.GPIO_Speed = GPIO_Speed_50MHz};
GPIO_Init(GPIOC, &GPIO_InitStruct);
xTaskCreate(vTask1, "vTask1", 32, NULL, 2, &xHandle1);
xTaskCreate(vTask2, "vTask2", 512, NULL, 3, &xHandle2);
vTaskStartScheduler();
}# 添加源文件
file(GLOB CMSIS_LIST
${PROJECT_SOURCE_DIR}/CMSIS/CM3/CoreSupport/core_cm3.c
${PROJECT_SOURCE_DIR}/CMSIS/CM3/DeviceSupport/ST/STM32F10x/system_stm32f10x.c
${PROJECT_SOURCE_DIR}/FreeRTOS-Kernel/portable/GCC/ARM_CM3/port.c
${PROJECT_SOURCE_DIR}/FreeRTOS-Kernel/portable/MemMang/heap_4.c
${PROJECT_SOURCE_DIR}/FreeRTOS-Kernel/croutine.c
${PROJECT_SOURCE_DIR}/FreeRTOS-Kernel/event_groups.c
${PROJECT_SOURCE_DIR}/FreeRTOS-Kernel/list.c
${PROJECT_SOURCE_DIR}/FreeRTOS-Kernel/queue.c
${PROJECT_SOURCE_DIR}/FreeRTOS-Kernel/stream_buffer.c
${PROJECT_SOURCE_DIR}/FreeRTOS-Kernel/tasks.c
${PROJECT_SOURCE_DIR}/FreeRTOS-Kernel/timers.c
${PROJECT_SOURCE_DIR}/ssd1315.c
)复制源文件
这里为了方便,并没有移除文档等不需要的文件
复制该目录到工程目录如下所示:
project# 工程根目录
.vscode# vscode配置目录
…
CMSIS# 架构库目录
…
STM32F10x_StdPeriph_Driver# 标准外设库 目录
…
FreeRTOS-Kernel# FREEROTS 内核目录
…
build# 编译输出目录
…
main.c# LED点亮示例代码
CMakeLists.txt# CMAKE编译配置文件
stlink-dap.cfg# 仿真器配置文件
stm32f1x.cfg# 目标芯片配置文件
STM32F103xx_FLASH.ld# 链接脚本文件
STM32F103xx.svd# 目标芯片寄存器
stm32f10x_conf.h# 标准外设库配置文件
ssd1315.c# SSD1315驱动源文件
ssd1315.h# SSD1315驱动头文件
lvgl-8.3.11# LVGL 库
…
添加代码补全和智能提示
添加LVGL相关头文件 该文件修改只影响代码预览和跳转,对工程的编译调试、仿真、无影响。
"includePath": [
"${workspaceFolder}/CMSIS/CM3/CoreSupport",
"${workspaceFolder}/CMSIS/CM3/DeviceSupport/ST/STM32F10x",
"${workspaceFolder}/STM32F10x_StdPeriph_Driver/inc",
"${workspaceFolder}/FreeRTOS-Kernel",
"${workspaceFolder}/FreeRTOS-Kernel/include",
"${workspaceFolder}/FreeRTOS-Kernel/examples/template_configuration",
"${workspaceFolder}/FreeRTOS-Kernel/portable/GCC/ARM_CM3",
"${workspaceFolder}/lvgl-8.3.11/",
"${workspaceFolder}/lvgl-8.3.11/src",
"${workspaceFolder}/lvgl-8.3.11/src/core",
"${workspaceFolder}/lvgl-8.3.11/src/draw",
"${workspaceFolder}/lvgl-8.3.11/src/extra",
"${workspaceFolder}/lvgl-8.3.11/src/extra/layouts",
"${workspaceFolder}/lvgl-8.3.11/src/extra/layouts/flex",
"${workspaceFolder}/lvgl-8.3.11/src/extra/layouts/grid",
"${workspaceFolder}/lvgl-8.3.11/src/extra/libs",
"${workspaceFolder}/lvgl-8.3.11/src/extra/others",
"${workspaceFolder}/lvgl-8.3.11/src/extra/themes",
"${workspaceFolder}/lvgl-8.3.11/src/extra/widgets",
"${workspaceFolder}/lvgl-8.3.11/src/font",
"${workspaceFolder}/lvgl-8.3.11/src/hal",
"${workspaceFolder}/lvgl-8.3.11/src/misc",
"${workspaceFolder}/lvgl-8.3.11/src/widgets",
"${workspaceFolder}/lvgl-8.3.11/examples/porting",
"${workspaceFolder}/"
],修改Debug到Release
进一步缩小体积,需要修改为Release版本,禁用了调试功能
{
"version": "2.0.0",
"options": {
"cwd": "${workspaceFolder}/build"
},
"tasks": [
{
"label": "clean",
"type": "shell",
"command": "rm * -r",
"problemMatcher": []
},
{
"label": "cmake",
"type": "shell",
"command": "cmake",
"args": [
"-G",
"MinGW Makefiles",
// ".."
"..",
"-DRELEASE=ON"
],
"dependsOn": [
"clean"
],
"problemMatcher": []
},
{
"label": "make",
"type": "shell",
// "command": "make ",
"command": "make -j${env:NUMBER_OF_PROCESSORS}", // 多线程编译,指定编译线程数为CPU核心数
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "rebuild",
"dependsOrder": "sequence",
"dependsOn": [
"cmake",
"make"
],
"problemMatcher": []
},
{
"type": "shell",
"label": "download",
"command": "openocd",
"args": [
"-f",
"../stlink-dap.cfg",
"-f",
"../stm32f1x.cfg",
"-c",
"init",
"-c",
"halt",
"-c",
"program app.bin 0x8000000",
"-c",
"reset",
"-c",
"shutdown"
],
"group": "build",
"dependsOn": "make",
"problemMatcher": []
}
]
}添加头文件、源文件路径配置
- 添加
LVGL相关的源文件、头文件 - 修改
RELEASE编译参数为-Os -flto,
# 设置 CMake 最低支持版本
cmake_minimum_required(VERSION 3.17)
# Cmake 交叉编译配置
set(CMAKE_SYSTEM_NAME Generic)
# 定义工程名称
project("demo")
# 指定编译工具
set(CMAKE_C_COMPILER "arm-none-eabi-gcc")
set(CMAKE_CXX_COMPILER "arm-none-eabi-g++")
set(CMAKE_ASM_COMPILER "arm-none-eabi-gcc")
set(CMAKE_AR "arm-none-eabi-ar")
set(CMAKE_OBJCOPY "arm-none-eabi-objcopy")
set(CMAKE_OBJDUMP "arm-none-eabi-objdump")
set(CMAKE_SIZE "arm-none-eabi-size")
# 编译相关选项
set(MCU_FLAGS "-mcpu=cortex-m3 -mthumb -mfloat-abi=soft")
set(CMAKE_C_FLAGS_DEBUG "-g -ggdb -Og")
# set(CMAKE_C_FLAGS_RELEASE "-O3")
set(CMAKE_C_FLAGS_RELEASE "-Os -flto") # 修改更激进的编译级别
# set(CMAKE_C_FLAGS "${MCU_FLAGS} -ffunction-sections -fdata-sections -fno-builtin -fno-common -Wextra -Werror -Wno-unknown-pragmas -Wl,-u,_printf_float") #-w -Wall
set(CMAKE_C_FLAGS "${MCU_FLAGS} -ffunction-sections -fdata-sections -fno-builtin -fno-common ") # -Wall -Wno-unknown-pragmas
set(CMAKE_ASM_FLAGS "${MCU_FLAGS} -x assembler-with-cpp")
if(RELEASE)
message("build for release!")
set(CMAKE_BUILD_TYPE "Release")
add_definitions(-DRELEASE)
else()
message("build for debug!")
set(CMAKE_BUILD_TYPE "Debug")
add_definitions(-DDEBUG)
endif()
# 设置编译器选项
add_definitions(-DUSE_STDPERIPH_DRIVER)
add_definitions(-DSTM32F10X_MD)
add_definitions(-DLV_LVGL_H_INCLUDE_SIMPLE)
# 添加头文件搜索路径
include_directories(
${PROJECT_SOURCE_DIR}/CMSIS/CM3/CoreSupport
${PROJECT_SOURCE_DIR}/CMSIS/CM3/DeviceSupport/ST/STM32F10x
${PROJECT_SOURCE_DIR}/STM32F10x_StdPeriph_Driver/inc
${PROJECT_SOURCE_DIR}/FreeRTOS-Kernel
${PROJECT_SOURCE_DIR}/FreeRTOS-Kernel/include
${PROJECT_SOURCE_DIR}/FreeRTOS-Kernel/examples/template_configuration
${PROJECT_SOURCE_DIR}/FreeRTOS-Kernel/portable/GCC/ARM_CM3
${PROJECT_SOURCE_DIR}/FreeRTOS-Kernel/
${PROJECT_SOURCE_DIR}/lvgl-8.3.11/
${PROJECT_SOURCE_DIR}/lvgl-8.3.11/src
${PROJECT_SOURCE_DIR}/lvgl-8.3.11/src/core
${PROJECT_SOURCE_DIR}/lvgl-8.3.11/src/draw
${PROJECT_SOURCE_DIR}/lvgl-8.3.11/src/draw/sw
${PROJECT_SOURCE_DIR}/lvgl-8.3.11/src/extra
${PROJECT_SOURCE_DIR}/lvgl-8.3.11/src/extra/layouts
${PROJECT_SOURCE_DIR}/lvgl-8.3.11/src/extra/libs
${PROJECT_SOURCE_DIR}/lvgl-8.3.11/src/extra/others
${PROJECT_SOURCE_DIR}/lvgl-8.3.11/src/extra/themes
${PROJECT_SOURCE_DIR}/lvgl-8.3.11/src/extra/themes/basic
${PROJECT_SOURCE_DIR}/lvgl-8.3.11/src/extra/themes/default
${PROJECT_SOURCE_DIR}/lvgl-8.3.11/src/extra/themes/mono
${PROJECT_SOURCE_DIR}/lvgl-8.3.11/src/extra/widgets
${PROJECT_SOURCE_DIR}/lvgl-8.3.11/src/extra/widgets/*/*
${PROJECT_SOURCE_DIR}/lvgl-8.3.11/src/font
${PROJECT_SOURCE_DIR}/lvgl-8.3.11/src/hal
${PROJECT_SOURCE_DIR}/lvgl-8.3.11/src/misc
${PROJECT_SOURCE_DIR}/lvgl-8.3.11/src/widgets
${PROJECT_SOURCE_DIR}/lvgl-8.3.11/examples/porting
${PROJECT_SOURCE_DIR}/
)
# 添加源文件
file(GLOB CMSIS_LIST
${PROJECT_SOURCE_DIR}/CMSIS/CM3/CoreSupport/core_cm3.c
${PROJECT_SOURCE_DIR}/CMSIS/CM3/DeviceSupport/ST/STM32F10x/system_stm32f10x.c
${PROJECT_SOURCE_DIR}/FreeRTOS-Kernel/portable/GCC/ARM_CM3/port.c
${PROJECT_SOURCE_DIR}/FreeRTOS-Kernel/portable/MemMang/heap_4.c
${PROJECT_SOURCE_DIR}/FreeRTOS-Kernel/croutine.c
${PROJECT_SOURCE_DIR}/FreeRTOS-Kernel/event_groups.c
${PROJECT_SOURCE_DIR}/FreeRTOS-Kernel/list.c
${PROJECT_SOURCE_DIR}/FreeRTOS-Kernel/queue.c
${PROJECT_SOURCE_DIR}/FreeRTOS-Kernel/stream_buffer.c
${PROJECT_SOURCE_DIR}/FreeRTOS-Kernel/tasks.c
${PROJECT_SOURCE_DIR}/FreeRTOS-Kernel/timers.c
${PROJECT_SOURCE_DIR}/lvgl-8.3.11/src/core/*.c
${PROJECT_SOURCE_DIR}/lvgl-8.3.11/src/draw/*.c
${PROJECT_SOURCE_DIR}/lvgl-8.3.11/src/draw/sw/*.c
${PROJECT_SOURCE_DIR}/lvgl-8.3.11/src/extra/*.c
${PROJECT_SOURCE_DIR}/lvgl-8.3.11/src/extra/layouts/*.c
${PROJECT_SOURCE_DIR}/lvgl-8.3.11/src/extra/layouts/flex/*.c
${PROJECT_SOURCE_DIR}/lvgl-8.3.11/src/extra/layouts/grid/*.c
${PROJECT_SOURCE_DIR}/lvgl-8.3.11/src/extra/libs/*.c
${PROJECT_SOURCE_DIR}/lvgl-8.3.11/src/extra/others/*.c
${PROJECT_SOURCE_DIR}/lvgl-8.3.11/src/extra/themes/*.c
${PROJECT_SOURCE_DIR}/lvgl-8.3.11/src/extra/themes/basic/*.c
${PROJECT_SOURCE_DIR}/lvgl-8.3.11/src/extra/themes/default/*.c
${PROJECT_SOURCE_DIR}/lvgl-8.3.11/src/extra/themes/mono/*.c
${PROJECT_SOURCE_DIR}/lvgl-8.3.11/src/extra/widgets/*.c
${PROJECT_SOURCE_DIR}/lvgl-8.3.11/src/extra/widgets/*/*.c
${PROJECT_SOURCE_DIR}/lvgl-8.3.11/src/font/*.c
${PROJECT_SOURCE_DIR}/lvgl-8.3.11/src/hal/*.c
${PROJECT_SOURCE_DIR}/lvgl-8.3.11/src/misc/*.c
${PROJECT_SOURCE_DIR}/lvgl-8.3.11/src/widgets/*.c
${PROJECT_SOURCE_DIR}/lvgl-8.3.11/examples/porting/*.c
${PROJECT_SOURCE_DIR}/ssd1315.c
)
aux_source_directory(${PROJECT_SOURCE_DIR}/STM32F10x_StdPeriph_Driver/src STD_LIST)
# 设置启动文件路径
set(START_UP_ASM ${PROJECT_SOURCE_DIR}/CMSIS/CM3/DeviceSupport/ST/STM32F10x/startup/gcc_ride7/startup_stm32f10x_md.s)
#设置支持 ASM
enable_language(ASM)
#设置启动文件 C 属性
set_property(SOURCE ${START_UP_ASM} PROPERTY LANGUAGE C)
# 设置链接脚本路径
set(LINKER_SCRIPT ${PROJECT_SOURCE_DIR}/STM32F103C8T6.ld)
# 设置链接器选项
#set(CMAKE_EXE_LINKER_FLAGS " -specs=rdimon.specs --specs=nano.specs -specs=nosys.specs -T${LINKER_SCRIPT} -Wl,-Map=${PROJECT_BINARY_DIR}/${DEVICE_TYPE}.map,--cref -Wl,--gc-sections")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--print-memory-usage -specs=rdimon.specs --specs=nano.specs -specs=nosys.specs -T${LINKER_SCRIPT} -Wl,-Map=${PROJECT_BINARY_DIR}/${DEVICE_TYPE}.map,--cref -Wl,--gc-sections") #镜像输出时报告 FLASH RAM 的使用率
#生成目标文件
add_executable(app.elf main.c ${START_UP_ASM} ${CMSIS_LIST} ${STD_LIST})
#设置可执行文件输出路径
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR})
#设置 ELF 转换路径
set(ELF_FILE ${PROJECT_BINARY_DIR}/app.elf)
set(HEX_FILE ${PROJECT_BINARY_DIR}/app.hex)
set(BIN_FILE ${PROJECT_BINARY_DIR}/app.bin)
add_custom_command(TARGET "app.elf" POST_BUILD
COMMAND ${CMAKE_OBJCOPY} -Obinary ${ELF_FILE} ${BIN_FILE}
COMMAND ${CMAKE_OBJCOPY} -Oihex ${ELF_FILE} ${HEX_FILE}
COMMAND ${CMAKE_COMMAND} -E copy ${HEX_FILE} "${PROJECT_BINARY_DIR}/bin/${PROJECT_NAME}.hex"
COMMAND ${CMAKE_COMMAND} -E copy ${BIN_FILE} "${PROJECT_BINARY_DIR}/bin/${PROJECT_NAME}.bin"
COMMAND ${CMAKE_COMMAND} -E copy ${ELF_FILE} "${PROJECT_BINARY_DIR}/bin/${PROJECT_NAME}.elf"
COMMAND ${CMAKE_SIZE} --format=berkeley ${ELF_FILE} ${HEX_FILE}
COMMENT "Building ${PROJECT_NAME} (bin, hex, elf) and print size")添加LVGL配置及裁剪
复制模板配置文件lvgl-8.3.11/lv_conf_template.h到lvgl-8.3.11/lv_conf.h
project# 工程根目录
.vscode# vscode配置目录
…
CMSIS# 架构库目录
…
STM32F10x_StdPeriph_Driver# 标准外设库 目录
…
FreeRTOS-Kernel# FREEROTS 内核目录
…
build# 编译输出目录
…
main.c# LED点亮示例代码
CMakeLists.txt# CMAKE编译配置文件
stlink-dap.cfg# 仿真器配置文件
stm32f1x.cfg# 目标芯片配置文件
STM32F103xx_FLASH.ld# 链接脚本文件
STM32F103xx.svd# 目标芯片寄存器
stm32f10x_conf.h# 标准外设库配置文件
ssd1315.c# SSD1315驱动源文件
ssd1315.h# SSD1315驱动头文件
lvgl-8.3.11# LVGL 库
lv_conf_template.h
lv_conf.h
…
参照以下内容修改配置 (基本上除了标签都裁剪掉了)
/**
* @file lv_conf.h
* Configuration file for v8.3.11
*/
/*
* Copy this file as `lv_conf.h`
* 1. simply next to the `lvgl` folder
* 2. or any other places and
* - define `LV_CONF_INCLUDE_SIMPLE`
* - add the path as include path
*/
/* clang-format off */
//#if 0 /*Set it to "1" to enable content*/
#if 1 //使能该文件
#ifndef LV_CONF_H
#define LV_CONF_H
#include <stdint.h>
/*====================
COLOR SETTINGS
*====================*/
/*Color depth: 1 (1 byte per pixel), 8 (RGB332), 16 (RGB565), 32 (ARGB8888)*/
//#define LV_COLOR_DEPTH 16
#define LV_COLOR_DEPTH 8 // 修改颜色深度 单色屏一个像素点占用一个字节
/*Swap the 2 bytes of RGB565 color. Useful if the display has an 8-bit interface (e.g. SPI)*/
#define LV_COLOR_16_SWAP 0
/*Enable features to draw on transparent background.
*It's required if opa, and transform_* style properties are used.
*Can be also used if the UI is above another layer, e.g. an OSD menu or video player.*/
#define LV_COLOR_SCREEN_TRANSP 0
/* Adjust color mix functions rounding. GPUs might calculate color mix (blending) differently.
* 0: round down, 64: round up from x.75, 128: round up from half, 192: round up from x.25, 254: round up */
#define LV_COLOR_MIX_ROUND_OFS 0
/*Images pixels with this color will not be drawn if they are chroma keyed)*/
#define LV_COLOR_CHROMA_KEY lv_color_hex(0x00ff00) /*pure green*/
/*=========================
MEMORY SETTINGS
*=========================*/
/*1: use custom malloc/free, 0: use the built-in `lv_mem_alloc()` and `lv_mem_free()`*/
#define LV_MEM_CUSTOM 0
#if LV_MEM_CUSTOM == 0
/*Size of the memory available for `lv_mem_alloc()` in bytes (>= 2kB)*/
//#define LV_MEM_SIZE (48U * 1024U) /*[bytes]*/
#define LV_MEM_SIZE (4U * 1024U) //减小内存大小
/*Set an address for the memory pool instead of allocating it as a normal array. Can be in external SRAM too.*/
#define LV_MEM_ADR 0 /*0: unused*/
/*Instead of an address give a memory allocator that will be called to get a memory pool for LVGL. E.g. my_malloc*/
#if LV_MEM_ADR == 0
#undef LV_MEM_POOL_INCLUDE
#undef LV_MEM_POOL_ALLOC
#endif
#else /*LV_MEM_CUSTOM*/
#define LV_MEM_CUSTOM_INCLUDE <stdlib.h> /*Header for the dynamic memory function*/
#define LV_MEM_CUSTOM_ALLOC malloc
#define LV_MEM_CUSTOM_FREE free
#define LV_MEM_CUSTOM_REALLOC realloc
#endif /*LV_MEM_CUSTOM*/
/*Number of the intermediate memory buffer used during rendering and other internal processing mechanisms.
*You will see an error log message if there wasn't enough buffers. */
// #define LV_MEM_BUF_MAX_NUM 16
#define LV_MEM_BUF_MAX_NUM 2 //减少中间缓冲区最大数量
/*Use the standard `memcpy` and `memset` instead of LVGL's own functions. (Might or might not be faster).*/
#define LV_MEMCPY_MEMSET_STD 0
/*====================
HAL SETTINGS
*====================*/
/*Default display refresh period. LVG will redraw changed areas with this period time*/
#define LV_DISP_DEF_REFR_PERIOD 30 /*[ms]*/
/*Input device read period in milliseconds*/
#define LV_INDEV_DEF_READ_PERIOD 30 /*[ms]*/
/*Use a custom tick source that tells the elapsed time in milliseconds.
*It removes the need to manually update the tick with `lv_tick_inc()`)*/
#define LV_TICK_CUSTOM 0
#if LV_TICK_CUSTOM
#define LV_TICK_CUSTOM_INCLUDE "Arduino.h" /*Header for the system time function*/
#define LV_TICK_CUSTOM_SYS_TIME_EXPR (millis()) /*Expression evaluating to current system time in ms*/
/*If using lvgl as ESP32 component*/
// #define LV_TICK_CUSTOM_INCLUDE "esp_timer.h"
// #define LV_TICK_CUSTOM_SYS_TIME_EXPR ((esp_timer_get_time() / 1000LL))
#endif /*LV_TICK_CUSTOM*/
/*Default Dot Per Inch. Used to initialize default sizes such as widgets sized, style paddings.
*(Not so important, you can adjust it to modify default sizes and spaces)*/
#define LV_DPI_DEF 130 /*[px/inch]*/
/*=======================
* FEATURE CONFIGURATION
*=======================*/
/*-------------
* Drawing
*-----------*/
/*Enable complex draw engine.
*Required to draw shadow, gradient, rounded corners, circles, arc, skew lines, image transformations or any masks*/
// #define LV_DRAW_COMPLEX 1
#define LV_DRAW_COMPLEX 0 //关闭阴影等效果
#if LV_DRAW_COMPLEX != 0
/*Allow buffering some shadow calculation.
*LV_SHADOW_CACHE_SIZE is the max. shadow size to buffer, where shadow size is `shadow_width + radius`
*Caching has LV_SHADOW_CACHE_SIZE^2 RAM cost*/
#define LV_SHADOW_CACHE_SIZE 0
/* Set number of maximally cached circle data.
* The circumference of 1/4 circle are saved for anti-aliasing
* radius * 4 bytes are used per circle (the most often used radiuses are saved)
* 0: to disable caching */
#define LV_CIRCLE_CACHE_SIZE 4
#endif /*LV_DRAW_COMPLEX*/
/**
* "Simple layers" are used when a widget has `style_opa < 255` to buffer the widget into a layer
* and blend it as an image with the given opacity.
* Note that `bg_opa`, `text_opa` etc don't require buffering into layer)
* The widget can be buffered in smaller chunks to avoid using large buffers.
*
* - LV_LAYER_SIMPLE_BUF_SIZE: [bytes] the optimal target buffer size. LVGL will try to allocate it
* - LV_LAYER_SIMPLE_FALLBACK_BUF_SIZE: [bytes] used if `LV_LAYER_SIMPLE_BUF_SIZE` couldn't be allocated.
*
* Both buffer sizes are in bytes.
* "Transformed layers" (where transform_angle/zoom properties are used) use larger buffers
* and can't be drawn in chunks. So these settings affects only widgets with opacity.
*/
// #define LV_LAYER_SIMPLE_BUF_SIZE (24 * 1024)
// #define LV_LAYER_SIMPLE_FALLBACK_BUF_SIZE (3 * 1024)
#define LV_LAYER_SIMPLE_BUF_SIZE (1 * 1024) //减小图层缓冲大小
#define LV_LAYER_SIMPLE_FALLBACK_BUF_SIZE (512) //减小图层缓冲大小
/*Default image cache size. Image caching keeps the images opened.
*If only the built-in image formats are used there is no real advantage of caching. (I.e. if no new image decoder is added)
*With complex image decoders (e.g. PNG or JPG) caching can save the continuous open/decode of images.
*However the opened images might consume additional RAM.
*0: to disable caching*/
#define LV_IMG_CACHE_DEF_SIZE 0
/*Number of stops allowed per gradient. Increase this to allow more stops.
*This adds (sizeof(lv_color_t) + 1) bytes per additional stop*/
#define LV_GRADIENT_MAX_STOPS 2
/*Default gradient buffer size.
*When LVGL calculates the gradient "maps" it can save them into a cache to avoid calculating them again.
*LV_GRAD_CACHE_DEF_SIZE sets the size of this cache in bytes.
*If the cache is too small the map will be allocated only while it's required for the drawing.
*0 mean no caching.*/
#define LV_GRAD_CACHE_DEF_SIZE 0
/*Allow dithering the gradients (to achieve visual smooth color gradients on limited color depth display)
*LV_DITHER_GRADIENT implies allocating one or two more lines of the object's rendering surface
*The increase in memory consumption is (32 bits * object width) plus 24 bits * object width if using error diffusion */
#define LV_DITHER_GRADIENT 0
#if LV_DITHER_GRADIENT
/*Add support for error diffusion dithering.
*Error diffusion dithering gets a much better visual result, but implies more CPU consumption and memory when drawing.
*The increase in memory consumption is (24 bits * object's width)*/
#define LV_DITHER_ERROR_DIFFUSION 0
#endif
/*Maximum buffer size to allocate for rotation.
*Only used if software rotation is enabled in the display driver.*/
// #define LV_DISP_ROT_MAX_BUF (10*1024)
#define LV_DISP_ROT_MAX_BUF (512) //减小旋转操作分配的最大缓冲区大小
/*-------------
* GPU
*-----------*/
/*Use Arm's 2D acceleration library Arm-2D */
#define LV_USE_GPU_ARM2D 0
/*Use STM32's DMA2D (aka Chrom Art) GPU*/
#define LV_USE_GPU_STM32_DMA2D 0
#if LV_USE_GPU_STM32_DMA2D
/*Must be defined to include path of CMSIS header of target processor
e.g. "stm32f7xx.h" or "stm32f4xx.h"*/
#define LV_GPU_DMA2D_CMSIS_INCLUDE
#endif
/*Enable RA6M3 G2D GPU*/
#define LV_USE_GPU_RA6M3_G2D 0
#if LV_USE_GPU_RA6M3_G2D
/*include path of target processor
e.g. "hal_data.h"*/
#define LV_GPU_RA6M3_G2D_INCLUDE "hal_data.h"
#endif
/*Use SWM341's DMA2D GPU*/
#define LV_USE_GPU_SWM341_DMA2D 0
#if LV_USE_GPU_SWM341_DMA2D
#define LV_GPU_SWM341_DMA2D_INCLUDE "SWM341.h"
#endif
/*Use NXP's PXP GPU iMX RTxxx platforms*/
#define LV_USE_GPU_NXP_PXP 0
#if LV_USE_GPU_NXP_PXP
/*1: Add default bare metal and FreeRTOS interrupt handling routines for PXP (lv_gpu_nxp_pxp_osa.c)
* and call lv_gpu_nxp_pxp_init() automatically during lv_init(). Note that symbol SDK_OS_FREE_RTOS
* has to be defined in order to use FreeRTOS OSA, otherwise bare-metal implementation is selected.
*0: lv_gpu_nxp_pxp_init() has to be called manually before lv_init()
*/
#define LV_USE_GPU_NXP_PXP_AUTO_INIT 0
#endif
/*Use NXP's VG-Lite GPU iMX RTxxx platforms*/
#define LV_USE_GPU_NXP_VG_LITE 0
/*Use SDL renderer API*/
#define LV_USE_GPU_SDL 0
#if LV_USE_GPU_SDL
#define LV_GPU_SDL_INCLUDE_PATH <SDL2/SDL.h>
/*Texture cache size, 8MB by default*/
#define LV_GPU_SDL_LRU_SIZE (1024 * 1024 * 8)
/*Custom blend mode for mask drawing, disable if you need to link with older SDL2 lib*/
#define LV_GPU_SDL_CUSTOM_BLEND_MODE (SDL_VERSION_ATLEAST(2, 0, 6))
#endif
/*-------------
* Logging
*-----------*/
/*Enable the log module*/
#define LV_USE_LOG 0
#if LV_USE_LOG
/*How important log should be added:
*LV_LOG_LEVEL_TRACE A lot of logs to give detailed information
*LV_LOG_LEVEL_INFO Log important events
*LV_LOG_LEVEL_WARN Log if something unwanted happened but didn't cause a problem
*LV_LOG_LEVEL_ERROR Only critical issue, when the system may fail
*LV_LOG_LEVEL_USER Only logs added by the user
*LV_LOG_LEVEL_NONE Do not log anything*/
#define LV_LOG_LEVEL LV_LOG_LEVEL_WARN
/*1: Print the log with 'printf';
*0: User need to register a callback with `lv_log_register_print_cb()`*/
#define LV_LOG_PRINTF 0
/*Enable/disable LV_LOG_TRACE in modules that produces a huge number of logs*/
#define LV_LOG_TRACE_MEM 1
#define LV_LOG_TRACE_TIMER 1
#define LV_LOG_TRACE_INDEV 1
#define LV_LOG_TRACE_DISP_REFR 1
#define LV_LOG_TRACE_EVENT 1
#define LV_LOG_TRACE_OBJ_CREATE 1
#define LV_LOG_TRACE_LAYOUT 1
#define LV_LOG_TRACE_ANIM 1
#endif /*LV_USE_LOG*/
/*-------------
* Asserts
*-----------*/
/*Enable asserts if an operation is failed or an invalid data is found.
*If LV_USE_LOG is enabled an error message will be printed on failure*/
// #define LV_USE_ASSERT_NULL 1 /*Check if the parameter is NULL. (Very fast, recommended)*/
#define LV_USE_ASSERT_NULL 0 //关闭NULL的断言
// #define LV_USE_ASSERT_MALLOC 1 /*Checks is the memory is successfully allocated or no. (Very fast, recommended)*/
#define LV_USE_ASSERT_MALLOC 0 //关闭MALLOC的断言
#define LV_USE_ASSERT_STYLE 0 /*Check if the styles are properly initialized. (Very fast, recommended)*/
#define LV_USE_ASSERT_MEM_INTEGRITY 0 /*Check the integrity of `lv_mem` after critical operations. (Slow)*/
#define LV_USE_ASSERT_OBJ 0 /*Check the object's type and existence (e.g. not deleted). (Slow)*/
/*Add a custom handler when assert happens e.g. to restart the MCU*/
#define LV_ASSERT_HANDLER_INCLUDE <stdint.h>
#define LV_ASSERT_HANDLER while(1); /*Halt by default*/
/*-------------
* Others
*-----------*/
/*1: Show CPU usage and FPS count*/
#define LV_USE_PERF_MONITOR 0
#if LV_USE_PERF_MONITOR
#define LV_USE_PERF_MONITOR_POS LV_ALIGN_BOTTOM_RIGHT
#endif
/*1: Show the used memory and the memory fragmentation
* Requires LV_MEM_CUSTOM = 0*/
#define LV_USE_MEM_MONITOR 0
#if LV_USE_MEM_MONITOR
#define LV_USE_MEM_MONITOR_POS LV_ALIGN_BOTTOM_LEFT
#endif
/*1: Draw random colored rectangles over the redrawn areas*/
#define LV_USE_REFR_DEBUG 0
/*Change the built in (v)snprintf functions*/
#define LV_SPRINTF_CUSTOM 0
#if LV_SPRINTF_CUSTOM
#define LV_SPRINTF_INCLUDE <stdio.h>
#define lv_snprintf snprintf
#define lv_vsnprintf vsnprintf
#else /*LV_SPRINTF_CUSTOM*/
#define LV_SPRINTF_USE_FLOAT 0
#endif /*LV_SPRINTF_CUSTOM*/
#define LV_USE_USER_DATA 1
/*Garbage Collector settings
*Used if lvgl is bound to higher level language and the memory is managed by that language*/
#define LV_ENABLE_GC 0
#if LV_ENABLE_GC != 0
#define LV_GC_INCLUDE "gc.h" /*Include Garbage Collector related things*/
#endif /*LV_ENABLE_GC*/
/*=====================
* COMPILER SETTINGS
*====================*/
/*For big endian systems set to 1*/
#define LV_BIG_ENDIAN_SYSTEM 0
/*Define a custom attribute to `lv_tick_inc` function*/
#define LV_ATTRIBUTE_TICK_INC
/*Define a custom attribute to `lv_timer_handler` function*/
#define LV_ATTRIBUTE_TIMER_HANDLER
/*Define a custom attribute to `lv_disp_flush_ready` function*/
#define LV_ATTRIBUTE_FLUSH_READY
/*Required alignment size for buffers*/
#define LV_ATTRIBUTE_MEM_ALIGN_SIZE 1
/*Will be added where memories needs to be aligned (with -Os data might not be aligned to boundary by default).
* E.g. __attribute__((aligned(4)))*/
#define LV_ATTRIBUTE_MEM_ALIGN
/*Attribute to mark large constant arrays for example font's bitmaps*/
#define LV_ATTRIBUTE_LARGE_CONST
/*Compiler prefix for a big array declaration in RAM*/
#define LV_ATTRIBUTE_LARGE_RAM_ARRAY
/*Place performance critical functions into a faster memory (e.g RAM)*/
#define LV_ATTRIBUTE_FAST_MEM
/*Prefix variables that are used in GPU accelerated operations, often these need to be placed in RAM sections that are DMA accessible*/
#define LV_ATTRIBUTE_DMA
/*Export integer constant to binding. This macro is used with constants in the form of LV_<CONST> that
*should also appear on LVGL binding API such as Micropython.*/
#define LV_EXPORT_CONST_INT(int_value) struct _silence_gcc_warning /*The default value just prevents GCC warning*/
/*Extend the default -32k..32k coordinate range to -4M..4M by using int32_t for coordinates instead of int16_t*/
#define LV_USE_LARGE_COORD 0
/*==================
* FONT USAGE
*===================*/
/*Montserrat fonts with ASCII range and some symbols using bpp = 4
*https://fonts.google.com/specimen/Montserrat*/
#define LV_FONT_MONTSERRAT_8 0
#define LV_FONT_MONTSERRAT_10 0
#define LV_FONT_MONTSERRAT_12 0
#define LV_FONT_MONTSERRAT_14 1
#define LV_FONT_MONTSERRAT_16 0
#define LV_FONT_MONTSERRAT_18 0
#define LV_FONT_MONTSERRAT_20 0
#define LV_FONT_MONTSERRAT_22 0
#define LV_FONT_MONTSERRAT_24 0
#define LV_FONT_MONTSERRAT_26 0
#define LV_FONT_MONTSERRAT_28 0
#define LV_FONT_MONTSERRAT_30 0
#define LV_FONT_MONTSERRAT_32 0
#define LV_FONT_MONTSERRAT_34 0
#define LV_FONT_MONTSERRAT_36 0
#define LV_FONT_MONTSERRAT_38 0
#define LV_FONT_MONTSERRAT_40 0
#define LV_FONT_MONTSERRAT_42 0
#define LV_FONT_MONTSERRAT_44 0
#define LV_FONT_MONTSERRAT_46 0
#define LV_FONT_MONTSERRAT_48 0
/*Demonstrate special features*/
#define LV_FONT_MONTSERRAT_12_SUBPX 0
#define LV_FONT_MONTSERRAT_28_COMPRESSED 0 /*bpp = 3*/
#define LV_FONT_DEJAVU_16_PERSIAN_HEBREW 0 /*Hebrew, Arabic, Persian letters and all their forms*/
#define LV_FONT_SIMSUN_16_CJK 0 /*1000 most common CJK radicals*/
/*Pixel perfect monospace fonts*/
#define LV_FONT_UNSCII_8 0
#define LV_FONT_UNSCII_16 0
/*Optionally declare custom fonts here.
*You can use these fonts as default font too and they will be available globally.
*E.g. #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(my_font_1) LV_FONT_DECLARE(my_font_2)*/
#define LV_FONT_CUSTOM_DECLARE
/*Always set a default font*/
#define LV_FONT_DEFAULT &lv_font_montserrat_14
/*Enable handling large font and/or fonts with a lot of characters.
*The limit depends on the font size, font face and bpp.
*Compiler error will be triggered if a font needs it.*/
#define LV_FONT_FMT_TXT_LARGE 0
/*Enables/disables support for compressed fonts.*/
#define LV_USE_FONT_COMPRESSED 0
/*Enable subpixel rendering*/
#define LV_USE_FONT_SUBPX 0
#if LV_USE_FONT_SUBPX
/*Set the pixel order of the display. Physical order of RGB channels. Doesn't matter with "normal" fonts.*/
#define LV_FONT_SUBPX_BGR 0 /*0: RGB; 1:BGR order*/
#endif
/*Enable drawing placeholders when glyph dsc is not found*/
#define LV_USE_FONT_PLACEHOLDER 1
/*=================
* TEXT SETTINGS
*=================*/
/**
* Select a character encoding for strings.
* Your IDE or editor should have the same character encoding
* - LV_TXT_ENC_UTF8
* - LV_TXT_ENC_ASCII
*/
#define LV_TXT_ENC LV_TXT_ENC_UTF8
/*Can break (wrap) texts on these chars*/
#define LV_TXT_BREAK_CHARS " ,.;:-_"
/*If a word is at least this long, will break wherever "prettiest"
*To disable, set to a value <= 0*/
#define LV_TXT_LINE_BREAK_LONG_LEN 0
/*Minimum number of characters in a long word to put on a line before a break.
*Depends on LV_TXT_LINE_BREAK_LONG_LEN.*/
#define LV_TXT_LINE_BREAK_LONG_PRE_MIN_LEN 3
/*Minimum number of characters in a long word to put on a line after a break.
*Depends on LV_TXT_LINE_BREAK_LONG_LEN.*/
#define LV_TXT_LINE_BREAK_LONG_POST_MIN_LEN 3
/*The control character to use for signalling text recoloring.*/
#define LV_TXT_COLOR_CMD "#"
/*Support bidirectional texts. Allows mixing Left-to-Right and Right-to-Left texts.
*The direction will be processed according to the Unicode Bidirectional Algorithm:
*https://www.w3.org/International/articles/inline-bidi-markup/uba-basics*/
#define LV_USE_BIDI 0
#if LV_USE_BIDI
/*Set the default direction. Supported values:
*`LV_BASE_DIR_LTR` Left-to-Right
*`LV_BASE_DIR_RTL` Right-to-Left
*`LV_BASE_DIR_AUTO` detect texts base direction*/
#define LV_BIDI_BASE_DIR_DEF LV_BASE_DIR_AUTO
#endif
/*Enable Arabic/Persian processing
*In these languages characters should be replaced with an other form based on their position in the text*/
#define LV_USE_ARABIC_PERSIAN_CHARS 0
/*==================
* WIDGET USAGE
*================*/
/*Documentation of the widgets: https://docs.lvgl.io/latest/en/html/widgets/index.html*/
// #define LV_USE_ARC 1
#define LV_USE_ARC 0 // 禁用圆弧控件
// #define LV_USE_BAR 1
#define LV_USE_BAR 0 // 禁用进度条
// #define LV_USE_BTN 1
#define LV_USE_BTN 0 // 禁用按键
// #define LV_USE_BTNMATRIX 1
#define LV_USE_BTNMATRIX 0 // 禁用按钮矩阵控件
// #define LV_USE_CANVAS 1
#define LV_USE_CANVAS 0 // 禁用画布控件
// #define LV_USE_CHECKBOX 1
#define LV_USE_CHECKBOX 0 // 禁用复选框控件
// #define LV_USE_DROPDOWN 1 /*Requires: lv_label*/
#define LV_USE_DROPDOWN 0 // 禁用下拉列表空间
// #define LV_USE_IMG 1 /*Requires: lv_label*/
#define LV_USE_IMG 0 // 禁用图像控件
#define LV_USE_LABEL 1
#if LV_USE_LABEL
// #define LV_LABEL_TEXT_SELECTION 1 /*Enable selecting text of the label*/
// #define LV_LABEL_LONG_TXT_HINT 1 /*Store some extra info in labels to speed up drawing of very long texts*/
#define LV_LABEL_TEXT_SELECTION 0 //标签文本选中
#define LV_LABEL_LONG_TXT_HINT 0 // 禁用长文本提示优化
#endif
// #define LV_USE_LINE 1
#define LV_USE_LINE 0 // 禁用线条控件
// #define LV_USE_ROLLER 1 /*Requires: lv_label*/
#define LV_USE_ROLLER 0 // 禁用滚动选择器控件
#if LV_USE_ROLLER
#define LV_ROLLER_INF_PAGES 7 /*Number of extra "pages" when the roller is infinite*/
#endif
// #define LV_USE_SLIDER 1 /*Requires: lv_bar*/
#define LV_USE_SLIDER 0 // 禁用滑块控件
// #define LV_USE_SWITCH 1
#define LV_USE_SWITCH 0 // 禁用开关控件
// #define LV_USE_TEXTAREA 1 /*Requires: lv_label*/
#define LV_USE_TEXTAREA 0 // 文本输入区域控件
#if LV_USE_TEXTAREA != 0
#define LV_TEXTAREA_DEF_PWD_SHOW_TIME 1500 /*ms*/
#endif
// #define LV_USE_TABLE 1
#define LV_USE_TABLE 0 // 禁用表格控件
/*==================
* EXTRA COMPONENTS
*==================*/
/*-----------
* Widgets
*----------*/
// #define LV_USE_ANIMIMG 1
#define LV_USE_ANIMIMG 0 // 禁用动画控件
// #define LV_USE_CALENDAR 1
#define LV_USE_CALENDAR 0 // 禁用日历控件
#if LV_USE_CALENDAR
#define LV_CALENDAR_WEEK_STARTS_MONDAY 0
#if LV_CALENDAR_WEEK_STARTS_MONDAY
#define LV_CALENDAR_DEFAULT_DAY_NAMES {"Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"}
#else
#define LV_CALENDAR_DEFAULT_DAY_NAMES {"Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"}
#endif
#define LV_CALENDAR_DEFAULT_MONTH_NAMES {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}
#define LV_USE_CALENDAR_HEADER_ARROW 1
#define LV_USE_CALENDAR_HEADER_DROPDOWN 1
#endif /*LV_USE_CALENDAR*/
// #define LV_USE_CHART 1
#define LV_USE_CHART 0 // 禁用图表控件
// #define LV_USE_COLORWHEEL 1
#define LV_USE_COLORWHEEL 0 // 禁用色环控件
// #define LV_USE_IMGBTN 1
#define LV_USE_IMGBTN 0 // 禁用图片按钮控件
// #define LV_USE_KEYBOARD 1
#define LV_USE_KEYBOARD 0 // 禁用键盘控件
// #define LV_USE_LED 1
#define LV_USE_LED 0 // 禁用指示灯控件
// #define LV_USE_LIST 1
#define LV_USE_LIST 0 // 禁用列表控件
// #define LV_USE_MENU 1
#define LV_USE_MENU 0 // 禁用菜单控件
// #define LV_USE_METER 1
#define LV_USE_METER 0 // 禁用仪表盘控件
// #define LV_USE_MSGBOX 1
#define LV_USE_MSGBOX 0 // 禁用消息框控件
// #define LV_USE_SPAN 1
#define LV_USE_SPAN 0 // 禁用文本块控件
#if LV_USE_SPAN
/*A line text can contain maximum num of span descriptor */
#define LV_SPAN_SNIPPET_STACK_SIZE 64
#endif
// #define LV_USE_SPINBOX 1
#define LV_USE_SPINBOX 0 // 禁用微调框控件
// #define LV_USE_SPINNER 1
#define LV_USE_SPINNER 0 // 禁用加载旋转器控件
// #define LV_USE_TABVIEW 1
#define LV_USE_TABVIEW 0 // 禁用标签视图控件
// #define LV_USE_TILEVIEW 1
#define LV_USE_TILEVIEW 0 // 禁用平铺视图控件
// #define LV_USE_WIN 1
#define LV_USE_WIN 0 // 禁用窗口控件
/*-----------
* Themes
*----------*/
/*A simple, impressive and very complete theme*/
// #define LV_USE_THEME_DEFAULT 1
#define LV_USE_THEME_DEFAULT 0 // 禁用默认主题
#if LV_USE_THEME_DEFAULT
/*0: Light mode; 1: Dark mode*/
#define LV_THEME_DEFAULT_DARK 0
/*1: Enable grow on press*/
#define LV_THEME_DEFAULT_GROW 1
/*Default transition time in [ms]*/
#define LV_THEME_DEFAULT_TRANSITION_TIME 80
#endif /*LV_USE_THEME_DEFAULT*/
/*A very simple theme that is a good starting point for a custom theme*/
// #define LV_USE_THEME_BASIC 1
#define LV_USE_THEME_BASIC 0 // 禁用基础主题
/*A theme designed for monochrome displays*/
// #define LV_USE_THEME_MONO 1
#define LV_USE_THEME_MONO 0 // 禁用单色主题
/*-----------
* Layouts
*----------*/
/*A layout similar to Flexbox in CSS.*/
// #define LV_USE_FLEX 1
#define LV_USE_FLEX 0 // 禁用Flex 弹性布局
/*A layout similar to Grid in CSS.*/
// #define LV_USE_GRID 1
#define LV_USE_GRID 0 // 禁用Grid 弹性布局
/*---------------------
* 3rd party libraries
*--------------------*/
/*File system interfaces for common APIs */
/*API for fopen, fread, etc*/
#define LV_USE_FS_STDIO 0
#if LV_USE_FS_STDIO
#define LV_FS_STDIO_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
#define LV_FS_STDIO_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/
#define LV_FS_STDIO_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/
#endif
/*API for open, read, etc*/
#define LV_USE_FS_POSIX 0
#if LV_USE_FS_POSIX
#define LV_FS_POSIX_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
#define LV_FS_POSIX_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/
#define LV_FS_POSIX_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/
#endif
/*API for CreateFile, ReadFile, etc*/
#define LV_USE_FS_WIN32 0
#if LV_USE_FS_WIN32
#define LV_FS_WIN32_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
#define LV_FS_WIN32_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/
#define LV_FS_WIN32_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/
#endif
/*API for FATFS (needs to be added separately). Uses f_open, f_read, etc*/
#define LV_USE_FS_FATFS 0
#if LV_USE_FS_FATFS
#define LV_FS_FATFS_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
#define LV_FS_FATFS_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/
#endif
/*API for LittleFS (library needs to be added separately). Uses lfs_file_open, lfs_file_read, etc*/
#define LV_USE_FS_LITTLEFS 0
#if LV_USE_FS_LITTLEFS
#define LV_FS_LITTLEFS_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
#define LV_FS_LITTLEFS_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/
#endif
/*PNG decoder library*/
#define LV_USE_PNG 0
/*BMP decoder library*/
#define LV_USE_BMP 0
/* JPG + split JPG decoder library.
* Split JPG is a custom format optimized for embedded systems. */
#define LV_USE_SJPG 0
/*GIF decoder library*/
#define LV_USE_GIF 0
/*QR code library*/
#define LV_USE_QRCODE 0
/*FreeType library*/
#define LV_USE_FREETYPE 0
#if LV_USE_FREETYPE
/*Memory used by FreeType to cache characters [bytes] (-1: no caching)*/
#define LV_FREETYPE_CACHE_SIZE (16 * 1024)
#if LV_FREETYPE_CACHE_SIZE >= 0
/* 1: bitmap cache use the sbit cache, 0:bitmap cache use the image cache. */
/* sbit cache:it is much more memory efficient for small bitmaps(font size < 256) */
/* if font size >= 256, must be configured as image cache */
#define LV_FREETYPE_SBIT_CACHE 0
/* Maximum number of opened FT_Face/FT_Size objects managed by this cache instance. */
/* (0:use system defaults) */
#define LV_FREETYPE_CACHE_FT_FACES 0
#define LV_FREETYPE_CACHE_FT_SIZES 0
#endif
#endif
/*Tiny TTF library*/
#define LV_USE_TINY_TTF 0
#if LV_USE_TINY_TTF
/*Load TTF data from files*/
#define LV_TINY_TTF_FILE_SUPPORT 0
#endif
/*Rlottie library*/
#define LV_USE_RLOTTIE 0
/*FFmpeg library for image decoding and playing videos
*Supports all major image formats so do not enable other image decoder with it*/
#define LV_USE_FFMPEG 0
#if LV_USE_FFMPEG
/*Dump input information to stderr*/
#define LV_FFMPEG_DUMP_FORMAT 0
#endif
/*-----------
* Others
*----------*/
/*1: Enable API to take snapshot for object*/
#define LV_USE_SNAPSHOT 0
/*1: Enable Monkey test*/
#define LV_USE_MONKEY 0
/*1: Enable grid navigation*/
#define LV_USE_GRIDNAV 0
/*1: Enable lv_obj fragment*/
#define LV_USE_FRAGMENT 0
/*1: Support using images as font in label or span widgets */
#define LV_USE_IMGFONT 0
/*1: Enable a published subscriber based messaging system */
#define LV_USE_MSG 0
/*1: Enable Pinyin input method*/
/*Requires: lv_keyboard*/
#define LV_USE_IME_PINYIN 0
#if LV_USE_IME_PINYIN
/*1: Use default thesaurus*/
/*If you do not use the default thesaurus, be sure to use `lv_ime_pinyin` after setting the thesauruss*/
#define LV_IME_PINYIN_USE_DEFAULT_DICT 1
/*Set the maximum number of candidate panels that can be displayed*/
/*This needs to be adjusted according to the size of the screen*/
#define LV_IME_PINYIN_CAND_TEXT_NUM 6
/*Use 9 key input(k9)*/
#define LV_IME_PINYIN_USE_K9_MODE 1
#if LV_IME_PINYIN_USE_K9_MODE == 1
#define LV_IME_PINYIN_K9_CAND_TEXT_NUM 3
#endif // LV_IME_PINYIN_USE_K9_MODE
#endif
/*==================
* EXAMPLES
*==================*/
/*Enable the examples to be built with the library*/
// #define LV_BUILD_EXAMPLES 1
#define LV_BUILD_EXAMPLES 0 // 不编译示例
/*===================
* DEMO USAGE
====================*/
/*Show some widget. It might be required to increase `LV_MEM_SIZE` */
#define LV_USE_DEMO_WIDGETS 0
#if LV_USE_DEMO_WIDGETS
#define LV_DEMO_WIDGETS_SLIDESHOW 0
#endif
/*Demonstrate the usage of encoder and keyboard*/
#define LV_USE_DEMO_KEYPAD_AND_ENCODER 0
/*Benchmark your system*/
#define LV_USE_DEMO_BENCHMARK 0
#if LV_USE_DEMO_BENCHMARK
/*Use RGB565A8 images with 16 bit color depth instead of ARGB8565*/
#define LV_DEMO_BENCHMARK_RGB565A8 0
#endif
/*Stress test for LVGL*/
#define LV_USE_DEMO_STRESS 0
/*Music player demo*/
#define LV_USE_DEMO_MUSIC 0
#if LV_USE_DEMO_MUSIC
#define LV_DEMO_MUSIC_SQUARE 0
#define LV_DEMO_MUSIC_LANDSCAPE 0
#define LV_DEMO_MUSIC_ROUND 0
#define LV_DEMO_MUSIC_LARGE 0
#define LV_DEMO_MUSIC_AUTO_PLAY 0
#endif
// 添加屏幕分辨率
#define MY_DISP_HOR_RES (128)
#define MY_DISP_VER_RES (64)
/*--END OF LV_CONF_H--*/
#endif /*LV_CONF_H*/
#endif /*End of "Content enable"*/移植显示驱动
- 复制模板配置文件
lvgl-8.3.11/examples/porting/lv_port_disp_template.c到lvgl-8.3.11/examples/porting/lv_port_disp.c - 复制模板配置文件
lvgl-8.3.11/examples/porting/lv_port_disp_template.h到lvgl-8.3.11/examples/porting/lv_port_disp.h
project# 工程根目录
.vscode# vscode配置目录
…
CMSIS# 架构库目录
…
STM32F10x_StdPeriph_Driver# 标准外设库 目录
…
FreeRTOS-Kernel# FREEROTS 内核目录
…
build# 编译输出目录
…
main.c# LED点亮示例代码
CMakeLists.txt# CMAKE编译配置文件
stlink-dap.cfg# 仿真器配置文件
stm32f1x.cfg# 目标芯片配置文件
STM32F103xx_FLASH.ld# 链接脚本文件
STM32F103xx.svd# 目标芯片寄存器
stm32f10x_conf.h# 标准外设库配置文件
ssd1315.c# SSD1315驱动源文件
ssd1315.h# SSD1315驱动头文件
lvgl-8.3.11# LVGL 库
examples
porting
lv_port_disp_template.c
lv_port_disp_template.h
lv_port_disp.c
lv_port_disp.h
…
参照以下内容修改
/**
* @file lv_port_disp.h
*
*/
/*Copy this file as "lv_port_disp.h" and set this value to "1" to enable content*/
// #if 0
#if 1 // 使能该文件
#ifndef LV_PORT_DISP_H
#define LV_PORT_DISP_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#if defined(LV_LVGL_H_INCLUDE_SIMPLE)
#include "lvgl.h"
#else
#include "lvgl/lvgl.h"
#endif
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/**********************
* GLOBAL PROTOTYPES
**********************/
/* Initialize low level display driver */
void lv_port_disp_init(void);
/* Enable updating the screen (the flushing process) when disp_flush() is called by LVGL
*/
void disp_enable_update(void);
/* Disable updating the screen (the flushing process) when disp_flush() is called by LVGL
*/
void disp_disable_update(void);
__weak_symbol void disp_init_todo(void); //弱定义初始化,由外部实现
__weak_symbol void disp_flush_todo(lv_disp_drv_t *disp_drv, const lv_area_t *area, lv_color_t *color_p); //弱定义刷新,由外部实现
/**********************
* MACROS
**********************/
#ifdef __cplusplus
} /*extern "C"*/
#endif
#endif /*LV_PORT_DISP_TEMPL_H*/
#endif /*Disable/Enable content*//**
* @file lv_port_disp_templ.c
*
*/
/*Copy this file as "lv_port_disp.c" and set this value to "1" to enable content*/
// #if 0
#if 1 // 使能该文件
/*********************
* INCLUDES
*********************/
// #include "lv_port_disp_template.h"
#include "lv_port_disp.h"
#include <stdbool.h>
/*********************
* DEFINES
*********************/
#ifndef MY_DISP_HOR_RES
#warning Please define or replace the macro MY_DISP_HOR_RES with the actual screen width, default value 320 is used for now.
#define MY_DISP_HOR_RES 320
#endif
#ifndef MY_DISP_VER_RES
#warning Please define or replace the macro MY_DISP_HOR_RES with the actual screen height, default value 240 is used for now.
#define MY_DISP_VER_RES 240
#endif
/**********************
* TYPEDEFS
**********************/
/**********************
* STATIC PROTOTYPES
**********************/
static void disp_init(void);
static void disp_flush(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_color_t * color_p);
//static void gpu_fill(lv_disp_drv_t * disp_drv, lv_color_t * dest_buf, lv_coord_t dest_width,
// const lv_area_t * fill_area, lv_color_t color);
/**********************
* STATIC VARIABLES
**********************/
/**********************
* MACROS
**********************/
/**********************
* GLOBAL FUNCTIONS
**********************/
void lv_port_disp_init(void)
{
/*-------------------------
* Initialize your display
* -----------------------*/
disp_init();
/*-----------------------------
* Create a buffer for drawing
*----------------------------*/
/**
* LVGL requires a buffer where it internally draws the widgets.
* Later this buffer will passed to your display driver's `flush_cb` to copy its content to your display.
* The buffer has to be greater than 1 display row
*
* There are 3 buffering configurations:
* 1. Create ONE buffer:
* LVGL will draw the display's content here and writes it to your display
*
* 2. Create TWO buffer:
* LVGL will draw the display's content to a buffer and writes it your display.
* You should use DMA to write the buffer's content to the display.
* It will enable LVGL to draw the next part of the screen to the other buffer while
* the data is being sent form the first buffer. It makes rendering and flushing parallel.
*
* 3. Double buffering
* Set 2 screens sized buffers and set disp_drv.full_refresh = 1.
* This way LVGL will always provide the whole rendered screen in `flush_cb`
* and you only need to change the frame buffer's address.
*/
/* Example for 1) */
static lv_disp_draw_buf_t draw_buf_dsc_1;
static lv_color_t buf_1[MY_DISP_HOR_RES * 10]; /*A buffer for 10 rows*/
lv_disp_draw_buf_init(&draw_buf_dsc_1, buf_1, NULL, MY_DISP_HOR_RES * 10); /*Initialize the display buffer*/
// /* Example for 2) */
// static lv_disp_draw_buf_t draw_buf_dsc_2;
// static lv_color_t buf_2_1[MY_DISP_HOR_RES * 10]; // /*A buffer for 10 rows*/
// static lv_color_t buf_2_2[MY_DISP_HOR_RES * 10]; // /*An other buffer for 10 rows*/
// lv_disp_draw_buf_init(&draw_buf_dsc_2, buf_2_1, buf_2_2, MY_DISP_HOR_RES * 10); // /*Initialize the display buffer*/
// /* Example for 3) also set disp_drv.full_refresh = 1 below*/
// static lv_disp_draw_buf_t draw_buf_dsc_3;
// static lv_color_t buf_3_1[MY_DISP_HOR_RES * MY_DISP_VER_RES]; // /*A screen sized buffer*/
// static lv_color_t buf_3_2[MY_DISP_HOR_RES * MY_DISP_VER_RES]; // /*Another screen sized buffer*/
// lv_disp_draw_buf_init(&draw_buf_dsc_3, buf_3_1, buf_3_2,
// MY_DISP_VER_RES * LV_VER_RES_MAX); /*Initialize the display buffer*/
/*-----------------------------------
* Register the display in LVGL
*----------------------------------*/
static lv_disp_drv_t disp_drv; /*Descriptor of a display driver*/
lv_disp_drv_init(&disp_drv); /*Basic initialization*/
/*Set up the functions to access to your display*/
/*Set the resolution of the display*/
disp_drv.hor_res = MY_DISP_HOR_RES;
disp_drv.ver_res = MY_DISP_VER_RES;
/*Used to copy the buffer's content to the display*/
disp_drv.flush_cb = disp_flush;
/*Set a display buffer*/
disp_drv.draw_buf = &draw_buf_dsc_1;
/*Required for Example 3)*/
//disp_drv.full_refresh = 1;
/* Fill a memory array with a color if you have GPU.
* Note that, in lv_conf.h you can enable GPUs that has built-in support in LVGL.
* But if you have a different GPU you can use with this callback.*/
//disp_drv.gpu_fill_cb = gpu_fill;
/*Finally register the driver*/
lv_disp_drv_register(&disp_drv);
}
/**********************
* STATIC FUNCTIONS
**********************/
/*Initialize your display and the required peripherals.*/
static void disp_init(void)
{
/*You code here*/
disp_init_todo(); //这是一个虚函数 由外部实现
}
volatile bool disp_flush_enabled = true;
/* Enable updating the screen (the flushing process) when disp_flush() is called by LVGL
*/
void disp_enable_update(void)
{
disp_flush_enabled = true;
}
/* Disable updating the screen (the flushing process) when disp_flush() is called by LVGL
*/
void disp_disable_update(void)
{
disp_flush_enabled = false;
}
/*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)
{
// if(disp_flush_enabled) {
// // /*The most simple case (but also the slowest) to put all pixels to the screen one-by-one*/
// int32_t x;
// int32_t y;
// for(y = area->y1; y <= area->y2; y++) {
// for(x = area->x1; x <= area->x2; x++) {
// /*Put a pixel to the display. For example:*/
// /*put_px(x, y, *color_p)*/
// color_p++;
// }
// }
// }
disp_flush_todo(disp_drv, area, color_p); //这是一个虚函数 由外部实现
/*IMPORTANT!!!
*Inform the graphics library that you are ready with the flushing*/
lv_disp_flush_ready(disp_drv);
}
/*OPTIONAL: GPU INTERFACE*/
/*If your MCU has hardware accelerator (GPU) then you can use it to fill a memory with a color*/
//static void gpu_fill(lv_disp_drv_t * disp_drv, lv_color_t * dest_buf, lv_coord_t dest_width,
// const lv_area_t * fill_area, lv_color_t color)
//{
// /*It's an example code which should be done by your GPU*/
// int32_t x, y;
// dest_buf += dest_width * fill_area->y1; /*Go to the first line*/
//
// for(y = fill_area->y1; y <= fill_area->y2; y++) {
// for(x = fill_area->x1; x <= fill_area->x2; x++) {
// dest_buf[x] = color;
// }
// dest_buf+=dest_width; /*Go to the next line*/
// }
//}
#else /*Enable this file at the top*/
/*This dummy typedef exists purely to silence -Wpedantic.*/
typedef int keep_pedantic_happy;
#endif移植触摸驱动
需要触摸屏幕、按键等人机交互等情况下,需要完成该移植,本文未用到
移植文件系统驱动
需要从SD卡加载图片显示等情况下,需要完成该移植,本文未用到
main.c 编写修改
编写LED闪烁任务测试
#include "stm32f10x.h"
#include "FreeRTOS.h"
#include "task.h"
#include "lvgl.h"
#include "lv_port_disp.h"
#include "ssd1315.h"
static TaskHandle_t xHandle1 = NULL, xHandle2 = NULL;
void vTask1(void *param)
{
while (1)
{
vTaskDelay(pdMS_TO_TICKS(300));
GPIO_SetBits(GPIOC, GPIO_Pin_13);
vTaskDelay(pdMS_TO_TICKS(300));
GPIO_ResetBits(GPIOC, GPIO_Pin_13);
}
}
void vTask2(void *param)
{
while (1)
{
vTaskDelay(pdMS_TO_TICKS(10));
lv_tick_inc(10);
lv_timer_handler();
continue;
uint8_t page, col;
for (page = 0; page < 8; page++)
{
SSD1315_SetCursor(page, 0);
for (col = 0; col < 128; col++)
{
SSD1315_WriteData(0xff); // 0x00 = 全黑,0xFF = 全亮
vTaskDelay(pdMS_TO_TICKS(10));
}
}
for (page = 0; page < 8; page++)
{
SSD1315_SetCursor(page, 0);
for (col = 0; col < 128; col++)
{
SSD1315_WriteData(0x00); // 0x00 = 全黑,0xFF = 全亮
// vTaskDelay(pdMS_TO_TICKS(10));
}
}
}
}
// 实现LVGL中 屏幕初始化的弱定义
void disp_init_todo(void)
{
SSD1315_Init();
}
// 实现LVGL中 屏幕刷新的弱定义
void disp_flush_todo(lv_disp_drv_t *disp_drv, const lv_area_t *area, lv_color_t *color_p)
{
static uint8_t fb[8][128] = {0};
// 更新像素点
for (int32_t y = area->y1; y <= area->y2; y++)
{
for (int32_t x = area->x1; x <= area->x2; x++)
{
uint8_t page = y / 8;
uint8_t bit = y % 8;
if (page >= 8)
continue;
if (x >= 128)
continue;
uint8_t color = *(uint8_t *)color_p;
if (color)
fb[page][x] |= (1 << bit);
else
fb[page][x] &= ~(1 << bit);
/*Put a pixel to the display. For example:*/
/*put_px(x, y, *color_p)*/
color_p++;
}
}
uint8_t pagemin = area->y1 / 8;
uint8_t pagemax = area->y2 / 8;
uint8_t colmin = area->x1;
uint8_t colmax = area->x2;
// 刷新变化的像素点
for (int32_t page = pagemin; page <= pagemax; page++)
{
SSD1315_SetCursor(page, colmin);
for (int32_t col = colmin; col <= colmax; col++)
SSD1315_WriteData(fb[page][col]);
}
}
int main(void)
{
// SSD1315_Init();
lv_init();
lv_port_disp_init();
{
/* 创建一个中心标签 */
lv_obj_t *label = lv_label_create(lv_scr_act());
lv_label_set_text(label, "CENTER");
lv_obj_align(label, LV_ALIGN_CENTER, 0, 0);
}
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC | RCC_APB2Periph_AFIO, ENABLE);
GPIO_InitTypeDef GPIO_InitStruct = {
.GPIO_Pin = GPIO_Pin_13,
.GPIO_Mode = GPIO_Mode_Out_PP,
.GPIO_Speed = GPIO_Speed_50MHz};
GPIO_Init(GPIOC, &GPIO_InitStruct);
xTaskCreate(vTask1, "vTask1", 32, NULL, 2, &xHandle1);
xTaskCreate(vTask2, "vTask2", 512, NULL, 3, &xHandle2);
vTaskStartScheduler();
}镜像输出
编译成功后完整日志如下
* 正在执行任务: rm * -r
* 终端将被任务重用,按任意键关闭。
* 正在执行任务: cmake -G 'MinGW Makefiles' .. -DRELEASE=ON
-- The C compiler identification is GNU 16.1.0
-- The CXX compiler identification is GNU 16.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: C:/Program Files/mingw64/bin/cc.exe
-- Check for working C compiler: C:/Program Files/mingw64/bin/cc.exe - works
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: C:/Program Files/mingw64/bin/cc.exe
-- Check for working CXX compiler: C:/Program Files/mingw64/bin/cc.exe - works
-- Detecting CXX compile features
-- Detecting CXX compile features - done
build for release!
-- The ASM compiler identification is GNU
-- Found assembler: C:/Program Files (x86)/GNU Arm Embedded Toolchain/10 2021.10/bin/arm-none-eabi-gcc.exe
-- Configuring done (5.1s)
-- Generating done (0.3s)
-- Build files have been written to: C:/Users/user/Desktop/project-rtos-lvgl/build
* 终端将被任务重用,按任意键关闭。
* 正在执行任务: make
[ 0%] Building C object CMakeFiles/app.elf.dir/main.c.obj
[ 1%] Building C object CMakeFiles/app.elf.dir/CMSIS/CM3/DeviceSupport/ST/STM32F10x/startup/gcc_ride7/startup_stm32f10x_md.s.obj
[ 1%] Building C object CMakeFiles/app.elf.dir/CMSIS/CM3/CoreSupport/core_cm3.c.obj
[ 2%] Building C object CMakeFiles/app.elf.dir/CMSIS/CM3/DeviceSupport/ST/STM32F10x/system_stm32f10x.c.obj
[ 2%] Building C object CMakeFiles/app.elf.dir/FreeRTOS-Kernel/croutine.c.obj
[ 3%] Building C object CMakeFiles/app.elf.dir/FreeRTOS-Kernel/event_groups.c.obj
[ 3%] Building C object CMakeFiles/app.elf.dir/FreeRTOS-Kernel/list.c.obj
[ 4%] Building C object CMakeFiles/app.elf.dir/FreeRTOS-Kernel/portable/GCC/ARM_CM3/port.c.obj
[ 5%] Building C object CMakeFiles/app.elf.dir/FreeRTOS-Kernel/portable/MemMang/heap_4.c.obj
[ 5%] Building C object CMakeFiles/app.elf.dir/FreeRTOS-Kernel/queue.c.obj
[ 6%] Building C object CMakeFiles/app.elf.dir/FreeRTOS-Kernel/stream_buffer.c.obj
[ 6%] Building C object CMakeFiles/app.elf.dir/FreeRTOS-Kernel/tasks.c.obj
[ 7%] Building C object CMakeFiles/app.elf.dir/FreeRTOS-Kernel/timers.c.obj
[ 7%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/examples/porting/lv_port_disp.c.obj
[ 8%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/examples/porting/lv_port_disp_template.c.obj
[ 8%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/examples/porting/lv_port_fs_template.c.obj
[ 9%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/examples/porting/lv_port_indev_template.c.obj
[ 10%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/core/lv_disp.c.obj
[ 10%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/core/lv_event.c.obj
[ 11%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/core/lv_group.c.obj
[ 11%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/core/lv_indev.c.obj
[ 12%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/core/lv_indev_scroll.c.obj
[ 12%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/core/lv_obj.c.obj
[ 13%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/core/lv_obj_class.c.obj
[ 14%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/core/lv_obj_draw.c.obj
[ 14%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/core/lv_obj_pos.c.obj
[ 15%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/core/lv_obj_scroll.c.obj
[ 15%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/core/lv_obj_style.c.obj
[ 16%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/core/lv_obj_style_gen.c.obj
[ 16%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/core/lv_obj_tree.c.obj
[ 17%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/core/lv_refr.c.obj
[ 17%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/core/lv_theme.c.obj
[ 18%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/draw/lv_draw.c.obj
[ 19%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/draw/lv_draw_arc.c.obj
[ 19%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/draw/lv_draw_img.c.obj
[ 20%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/draw/lv_draw_label.c.obj
[ 20%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/draw/lv_draw_layer.c.obj
[ 21%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/draw/lv_draw_line.c.obj
[ 21%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/draw/lv_draw_mask.c.obj
[ 22%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/draw/lv_draw_rect.c.obj
[ 23%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/draw/lv_draw_transform.c.obj
[ 23%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/draw/lv_draw_triangle.c.obj
[ 24%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/draw/lv_img_buf.c.obj
[ 24%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/draw/lv_img_cache.c.obj
[ 25%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/draw/lv_img_decoder.c.obj
[ 25%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/draw/sw/lv_draw_sw.c.obj
[ 26%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/draw/sw/lv_draw_sw_arc.c.obj
[ 26%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/draw/sw/lv_draw_sw_blend.c.obj
[ 27%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/draw/sw/lv_draw_sw_dither.c.obj
[ 28%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/draw/sw/lv_draw_sw_gradient.c.obj
[ 28%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/draw/sw/lv_draw_sw_img.c.obj
[ 29%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/draw/sw/lv_draw_sw_layer.c.obj
[ 29%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/draw/sw/lv_draw_sw_letter.c.obj
[ 30%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/draw/sw/lv_draw_sw_line.c.obj
[ 30%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/draw/sw/lv_draw_sw_polygon.c.obj
[ 31%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/draw/sw/lv_draw_sw_rect.c.obj
[ 32%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/draw/sw/lv_draw_sw_transform.c.obj
[ 32%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/extra/layouts/flex/lv_flex.c.obj
[ 33%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/extra/layouts/grid/lv_grid.c.obj
[ 33%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/extra/lv_extra.c.obj
[ 34%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/extra/themes/basic/lv_theme_basic.c.obj
[ 34%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/extra/themes/default/lv_theme_default.c.obj
[ 35%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/extra/themes/mono/lv_theme_mono.c.obj
[ 35%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/extra/widgets/animimg/lv_animimg.c.obj
[ 36%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/extra/widgets/calendar/lv_calendar.c.obj
[ 37%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/extra/widgets/calendar/lv_calendar_header_arrow.c.obj
[ 37%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/extra/widgets/calendar/lv_calendar_header_dropdown.c.obj
[ 38%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/extra/widgets/chart/lv_chart.c.obj
[ 38%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/extra/widgets/colorwheel/lv_colorwheel.c.obj
[ 39%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/extra/widgets/imgbtn/lv_imgbtn.c.obj
[ 39%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/extra/widgets/keyboard/lv_keyboard.c.obj
[ 40%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/extra/widgets/led/lv_led.c.obj
[ 41%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/extra/widgets/list/lv_list.c.obj
[ 41%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/extra/widgets/menu/lv_menu.c.obj
[ 42%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/extra/widgets/meter/lv_meter.c.obj
[ 42%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/extra/widgets/msgbox/lv_msgbox.c.obj
[ 43%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/extra/widgets/span/lv_span.c.obj
[ 43%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/extra/widgets/spinbox/lv_spinbox.c.obj
[ 44%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/extra/widgets/spinner/lv_spinner.c.obj
[ 44%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/extra/widgets/tabview/lv_tabview.c.obj
[ 45%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/extra/widgets/tileview/lv_tileview.c.obj
[ 46%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/extra/widgets/win/lv_win.c.obj
[ 46%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/font/lv_font.c.obj
[ 47%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/font/lv_font_dejavu_16_persian_hebrew.c.obj
[ 47%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/font/lv_font_fmt_txt.c.obj
[ 48%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/font/lv_font_loader.c.obj
[ 48%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/font/lv_font_montserrat_10.c.obj
[ 49%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/font/lv_font_montserrat_12.c.obj
[ 50%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/font/lv_font_montserrat_12_subpx.c.obj
[ 50%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/font/lv_font_montserrat_14.c.obj
[ 51%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/font/lv_font_montserrat_16.c.obj
[ 51%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/font/lv_font_montserrat_18.c.obj
[ 52%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/font/lv_font_montserrat_20.c.obj
[ 52%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/font/lv_font_montserrat_22.c.obj
[ 53%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/font/lv_font_montserrat_24.c.obj
[ 53%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/font/lv_font_montserrat_26.c.obj
[ 54%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/font/lv_font_montserrat_28.c.obj
[ 55%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/font/lv_font_montserrat_28_compressed.c.obj
[ 55%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/font/lv_font_montserrat_30.c.obj
[ 56%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/font/lv_font_montserrat_32.c.obj
[ 56%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/font/lv_font_montserrat_34.c.obj
[ 57%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/font/lv_font_montserrat_36.c.obj
[ 57%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/font/lv_font_montserrat_38.c.obj
[ 58%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/font/lv_font_montserrat_40.c.obj
[ 58%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/font/lv_font_montserrat_42.c.obj
[ 59%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/font/lv_font_montserrat_44.c.obj
[ 60%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/font/lv_font_montserrat_46.c.obj
[ 60%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/font/lv_font_montserrat_48.c.obj
[ 61%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/font/lv_font_montserrat_8.c.obj
[ 61%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/font/lv_font_simsun_16_cjk.c.obj
[ 62%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/font/lv_font_unscii_16.c.obj
[ 62%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/font/lv_font_unscii_8.c.obj
[ 63%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/hal/lv_hal_disp.c.obj
[ 64%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/hal/lv_hal_indev.c.obj
[ 64%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/hal/lv_hal_tick.c.obj
[ 65%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/misc/lv_anim.c.obj
[ 65%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/misc/lv_anim_timeline.c.obj
[ 66%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/misc/lv_area.c.obj
[ 66%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/misc/lv_async.c.obj
[ 67%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/misc/lv_bidi.c.obj
[ 67%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/misc/lv_color.c.obj
[ 68%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/misc/lv_fs.c.obj
[ 69%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/misc/lv_gc.c.obj
[ 69%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/misc/lv_ll.c.obj
[ 70%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/misc/lv_log.c.obj
[ 70%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/misc/lv_lru.c.obj
[ 71%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/misc/lv_math.c.obj
[ 71%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/misc/lv_mem.c.obj
[ 72%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/misc/lv_printf.c.obj
[ 73%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/misc/lv_style.c.obj
[ 73%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/misc/lv_style_gen.c.obj
[ 74%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/misc/lv_templ.c.obj
[ 74%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/misc/lv_timer.c.obj
[ 75%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/misc/lv_tlsf.c.obj
[ 75%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/misc/lv_txt.c.obj
[ 76%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/misc/lv_txt_ap.c.obj
[ 76%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/misc/lv_utils.c.obj
[ 77%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/widgets/lv_arc.c.obj
[ 78%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/widgets/lv_bar.c.obj
[ 78%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/widgets/lv_btn.c.obj
[ 79%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/widgets/lv_btnmatrix.c.obj
[ 79%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/widgets/lv_canvas.c.obj
[ 80%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/widgets/lv_checkbox.c.obj
[ 80%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/widgets/lv_dropdown.c.obj
[ 81%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/widgets/lv_img.c.obj
[ 82%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/widgets/lv_label.c.obj
[ 82%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/widgets/lv_line.c.obj
[ 83%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/widgets/lv_objx_templ.c.obj
[ 83%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/widgets/lv_roller.c.obj
[ 84%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/widgets/lv_slider.c.obj
[ 84%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/widgets/lv_switch.c.obj
[ 85%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/widgets/lv_table.c.obj
[ 85%] Building C object CMakeFiles/app.elf.dir/lvgl-8.3.11/src/widgets/lv_textarea.c.obj
[ 86%] Building C object CMakeFiles/app.elf.dir/ssd1315.c.obj
[ 87%] Building C object CMakeFiles/app.elf.dir/STM32F10x_StdPeriph_Driver/src/misc.c.obj
[ 87%] Building C object CMakeFiles/app.elf.dir/STM32F10x_StdPeriph_Driver/src/stm32f10x_adc.c.obj
[ 88%] Building C object CMakeFiles/app.elf.dir/STM32F10x_StdPeriph_Driver/src/stm32f10x_bkp.c.obj
[ 88%] Building C object CMakeFiles/app.elf.dir/STM32F10x_StdPeriph_Driver/src/stm32f10x_can.c.obj
[ 89%] Building C object CMakeFiles/app.elf.dir/STM32F10x_StdPeriph_Driver/src/stm32f10x_cec.c.obj
[ 89%] Building C object CMakeFiles/app.elf.dir/STM32F10x_StdPeriph_Driver/src/stm32f10x_crc.c.obj
[ 90%] Building C object CMakeFiles/app.elf.dir/STM32F10x_StdPeriph_Driver/src/stm32f10x_dac.c.obj
[ 91%] Building C object CMakeFiles/app.elf.dir/STM32F10x_StdPeriph_Driver/src/stm32f10x_dbgmcu.c.obj
[ 91%] Building C object CMakeFiles/app.elf.dir/STM32F10x_StdPeriph_Driver/src/stm32f10x_dma.c.obj
[ 92%] Building C object CMakeFiles/app.elf.dir/STM32F10x_StdPeriph_Driver/src/stm32f10x_exti.c.obj
[ 92%] Building C object CMakeFiles/app.elf.dir/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c.obj
[ 93%] Building C object CMakeFiles/app.elf.dir/STM32F10x_StdPeriph_Driver/src/stm32f10x_fsmc.c.obj
[ 93%] Building C object CMakeFiles/app.elf.dir/STM32F10x_StdPeriph_Driver/src/stm32f10x_gpio.c.obj
[ 94%] Building C object CMakeFiles/app.elf.dir/STM32F10x_StdPeriph_Driver/src/stm32f10x_i2c.c.obj
[ 94%] Building C object CMakeFiles/app.elf.dir/STM32F10x_StdPeriph_Driver/src/stm32f10x_iwdg.c.obj
[ 95%] Building C object CMakeFiles/app.elf.dir/STM32F10x_StdPeriph_Driver/src/stm32f10x_pwr.c.obj
[ 96%] Building C object CMakeFiles/app.elf.dir/STM32F10x_StdPeriph_Driver/src/stm32f10x_rcc.c.obj
[ 96%] Building C object CMakeFiles/app.elf.dir/STM32F10x_StdPeriph_Driver/src/stm32f10x_rtc.c.obj
[ 97%] Building C object CMakeFiles/app.elf.dir/STM32F10x_StdPeriph_Driver/src/stm32f10x_sdio.c.obj
[ 97%] Building C object CMakeFiles/app.elf.dir/STM32F10x_StdPeriph_Driver/src/stm32f10x_spi.c.obj
[ 98%] Building C object CMakeFiles/app.elf.dir/STM32F10x_StdPeriph_Driver/src/stm32f10x_tim.c.obj
[ 98%] Building C object CMakeFiles/app.elf.dir/STM32F10x_StdPeriph_Driver/src/stm32f10x_usart.c.obj
[ 99%] Building C object CMakeFiles/app.elf.dir/STM32F10x_StdPeriph_Driver/src/stm32f10x_wwdg.c.obj
[100%] Linking C executable app.elf
Memory region Used Size Region Size %age Used
RAM: 14464 B 20 KB 70.63%
FLASH: 64496 B 64 KB 98.41%
Building demo (bin, hex, elf) and print size
text data bss dec hex filename
64448 48 14424 78920 13448 C:/Users/user/Desktop/project-rtos-lvgl/build/app.elf
0 64496 0 64496 fbf0 C:/Users/user/Desktop/project-rtos-lvgl/build/app.hex
[100%] Built target app.elf
* 终端将被任务重用,按任意键关闭。
居中标签显示
LVGL 8.3.11