Explorar el Código

【完善】:完善基本模块格式

SummerGift hace 8 años
padre
commit
c669ce7d2e

+ 13 - 34
docs/Development_manual_document_section/01-Getting_Started_Guide.md

@@ -1,32 +1,11 @@
 # RT-Thread MicroPython 快速上手
 # RT-Thread MicroPython 快速上手
 
 
-## 1. 简介
-### 1.1 主要特性
-
-- 1、MicroPython 是 Python 3 编程语言的一种精简而高效的实现,它包含 Python 标准库的一个子集,并被优化为在微控制器和受限环境中运行。
-
-- 2、RT-Thread MicroPython 可以运行在任何搭载了 RT-Thread 操作系统并且有一定资源的嵌入式平台上。
-
-- 3、MicroPython 可以运行在有一定资源的开发板上,给你一个低层次的 Python 操作系统,可以用来控制各种电子系统。
-
-- 4、MicroPython 富有各种高级特性,比如交互式提示、任意精度整数、闭包函数、列表解析、生成器、异常处理等等。
-
-- 5、MicroPython 的目标是尽可能与普通 Python 兼容,使开发者能够轻松地将代码从桌面端转移到微控制器或嵌入式系统。
-
-### 1.2 MicroPython 的优势
-
-- 1、Python 是一款容易上手的脚本语言,同时具有强大的功能,语法优雅简单。使用 MicroPython 编程可以降低嵌入式的开发门槛,让更多的人体验嵌入式的乐趣。
-
-- 2、通过 MicroPython 实现硬件底层的访问和控制,不需要了解底层寄存器、数据手册、厂家的库函数等,即可轻松控制硬件。
-
-- 3、大部分外设和常用功能都有自己的库,降低开发难度,使开发和移植变得容易和快速。
-
-## 2. 开始使用 MicroPython
+## 1. 开始使用 MicroPython
 
 
 !!! note "注意"
 !!! note "注意"
      RT-Thread MicroPython 需要运行在 **RT-Thread 3.0** 版本以上。
      RT-Thread MicroPython 需要运行在 **RT-Thread 3.0** 版本以上。
 
 
-### 2.1 选择合适的 BSP 平台
+### 1.1 选择合适的 BSP 平台
 
 
 RT-Thread MicroPython mini 版本最小资源占用要求为:
 RT-Thread MicroPython mini 版本最小资源占用要求为:
 
 
@@ -35,7 +14,7 @@ RT-Thread MicroPython mini 版本最小资源占用要求为:
 
 
 常见的许多开发板都可以运行 MicroPython,如 `stm32f10x` 、`stm32f40x` 、`stm32f429-apollo`、`imxrt1052-evk`  、`iot-camera` 等。 
 常见的许多开发板都可以运行 MicroPython,如 `stm32f10x` 、`stm32f40x` 、`stm32f429-apollo`、`imxrt1052-evk`  、`iot-camera` 等。 
 
 
-### 2.2 MicroPython 软件包的安装
+### 1.2 MicroPython 软件包的安装
 
 
 - MicroPython 软件包可以通过 env 工具在线下载获得。在下载 MicroPython 软件包前,建议使用 `pkgs --upgrade` 命令更新软件包列表,并且在配置版本时勾选 `latest` 版本,如图:
 - MicroPython 软件包可以通过 env 工具在线下载获得。在下载 MicroPython 软件包前,建议使用 `pkgs --upgrade` 命令更新软件包列表,并且在配置版本时勾选 `latest` 版本,如图:
 
 
@@ -43,11 +22,11 @@ RT-Thread MicroPython mini 版本最小资源占用要求为:
 
 
 - 使用 env 下载 MicroPython 软件包的方法请参考: [`RT-Thread env 工具使用手册`](https://www.rt-thread.org/document/site/docs/tools/env/env-user-manual/)
 - 使用 env 下载 MicroPython 软件包的方法请参考: [`RT-Thread env 工具使用手册`](https://www.rt-thread.org/document/site/docs/tools/env/env-user-manual/)
 
 
-### 2.3 选择开发环境
+### 1.3 选择开发环境
 
 
 - 目前 MicroPython 支持三种开发环境,分别为 `MDK / IAR / GCC`,选择合适的开发环境,使用 env 工具将 MicroPython 软件包开启后,需重新生成工程,再进行编译、下载。
 - 目前 MicroPython 支持三种开发环境,分别为 `MDK / IAR / GCC`,选择合适的开发环境,使用 env 工具将 MicroPython 软件包开启后,需重新生成工程,再进行编译、下载。
 
 
-### 2.4 运行 MicroPython
+### 1.4 运行 MicroPython
 
 
 - 在 Finsh/MSH 命令行内输入 `python` 即可进入 MicroPython 的交互命令行 REPL(Read-Evaluate-Print-Loop),可在终端看到如下界面:
 - 在 Finsh/MSH 命令行内输入 `python` 即可进入 MicroPython 的交互命令行 REPL(Read-Evaluate-Print-Loop),可在终端看到如下界面:
 
 
@@ -55,16 +34,16 @@ RT-Thread MicroPython mini 版本最小资源占用要求为:
 
 
 使用 `Ctrl-D` 或输入 `quit()` 以及 `exit()`  即可退出 REPL ,回到 RT-Thread Finsh/MSH。
 使用 `Ctrl-D` 或输入 `quit()` 以及 `exit()`  即可退出 REPL ,回到 RT-Thread Finsh/MSH。
 
 
-## 3. MicroPython 基本功能 
-### 3.1 Python 语法与内建函数 
+## 2. MicroPython 基本功能 
+### 2.1 Python 语法与内建函数 
 
 
-#### 3.1.1 使用 python 交互命令行 
+#### 2.1.1 使用 python 交互命令行 
 
 
 - MicroPython 是 Python 3 编程语言的一种精简而高效的实现,语法和 Python 3 相同,并带有丰富的内建函数,使用 MicroPython 交互命令行即可运行 Python 代码:
 - MicroPython 是 Python 3 编程语言的一种精简而高效的实现,语法和 Python 3 相同,并带有丰富的内建函数,使用 MicroPython 交互命令行即可运行 Python 代码:
 
 
 ![elect_micropytho](./figures/python_hello.png)
 ![elect_micropytho](./figures/python_hello.png)
 
 
-#### 3.1.2 交互命令行的粘贴模式
+#### 2.1.2 交互命令行的粘贴模式
 
 
 - `MicroPython`  比一般的 python 交互环境多了一个特别的**粘贴模式**,可以一次粘贴输入多行 python 代码。
 - `MicroPython`  比一般的 python 交互环境多了一个特别的**粘贴模式**,可以一次粘贴输入多行 python 代码。
 - 在命令行提示符状态下,按下 `Ctrl-E` 组合键,就会出现提示:`paste mode; Ctrl-C to cancel, Ctrl-D to finish` 。粘贴需要运行的代码后,按下 `Ctlr-D` 即可退出粘贴模式,同时输入的代码也会自动执行。
 - 在命令行提示符状态下,按下 `Ctrl-E` 组合键,就会出现提示:`paste mode; Ctrl-C to cancel, Ctrl-D to finish` 。粘贴需要运行的代码后,按下 `Ctlr-D` 即可退出粘贴模式,同时输入的代码也会自动执行。
@@ -81,7 +60,7 @@ for i in range(1,10):
 
 
 ![elect_micropytho](./figures/python_grammer_function.png)
 ![elect_micropytho](./figures/python_grammer_function.png)
 
 
-### 3.2 MicroPython 内建模块
+### 2.2 MicroPython 内建模块
 
 
 - MicroPython 提供丰富的内建模块用来完成相关的程序功能。同时 RT-Thread  也提供了 `rtthread` 模块用来返回系统运行相关的信息。
 - MicroPython 提供丰富的内建模块用来完成相关的程序功能。同时 RT-Thread  也提供了 `rtthread` 模块用来返回系统运行相关的信息。
 - 以 `rtthread` 和 `time` 模块为例,调用方式如下:
 - 以 `rtthread` 和 `time` 模块为例,调用方式如下:
@@ -91,13 +70,13 @@ for i in range(1,10):
 !!! tip "提示"
 !!! tip "提示"
      默认下载的 MicroPython  软件包为 mini 版本,为 RT-Thread 推出的最小版本的 MicroPython ,如果想使用更多的 MicroPython 模块,可以在 menuconfig 配置项中打开更多的模块选项。
      默认下载的 MicroPython  软件包为 mini 版本,为 RT-Thread 推出的最小版本的 MicroPython ,如果想使用更多的 MicroPython 模块,可以在 menuconfig 配置项中打开更多的模块选项。
 
 
-## 4. MicroPython 例程
+## 3. MicroPython 例程
 
 
 通过 MicroPython 可以用非常简单的方式来控制开发板的硬件资源,下面用两个例子来说明:
 通过 MicroPython 可以用非常简单的方式来控制开发板的硬件资源,下面用两个例子来说明:
 
 
 以下例程运行在 `i.MX RT1050 开发板 `上,运行之前需要开启 RT-Thread  `Pin 设备`功能。
 以下例程运行在 `i.MX RT1050 开发板 `上,运行之前需要开启 RT-Thread  `Pin 设备`功能。
 
 
-### 4.1 闪烁灯
+### 3.1 闪烁灯
 
 
 - i.MX RT1050 开发板中: [第 52 号 pin](https://github.com/RT-Thread/rt-thread/blob/8ed3470d2a485c49ec4f5d4a5ec53e94edf7a2c8/bsp/imxrt1052-evk/drivers/drv_pin.c#L105) 为 LED D18,与 phy 复位引脚共用
 - i.MX RT1050 开发板中: [第 52 号 pin](https://github.com/RT-Thread/rt-thread/blob/8ed3470d2a485c49ec4f5d4a5ec53e94edf7a2c8/bsp/imxrt1052-evk/drivers/drv_pin.c#L105) 为 LED D18,与 phy 复位引脚共用
 
 
@@ -115,7 +94,7 @@ while True:
 
 
 针对自己的开发板修改引脚号,将以上脚本使用 3.1.2 章节介绍的**粘贴模式**输入,即可看到 LED 灯按照指定的频率闪烁。使用 `Ctrl-C` 可以取消当前正在运行程序。
 针对自己的开发板修改引脚号,将以上脚本使用 3.1.2 章节介绍的**粘贴模式**输入,即可看到 LED 灯按照指定的频率闪烁。使用 `Ctrl-C` 可以取消当前正在运行程序。
 
 
-### 4.2 按键灯
+### 3.2 按键灯
 
 
 - i.MX RT1050 开发板中: [第 125 号 pin](https://github.com/RT-Thread/rt-thread/blob/8ed3470d2a485c49ec4f5d4a5ec53e94edf7a2c8/bsp/imxrt1052-evk/drivers/drv_pin.c#L184) 为 SW8
 - i.MX RT1050 开发板中: [第 125 号 pin](https://github.com/RT-Thread/rt-thread/blob/8ed3470d2a485c49ec4f5d4a5ec53e94edf7a2c8/bsp/imxrt1052-evk/drivers/drv_pin.c#L184) 为 SW8
 
 

+ 15 - 15
docs/Development_manual_document_section/03-Basic_Module/03-sys.md

@@ -6,44 +6,44 @@
 ## 函数
 ## 函数
 
 
 - sys.exit(retval=0)  
 - sys.exit(retval=0)  
-  终止当前程序给定的退出代码。 函数会抛出 SystemExit 异常。
+  终止当前程序给定的退出代码。 函数会抛出 `SystemExit` 异常。
 
 
 - sys.print_exception(exc, file=sys.stdout)  
 - sys.print_exception(exc, file=sys.stdout)  
-  打印异常与追踪到一个类似文件的对象 file (或者缺省 sys.stdout ).
+  打印异常与追踪到一个类似文件的对象 file (或者缺省 `sys.stdout` ).
 
 
 ## 常数
 ## 常数
 
 
-- sys.argv  
+### **sys.argv**  
   当前程序启动时参数的可变列表。
   当前程序启动时参数的可变列表。
 
 
-- sys.byteorder  
+### **sys.byteorder**  
   系统字节顺序 (“little” or “big”).
   系统字节顺序 (“little” or “big”).
 
 
-- sys.implementation  
-  使用当前Python实现的。
+### **sys.implementation**  
+  使用当前 Python 实现的。
 
 
-- sys.modules  
+### **sys.modules**  
   加载模块字典。在一部分环境中它可能不包含内置模块。
   加载模块字典。在一部分环境中它可能不包含内置模块。
 
 
-- sys.path  
+### **sys.path**  
   搜索导入模块的可变目录列表。
   搜索导入模块的可变目录列表。
 
 
-- sys.platform  
+### **sys.platform**  
   返回当前操作系统信息。
   返回当前操作系统信息。
 
 
-- sys.stderr  
+### **sys.stderr**  
   标准错误流。
   标准错误流。
 
 
-- sys.stdin  
+### **sys.stdin**  
   标准输入流。
   标准输入流。
 
 
-- sys.stdout  
+### **sys.stdout**  
   标准输出流。
   标准输出流。
 
 
-- sys.version  
-  符合的Python语言版本,如字符串。
+### **sys.version**  
+  符合的 Python 语言版本,如字符串。
 
 
-- sys.version_info  
+### **sys.version_info**  
   Python 语言版本,实现符合,作为一个元组的值。
   Python 语言版本,实现符合,作为一个元组的值。
 
 
 ## 示例 
 ## 示例 

+ 41 - 41
docs/Development_manual_document_section/03-Basic_Module/04-math.md

@@ -7,128 +7,128 @@
 
 
 ## 函数
 ## 函数
 
 
-- math.acos(x)  
+### **math.acos(x)**
   返回 ``x`` 的反余弦。
   返回 ``x`` 的反余弦。
 
 
-- math.acosh(x)  
+### **math.acosh(x)** 
   返回 ``x`` 的逆双曲余弦。
   返回 ``x`` 的逆双曲余弦。
 
 
-- math.asin(x)  
+### **math.asin(x)**
   返回 ``x`` 的反正弦。
   返回 ``x`` 的反正弦。
 
 
-- math.asinh(x)  
+### **math.asinh(x)**
   返回``x`` 的逆双曲正弦。
   返回``x`` 的逆双曲正弦。
 
 
-- math.atan(x)  
+### **math.atan(x)**
   返回 ``x`` 的逆切线。
   返回 ``x`` 的逆切线。
 
 
-- math.atan2(y, x)  
+### **math.atan2(y, x)**
   Return the principal value of the inverse tangent of y/x.
   Return the principal value of the inverse tangent of y/x.
 
 
-- math.atanh(x)  
+### **math.atanh(x)**
   Return the inverse hyperbolic tangent of x.
   Return the inverse hyperbolic tangent of x.
 
 
-- math.ceil(x)  
+### **math.ceil(x)**
   Return an integer, being x rounded towards positive infinity.
   Return an integer, being x rounded towards positive infinity.
 
 
-- math.copysign(x, y)  
+### **math.copysign(x, y)** 
   Return x with the sign of y.
   Return x with the sign of y.
 
 
-- math.cos(x)  
+### **math.cos(x)**  
   Return the cosine of x.
   Return the cosine of x.
 
 
-- math.cosh(x)  
+### **math.cosh(x)**  
   Return the hyperbolic cosine of x.
   Return the hyperbolic cosine of x.
 
 
-- math.degrees(x)  
+### **math.degrees(x)**  
   Return radians x converted to degrees.
   Return radians x converted to degrees.
 
 
-- math.erf(x)  
+### **math.erf(x)**  
   Return the error function of x.
   Return the error function of x.
 
 
-- math.erfc(x)  
+### **math.erfc(x)**  
   Return the complementary error function of x.
   Return the complementary error function of x.
 
 
-- math.exp(x)  
+### **math.exp(x)**  
   Return the exponential of x.
   Return the exponential of x.
 
 
-- math.expm1(x)  
+### **math.expm1(x)**  
   Return exp(x) - 1.
   Return exp(x) - 1.
 
 
-- math.fabs(x)  
+### **math.fabs(x)**  
   Return the absolute value of x.
   Return the absolute value of x.
 
 
-- math.floor(x)  
+### **math.floor(x)**  
   Return an integer, being x rounded towards negative infinity.
   Return an integer, being x rounded towards negative infinity.
 
 
-- math.fmod(x, y)  
+### **math.fmod(x, y)**  
   Return the remainder of x/y.
   Return the remainder of x/y.
 
 
-- math.frexp(x)  
+### **math.frexp(x)**  
   Decomposes a floating-point number into its mantissa and exponent. The returned value is the tuple (m, e) such that x == m * 2**e exactly. If x == 0 then the function returns (0.0, 0), otherwise the relation 0.5 <= abs(m) < 1 holds.
   Decomposes a floating-point number into its mantissa and exponent. The returned value is the tuple (m, e) such that x == m * 2**e exactly. If x == 0 then the function returns (0.0, 0), otherwise the relation 0.5 <= abs(m) < 1 holds.
 
 
-- math.gamma(x)  
+### **math.gamma(x)**  
   Return the gamma function of x.
   Return the gamma function of x.
 
 
-- math.isfinite(x)  
+### **math.isfinite(x)**  
   Return True if x is finite.
   Return True if x is finite.
 
 
-- math.isinf(x)  
+### **math.isinf(x)**  
   Return True if x is infinite.
   Return True if x is infinite.
 
 
-- math.isnan(x)  
+### **math.isnan(x)**  
   Return True if x is not-a-number
   Return True if x is not-a-number
 
 
-- math.ldexp(x, exp)  
+### **math.ldexp(x, exp)**  
   Return x * (2**exp).
   Return x * (2**exp).
 
 
-- math.lgamma(x)  
+### **math.lgamma(x)**  
   Return the natural logarithm of the gamma function of x.
   Return the natural logarithm of the gamma function of x.
 
 
-- math.log(x)  
+### **math.log(x)**  
   Return the natural logarithm of x.
   Return the natural logarithm of x.
 
 
-- math.log10(x)  
+### **math.log10(x)**  
   Return the base-10 logarithm of x.
   Return the base-10 logarithm of x.
 
 
-- math.log2(x)  
+### **math.log2(x)**  
   Return the base-2 logarithm of x.
   Return the base-2 logarithm of x.
 
 
-- math.modf(x)  
+### **math.modf(x)**  
   Return a tuple of two floats, being the fractional and integral parts of x. Both return values have the same sign as x.
   Return a tuple of two floats, being the fractional and integral parts of x. Both return values have the same sign as x.
 
 
-- math.pow(x, y)  
+### **math.pow(x, y)**  
   Returns x to the power of y.
   Returns x to the power of y.
 
 
-- math.radians(x)  
+### **math.radians(x)**  
   Return degrees x converted to radians.
   Return degrees x converted to radians.
 
 
-- math.sin(x)  
+### **math.sin(x)**  
   Return the sine of x.
   Return the sine of x.
 
 
-- math.sinh(x)  
+### **math.sinh(x)**  
   Return the hyperbolic sine of x.
   Return the hyperbolic sine of x.
 
 
-- math.sqrt(x)  
+### **math.sqrt(x)**  
   Return the square root of x.
   Return the square root of x.
 
 
-- math.tan(x)  
+### **math.tan(x)**  
   Return the tangent of x.
   Return the tangent of x.
 
 
-- math.tanh(x)  
+### **math.tanh(x)**  
   Return the hyperbolic tangent of x.
   Return the hyperbolic tangent of x.
 
 
-- math.trunc(x)  
+### **math.trunc(x)**  
   返回一个整数, x 接近于0。
   返回一个整数, x 接近于0。
 
 
 ## 常数
 ## 常数
 
 
-- math.e  
+### **math.e**  
   自然对数的底
   自然对数的底
 
 
-- math.pi  
+### **math.pi**  
   圆周率
   圆周率
-  
+
 更多内容可参考  [math](https://docs.python.org/3.5/library/math.html?highlight=math#module-math) 。
 更多内容可参考  [math](https://docs.python.org/3.5/library/math.html?highlight=math#module-math) 。
 
 
 ----------
 ----------

+ 8 - 8
docs/Development_manual_document_section/03-Basic_Module/05-uio.md

@@ -5,25 +5,25 @@
 
 
 ## 函数
 ## 函数
 
 
-- uio.open(name, mode='r', **kwargs)  
+### **uio.open**(name, mode='r', **kwargs)  
   打开一个文件,关联到内建函数``open()``。所有端口 (用于访问文件系统) 需要支持模式参数,但支持其他参数不同的端口。
   打开一个文件,关联到内建函数``open()``。所有端口 (用于访问文件系统) 需要支持模式参数,但支持其他参数不同的端口。
 
 
 ## 类
 ## 类
 
 
-- class uio.FileIO(...)  
+### **class uio.FileIO**(...)  
   这个文件类型用二进制方式打开文件,等于使用``open(name, “rb”)``。 不应直接使用这个实例。
   这个文件类型用二进制方式打开文件,等于使用``open(name, “rb”)``。 不应直接使用这个实例。
 
 
-- class uio.TextIOWrapper(...)  
+### **class uio.TextIOWrapper**(...)  
   这个类型以文本方式打开文件,等同于使用``open(name, “rt”)``不应直接使用这个实例。
   这个类型以文本方式打开文件,等同于使用``open(name, “rt”)``不应直接使用这个实例。
 
 
-- class uio.StringIO([string])  
+### **class uio.StringIO**([string])  
 
 
-- class uio.BytesIO([string])  
-  内存文件对象。StringIO 用于文本模式 I/O (用 “t” 打开文件),BytesIO 用于二进制方式 (用 “b” 方式)。文件对象的初始内容可以用字符串参数指定(stringio用普通字符串,bytesio用byets对象)。所有的文件方法,如 read(), write(), seek(), flush(), close() 都可以用在这些对象上,包括下面方法:
+### **class uio.BytesIO**([string])  
+  内存文件对象。`StringIO` 用于文本模式 I/O (用 “t” 打开文件),`BytesIO` 用于二进制方式 (用 “b” 方式)。文件对象的初始内容可以用字符串参数指定(`stringio`用普通字符串,`bytesio``bytes`对象)。所有的文件方法,如 `read(), write(), seek(), flush(), close()` 都可以用在这些对象上,包括下面方法:
 
 
-- getvalue()  
+### **getvalue**()  
   获取缓存区内容。
   获取缓存区内容。
-  
+
 更多内容可参考  [uio](http://docs.micropython.org/en/latest/pyboard/library/uio.html) 。
 更多内容可参考  [uio](http://docs.micropython.org/en/latest/pyboard/library/uio.html) 。
 
 
 ----------
 ----------

+ 3 - 4
docs/Development_manual_document_section/03-Basic_Module/06-ucollections.md

@@ -5,8 +5,8 @@
 
 
 ## 类
 ## 类
 
 
-- ucollections.namedtuple(name, fields)  
-  这是工厂函数创建一个新的 namedtuple 型与一个特定的字段名称和集合。namedtuple 是元组允许子类要访问它的字段不仅是数字索引,而且还具有属性使用符号字段名访问语法。 字段是字符串序列指定字段名称。为了兼容的实现也可以用空间分隔的字符串命名的字段(但效率较低) 使用示例:
+### **ucollections.namedtuple**(name, fields)  
+这是工厂函数创建一个新的 `namedtuple` 型与一个特定的字段名称和集合。`namedtuple` 是元组允许子类要访问它的字段不仅是数字索引,而且还具有属性使用符号字段名访问语法。 字段是字符串序列指定字段名称。为了兼容的实现也可以用空间分隔的字符串命名的字段(但效率较低) 使用示例:
 
 
 ```python
 ```python
 from ucollections import namedtuple
 from ucollections import namedtuple
@@ -20,7 +20,7 @@ ucollections.OrderedDict(...)
 
 
 ```
 ```
 
 
-dict 类型的子类,记住并保留键的追加顺序。keys/items返回的顺序被加入:
+dict 类型的子类,记住并保留键的追加顺序。keys/items 返回的顺序被加入:
 
 
 ```python
 ```python
 from ucollections import OrderedDict
 from ucollections import OrderedDict
@@ -33,7 +33,6 @@ d["w"] = 5
 d["b"] = 3
 d["b"] = 3
 for k, v in d.items():
 for k, v in d.items():
     print(k, v)
     print(k, v)
-    
 ```
 ```
 输出:
 输出:
 
 

+ 6 - 6
docs/Development_manual_document_section/03-Basic_Module/07-ustruct.md

@@ -8,21 +8,21 @@
 
 
 ## 函数
 ## 函数
 
 
-- ustruct.calcsize(fmt)  
+### **ustruct.calcsize**(fmt)  
   返回需要的字节数`fmt`。
   返回需要的字节数`fmt`。
 
 
-- ustruct.pack(fmt, v1, v2, ...)  
+### **ustruct.pack**(fmt, v1, v2, ...)  
   按照字符串格式`fmt` 压缩参数 v1, v2, ... 。 返回值是参数编码后的字节对象。
   按照字符串格式`fmt` 压缩参数 v1, v2, ... 。 返回值是参数编码后的字节对象。
 
 
-- ustruct.pack_into(fmt, buffer, offset, v1, v2, ...)  
+### **ustruct.pack_into**(fmt, buffer, offset, v1, v2, ...)  
   按照字符串格式`fmt` 压缩参数 v1, v2, ... 到缓冲区`buffer`,开始位置是`offset`。`offset`可以是负数,从缓冲区末尾开始计数。
   按照字符串格式`fmt` 压缩参数 v1, v2, ... 到缓冲区`buffer`,开始位置是`offset`。`offset`可以是负数,从缓冲区末尾开始计数。
 
 
-- ustruct.unpack(fmt, data)  
+### **ustruct.unpack**(fmt, data)  
   按照字符串格式`fmt`解压数据`data`。 返回值是解压后参数的元组。
   按照字符串格式`fmt`解压数据`data`。 返回值是解压后参数的元组。
 
 
-- ustruct.unpack_from(fmt, data, offset=0)  
+### **ustruct.unpack_from**(fmt, data, offset=0)  
   从 fmt 的 offset 开始解压数据,如果 offset 是负数就是从缓冲区末尾开始计算。 返回值是解压后参数元组。
   从 fmt 的 offset 开始解压数据,如果 offset 是负数就是从缓冲区末尾开始计算。 返回值是解压后参数元组。
-  
+
 更多的内容可参考  [struct](https://docs.python.org/3/library/struct.html) 。
 更多的内容可参考  [struct](https://docs.python.org/3/library/struct.html) 。
 
 
 ----------
 ----------

+ 4 - 4
docs/Development_manual_document_section/03-Basic_Module/08-array.md

@@ -7,15 +7,15 @@
 
 
 ## 类
 ## 类
 
 
-- class array.array(typecode[, iterable])  
+### **class array.array**(typecode[, iterable])  
   指定类型创建数组元素。用可选项[]做为数组的初始值,可选项[]未指定的,则创建空数组。
   指定类型创建数组元素。用可选项[]做为数组的初始值,可选项[]未指定的,则创建空数组。
 
 
-- append(val)  
+### **append**(val)  
   将新元素添加到数组的结尾,并将其扩展。
   将新元素添加到数组的结尾,并将其扩展。
 
 
-- extend(iterable)  
+### **extend**(iterable)  
   使用迭代方式将新元素添加到数组的结尾,并将其扩展。
   使用迭代方式将新元素添加到数组的结尾,并将其扩展。
-  
+
 更多内容可参考  [array](https://docs.python.org/3/library/array.html) 。
 更多内容可参考  [array](https://docs.python.org/3/library/array.html) 。
 
 
 ----------
 ----------

+ 7 - 7
docs/Development_manual_document_section/03-Basic_Module/09-gc.md

@@ -5,21 +5,21 @@
 
 
 ## 函数
 ## 函数
 
 
-- gc.enable()  
+### **gc.enable**()  
   启动自动垃圾回收。
   启动自动垃圾回收。
 
 
-- gc.disable()  
+### **gc.disable**()  
   禁用自动垃圾回收。 堆内存仍然可以分配,垃圾回收仍然可以手动启动使用 gc.collect().
   禁用自动垃圾回收。 堆内存仍然可以分配,垃圾回收仍然可以手动启动使用 gc.collect().
 
 
-- gc.collect()  
+### **gc.collect**()  
   运行垃圾回收。
   运行垃圾回收。
 
 
-- gc.mem_alloc()  
-  返回分配的堆RAM的字节数。
+### **gc.mem_alloc**()  
+  返回分配的堆 RAM 的字节数。
 
 
-- gc.mem_free()  
+### **gc.mem_free**()  
   返回可用堆内存的字节数。
   返回可用堆内存的字节数。
-  
+
 更多内容可参考  [gc](https://docs.python.org/3.5/library/gc.html#module-gc) 。
 更多内容可参考  [gc](https://docs.python.org/3.5/library/gc.html#module-gc) 。
 
 
 ----------
 ----------

+ 0 - 18
docs/Development_manual_document_section/03-MicroPython_libraries.md

@@ -14,24 +14,6 @@ MicroPython 的模块(函数和类库)有以下几类 :
 - 扩展模块:实现 micropython 的 Python 标准库。
 - 扩展模块:实现 micropython 的 Python 标准库。
 - 硬件驱动模块: 特定端口或者硬件驱动的模块,因此不可移植。
 - 硬件驱动模块: 特定端口或者硬件驱动的模块,因此不可移植。
 
 
-Note about the availability of modules and their contents: This documentation
-in general aspires to describe all modules and functions/classes which are
-implemented in MicroPython. However, MicroPython is highly configurable, and
-each port to a particular board/embedded system makes available only a subset
-of MicroPython libraries. For officially supported ports, there is an effort
-to either filter out non-applicable items, or mark individual descriptions
-with "Availability:" clauses describing which ports provide a given feature.
-With that in mind, please still be warned that some functions/classes
-in a module (or even the entire module) described in this documentation may be
-unavailable in a particular build of MicroPython on a particular board. The
-best place to find general information of the availability/non-availability
-of a particular feature is the "General Information" section which contains
-information pertaining to a specific port.
-
-Beyond the built-in libraries described in this documentation, many more
-modules from the Python standard library, as well as further MicroPython
-extensions to it, can be found in the [micropython-lib repository](https://github.com/micropython/micropython-lib).
-
 ## 2. Python 标准库和微型库
 ## 2. Python 标准库和微型库
 
 
 标准的 Python 库被 “微型化”后,就是 micropython 标准库。它们仅仅提供了该模块的核心功能。一些模块没有直接使用标准的 Python 的名字,而是冠以"u",例如``ujson``代替``json``。也就是说 micropython 标准库(=微型库),只实现了一部分模块功能。通过他们的名字不同,用户有选择的去写一个 Python 级模块扩展功能,也是为实现更好的兼容性。
 标准的 Python 库被 “微型化”后,就是 micropython 标准库。它们仅仅提供了该模块的核心功能。一些模块没有直接使用标准的 Python 的名字,而是冠以"u",例如``ujson``代替``json``。也就是说 micropython 标准库(=微型库),只实现了一部分模块功能。通过他们的名字不同,用户有选择的去写一个 Python 级模块扩展功能,也是为实现更好的兼容性。

+ 22 - 2
docs/Development_manual_document_section/README.md

@@ -1,6 +1,26 @@
-# RT-Thread Micropython 开发手册 #
+# RT-Thread Micropython 开发手册介绍
 
 
 ----------
 ----------
 
 
 !!! abstract "摘要"
 !!! abstract "摘要"
-     本手册介绍了 RT-Thread Micropython 的基础知识、常用模块,以及开发新模块的流程。带领读者了解 Micropython ,并学会使用 Micropython 进行开发。
+     本手册介绍了 RT-Thread Micropython 的基础知识、常用模块,以及开发新模块的流程。带领读者了解 Micropython ,并学会使用 Micropython 进行开发。
+     
+## 1.1 主要特性
+
+- 1、MicroPython 是 Python 3 编程语言的一种精简而高效的实现,它包含 Python 标准库的一个子集,并被优化为在微控制器和受限环境中运行。
+
+- 2、RT-Thread MicroPython 可以运行在任何搭载了 RT-Thread 操作系统并且有一定资源的嵌入式平台上。
+
+- 3、MicroPython 可以运行在有一定资源的开发板上,给你一个低层次的 Python 操作系统,可以用来控制各种电子系统。
+
+- 4、MicroPython 富有各种高级特性,比如交互式提示、任意精度整数、闭包函数、列表解析、生成器、异常处理等等。
+
+- 5、MicroPython 的目标是尽可能与普通 Python 兼容,使开发者能够轻松地将代码从桌面端转移到微控制器或嵌入式系统。
+
+## 1.2 MicroPython 的优势
+
+- 1、Python 是一款容易上手的脚本语言,同时具有强大的功能,语法优雅简单。使用 MicroPython 编程可以降低嵌入式的开发门槛,让更多的人体验嵌入式的乐趣。
+
+- 2、通过 MicroPython 实现硬件底层的访问和控制,不需要了解底层寄存器、数据手册、厂家的库函数等,即可轻松控制硬件。
+
+- 3、大部分外设和常用功能都有自己的库,降低开发难度,使开发和移植变得容易和快速。