devbis / st7789_mpy Goto Github PK
View Code? Open in Web Editor NEWFast pure-C driver for MicroPython that can handle display modules on ST7789 chip
License: MIT License
Fast pure-C driver for MicroPython that can handle display modules on ST7789 chip
License: MIT License
The 4.3 release of ESP-IDF won't compile the c modules into the micropython firmware as has some error using 'make' 'all' that it can't find the 'file' st7789_mpy, when this is actually a folder and not a file.
I don't know why, with out this module, everything seems work ok.
hardware:TTGO Camera Plus
software:with a ov2640 module.
import webrepl_setup
to set a webrepl
and I can see that the password in the webrepl_cfg.py is the same what I typed.
but it will always said that.
Welcome to MicroPython!
Password:
Access denied
Disconnected
Using the instructions in README.md and using the docker container build instructions (docker run --rm -v $HOME:$HOME -u $UID -w $PWD larsks/esp-open-sdk ...), I'm able to build micropython without your ST7789 module. When I include the module:
cd ports/esp8266
docker run --rm -v $HOME:$HOME -u $UID -w $PWD larsks/esp-open-sdk make V=1 USER_C_MODULES=/Users/john/p3.9.0a4/st7789_mpy/ all
I get the 'will not fit' error. Is there a way to work around this by excluding other modules?
Thanks!
Hello,
did not get the module compiled.
Hardware: TTGO ESP32 with 1.4" Display
$ make USER_C_MODULES=../../../st7789_mpy/ all
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
Including User C Module from ../../../st7789_mpy//st7789
** WARNING **
The git hash of ESP IDF does not match the supported version
The build may complete and the firmware may work but it is not guaranteed
ESP IDF path: /home/developer/Downloads/esp-idf
Current git hash: 8bc19ba893e5544d571a753d82b44a84799b94b1
Supported git hash (v3.3): 9e70825d1e1cbf7988cf36981774300066580ea7
Supported git hash (v4.0) (experimental): 4c81978a3e2220674a432a588292a4c860eef27b
GEN build-GENERIC/sdkconfig.h
Traceback (most recent call last):
File "/home/developer/Downloads/esp-idf/tools/kconfig_new/confgen.py", line 31, in
from future.utils import iteritems
ModuleNotFoundError: No module named 'future'
make: *** [Makefile:401: build-GENERIC/sdkconfig.h] Error 1
What did I wrong ?
when run install.sh in user context.... got this
$ make v=1 USER_C_MODULES=../../../st7789_mpy/ all
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
Including User C Module from ../../../st7789_mpy//st7789
** WARNING **
The git hash of ESP IDF does not match the supported version
The build may complete and the firmware may work but it is not guaranteed
ESP IDF path: /home/developer/Downloads/esp-idf
Current git hash: 8bc19ba893e5544d571a753d82b44a84799b94b1
Supported git hash (v3.3): 9e70825d1e1cbf7988cf36981774300066580ea7
Supported git hash (v4.0) (experimental): 4c81978a3e2220674a432a588292a4c860eef27b
GEN build-GENERIC/sdkconfig.h
/home/developer/Downloads/esp-idf/Kconfig:14: warning: IDF_ENV_FPGA has 'option env="IDF_ENV_FPGA"', but the environment variable IDF_ENV_FPGA is not set
Traceback (most recent call last):
File "/home/developer/Downloads/esp-idf/tools/kconfig_new/confgen.py", line 641, in
main()
File "/home/developer/Downloads/esp-idf/tools/kconfig_new/confgen.py", line 261, in main
config = kconfiglib.Kconfig(args.kconfig)
File "/home/developer/Downloads/esp-idf/tools/kconfig_new/kconfiglib.py", line 947, in init
self._init(filename, warn, warn_to_stderr, encoding)
File "/home/developer/Downloads/esp-idf/tools/kconfig_new/kconfiglib.py", line 1085, in _init
self._parse_block(None, self.top_node, self.top_node).next = None
File "/home/developer/Downloads/esp-idf/tools/kconfig_new/kconfiglib.py", line 2970, in _parse_block
raise KconfigError(
kconfiglib.KconfigError: /home/developer/Downloads/esp-idf/Kconfig:173: '$COMPONENT_KCONFIGS_PROJBUILD_SOURCE_FILE' not found (in 'source "$COMPONENT_KCONFIGS_PROJBUILD_SOURCE_FILE"'). Check that environment variables are set correctly (e.g. $srctree, which is unset or blank). Also note that unset environment variables expand to the empty string.
make: *** [Makefile:401: build-GENERIC/sdkconfig.h] Error 1
I want to use the driver with this board: https://github.com/Xinyuan-LilyGO/TTGO-T-Display
The display is 1.14 inch and has 135 x 240 pixels.
I have to use software SPI and a dummy pin (25) for MISO.
from machine import Pin, SPI
import st7789
spi = SPI(-1, baudrate=40000000, polarity=1, phase=0, sck=Pin(18), mosi=Pin(19), miso=Pin(25))
display = st7789.ST7789(spi, 135, 240, reset=Pin(23, Pin.OUT), dc=Pin(16, Pin.OUT), cs=Pin(5, Pin.OUT))
display.init()
tftbl = Pin(4, Pin.OUT)
tftbl.on()
display.fill(st7789.WHITE)
The display is switched on but the white color is not written on the complete display.
The example code for the board uses an Arduino driver (https://github.com/Bodmer/TFT_eSPI) which works perfectly.
It seems the driver needs an offset in x and y direction (CGRAM_OFFSET).
I'm using this library with the DSTIKE ESP32 Watch DevKit TFT here.
It works like a charm (put python into a watch was my secret dream).
Alas the screen is rotated 90° cw, I added a function to set rotation :
STATIC mp_obj_t st7789_ST7789_set_rotation(mp_obj_t self_in, mp_obj_t value) {
st7789_ST7789_obj_t *self = MP_OBJ_TO_PTR(self_in);
mp_int_t m = mp_obj_get_int(value);
uint8_t madctl[] = {ST7789_MADCTL_RGB};
switch (m) {
case 0:
madctl[0] = ST7789_MADCTL_MX | ST7789_MADCTL_MY | ST7789_MADCTL_RGB ;
write_cmd(self, ST7789_MADCTL, madctl, 1);
break;
case 1:
madctl[0] = ST7789_MADCTL_MY | ST7789_MADCTL_MV | ST7789_MADCTL_RGB ;
write_cmd(self, ST7789_MADCTL, madctl, 1);
break;
case 2:
madctl[0] = ST7789_MADCTL_RGB ;
write_cmd(self, ST7789_MADCTL, madctl, 1);
break;
case 3:
madctl[0] = ST7789_MADCTL_MX | ST7789_MADCTL_MV | ST7789_MADCTL_RGB ;
write_cmd(self, ST7789_MADCTL, madctl, 1);
break;
default:
break;
}
return mp_const_none;
}
MP_DEFINE_CONST_FUN_OBJ_2(st7789_ST7789_set_rotation_obj, st7789_ST7789_set_rotation);
But when setting in mode 1 there is like an offset of 80 pixels (the fill
function leaves a vertical band on the right)
No clues of what next (I'm remapping everything in sw right now). Any Idea?
Hi
I have working dev toolchain for Esp8266 configured in Docker. When I add your module:
`
git clone https://github.com/devbis/st7789_mpy.git /st7789_mpy
make USER_C_MODULES=/st7789_mpy all
`
I get compilation error "region `iram1_0_seg' overflowed by 1368 bytes":
`
...
CC /st7789_mpy/st7789/st7789.c
CC ../../lib/axtls/ssl/asn1.c
CC ../../lib/axtls/ssl/loader.c
CC ../../lib/axtls/ssl/tls1.c
CC ../../lib/axtls/ssl/tls1_svr.c
CC ../../lib/axtls/ssl/tls1_clnt.c
CC ../../lib/axtls/ssl/x509.c
CC ../../lib/axtls/crypto/aes.c
CC ../../lib/axtls/crypto/bigint.c
CC ../../lib/axtls/crypto/crypto_misc.c
CC ../../lib/axtls/crypto/hmac.c
CC ../../lib/axtls/crypto/md5.c
CC ../../lib/axtls/crypto/rsa.c
CC ../../lib/axtls/crypto/sha1.c
CC ../../extmod/modbtree.c
CC ../../lib/berkeley-db-1.xx/btree/bt_close.c
CC ../../lib/berkeley-db-1.xx/btree/bt_conv.c
CC ../../lib/berkeley-db-1.xx/btree/bt_debug.c
CC ../../lib/berkeley-db-1.xx/btree/bt_delete.c
CC ../../lib/berkeley-db-1.xx/btree/bt_get.c
CC ../../lib/berkeley-db-1.xx/btree/bt_open.c
CC ../../lib/berkeley-db-1.xx/btree/bt_overflow.c
CC ../../lib/berkeley-db-1.xx/btree/bt_page.c
CC ../../lib/berkeley-db-1.xx/btree/bt_put.c
CC ../../lib/berkeley-db-1.xx/btree/bt_search.c
CC ../../lib/berkeley-db-1.xx/btree/bt_seq.c
CC ../../lib/berkeley-db-1.xx/btree/bt_split.c
CC ../../lib/berkeley-db-1.xx/btree/bt_utils.c
CC ../../lib/berkeley-db-1.xx/mpool/mpool.c
AS gchelper.s
CC ../../extmod/modlwip.c
CC ../../extmod/modonewire.c
CC ../../lib/libc/string0.c
CC ../../lib/libm/math.c
CC ../../lib/libm/fmodf.c
CC ../../lib/libm/nearbyintf.c
CC ../../lib/libm/ef_sqrt.c
CC ../../lib/libm/kf_rem_pio2.c
CC ../../lib/libm/kf_sin.c
CC ../../lib/libm/kf_cos.c
CC ../../lib/libm/kf_tan.c
CC ../../lib/libm/ef_rem_pio2.c
CC ../../lib/libm/sf_sin.c
CC ../../lib/libm/sf_cos.c
CC ../../lib/libm/sf_tan.c
CC ../../lib/libm/sf_frexp.c
CC ../../lib/libm/sf_modf.c
CC ../../lib/libm/sf_ldexp.c
CC ../../lib/libm/asinfacosf.c
CC ../../lib/libm/atanf.c
CC ../../lib/libm/atan2f.c
CC ../../lib/mp-readline/readline.c
CC ../../lib/netutils/netutils.c
CC ../../lib/timeutils/timeutils.c
CC ../../lib/utils/pyexec.c
CC ../../lib/utils/interrupt_char.c
CC ../../lib/utils/sys_stdio_mphal.c
CC ../../lib/oofatfs/ff.c
CC ../../lib/oofatfs/ffunicode.c
CC ../../drivers/bus/softspi.c
CC ../../drivers/dht/dht.c
LINK build/firmware.elf
xtensa-lx106-elf-ld: build/firmware.elf section .text' will not fit in region
iram1_0_seg'
xtensa-lx106-elf-ld: region `iram1_0_seg' overflowed by 1368 bytes
make: *** [build/firmware.elf] Error 1
`
Have you ever seen similar problem before?
Traceback (most recent call last):
File "", line 11, in
File "st7789.py", line 46, in init
ValueError: invalid pin
hello,
i try to compile your module with esp32, and this is the reported error:
`dam@dvarrel-pc:~/esp/micropython/ports/esp32$ make USER_C_MODULES=../../../st7789_mpy/ all
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
Including User C Module from ../../../st7789_mpy//st7789
Building with ESP IDF v3
CC ../../../st7789_mpy/st7789/st7789.c
In file included from ../../../st7789_mpy/st7789/st7789.c:27:0:
../../../st7789_mpy/st7789/st7789.c:469:19: error: 'MP_QSTR_blit_buffer' undeclared here (not in a function)
thank you
`
Hi,
after I performed:
make USER_C_MODULES=../../../st7789_mpy/ all
The building start to work but in the middle of process I get that error:
build-GENERIC/frozen_content.c:71:5: error: redeclaration of enumerator 'MP_QSTR_color'
MP_QSTR_color,
^
In file included from ../../py/obj.h:31:0,
from ../../py/objint.h:30,
from build-GENERIC/frozen_content.c:15:
build-GENERIC/genhdr/qstrdefs.generated.h:512:6: note: previous definition of 'MP_QSTR_color' was here
QDEF(MP_QSTR_color, (const byte*)"\xd8\x06\x05" "color")
^
../../py/qstr.h:41:23: note: in definition of macro 'QDEF'
#define QDEF(id, str) id,
^
make: *** [build-GENERIC/build-GENERIC/frozen_content.o] Error 1
Thanks
Hi,
I did a try on stm32 port. My arm-none-eabi-gcc version is : gcc version 8.3.1 20190703 (release) [gcc-8-branch revision 273027] (GNU Tools for Arm Embedded Processors 8-2019-q3-update)
Something wrong with syntax.
Any idea ?
Including User C Module from ../../../st7789_mpy//st7789
CC ../../../st7789_mpy/st7789/st7789.c
In file included from ../../py/mphal.h:34,
from ../../../st7789_mpy/st7789/st7789.c:30:
../../../st7789_mpy/st7789/st7789.c: In function 'write_cmd':
./mphalport.h:71:33: error: expected expression before 'do'
#define mp_hal_pin_write(p, v) do { if (v) { mp_hal_pin_high(p); } else { mp_hal_pin_low(p); } } while (0)
^~
../../../st7789_mpy/st7789/st7789.c:41:23: note: in expansion of macro 'mp_hal_pin_write'
#define DC_LOW() (mp_hal_pin_write(self->dc, 0))
^~~~~~~~~~~~~~~~
../../../st7789_mpy/st7789/st7789.c:88:9: note: in expansion of macro 'DC_LOW'
DC_LOW();
^~~~~~
./mphalport.h:71:33: error: expected expression before 'do'
#define mp_hal_pin_write(p, v) do { if (v) { mp_hal_pin_high(p); } else { mp_hal_pin_low(p); } } while (0)
^~
../../../st7789_mpy/st7789/st7789.c:42:23: note: in expansion of macro 'mp_hal_pin_write'
#define DC_HIGH() (mp_hal_pin_write(self->dc, 1))
^~~~~~~~~~~~~~~~
../../../st7789_mpy/st7789/st7789.c:92:9: note: in expansion of macro 'DC_HIGH'
DC_HIGH();
^~~~~~~
../../../st7789_mpy/st7789/st7789.c: In function 'draw_pixel':
./mphalport.h:71:33: error: expected expression before 'do'
#define mp_hal_pin_write(p, v) do { if (v) { mp_hal_pin_high(p); } else { mp_hal_pin_low(p); } } while (0)
^~
../../../st7789_mpy/st7789/st7789.c:42:23: note: in expansion of macro 'mp_hal_pin_write'
#define DC_HIGH() (mp_hal_pin_write(self->dc, 1))
^~~~~~~~~~~~~~~~
../../../st7789_mpy/st7789/st7789.c:139:5: note: in expansion of macro 'DC_HIGH'
DC_HIGH();
^~~~~~~
../../../st7789_mpy/st7789/st7789.c: In function 'fast_hline':
./mphalport.h:71:33: error: expected expression before 'do'
#define mp_hal_pin_write(p, v) do { if (v) { mp_hal_pin_high(p); } else { mp_hal_pin_low(p); } } while (0)
^~
../../../st7789_mpy/st7789/st7789.c:42:23: note: in expansion of macro 'mp_hal_pin_write'
#define DC_HIGH() (mp_hal_pin_write(self->dc, 1))
^~~~~~~~~~~~~~~~
../../../st7789_mpy/st7789/st7789.c:149:5: note: in expansion of macro 'DC_HIGH'
DC_HIGH();
^~~~~~~
../../../st7789_mpy/st7789/st7789.c: In function 'fast_vline':
./mphalport.h:71:33: error: expected expression before 'do'
#define mp_hal_pin_write(p, v) do { if (v) { mp_hal_pin_high(p); } else { mp_hal_pin_low(p); } } while (0)
^~
../../../st7789_mpy/st7789/st7789.c:42:23: note: in expansion of macro 'mp_hal_pin_write'
#define DC_HIGH() (mp_hal_pin_write(self->dc, 1))
^~~~~~~~~~~~~~~~
../../../st7789_mpy/st7789/st7789.c:158:5: note: in expansion of macro 'DC_HIGH'
DC_HIGH();
^~~~~~~
../../../st7789_mpy/st7789/st7789.c: In function 'st7789_ST7789_hard_reset':
./mphalport.h:71:33: error: expected expression before 'do'
#define mp_hal_pin_write(p, v) do { if (v) { mp_hal_pin_high(p); } else { mp_hal_pin_low(p); } } while (0)
^~
../../../st7789_mpy/st7789/st7789.c:44:23: note: in expansion of macro 'mp_hal_pin_write'
#define RESET_HIGH() (mp_hal_pin_write(self->reset, 1))
^~~~~~~~~~~~~~~~
../../../st7789_mpy/st7789/st7789.c:169:5: note: in expansion of macro 'RESET_HIGH'
RESET_HIGH();
^~~~~~~~~~
./mphalport.h:71:33: error: expected expression before 'do'
#define mp_hal_pin_write(p, v) do { if (v) { mp_hal_pin_high(p); } else { mp_hal_pin_low(p); } } while (0)
^~
../../../st7789_mpy/st7789/st7789.c:43:23: note: in expansion of macro 'mp_hal_pin_write'
#define RESET_LOW() (mp_hal_pin_write(self->reset, 0))
^~~~~~~~~~~~~~~~
../../../st7789_mpy/st7789/st7789.c:171:5: note: in expansion of macro 'RESET_LOW'
RESET_LOW();
^~~~~~~~~
./mphalport.h:71:33: error: expected expression before 'do'
#define mp_hal_pin_write(p, v) do { if (v) { mp_hal_pin_high(p); } else { mp_hal_pin_low(p); } } while (0)
^~
../../../st7789_mpy/st7789/st7789.c:44:23: note: in expansion of macro 'mp_hal_pin_write'
#define RESET_HIGH() (mp_hal_pin_write(self->reset, 1))
^~~~~~~~~~~~~~~~
../../../st7789_mpy/st7789/st7789.c:173:5: note: in expansion of macro 'RESET_HIGH'
RESET_HIGH();
^~~~~~~~~~
../../../st7789_mpy/st7789/st7789.c: In function 'st7789_ST7789_fill_rect':
./mphalport.h:71:33: error: expected expression before 'do'
#define mp_hal_pin_write(p, v) do { if (v) { mp_hal_pin_high(p); } else { mp_hal_pin_low(p); } } while (0)
^~
../../../st7789_mpy/st7789/st7789.c:42:23: note: in expansion of macro 'mp_hal_pin_write'
#define DC_HIGH() (mp_hal_pin_write(self->dc, 1))
^~~~~~~~~~~~~~~~
../../../st7789_mpy/st7789/st7789.c:253:5: note: in expansion of macro 'DC_HIGH'
DC_HIGH();
^~~~~~~
../../../st7789_mpy/st7789/st7789.c: In function 'st7789_ST7789_fill':
./mphalport.h:71:33: error: expected expression before 'do'
#define mp_hal_pin_write(p, v) do { if (v) { mp_hal_pin_high(p); } else { mp_hal_pin_low(p); } } while (0)
^~
../../../st7789_mpy/st7789/st7789.c:42:23: note: in expansion of macro 'mp_hal_pin_write'
#define DC_HIGH() (mp_hal_pin_write(self->dc, 1))
^~~~~~~~~~~~~~~~
../../../st7789_mpy/st7789/st7789.c:268:5: note: in expansion of macro 'DC_HIGH'
DC_HIGH();
^~~~~~~
../../../st7789_mpy/st7789/st7789.c: In function 'st7789_ST7789_blit_buffer':
./mphalport.h:71:33: error: expected expression before 'do'
#define mp_hal_pin_write(p, v) do { if (v) { mp_hal_pin_high(p); } else { mp_hal_pin_low(p); } } while (0)
^~
../../../st7789_mpy/st7789/st7789.c:42:23: note: in expansion of macro 'mp_hal_pin_write'
#define DC_HIGH() (mp_hal_pin_write(self->dc, 1))
^~~~~~~~~~~~~~~~
../../../st7789_mpy/st7789/st7789.c:358:5: note: in expansion of macro 'DC_HIGH'
DC_HIGH();
^~~~~~~
../../../st7789_mpy/st7789/st7789.c: In function 'st7789_ST7789_on':
./mphalport.h:71:33: error: expected expression before 'do'
#define mp_hal_pin_write(p, v) do { if (v) { mp_hal_pin_high(p); } else { mp_hal_pin_low(p); } } while (0)
^~
../../../st7789_mpy/st7789/st7789.c:45:22: note: in expansion of macro 'mp_hal_pin_write'
#define DISP_HIGH() (mp_hal_pin_write(self->backlight, 1))
^~~~~~~~~~~~~~~~
../../../st7789_mpy/st7789/st7789.c:414:5: note: in expansion of macro 'DISP_HIGH'
DISP_HIGH();
^~~~~~~~~
../../../st7789_mpy/st7789/st7789.c:413:26: error: unused variable 'self' [-Werror=unused-variable]
st7789_ST7789_obj_t *self = MP_OBJ_TO_PTR(self_in);
^~~~
In file included from ../../py/mphal.h:34,
from ../../../st7789_mpy/st7789/st7789.c:30:
../../../st7789_mpy/st7789/st7789.c: In function 'st7789_ST7789_off':
./mphalport.h:71:33: error: expected expression before 'do'
#define mp_hal_pin_write(p, v) do { if (v) { mp_hal_pin_high(p); } else { mp_hal_pin_low(p); } } while (0)
^~
../../../st7789_mpy/st7789/st7789.c:46:21: note: in expansion of macro 'mp_hal_pin_write'
#define DISP_LOW() (mp_hal_pin_write(self->backlight, 0))
^~~~~~~~~~~~~~~~
../../../st7789_mpy/st7789/st7789.c:423:5: note: in expansion of macro 'DISP_LOW'
DISP_LOW();
^~~~~~~~
../../../st7789_mpy/st7789/st7789.c:422:26: error: unused variable 'self' [-Werror=unused-variable]
st7789_ST7789_obj_t *self = MP_OBJ_TO_PTR(self_in);
^~~~
../../../st7789_mpy/st7789/st7789.c: In function 'st7789_ST7789_make_new':
../../../st7789_mpy/st7789/st7789.c:552:29: error: implicit declaration of function 'MP_ERROR_TEXT'; did you mean 'MP_ROM_INT'? [-Werror=implicit-function-declaration]
mp_raise_ValueError(MP_ERROR_TEXT("Unsupported display. Only 240x240 and 135x240 are supported without xstart and ystart provided"));
^~~~~~~~~~~~~
MP_ROM_INT
../../../st7789_mpy/st7789/st7789.c:552:29: error: passing argument 1 of 'mp_raise_ValueError' makes pointer from integer without a cast [-Werror=int-conversion]
mp_raise_ValueError(MP_ERROR_TEXT("Unsupported display. Only 240x240 and 135x240 are supported without xstart and ystart provided"));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../../../st7789_mpy/st7789/st7789.c:28:
../../py/runtime.h:154:47: note: expected 'const char *' but argument is of type 'int'
NORETURN void mp_raise_ValueError(const char *msg);
~~~~~~~~~~~~^~~
../../../st7789_mpy/st7789/st7789.c:557:29: error: passing argument 1 of 'mp_raise_ValueError' makes pointer from integer without a cast [-Werror=int-conversion]
mp_raise_ValueError(MP_ERROR_TEXT("must specify all of reset/dc pins"));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../../../st7789_mpy/st7789/st7789.c:28:
../../py/runtime.h:154:47: note: expected 'const char *' but argument is of type 'int'
NORETURN void mp_raise_ValueError(const char *msg);
~~~~~~~~~~~~^~~
cc1: all warnings being treated as errors
../../py/mkrules.mk:47 : la recette pour la cible « build-RESA_PYBSTICK26/st7789/st7789.o » a échouée
make: *** [build-RESA_PYBSTICK26/st7789/st7789.o] Erreur 1
Is this display driver compatible with LVGL/Squareline GUI creation tools? If so how to integrate both in one firmware?
Hi there fantastic work on the driver, it's been really good to use, with the map_bitarray_to_rgb565
I'm not wanting to store the raw RGB565 binary in my flash it'd be good to store just the bitarray and use your helper to convert it on the fly, I can't seem to get this going though. I've tried converting a PNG file to bytearray and then used this helper but it always comes out garbled, are you able to write up an example of it's use, it'd be greatly appreciated.
The README contains performance measurements for the ESP8266 and also states how to build MicroPython with this module for the ESP8266. However, I can't get the current version of MicroPython to include this module when building.
I'm using the "recommended" way to build for ESP8266, which is using docker:
~/Downloads/micropython/ports/esp8266
> docker run --rm -v $HOME:$HOME -u (id -u) -w $PWD larsks/esp-open-sdk make USER_C_MODULES=../../../st7789_mpy/st7789/micropython.cmake all
This builds fine but produces exactly the same image as without the USER_C_MODULES
argument. When flashing the produced image, import st7789
does not work.
When looking over the Makefile in micropython/ports/esp8266
, I noticed that neither USER_C_MODULES
nor cmake
is referenced at all. I also couldn't find anything else on how to include external modules in an ESP8266 build.
Am I missing something here?
I want to draw some text strings and numbers on screen,how to code it?
just like 'print('Hello World!')', 'drawNum(123.45)'.
hello,
this driver for my ttgo esp32 led display works very well, thanks a lot.
But i can't use the Timer module, looks bizarre ?
i try the different exemples in micropython.org like :
from machine import Timer tim = Timer(-1) tim.init(period=5000, mode=Timer.ONE_SHOT, callback=lambda t:print(1)) tim.init(period=2000, mode=Timer.PERIODIC, callback=lambda t:print(2))
have you got this malfunction ?
thanks you
I'm trying to build micropython including your driver (thank you very much for the effort in developing it.), but I've stumbled across the following error while compiling, and I'm not sure how to go forward as I'm not very familiar with firmware building. I have followed the provided instructions and I currently am able to build a 'clean' micropython firmware.
When I try to include your driver, and run the
make USER_C_MODULES=../../../st7789_mpy/ all
command (my folder structure is matching the one explained in your tutorial), I am presented with the following error:
[...]
CC ../../extmod/uos_dupterm.c
CC ../../lib/embed/abort_.c
CC ../../lib/utils/printf.c
CC build-GENERIC/frozen_content.c
build-GENERIC/frozen_content.c:71:5: error: redeclaration of enumerator 'MP_QSTR_color'
MP_QSTR_color,
^
In file included from ../../py/obj.h:33:0,
from ../../py/objint.h:30,
from build-GENERIC/frozen_content.c:15:
build-GENERIC/genhdr/qstrdefs.generated.h:509:6: note: previous definition of 'MP_QSTR_color' was here
QDEF(MP_QSTR_color, (const byte*)"\xd8\x06\x05" "color")
^
../../py/qstr.h:41:23: note: in definition of macro 'QDEF'
#define QDEF(id, str) id,
^
../../py/mkrules.mk:63: recipe for target 'build-GENERIC/build-GENERIC/frozen_content.o' failed
make: *** [build-GENERIC/build-GENERIC/frozen_content.o] Error 1
I would appreciate any help on how to solve this.
Bonjour ,
I try to include st7789 to ESP32 micropython 1.14.
first without st7789 the build is good.
then make with st7789 is good but 'import st7789' is KO.
no st7789 string in the report.
mistake or missing ?
Thanks for help and
Regards
Linux ubuntu 16.4
I've tried so many times, but I still can't compile the right file(maybe something wrong with the network). Could someone
share the bin file? thanks. (esp8266 st7789)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.