mbedSDK中文说明(官方文档直译)
2014年10月29日juleiLeaveaComment
ThembedSoftwareDevelopmentKit(SDK)isaC/C++microcontrollersoftwareplatformrelieduponbytensofthousandsofdeveloperstobuildprojectsfast.We’veworriedaboutcreatingandtestingstartupcode,Cruntime,librariesandperipheralAPIs,soyoucanworryaboutcodingthesmartsofyournextproduct.
mbed的软件开发工具包(SDK)是一个c/c++微处理器软件开发平台,数以万计的开发人员依赖该平台来快速构建项目。我们创建和测试了启动代码,C运行时,库和外围api,因此你只需考虑下一个产品本身的编码问题。
?
TheSDKislicensedunderthepermissiveApache2.0licence,soyoucanuseitinbothcommercialandpersonalprojectswithconfidence.
该SDK使用apache2.0授权许可证,所以可以放心的在商业和个人项目中使用它。
ThembedSDKhasbeendesignedtoprovideenoughhardwareabstractiontobeintuitiveandconcise,yetpowerfulenoughtobuildcomplexprojects.Itisbuiltonthelow-levelARMCMSISAPIs,allowingyoutocodedowntothemetalifneeded.InadditiontoRTOS,USBandNetworkinglibraries,acookbookofhundredsofreusableperipheralandmodulelibrarieshavebeenbuiltontopoftheSDKbythembedDeveloperCommunity.
mbedSDK设计提供足够直观和简洁的硬件抽象模型,但是功能强大到可以构建复杂的项目。它是建立在低级别的ARMCMSISAPI上,允许你在需要时进行底层编码。除了RTOS,USB和网络库,mbed开发者社区已经建成了数以百计的可重复使用的外设和模块库的应用手册。
HelloWorld程序!
Startupcode,check.CLibraryintegration,check.Peripherallibraries,check.We’veworkedhardtohelpyougettothepoint:
启动代码检查。C类库的整合和检查。外设函数库检查。我们努力帮助您直接切入正题:
HelloWorld–main.cpp
High-levelPeripheralAPIs
高层次外设API
ThembedSDKgivesyouanAPI-drivenapproachtomicrocontrollercoding.
mbedSDK为您提供一个单片机编码方式的API驱动。
We’vedoneallthehardworkofimplementingdriversforthedifferentmbedMicrocontrollers,soyoudon’thaveto.Itisliberatingtofireupaninterface,knowingit’lljustwork!
我们已经努力的为不同的mbed微控制器实现了驱动程序,所以你没必要做这方面的内容。你只需要调用接口,使得它能够正常工作。
YoucancodeusingmeaningfulabstractobjectsandAPIcalls,soyoudon’tneedtolearnthemicrocontrollerhardwaredetailstogetgoing.Thereisevena“HelloWorld!”exampleforeveryperipheral,justtogetyoustartedbeforeyouknowit.
你可以使用对象和调用API接口来完成编码,所以你没有必要学习微控制器硬件的详细内容,甚至每一个外部设备都有一个“helloworld”的例子,在你了解具体代码之前就可以进行代码的编写以及项目的开发了。
Takealookatsomeoftheseinterfacestogetafeelofhowitworks:DigitalOut,AnalogIn,SPI,USBMouse,Timer,CAN
仔细观察这些接口,来了解它们是如何工作的:DigitalOut,AnalogIn,SPI,USBMouse,Timer,CAN
Butifneeded,youcanalwaysbypasstheAPIsandtalkdirectlytothemicrocontrollerhardwareusingthelow-levelCortexMicrocontrollerSoftwareInterfaceStandard(CMSIS)APIs.Idealwhentheyarefineformostofyourproject,butoneaspectneedsspecificlow-levelcontrol.
另外如果你需要的话,你可以绕开APIS接口来运用底层的(CMSIS)APIS直接和微控制器硬件进行对话,它们是适合大部分程序的,但是这样做是需要进行特定的底层控制的。
?
ForallthembedC/C++SDKAPIs,seethembedHandbook
对于全部的mbedC/C++SDKAPIs,可以查看?mbedHandbook手册
ToreadmoreaboutmbedSDKcodingstyle,seethembedSDKcodingstyle
了解更多mbedSDK的编码风格,可以查看mbedSDKcodingstyle手册
SupportforMultipleTargets
多目标支持
TheabstractionprovidedbythembedSDKAPIsenableslibrariesandexamplecodetobereusedbyanymicrocontrollertargetthatthembedSDKtargets.
多工具链支持
OurgoalwiththembedCompilerandmbedSDKistoenableaconsistentandstablefullyintegrateddevelopmentplatformthatjustworks.Thishelpsprovideaconsistentcontextfordevelopment,codesharing,andquestionsandanswerswithotherdevelopersthathelpsyoubemoreproductive,especiallywhenprototyping.
我们与编译器和SDK的目标是建立一个一致的和稳定的,充分集成的可以工作的开发平台。这有助于为产品开发,代码共享提供一个一致的环境,在这个环境里可以与其他开发者进行问题的交流,从而使你能更有效率的开发,特别是原型设计时的效率更高。
However,thembedC/C++SDKusedwiththembedOnlineCompilerisalsocompatiblewithanumberofotherpopularARMmicrocontrollertoolchains!
mbedC/C++SDK使用mbed在线编辑器也是兼容一些主流的ARM微控制器开发工具链。
Ifyou’dliketousethembedMicrocontrollersormbedC/C++SDKwithanalternatetool,orsimplymigratetooneasyourprojectdevelopspastprototype,youcanchoosetoexportanmbedprojecttothetoolchainofyourchoicebyright-clickingonthemintheIDE.
如果你想使用mbed微控制器或者mbedC/C++SDK,或者仅仅是迁移作为一个项目开发的原型。你可以选择右击IDE文件,来将mbed项目导出到你选择的工具链中。
YoucanreadmoreaboutthisontheExportingtoofflinetoolchainshandbookpage.
你可以阅读更多的关于这个Exportingtoofflinetoolchains手册。
ThembedSDKislicensedunderthepermissiveApache2.0opensourcelicence.
该SDK使用apache2.0授权许可证
WewantedtomakesurethelicensewechosemadeitpossibletousetheSDKinbothcommercialandpersonalprojectswithconfidence,includingnoobligationstoopensourceyourowncodeifyoudidn’twantto.Whilstweencouragesharingofcodeandexperiencetobereusablebyothers,wecertainlydon’twanttoenforceit,andapermissivelicenseprovidesthatfreedomforouruserstokeeptheoptionsopen.
我们选择的授权许可以让SDK在商业和个人领域随意使用,其中你也可以选择不开源自己的代码。虽然我们鼓励分享代码和经验被其他人重复使用,但是我们不强制执行。许可证允许我们的用户有自由选择权。
IfyouareinterestedindelvinginthedepthofthembedSDKimplementationyoucantakealookatthedocumentationofthembedlibraryinternals.
如果你有兴趣深入研究深度的mbedSDK实现,你可以看看mbed内部的文档。
andyoucanusethembedlibrarysources,insteadofoneofitsbuilds:
你可以使用mbed库资源,而不是它的一个结构:
Importlibrarymbed-src
导入mbed-src库
mbedlibrarysources
mbed的源代码
IfyouareinterestedinportingthembedSDKtoanewtargetweprovidethesourcesofalltheofficialmbedlibraries,testsandtools(buildandtestsystem,exporterstoofflineIDEs)inthisgithubrepository.
如果你对SDK植入一个新目标感兴趣,我们会提供所有的正式的mbed库,在github库中我们提供测试以及工具(构建和测试系统,离线集成开发环境)。
|
|