首页 > 其他分享 >RT-Thread Studio增加软件包操作

RT-Thread Studio增加软件包操作

时间:2022-09-05 09:33:25浏览次数:98  
标签:RT ad7606 Thread src AD7606 Studio PKG 软件包 USING

RT-Thread Studio增加软件包操作

1. 在本地中完成如下操作

打开RTthread Studio的安装目录
image

在当前目录下找到env的目录
image

在env的目录下找到要添加软件包的分类文件夹
image

本次以peripherals作为例子,进入peripherals点击鼠标右键在当前目录打开ConEmu Here,如果鼠标右键的列表中没有这个选项参考如下教程

Env 用户手册 (rt-thread.org)

接着按照如下教程使用索引生成向导

软件包开发指南 (rt-thread.org)

其中github的ID查询方法:https://api.github.com/users/+你的github用户名

完成向导后就会在当前目录下生成对应的软件包文件夹
image

修改文件夹下的两个文件
image

Kconfig文件示例

# Kconfig file for package ad7606
menuconfig PKG_USING_AD7606
    bool "AD7606: An ADC chip."
    default n

if PKG_USING_AD7606

    config PKG_AD7606_PATH
        string
        default "/packages/peripherals/ad7606"

    choice
        prompt "Version"
        default PKG_USING_AD7606_LATEST_VERSION
        help
            Select the package version

        config PKG_USING_AD7606_V100
            bool "v1.0.0"

        config PKG_USING_AD7606_LATEST_VERSION
            bool "latest"
    endchoice
          
    config PKG_AD7606_VER
       string
       default "v1.0.0"    if PKG_USING_AD7606_V100
       default "latest"    if PKG_USING_AD7606_LATEST_VERSION

endif

package.json文件示例

{
  "name": "ad7606",
  "description": "Please add description of ad7606 in English.",
  "description_zh": "请添加软件包 ad7606 的中文描述。",  
  "enable": "PKG_USING_AD7606", 
  "keywords": [
    "ad7606"
  ],
  "category": "peripherals",
  "author": {
    "name": "59213512",
    "email": "[email protected]",
    "github": "59213512"
  },
  "license": "MIT",
  "repository": "https://github.com/fateful-Y/rtthread",
  "icon": "unknown",
  "homepage": "unknown",
  "doc": "unknown",
  "site": [
    {
      "version": "v1.0.0",
      "URL": "https://github.com/fateful-Y/rtthread.git",
      "filename": "ad7606-1.0.0.zip",
      "VER_SHA": "master"
    },
    {
      "version": "latest",
      "URL": "https://github.com/fateful-Y/rtthread.git",
      "filename": "",
      "VER_SHA": "master"
    }
  ]
}

2. 在对应的git仓库中建立如下目录列表

image
其中docs放一些说明文件

examples放软件包的demo示例文件

inc放头文件

src放源文件

.gitignore放如下代码

# Prerequisites
*.d

# Object files
*.o
*.ko
*.obj
*.elf

# Linker output
*.ilk
*.map
*.exp

# Precompiled Headers
*.gch
*.pch

# Libraries
*.lib
*.a
*.la
*.lo

# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib

# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex

# Debug files
*.dSYM/
*.su
*.idb
*.pdb

# Kernel Module Compile Results
*.mod*
*.cmd
.tmp_versions/
modules.order
Module.symvers
Mkfile.old
dkms.conf

LICENSE放如下代码

hello/LICENSE at master · RT-Thread-packages/hello

SConscript构建文件示例:

from building import *
Import('rtconfig')

src   = []
cwd   = GetCurrentDir()

# add ad7606 src files.
if GetDepend('PKG_USING_AD7606'):
    src += Glob('src/ad7606.c')

# add ad7606 include path.
path  = [cwd + '/inc']

# add src and include to group.
group = DefineGroup('ad7606', src, depend = ['PKG_USING_AD7606'], CPPPATH = path)

Return('group')

3. 打开rtthread studio中的setting文件添加软件包

image

标签:RT,ad7606,Thread,src,AD7606,Studio,PKG,软件包,USING
From: https://www.cnblogs.com/ydmblog/p/16656936.html

相关文章

  • 记录echarts升级echarts5.3.0
    转自于:https://zhuanlan.zhihu.com/p/526439319背景为更好地维护项目以及使用v5新特性,把已有项目的eharts3.0/4.0升级v5【升级文档】前期准备推荐一个npm版本检测工具n......
  • SecureCRT - Signature Verification Error
     SecureCRT-SignatureVerificationError 玛德以前遇到过这个问题然后处理了没记录,这两天新给的堡垒机新装的SecureCRT/SecureFX(9.1版本)打开又报错如下(截图是sft......
  • Webrtc Video Simulcast
    titleWebRTCVideoSimulcastClient->PeerConnection:SetLocalDescriptionPeerConnection->SdpOfferAnswerHandler:SetLocalDescriptionSdpOfferAnswerHandler->SdpOffer......
  • ECHART的使用方法
    项目中需要使用图表,最初使用的.NET自带的MSChart控件,做出来的效果不太好,所以又使用了Echarts控件。MSChart源码放在最后,可自行下载查看。Echarts是一个基于JavaScript......
  • F1C100S rt-smart 内核移植(二)
    前言本篇的内容进入了rt-smart内核的C语言世界,因此会同时涉及到较多的.c文件,需要读者对rt-smart内核有基本的认识,至少需要大致了解内核的文件结构。在上一章节中,我们从启......
  • Docker Desktop starting
                ......
  • vc++template function get random and quick sort
    //ConsoleApplication2.cpp:Thisfilecontainsthe'main'function.Programexecutionbeginsandendsthere.//#include<ctime>#include<iostream>#include......
  • 多线程---Thread和Runnable
    多线程参考视频:多线程02:线程、进程、多线程哔哩哔哩bilibili1.概念     2.线程创建创建线程方式一:继承Thread类,重写run()方法,调用start开启线程packagec......
  • 在VirtueBox中安装Ubuntu中的艰难险阻
    据安装教程中解释道在WSL中运行Ubuntu可能仍存在一些问题,为了防止可能影响的学习,不如就在虚拟机中安装Ubuntu吧。在VirtueBox中的艰难艰难1:无法新建虚拟机嗯?为什么无法......
  • 基于 ESP8266_RTOS_SDK 驱动 DHT11
    概述DHT11模块使用一根data线实现信号触发以及数据反馈,信号格式参考如下https://zhuanlan.zhihu.com/p/347904660本文使用GPIO中断的方式采集反馈数据知识点:GPIO、中断......