diff --git a/docs/assets/img/product_pics/unit/dds/dds_01.webp b/docs/assets/img/product_pics/unit/dds/dds_01.webp new file mode 100644 index 00000000..f641afd8 Binary files /dev/null and b/docs/assets/img/product_pics/unit/dds/dds_01.webp differ diff --git a/docs/assets/img/product_pics/unit/dds/dds_02.webp b/docs/assets/img/product_pics/unit/dds/dds_02.webp new file mode 100644 index 00000000..e4807216 Binary files /dev/null and b/docs/assets/img/product_pics/unit/dds/dds_02.webp differ diff --git a/docs/assets/img/product_pics/unit/dds/dds_sch.webp b/docs/assets/img/product_pics/unit/dds/dds_sch.webp new file mode 100644 index 00000000..f9d8dab3 Binary files /dev/null and b/docs/assets/img/product_pics/unit/dds/dds_sch.webp differ diff --git a/docs/en/api/tough/touch.md b/docs/en/api/tough/touch.md new file mode 100644 index 00000000..1b2ec45b --- /dev/null +++ b/docs/en/api/tough/touch.md @@ -0,0 +1,156 @@ +# TOUCH + +> TOUGH integrates a 2-inch resistive touch screen on the front side of the product with an internal NS2009 driver chip. In the M5Tough library, we provide a series of APIs that can be used for touch interaction detection. + +## Touch Class + +>In the initialization of `M5.begin()`, an instance of `touch` has been created and initialized. You can use the API in this instance to obtain touch interaction information. + + +- **Function: Initialize the touch screen, this function will be called by default in M5.begin to initialize the touch screen** + +- `void begin(bool EEPROMEnabled = true);` + +- **Function: Perform screen touch calibration (calibration data will be saved to EEPROM), return to True if it has been calibrated, otherwise enter the calibration page, the user needs to touch the specified location according to the screen prompts** + +- `bool calibrationTouch(TFT_eSPI *fb);` + +**Routine:** + +``` +#include + +void setup() +{ + M5.begin(true, true, true, true); + while (!M5.touch.calibrationTouch(&M5.Lcd)); + M5.Lcd.fillScreen(TFT_BLACK); + M5.Lcd.print("Calibration Successfully"); +} + +void loop() +{ + +} + +``` + +- **Function: Read touch data** +- `void read();` + +- **Function: Read the X coordinate of the touch finger** +- `int GetTouchX();` + +- **Function: Read Y coordinate of touch finger** +- `int GetTouchY();` + +- **Function: Detect touch finger pressing** +- `bool isPressed();` + +- **Function: Detection of touch finger release** +- `bool isRelease();` + +- **Function: Detect the movement of the touch finger** +- `bool isMoving();` + +- **Function: Wait for the touch finger to release** +- `bool WaitRelease();` + +- **Function: Wait for the touch finger to be released and set the timeout period** +- `bool WaitRelease(uint64_t AutoReleseTime);` + +- **Function: Read the touch point information, return a TouchPoint structure, which contains X, Y coordinate information, and implement operator overloading internally, support direct assignment and comparison of TouchPoint type structures** +- `TouchPoint getPoint();` + +## TouchPoint + +>By calling the getPoint method, a TouchPoint structure type data can be obtained. Its internal members and methods are as follows. + +``` +class TouchPoint +{ +public: + TouchPoint(int16_t x_ = -1, int16_t y_ = -1); + bool operator==(const TouchPoint &p); + bool operator!=(const TouchPoint &p); + bool operator=(const TouchPoint &p); + + bool Equals(const TouchPoint &p); + + void set(int16_t x_ = -1, int16_t y_ = -1); + bool vaild(); + + int16_t x, y; +}; + +``` + +>Users can create a screen area by creating an instance of the TouchZone structure, using the built-in `contains` method to determine whether TouchPoint is contained in the area. + +## TouchZone + +``` +typedef struct TouchZone +{ + uint16_t x; + uint16_t y; + uint16_t w; + uint16_t h; + TouchZone(): x(-1), y(-1), w(0), h(0) {} + TouchZone(uint16_t _x, uint16_t _y, uint16_t _w, uint16_t _h): x(_x), y(_y), w(_w), h(_h)(); + bool contains(const TouchPoint &p) + { + if ((this->x == -1) || (this->y == -1) || (this->w == 0) || (this->h == 0)) + return false; + if ((p.x ​​>= this->x) && (p.x <= (this->x + this->w)) && + (p.y >= this->y) && (p.y <= (this->y + this->h))) + { + return true; + } + return false; + } +} TouchZone_t; + +``` + + +> When dynamically reading touch data, you need to add `void update();` to the loop to refresh the touch data. + + +**Routine:** + +```arduino +#include + +TouchZone clearBtn(0,0,50,50); + +void setup() +{ + M5.begin(true, true, true, true); + while (!M5.touch.calibrationTouch(&M5.Lcd)); + M5.lcd.drawString("CLEAR",5,5,3); +} + +void loop() +{ + M5.update(); + if(M5.touch.isPressed()){ + TouchPoint Point = M5.touch.getPoint(); + if(M5.touch.isMoving()){ + char buffer[24]; + sprintf(buffer, "X: %3d, Y: %3d", Point.x, Point.y); + M5.Lcd.drawPixel(Point.x, Point.y ,TFT_GREEN); + Serial.println(buffer); + } + if(clearBtn.contains(Point)){ + M5.lcd.fillScreen(TFT_BLACK); + M5.lcd.drawString("CLEAR",5,5,3); + } + } +} + + + +``` + +- For more information about Touch API, please refer to [M5Tough-Github source code](https://github.com/m5stack/M5Tough/tree/master/src) diff --git a/docs/en/arduino/arduino_home_page.md b/docs/en/arduino/arduino_home_page.md index 247d3757..d0bd41d4 100644 --- a/docs/en/arduino/arduino_home_page.md +++ b/docs/en/arduino/arduino_home_page.md @@ -103,6 +103,14 @@ const m5paper_api = { "id":"m5paper_api" }; +const tough_api = { + 'title':"M5Tough API", + 'item':{ + 'TOUCH':'#/en/api/tough/touch' + }, + "id":"tough_api" +}; + var arduino_home_page = new Vue({ el:'#arduino_home_page', data() { @@ -113,7 +121,8 @@ var arduino_home_page = new Vue({ m5stickc_api: m5stickc_api, m5core2_api: m5core2_api, coreink_api: coreink_api, - m5paper_api: m5paper_api + m5paper_api: m5paper_api, + tough_api: tough_api } }; } diff --git a/docs/en/core/tough.md b/docs/en/core/tough.md new file mode 100644 index 00000000..c69337a7 --- /dev/null +++ b/docs/en/core/tough.md @@ -0,0 +1,245 @@ +# TOUGH + + + + + +## Description + +**TOUGH** is the embedded master control for industrial scenarios in the M5Stack development kit series. The main control ESP32 model is D0WDQ6-V3, with two Xtensa® 32-bit LX6 processors that can be controlled separately, the main frequency is up to 240Mhz, supports WiFi and Bluetooth functions, onboard 16MB Flash and 8MB PSRAM, and can be through TYPE-C interface Download programs and powerful configuration to meet the resource overhead of complex applications. The front is equipped with a 2.0-inch resistive touch screen. The built-in RTC module can provide accurate timing function. The power supply part is equipped with AXP192 power management chip. At the same time, the fuselage is equipped with a TF-card (microSD) card slot and speakers, and a power amplifier chip with I2S digital audio interface can effectively prevent audio signal distortion. + +## Product Features + +- Based on ESP32 development board, support WiFi, Bluetooth +- 16M Flash, 8M PSRAM +- Built-in speaker, power indicator, RTC, I2S power amplifier, resistive touch screen, power button, reset button +- TF card slot (support up to 16GB) +- Development platform [UIFlow](http://flow.m5stack.com), [MicroPython](http://micropython.org/), [Arduino](http://www.arduino.cc) + +## contains + +- 1x M5Stack TOUGH +- 1x Type-C USB(20cm) + +## Application + +- Industrial Controller + +## Specifications + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Master control resourcesParameters
ESP32-D0WDQ6-V3240MHz dual core, 600 DMIPS, 520KB SRAM, Wi-Fi, dual mode Bluetooth
Flash16MB
PSRAM8MB
Input voltage5V @ 500mA
Host interfaceTypeC x 1, GROVE(I2C+I/0+UART) x 1
IPS LCD screen2.0"@320*240 ILI9342C
Resistive touch screen driver ICNS2009
Speaker1W-0928
I2S power amplifierNS4168
RTCBM8563
PMUAXP192
USB chipCP2104
DC-DC boostSY7088
TF card slotSupport up to 16G
Lithium battery interfaceMX1.25mm in-line 2P
Antenna2.4G 3D antenna
+ + +## EasyLoader + +>EasyLoader is a concise and fast program writer, which has a built-in case program related to the product. It can be burned to the main control by simple steps to perform a series of function verification. Please install the corresponding driver according to the device type. M5Core host [Please click here to view the CP210X driver installation tutorial](en/arduino/arduino_development) + +- **Windows** + - [FactoryTest](https://m5stack.oss-cn-shenzhen.aliyuncs.com/EasyLoader/Windows/CORE/EasyLoader_M5Tough_FactoryTest.exe) + +## Pin mapping + +**LCD screen & TF Card** + +LCD pixels: 320x240 +TF card supports up to 16GB + + + + + +
ESP32 ChipGPIO38GPIO23GPIO18GPIO5GPIO15
AXP192 Chip AXP_IO4AXP_LD03AXP_LDO2
ILI9342CMISOMOSISCKCSDCRSTBLPWR
+ + + + +
ESP32 ChipGPIO38GPIO23GPIO18GPIO4
TF CardMISOMOSISCKCS
+ +**Resistive touch screen** + + + + +
ESP32 chipGPIO21GPIO22GPIO39
Res.TOUCH/NS2009SDASCLPENIRQ
+ +**NS4168 power amplifier** + + + + +
ESP32 ChipGPIO12GPIO0GPIO2AXP_IO2
NS4168BCLKLRCKDATASPK_EN
+ +**RTC** + + + + + +
ESP32 ChipGPIO21GPIO22
AXP192AXP_PWRAXP_LDO1
BM8563SDASCLINTPWR
+ +**USB to serial download** + + + + +
ESP32 ChipGPIO1GPIO3
CP2104RXDTXD
+ +**Internal I2C connection** + + + + + + +
ESP32 ChipGPIO21GPIO22
AXP192SDASCL
BM8563SDASCL
NS2009SDASCL
+ +## TOUGH M-BUS schematic + + + +## M5Core2 port description + + + + + + + + + + + + + + +
PORTPINRemarks:
PORT-A (red)G32/33I2C
+ +## ESP32 ADC/DAC can map pin + + + + + + + + + + + + + + + + + + + + + + +
ADC1ADC2DAC1DAC2
8 channels10 channels2 channels2 channels
G32-39G0/2/4/12-15/25-27G25G26
+ + +For more information about pin assignments and pin remapping, please refer to [ESP32 datasheet](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/esp32_datasheet_en.pdf) + + +## Related Links + +- **Datasheet** + - [ESP32](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/esp32_datasheet_cn.pdf) + - [NS4168](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/NS4168_CN_datasheet.pdf) + - [ILI9342C](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/ILI9342C-ILITEK.pdf) + - [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=tough_api) + + +## Schematic + + + +## Example + +### Arduino IDE + +- [FactoryTest](https://github.com/m5stack/M5Tough/tree/master/examples/Basics/FactoryTest) +- [M5Tough-Lib](https://github.com/m5stack/M5Tough) + + \ No newline at end of file diff --git a/docs/en/unit/dds.md b/docs/en/unit/dds.md index de34494c..95e01a3d 100644 --- a/docs/en/unit/dds.md +++ b/docs/en/unit/dds.md @@ -2,7 +2,7 @@ SKU:U105 -
+
## Description @@ -86,6 +86,27 @@ It supports deep sleep mode, which can reduce the power consumption in the idle ## EasyLoader +>EasyLoader is a concise and fast program writer, which has a built-in case program related to the product. It can be burned to the main control by simple steps to perform a series of function verification. Please install the corresponding driver according to the device type. M5Core host [Please click here to view the CP210X driver installation tutorial](en/arduino/arduino_development) + +
+
+
+
+ Windows +
+
+
+ +
+ + +

Description:

+

Control DDS Unit Output Sine wave/Triangle wave/Square wave/Sawtooth wave.

+
+
+
## Example @@ -151,14 +172,14 @@ It supports deep sleep mode, which can reduce the power consumption in the idle // /*------------------------------------------------ -------------------------------------------------- -*/ - ``` + + \ No newline at end of file diff --git a/docs/zh_CN/api/tough/touch.md b/docs/zh_CN/api/tough/touch.md index dec3d997..4b1baa81 100644 --- a/docs/zh_CN/api/tough/touch.md +++ b/docs/zh_CN/api/tough/touch.md @@ -153,4 +153,4 @@ void loop() ``` -## 更多有关Touch API内容,请参考[M5Tough-Github]()源码 \ No newline at end of file +- 更多有关Touch API内容,请参考[M5Tough-Github源码](https://github.com/m5stack/M5Tough/tree/master/src) \ No newline at end of file diff --git a/docs/zh_CN/arduino/arduino_home_page.md b/docs/zh_CN/arduino/arduino_home_page.md index 40c33110..0741f05b 100644 --- a/docs/zh_CN/arduino/arduino_home_page.md +++ b/docs/zh_CN/arduino/arduino_home_page.md @@ -102,6 +102,13 @@ const m5paper_api = { "id":"m5paper_api" }; +const tough_api = { + 'title':"M5Tough API", + 'item':{ + 'TOUCH':'#/zh_CN/api/tough/touch' + }, + "id":"tough_api" +}; var arduino_home_page = new Vue({ el:'#arduino_home_page', @@ -113,7 +120,8 @@ var arduino_home_page = new Vue({ m5stickc_api: m5stickc_api, m5core2_api: m5core2_api, coreink_api: coreink_api, - m5paper_api: m5paper_api + m5paper_api: m5paper_api, + tough_api: tough_api } }; } diff --git a/docs/zh_CN/core/tough.md b/docs/zh_CN/core/tough.md index 0e7fac15..e1060ea8 100644 --- a/docs/zh_CN/core/tough.md +++ b/docs/zh_CN/core/tough.md @@ -1,8 +1,8 @@ # TOUGH -SKU:K010 + -
+ ## 描述 @@ -96,57 +96,15 @@ 天线 2.4G 3D天线 - - 工作温度 - 32°F to 104°F ( 0°C to 40°C ) - - - 净重 - 52g - - 毛重 - 70g - - - 产品尺寸 - 76*58*41.6mm - - - 包装尺寸 - 75 x 60 x 20mm - - - 外壳材质 - Plastic ( PC ) - ## EasyLoader ->EasyLoader是一个简洁快速的程序烧录器,其内置了一个产品相关的案例程序,通过简单步骤将其烧录至主控,即可进行一系列的功能验证.**(程序烧录前,请根据设备类型安装相应驱动程序. M5Core型主机[请点击此处查看CP210X驱动安装教程](zh_CN/arduino/arduino_development?id=安装串口驱动),M5StickC/V/T/ATOM系列可免驱动使用)** - -
-
-
-
- Windows - -
-
-
- -
- - -

案例描述:

-

该案例将执行喇叭,wifi,按键,加速计,TF-card(microSD),屏幕等硬件运行测试.

-
-
-
+>EasyLoader是一个简洁快速的程序烧录器,其内置了一个产品相关的案例程序,通过简单步骤将其烧录至主控,即可进行一系列的功能验证.**(程序烧录前,请根据设备类型安装相应驱动程序. M5Core型主机[请点击此处查看CP210X驱动安装教程](zh_CN/arduino/arduino_development?id=安装串口驱动)** +- **Windows** + - [FactoryTest](https://m5stack.oss-cn-shenzhen.aliyuncs.com/EasyLoader/Windows/CORE/EasyLoader_M5Tough_FactoryTest.exe) ## 管脚映射 @@ -157,7 +115,7 @@ TF 卡最大支持 16GB - +
ESP32 ChipGPIO38GPIO23GPIO18GPIO5GPIO15
AXP192 Chip AXP_IO4AXP_DC3AXP_LDO2
AXP192 Chip AXP_IO4AXP_LD03AXP_LDO2
ILI9342CMISOMOSISCKCSDCRSTBLPWR
@@ -176,7 +134,7 @@ TF 卡最大支持 16GB **NS4168功放** - +
ESP32 ChipGPIO12GPIO0GPIO2AXP_IO2GPIO34
ESP32 ChipGPIO12GPIO0GPIO2AXP_IO2
NS4168BCLKLRCKDATASPK_EN
@@ -184,8 +142,8 @@ TF 卡最大支持 16GB - - + +
ESP32 ChipGPIO21GPIO22
AXP192AXP_PWR
BM8563SDASCLINT
AXP192AXP_PWRAXP_LDO1
BM8563SDASCLINTPWR
**USB转串口下载** @@ -278,17 +236,11 @@ TF 卡最大支持 16GB ### Arduino IDE -- [FactoryTest](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Core/M5Core2/Arduino) -- [M5Tough-Lib](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Core/M5Core2/Arduino) +- [FactoryTest](https://github.com/m5stack/M5Tough/tree/master/examples/Basics/FactoryTest) +- [M5Tough-Lib](https://github.com/m5stack/M5Tough) \ No newline at end of file diff --git a/docs/zh_CN/unit/dds.md b/docs/zh_CN/unit/dds.md index 3d29021a..2525f389 100644 --- a/docs/zh_CN/unit/dds.md +++ b/docs/zh_CN/unit/dds.md @@ -78,12 +78,35 @@ + +## EasyLoader + +>EasyLoader是一个简洁快速的程序烧录器,其内置了一个产品相关的案例程序,通过简单步骤将其烧录至主控,即可进行一系列的功能验证.**(程序烧录前,请根据设备类型安装相应驱动程序. M5Core型主机[请点击此处查看CP210X驱动安装教程](zh_CN/arduino/arduino_development?id=安装串口驱动)** + +
+
+
+
+ Windows +
+
+
+ +
+ + +

案例描述:

+

控制DDS Unit输出正弦波/三角波/方波/锯齿波.

+
+
+
+ ## 相关链接 - **[AD9833](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/unit/dds/ad9833.pdf)** -## EasyLoader - ## 案例程序 @@ -154,7 +177,7 @@