当前位置:网站首页>关于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的使用区别,有时间的话 哈哈~
边栏推荐
- SAP HR family member information
- Installing gradle
- [experiment sharing] log in to Cisco devices through the console port
- What if once again forgets the login password of raspberry pie? And you don't have a monitor yet! Today, I would like to introduce a method
- Possible SQL for Oracle table lookup information
- New potential energy of industrial integration, Xiamen station of city chain technology digital summit successfully held
- Design and implementation of spark offline development framework
- SAP HR 劳动合同信息 0016
- SAP HR labor contract information 0016
- 平衡二叉樹【AVL樹】——插入、删除
猜你喜欢
SAP HR reward and punishment information export
产业共融新势能,城链科技数字峰会厦门站成功举办
Pycharm essential plug-in, change the background (self use, continuous update) | CSDN creation punch in
[compilation principle] lexical analysis design and Implementation
S2b2b mall solution of intelligent supply chain in packaging industry: opening up a new ecosystem of e-commerce consumption
UE4_ Use of ue5 blueprint command node (turn on / off screen response log publish full screen display)
Svn relocation
Installing gradle
Flash encryption process and implementation of esp32
SRM supplier cloud collaborative management platform solution for building materials industry to realize business application scalability and configuration
随机推荐
数据库面试题+解析
Arbre binaire équilibré [Arbre AVL] - Insérer et supprimer
FPGA basics catalog
生鲜行业数字化采购管理系统:助力生鲜企业解决采购难题,全程线上化采购执行
C cat and dog
Dependency injection
B_ QuRT_ User_ Guide(39)
SAP HR reward and punishment information export
Sequence of entity layer, Dao layer, service layer and controller layer
ping报错:未知的名称或服务
[compilation principle] lexical analysis design and Implementation
Anxinco EC series modules are connected to the multi protocol access products of onenet Internet of things open platform
Ora-02437 failed to verify the primary key violation
Take you hand in hand to build Eureka server with idea
One of the anti climbing methods
SAP HR social work experience 0023
Take you hand in hand to build Eureka client with idea
2022 certified surveyors are still at a loss when preparing for the exam? Teach you how to take the exam hand in hand?
KeePass realizes automatic input of web pages
C inheritance and interface design polymorphism