1.新建一个一个工作空间文件夹
2.创建一个工程
2.1
2.2
2.3 选择 FSP 库版本、板子型号、设备(MCU)型号、编程语言、编译器
2.4
2.5
2.6
2.7
2.8 代码生成
2.9 代码生成结果
2.10 通过MDK 打卡RASC配置软件
2.11
LED硬件信息
3.1 LED
3.2 RASC 配置gpio
属性说明:
生成代码
软件编写
软件入口函数
void hal_entry(void)
led 闪烁函数
void hal_entry(void)
{
/* TODO: add your own code here */
//初始化io
R_IOPORT_Open (&g_ioport_ctrl, g_ioport.p_cfg);
//
while(1)
{
R_IOPORT_PinWrite(&g_ioport_ctrl, BSP_IO_PORT_04_PIN_04, BSP_IO_LEVEL_LOW);
R_BSP_SoftwareDelay(100, BSP_DELAY_UNITS_MILLISECONDS); //延时 100毫秒
R_IOPORT_PinWrite(&g_ioport_ctrl, BSP_IO_PORT_04_PIN_04, BSP_IO_LEVEL_HIGH);
R_IOPORT_PinWrite(&g_ioport_ctrl, BSP_IO_PORT_04_PIN_05, BSP_IO_LEVEL_LOW);
R_BSP_SoftwareDelay(100, BSP_DELAY_UNITS_MILLISECONDS); //延时 100毫秒
R_IOPORT_PinWrite(&g_ioport_ctrl, BSP_IO_PORT_04_PIN_05, BSP_IO_LEVEL_HIGH);
R_IOPORT_PinWrite(&g_ioport_ctrl, BSP_IO_PORT_04_PIN_15, BSP_IO_LEVEL_LOW);
R_BSP_SoftwareDelay(100, BSP_DELAY_UNITS_MILLISECONDS); //延时 100毫秒
R_IOPORT_PinWrite(&g_ioport_ctrl, BSP_IO_PORT_04_PIN_15, BSP_IO_LEVEL_HIGH);
}
#if BSP_TZ_SECURE_BUILD
/* Enter non-secure code */
R_BSP_NonSecureEnter();
#endif
}
系统延时函数
/*
void R_BSP_SoftwareDelay (uint32_t delay, bsp_delay_units_t units)
delay:时间数量
units:时间单位
*/
可选的时间单位
```c
typedef enum
{
BSP_DELAY_UNITS_SECONDS = 1000000, ///< Requested delay amount is in seconds
BSP_DELAY_UNITS_MILLISECONDS = 1000, ///< Requested delay amount is in milliseconds
BSP_DELAY_UNITS_MICROSECONDS = 1 ///< Requested delay amount is in microseconds
} bsp_delay_units_t;
gpio相关的函数
fsp_err_t R_IOPORT_Open(ioport_ctrl_t * const p_ctrl, const ioport_cfg_t * p_cfg);
fsp_err_t R_IOPORT_Close(ioport_ctrl_t * const p_ctrl);
fsp_err_t R_IOPORT_PinsCfg(ioport_ctrl_t * const p_ctrl, const ioport_cfg_t * p_cfg);
fsp_err_t R_IOPORT_PinCfg(ioport_ctrl_t * const p_ctrl, bsp_io_port_pin_t pin, uint32_t cfg);
fsp_err_t R_IOPORT_PinEventInputRead(ioport_ctrl_t * const p_ctrl, bsp_io_port_pin_t pin, bsp_io_level_t * p_pin_event);
fsp_err_t R_IOPORT_PinEventOutputWrite(ioport_ctrl_t * const p_ctrl, bsp_io_port_pin_t pin, bsp_io_level_t pin_value);
fsp_err_t R_IOPORT_PinRead(ioport_ctrl_t * const p_ctrl, bsp_io_port_pin_t pin, bsp_io_level_t * p_pin_value);
fsp_err_t R_IOPORT_PinWrite(ioport_ctrl_t * const p_ctrl, bsp_io_port_pin_t pin, bsp_io_level_t level);
fsp_err_t R_IOPORT_PortDirectionSet(ioport_ctrl_t * const p_ctrl,
bsp_io_port_t port,
ioport_size_t direction_values,
ioport_size_t mask);
fsp_err_t R_IOPORT_PortEventInputRead(ioport_ctrl_t * const p_ctrl, bsp_io_port_t port, ioport_size_t * event_data);
fsp_err_t R_IOPORT_PortEventOutputWrite(ioport_ctrl_t * const p_ctrl,
bsp_io_port_t port,
ioport_size_t event_data,
ioport_size_t mask_value);
fsp_err_t R_IOPORT_PortRead(ioport_ctrl_t * const p_ctrl, bsp_io_port_t port, ioport_size_t * p_port_value);
fsp_err_t R_IOPORT_PortWrite(ioport_ctrl_t * const p_ctrl, bsp_io_port_t port, ioport_size_t value, ioport_size_t mask);
审核编辑 黄昊宇
声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。
举报投诉
-
keil
+关注
关注
69文章
1223浏览量
170486
发布评论请先 登录
相关推荐
热点推荐
【RA4M2-SENSOR】+开发环境构建
安装RASC,首要的工作就是下载该软件,其网址为:
https://github.com/renesas/fsp/releases
在完成下载后,通过点击即开始安装过程。
2.生成Keil
发表于 09-02 11:33
【RA4L1-SENSOR】开箱+Keil环境搭建+点灯
E2 Studio、Keil、IAR 等开发工具
这里使用 Keil 开发
需要安装瑞萨 RASC (RA Smart Configurator)软件进行
发表于 06-08 11:06
使用RASC生成Keil工程
手动新建一个名为“Workspace_Keil”的文件夹,并将该文件夹作为我们的工作空间,我们的所有Keil工程都会放在这个文件夹里面。值得注意的是:为了避免编译错误,该工作空间文件夹必须放在全英文的路径下,不能包含有中文字符。

【RA-Eco-RA4M2开发板评测】开箱+Keil环境搭建+点灯
工程生成和芯片功能配置(类似 STM32 的 MX 软件功能)
RASC 软件安装包 800M+,安装完占用超过 2G 磁盘空间,如果觉得麻烦并且费时, 也可以不安装
发表于 05-05 09:37
【RA-Eco-RA4M2开发板评测】keil环境安装
keil5.38的pack installer 中最新的dfp包是5。2。0。
为了与RASC中版本一致,所以我去单独下载安装了5.9.0的RA_DFP。
keil中的设置
找到
发表于 04-29 19:30
【瑞萨RA2L1入门学习】开箱+Keil环境搭建+点灯+点亮OLED
使用 Keil 开发, 建议安装瑞萨 RASC (RA Smart Configurator)软件进行 Keil 工程生成和芯片功能配置(
发表于 01-25 12:10
【RA-Eco-RA4E2-64PIN-V1.0开发板试用】+KEIL+RASC 点亮LED灯
界面,点开底部的pin标签,选择P207引脚,配置为OUTput
按ctrl+s保存,点击右上角创建代码
之后关闭RASC,打开生成的keil工程
三、添加代码
1、打开
发表于 01-15 21:36
【RA-Eco-RA4E2-64PIN-V1.0开发板试用】+KEIL+RASC 开发环境搭建
racs,新建工程,选择芯片,选择keil开发环境,一直下一步即可
关闭RASC,打开生成的keil工程
发表于 01-15 21:21
【RA-Eco-RA4E2-64PIN-V1.0开发板试用】开箱+Keil环境搭建+点灯+点亮OLED
Configurator)软件进行 Keil 工程生成和芯片功能配置(类似 STM32 的 MX 软件功能)
RASC 软件安装包 800M+,安装完占用超过
发表于 12-19 23:52
【RA-Eco-RA4E2-64PIN-V1.0开发板试用】+初次见面+MDK生成代码+点灯
:Arm Keil |
Renesas RA_DFP
2、下载官方 RA 智能配置(RASC)安装程序 (FSP 软件包,可与 IAR Embedded Workbench、Arm
Keil
发表于 12-15 21:55
【RA-Eco-RA4E2-64PIN-V1.0开发板试用】MDK新建工程
安装。
2.RASC 软件安装完成之后,还需要将 RASC 软件集成到 Keil 软件上面
3.新建工程
使用 RASC 自动
发表于 12-14 18:23
【RA-Eco-RA0E1-32PIN-V1.0开发板试用】使用 RASC 建立 Keil 工程、烧录测试
Content 生成工程文件。
Keil IDE 编译
回到工程所在文件夹,可见此时已生成 Keil
发表于 11-09 12:52
评论