首先include头文件,不需要把文件 放到工程中,通常需要使用判隐昌函数文件的时候,把.c文件放到工程里。携中只需要把头文件掘扒夹路径在IAR中 配置下就可以啦。。你把.h文件在工程中去掉,路径包含下,看看行不行。
还有,我通常那个包含的都是stm8s.h这个文件,在库中有的,你这个我没包含过。
注意:以下修改在IARfor
STM8
1.10
SP3下验证,库文件为IAR自带的1.1.11、选择CPU类型(支持STM8S系列设备)stm8s.h.../*
Uncomment
the
line
below
according
to
the
target
STM8S
device
used
in
yourapplication.
Tip:
To
avoid
modifying
this
file
each
time
you
need
to
switch
between
thesedevices,
you
can
define
the
device
in
your
toolchain
compiler
preprocessor.
*/#if
!defined
(STM8S208)
&&
!defined
(STM8S207)
&&
!defined
(STM8S105)
&&
!defined
(STM8S103)
&&
!defined
(STM8S903)#define
STM8S208/*
#define
STM8S207
*//*
#define
STM8S105
*/
/*
#define
STM8S103
*//*
#define
STM8S903
*/#endif根据你的CPU类型选择宏定义,比如我这里用的是105系列,则修改为:/*
#define
STM8S208
*//*
#define
STM8S207
*/
#define
STM8S105
/*
#define
STM8S103
*/
/*
#define
STM8S903
*/选择好CPU类型后,还需查看选择的类型中哪些外设是包乎橘含的哪些外设没有包含,将没有包含的外设驱动c文件在工程中去掉如105系列没有adc2、can、uart1、uart32、修改stm8s_conf.h文件选择好CPU类型后,接下来就握戚是选择要使用的外设了,stm8s_conf.h就是外设岁皮团驱动选择开关,在用户函数中,只需包含此头文件即可。
您好,stm8库文件在IAR的安装路径里可以找到,位置如下(告闷以安装在电脑D盘为例):
D:\Program Files\IAR Systems\Embedded Workbench 7.3\stm8\examples\STM8S\STM8S105C6-Board\Libraries\STM8S_StdPeriph_Driver
“STM8S_StdPeriph_Driver”文件夹里有两个袜轿弯库文件夹“inc”和“src”,分别用来存放.h和.c文件,截图如下:帆弊
满意请采纳好评,谢谢!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)