当前位置:网站首页>基于STM32F1的开源小项目
基于STM32F1的开源小项目
2022-06-11 14:21:00 【奋斗小鹏】
一. 简介
在前面几篇文章中,将这个项目的各个部分都做了简单的介绍,今天在这里作为一个完整版分享给大家使用。喜欢的话,可以自行获取。
演示视频
观看过演示视频的话,这是一个很好的课设,或者作为初学者入门实践一个首选。
欢迎关注微信公众号
FPGA之旅 回复 STM32-Project1 获取下载链接
二. 项目框架介绍
本项目没有使用RTOS操作系统,是一个裸机程序,使用的是一个前后台的框架。中断回调函数用来查询各个状态是否发生并做好标记,然后在main函数中进行相应的处理。
在进入到main函数之后,是对各个硬件部分进行初始化,并进行开机动画的加载,这也是一个标准的流程。
uart_init(115200);
delay_init();
LCD_Init();
TIM4Init(); //延时
InfraredInit();
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);
LCDDMAFullOn(BackGround);
Boot_Animation(); //开机动画
LCDDMAFullOn(BackGround);
然后就是根据当前的模式进入到不同的if语句中执行相应的函数,默认为主界面,在里面是一个while循环语句。通过按键的值执行相应的操作,在每一次操作完后,要将按键的状态复位。SelectUp和SelectDown分别为光标的上下移动,切换状态的时候,利用break即可跳出。
其他的每一个状态的实现过程都是这样的写法,非常方便扩展。
if(CurrMode == Main) //主界面
{
LCDDMAFullOn(BackGround);
MainInterface();
while(1)
{
if(KEYState == KEYLEFT)
{
SelectUp();
KEYState = KEYNONE;
}
else if(KEYState == KEYRIGHT)
{
SelectDown();
KEYState = KEYNONE;
}
else if(KEYState == KEYUP)
{
CurrMode = (enum State)(CurrIndex + 1);
if(CurrMode == 3)
CurrMode = Photo;
KEYState = KEYNONE;
break;
}
}
}
边栏推荐
- mysql高级语句
- Hamad application layout scheme 02 of hashicopy
- Airtest automated test
- In depth research and analysis report on global and Chinese SURFBOARD WAX Market
- After many years of digital transformation projects, the main architects are desperate: outsourcing should not have been used at the beginning!
- I have something to say about final, finally and finalize
- 社交软件Soul撤回IPO申请:上市只差临门一脚 腾讯是大股东
- 【SystemVerilog 之 接口】~ Interface
- Leetcode 1962. 移除石子使总数最小(应该是向上取整)
- IC fresh Chinese cabbage price of 400000 yuan! Experienced experts who have worked for many years guide you how to choose an offer!
猜你喜欢

高通WLAN框架学习(29)-- 6GHz 概述

MySQL advanced statement

Recommended open source scheduling libraries worth learning

HMS core shows the latest open capabilities in mwc2022, helping developers build high-quality applications

Leetcode 1968. Construct an array whose elements are not equal to the average value of two adjacent elements (yes, finally solved)

uniapp设置页面跳转效果 - navigateTo切换效果 - 全局animationType动画

Qualcomm WLAN framework learning (29) -- 6GHz overview

Live800:智能客服提升客户体验的几种方式

How to manually package your own projects

Seven parameters of thread pool and reject policy
随机推荐
Leetcode daily question - Search insertion position
C # - how to add and read appsetting in the console application JSON file
gensim. Models word2vec parameter
Hashicopy之nomad应用编排方案05(访问web页面)
【SystemVerilog 之 过程块和方法】~ 域、always过程块、initial过程块、函数 function、任务 task、生命周期
2022年湖南省安全员-C证考试练习题及在线模拟考试
Architectural concept exploration: Taking the development of card games as an example
大道至簡 | 設計 ViT 到底怎麼配置Self-Attention才是最合理的?
英伟达研发主管:AI 是如何改进芯片设计的?
漫画:有趣的 “切蛋糕“ 问题
Turning "passive" into "active", how to build security compliant intelligent products | Q recommendation
mysql创建表出错1067 - Invalid default value for ‘update_time‘
树莓派获得网络安装系统功能,无需借助其他设备
以 Log4j 为例,如何评估和划分安全风险
Why do I need the public static void main (string[] args) method?
Sqlmap detection SQL lab range
Leetcode 1962. Remove stones to minimize the total amount (should be rounded up)
02 Tekton Pipeline
In depth analysis of "circle group" relationship system design | series of articles on "circle group" technology
在微服务架构中管理技术债务