Giter Club home page Giter Club logo

ft800-ft813's Introduction

EVE2 / EVE3 / EVE4 code library

This is a code library for EVE2/EVE3/EVE4 graphics controller ICs from FTDI/Bridgetek:

http://www.ftdichip.com/EVE.htm
http://brtchip.com/eve/
http://brtchip.com/ft81x/
https://brtchip.com/bt81x/

It contains code for and has been used with various micro-controllers and displays.

Controllers

I have used it so far with:

  • 8-Bit AVR, specifically the 90CAN series
  • Arduino: Uno R3, mini-pro, ESP8266, ESP32, Metro-M4 (DMA), STM32 Nucleo_F446RE (DMA), XMC1100, Uno R4
  • Renesas F1L RH850
  • Infineon Aurix TC222
  • GD32VF103
  • ATSAMC21J18A (DMA)
  • ATSAME51J19A (DMA)
  • ESP32 (DMA)
  • RP2040 Baremetal (DMA) + Arduino (DMA) - Raspberry Pi Pico
  • S32K144 (DMA)
  • GD32C103CBT6 (DMA)
  • STM32G0B1CET6

I have reports of successfully using it with:

  • ATSAMV70
  • ATSAMD20
  • ATSAME4
  • MSP430
  • MSP432
  • some PICs
  • ATxmega128A1
  • TMS320F28335

Displays

The TFTs tested so far:

This is version 5

This is version 5 of this code library and there are a couple of changes from V4.

First of all, support for FT80x is gone. The main reason is that this allowed a nice speed improvement modification that only works with FT81x and beyond. Then there is a hard break from FT80x to FT81x with ony 256k of memory in FT80x but 1MB in FT81x. The memory map is different and all the registers are located elsewhere. FT810, FT811, FT812, FT813, BT815, BT816, BT817 and BT818 can use the exact same code as long none of the new features of BT81x are used - and there are plenty of modules with these available to choose from

As a side effect all commands are automatically started now.

Second is that there are two sets of display-list building command functions now: EVE_cmd_xxx() and EVE_cmd_xxx_burst(). The EVE_cmd_xxx_burst() functions are optimized for speed, these are pure data transfer functions and do not even check anymore if burst mode is active.

Structure

This library currently has nine files that I hope are named to make clear what these do:

  • EVE.h - this has all defines for FT81x / BT81x itself, so here are options, registers, commands and macros defined
  • EVE_commands.c - this has all the API functions that are to be called from an application
  • EVE_commands.h - this contains the prototypes for the functions in EVE_commands.c
  • EVE_config.h - this has all the parameters for the numerous supported display modules, here is definded which set of parameters is to be used
  • EVE_target.c - this has non-portable specific code for a number of supported controllers, mostly to support DMA
  • EVE_target.h - this has non-portable pin defines and code as "static inline" functions for all supported controllers
  • EVE_target.cpp - this is for Arduino C++ targets
  • EVE_cpp_wrapper.cpp - this is for Arduino C++ targets
  • EVE_cpp_wrapper.h - this is for Arduino C++ targets

Addtionally there are these two:

  • EVE_supplemental.c
  • EVE_supplemental.h

This has the prototype and implementation for extra functions, so far:

  • EVE_widget_circle() - widget function to draw a circle
  • EVE_widget_rectangle() - widget function to draw a rectangle
  • EVE_polar_cartesian() - calculate coordinates from an angle and a length

Examples

Generate a basic display list and tell EVE to use it:

EVE_cmd_dl(CMD_DLSTART); // tells EVE to start a new display-list
EVE_cmd_dl(DL_CLEAR_COLOR_RGB | WHITE); // sets the background color
EVE_cmd_dl(DL_CLEAR | CLR_COL | CLR_STN | CLR_TAG);
EVE_color_rgb(BLACK);
EVE_cmd_text(5, 15, 28, 0, "Hello there!");
EVE_cmd_dl(DL_DISPLAY); // put in the display list to mark its end
EVE_cmd_dl(CMD_SWAP); // tell EVE to use the new display list
while (EVE_busy());

Note, these commands are executed one by one, for each command chip-select is pulled low, a three byte address is send, the data for the command and its parameters is send and then chip-select is pulled high again which also makes EVE execute the command.

But there is a way to speed things up, we can get away with only sending the address once:

EVE_start_cmd_burst();
EVE_cmd_dl_burst(CMD_DLSTART);
EVE_cmd_dl_burst(DL_CLEAR_COLOR_RGB | WHITE);
EVE_cmd_dl_burst(DL_CLEAR | CLR_COL | CLR_STN | CLR_TAG);
EVE_color_rgb_burst(BLACK);
EVE_cmd_text_burst(5, 15, 28, 0, "Hello there!");
EVE_cmd_dl_burst(DL_DISPLAY);
EVE_cmd_dl_burst(CMD_SWAP);
EVE_end_cmd_burst();
while (EVE_busy());

This does the same as the first example but faster. The preceding EVE_start_cmd_burst() either sets chip-select to low and sends out the three byte address.
Or if DMA is available for the target you are compiling for with support code in EVE_target.c / EVE_target.cpp and EVE_target.h, it writes the address to EVE_dma_buffer and sets EVE_dma_buffer_index to 1.

Note the trailing "_burst" in the following functions, these are special versions of these commands that can only be used within an EVE_start_cmd_burst()/EVE_end_cmd_bust() pair. These functions are optimized to push out data and nothing else.

The final EVE_end_cmd_burst() either pulls back the chip-select to high.
Or if we have DMA it calls EVE_start_dma_transfer() to start pushing out the buffer in the background.

As we have 7 commands for EVE in these simple examples, the second one has the address overhead removed from six commands and therefore needs to transfer 18 bytes less over SPI.
So even with a small 8-bit controller that does not support DMA this is a usefull optimization for building display lists.

Using DMA has one caveat: we need to limit the transfer to <4k as we are writing to the FIFO of EVEs command co-processor. This is usually not an issue though as we can shorten the display list generation with previously generated snippets that we attach to the current list with CMD_APPEND. And when we use widgets like CMD_BUTTON or CMD_CLOCK the generated display list grows by a larger amount than what we need to put into the command-FIFO so we likely reach the 8k limit of the display-list before we hit the 4k limit of the command-FIFO. It is possible to use two or more DMA transfers to the FIFO to build a single display list, either to get around the 4k limit of the FIFO or in order to distribute the workload better of the time necessary between two display renewals.

You could for example do this, spread over three consecutive calls:

EVE_start_cmd_burst();
EVE_cmd_dl_burst(CMD_DLSTART);
EVE_cmd_dl_burst(DL_CLEAR_COLOR_RGB | WHITE);
EVE_end_cmd_burst();
EVE_start_cmd_burst();
EVE_cmd_dl_burst(DL_CLEAR | CLR_COL | CLR_STN | CLR_TAG);
EVE_color_rgb_burst(BLACK);
EVE_end_cmd_burst();
EVE_start_cmd_burst();
EVE_cmd_text_burst(5, 15, 28, 0, "Hello there!");
EVE_cmd_dl_burst(DL_DISPLAY);
EVE_cmd_dl_burst(CMD_SWAP);
EVE_end_cmd_burst();

But you need to check with EVE_busy() before each of these blocks. Maybe similar like this never compiled pseudo-code:

thread_1ms_update_display() { static uint8_t state = 0; static uint8_t count = 0;

count++;

if (E_OK == EVE_busy())
{
    switch (state)
    {
        case 0:
            update_first();
            state = 1;
            break;
        case 1:
            update_second();
            state = 2;
            break;
        case 2:
            if (counter > 19)
            {
                update_last_swap_list();
                count = 0;
                state = 0;
            }
            break;
    }
}

}

Remarks

The examples in the "example_projects" drawer are for use with AtmelStudio7. For Arduino I am using PlatformIO with Visual Studio Code.

The platform the code is compiled for is automatically detected thru compiler flags in EVE_target.h.

The desired TFT is selected by adding a define for it to the build-environment, e.g. -DEVE_EVE3_50G There is a list of available options at the start of EVE_config.h sorted by chipset.

The pins used for Chip-Select and Power-Down setup in the EVE_target/EVE_target_XXXXX.h file for your target with defines and these defines can be bypassed with defines in the build-environment.
Check the apropriate header file for your desired target.

When compiling for AVR you need to provide the clock it is running at in order to make the _delay_ms() calls used to initialize the TFT work with the intended timing. For other plattforms you need to provide a DELAY_MS(ms) function that works at least between 1ms and 56ms and is not performing these delays shorter than requested. The DELAY_MS(ms) is only used during initialization of the FT8xx/BT8xx.

In Addition you need to initialize the pins used for Chip-Select and Power-Down in your hardware correctly to output. Plus setup the SPI accordingly, mode-0, 8-bit, MSB-first, not more than 11MHz for the initialization. A couple of targets already have a function EVE_init_spi() in EVE_target.c.

A word of "warning", you have to take care yourself to not send more than 4kiB at once to the command co-processor or to not generate display lists that are longer than 8kiB. My library does not check and re-check the command-FIFO on every step.
Also there are no checks for the validity of function arguments.
This is optimized for speed, so the training wheels are off.

Post questions here

Originally the project went public in the German mikrocontroller.net forum, the thread contains some insight: https://www.mikrocontroller.net/topic/395608

Feel free to add to the discussion with questions or remarks.

New: Github has a discussions feature as well: https://github.com/RudolphRiedel/FT800-FT813/discussions

ft800-ft813's People

Contributors

hezy0426 avatar markand avatar obones avatar rselec avatar rudolphriedel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ft800-ft813's Issues

Drawing basic shapes

Hi,

I found your library and FT813 powered displays very interesting and ordered RVT70UQFNWC00 for testing. I am developing system where I currently use RA8875 controller, but it start to lag on my project specially due to bad font quality.

With a quick look for FT81x Series Programmers Guide I started to wonder is there any way to draw framed rectangles or circles without fill? As far as I found RECTS or POINTS will allways fill the area, I would also need other basic shapes like arc.

ESP32 not initializing if GPIO pin number > 31

Hi,
On the ESP32 platform the EVE does not initialize correctly if a GPIO number is higher than 31.
For example: on my board, the EVE_PDN pin is set to pin 33 on the ESP32.
This can be fixed by changing the "BIT" macro in the EVE_init_spi function to "BIT64".

FT8_cmd_inflate() overflows the buffer

Hi! Awesome work with EVE, thanks for sharing.

I'm having some issues with cmd_inflate() with big images (larger than 4k). Looking at the code, I realize there is no treatment to split the transfers, like the cmd_loadimage().

Surprisingly the same solution for the load_image doesn't work on inflate (or I'm doing something wrong). Maybe need something different.

Thanks!

Adafruit HUZZAH32 - ESP32 Feather

I cannot get the library working with Adafruit HUZZAH32 - ESP32 Feather, I started from other ESP32 configurations but without success. Maybe I'm not getting the GPIO mapping correct.

I'm using the Riverdi RVT50HQBNWC00-B display and using this successfully with Teensy board.

This is the ESP32 board I try to configure, https://learn.adafruit.com/adafruit-huzzah32-esp32-feather/pinouts

This is my environment config

platform = espressif32
board = featheresp32
build_unflags = -Os
build_flags =
        ${env.build_flags}
         -D EVE_CS=22
         -D EVE_PDN=17
         -D EVE_SCK=5
         -D EVE_MISO=19
         -D EVE_MOSI=18
         -O2

Any ideas?

Unable to trigger buttons when I remove my finger from the screen : EVE2 - FT813 - STM32 - PlatformIO

Hello,

I am using a FT813 Development Module with 5.0 inch WVGA TFT LCD (800x480p Capacitive) and I am developing a GUI on that screen.
The problem is that I am trying to trigger the buttons on the screen only when I remove my finger from the screen (on a rising edge).
But, so far, I am not able to do so, as they only trigger when I press.

Although I spotted that in the "Calibration" demo, all 3 buttons that appear on the screen (one after the other) are only triggered once my finger has been removed from the screen. And even after having a look at the code that runs the Calibration demo, I can't figure out how to do so.

Thank you in advance.

Here is some of the code that I am using (in case it could help) :
in void TFT_display(void):

    /* display "Home" button */
    EVE_cmd_dl_burst(DL_COLOR_RGB | BLACK);
    EVE_cmd_fgcolor_burst(0x00f7f7f7);         
    EVE_cmd_dl_burst(TAG(5));         //assign tag-value '5' to the button that follows
    EVE_cmd_button_burst(0,0, 224, 80, 29, toggle_home, "Main");
    EVE_cmd_dl_burst(TAG(0)); /* no touch * `

in void TFT_touch(void):

        case 5: /* use "Home" button to come back to the home menu

        message = "Home Menu";
        TFT_display_main();
        
        if (toggle_lock == 0)
        {
                                
            toggle_lock = 42;
            if (toggle_home == EVE_OPT_FLAT)
            {
                //message = "Home Menu";
                //toggle_home = 0;

            }
            else
            {		
                //toggle_home = EVE_OPT_FLAT;

            }
        }
        
        break;

IOT5 from Riverdi support?

Just wondering if the code supports also a IOT5 board with ESP32. I like to use it for client project with VSCodium and PlatformIO.

Regards,
Rob Oudendijk

Runtime Configuration of EVE_HAS_GT911?

Rudolph-

A small library modification for your consideration.

As I'm sure you are familiar with, component shortages have thrown a wrench in many product lines this year. Matrix Orbital in particular seems to have been hit hard, and while looking for second sources, I've noticed that in some cases, equivalent displays from other manufacturers are quite similar- with compatible (or adaptable) pinouts, timings, and mechanical form factors. But the software hiccup of the hardcoded Goodix touch controller configuration makes these displays incompatible from a software perspective, unless a different software build is created for each display type used.

To avoid this, what I've tested locally is a simple change to EVE_commands.c and EVE_commands.h.

In EVE_commands.h, the init function changes from:
uint8_t EVE_init(void);
to
uint8_t EVE_init(bool hasGT911);

and in the revised EVE_init(bool hasGT911) function in EVE_commands.c, we simply take the

    #if defined (EVE_HAS_GT911)
    ...
    #endif

block and wrap it in a conditional:

   if (hasGT911)
   {
       #if defined (EVE_HAS_GT911)
       ...
       #endif
   }

Then for any "flexible" display configuration desired, "EVE_HAS_GT911" would be defined in the display profile in EVE_config.h (to make it "available"), and then this could either be used or not used as desired at runtime, as determined by the hasGT911 parameter when EVE_init is called, allowing both types of displays to be used without requiring separate software builds.

Thoughts?
Or is there a better way to do this?

Thanks in advance.

New native ESP32 SPI with DMA and improved Arduino SPI

This is not really an issue per-se, but I recently re-worked your code and I thought I would share my improvements back. It is a lot of fundamental changes so rather than submit a huge pull request that you may not want, I'll just point you to it here:

https://github.com/davidjade/FT800-FT813/tree/4.x

My main motivation for doing this was to find a way to enable the LittlevGL GUI library to interface with FT81x boards, which mostly required a lot of performance work. I think I have been successful in that as I now have a striped-down driver for LittlevGL (not include here) that works. My new LittlevGL display driver can do full screen updates at about 4-5 FPS using 2-wire SPI DMA mode and should be up to 4x faster with Quad SPI (which I am working on next). This new ESP32 SPI DMA code is stable for me at 30Mhz on a breadboard, which is significantly faster than the Arduino demo is capable of.

Some stats on my performance work (these are the numbers displayed in the demo):

Original FT81x Arduino demo - stable for me at 16Mhz

  • time1: 1586us
  • time2: 94us

New FT81x-Arduino - stable for me at 16Mhz

  • time1: 191us
  • time2: 45us

New FT81x-ESP32 - stable for me at 30Mhz

  • time1: 147us
  • time2: 27us

I'd be happy to make this a pull request if you want but please take a look first. I only updated the PlatformIO Arduino demo project and added a new native ESP32 PlatformIO demo project and have left the main EVE code files in the project root unchanged for now. I most certainly broke the existing DMA code for boards I don't have and also have not tested on any other Arduino boards as I only have ESP32 boards.

If this does not interest you that's Ok. Or if you just want to take some ideas from this on your own, that's fine too. I just wanted to share back as your code was very helpful to me.

Support for esp32-s3

Hallo,

ich arbeite mit einem esp32-s3 (esp-idf) und dem BT815 und laufe hier in einige Probleme. Um überhaupt auf dem esp32-s3 die lib zum laufen zu bringen musste ich eigentlich nur die HOST_ID auf SPI2_HOST setzen.
Allerdings bekomme ich immer einen Watchdog Trigger, den ich nicht richtig verstehe.
Ich lasse die touch Kalibrierung laufen und die Funktionspi_device_polling_transmit(EVE_spi_device_simple, &trans); endet immer im WDT.
Noch bin ich auf der Suche nach der Ursache, aber ich möchte heir schon mal fragen, warum zwei spi_devices angelegt werden? Und wieso die unterschiedlichen Frequenzen?

FT800-FT813/EVE_target.c

Lines 383 to 389 in aa717f3

spi_bus_initialize(HSPI_HOST, &buscfg, 2);
spi_bus_add_device(HSPI_HOST, &devcfg, &EVE_spi_device);
devcfg.address_bits = 0;
devcfg.post_cb = 0;
devcfg.clock_speed_hz = 10 * 1000 * 1000; //Clock = 10 MHz
spi_bus_add_device(HSPI_HOST, &devcfg, &EVE_spi_device_simple);

Liebe Grüße

Sound issue after init

When using this GT911 with the FT813, after running the initialization of the GT911, the ft813 no longer plays any sound.

Write bitmap regions of screen from buffer (LVGL)

Dear Rudolph,
I was able to make Arduino PlatformIO example to work on my test bed composed of ESP32 MCU and a Riverdi EVE3 7" display.
I would like to use LVGL (either v7 or v8) with your library. I'm aware of the LVGL ESP32 project, however it is for ESP-IDF and, despite being a derivative of your work, has significant differences which I try to overcome but failed.

I understand that LVGL just need a callback function to draw regions of bitmap from a SRAM buffer

The LVGL ESP32 project achieves this through the functions FT81x_flush and TFT_WriteBitmap below (https://github.com/lvgl/lvgl_esp32_drivers/blob/master/lvgl_tft/FT81x.c).
The latter uses a function, EVE_memWrite_buffer, for which the closest function in your library is EVE_memWrite_sram_buffer. However it misses the flag that sends DISP_SPI_SIGNAL_FLUSH to the SPI transaction. The low level function to write to SPI bus (disp_spi_transaction) is very different from spi_transfer, I guess due to being ESP-IDF based.

Could you please pointing me to some clues to get it working?
I would be happy to test a prototype function. I guess I can get the screen initialization working.

Thank you,
Nick

void TFT_WriteBitmap(uint8_t* Bitmap, uint16_t X, uint16_t Y, uint16_t Width, uint16_t Height)
{
	// calc base address
	uint32_t addr = SCREEN_BITMAP_ADDR + (Y * BYTES_PER_LINE) + (X * BYTES_PER_PIXEL);

	// can we do a fast full width block transfer?
	if(X == 0 && Width == EVE_HSIZE)
	{
		EVE_memWrite_buffer(addr, Bitmap, (Height * BYTES_PER_LINE), true);
	}
	else
	{
		// line by line mode
		uint32_t bpl = Width * BYTES_PER_PIXEL;
		for (uint16_t i = 0; i < Height; i++)
		{
			EVE_memWrite_buffer(addr, Bitmap + (i * bpl), bpl, (i == Height - 1));
			addr += BYTES_PER_LINE;
		}
	}
}

// LittlevGL flush callback
void FT81x_flush(lv_disp_drv_t * drv, const lv_area_t * area, lv_color_t * color_map)
{
	TFT_WriteBitmap((uint8_t*)color_map, area->x1, area->y1, lv_area_get_width(area), lv_area_get_height(area));
} 

add suppoort for Fysect TFT EVE 5"

Hi, i purchase this TFT for my 3dprinter

https://es.aliexpress.com/item/4000628057351.html?spm=a2g0s.9042311.0.0.a4c463c08gLTib

this display have a chipset

EBRT FT810Q
https://www.mouser.es/ProductDetail/Bridgetek/FT810Q-T
https://www.mouser.es/datasheet/2/880/DS_FT81x-1140609.pdf

i have test the examples as-sis (without touch the configuration) and "works"

the only not works is the touch panel and emit a wreid sound from the speaker

is possible add this tft to you library?

greetings

you can see more info in MarlinFirmware/Marlin#16628

white screen on adafruit 1680 (KD50G21-40NT-A1)

Hi,

I'm trying to use my Adafruit 1680 with a VM816C50A evaluation board (BT816), I get up to the screen turning on with its backlight but example in this repository for ESP32 leads to a white screen all time long. I've also tried the official bridgetek repository and very minimal own code with the same exact result. No even sign of graphic artifacts. I have no clue what do I miss.

The KD50G21-40NT-A1 datasheet is pretty minimal and I have no clue what should I set about timings.

I think I've stumbled across one of your post in a german forum here and I tried the settings you've shown:

#define EVE_PCLK 2
#define EVE_PCLKPOL 1
#define EVE_SWIZZLE 0
#define EVE_GEN 2
#define EVE_CSPREAD 0
#define EVE_VSYNC0 (0L)   /* Tvf Vertical Front Porch */
#define EVE_VSYNC1 (13L)   /* Tvf + Tvp Vertical Front Porch plus Vsync Pulse width */
#define EVE_VOFFSET (35L) /* Tvf + Tvp + Tvb Number of non-visible lines (in lines) */
#define EVE_VCYCLE (516L) /* Tv Total number of lines (visible and non-visible) (in lines) */
#define EVE_HSYNC0 (0L)   /* Thf Horizontal Front Porch */
#define EVE_HSYNC1 (88L)  /* Thf + Thp Horizontal Front Porch plus Hsync Pulse width */
#define EVE_HOFFSET (169L) /* Thf + Thp + Thb Length of non-visible part of line (in PCLK cycles) */
#define EVE_HCYCLE (969L) /* Th Total length of line (visible and non-visible) (in PCLKs) */
#define EVE_HSIZE (800L) /* Thd Length of visible part of line (in PCLKs) - display width */
#define EVE_VSIZE (480L) /* Tvd Number of visible lines (in lines) - display height */

I'm running out of ideas for this problem unless either my ribbon cable is damaged or anything else... Did you end up with a working screen?

My main MCU is ESP32c6 using simple SPI.

Multi-device support

Hi! I'm Alexis Lockwood, a software engineer at Boulder Engineering Studio; I found this driver useful for a recent project with some admittedly heavy modifications, thought I'd drop by and try to contribute something back.

Changes I've made

  • Remove #defines for display timing setup, instead allow a struct of values to be provided at runtime.
  • Give all functions a context parameter eve_context_t *, with that struct containing all the necessary per-instance state as well as a collection of function pointers implementing the underlying lower-level routines.
  • Add a timeout facility to the wait-while-busy loops.
  • Probably broke DMA 😉

Still planned

  • Factor the function pointers out of the context struct, using a second level of indirection to allow this to be stored in flash rather than wasting all that RAM.
  • Fix DMA. The breakage is only temporary as I definitely want DMA myself too.

This is definitely not ready for immediate upstreaming. I've definitely broken all the example code, and some of these changes will balloon the generated code for small targets like AVR and PIC.

Additionally needed to properly merge upstream

  • Allow compile-time configuration on how the function pointer struct is accessed, allowing it to be e.g. PROGMEM on AVR.
  • Allow the use of a single state context for builds not wanting to use multi-display support, avoiding passing around the useless pointer.
  • Fix the examples.

When I've finished the "still planned" changes, I will certainly share with you the modified code — just the four files EVE.h, EVE_commands.h, EVE_commands.c, EVE_config.h — no matter what. Let me know if this sounds like something you'd be willing to merge, as I may be able to spend some time making the rest of the changes needed to get this upstreamed.

cc @austinbes

Flash support

Hi,

ich habe einige Fragen zur Verwendung des Flash Speichers.

  1. Ist es möglich direkt vom Flash Videos und Bilder etc. abzuspielen/anzuzeigen, ohne dass diese in dem RAM_G geladen werden müssen, oder muss ich immer diesen "Umweg" gehen?

  2. Ist es möglich Daten direkt auf den Flash zu laden, ohne diese erst in RAM_G laden zu müssen? Z.B. Habe ich ein Video im Flash des esp32-s3 liegen und möchte das nun in den Flash des BT815 schieben. Das Video ist größer als der verfügbare RAM_G.

Lg
Jonathan

Code redundance found

Hello Rudolph,

I'm writing my own library for STM32H7 and the NHD-4.3-800480FT-CSXP-CTP display. I use the examples from Bridgetek as well as your FT800-FT813 library as a template.
I noticed (among other things) that your code is redundant: the functions "EVE_start_command" and "EVE_begin_cmd" contain exactly the same code.
Does it have a special reason?

Kind Regards,
Michael

BTW: Do you speak German?

Support for new EVE4x-70G IPS displays from Matrix Orbital

Hello! I'm testing out one of the pre-production 7.0" IPS 1024x600 EVE4 displays from Matrix Orbital, but am having a bit of trouble getting it to function correctly with this library.

The symptoms are that an image displays, but the whole screen has an intermittent flicker, sometimes with a position offset, as well as some vertical streaking primarily on the left edge (which appears as horizontal streaking on the top edge in my application, as I'm using rotation 2 for portrait orientation). Touch appears to work OK for buttons, but none of the sliders are functional. After a period of time (a minute or so), the display will go dark until power cycled. If the code execution is interrupted, such as when the microprocessor is being re-programmed, the display (in its frozen state) is visually 100% stable, so it appears as though the glitching only happens while the display is actively being updated.

Being brand new, there wasn't a definition for this display in EVE_config.h, so I requested the timing parameters from Matrix Orbital and created my own. I've never done this before, so I wouldn't be surprised if I made a mistake at this step, or misinterpreted the mapping of the timings for how this library expects them.

The timing values I received from Matrix Orbital:

DWIDTH = 1024;
DHEIGHT = 600;
PIXVOFFSET = 0;
PIXHOFFSET = 0;
HCYCLE = 1259;
HOFFSET = 85;
HSYNC0 = 37;
HSYNC1 = 40;
VCYCLE = 768;
VOFFSET = 16; 
VSYNC0 = 13;
VSYNC1 = 20;
PCLK = 1;
SWIZZLE = 0;
PCLK_POL = 0;
HSIZE = 1024;
VSIZE = 600;
CSPREAD = 0;
DITHER = 1;

And then my resulting configuration:

#if defined (EVE_EVE4_70G_TEST)
#define EVE_HSIZE  (1024L)
#define EVE_VSIZE (600L)

#define EVE_VSYNC0  (13L) 
#define EVE_VSYNC1  (20L)
#define EVE_VOFFSET (16L)
#define EVE_VCYCLE  (768L)
#define EVE_HSYNC0  (37L) 
#define EVE_HSYNC1  (40L) 
#define EVE_HOFFSET (85L)
#define EVE_HCYCLE  (1259L) 
#define EVE_PCLKPOL (0L)
#define EVE_SWIZZLE (0L)
#define EVE_PCLK  (1L)  
#define EVE_CSPREAD (0L)
#define EVE_TOUCH_RZTHRESH (1200L)

//#define EVE_HAS_GT911  /* special treatment required for out-of-spec touch-controller */
#define EVE_HAS_CRYSTAL
#define FT81X_ENABLE
#define BT81X_ENABLE
#endif

As you can probably tell from those defines, I'm still on the 4.x branch from the end of last year. If supporting this display requires an upgrade to the 5.x branch I can do that, I'm just trying to not change too many things at once if I can avoid it.

Thanks in advance for the help!

ESP32-S2 with Riverdi RiTFT - WDT IDLE / Backlight PWM

Hi Rudolph,

Firstly many thanks for these code libraries, they're really helpful to anyone building projects/products using EVE displays.

I'm working on a project which uses an ESP32-S2 with a Riverdi RiTFT70 display. I used your ESP32 example PIO project and swapped the board config to use my custom ESP32-S2 .json file.

The screen loads just fine when I use the RiTFT50 build flag, which is maybe something to consider updating. My issue is that once the display list has been loaded the Idle task WDT is triggered. Using taskYIELD() or other refactors of this in the while(1) loop doesn't seem to help.

Also there's a gap in my understanding because as far as I can tell the TFT_display function is being called every 20ms and each time it is called the "rotate" is initialised to 0. Rotation is happening normally (I forced tag = 10 as I don't have a touch screen), but how is this so if rotate is being set to 0 every time the function is run?

On a separate subject, your standard PWM frequency for the Riverdi EVE3 backlight is 4kHz, I contacted Riverdi (because
I was getting a 4kHz squeal from the IC) who told me the ICs they use for EVE3 are CAT4238 or CAT4139. On the datasheets it states 100 - 2kHz. I recommend 200Hz as a default as this is barely audible.

Where to buy the ADAM101?

Hi,

How can I buy the ADAM101 display, and how it is supported by the FT81X, since it should be limited to 800x600 res?

Thanks in advance

Arye

cmd_text does not display text

I am playing with a BT815 device and everything seems to be going great. Except for cmd_font which has peculiar issues. I tried V 4.0 of this library and also the latest that does not keep track of the cmd_offset anymore, instead writing into REG_CMDB_WRITE.

What I observe is that strings of certain length are not rendered, but the device continues. In my true application, later commands then sometimes report ominous errors like invalid padding for cmd_flashread - even though I do not intend to run cmd_flashread anyways. It feels like an alignment error, but I cannot pin it down.

Most lengths string work fine. If I run this python program as outside trigger:

for i in range(1, 100):
    print i
    subprocess.check_call(["./tester", "a" * i])
    time.sleep(0.5)

And here is the full C program tester, without #includes:

int main(int argc, char** argv)
{
        if(platform_spi_init() != 1){
                printf("spi init failed");
                return -1;
        }
        if (EVE_init() == 0) {
                printf("eve init failed");
                return -1;
        }

        EVE_cmd_dl(CMD_SYNC);
        EVE_cmd_dl(CMD_DLSTART);

        EVE_cmd_dl(DL_COLOR_RGB | 0xffffff);

        EVE_cmd_dl(DL_CLEAR | CLR_COL | CLR_STN | CLR_TAG);
        EVE_cmd_dl(DL_CLEAR_RGB | 0x000000);

        EVE_cmd_text(100, 150, 23, 0, argv[1]);

        EVE_cmd_dl(DL_DISPLAY);
        EVE_cmd_dl(CMD_SWAP);
        EVE_cmd_execute();

        return 0;
}

All strings render, except for length

12, 13, 14, 15
44, 45, 46, 47
76, 77, 78, 79, 

However when I start with i=44 instead of i=1, then the first string will render, but the next one will not. Can you reproduce this issue? Any idea what it might be?

Lack of enable the disp signal panel and start clocking data to the LCD

Hello Rudolph,
Thank you very much for the work you put into creating this lib.
I think I found a small error while trying to enable the display using your lib.
I am using RVT50HQBNWC00-B with STM32, so I set #define EVE_RVT50H in EVE_config.h.
It turns on config:

/* RVT50HQBxxxxx 800x480 5.0" Riverdi, various options, BT817 */
#if defined(EVE_RVT50H)
#define EVE_HSIZE (800L)
#define EVE_VSIZE (480L)

#define EVE_VSYNC0 (0L)
#define EVE_VSYNC1 (4L)
#define EVE_VOFFSET (8L)
#define EVE_VCYCLE (496L)
#define EVE_HSYNC0 (0L)
#define EVE_HSYNC1 (4L)
#define EVE_HOFFSET (8L)
#define EVE_HCYCLE (816L)
#define EVE_PCLK (3L)    // <= important!
#define EVE_PCLKPOL (1L)
#define EVE_SWIZZLE (0L)
#define EVE_CSPREAD (0L)
#define EVE_HAS_CRYSTAL
#define EVE_GEN 4

#endif

When REG_PCLK is set to 2 to 255, the display out is in pass-through mode, but this setup makes that in function static uint8_t enable_pixel_clock(void) enable the DISP signal to the LCD panel and start clocking data to the LCD panel are not called.

static uint8_t enable_pixel_clock(void)
{
    uint8_t ret = E_OK;

#if EVE_GEN > 3
#if defined(EVE_PCLK_FREQ)
    uint32_t frequency;
    /* setup the second PLL for the pixel-clock according to the define in EVE_config.h for the display, as close a match as possible */
    frequency = EVE_cmd_pclkfreq(EVE_PCLK_FREQ, 0L);
    if (0U == frequency)    /* this failed for some reason so we return with an error */
    {
        ret = EVE_FAIL_PCLK_FREQ;
    }
    else
    {
        EVE_memWrite8(REG_GPIO, 0x80U); /* enable the DISP signal to the LCD panel, it is set to output in REG_GPIO_DIR by default */
        EVE_memWrite8(REG_PCLK, EVE_PCLK); /* now start clocking data to the LCD panel */
    }
#endif
#else
    EVE_memWrite8(REG_GPIO, 0x80U); /* enable the DISP signal to the LCD panel, it is set to output in REG_GPIO_DIR by default */
    EVE_memWrite8(REG_PCLK, EVE_PCLK); /* now start clocking data to the LCD panel */
#endif

    return ret;
}

Because EVE_GEN = 4, so > 3, but EVE_PCLK_FREQ is not defined. That's why it didn't work for me. In my opinion, this function should look like this, and in this form at my place it works:

static uint8_t enable_pixel_clock(void)
{
    uint8_t ret = E_OK;

#if EVE_GEN > 3
	#if defined(EVE_PCLK_FREQ)
		uint32_t frequency;
		/* setup the second PLL for the pixel-clock according to the define in EVE_config.h for the display, as close a match as possible */
		frequency = EVE_cmd_pclkfreq(EVE_PCLK_FREQ, 0L);
		if (0U == frequency)    /* this failed for some reason so we return with an error */
		{
			ret = EVE_FAIL_PCLK_FREQ;
		}
		else
		{
			EVE_memWrite8(REG_GPIO, 0x80U); /* enable the DISP signal to the LCD panel, it is set to output in REG_GPIO_DIR by default */
			EVE_memWrite8(REG_PCLK, EVE_PCLK); /* now start clocking data to the LCD panel */
		}
	#else
		EVE_memWrite8(REG_GPIO, 0x80U); /* NEW */
		EVE_memWrite8(REG_PCLK, EVE_PCLK); /* NEW */
	#endif
#else
    EVE_memWrite8(REG_GPIO, 0x80U); /* enable the DISP signal to the LCD panel, it is set to output in REG_GPIO_DIR by default */
    EVE_memWrite8(REG_PCLK, EVE_PCLK); /* now start clocking data to the LCD panel */
#endif

    return ret;
}

Best regards,
grados73

Tag releases rather than changing default branch

I notice that the current branch is 5.x, and that the 3.x and 4.x branches are behind those. I am assuming that each time a new "version" is being developed that you switch to a new branch and change the default. Why not work off of one default master branch and tag releases as you go? With git tags, you can always checkout a previous version. (Creating a Github release will also create a tag.)

Hello Rudolph

I first want to thank you for your dedication to this toppic and the work youve share with us.

As im pretty sure that, 90% of all who want to work with that display driver will finally reach your page, i just want to share a (from my point) highly neccesary toppic. I hope you find it usefull and may integrate this information in your documentation.

I worked with eve 2,3 and now finally 4.
And to be honest i had problems all the time..Even with the help of your great work i didnt got any usefull results.
Then i got the first usefull results but still got hit with a lot of display crashes and uncommon issues.

Things i've coded worked some time and then it started to crash etc. without any changes.

I've searched literally for month and replaced nearly every single componend until i finally dropped my whole desk and started to hard wire everything because i finally believed i had issues with wiring and contacts of breadboards etc.

But still the same problems...

Today i basically finally figured out what the rootcause is!

Just to explain...the setup i've used where arm processors all the time, so i had mcu glockrates of >100mhz. actually i run a stm32H7 at 550MHz.

as the BT8x are clocked much lower the interrupt edge detection is much slower as well. and yes it just works on the int edges not on just on high or low.
so today i started to make experiments with the signal slew rate of the mcu and when i configured them (CS,PD) to the slowest setup my issues magically disappeared. it seems it just works on the int edges not on just on high or low of the signal.

so it is highly neccesary to configure the PD and CS slew rate as slow as possible when using an mcu which is clocked much higher then the BT8x.

i could nowhere find this information or even any hint to it during my searches, so this may help other who have simmilar issues.

Best regards
Thomas

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.