diff --git a/docs/en/module/grbl13.2.md b/docs/en/module/grbl13.2.md
index 8bb5b42c..61e7bd8a 100644
--- a/docs/en/module/grbl13.2.md
+++ b/docs/en/module/grbl13.2.md
@@ -22,7 +22,7 @@ The power input interface is DC/9-24V, the motor drive current can reach 1.5A, a
## Include
--GRBL 13.2 Module
+- 1x GRBL 13.2 Module
## Applications
diff --git a/docs/en/unit/dds.md b/docs/en/unit/dds.md
new file mode 100644
index 00000000..a0b6d7f3
--- /dev/null
+++ b/docs/en/unit/dds.md
@@ -0,0 +1,149 @@
+# DDS
+
+SKU:U105
+
+


div>
+
+## Description
+
+**DDS** is a signal source Unit. It uses the AD9833 programmable waveform generator + STM32F0 micro controller. Based on I2C communication interface (addr:0x31) It can easily control the signal source to output multiple waveforms (sine wave, triangle wave, square wave output, sawtooth wave, signal output amplitude 0-0.6V) and adjust the frequency and phase.
+
+It supports deep sleep mode, which can reduce the power consumption in the idle state. The Unit is suitable for the electronic circuit prototype design of various test instruments as a signal source.
+
+## Product Features
+
+- Digital programmable frequency and phase
+- Signal output amplitude 0-0.6V
+- Sine wave/Triangle wave/Square wave/Sawtooth wave (fixed frequency: 13.6KHz)/DC output
+
+## Includes
+
+- 1x DDS Unit
+- 1x HY2.0-4P cable
+- 1x SMA-2.54mm cable
+
+## Application
+
+- Frequency stimulation/waveform generation
+- Liquid flow and airflow measurement
+- Sensor applications: proximity, motion and defect detection
+- Line loss/attenuation
+- Testing and medical equipment
+- Scan/clock generator
+- Time domain reflectometry (TDR) application
+
+## Specification
+
+
+
+ | Specifications |
+ Parameters |
+
+
+ | Support waveform |
+ Sine wave/Triangle wave/Square wave/Sawtooth wave (fixed frequency: 13.6KHz)/DC output |
+
+
+ | Signal output amplitude |
+ 0-0.6V |
+
+
+ | Net weight |
+ 7g |
+
+
+ | Gross weight |
+ 19g |
+
+
+ | Product size |
+ 48*24*8mm |
+
+
+ | Package size |
+ 67*53*12mm |
+
+
+
+## Related Links
+
+- **[AD9833](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/unit/dds/ad9833.pdf)**
+
+## EasyLoader
+
+
+## Example
+
+### Arduino IDE
+
+- [Arduino example program](https://github.com/m5stack/M5Stack/blob/master/examples/Unit/DDS_AD9833/DDS_AD9833.ino)
+
+
+## Schematic
+
+

+
+## Pin mapping
+
+
+ | M5Core | SCL | SDA | 5V | GND |
+ | DDS Unit | GPIO22 | GPIO21 | 5V | GND |
+
+
+## I2C register
+
+- I2C Address: **0x31**
+
+>When writing a register, the highest bit must be set to 1. The mclk is set to "1" by default, it will keep the last output signal magnitude. Once the DAC is set to 1, it stops the Unit output.
+
+```
+/*------------------------------------------------ -------------------------------------------------- */
+// | DDS CTRL REG | 0x20
+// | ----------------------------------------------- -------------------------------------------------
+// | dds_ctrl_reg[0] | R/W | System control
+// | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
+// | W | R | R | R | R | MODE |
+//
+// | -MODE: 000 Reserved
+// | 001 SINUS
+// | 010 TRIANGLE
+// | 011 SQUARE
+// | 100 SAWTOOTH
+// | 101 DC
+//
+// | dds_ctrl_reg[1] | R/W | System control
+// | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
+// | W | FSELECT | PSELECT | S01 | S12 | RSET | R | R |
+//
+// | -FSELECT: 0 Used FREQ0
+// 1 Used FREQ1
+// | -PSELECT: 0 Used PHASE0
+// 1 Used PHASE1
+// | -SLEEP01: 1 Disenable mclk
+// | -SLEEP12: 1 Disenable DAC
+/*------------------------------------------------ -------------------------------------------------- -
+
+/*------------------------------------------------ -------------------------------------------------- */
+// | DDS FREQ PHASE REG | 0x30
+// | ----------------------------------------------- -------------------------------------------------
+ // | dds_freq_phase_reg[0:3] | R/W | FREQ(28bit)
+ // | 31 | 30 | 29:28 | 27:0 |
+ // | W | N | R | freq reg 0 |
+ //
+ // | dds_freq_phase_reg[4:5] | R/W | PHASE(12bit)
+ // | 15 | 14 | 13:12 | 11:0 |
+ // | W | N | R | phase reg 1 |
+//
+/*------------------------------------------------ -------------------------------------------------- -*/
+
+
+```
+
+
diff --git a/docs/en/unit/envII.md b/docs/en/unit/envII.md
index 418aa3e7..8935ad6f 100644
--- a/docs/en/unit/envII.md
+++ b/docs/en/unit/envII.md
@@ -6,7 +6,7 @@
## Description
-**ENV II** is an environmental sensor which can sense temperature, humidity and atmospheric pressure. It integrates the SHT30 and BMP280 sensors and is programmed over the I2C protocol.
+**ENV II** is an environmental sensor which can sense temperature, humidity and atmospheric pressure. It integrates the SHT30 and BMP280 sensors and is programmed over the I2C protocol(SHT30:0x44, BMP280:0x76).
SHT30 is a digital temperature and humidity sensor with high precision and low power consumption.
diff --git a/docs/en/unit/imu.md b/docs/en/unit/imu.md
index 03d6fd55..92d72402 100644
--- a/docs/en/unit/imu.md
+++ b/docs/en/unit/imu.md
@@ -6,7 +6,7 @@
## Description
-**6-Axis IMU Unit** is a 6-axis attitude sensor with 3-axis gravity accelerometer and 3-axis gyroscope, which can calculate tilt angle and acceleration in real time. The chip adopts mpu6886, has 16 bit ADC, built-in programmable digital filter and on-chip temperature sensor, adopts I2C interface to communicate with host computer, and supports low-power mode.
+**6-Axis IMU Unit** is a 6-axis attitude sensor with 3-axis gravity accelerometer and 3-axis gyroscope, which can calculate tilt angle and acceleration in real time. The chip adopts mpu6886, has 16 bit ADC, built-in programmable digital filter and on-chip temperature sensor, adopts I2C interface (addr:0x68) to communicate with host computer, and supports low-power mode.
## Product Features
@@ -35,6 +35,10 @@
Resources |
Parameter |
+
+ | I2C Interface |
+ addr:0x68 |
+
| Accelerometer range |
±2g, ±4g, ±8g, or ±16g |
diff --git a/docs/en/unit/laser-tx.md b/docs/en/unit/laser-tx.md
index a6e9694d..8d87234a 100644
--- a/docs/en/unit/laser-tx.md
+++ b/docs/en/unit/laser-tx.md
@@ -6,7 +6,7 @@
## Description
-***LASER.TXT*** is one of the communication devices among the M5Units family - a Laser emitter with adjustable focal length.
+***LASER.TX*** is one of the communication devices among the M5Units family - a Laser emitter with adjustable focal length.
It is mainly built with a laser diode Laser communications devices are wireless connections through the atmosphere. They work similarly to fiber-optic links, except the beam is transmitted through free space. While the transmitter and receiver must require line-of-sight conditions, they have the benefit of eliminating the need for broadcast rights and buried cables.
diff --git a/docs/en/unit/tvoc.md b/docs/en/unit/tvoc.md
index 7fe97695..2461bf62 100644
--- a/docs/en/unit/tvoc.md
+++ b/docs/en/unit/tvoc.md
@@ -17,7 +17,7 @@ If you need to obtain accurate results, you need to calibrate according to a kno
## Product Features
- TVOC/eCO2 concentration detection
-- I2C communication(0X58)
+- I2C communication(0x58)
- Outstanding long-term stability
- Humidity Compensation
- 2x LEGO™ Hole
@@ -58,7 +58,7 @@ If you need to obtain accurate results, you need to calibrate according to a kno
| Protocol |
- I2C: |
+ I2C:0x58 |
| Net Weight |
diff --git a/docs/zh_CN/api/tough/lcd.md b/docs/zh_CN/api/tough/lcd.md
new file mode 100644
index 00000000..31992aa5
--- /dev/null
+++ b/docs/zh_CN/api/tough/lcd.md
@@ -0,0 +1,9 @@
+# LCD
+
+>TOUGH正面集成一块2英寸的彩色LCD显示屏,在M5Tough库中,我们提供了一系列的API能够用于图案绘制与文本显示,详情如下。
+
+## M5Display类
+
+>在`M5.begin()`初始化中,已经创建了实例`lcd`并进行了初始化. 你可以用该实例中的API进行图案绘制与文本显示。
+
+
diff --git a/docs/zh_CN/api/tough/system_api.md b/docs/zh_CN/api/tough/system_api.md
index 149444c5..f4fb3e69 100644
--- a/docs/zh_CN/api/tough/system_api.md
+++ b/docs/zh_CN/api/tough/system_api.md
@@ -29,17 +29,21 @@ void setup() {
**功能:播放Midi文件**
-**例程:**
+**函数原型:**
-```arduino
+`size_t playRAW( const uint8_t* __audioPtr, size_t __size, bool __modal = false, bool freeFlag = true,TickType_t __ticksToWait = portMAX_DELAY );`
-if( M5.BtnL.wasPressed())
-{
- Serial.printf("BtnL wasPressed!");
-}
-M5.update();
+**功能:播放PCM数据**
-```
+**函数原型:**
+
+`size_t playBeep( int __freq = 2000, int __timems = 1000,int __maxval = 10000, bool __modal = false );`
+
+**功能:播放指定频率声音**
+
+ modal 是否异步
+ freeFlag 是否释放内存
+ __ticksToWait 允许阻塞播放最大时长
## update()
diff --git a/docs/zh_CN/api/tough/touch.md b/docs/zh_CN/api/tough/touch.md
index b30dcdf7..dec3d997 100644
--- a/docs/zh_CN/api/tough/touch.md
+++ b/docs/zh_CN/api/tough/touch.md
@@ -1,6 +1,6 @@
# TOUCH
->TOUGH正面提供了一块2英寸的电阻式触摸屏,驱动芯片为NS2009,在M5Tough库中,我们提供了一系列的API能够用于触摸交互检测,详情如下。
+>TOUGH正面集成一块2英寸的电阻式触摸屏,驱动芯片为NS2009,在M5Tough库中,我们提供了一系列的API能够用于触摸交互检测,详情如下。
## Touch类
diff --git a/docs/zh_CN/core/tough.md b/docs/zh_CN/core/tough.md
index 9a8dac0c..0e7fac15 100644
--- a/docs/zh_CN/core/tough.md
+++ b/docs/zh_CN/core/tough.md
@@ -2,11 +2,11 @@
SKU:K010
-
+
## 描述
-**TOUGH** 是M5Stack开发套件系列中面向工业场景的嵌入式主控。主控ESP32型号为D0WDQ6-V3,具有两个可以单独控制的 Xtensa® 32-bit LX6 处理器,主频高达240Mhz,支持WiFi与蓝牙功能,板载16MB Flash与8MB PSRAM,可通过TYPE-C接口下载程序,强劲的配置满足复杂应用的资源开销。正面搭载一块2.0寸一体化电阻式触摸屏。内建的RTC模块可提供精准计时功能。电源部分搭载AXP192电源管理芯片。同时机身内配备了TF-card(microSD)卡槽与扬声器,采用I2S数字音频接口的功放芯片,能有效防止音频信号失真。
+**TOUGH** 是M5Stack开发套件系列中面向工业场景的嵌入式主控。主控ESP32型号为D0WDQ6-V3,具有两个可以单独控制的 Xtensa® 32-bit LX6 处理器,主频高达240Mhz,支持WiFi与蓝牙功能,板载16MB Flash与8MB PSRAM,可通过TYPE-C接口下载程序,强劲的配置满足复杂应用的资源开销。正面搭载一块2.0寸电阻式触摸屏。内建的RTC模块可提供精准计时功能。电源部分搭载AXP192电源管理芯片。同时机身内配备了TF-card(microSD)卡槽与扬声器,采用I2S数字音频接口的功放芯片,能有效防止音频信号失真。
## 产品特性
@@ -109,7 +109,7 @@
| 产品尺寸 |
- 54 x 54 x 16mm |
+ 76*58*41.6mm |
| 包装尺寸 |
@@ -263,10 +263,11 @@ TF 卡最大支持 16GB
- [BM8563](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/BM8563_V1.1_cn.pdf)
- [SY7088](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/SY7088-Silergy.pdf)
- [AXP192](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/AXP192_datasheet_en.pdf)
+ - [NS2009](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/tough/NS2009_C219024.pdf)
- **API**
- - [Arduino API](zh_CN/arduino/arduino_home_page?id=m5core2_api)
+ - [Arduino API](zh_CN/arduino/arduino_home_page?id=tough_api)
## 原理图
diff --git a/docs/zh_CN/module/grbl13.2.md b/docs/zh_CN/module/grbl13.2.md
index 0594249a..7d514c07 100644
--- a/docs/zh_CN/module/grbl13.2.md
+++ b/docs/zh_CN/module/grbl13.2.md
@@ -18,7 +18,7 @@
## 包含
-- GRBL 13.2 Module
+- 1x GRBL 13.2 Module
## 应用
diff --git a/docs/zh_CN/uiflow/event.md b/docs/zh_CN/uiflow/event.md
new file mode 100644
index 00000000..e26ca012
--- /dev/null
+++ b/docs/zh_CN/uiflow/event.md
@@ -0,0 +1,166 @@
+
+
+
+ 目录
+
+
+
+ 无限循环
+ 按键
+ 定时器
+
+
+
+## Loop
+
+#### 无限循环
+
+>无限循环执行包含在Loop内的程序
+
+>
+
+#### 使用变量
+
+>例如:无限循环点灯与熄灭
+
+>
+
+## Button
+
+#### 功能说明
+
+>按键状态的监听,配置按键回调函数
+
+>
+
+* __常量__
+监听按键状态,并绑定回调函数
+
+* __常用运算__
+监听按键状态
+
+* __求余__
+在式子两边添加数据,进行求余
+
+* __特殊数判断__
+添加一个数值,设定判断是否为成立(例如判断是否为奇数或偶数或质数),符合时为True,否则为False
+
+
+#### 使用方法
+
+>在运算式子两边添加数据,将运算式子赋给一个变量或其他对象,获取结果
+
+>
+
+## Timer
+
+#### 功能说明
+
+>设置定时器,并指定相应回调函数定时执行。
+
+>
+
+* __random fraction__
+每当执行一次,在0到1之间随机生成一个数字
+
+* __random integer__
+指定一个随机范围,每当执行一次,在范围内随机生成一个整数
+
+#### 使用方法
+
+>用常量设定随机范围,将random intger赋值给一个变量
+
+>
+
+
+## map
+
+#### 功能说明
+
+>字典是一种可变容器,可以存储任意类型的变量.
+
+>
+
+* __creat map__
+建立键值对
+
+* __map clear__
+清空字典
+
+* __map contain key__
+返回是否存在键
+
+* __get key in map__
+返回键的值
+
+* __in map add key value__
+在字典中添加键值对
+
+* __in map set key value__
+在字典中设置键值对
+
+* __in map delete key__
+删除指定的键
+
+#### 使用方法
+
+>创建字典,添加键值对
+
+>
+
+## array
+
+#### 功能说明
+
+>如果说变量是一个容器,那么数组就是由很多个容器组成的一个集合体,我们可以对数组里的任何一个变量进行赋值,获取
+
+>
+* __length of__
+测量数组的长度(即数组中元素的个数)
+* __X is empty__
+判断一个数组是否为空,成立时式子为True,否则为False
+* __in list find__
+数组索引,索引正序或倒序的某个指定元素
+* __create empty list__
+添加一个数值,设定判断是否为成立(例如判断是否为奇数或偶数或质数),符合时为True,否则为False
+* __create list with__
+自定义一个数组
+* __in list get__
+获取数组某个索引元素值
+* __in list get sub-list from__
+从数组中截获元素作为新数组
+* __icreat list with item repeated times__
+建立一个数组,使用元素重复一定次数进行填充
+* __reverse__
+数组倒序排列
+* __in list set as__
+在数组中设置某个索引为指定值
+* __make list from text with delimiter__
+从文本建立数组,使用分隔符
+
+#### 使用方法
+
+>添加一个create list创建数组,添加一些元素到数组中,通过迭代或是其他方式调用
+
+>
+
+
+## JSON
+
+#### 功能说明
+
+>JSON 是一种轻量级数据交互格式,方便数据传输与阅读
+
+>
+
+* __dumps to json__
+将python对象编码为JSON格式
+
+* __loads json__
+将JSON字符串解码为python对象
+
+
+#### 使用方法
+>建立字典转成JSON格式
+
+>
\ No newline at end of file
diff --git a/docs/zh_CN/unit/dds.md b/docs/zh_CN/unit/dds.md
index 9b418db4..5658dfe6 100644
--- a/docs/zh_CN/unit/dds.md
+++ b/docs/zh_CN/unit/dds.md
@@ -1,36 +1,26 @@
# DDS
-SKU:U100
+SKU:U105
## 描述
-**DDS** 是一款信号源Unit.
-
-内部集成AD9833可编程波形发生器。
-
-集成STM32F0控制方案
-
-I2C通信方式
-
-能够产生正弦波、三角波、方波输出、锯齿波输出。
-
-能够非常方便的控制输出波形,与调整频率、相位
-
-支持休眠策略
-
+**DDS** 是一款信号源Unit. 采用AD9833可编程波形发生器+STM32F0控制方案。提供I2C通信接口(addr:0x31),实际使用时以配置寄存器的方式进行操作。能够非常方便的控制该信号源输出多种波形(正弦波、三角波、方波输出、锯齿波,信号输出幅值0-0.6V),与调整频率、相位。并且支持休眠策略,空闲状态时能够进一步减小电能损耗。该Unit适用于各种测试仪器的电子线路原型设计中充当信号源。
## 产品特性
- 数字可编程频率和相位
- 信号输出幅值0-0.6V
-- 正弦波/三角波/方波输出/锯齿波/DC输出
+- 正弦波/三角波/方波/锯齿波(固定频率:13.6KHz)/DC输出
+- 输出频率范围:0 MHz至12.5 MHz
+- 28位分辨率(25 MHz基准时钟时为0.1 Hz)
## 包含
- 1x DDS Unit
- 1x HY2.0-4P线缆
+- 1x SMA-2.54mm线缆
## 应用
@@ -49,6 +39,22 @@ I2C通信方式
规格 |
参数 |
+
+ | 支持波形 |
+ 正弦波/三角波/方波/锯齿波(固定频率:13.6KHz)/DC输出 |
+
+
+ | 信号输出幅值 |
+ 0-0.6V |
+
+
+ | 输出频率范围 |
+ 0 MHz至12.5 MHz |
+
+
+ | 分辨率 |
+ 28位(25 MHz基准时钟时为0.1 Hz) |
+
| 净重 |
7g |
@@ -96,6 +102,50 @@ I2C通信方式
- I2C Address: **0x31**
+>写寄存器时,需要将最高位置1。mclk置1将保持输出最后一个信号幅值,DAC置1将停止Unit输出。
+
+```
+/*--------------------------------------------------------------------------------------------------*/
+// | DDS CTRL REG | 0x20
+// | ------------------------------------------------------------------------------------------------
+// | dds_ctrl_reg[0] | R/W | System control
+// | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
+// | W | R | R | R | R | MODE |
+//
+// | -MODE: 000 Reserved
+// | 001 SINUS
+// | 010 TRIANGLE
+// | 011 SQUARE
+// | 100 SAWTOOTH
+// | 101 DC
+//
+// | dds_ctrl_reg[1] | R/W | System control
+// | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
+// | W | FSELECT | PSELECT | S01 | S12 | RSET | R | R |
+//
+// | -FSELECT: 0 Used FREQ0
+// 1 Used FREQ1
+// | -PSELECT: 0 Used PHASE0
+// 1 Used PHASE1
+// | -SLEEP01: 1 Disenable mclk
+// | -SLEEP12: 1 Disenable DAC
+/*----------------------------------------------------------------------------------------------------
+
+/*--------------------------------------------------------------------------------------------------*/
+// | DDS FREQ PHASE REG | 0x30
+// | ------------------------------------------------------------------------------------------------
+ // | dds_freq_phase_reg[0:3] | R/W | FREQ(28bit)
+ // | 31 | 30 | 29:28 | 27:0 |
+ // | W | N | R | freq reg 0 |
+ //
+ // | dds_freq_phase_reg[4:5] | R/W | PHASE(12bit)
+ // | 15 | 14 | 13:12 | 11:0 |
+ // | W | N | R | phase reg 1 |
+//
+/*---------------------------------------------------------------------------------------------------*/
+
+
+```