FTDI Community

Please login or register.

Login with username, password and session length.
Advanced Search  

News:

Welcome to the FTDI Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ FTDI Support


New Bridgetek Community is now open

Please note that we have created the Bridgetek Community to discuss all Bridgetek products e.g. EVE, MCU.

Please follow this link and create a new user account to get started.

Bridgetek Community

Show Posts

You can view here all posts made by this member. Note that you can only see posts made in areas to which you currently have access.

Messages - techtoys

Pages: [1] 2
1
Hi

See attached files as patches for /FT_Esd_Framework and /FT_Esd_Widgets. Comment are available at the top of each file to describe what have been changed with reasons. They are easy because all of them are fixed, not __Generated files from .widgets.

Problems came when there are __Generated.c files exported by ESD. Attached a MS WORD file to describe the changes required to make Arduino C++ compiler for Teensy.

In case there is any question please pm : johnleung00@gmail.com

John

2
Dear FTDI community

Do you mean it is not possible for me to change from the current ESD UI?

Explicit casting is not the only change. I have summarized a list with changes required so that other compilers (ESP32's IDF and C++ for Teensy) can pass. Could share with you if you need it.

John

3
Hi

By inspecting source code generated from ESD I can see that explicit casting is available for some cases but not the other. Example with .c source code generated by ESD:

(1)
//Explicit casting is available for context
Code: [Select]
Ft_Esd_Layout_Stretch__Generated.c:: Ft_Esd_Layout_Stretch__Initializer(Ft_Esd_Layout_Stretch *context){
Ft_Esd_Widget__Initializer((Ft_Esd_Widget *)context);
}

(2)
//No explicit casting for context_1
Code: [Select]
Ft_Esd_SpinBox__Generated.c:: Ft_Esd_SpinBox_Update(Ft_Esd_SpinBox *context){
//...
if (if_1)
{
 Ft_Esd_PushButton * context_1 = &context->Push_Up;
 Ft_Esd_Layout_Linear * parent_1 = &context->Horizontal_Layout;
 Ft_Esd_Widget_InsertTop(context_1, parent_1);
}else{
//...
}
}

All __Generated.c source files are generated by ESD with some .widget files as blueprints. So I am thinking if there is any "switch" or some sort to control explicit casting v.s. implicit casting.

Asking this question because I am working on a project to port Eclipse project output for ESP32 and Arduino. ESP32-IDF in pure C has no problem. A python program developed to convert Eclipse output to ESP32-based project is working, because ESD and ESP32 are both using pure C.

However I am hitting a wall with Arduino in C++, which requires strict syntaxes with explicit casting. Modification by putting explicit casting like snippet below will get the project compiled successfully. But it would not be a friendly package if we need to do it manually for every project.

Code: [Select]
Ft_Esd_Widget_InsertTop((Ft_Esd_Widget*)context_1, (Ft_Esd_Widget*)parent_1);
ESD is a nice software that opens up node-based visual programming for embedded GUI development. I am fascinated by its features and the possibility of extending this software to MCUs next to FT9xx. I also believe its influence can be much more profound than just using it for FT9xx (FT9xx MCU series is good but ESD can be much more). The success of porting ESP32 has proven my thinking.

So I wish to see if the same task to Arduino can be done. I am almost there. With manual modification manually and patches applying an Eclipse output from ESD can work with Arduino (Teensy in particular).

The next phase is to get project conversion done in an elegant and automatic manner.

Wish to see if there is somebody sharing my thinking and like to provide any insight.

4
Thank you for the link. I am following suggestion by pauljiao. It is working. I like it more because ESD_FUNCTION() macro is available and I can simulate the result under the UI of Screen Designer. My user function looks like this:

Code: [Select]
#ifndef api_font_resizer__H
#define api_font_resizer__H

#include "Ft_Esd.h"

ESD_FUNCTION(api_font_resizer, Type=uint16_t)
uint16_t api_font_resizer();

#endif

In MainPage__Generated.c :

Code: [Select]
ft_int16_t MainPage_ESD_Label_Font__Property(void *c)
{
MainPage *context = (MainPage *)c;
void *owner = context->Owner;
return api_font_resizer();
}

I am trying to structure the project with FreeRTOS, with all GUI related functions run in a task and all modelling tasks allocated to another. So it is like running in 2 threads.

The main thread listing:

Code: [Select]
#include "FT_Platform.h"
#include "freertos/FreeRTOS.h"
#include "Ft_Esd_App.h"
#include "api_font_resizer.h"

uint16_t api_font_resizer(){
static uint16_t msec=0, size= 16;
if(msec++ ==300){ //this is not 300msec. Timing should be adjusted.
if (size++ ==34){
size = 16;
}
msec=0;
}
return size;
}

void setup() {
xTaskCreatePinnedToCore(guiTask,"GuiTask",10000,NULL,1,NULL,1);
}

static uint32_t test_loop_counter=0;

void loop() {
vTaskDelay( 5000 / portTICK_PERIOD_MS ); //delay for 5 sec.
printf("Test loop counter: %d/n", test_loop_counter++);
}


Listing of Ft_Esd_App.h:

Code: [Select]
#ifndef COMPONENTS_FTDI_FT_ESD_FRAMEWORK_FT_ESD_APP_H_
#define COMPONENTS_FTDI_FT_ESD_FRAMEWORK_FT_ESD_APP_H_

#include "Ft_Esd.h"
ft_int32_t Ft_main(ft_int32_t argc, ft_char8_t *argv[]);

#include "freertos/FreeRTOS.h"

void guiTask(void *pvParameters)
{
Ft_main(0, 0);
}

#endif
It is working demonstrated by a looping "Widget Opacity" font size from 16 <-> 34, and a serial printout Test loop counter %d in parallel.

But it seems to me that ESD as a graphical framework shall have an interface for this out-of-the-box instead of a user function. I mean, if a user wants to migrate an old LED-based design to a modern GUI with EVE, he may want to keep existing code for the critical part unchanged (e.g. motor control, sensor sampling intact). Migration task is to change only a value displayed on 7 segments LED board to a 5" LCD controlled by EVE. Rewriting the major part of software to place it under MainPage__Generated.c or user_functions.c should be avoided.

I can see from Logic Interface that there are several tools available such as Signal, Slot, Input, & Variable. With Variable it can be Public, Read-only, and Private. So, did I miss anything from the user guide to update Variable or Slot with standard API subscription?

5
Hi

Studying how to update a ESD label with value returned from a temperature sensor. My version of ESD is 4.5 beta 2.
Project modified from a basic example : WidgetOpacity as the starting point. I have changed the font size of the ESD Label "Widget Opacity" with an Input Logic Interface. Screen shot of ESD UI attached for reference.

My target is to update the font size with a temperature sensor reading, from 16 to 34.
From ESD simulation the Font size is fixed, because I have not supplied the function to update the reading yet. However, project compiled OK and running good.

Now an Eclipse project is generated with MainPage__Generated.c created with full listing at the end of this post.
I can see that ESD_Label_Font__Property() is changed as follows:

Code: [Select]
ft_int16_t MainPage_ESD_Label_Font__Property(void *c)
{
MainPage *context = (MainPage *)c;
void *owner = context->Owner;
return context->temp_sensor(owner);
}

I think the key is to get context->temp_sensor(owner) updated for whatever period I need via an API.
Under #ifdef ESD_SIMULATION...#endif there are two function prototypes:

Code: [Select]
int MainPage__Get_temp_sensor__ESD(void *context) { return ((MainPage__ESD *)context)->temp_sensor; }
void MainPage__Set_temp_sensor__ESD(void *context, int value) { ((MainPage__ESD *)context)->temp_sensor = value; }

These two functions are not present beyond ESD_SIMULATION.

My question:

Is MainPage__Set_temp_sensor__ESD() the API I need to supply in order to update the font size? Where is the right place to put API to update the temperature reading?

From ESD user guide there are not many examples.


Code: [Select]
//File name: MainPage__Generated.c

#include "MainPage.h"

extern void Ft_Esd_Noop(void *context);
int MainPage_temp_sensor__Default(void *context) { return 16L; }

static ft_int16_t MainPage_ESD_Label_Font__Property(void *context);
static const char * MainPage_ESD_Label_Text__Property(void *context) { return "Widget Opacity"; }
static ft_int16_t MainPage_ESD_Slider_Min__Property(void *context) { return 16; }
static ft_int16_t MainPage_ESD_Slider_Max__Property(void *context) { return 34; }
static ft_uint8_t MainPage_ESD_Gauge_Alpha__Property(void *context);
static ft_uint8_t MainPage_ESD_Clock_Alpha__Property(void *context);
static ft_int16_t MainPage_ESD_Slider_1_Max__Property(void *context) { return 255; }

static Ft_Esd_WidgetSlots s_MainPage__Slots = {
(void(*)(void *))Ft_Esd_Widget_Initialize,
(void(*)(void *))Ft_Esd_Widget_Start,
(void(*)(void *))Ft_Esd_Widget_Enable,
(void(*)(void *))Ft_Esd_Widget_Update,
(void(*)(void *))Ft_Esd_Widget_Render,
(void(*)(void *))Ft_Esd_Widget_Idle,
(void(*)(void *))Ft_Esd_Widget_Disable,
(void(*)(void *))MainPage_End,
};


void MainPage__Fixed_Position__Initializer(MainPage *context)
{
Ft_Esd_Layout_Fixed *object = &context->Fixed_Position;
Ft_Esd_Layout_Fixed__Initializer(object);
object->Owner = context;
object->Widget.Active = 1;
object->Widget.LocalX = 0;
object->Widget.LocalY = 0;
object->Widget.LocalWidth = 50;
object->Widget.LocalHeight = 50;
Ft_Esd_Widget_InsertBottom((Ft_Esd_Widget *)object, (Ft_Esd_Widget *)context);
}

void MainPage__ESD_Label__Initializer(MainPage *context)
{
Ft_Esd_Label *object = &context->ESD_Label;
Ft_Esd_Label__Initializer(object);
object->Owner = context;
object->Widget.Active = 1;
object->Widget.LocalX = 10;
object->Widget.LocalY = 12;
object->Widget.LocalWidth = 330;
object->Widget.LocalHeight = 44;
object->Font = MainPage_ESD_Label_Font__Property;
object->Text = MainPage_ESD_Label_Text__Property;
Ft_Esd_Widget_InsertBottom((Ft_Esd_Widget *)object, (Ft_Esd_Widget *)&context->Fixed_Position);
}

void MainPage__ESD_Slider__Initializer(MainPage *context)
{
Ft_Esd_Slider *object = &context->ESD_Slider;
Ft_Esd_Slider__Initializer(object);
object->Owner = context;
object->Widget.Active = 1;
object->Widget.LocalX = 40;
object->Widget.LocalY = 164;
object->Widget.LocalWidth = 300;
object->Widget.LocalHeight = 40;
object->Value = 16;
object->Min = MainPage_ESD_Slider_Min__Property;
object->Max = MainPage_ESD_Slider_Max__Property;
Ft_Esd_Widget_InsertBottom((Ft_Esd_Widget *)object, (Ft_Esd_Widget *)&context->Fixed_Position);
}

void MainPage__ESD_Gauge__Initializer(MainPage *context)
{
Ft_Esd_Gauge *object = &context->ESD_Gauge;
Ft_Esd_Gauge__Initializer(object);
object->Owner = context;
object->Widget.Active = 1;
object->Widget.LocalX = 75;
object->Widget.LocalY = 217;
object->Widget.LocalWidth = 186;
object->Widget.LocalHeight = 155;
object->Alpha = MainPage_ESD_Gauge_Alpha__Property;
Ft_Esd_Widget_InsertBottom((Ft_Esd_Widget *)object, (Ft_Esd_Widget *)&context->Fixed_Position);
}

void MainPage__ESD_Clock__Initializer(MainPage *context)
{
Ft_Esd_Clock *object = &context->ESD_Clock;
Ft_Esd_Clock__Initializer(object);
object->Owner = context;
object->Widget.Active = 1;
object->Widget.LocalX = 211;
object->Widget.LocalY = 73;
object->Widget.LocalWidth = 90;
object->Widget.LocalHeight = 82;
object->Alpha = MainPage_ESD_Clock_Alpha__Property;
Ft_Esd_Widget_InsertBottom((Ft_Esd_Widget *)object, (Ft_Esd_Widget *)&context->Fixed_Position);
}

void MainPage__ESD_Slider_1__Initializer(MainPage *context)
{
Ft_Esd_Slider *object = &context->ESD_Slider_1;
Ft_Esd_Slider__Initializer(object);
object->Owner = context;
object->Widget.Active = 1;
object->Widget.LocalX = 20;
object->Widget.LocalY = 404;
object->Widget.LocalWidth = 418;
object->Widget.LocalHeight = 42;
object->Value = 255;
object->Max = MainPage_ESD_Slider_1_Max__Property;
Ft_Esd_Widget_InsertBottom((Ft_Esd_Widget *)object, (Ft_Esd_Widget *)&context->Fixed_Position);
}

void MainPage__Initializer(MainPage *context)
{
Ft_Esd_Widget__Initializer((Ft_Esd_Widget *)context);
context->Widget.ClassId = MainPage_CLASSID;
context->Widget.Slots = &s_MainPage__Slots;
context->Widget.LocalX = 0;
context->Widget.LocalY = 0;
context->Widget.LocalWidth = 400;
context->Widget.LocalHeight = 300;
context->temp_sensor = MainPage_temp_sensor__Default;
MainPage__Fixed_Position__Initializer(context);
MainPage__ESD_Label__Initializer(context);
MainPage__ESD_Slider__Initializer(context);
MainPage__ESD_Gauge__Initializer(context);
MainPage__ESD_Clock__Initializer(context);
MainPage__ESD_Slider_1__Initializer(context);
}

void MainPage_End(MainPage *context)
{
void *owner = context->Owner;
Ft_Esd_Widget_End((Ft_Esd_Widget *)context);
Ft_Esd_Widget_Detach((Ft_Esd_Widget *)&context->Fixed_Position);
Ft_Esd_Widget_Detach((Ft_Esd_Widget *)&context->ESD_Label);
Ft_Esd_Widget_Detach((Ft_Esd_Widget *)&context->ESD_Slider);
Ft_Esd_Widget_Detach((Ft_Esd_Widget *)&context->ESD_Gauge);
Ft_Esd_Widget_Detach((Ft_Esd_Widget *)&context->ESD_Clock);
Ft_Esd_Widget_Detach((Ft_Esd_Widget *)&context->ESD_Slider_1);
}

ft_int16_t MainPage_ESD_Label_Font__Property(void *c)
{
MainPage *context = (MainPage *)c;
void *owner = context->Owner;
return context->temp_sensor(owner);
}

ft_uint8_t MainPage_ESD_Gauge_Alpha__Property(void *c)
{
MainPage *context = (MainPage *)c;
void *owner = context->Owner;
return context->ESD_Slider_1.Value;
}

ft_uint8_t MainPage_ESD_Clock_Alpha__Property(void *c)
{
MainPage *context = (MainPage *)c;
void *owner = context->Owner;
return context->ESD_Slider.Value;
}

#ifdef ESD_SIMULATION
#include <stdlib.h>

typedef struct
{
MainPage Instance;
int temp_sensor;
} MainPage__ESD;

int MainPage__Get_temp_sensor__ESD(void *context) { return ((MainPage__ESD *)context)->temp_sensor; }
void MainPage__Set_temp_sensor__ESD(void *context, int value) { ((MainPage__ESD *)context)->temp_sensor = value; }

void *MainPage__Create__ESD()
{
MainPage__ESD *context = (MainPage__ESD *)malloc(sizeof(MainPage__ESD));
MainPage__Initializer(&context->Instance);
context->Instance.Owner = context;
context->temp_sensor = 16L;
context->Instance.temp_sensor = MainPage__Get_temp_sensor__ESD;
return context;
}

void MainPage__Destroy__ESD(void *context)
{
free(context);
}


#endif /* ESD_SIMULATION */

//end of file


Thank you.




6
Studying how EVE Screen Designer 4.5 works and found a datatype mismatch in FT_Esd_Dl.c.

This file is stored at ./EVE Screen Designer/Libraries/FT_Esd_Framework/

Data type for FT_Esd_BitmapHandleUse[] declared as ft_bool_t.

However, browsing down the source code at line #251 an assignment to 2 is declared.

Code: [Select]
if ((handle < FT_ESD_BITMAPHANDLE_NB) && (handle != FT_ESD_SCRATCHHANDLE)) // When valid and not using scratch handle
{
Ft_Esd_BitmapHandleUse[handle] = 2; // In use
}

This leads to compile error for some other toolchain.

7
Hi Administrator

I was just curious what would happen if single brace is changed to triple brace pairs for Ft_Esd_WidgetSlots initialization in original BridgeTek toolchain, an attempt was made by randomly pick s_App_Screen__Slots in the source file AppScreen__generated.c with src code changed as below:

Code: [Select]
static Ft_Esd_WidgetSlots s_AppScreen__Slots = {{{
(void(*)(void *))Ft_Esd_Widget_Initialize,
(void(*)(void *))AppScreen_Start,
(void(*)(void *))Ft_Esd_Widget_Enable,
(void(*)(void *))AppScreen_Update,
(void(*)(void *))Ft_Esd_Widget_Render,
(void(*)(void *))Ft_Esd_Widget_Idle,
(void(*)(void *))Ft_Esd_Widget_Disable,
(void(*)(void *))AppScreen_End,
}}};


There is another way to do it like
Code: [Select]
.Initialize = (void(*)(void *))Ft_Esd_Widget_Initialize but a triple brace pairs is more simple. After this change the warning message [-Wmissing-braces] removed in FT90x GCC toolchain as well. Unfortunately there is no real FT90x hardware with me so I cannot test.

Nevertheless, having changed all single brace to triple brace pairs for Ft_Esd_WidgetSlots I am able to run the WidgetOpacity example on my hardware with ESP32 as seen in this hyperlink.

https://www.dropbox.com/s/vctfsx5jhgcay5a/IMG_20190515_120950_HDR.jpg?dl=0

Touch screen is supported so the opacity of these two widgets can be adjusted by the scroll bars underneath.

This example was finished with ESD -> export to Eclipse project -> manually modification on individual files.
The next step is to modify /Libraries folder in installation directory of ESD so that it is possible to export Eclipse project from ESD for third party MCU.

John


8
Hi

I am trying to port ESD to ESP32 Wifi SoC in addition to FT9xx MCUs. The HAL part is working with a new directory ESP32 in FT_Eve_Hal/Hdr and FT_Eve_Hal/Src with relevant .c and .h files. New compiling directive added to FT_Platform.h as ESP32_PLATFORM, together with a new LCD model of 480*854.

Toolchain is the development framework base on Cygwin GCC in Eclipse IDE. I also tested Cross GCC and it shows to be working too. Language in pure C.

Now I am proceeding further with FT_Esd_Framework by copying all .c and .h files to project and get them compiled.

There is a problem with Ft_Esd_WidgetSlots structure in Ft_Esd_Widget.h. This structure is initialized in almost each of the .c files under /FT_Esd_Framework with individual function pointers. For example, in Ft_Esd_Layout_Tag.c this structure is initialized as follows:

Code: [Select]
static Ft_Esd_WidgetSlots s_Ft_Esd_Layout_Tag__Slots = {
(void(*)(void *))Ft_Esd_Widget_Initialize,
(void(*)(void *))Ft_Esd_Widget_Start,
(void(*)(void *))Ft_Esd_Widget_Enable,
(void(*)(void *))Ft_Esd_Widget_Update,
(void(*)(void *))Ft_Esd_Layout_Tag_Render,
(void(*)(void *))Ft_Esd_Widget_Idle,
(void(*)(void *))Ft_Esd_Widget_Disable,
(void(*)(void *))Ft_Esd_Widget_End,
};

With official Bridgetek FT9xx GCC, this intialization is giving warning as
Code: [Select]
missing braces around initializer [-Wmissing-braces] Ft_Esd_FixedPointNumericLabel__Generated.c /WidgetOpacity/FT_Esd_Widgets line 26 C/C++ Problem

This is a warning but not error.

Unfortunately, the same code with Cygwin GCC/Cross GCC is giving an error with the same message
Code: [Select]
missing braces around initializer [-Wmissing-braces]
Because Ft_Esd_WidgetSlots is a structure composed of a union of an array of 8 elements, should it be 3 braces in initialization like code snippet below instead of a single brace pair ?

Code: [Select]
static Ft_Esd_WidgetSlots s_Ft_Esd_Layout_Display__Slots = {{{
(void(*)(void *))Ft_Esd_Widget_Initialize,
(void(*)(void *))Ft_Esd_Widget_Start,
(void(*)(void *))Ft_Esd_Widget_Enable,
(void(*)(void *))Ft_Esd_Layout_Display_Update,
(void(*)(void *))Ft_Esd_Layout_Display_Render,
(void(*)(void *))Ft_Esd_Layout_Display_Idle,
(void(*)(void *))Ft_Esd_Widget_Disable,
(void(*)(void *))Ft_Esd_Widget_End,
}}};
I tried three braces with my toolchain and it works OK. Does anybody know why is it so? Is it something with compile options to change it?

Hope it is "legal" to port the ESD to a third party MCU as I notice only FT9xx series MCUs are supported for now. But I do realize that porting guide for ESD 4.5 is on the way. I am not sure if my question here worth an answer.

John

9
Discussion - Software / EVE Screen Editor - Flash Storage Options
« on: April 05, 2019, 05:39:49 PM »
Hi

Testing EVE Screen Editor (BT815) with  different storage options, Embedded and Flash options. Msvc_Emulator under MS Visual Studio works 100% OK for Embedded option but the same image is not displayed when I changed it to Flash options.

Is Flash options supported for Msvc Emulator? Do I need to change code manually in Coprocessor list to make it work? I also notice that for both Embedded and Flash options the generated coprocessor list is the same, listed below:

BITMAP_HANDLE(0)
CMD_SETBITMAP(0, RGB565, 240, 423)
BEGIN(BITMAPS)
VERTEX2II(0, 0, 0, 0)
END()

When Embedded options is selected a constant array is generated in .h file. However, for Flash options there is nothing generated to represent the data array. Any suggestion?

John

10
Hi

I am starting to design a custom PCB for my application with BT815. My host is a SoC with SPI access. A Serial Flash will be onboard for storage of graphic assets (png, wav, video etc). I can see that there is a <Program Flash> utility in EVE Asset Builder to program a Serial Flash via FT4222. From schematic of VM810C a FT4222HQ is onboard that wired to QSPI of BT816. My questions are:

1) If I don't want to include FT4222 on each of my final design PCB (to save BOM cost), is a SPI/QSPI MUX required? Or needing a jumper set to select between FT4222 vs my host?
2) Is the protocol to program a serial flash wired up to BT81x open so that I can include it in my firmware?

John

11
Discussion - Software / Re: FT813 Touch screen response
« on: March 30, 2019, 03:34:26 PM »
I am very pleased to feedback to all of you that, the array TOUCH_DATA_U8[] loaded to RAM_CMD after bootup works like magic.
A single instruction  with

Code: [Select]
Gpu_Hal_WrCmdBufFromFlash(phost,TOUCH_DATA_U8, sizeof(TOUCH_DATA_U8));
inside App_Common_Init(phost) now solving the problem of undetected finger release for FT6206.

Previously I had undetected finger release once out of 4-5 touches. Now I have tested it with usual touches, finger-release undetected no longer there.

Thanks a lot for the support.

I would like to share the file. Below is the file touch_cap_811.h I am using. Have include this header in App_Common.cpp to make it work:

Code: [Select]
#ifndef TOUCH_CAP_811_H
#define TOUCH_CAP_811_H

#define TOUCH_TARGET "811"
#define TOUCH_FUNCTION "cap"
#define TOUCH_VERSION "100"
#define TOUCH_DATA_LEN 1216

#include "Platform.h"

PROGMEM prog_uchar8_t TOUCH_DATA_U8[TOUCH_DATA_LEN] ={
26,255,255,255,32,32,48,0,4,0,0,0,2,0,0,0,34,255,255,255,0,176,48,0,120,218,237,84,
221,111,84,69,20,63,51,179,93,160,148,101,111,76,5,44,141,123,111,161,11,219,154,16,
9,16,17,229,156,75,26,11,13,21,227,3,16,252,184,179,45,219,143,45,41,125,144,72,67,
100,150,71,189,113,18,36,17,165,100,165,198,16,32,17,149,196,240,128,161,16,164,38,
54,240,0,209,72,130,15,38,125,48,66,82,30,76,19,31,172,103,46,139,24,255,4,227,157,
204,156,51,115,102,206,231,239,220,5,170,94,129,137,75,194,216,98,94,103,117,115,121,
76,131,177,125,89,125,82,123,60,243,58,142,242,204,185,243,188,118,156,227,155,203,
238,238,195,251,205,229,71,92,28,169,190,184,84,143,113,137,53,244,103,181,237,87,
253,113,137,233,48,12,198,165,181,104,139,25,84,253,155,114,74,191,0,54,138,163,12,
62,131,207,129,23,217,34,91,31,128,65,246,163,175,213,8,147,213,107,35,203,94,108,
3,111,40,171,83,24,15,165,177,222,116,97,23,188,140,206,150,42,102,181,87,78,86,182,
170,134,215,241,121,26,243,252,2,76,115,217,139,222,206,173,136,132,81,61,35,185,
39,113,23,46,199,76,178,54,151,183,224,0,40,189,28,149,182,58,131,79,152,30,76,34,98,
234,162,216,133,141,102,39,170,40,192,101,53,201,146,191,37,77,44,177,209,74,211,
5,206,187,5,6,216,47,53,96,123,22,50,103,251,192,84,17,74,227,185,56,106,51,91,161,
96,182,163,48,171,141,139,65,152,66,66,11,102,43,158,75,36,80,147,184,147,139,112,17,
235,216,103,111,239,245,92,10,175,194,40,44,58,125,5,59,112,50,103,245,4,78,192,5,
156,194,51,60,191,134,75,110,173,237,46,192,121,156,192,115,184,218,120,67,63,115,
46,11,102,10,97,232,50,235,114,182,148,118,178,41,188,12,135,77,202,124,12,96,238,35,
161,234,189,129,23,249,212,139,230,25,53,48,205,52,93,163,117,53,154,170,81,85,163,
178,70,69,66,167,241,14,46,241,1,226,136,152,179,197,59,184,148,254,49,132,48,15,
176,137,192,76,131,196,105,104,162,86,81,160,165,255,26,173,162,137,86,145,210,183,
192,55,175,194,211,60,91,120,230,184,174,27,41,131,155,40,224,29,87,179,232,16,55,55,
7,165,147,81,23,165,49,101,54,224,75,180,81,108,18,29,226,69,225,110,175,224,42,212,
25,47,130,193,110,234,192,215,252,56,74,162,24,46,251,174,54,106,68,245,14,9,155,
160,22,120,207,104,240,29,90,178,140,28,24,220,47,166,112,61,251,208,192,111,56,239,
238,93,255,251,62,99,32,193,75,61,190,235,123,229,110,218,194,85,79,225,59,98,20,
238,227,235,220,11,221,149,25,180,116,194,159,111,96,192,24,213,59,139,179,156,215,
69,230,19,24,35,135,117,206,171,206,162,67,129,234,61,235,11,104,103,84,64,223,167,
254,40,163,101,92,84,43,150,46,249,219,205,7,116,11,91,104,61,57,75,223,8,48,25,28,
119,252,222,113,49,86,249,74,180,211,156,181,61,215,168,157,7,251,199,150,242,250,91,
58,132,94,121,7,53,151,139,98,6,165,153,69,214,32,110,211,100,101,31,89,45,81,98,
23,205,205,197,209,109,186,198,35,141,191,249,25,60,132,223,153,251,98,20,239,146,139,
20,217,250,41,250,137,58,177,90,57,79,51,108,233,20,253,194,187,49,222,205,114,141,
96,48,175,219,107,54,111,138,22,154,103,108,79,58,252,179,178,79,164,195,2,153,36,
39,170,199,201,167,197,85,106,8,59,177,81,46,56,2,230,75,114,17,55,112,188,65,208,
137,77,114,10,115,55,58,208,197,173,122,87,6,140,110,42,208,124,163,70,108,241,104,
18,245,98,214,187,134,53,42,221,22,182,133,211,116,148,177,194,209,192,85,90,199,58,
55,203,2,229,19,137,187,161,228,154,112,203,145,125,244,188,220,118,228,41,201,181,
41,195,144,215,183,51,80,250,21,217,16,217,200,235,109,227,188,122,218,142,60,170,
224,112,240,184,130,229,224,113,5,223,148,163,80,165,183,130,187,132,116,64,238,161,
85,220,115,139,205,98,227,244,29,102,125,7,37,243,123,223,11,26,92,63,243,116,61,
191,138,123,244,160,84,186,74,31,5,174,247,119,135,199,248,253,135,242,97,102,145,190,
144,14,85,238,221,231,193,158,48,205,25,120,248,15,220,29,158,9,70,185,30,103,229,
33,254,23,237,160,172,62,193,90,222,224,232,14,200,56,90,104,142,227,120,110,6,21,
211,203,65,150,99,151,220,247,87,164,50,159,49,239,234,58,142,0,109,108,123,18,79,
227,36,100,248,222,205,96,127,120,26,171,228,69,63,36,17,252,200,17,116,242,187,227,
88,143,247,2,75,191,6,130,59,188,11,55,240,31,243,122,152,226,183,207,154,73,188,39,
219,43,105,222,87,41,143,141,140,175,73,112,184,252,61,184,16,90,250,35,168,82,119,
176,57,116,94,200,150,22,190,179,44,104,12,235,84,149,102,252,89,154,193,99,228,106,
242,125,248,64,194,255,223,127,242,83,11,255,2,70,214,226,128,0,0,26,255,255,255,
20,33,48,0,4,0,0,0,15,0,0,0,26,255,255,255,32,32,48,0,4,0,0,0,0,0,0,0};

#endif

12
Discussion - Software / FT813 Touch screen response
« on: March 28, 2019, 08:39:00 AM »
Hi

I am porting a new LCD display to FT813 with a CTP controller FT6206 from FocalTech. This controller works with FT813 native hardware wiring to RST, INT, SCL and SDA directly between FT813 and FT6206. CMD_SKETCH() is working but I find sometimes the firmware doesn't detect a finger lift. That means a touch is reported properly with REG_TOUCH_TAG returning the tag number (in my case it is 2). One moment when the finger is lifted REG_TOUCH_TAG returns 0 which is OK, but the other time it just stays 2. This implies the hardware fails to detect a finger release. I have to touch on some other area of the CTP to force REG_TOUCH_TAG return to 0. Is there any method to improve the sensitivity? Is this issue common to other displays (with other CTP controllers)?


Here is my source code for your reference:

Code: [Select]
#include <FT81xImpluino.h> //this is a custom module for FT81x for Arduino

void setup()
{
  Serial.begin(115200);
  FT81xImpl.begin();

  FT81xImpl.DLStart(); //new display list
  FT81xImpl.Clear(1, 1, 1);
  FT81xImpl.Begin(BITMAPS);
  FT81xImpl.Tag(2);
  FT81xImpl.Cmd_Button(84, 30, 300, 200, 31, 0, "Button");
 
  FT81xImpl.Cmd_Track(84, 30, 300, 200, 2);
  FT81xImpl.End();
 
  FT81xImpl.DLEnd();   //equivalent swap()
  FT81xImpl.Finish();  //equivalent wait fifo buffer empty and clean up
}

void loop()
{
  int finger = Gpu_Hal_Rd8(phost, REG_TOUCH_TAG); //low level register read
  Serial.printf("Finger %d\n", finger); //print out REG_TOUCH_TAG continuously
}


Thanks to anyone supporting this.

John

13
Discussion - Software / Partial screen update with FT813
« on: March 16, 2019, 03:09:13 PM »
Hi

Is there any method to do a partial update to LCD screen driven by FT813?
Testing with Msvc_Emulator with a very simple feature. Code snippet is shown below:

Code: [Select]
//Display list to draw something at the top
Gpu_CoCmd_Dlstart(phost);
FuncA_display_object(); //function to display something on top of the screen
App_WrCoCmd_Buffer(phost, END());
App_WrCoCmd_Buffer(phost, DISPLAY());
Gpu_CoCmd_Swap(phost);
App_Flush_Co_Buffer(phost);
Gpu_Hal_WaitCmdfifo_empty(phost);

//2nd display list to draw some other contents a the bottom.
Gpu_CoCmd_Dlstart(phost);
App_WrCoCmd_Buffer(phost, SCISSOR_XY((DispWidth / 2) - 14, (DispHeight - 75)));
App_WrCoCmd_Buffer(phost, SCISSOR_SIZE(32, 32));
App_WrCoCmd_Buffer(phost, CLEAR_COLOR_RGB(255,255, 1));
App_WrCoCmd_Buffer(phost, CLEAR(1, 1, 1));
FuncB_display_object(); //function to display other contents at the bottom of the screen
App_WrCoCmd_Buffer(phost, END());
App_WrCoCmd_Buffer(phost, DISPLAY());
Gpu_CoCmd_Swap(phost);
App_Flush_Co_Buffer(phost);
Gpu_Hal_WaitCmdfifo_empty(phost);

The mindset to run FuncA_display_object() and FuncB_display_object() within a single display list with one swap is not allowed for my case. With code above I can see only the bottom content because the second display list is refreshing the whole screen. I did try to use scissor but this macro only restrict the area to draw in the second display list, the rest of the area including the top part has been erased completely.

Is it something related to SAVE_CONTEXT() & RESTORE_CONTEXT()? and Can somebody help in this ?

Thanks in advance.

John


14
Discussion - Hardware / Re: BT81x to support 1366*768 LCD?
« on: January 22, 2019, 03:15:43 PM »
The reason is that, there is a potential application to show a life video from cmos sensor. We wish to use a large display of 1366*768 to display it in full frame but don't know if it is possible. If not, we would be forced to use a LCD panel of lower resolution.

15
Discussion - Hardware / Re: BT81x to support 1366*768 LCD?
« on: January 21, 2019, 04:29:01 PM »
Hi

A video from your desk will definitely be useful. Look forward to it. It is not hurry.

After studying AN_314 there are still some follow-up questions. On page 4 it states that "The internal graphics RAM of the FT800 is 256k Bytes and as such any image stored on chip must fit into this memory size."
For new BT81x the graphics RAM is 1M bytes. This translates to something like 1366*732*1 byte. Does it mean we cannot fit in a full frame of 1366*768 of 565 color in BT81x? If this is true, how a larger screen of 1280*800 from your desk is supported?


John

Pages: [1] 2