11 Star 39 Fork 20

RT-Thread-Mirror / micropython

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

MicroPython

中文页 | English

1、介绍

这是一个在 RT-Thread 上的 MicroPython 移植,可以运行在 RT-Thread 3.0 版本以上。通过该软件包可以在搭载了 RT-Thread 的嵌入式系统上运行 MicroPython

如果是第一次接触 RT-Thread MicroPython,推荐你先通过 RT-Thread 官方支持的开发板来快速上手,这些开发板的固件功能完善并提供源代码,适合入门学习,官方支持开发板 固件下载请点我

1.1 目录结构

名称 说明
docs 文档目录,包括入门指南和开发手册
drivers MicroPython 源代码目录
extmod MicroPython 源代码目录
lib MicroPython 源代码目录
py MicroPython 源代码目录
port 移植代码目录
LICENSE Micropython MIT 许可证

1.2 许可证

RT-Thread MicroPython 遵循 MIT 许可,详见 LICENSE 文件。

1.3 依赖

  • RT-Thread 3.0+

2、如何打开 RT-Thread MicroPython

使用 MicroPython package 需要在 RT-Thread 的包管理器中选择它,具体路径如下:

elect_micropytho

然后让 RT-Thread 的包管理器自动更新,或者使用 pkgs --update 命令更新包到 BSP 中。

3、使用 RT-Thread MicroPython

3.1 添加软件包到工程

选中 MicroPython package 后,再次进行 bsp 编译时,它会被加入到 bsp 工程中进行编译。

3.2 使用 MicroPython IDE

RT-Thread MicroPython IDE 为 MicroPython 提供了强大的开发环境,可以通过 VScode 应用商店直接查询下载,示例如下所示:

08_direct_run_files

3.3 向 MicroPython 添加 C 扩展

为了方便用户添加自己编写的 C 函数到 MicroPython 中被 Python 脚本调用,RT-Thread 提供了 MicroPython C 绑定代码自动生成器 供大家使用。通过该工具,用户只需要简单几步,即可实现 C 函数扩展,下图展示了自动生成的 C 代码的形式。

08_direct_run_files

4、注意事项

  • 需要使用 RT-Thread 3.0 以上版本
  • menuconfig 选项中选择 Micropythonlatest 版本
  • 目前 System Module 下的 ffi 模块只支持 GCC 工具链,且需要在链接脚本中添加相关段信息

5、开发资源

The MIT License (MIT) Copyright (c) 2013, 2014 Damien P. George Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

这是一个在 RT-Thread 上的 MicroPython 移植,可以运行在 RT-Thread 3.0 版本以上。通过该软件包可以在搭载了 RT-Thread 的嵌入式系统上运行 MicroPython 展开 收起
Python 等 4 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Python
1
https://gitee.com/RT-Thread-Mirror/micropython.git
git@gitee.com:RT-Thread-Mirror/micropython.git
RT-Thread-Mirror
micropython
micropython
master

搜索帮助