当前位置:网站首页>[STM32] migration of guilite based on Hal Library
[STM32] migration of guilite based on Hal Library
2022-06-10 05:05:00 【Marshal Q】
Catalog
Preparation :
- STM32CubeMX
- STM32RCT6 Core board
- IDE Keil(MDK-ARM)
- DuPont line ×4
- 0.96 " OLED screen (4 Pin )
One 、 What is? GuiLite
GuiLite It's an open source Gui frame , Rely on only one header file (GuiLite.h), No complicated file management is required , The amount of code is approachable ,GuiLite from 5K That's ok C++ Code writing , MCU can also run smoothly
Its minimum hardware operating requirements :
| CPU Main frequency | ROM size | RAM size |
|---|---|---|
| 24MHZ | 29KB | 9KB |
And GuiLite It has strong cross platform
- Supported operating systems :iOS/macOS/WatchOS,Android,Linux(ARM/x86-64),Windows( contain VR),RTOS… Even a single-chip computer without an operating system
- Supported development languages :C/C++, Swift, Java, Javascript, C#, Golang…
- Support for the first 3 Fangku :Qt, MFC, Winforms, CoCoa…
besides ,GuiLite Provide a series of auxiliary development tools
- ️ The perfect “ cloud ” + “ The Internet of things ” Solution : Let you easily control the world IoT Business
- Support for multiple languages , use UTF-8 code ; Support video playback
- Resource creation tools customize your own fonts for you / Image resources
- What you see is what you get GUI Layout tools
- Compile activity statistics , And real-time analysis
- Support 3D & Web
- Support Docker, A command to start .
Two 、STM32CubeMX part
2.1 Configure clock
choice STM32F103RCTx Series of chips , When configuring the clock, it will be automatically configured IO Port pin 
take HCLK Set to maximum frequency 72MHz
2.2 To configure IIC

2.3 Project generation
Increase the allocated heap space 


Project management is still these options , then GENERATE CODE,STM32CubeMX Partially completed
3、 ... and 、MDK 5 part
open MDK Generate two folders and install them respectively oled and UIcode The file of 

3.1 transplant OLED file
There is a project link at the end of the article
transplant OLED Your operation is already in progress 【STM32】HAL Library in 4 Pin 0.96 " OLED On screen porting — Hardware IIC( One ) It's detailed in , I won't repeat it here
3.2 transplant GuiLite file
On Gitee Of GuiLite Routine presentation , choice HelloCircle routine , Will be one of the UIcode Copy folder to Engineering documents 
stay MDK Import... Into the project UICode Under the UIcode.cpp file 
add to UIcode The path of 
3.3 modify main.c file
3.3.1 Add header file #include "oled.h"

3.3.2 add to GuiLite The interface function

// Draw point function interface
void gfx_draw_pixel(int x, int y, unsigned int rgb)
{
OLED_DrawPoint(x,y,rgb);
}
// Picture function ( not used )
void gfx_draw_fill(int x, int y,int w, int q, unsigned int rgb)
{
}
// Create a function pointer structure
struct EXTERNAL_GFX_OP
{
void (*draw_pixel)(int x, int y, unsigned int rgb);
void (*fill_rect)(int x0, int y0, int x1, int y1, unsigned int rgb);
} my_gfx_op;
extern void startHelloCircle(void* phy_fb, int width, int height, int color_bytes, struct EXTERNAL_GFX_OP* gfx_op);
// Set the delay function interface
void delay_ms(int milli_seconds)
{
HAL_Delay(milli_seconds);
}
3.3.3 Add code

// Pass function pointer
my_gfx_op.draw_pixel = gfx_draw_pixel;
my_gfx_op.fill_rect = NULL;//gfx_fill_rect;
// Start drawing circle
startHelloCircle(NULL, 128, 64, 1, &my_gfx_op);
3.4 modify UIcode.cpp file
3.4.1 add to oled.h file
Because this is C++ And C Language mixing , So the statement here will be slightly different , On the Internet about single chip microcomputer transplantation GuiLite There is no mention of this issue , Avoid pit ! Why is that? ? The next answer 
3.4.2 add to OLED Refresh function

Take another one. , If the declaration is in accordance with C Language format #include "oled.h" To write , Then this place will always report errors , Call failed
3.5 When the configuration is complete , close Use MicroLIB Options , Compile code

When compiling and downloading, you need to select the corresponding downloader , Check below 
The effect is as shown in the picture
边栏推荐
- Personnaliser le plug - in bulles JS prompt tooltips
- Error of clip operator in mindconvert model transformation
- 信息学奥赛一本通 1287:最低通行费 | OpenJudge NOI 2.6 7614:最低通行费
- Zen project management flow
- Inherit extensions
- Interview question 08.04 Power set
- [UE4 automatic terrain material]
- Why is mindspore 1.5rcgraph mode slow to train?
- 城市/学校/专业,哪个在选大学时最重要? | 每日趣闻
- Basic methods of stack and related problems
猜你喜欢

Mindspire's nn Can pad specify dimension filling

【通用数据库工具】上海道宁为开发者、分析师、数据库管理员带来适用于所有数据库和操作系统的工具——DbVisualizer

25. BOM事件

25. BOM事件

每日一题—LeetCode497—非重叠矩形中的随机点-前缀和-二分

S series · add legend in the made Matplotlib diagram

js电子闹钟网页js特效代码

S系列·在已作出的matplotlib图中新增图例
![[UE4 automatic terrain material]](/img/59/34cf7b85d66cdc608e3a3626c61239.png)
[UE4 automatic terrain material]

Odometer.js数字滚动插件
随机推荐
An error is reported in the mindspore training phase: not find op[add] in AKG
2022.6.7-----leetcode. eight hundred and seventy-five
.NET C#基础(7):接口 - 人如何和猫互动
Apispace sunrise sunset API interface is free and easy to use
联系人二维码生成插件qrcode.js
Error of clip operator in mindconvert model transformation
Literature reading -- location of regulatory variation in maize drought response and tolerance gene expression
2022制冷与空调设备运行操作特种作业证考试题库模拟考试平台操作
信息学奥赛一本通 1287:最低通行费 | OpenJudge NOI 2.6 7614:最低通行费
2022.5.31-----leetcode. Sword finger offer one hundred and fourteen
加快Kettle插入速度的小技巧
In the introduction to beginners in the mindpole official website tutorial, I don't know much about map mapping when importing data
2022.6.1-----leetcode. four hundred and seventy-three
【创新文档技术解决方案】上海道宁为您提供涵盖整个文档起草生命周期的产品——Litera,帮助用户创建质量更高的文档
Interview question 05.04 Next number
S系列·向文本文件新增数据并且不添加重复值
Error occurs when the mindspire tutorial is run online
City / school / major, which is the most important when choosing a university| Daily anecdotes
Interview question 05.07 Pairing exchange
Warning: Accessing non-existent property ‘column‘ of module exports inside circular depen