{"id":17918843,"url":"https://github.com/fastshift/arduino-for-keil","last_synced_at":"2025-05-16T02:10:47.382Z","repository":{"id":27422682,"uuid":"113845412","full_name":"FASTSHIFT/Arduino-For-Keil","owner":"FASTSHIFT","description":"A lightweight Arduino framework for Keil projects.","archived":false,"fork":false,"pushed_at":"2025-05-02T09:16:31.000Z","size":13703,"stargazers_count":373,"open_issues_count":18,"forks_count":135,"subscribers_count":16,"default_branch":"main","last_synced_at":"2025-05-02T09:23:24.699Z","etag":null,"topics":["arduino","at32","at32f403","c","cpp","keil","stm32","stm32duino","stm32f0","stm32f1","stm32f3","stm32f4","stm32l1"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FASTSHIFT.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-12-11T10:30:29.000Z","updated_at":"2025-05-02T09:16:35.000Z","dependencies_parsed_at":"2024-12-07T23:03:56.456Z","dependency_job_id":"49624f61-e27e-4678-90a8-a4521bfa33b3","html_url":"https://github.com/FASTSHIFT/Arduino-For-Keil","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FASTSHIFT%2FArduino-For-Keil","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FASTSHIFT%2FArduino-For-Keil/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FASTSHIFT%2FArduino-For-Keil/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FASTSHIFT%2FArduino-For-Keil/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FASTSHIFT","download_url":"https://codeload.github.com/FASTSHIFT/Arduino-For-Keil/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254453667,"owners_count":22073618,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arduino","at32","at32f403","c","cpp","keil","stm32","stm32duino","stm32f0","stm32f1","stm32f3","stm32f4","stm32l1"],"created_at":"2024-10-28T20:13:09.941Z","updated_at":"2025-05-16T02:10:42.371Z","avatar_url":"https://github.com/FASTSHIFT.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Arduino for Keil\n## 1.概要\n\u003e这是一个轻量级的Arduino框架，使**STM32**系列单片机兼容Arduino语法，在Keil上进行编译调试。\n\n相对于传统开发方式的优势:\n\u003e\n\u003e   1.与Arduino共用[生态](https://github.com/topics/arduino-library)，降低学习门槛，简化开发过程。\n\u003e\n\u003e   2.关键部分使用了 **寄存器+宏** 的优化方式，减少函数调用开销，提升运行效率。\n\u003e\n\u003e   3.简化的Arduino框架，相对[stm32duino](https://github.com/stm32duino)与HAL库，拥有更小的代码体积、更快的编译和执行速度。\n\n## 2.使用\n\u003e   底层基于 **AT32/STM32标准外设库** 二次封装，安装之后才能正常编译，下载链接位于下方。\n\n[AT32F403A标准外设库](http://www.arterytek.com/download/Pack_Keil_AT32F4xx_CH_V1.3.4.zip)\n\n[AT32F43x/421标准外设库](https://www.arterytek.com/download/PACK/Keil5_AT32MCU_AddOn_V2.1.7.zip)\n\n[STM32F0xx标准外设库](https://keilpack.azureedge.net/pack/Keil.STM32F0xx_DFP.1.0.1.pack)\n\n[STM32F10x标准外设库](https://keilpack.azureedge.net/pack/Keil.STM32F1xx_DFP.1.1.0.pack)\n\n[STM32F3xx标准外设库](https://keilpack.azureedge.net/pack/Keil.STM32F3xx_DFP.1.2.0.pack)\n\n[STM32F4xx标准外设库](https://keilpack.azureedge.net/pack/Keil.STM32F4xx_DFP.1.0.8.pack)\n\n[STM32L1xx标准外设库](https://keilpack.azureedge.net/pack/Keil.STM32L1xx_DFP.1.0.2.pack)\n\n**注意** 如果您已经安装了更高版本的pack，需要使用keil自带的包管理器将高版本的pack进行Remove\n\n\u003e一般用法可以直接参照[Arduino语法](https://www.arduino.cc/reference/en/)。\n\u003e\n\u003e高级用法参考[Example](https://github.com/FASTSHIFT/Arduino-For-Keil/tree/master/Example)内的示例。\n\u003e\n\u003e第三方库移植参考[第三方库移植示例](https://github.com/FASTSHIFT/Arduino-For-Keil/blob/master/How%20to%20use%20Arduino%20library)。\n\n支持与寄存器和标准外设库的函数混用，**保证开发的灵活性**:\n```C\nvoid setup()\n{\n    pinMode(PA0,OUTPUT);                //使用Arduino函数将配置PA0为输出模式\n}\n\nvoid loop()\n{\n    GPIOA-\u003eBSRR = GPIO_Pin_0;           //使用寄存器将PA0电平拉高\n    delay(1000);                        //延时一秒\n    GPIO_ResetBits(GPIOA, GPIO_Pin_0);  //使用标准外设库的函数将PA0电平拉低\n    delay(1000);                        //延时一秒\n}\n```\n\n## 3.系统框架\n![image](https://github.com/FASTSHIFT/Arduino-For-Keil/blob/master/Framework.png)\n\n## 4.注意\n     1.请不要删除\"main.cpp\"中的main函数。 \n     2.添加第三方库函数的时候要加入完整的路径，以及.cpp源文件. \n     3.由于平台的不同，有的函数库可能要进行修改才能正常编译，具体修改方式请按照编译器的提示，或者可以提交Issues。 \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffastshift%2Farduino-for-keil","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffastshift%2Farduino-for-keil","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffastshift%2Farduino-for-keil/lists"}