Git Product home page Git Product logo

arduino-for-keil's Introduction

Arduino for Keil

1.概要

这是一个轻量级的Arduino框架,使STM32系列单片机兼容Arduino语法,在Keil上进行编译调试。

相对于传统开发方式的优势:

1.与Arduino共用生态,降低学习门槛,简化开发过程。

2.关键部分使用了 寄存器+宏 的优化方式,减少函数调用开销,提升运行效率。

3.简化的Arduino框架,相对stm32duino与HAL库,拥有更小的代码体积、更快的编译和执行速度。

2.使用

底层基于 AT32/STM32标准外设库 二次封装,安装之后才能正常编译,下载链接位于下方。

AT32F4xx标准外设库

AT32F435标准外设库

STM32F0xx标准外设库

STM32F10x标准外设库

STM32F3xx标准外设库

STM32F4xx标准外设库

STM32L1xx标准外设库

注意 如果您已经安装了更高版本的pack,需要使用keil自带的包管理器将高版本的pack进行Remove

一般用法可以直接参照Arduino语法

高级用法参考Example内的示例。

第三方库移植参考第三方库移植示例

支持与寄存器和标准外设库的函数混用,保证开发的灵活性:

void setup()
{
    pinMode(PA0,OUTPUT);                //使用Arduino函数将配置PA0为输出模式
}

void loop()
{
    GPIOA->BSRR = GPIO_Pin_0;           //使用寄存器将PA0电平拉高
    delay(1000);                        //延时一秒
    GPIO_ResetBits(GPIOA, GPIO_Pin_0);  //使用标准外设库的函数将PA0电平拉低
    delay(1000);                        //延时一秒
}

3.系统框架

image

4.注意

 1.请不要删除"main.cpp"中的main函数。 
 2.添加第三方库函数的时候要加入完整的路径,以及.cpp源文件. 
 3.由于平台的不同,有的函数库可能要进行修改才能正常编译,具体修改方式请按照编译器的提示,或者可以提交Issues。 

arduino-for-keil's People

Contributors

fastshift avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.