论坛首页
任务活动
问答
论坛专题
登录
注册
初级工程渣
+ 关注
粉丝
0
|
主题
51
|
回帖
553
加好友
私信
帖子
主题
回复
评论
keil新建基础工程(基于gd32f103)
2024-7-1 18:42
GigaDevice GD32 MCU
33
203
效果:如果PC13引脚上接了led就会闪烁,或者用电压表测PC13引脚它会每隔500ms变化一次电平。 ...
如此设置即可,然后一步步确认ok即可。 下载程序
......
......
若无其他报错即可下载运行,这里我的是jlink下载做以下设置即可
因为编译器版本不对,做以下更改就行。 后面点击OK,再编译一次即可。 ...
没更改编译器版本则会如下报错: ../system/GD32F10x_standard_peripheral/gd32f10x_dac.c(35): warning: I ...
编译下载运行 点击build或直接F7按键
由于我将延时函数的中断放在了bsp_system.c文件中所以gd32f10x_it.c文件需要删除此部分的中断函数,gd32f10 ...
bsp_gpio.h#ifndef BSP_GPIO_H #define BSP_GPIO_H #include "bsp.h" /* GPIO 定义 */ #define LED_GPI ...
bsp_gpio.c #include "bsp_gpio.h" void bsp_gpio_init(void) { /* clk 配置 */ rcu_periph_clo ...
bsp_system.h #ifndef BSP_SYSTEM_H #define BSP_SYSTEM_H #include "bsp.h" void delay_sw_ns(uint32_ ...
bsp_system.c #include "bsp_system.h" volatile static uint32_t delay_count; void system_config(vo ...
bsp.h #ifndef BSP_H #define BSP_H #include // c 库 #include "gd32f10x.h" // gd32 hal库 ...
bsp.c #include "bsp.h" void bsp_init(void) { system_config(); bsp_gpio_init(); /* PC13 ...
main.h #ifndef MAIN_H #define MAIN_H /* C库 函数 */ #include #include #include #include #inc ...
代码编写 编写代码测试 main.c #include "main.h" int main(void) { bsp_init(); while (1) ...
添加以下路径
至此.c文件添加完毕,接下来添加.h文件
注:若添加的文件后缀不是.c命名的需要将文件类型更改一下,即可看到其他后缀的文件,如下图所示: ...
1
2
3
4
5
6
7
后一页
2
3
近期访客