BRT Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

Welcome to the Bridgetek Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ Bridgetek Support

Please refer to our website for detailed information on all our products - Bridgetek - Bridging Technology

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - karst.drenth

Pages: [1] 2
1
General Discussion / Variables of type "cstring"
« on: February 15, 2024, 03:07:53 PM »
Hi,

For some projects, I need to have the Text property of an ESD_TextBox to be editable ( I need it a.o. for a OS_Keyboard )
I looked in the Keyboard example and saw the use of "cstring" there. As I wanted so be sure that each instance has it's own storage, I checked the generated code.

To my asthonisment, I saw that in the EVE_Header files "cstring" is just a typedef of "const char*" which in turn means, that I will be writing directly in "some" memory where the default value is kept  :o

Is there anybody out there who can wake me up from this bad dream  ;D I am probably missing something, but can't figure out what.

Greets and already thanks for an answer,
Karst


2
Discussion - EVE / Couple of ESD questions / remarks
« on: April 11, 2022, 11:18:03 AM »
Hi All,

Now that I got my new HAL going, I am speeding up the development of my App.

Some things cross my mind....

1) Does somebody have implemented an OSK ( On Screen Keyboard ) ? My App needs to enter alpha-numeric settings.

2) Is there an Editable TextBox somewhere ?

3) AFAICS, CMD_KEYS does not seem to be implemented in ESD, does somebody have an example how to bind this into ESD generated code ?

In the attachment, the OSK which I crafted in ESD. It's nice and probably would work. But... It generates an enormous display_list, so that it won't display :(

Greets and thnx in advance for any answer,

Karst

3
Here comes the HALimpl :)

It is based upon Rudolph's Arduino Library as an API to the Arduino.

The App_Generated.c file is output from ESD. It just needs commenting out the "main()" function and the Application definition.

like this:

Code: [Select]
//static App application;
//static Esd_Context s_Esd;

void App__Start(App *context)
{
App__Initializer(context);
App_Start(context);
}

//int main(int argc, char *argv[])
//{
// Esd_Initialize();
//
// {
// Esd_Parameters ep;
// Esd_Defaults(&ep);
// ep.UserContext = &application;
// ep.Start = (Esd_Callback)App__Start;
// ep.Update = (Esd_Callback)App_Update;
// ep.Render = (Esd_Callback)App_Render;
// ep.Idle = (Esd_Callback)App_Idle;
// ep.End = (Esd_Callback)App_End;
// if (!Esd_Open(&s_Esd, &ep))
// return EXIT_FAILURE;
// }
// Esd_Loop(&s_Esd);
// Esd_Close(&s_Esd);
//
// Esd_Release();
// return EXIT_SUCCESS;
//}

which is then replaced in the .ino by:

Code: [Select]
void setup()
{
pinMode     (SWITCH,  INPUT);

pinMode (EVE_PDN, OUTPUT); // keep EVE in Reset (PD ==> PowerDown)
digitalWrite(EVE_PDN, LOW);

pinMode (PIN_SPI_SS, OUTPUT);
digitalWrite(PIN_SPI_SS, HIGH); // deselect EVE

pinMode (PIN_SPI1_SS, OUTPUT);
digitalWrite(PIN_SPI1_SS, HIGH); // deselect Flash

pinMode (PIN_SPI2_SS, OUTPUT);
digitalWrite(PIN_SPI2_SS, HIGH); // deselect FPC

pinMode     (LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, HIGH);

SerialUSB.begin(115200); // USB
Serial1 .begin(  9600); // ES_Link
Serial2  .begin( 16667); // LocoNet

Flash.begin(SPI1, PIN_SPI1_SS); // SerialFlash does the SPI startup by itself

SPI2.begin(); // start the display SPI
init_ST7701_Display(); // configure and start the display

SPI.begin(); // startup EVE's SPI
SPI.beginTransaction(EVE_SPI_SETTINGS);

TFT_init(); // Make EVE start working
TFT_display();

  delay(500);
arduino_printf("hello, Display is up :)");

int times = 180;
while (times--) {
  delay(26);
  TFT_display();
rotate += 2;
}

if (digitalRead(SWITCH) == 0) {
TFT_calibrate();
while (digitalRead(SWITCH) != 0);
while (digitalRead(SWITCH) == 0);
}

arduino_printf("hello, EVE is up :)");

Esd_Initialize();

Esd_Parameters ep;
Esd_Defaults(&ep);

ep.UserContext = &application;
ep.Start = (Esd_Callback)App__Start;
ep.Update = (Esd_Callback)App_Update;
ep.Render = (Esd_Callback)App_Render;
ep.Idle = (Esd_Callback)App_Idle;
ep.End = (Esd_Callback)App_End;

if (Esd_Open(&s_Esd, &ep)) {
EVE_HalContext* phost = &s_Esd.HalContext;
Esd_SetCurrent(&s_Esd);
Esd_Start(&s_Esd);

Esd_Started = true;

application.App_Screen.Main_Page.DDC_Logo_Input    = DDC_Logo_Input;
application.App_Screen.Main_Page.DCC_Logo_Rotation = DDC_Logo_Rotation;
}
else {
TFT_display();
}

SerialUSB.println("setup() done");
}


that's "setup()"

and in "loop()"

Code: [Select]
display_delay++;

// refresh the display every 20ms or 5 ms when ESD is running
if (display_delay > 4) {
display_delay = 0;

micros_start = micros();

if (Esd_Started) {
if (toggle_state != 0)
if (++rotate == 360)
rotate = 0;

Esd_Update (&s_Esd);
Esd_Render (&s_Esd);
Esd_WaitSwap(&s_Esd);
}
else
TFT_display();

micros_end = micros();

num_profile_a = (micros_end - micros_start); // calculate the micro-seconds passed during the call to TFT_display
}

Grettz,
Karst

4
Hi,

Sorry, have been offline quite a long time due to Covid 19 infection  :(

But you can look at the attached files and look for the string YD7201 in the files.

In the next post I will post also the new HALImpl ;)

Greets,
Karst

5
Hi,

Thanks for the info (y)

I will try and let you know the result :)

Greets,
Karst

6
Hi,

Thanks @BRT Community

That is exactly what I planned to do :)

But...

"...Write the CTPM configure register address and value to the BT815 designated memory location..."

Big question: Which is BT815 designated memory location ??  ;)

Greetz,
Karst

P.S. my "problem" is no longer urgent, since I switched to another Display which has a way better CTP ;) But it will emerge again at the moment I want to (re-)use the old display

7
Hi,

Self-answer to Question 2:

Code: [Select]
----------------------------------------------------------------------
GT911-Custom.eab compilation is in progress...
Microcode 'capcs.fs' uses 1100 bytes.
Loader command stream is 368 bytes
350 new bytes in firmware
Compilation is done.
----------------------------------------------------------------------
GT911-Custom.eab compilation is in progress...

Cross-compilation failed - exiting

in file included from *the terminal*:0
in file included from *the terminal*:-1
in file included from cross.fs:242
capcs.fs:361: error: Undefined word
begin loop
Backtrace:
0 $FFA47D28 throw
1 $FFA4A1F0 no.extensions 
Compilation failed!

I tried to compile this:

Code: [Select]
/*

The tiny language resembles C in syntax.

It allows:
  - functions, of "void" and "int" type
  - constructs, if .. else, while and do .. while loops
  - local variables, of "int" type only
  - integer arithmetic (no / or %)

The end-user defines three functions:
  - i2c_addr() which returns the I2C address
  - setup() one-time initialization
  - loop() poll the CTP and update the touch sensing registers

In addition a number of built-in functions are available for IO in the user's code. Together these form a simple HAL.

  - void delay_ms(n)              // delay for n milliseconds
  - void delay_us(n)              // delay for n microseconds
  - void i2c_regwr(u, v)          // write value v to register u
  - void i2c_startread(u)         // start a read from register u
  - int i2c_read16le()            // read 16 bits from I2C, little-endian
  - int i2c_read16be()            // read 16 bits from I2C, big-endian
  - int i2c_read8()               // read 8 bit from I2C
  - void i2c_stop()               // end the I2C read
  - void report_touch(id, x, y)   // set the touch sensing registers
  - int getINT()                  // get the INT input
  - void setINT(u)                // set INT open-drain
  - void setWAKE(u)               // set WAKE output
  - int getCYA()                  // get the CYA register value
*/


/* This code assumes CTP reports n_touches = 0 during last touch interrupt at finger-up */
int i2c_addr()
{
  return 0x38;
}

int setup()
{
  setWAKE (0);
  delay_ms(3);
  setWAKE (1);
  delay_ms(300);
}

//void rtouch()
//{
//  int x    = i2c_read16be() & 0xFFF;
//  int id_y = i2c_read16be();
//
//  report_touch(id_y >> 12, x, id_y & 0xFFF);
//}
//
//void loop()
//{
//  while (getINT() == 1) // wait for INT to go low
//    ;
//
//  i2c_startread(0x02);
//
//  int n_touches = i2c_read8();
//
//  while (n_touches != 0) {
//    rtouch();
//    n_touches = n_touches - 1;
//  }
//
//  i2c_stop();
//}

So loop() is mandatory.  :(

@BRT Community

Is it possible to post the source code of the ROM-micro-code for the GT911 ?

Greetz,
Karst

8
Hi,

I have a similar need. The CTP of my display seems to be pretty noisy...  :'( ( many false touches detected )

It has the GT11 chip on there. Reading the GT11 Manual/Programming guide, there is a setting for noise reduction. ( and some more settings that cope with ESD and noise problems )

Question 1: what are the BT815 factory firmware's settings for the GT11
Question 2: is the "custom firmware" method also able to only have a "setup" function and let "loop" just be done by the original firmware ?
Question 3: if 2) not is possible, what is the ROM's firmware source for the "loop" equivalent ?

Grtzz,
Karst

9
Discussion - EVE / Re: List of QSPI FLASH Chips for BT81x
« on: November 30, 2021, 09:42:30 AM »
ManufacturerChipSize(MBit)DetectEraseRead/WriteCMD_FLASHFAST
WinbondW25Q256JV256YesYesYesYes


10
Attachment 3

11
Attachment 2

12
Hi All,

One day further down the road, but for sure really on top of the hill  ;D

It's done and it works  8)

https://youtu.be/kIJu7Trx1sk

In the video you can see first the EVE Screen Designer 4.14.0 in which I designed my Application, then the camera panned to my module.
The first screen is the one from yesterday, coded with Rudolph's library. I still haver a bit of trouble with the touchscreen. Sometimes does not react at all, sometimes it generates "ghost" taps :(
Then after about 5 seconds the generated EVE App takes over.

I built the HAL based upon Rudolph's library routines. Which was pretty straight forward  8)

The first attachment shows the parts which I included in the Arduino sketch's setup() and loop().
The second attachment shows the only mods ( the comments ;) ) to be done in the generated code... not too bad is it ?

Attachment 3 contains the HAL I crafted :P

Greets,
Karst

13
Hi,

A little progress-report :)

Quote from: pauljiao
ESD will generate the ANSI C code for the selected platform.
Arduino is using its own C++ variety language to program. 
However, I think it is possible to build C for MCU on the Arduino board. 

Yes it is. But it can either have all it's code together with it's INO file or in the libraries folder each library in it's own directory.

So the trick I used is using "Junction-Links" to an MSVC exported version's generated libraries ( see attachment 1 ), then just listing the "main" header files of the ESD generated code in the INO ( see attachment 2 ) .

This will automagically pull-in all the ESD generated code  8) ;D

But... since ESD relies heavily on compile-time defines, the last thing is to take these defines from the MSVC project file and enter them in the Arduino boards.txt definition file as "extra_flags"

Then when it all compiles error free, it will generate a bunch of "undefined references" during link-time. ( only when also "App.h" is also present in the INO )

So...

Quote from: pauljiao
You may need to modify the code in the HAL of the ESD-generated application. You may refer to this porting guide:

Yep, better not modify, but write your own HAL_Impl. Which is my next challenge ;)

All the new platform definition stuff is done by editing EVE_Config.h, EVE_util.h, EVE_util.c and EVE_Platform.h ( if anybody is interested, tell me, I'll upload them here ;) )

Greets,
Karst

14
New Member Introductions / Re: New on the community, very interested in EVE
« on: November 24, 2021, 04:08:43 PM »
Hi all,

I really like your work Rudolph  8) very good !

Below as a video I made of my new device :)

https://www.youtube.com/v/teS-e2y24jo

Just needed a couple of hours digging around in your (sample) code and I could easily make this nice looking demo ! ( which I designed before in ESD, just copied the coordinates and sizes )

Greets,
Karst

15
Hi Paul,

Thanks for the link, I will study it and see what's in there for me :)

At first glance, it looks like exactly what I need !  8)

Greets,
Karst

Pages: [1] 2