当前位置:网站首页>关于CH32库函数与STM32库函数的区别
关于CH32库函数与STM32库函数的区别
2022-07-07 21:53:00 【Guard_Byte】
最近想用MPU6050六轴传感器来控制小车的90°精确转弯和保持直行,但手头没有多余的STM32F1的板子,恰好有两个CH32F103的最小系统板,所以想着把程序简单移植一下就可以了,没想到在此过程中却遇到了困难。
由于本人使用的时CH32官方的库函数,而大家用的最多的驱动代码差不多基于STM32开发,所以在移植过程中千万要小心。
1、以下为 CH32F10X_ 库函数中关于GPIO的相关寄存器与STM32不同的地方:
左边CH32官方库函数,右边为ST32官方库函数,所在文件 "ch/stm32f10x_gpio.c "
在使用入IIC或者DHT11等一个IO同时兼顾输入和输出能力的时候,尤其需要注意I/O方向配置,图中配置寄存器的名称不同,使用时需注意修改。
2、除此之外,本人还发现在USART配置时,个别寄存器名称也不相同,如在使用printf函数打印输出的重定向函数中:

由此可见,他们为了做区分,在细节处是动了自己的一点小心思的。但是 别忘了他们使用相同的ARM架构 Cortex - M3内核,同样的32位MCU,于是查了他们的固件库函数,发现常用寄存器除个别名称不同外其地址和长度完全一样,到这大家都懂了吧,个别地方稍微注意一下下,然后直接使用STM32固件库函数不就完事了。
3、后续可能会专门讲一下 国产ARM架构 32位 MCU 与STM32的使用区别,有时间的话 哈哈~
边栏推荐
- 数据库面试题+解析
- How to login and enable synchronization function in Google browser
- Anxin can internally test offline voice module vb-01 to communicate with esp-c3-12f
- Display the server hard disk image to the browser through Servlet
- Class C design questions
- Anxin vb01 offline voice module access intelligent curtain guidance
- The for loop realizes 1-100 addition and eliminates the 4-digit tail number
- 0-1背包问题
- 建筑建材行业SRM供应商云协同管理平台解决方案,实现业务应用可扩展可配置
- ASP. Net query implementation
猜你喜欢

As a new force, chenglian premium products was initially injected, and the shares of relevant listed companies rose 150% in response

Digital procurement management system for fresh food industry: help fresh food enterprises solve procurement problems and implement online procurement throughout the process

Extended tree (I) - graphic analysis and C language implementation

SAP HR 劳动合同信息 0016

Explain

Live-Server使用

SAP HR 家庭成员信息

MySQL Index Optimization Practice I

激光slam学习(2D/3D、偏实践)

Three questions TDM
随机推荐
Live server usage
SAP HR labor contract information 0016
Explain
IDEA 2021.3. X cracking
Solution of intelligent supply chain collaboration platform in electronic equipment industry: solve inefficiency and enable digital upgrading of industry
JNI uses asan to check memory leaks
SAP HR social work experience 0023
[stm32+esp8266 connect Tencent cloud IOT development platform 2] stm32+esp8266-01s connect Tencent cloud
USB (XV) 2022-04-14
2022 届的应届生都找到工作了吗?做自媒体可以吗?
List. How to achieve ascending and descending sort() 2020.8.6
Anxin can internally test offline voice module vb-01 to communicate with esp-c3-12f
建筑建材行业SRM供应商云协同管理平台解决方案,实现业务应用可扩展可配置
Oracle statistics by time
高效的S2B2C电商系统,是这样帮助电子材料企业提升应变能力的
The efficient s2b2c e-commerce system helps electronic material enterprises improve their adaptability in this way
Sequence of entity layer, Dao layer, service layer and controller layer
B_QuRT_User_Guide(40)
SQL database execution problems
Live-Server使用