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 - Rudolph

Pages: 1 ... 4 5 [6] 7 8 ... 27
76
Discussion - EVE / Re: Flashing BT815 from ESP32
« on: February 18, 2023, 01:38:36 PM »
My library does support the ESP32: https://github.com/RudolphRiedel/FT800-FT813
This includes DMA for both Arduino (by going around the Arduino SPI class) and ESP-IDF.

And in my example code I show how to write to the flash with flash_update, look for the define TEST_UTF8 which is set to "0" by default.
The part that actually writes the flash-image containing an UTF-8 font is commented out with "#if 0" since it only needs to be run once.

77
Discussion - EVE / Re: ASTC Custom Font from Flash
« on: November 30, 2022, 03:47:49 PM »
Have you checked with CMD_FONTCACHEQUERY how many glyphs are actually used?
In my experience it does not flicker though, using more characters than there is room for in the cache did result in crashes for me.

And I just checked the timings, I am using these as well.
Except for the magic cookie "0xD12" as my library configures the display clock by Hz.
"0xD12" is 51MHz though according to table 4-11 of the datasheet and I am using 51MHz.

How fast do you update the display?
There is flickering when you try to update the display list faster than EVE can display it.
With the given timing parameters the frame rate is 59,76 Hz so the pause between two updates should be
longer than 16.73 ms.

78
Discussion - EVE / Re: 5" EVE Touchscreen Display
« on: November 28, 2022, 05:01:03 PM »
I am using an adapter with a switching regulator for my tests with all kind of breadboards.
https://github.com/RudolphRiedel/EVE_display-adapter/tree/master/L-D5019-08



This is for a supply voltage of 5V to 18V (depending on the regulator) and the voltage
for I/O and backlight is about 3.35V - deliberately a little over 3.3V.

The only challenging part is the FFC connector as it has 0.5 mm pitch.

In regards of the biggest displays that I have connected, I am using the single supply 3.3V version with EVE2-70G and EVE3-70G.

I designed a PCB with two switching regulators specifically for the RVT101HVBNWC00-B as it needs 7V to 12V for the backlight.
This PCB somehow barely also fits mechanically at the back of the RVT70HSBNWC00-B for which I changed the backlight supply to 5V.

79
Discussion - EVE / Re: ASTC Custom Font from Flash
« on: November 23, 2022, 07:32:43 PM »
But that is just a theory for the moment, I am not entirely sure that the 40x40 pixels the font
converter outputs is really the size of the glyph.

The font convertor will take into account all character sizes in the input character set but doesn't not alter the glyph size for each individual character. For example, some characters may extend below the normal font baseline, and some may extend above the average character height, this is taken into account when setting the overall glyph width and height for all characters, so each glyph may be 40*40 but the given character within this glyph may not utilise the full 40*40 pixel size.

Well, that wasn't the question.
The question is if the width and heigth the font converter is reporting is actually the size of the bitmaps
as this looks like this is not necessarily the case:

Generated Folder: NotoSansSC-Regular_36_Extend
Format:           COMPRESSED_RGBA_ASTC_8x8_KHR
Compressed:       thorough
Layout Width:     80
Layout Height:    8
Pixel Width:      40
Pixel Height:     64

Generated Folder: NotoSansSC-Regular_36_Extend
Format:           COMPRESSED_RGBA_ASTC_10x5_KHR
Compressed:       thorough
Layout Width:     64
Layout Height:    8
Pixel Width:      40
Pixel Height:     40

The same font converted to the same target size should not have a height of 64 for ASTC 8x8 and
a height of 40 for ASTC 10x5.

Using a smaller size I get this:
Generated Folder: NotoSansSC-Regular_32_Extend
Format:           COMPRESSED_RGBA_ASTC_8x8_KHR
Compressed:       thorough
Layout Width:     64
Layout Height:    5
Pixel Width:      32
Pixel Height:     40

And the only reason I am asking is that knowing the sizes of the glyphs in bytes helps with setting up the fontcache.
Well, maybe that is something that the font converter could output in addition, bytes per glyph.

Quote
As a side note, I wish we had more than 32 bitmap-handles and could setup/query more than one font cache. ;)

I believe this is being looked at for future EVE revisions.

Best Regards,
BRT Community

Not that I am unhappy with BT817 but nice.  :)
If I were asked, I would have a few more ideas to add. :D

80
Discussion - EVE / Re: ASTC Custom Font from Flash
« on: November 23, 2022, 07:07:49 PM »
Just a comment about "It does not seem to do anything though, at least not in regards of saving the pixel engine from crashing when there is not enough time per line.":
I tried enabling and disabling REG_ADAPTIVE_FRAMERATE on a project which needs to display a lot of text. It uses also a custom font in the flash.
I analyzed it with an oscyloscope and could see the differences. If you enable it (= using the reset value) you can see the Display clock pin having breaks/pauses in between the usual frequency which you setup.
I was also able to view the influence of that setting right on the display: In a displaylist which is using the processing limits (so again a lot of text loaded from flash) my display started to flicker a lot when I enable REG_ADAPTIVE_FRAMERATE. If I disable it it just stops showing the most right part of the display because it cannot handle it in time.

And I aggree that having multiple font caches for different fonts / sizes would be great. The font cache of BT817 is a huge advantage compared to the BT815 in my opinion.

Nice, thank you for adding more data!
What I failed to mention is that I used to read REG_FRAMES to measure the effect and while it is called adaptive framerate there was no drop in framerate when deliberately trying to stress out EVE with complicated lines.
But missing clocks on the pixel clock should have that effect and now I doubt that my measurement was correct.


81
Discussion - EVE / Re: ASTC Custom Font from Flash
« on: November 23, 2022, 04:10:10 PM »
You can find an example of how to utilise CMD_FONTCACHE at the following:
https://github.com/BRTSG-FOSS/EveApps/blob/825eaeb620274d29082388f448a263525d5fa886/SampleApp/Font/Src/Font.c

As a side note, I wish we had more than 32 bitmap-handles and could setup/query more than one font cache. ;)

Quote
As for Adaptive frame rate, you can write the register during your initialization sequence, during your 'configuration of LCD' block, but the LCD must support this feature if it is to be beneficial.

REG_ADAPTIVE_FRAMERATE has a reset value of 0x1 so it is enabled by default.
It does not seem to do anything though, at least not in regards of saving the pixel engine from crashing when there is not enough time per line.

REG_AH_HCYCLE_MAX has a reset value of 0x0 so adaptive HSYNC is disabled by default.
Hence my recommendation:
"Setup REG_AH_HCYCLE_MAX to for example HCYCLE + 500, the reset value is zero."

82
Discussion - EVE / Re: ASTC Custom Font from Flash
« on: November 23, 2022, 03:40:57 PM »
startOfCache (ptr) will be the address from the RAM_G with 64-byte aligned.
cacheSize (num) will be the size of characters I wan to this display in 4 byte aligned. Here will be 100 * 1024.

Is this correct?

No, not exactly, see what I wrote.
The size of one glyph is the amount of pixels multiplied with the bits per pixel from the compression.
And each glyph needs to be stored 32 byte aligned.

ASTC 8x8 uses 2 bits per pixel:
40 * 40 * 2 = 3200

ASTC 10x8 uses 1.6 bits per pixel:
40 * 40 * 1.6 = 2560 (2560 % 32 = 0)

ASTC 10x6 uses 2.13 bits per pixel:
40 * 40 * 2.13 = 3408 -> 3424 (3408 % 32 = 16)

But that is just a theory for the moment, I am not entirely sure that the 40x40 pixels the font
converter outputs is really the size of the glyph.

83
Discussion - EVE / Re: ASTC Custom Font from Flash
« on: November 20, 2022, 08:47:17 PM »
This is likely to be a bandwidth issue between the BT817 and the SPI-Flash.
I converted NotoSansSC-Regular.otf with your table and EAB outputs 48x48 pixel for the glyhs for a size of 36.

So the first thing you can try is to use much smaller fonts, like 24.
Just to test this.
24 is converted here to 24x32 pixel and is using ASTC 8x8 on setting "auto".

If that works with more characters this is a bandwidth issue.

 
Next you can setup the font-cache for the larger font, see CMD_FONTCACHE.
This way a subset of glyphs is fetched from RAM_G.
CMD_FONTCACHEQUERY helps tuning the memory for the cache.

ASTC 10x5 is 2.56 bits per pixel.
So 40 * 40 * 2.56 is 4096.
A glyph needs to be 32 byte aligned but 4096 is divisible by 32.
For 20 chars fontcache we need 4096 * 20 = 81920 bytes.
Note that the start of the cache needs to be 64-byte aligned.

ASTC 8x8 uses 2 bits per pixel:
40 * 40 * 2 = 3200.
20 * 3200 = 64000 bytes

EAB 2.6.1 converts NotoSansSC-Regular.otf to ASTC 8x8 for me when set to "Auto".
Generated Folder: NotoSansSC-Regular_36_Extend
Format:           COMPRESSED_RGBA_ASTC_8x8_KHR
Compressed:       thorough
Layout Width:     80
Layout Height:    8
Pixel Width:      40
Pixel Height:     64
Number of characters in xfont file:      65408
Number of characters in user input file: 292
   Success: 287
   Fail:    5
   Fail code point: 0x5f00, 0x8a00, 0x9000, 0x9600, 0x9700
NotoSansSC-Regular_36_ASTC.xfont and NotoSansSC-Regular_36_ASTC.glyph are generated successfully.

40 * 64 * 2 = 5120
20 * 5120 = 102400 bytes


The "Fail: 5" is interesting as EAB 2.5.1 did not have any fails.

Hmm, when I manually set it to 10x5 I get this:
Generated Folder: NotoSansSC-Regular_36_Extend
Format:           COMPRESSED_RGBA_ASTC_10x5_KHR
Compressed:       thorough
Layout Width:     64
Layout Height:    8
Pixel Width:      40
Pixel Height:     40
Number of characters in xfont file:      65408
Number of characters in user input file: 292
   Success: 287
   Fail:    5
   Fail code point: 0x5f00, 0x8a00, 0x9000, 0x9600, 0x9700

So the same amount of characters for the same map but somehow the glyphs are smaller?
How? Why?

Ok, setting it to 10x8 for 1.6 bits per pixel the result is 40x40 pixel for the glyphs.
40 * 40 * 1.6 = 2560 (2560 % 32 = 0)
20 * 2560 = 51200 bytes


And one last thing.
Setup REG_AH_HCYCLE_MAX to for example HCYCLE + 500, the reset value is zero.

84
Discussion - EVE / Re: CMD_TESTCARD() only shows for a moment
« on: November 09, 2022, 05:15:30 PM »
CMD_TESTCARD does not really need anything, the co-processor takes care of everything.

I just added this in my startup

EVE_cmd_dl(CMD_TESTCARD);
DELAY_MS(5000);

And now the testcard is displayed for 5 seconds.

I am guessing this would be this in the AN25 EVE LIB:

EVE_LIB_BeginCoProList();
EVE_CMD_TESTCARD();
EVE_LIB_EndCoProList();
delay()

So what your code effectively does is to swap the display-list with the testcard out again right away.

85
Discussion - EVE / Re: API inconsistencies
« on: November 07, 2022, 09:27:27 PM »
Well ok, that is -1 if you treat it like an int16_t.  :)
My point was though that the BT81x Programming Guide is using uint16_t result and is saying "Set to -1 on success".
So technically it either is int16_t or it returns 0xffff on success. :-)
And of course you do not get a value out of a function like the API is now.

Another issues I came across is with all the int16_t parameters that do not seem to make sense.
Like int16_t font in cmd_button, cmd_text, cmd_toggle, cmd_keys and cmd_number.
While this is for the BITMAP_HANDLE which has a valid range from 0 to 31.
16 bits is fine, making it 8 bit would require a pad-byte for the commands - but why signed?
And then we have cmd_romfont, cmd_setfont, cmd_setfont2 and cmd_fontcache which all use uint32_t font.

We have int16_t width and height options for cmd_button, cmd_keys, cmd_scrollbar, cmd_sketch, cmd_slider and cmd_progress - why not uint16_t?
cmd_toggle - int16_t width
cmd_clock, cmd_dial, cmd_gauge - int16_t radius

And cmd_calibratesub is using uint16_t for width and height.

So far I did not bother too much, I put in a cast and it worked.
But now that I started to do MISRA-C 2012 checks I had to put in quite a number of extra casts to tell the static code analyzer tool that
I really want to put two int16_t values in one uint32_t value.

This is what I meant by API inconsistencies, if there is no compelling reason to not do this the API in the programming guide would benefit from some cleanup,
make it unsigned wherever possible and wherever negative values are impossible.

I just tried this and it works:
EVE_cmd_gauge(400, 200, 100, 0, 3, 2, 100, 1000);
EVE_cmd_button(400, 300, 100, 100, 28, 0, "Hello!");

This however does not work not at all:
EVE_cmd_gauge(400, 200, -100, 0, 3, 2, 100, 1000);
EVE_cmd_button(400, 300, -100, 100, 28, 0, "Hello!");
EVE_cmd_button(400, 300, 100, -100, 28, 0, "Hello!");
EVE_cmd_button(400, 300, 100, 100, -28, 0, "Hello!");

With all these I get a black screen as if the co-processor is not happy about the commands.
And trying the cmd_button in EVE Screen Editor it actually tells me "Co-processor engine fault".

So why signed parameters when going negative is not an option?

86
Discussion - EVE / Re: Text with newline doesn't work
« on: November 07, 2022, 08:43:28 PM »
I just gave it a spin as well since that reference to EVE_OPT_CENTERY and it just works for me either.

EVE_cmd_text(120, 100, 28, EVE_OPT_CENTER, "Lala\nFoobar");
EVE_cmd_text(120, 160, 29, EVE_OPT_CENTER,"one two\nthree four");

And the other options like EVE_OPT_CENTERX, EVE_OPT_CENTERY, EVE_OPT_RIGHTX or EVE_OPT_RIGHTX|EVE_OPT_CENTERY are also working.

This also does work:
uint32_t args[16];
args[0U] = 1234;
EVE_cmd_text_var(120, 220, 29, EVE_OPT_CENTERY|EVE_OPT_FORMAT,"log:\n%d%%", 1, args);

It does look a little strange with an UTF-8 font though, the spacing between the lines is off, probably because the height of the characters is too high.

87
Discussion - EVE / API inconsistencies
« on: October 31, 2022, 11:17:01 AM »
As I am going thru the MISRA-C report for my library I am finding API inconsistencies.

CMD_BITMAP_TRANSFORM
The given C prototype has "uint16_t result" as last parameter.
While this by itself is not correct and "result" should either be the return value or a pointer,
the description for result is:
"result return. Set to -1 on success, or 0 if it is not possible to find the solution matrix."

Which one is it, uint16_t or int16_t?
And actually the native type for RAM_CMD would be uint32_t.

88
Discussion - EVE / Re: implementing support for formated strings
« on: October 30, 2022, 09:03:43 PM »
MISRA-C 2012 is giving me a hard time for using stdarg.h, va_start, va_end and va_arg - "required".
So varargs needs to go.

I am thinking about using an array of uint32_t as argument since this is what the functions are needing anyways.

void EVE_cmd_text_var(int16_t x0, int16_t y0, int16_t font, uint16_t options, const char* text, uint8_t num_args, uint32_t arguments[])


uint32_t arguments[16U];

arguments[0U] = 0xBEEFBABEUL;
arguments[1U] = 0xCAFEB0BAUL;
arguments[2U] = 23UL;
 
EVE_cmd_text_var_burst(20, 120, 28, EVE_OPT_FORMAT, "same data: 0x%08x 0x%08x 0x%04x", 3, arguments);

Thoughts?


89
Discussion - EVE / Re: Blind effect with draw images
« on: October 27, 2022, 05:25:39 PM »
About the suggestions for a new prefix, I like your prefix EVE_ but if you want to avoid lint notes... maybe something like BT_EVE_ . But I think your prefix is ​​fine, and you shouldn't change it.

At least right now I am going with MISRA C 2012 and ignore the issue. :-)
Usually MISRA checks are out of reach for me and I guess for almost everone who uses my library.
At least I got no report regarding MISRA.
Well, I usually compile with -Wall -Wextra -pedantic and fixed what cppcheck found.

I had the opportunity though to generate a MISRA C 2012 report and that was not pretty.
There will be fixes. :-)

90
Discussion - EVE / Re: Blind effect with draw images
« on: October 25, 2022, 08:05:10 PM »
//lint !e960 Violates MISRA 2004 Required Rule 20.2, Re-use of C90 identifier pattern

How is this identified as a MISRA 20.2 violation?

About the lint is because the defines start with capital letter E.

I am afraid that you are up to something.
I do not have access to the actual C standard right now but it looks like it reserves practically
anthing for defines that starts with "E" - what the heck?

The comment can't be quite right though.

Check https://gimpel.com/demo.html with this snippet:

#include <stdint.h>

#define EVE_PCLK    (9U)
#define EVE_PCLKPOL (2U)

uint8_t hello(const uint8_t var);


uint8_t hello(const uint8_t var)
{
    uint8_t ret = 0U;
   
    if(var < EVE_PCLK)
    {
        ret = EVE_PCLKPOL;
    }

    return ret;
}

There is no rule violation with MISRA C 2012.
And for MISRA C 2004 I get this:
note 980: macro name 'EVE_PCLK' matches a pattern reserved to the compiler because it begins with 'E' and a following uppercase letter [MISRA 2004 Rule 20.1, advisory]

So this is 980 and not 960, rule 20.1 not rule 20.2.

Technically the EVE_ suffix violates the C-standard (because of reasons...), but I dare to say that practically the risk
of colliding with anything that is defined or will be defined for errno.h is close to zero,
if errno.h is even used at all.
Even MISRA 2004 reduced this to "advisory" and at least with PC-LINT this does not show up per default with MISRA 2012.
And at least GCC does not seem to warn about this, not even with -Wextra and -pedantic.
Nothing on https://godbolt.org/ with clang and -Wreserved-identifier either.
Plus, if that actually collides the result will very likely be an ERROR.

So my assesment for my library is that there is no immediate need to change the prefix,
this is something I may address with the next major version.

Anyways, any suggestions for a new prefix?
The EVE_ is just perfect.
I started out with FT8_ but that got old shortly afterwards. :-)
Using BT8_ should be more future-proof but just looking at it I would rather keep EVE_.

Pages: 1 ... 4 5 [6] 7 8 ... 27