2

嵌入式软件设计(库函数调用实现点灯)

 1 year ago
source link: https://blog.csdn.net/feixiaoxing/article/details/125122798
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

嵌入式软件设计(库函数调用实现点灯)

费晓行 已于 2022-06-04 18:23:32 修改 25

【 声明:版权所有,欢迎转载,请勿用于商业用途。 联系信箱:feixiaoxing @163.com】

         所谓库函数调用,主要是编译器工具厂商希望用户可以在编写代码的时候摆脱对具体芯片厂商的依赖。同样的mcu代码,可以在不改动或者极小改动的情况下完成mcu的替换。这就要保证固件顶层的接口都是一致的,底层的实现则都是mcu芯片厂商自己来完成的。

1、函数库的样子

c398c44eef99462680257591eedd115f.png

        如图所示,这里的CMSIS和FWLIB目录都包含了库函数代码。尤其是FWLIB里面的c文件,每个文件都是以具体芯片类型开头的,如下图所示,

3706ea6d3a9f464a8806ff8e4e72f161.png

2、初始化led模块

        有了这些函数库,硬件模块的编写就会变的轻松多了,不再需要和具体的寄存器打交道了,比如像这样,


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK