2 Star 2 Fork 5

qsnail123 / esp-idf-st7789

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

esp-idf-st7789

ST7789 Driver for esp-idf

The demo video by Dmitry Andreev.
https://www.youtube.com/watch?v=aOyaK0pUiPk&t

Installation for ESP32

git clone https://github.com/nopnop2002/esp-idf-st7789
cd esp-idf-st7789/
idf.py set-target esp32
idf.py menuconfig
idf.py flash

Installation for ESP32-S2

git clone https://github.com/nopnop2002/esp-idf-st7789
cd esp-idf-st7789/
idf.py set-target esp32s2
idf.py menuconfig
idf.py flash

ESP32-S2 Limitation

  • tjpgd library does not exist in ESP32-S2 ROM.

Configuration

You have to set this config value with menuconfig.

  • CONFIG_WIDTH
  • CONFIG_HEIGHT
  • CONFIG_OFFSETX
  • CONFIG_OFFSETY
  • CONFIG_MOSI_GPIO
  • CONFIG_SCLK_GPIO
  • CONFIG_CS_GPIO
  • CONFIG_DC_GPIO
  • CONFIG_RESET_GPIO
  • CONFIG_BL_GPIO

st7789-config-1


Generic ST7789 1.3 Inch

There is 2 kinds of marking.
st7789-back

st7789-config-2

MISO is not use.

st7789-1 st7789-2 st7789-3 st7789-4 st7789-5 st7789-6 st7789-7 st7789-8 st7789-9 st7789-10

BMP file
st7789-11

JPEG file(ESP32 only)
st7789-JPEG

PNG file
st7789-PNG


Generic ST7789 1.14 Inch

st7789-135x240-1 st7789-135x240-2


LILYGO TTGO 1.14 Inch

ttgo-config-1 ttgo-1


LILYGO TTGO T8 ESP32-S2

TTGO_T8_ESP32-S2-1 TTGO_T8_ESP32-S2-2


JPEG Decoder

The ESP-IDF component includes Tiny JPEG Decompressor.
The document of Tiny JPEG Decompressor is here.
This can reduce the image to 1/2 1/4 1/8.


PNG Decoder

The ESP-IDF component includes part of the miniz library, such as mz_crc32.
But it doesn't support all of the miniz.
The document of miniz library is here.

And I ported the pngle library from here.
This can reduce the image to any size.


Font File

You can add your original fonts.
The format of the font file is the FONTX format.
Your font file is put in font directory.
Your font file is uploaded to SPIFFS partition using meke flash.

Please refer this page about FONTX format.


Font File Editor(FONTX Editor)

There is a font file editor.
This can be done on Windows 10.
Developer page is here.

FontxEditor

This library uses the following as default fonts:

  • font/ILGH16XB.FNT // 8x16Dot Gothic
  • font/ILGH24XB.FNT // 12x24Dot Gothic
  • font/ILGH32XB.FNT // 16x32Dot Gothic
  • font/ILMH16XB.FNT // 8x16Dot Mincyo
  • font/ILMH24XB.FNT // 12x24Dot Mincyo
  • font/ILMH32XB.FNT // 16x32Dot Mincyo

From 0x00 to 0x7f, the characters image of Alphanumeric are stored.
From 0x80 to 0xff, the characters image of Japanese are stored.
Changing this file will change the font.

How to build your own font file

step1)
download fontxedit.exe.

step2)
download BDF font file from Internet.
I downloaded from here.
fontxedit.exe can ONLY import Monospaced bitmap fonts file.
Monospaced bitmap fonts can also be downloaded here.

step3)
import the BDF font file into your fontxedit.exe.
this tool can convert from BDF to FONTX.
FONTX-EDITTOR-1

step4)
adjust font size.
FONTX-EDITTOR-2

step5)
check font pattern.
FONTX-EDITTOR-13

step6)
save as .fnt file from your fontedit.exe.
FONTX-EDITTOR-14

step7)
upload your font file to $HOME/esp-idf-st7789/fonts directory.

step8)
add font to use

FontxFile fx32L[2];
InitFontx(fx32L,"/spiffs/LATIN32B.FNT",""); // 16x32Dot LATIN

Font file that From 0x80 to 0xff, the characters image of Japanese are stored.
st7789-KANA

Font file that From 0x80 to 0xff, the characters image of Latin are stored.
st7789-LATIN

MIT License Copyright (c) 2020 nopnop2002 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.

简介

ST7789 Driver for esp-idf 展开 收起
C 等 3 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/qsnail123/esp-idf-st7789.git
git@gitee.com:qsnail123/esp-idf-st7789.git
qsnail123
esp-idf-st7789
esp-idf-st7789
master

搜索帮助