Skip to content

Commit b1a4999

Browse files
committed
add code and README
0 parents  commit b1a4999

38 files changed

Lines changed: 6240 additions & 0 deletions

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 M5Stack
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
# CoreInk Library
2+
3+
English | [中文](README_cn.md)
4+
5+
<img src="http://docs.m5stack.com/assets/img/product_pics/core/coreink/coreink_01.webp" alt="CoreInk_Pic_01" width="350">
6+
7+
## Description
8+
9+
**CoreInk** is a brand new E-ink display in the M5Stack cores range. Controlled by the ESP32-PICO-D4 This new device includes a 200x200 1.54" Black and White E-Ink Display. Compared to a regular LCD,E-ink displays are easier on the eyes, which makes them a great choice for reading or viewing for longer periods. Other benefits are the low power consumption and the ability to retain the image even if power to the display is terminated。For control the CoreInk integrates an multi-function button,A physical button, integrated status LED and buzzer.The device also includes a 390mAh Lipo,RTC(BM8563)for controlling accurate timing and deep sleep funcionality. CoreInk features independent reset and power buttons,expansion ports(HY2.0-4P、M-BUS、HAT expansion)for attaching external sensors to expand functionailty,for unlimited possibilities。
10+
11+
?>Warning: Please avoid using high refresh rates,reccommended refresh rate is(15s/per refresh), Do not expose to ultraviolet rays for a long time, otherwise it may cause irreversible damage to the ink screen.
12+
13+
<img src="http://docs.m5stack.com/assets/img/product_pics/core/coreink/coreink_02.webp" alt="CoreInk_Pic_02" width="350">
14+
15+
## Pin Mapping
16+
17+
**E-Ink Display**
18+
19+
Screen Resolution:200x200
20+
21+
<table>
22+
<tr><td>ESP32 Chip</td><td>GPIO4</td><td>GPIO0</td><td>GPIO15</td><td>GPIO9</td><td>GPIO18</td><td>GPIO23</td></tr>
23+
<tr><td>GDEW0154M09</td><td>BUSY</td><td>RST</td><td>D/C</td><td>CS</td><td>SCK</td><td>MOSI</td></tr>
24+
</table>
25+
26+
**Multi-function button & Physical Button & LED & Buzzer**
27+
28+
<table>
29+
<tr><td>ESP32 Chip</td><td>GPIO37</td><td>GPIO38</td><td>GPIO39</td><td>GPIO5</td><td>GPIO10</td><td>GPIO2</td></tr>
30+
<tr><td>Multi-function button</td><td>Left position</td><td>Button press</td><td>Right position</td><td>/</td><td>/</td><td>/</td></tr>
31+
<tr><td>Physical Button</td><td>/</td><td>/</td><td>/</td><td>Physical Button</td><td>/</td><td>/</td></tr>
32+
<tr><td>LED</td><td>/</td><td>/</td><td>/</td><td>/</td><td>LED</td><td>/</td></tr>
33+
<tr><td>Buzzer</td><td>/</td><td>/</td><td>/</td><td>/</td><td>/</td><td>Buzzer</td></tr>
34+
</table>
35+
36+
**USB Serial**
37+
38+
<table>
39+
<tr><td>ESP32 Chip</td><td>GPIO1</td><td>GPIO3</td></tr>
40+
<tr><td>CP2104</td><td>RXD</td><td>TXD</td></tr>
41+
</table>
42+
43+
44+
**Internal I2C Connection**
45+
46+
<table>
47+
<tr><td>ESP32 Chip</td><td>GPIO21</td><td>GPIO22</td></tr>
48+
<tr><td>BM8563</td><td>SDA</td><td>SCL</td></tr>
49+
</table>
50+
51+
## Coreink M-BUS Schematic
52+
53+
<!-- <img class="pic" src="assets/img/product_pics/core/core2/core2_mbus.webp" width = "50%"> -->
54+
55+
## Coreink-HY2.0 4P Port
56+
57+
<table>
58+
<thead>
59+
<th>PORT</th>
60+
<th>PIN</th>
61+
<th>Protocol:</th>
62+
</thead>
63+
<tbody>
64+
<tr>
65+
<td>EXT-PORT</td>
66+
<td>G32/33</td>
67+
<td>I2C</td>
68+
</tr>
69+
</tbody>
70+
</table>
71+
72+
## ESP32 ADC/DAC Mappable Pins
73+
74+
<table>
75+
<thead>
76+
<th>ADC1</th>
77+
<th>ADC2</th>
78+
<th>DAC1</th>
79+
<th>DAC2</th>
80+
</thead>
81+
<tbody>
82+
<tr>
83+
<td>8 Channel</td>
84+
<td>10 Channel</td>
85+
<td>2 Channel</td>
86+
<td>2 Channel</td>
87+
</tr>
88+
<tr>
89+
<td>G32-39</td>
90+
<td>G0/2/4/12-15/25-27</td>
91+
<td>G25</td>
92+
<td>G26</td>
93+
</tr>
94+
</tbody>
95+
</table>
96+
97+
For more info on specific pin functions refer to the official ESP32 Docs[ESP32 datasheet](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/esp32_datasheet_en.pdf)
98+
99+
## Related Link
100+
101+
- **Datasheet**
102+
- [ESP32](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/esp32_datasheet_cn.pdf)
103+
- [BM8563](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/BM8563_V1.1_cn.pdf)
104+
- [SY7088](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/SY7088-Silergy.pdf)
105+
- [GDEW0154M09](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/CoreInk-K048-GDEW0154M09%20V2.0%20Specification.pdf)
106+
107+
- **API**
108+
109+
- [Arduino API](http://docs.m5stack.com/#/en/arduino/arduino_home_page)
110+
111+
## Tutorial&Quick-Start
112+
113+
<a href="http://docs.m5stack.com/#/en/quick_start/coreink/quick_start_arduino"><el-tag effect="plain">Arduino</el-tag></a>
114+
115+
## Schematic
116+
117+
<img src="http://docs.m5stack.com/assets/img/product_pics/core/coreink/coreink_sch1.webp">

README_cn.md

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# CoreInk Library
2+
3+
[English](README.md) | 中文
4+
5+
<img src="http://docs.m5stack.com/assets/img/product_pics/core/coreink/coreink_01.webp" alt="CoreInk_Pic_01" width="350">
6+
7+
## 描述
8+
9+
**CoreInk** 是M5Stack推出的一款带有电子墨水屏(E-Ink)的主控设备,控制器采用ESP32-PICO-D4。正面嵌入了一块分辨率为200x200 @ 1.54"的电子墨水屏,支持黑/白显示。相对于普通的LCD的屏幕,电子墨水屏能够提供用户更好的文本阅读体验, 同时具有低功耗,掉电图像保持等特性。人机交互方面提供了拨轮开关,与物理按键, 集成LED指示灯与蜂鸣器。内置了390mAh锂电池,结合内部的RTC(BM8563)可实现定时休眠与唤醒功能,能够为设备提供较为优秀的续航能力。在机身的左侧和底部配有独立的电源按键与复位(RST)按键,方便使用与调试。开放了丰富的外设接口(HY2.0-4P、M-BUS、HAT模块接口)能够拓展各式各样的传感器设备,为后续的应用功能开发提供无限可能。
10+
11+
?>注意事项: 使用时请注意避免长时间高频刷新,建议刷新间隔为(15s/次), 请勿长时间暴露在紫外线下, 否则有可能对墨水屏造成不可逆的损害。
12+
13+
<img src="http://docs.m5stack.com/assets/img/product_pics/core/coreink/coreink_02.webp" alt="CoreInk_Pic_02" width="350">
14+
15+
## 管脚映射
16+
17+
**墨水屏幕**
18+
19+
屏幕像素:200x200
20+
21+
<table>
22+
<tr><td>ESP32 Chip</td><td>GPIO4</td><td>GPIO0</td><td>GPIO15</td><td>GPIO9</td><td>GPIO18</td><td>GPIO23</td></tr>
23+
<tr><td>GDEW0154M09</td><td>BUSY</td><td>RST</td><td>D/C</td><td>CS</td><td>SCK</td><td>MOSI</td></tr>
24+
</table>
25+
26+
**拨轮开关 & 物理按键 & LED & 蜂鸣器**
27+
28+
<table>
29+
<tr><td>ESP32 Chip</td><td>GPIO37</td><td>GPIO38</td><td>GPIO39</td><td>GPIO5</td><td>GPIO10</td><td>GPIO2</td></tr>
30+
<tr><td>拨轮开关</td><td>右</td><td>中</td><td>左</td><td>/</td><td>/</td><td>/</td></tr>
31+
<tr><td>物理按键</td><td>/</td><td>/</td><td>/</td><td>物理按键</td><td>/</td><td>/</td></tr>
32+
<tr><td>LED</td><td>/</td><td>/</td><td>/</td><td>/</td><td>LED</td><td>/</td></tr>
33+
<tr><td>蜂鸣器</td><td>/</td><td>/</td><td>/</td><td>/</td><td>/</td><td>蜂鸣器</td></tr>
34+
</table>
35+
36+
**USB转串口下载**
37+
38+
<table>
39+
<tr><td>ESP32 Chip</td><td>GPIO1</td><td>GPIO3</td></tr>
40+
<tr><td>CP2104</td><td>RXD</td><td>TXD</td></tr>
41+
</table>
42+
43+
**内部I2C连接**
44+
45+
<table>
46+
<tr><td>ESP32 Chip</td><td>GPIO21</td><td>GPIO22</td></tr>
47+
<tr><td>BM8563</td><td>SDA</td><td>SCL</td></tr>
48+
</table>
49+
50+
## Coreink-HY2.0 4P端口
51+
52+
<table>
53+
<thead>
54+
<th>PORT</th>
55+
<th>PIN</th>
56+
<th>备注:</th>
57+
</thead>
58+
<tbody>
59+
<tr>
60+
<td>EXT-PORT</td>
61+
<td>G32/33</td>
62+
<td>I2C</td>
63+
</tr>
64+
</tbody>
65+
</table>
66+
67+
## ESP32 ADC/DAC可映射引脚
68+
69+
<table>
70+
<thead>
71+
<th>ADC1</th>
72+
<th>ADC2</th>
73+
<th>DAC1</th>
74+
<th>DAC2</th>
75+
</thead>
76+
<tbody>
77+
<tr>
78+
<td>8 通道</td>
79+
<td>10 通道</td>
80+
<td>2 通道</td>
81+
<td>2 通道</td>
82+
</tr>
83+
<tr>
84+
<td>G32-39</td>
85+
<td>G0/2/4/12-15/25-27</td>
86+
<td>G25</td>
87+
<td>G26</td>
88+
</tr>
89+
</tbody>
90+
</table>
91+
92+
有关引脚分配和引脚重新映射的更多信息,请参考[ESP32 datasheet](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/esp32_datasheet_cn.pdf)
93+
94+
95+
## 相关链接
96+
97+
- **Datasheet**
98+
- [ESP32](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/esp32_datasheet_cn.pdf)
99+
- [BM8563](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/BM8563_V1.1_cn.pdf)
100+
- [SY7088](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/SY7088-Silergy.pdf)
101+
- [GDEW0154M09](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/CoreInk-K048-GDEW0154M09%20V2.0%20Specification.pdf)
102+
103+
- **API**
104+
105+
- [Arduino API](http://docs.m5stack.com/#/zh_CN/arduino/arduino_home_page)
106+
107+
## 教程&快速上手
108+
109+
<a href="http://docs.m5stack.com/#/zh_CN/quick_start/coreink/quick_start_arduino"><el-tag effect="plain">Arduino</el-tag></a>
110+
111+
## 原理图
112+
113+
<img src="http://docs.m5stack.com/assets/img/product_pics/core/coreink/coreink_sch1.webp">

examples/Button/Button.ino

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#include "M5CoreInk.h"
2+
3+
Ink_Sprite InkPageSprite(&M5.M5Ink);
4+
5+
void ButtonTest(char* str)
6+
{
7+
InkPageSprite.clear();
8+
InkPageSprite.drawString(35,59,str);
9+
InkPageSprite.pushSprite();
10+
delay(2000);
11+
}
12+
13+
void setup() {
14+
15+
M5.begin();
16+
if( !M5.M5Ink.isInit())
17+
{
18+
Serial.printf("Ink Init faild");
19+
}
20+
M5.M5Ink.clear();
21+
delay(1000);
22+
//creat ink refresh Sprite
23+
if( InkPageSprite.creatSprite(0,0,200,200,true) != 0 )
24+
{
25+
Serial.printf("Ink Sprite creat faild");
26+
}
27+
}
28+
29+
void loop() {
30+
if( M5.BtnUP.wasPressed()) ButtonTest("Btn UP Pressed");
31+
if( M5.BtnDOWN.wasPressed()) ButtonTest("Btn DOWN Pressed");
32+
if( M5.BtnMID.wasPressed()) ButtonTest("Btn MID Pressed");
33+
if( M5.BtnEXT.wasPressed()) ButtonTest("Btn EXT Pressed");
34+
if( M5.BtnPWR.wasPressed()){
35+
ButtonTest("Btn PWR Pressed");
36+
M5.PowerDown();
37+
}
38+
M5.update();
39+
}

0 commit comments

Comments
 (0)