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.

Topics - vdc

Pages: [1]
1
Discussion - EVE / Simple way to draw meter
« on: February 03, 2023, 04:25:24 PM »
Hi all,

Is there any simple way to draw a meter? I look at the DemoMeterDemo application and try to understand but this give me a really hard time to follow the code.

I tried with drawing two circle to get the  meter circle. But I have no idea how to get color changed when moving let say arrow.

Let say at 50%, the first half circle is green and the other half is red. I tried with the EDGE_STRIP but it just cover all the other half. Is there any better way to display this?

Thank you so much,

Quote
SCISSOR_XY(300,780)
SCISSOR_SIZE(200,120)
CLEAR_COLOR_RGB(0xff,0xff,0xff)
CLEAR(1, 1, 1)
POINT_SIZE(1600)
BEGIN(POINTS)
VERTEX2F(6400, 14400)
COLOR_RGB(0xFF,0xFF,0xFF)
POINT_SIZE(800)
VERTEX2F(6400, 14400)
END()




2
Discussion - EVE / Calculate String Width in Custom Font
« on: December 16, 2022, 02:47:49 AM »
Hi,

I'm using 1024 x 600 7" display and using NotoSansCJK custom font with size 37

Quote
Font Conversion completed!

Generated Folder: NotoSansCJK-Regular_37_Extend
Format:           COMPRESSED_RGBA_ASTC_8x6_KHR
Compressed:       thorough
Layout Width:     80
Layout Height:    8
Pixel Width:      40
Pixel Height:     48
Number of characters in xfont file:      65408
Number of characters in user input file: 354
   Success: 349
   Fail:    5
   Fail code point: 0x5f00, 0x8a00, 0x9000, 0x9700, 0x9600
There are non-graphic characters filtered out.
NotoSansCJK-Regular_37_ASTC.xfont and NotoSansCJK-Regular_37_ASTC.glyph are generated successfully.

----------------------------------------------------------------------

json file
Quote
{"name": "NotoSansCJK-Regular_37_ASTC", "type": "extendedfont", "astc_block_footprints": "8x6", "size": 37, "base_line": 33, "caps_height": 28, "mid_line": 20, "x_width": 21, "x_offset": 0, "address_type": "FLASH", "address_glyph": 3925440}

I try to calculate the width of the string from the command

Quote
Gpu_CoCmd_Text(phost, 512, 20, FONT_M_HANDLE, OPT_CENTERX, "CONNECT FLUID BAGS, UNCLAMP LINES");

From the information above

"CONNECT FLUID BAGS, UNCLAMP LINES" = 33 characters and based on the converted log pixel width is 40.

33 * 40 = 1320 pixel. This seem not right for me because the display width is 1024 pixels. I'm not sure how the EAB convert the font size and the width for each character.

My goal is try to highlight and change the color of a word in a string (see the attachment) when a flag is set.

If I can get the correct string width in pixels then I can figure out the x/y position of each character so I can draw rects box and change text color dynamically.

Is there any command to get the true width size of a text string or can we set custom font have the same width for each character?



3
Discussion - EVE / ASTC Custom Font from Flash
« on: November 16, 2022, 04:42:30 PM »
Hi,

I have a question. I'm currently working on Chinese Simplified Custom Font that store in the built-in Flash as ASTC (EVE4) with the format.

Quote
Font Conversion completed!

Generated Folder: FZShuSong_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, 0x9700, 0x9600
There are non-graphic characters filtered out.
FZShuSong_36_ASTC.xfont and FZShuSong_36_ASTC.glyph are generated successfully.

----------------------------------------------------------------------

Flash Size for Custom Font
Quote
19.FZShuSong_30_ASTC.glyph                  : 3925440 : 1263360
20.FZShuSong_30_ASTC.xfont                  : 5188800 : 8832   
21.FZShuSong_36_ASTC.glyph                  : 5197632 : 2021376
22.FZShuSong_36_ASTC.xfont                  : 7219008 : 8832 

I use ASTC Speed Veryfast

The problem I got now is I can't display more than 7 characters (UTF-8) using Gpu_CoCmd_Text.

Font Setup
Quote
             
#define LANG_CN_XFONT_30_ASTC_ADDRESS  5188800
#define LANG_CN_XFONT_30_ASTC_SIZE     8832

#define LANG_CN_XFONT_36_ASTC_ADDRESS  7219008
#define LANG_CN_XFONT_36_ASTC_SIZE     8832

//Load font 30
Gpu_CoCmd_FlashRead(phost, RAM_G + 1000000, LANG_CN_XFONT_30_ASTC_ADDRESS, LANG_CN_XFONT_30_ASTC_SIZE);
Gpu_Hal_WaitCmdfifo_empty(phost);

//Load font 36
Gpu_CoCmd_FlashRead(phost, RAM_G + 1000000 + LANG_CN_XFONT_30_ASTC_SIZE, LANG_CN_XFONT_36_ASTC_ADDRESS, LANG_CN_XFONT_36_ASTC_SIZE);
Gpu_Hal_WaitCmdfifo_empty(phost);

Gpu_CoCmd_SetFont2(phost, FONT_S_HANDLE, RAM_G + 1000000, 0);
Gpu_CoCmd_SetFont2(phost, FONT_M_HANDLE, RAM_G + 1000000 + LANG_CN_XFONT_30_ASTC_SIZE, 0);


Quote
Gpu_CoCmd_SetBitmap(phost, RAM_G + 1000000, COMPRESSED_RGBA_ASTC_8x8_KHR, 32, 40);
Gpu_CoCmd_SetBitmap(phost, RAM_G + 1000000 + LANG_CN_XFONT_30_ASTC_SIZE, COMPRESSED_RGBA_ASTC_10x5_KHR, 40, 40);
Gpu_CoCmd_Text(phost, 30, 133/2, FONT_M_HANDLE, OPT_CENTERY, "设置流速");
Gpu_CoCmd_Text(phost, 230, 133/2, FONT_M_HANDLE, OPT_CENTERY, "= 10 ml/min");


Gpu_CoCmd_Text(phost, 30, 133/2 + 133, FONT_M_HANDLE, OPT_CENTERY, "实际流速");
Gpu_CoCmd_Text(phost, 230, 133/2 + 133, FONT_M_HANDLE, OPT_CENTERY, "= 10 ml/min");

Gpu_CoCmd_Text(phost, 30, 133/2 + 266, FONT_M_HANDLE, OPT_CENTERY, "输注量");
Gpu_CoCmd_Text(phost, 230, 133/2 + 266, FONT_M_HANDLE, OPT_CENTERY, "= 0 ml");


Gpu_CoCmd_Text(phost, 550, 133/2 + 133, FONT_M_HANDLE, OPT_CENTERY, "T = 33.8 °C");

// From now on, Text can't take any more.
//Gpu_CoCmd_Text(phost, 550, 133/2 + 266, FONT_M_HANDLE, OPT_CENTERY, "P = 130");
//Gpu_CoCmd_Text(phost, 512, 100, FONT_M_HANDLE, OPT_CENTER, "检查温度探测器窗口是否堵塞");

As I said, after the line T = 33.8 °C. the Cmd can't handle more input string.
The display is going crazy if I try to use display more text. I'm not sure what is the limit of the CMD_Text.
I want to use the ASTC and store in Flash because the table is big.
I'm not sure where I did wrong or how to solve this problem.

Also in some case, if the string of UTF-8 too long, the cmd is also not work and display go crazy again. Is it because UTF-8 take 3 bytes per char? and the Cmd can't handle it?

I'm using RVT70HSBNWC00-B - Riverdi (7" Display with 1024x600px resolution)

4
Discussion - EVE / Display Image Directly from Flash Memory EVE4
« on: August 01, 2022, 05:49:57 PM »
Hi,

I tried to display an image directly from the flash. But it won't display.

This is the code I use to for display
Code: [Select]


#define FLUID_COMPRESSED_ADDRESS 1361024
#define FLUID_COMPRESSED_SIZE 167040
#define FLUID_COMPRESSED_W 360
#define FLUID_COMPRESSED_H 464


Gpu_CoCmd_FlashHelper_SwitchFullMode(phost);
App_WrCoCmd_Buffer(phost, COLOR_RGB(0xFF, 0xCA, 0x18));
Gpu_CoCmd_SetBitmap(phost, 0x800000 | (FLUID_COMPRESSED_ADDRESS / 32), COMPRESSED_RGBA_ASTC_4x4_KHR, 360, 464);
App_WrCoCmd_Buffer(phost, BEGIN(BITMAPS));
App_WrCoCmd_Buffer(phost, VERTEX2F(300*16, 150*16)); // App_WrCoCmd_Buffer(phost, VERTEX2II(300, 150, 0, 0));
App_WrCoCmd_Buffer(phost, END());



Here is the Flash map file.

Code: [Select]
unified.blob                                      : 0       : 4096 
EDF Block                                         : 4096    : 192   
Belmont_Logo_575x272_RGB565.raw                   : 4288    : 312832
FluidBag_358x464_RGB565.raw                       : 317120  : 332224
Prime_Empty_353x504_RGB565.raw                    : 649344  : 355840
Prime_Full_353x504_RGB565.raw                     : 1005184 : 355840
FluidBag_360x464_COMPRESSED_RGBA_ASTC_4x4_KHR.raw : 1361024 : 167040



I based on the example from EAB generated to display, but it doesn't show anything. Do I need to do anything else? In the EAB, I select exhaustive as ASTC Preset, I just wonder if I need to use ASTC Options to make this works.

P/s: If I draw the image from y = 0 then this works. VERTEX2F(300*16, 0*16) OR VERTEX2II(300, 0, 0, 0). This works fine starting at y = 0. But I don't want my image starting from 0. Is there other way to do this?

Best regards,

5
Discussion - EVE / Monochrome Button
« on: July 06, 2022, 03:19:55 PM »
Hi,

Is there anyway I can draw a monochrome button and assign TAG as picture I attached with CMD_BUTTON?

I'm working on replicate the screen from Monochrome display. I can make a MUTE button with CMD_BUTTON, but I can't create a NEXT button. I want to use CMD_BUTTON because I want to use TAG on each button.

is there any way I can make this?

Best regards,

6
Discussion - EVE / EAB 2.5.1 xfont.py not found
« on: May 03, 2022, 03:19:53 PM »
Hi,

I'm using EAB 2.5.1 to convert Simplified Chinese font for BT817Q. However, I got error say that FileNotFoundError xfont.py. See that attached.

Any ways I can fix this? I want to use custom font and store it on the Flash. I follow the EAB 2.5.1 user guide but it keep saying error. Do I need to install any else to fix this error?


Thanks,

7
Discussion - EVE / BT817Q VERTEX2II y not display correctly
« on: June 15, 2021, 02:38:07 PM »
I'm running on BT817Q with 7" display (1024 x 600). I save the image as ASTC 8x8 in Memory flash.

Code: [Select]
    // Draw Logo
    Gpu_CoCmd_SetBitmap(phost, (0x800000 | 4096 / 32), COMPRESSED_RGBA_ASTC_8x8_KHR, 496, 200);
    App_WrCoCmd_Buffer(phost, BEGIN(BITMAPS));
    App_WrCoCmd_Buffer(phost, VERTEX2II(270, 0, 0, 0));
    App_WrCoCmd_Buffer(phost, END());

This code works fine. However, when I try to move the bitmap to difference location then it not display correctly. App_WrCoCmd_Buffer(phost, VERTEX2II(270, 100, 0, 0)). This cause the problem that the screen only display the horizontal lines.


8
Discussion - EVE / TouchScreen with BT817Q
« on: May 13, 2021, 07:25:49 PM »
Hi,

I'm working on Touch Function on BT817Q (Capacitive Touch).

I'm stuck at detecting if Touch is Pressed/Unpressed and Holding.

Quote
   Init.
   touch.status = TOUCH_UNPRESSED;
   
   
   function

   touch.tag = Gpu_Hal_Rd8(phost, REG_TOUCH_TAG);
   
   switch(touch.status){
    case TOUCH_UNPRESSED:                       // When status is Unpressed
        if(tagID != 0){   // pressed            // Check if tagID id valid, not equal 0 mean a button is touched touched
            touch.status = TOUCH_PRESSED;       // Set the status to pressed
            touch.delay = 0;                    // Set the delay time to 0
        }
        break;                                  // break;
    case TOUCH_PRESSED:                         // When status is Pressed. Mean button is pressed or holding
        if(tagID == 0) {                        // this check if the tag id is 0
            touch.status = TOUCH_UNPRESSED;     // Set the touch to unpressed
        }
        else if(tagID != 0) {                    // if the tag is not 0. Mean that button is valid or button is holding
            touch.delay = 0;                    // set delay time to 0
        }
        else {                                   // touch is none
            if(++touch.delay > 10){              // increment delay time before set it to Unpressed
                touch.status = TOUCH_UNPRESSED;
            }
        }

        break;
    default:                                    // Should not be here but in case.
        touch.status = TOUCH_UNPRESSED;
        touch.delay = 0;
    }


and I also have a function to check if PRESSED / UNPRESSED is change

Quote
uint32_t Touch_GetChange(void){
    // Checking between PRESSED / UNPRESSED
    if(touch.status != touch.prestat){
        touch.prestat = touch.status;
        return 1;
    }
    return 0;
}

in main loop,  I run

Quote
// Main loop
if(Touch_GetChange()){
        UARTprintf("TouchChanged \r\n");
}

The problem I have right now is the detect pressed/holding and unpressed is not really working. When I pressed the touch screen and moving my finder between buttons. The tag ID keep changing and Pressed / Unpressed changing. This cause the main loop Touch_GetChange() keep changing between 0 and 1.

What I want to do is detect is a button is pressed.

Quote
If button is pressed or holding
   tag is set but do nothing

If button is released/unpressed
   Trigger tag button function

I also want to set delay between pressed / unpressed to make less touch sensitivity in case someone accident touch the screen and  button trigger function right away.

Anyone have a better idea how to work with touch screen tag ID ?

9
Hi all.

I just got a new EVE4 from Riverdi (RVT70HSBNWC00-B) with 1024 x 600 resolution.

I tried to convert an image to RGB565 bitmap with EVE Asset Builder and I got message that the size of the .raw file from the 1024x600 images is exceeds 1MB. I guess because the RAM_G only have 1MB.

Is there any possible way to convert 1024x600 image file to bitmap that less than 1MB so it can be able to use Gpu_CoCmd_FlashRead to display an image from the flash with this resolution.

I think about other format like PALETTED565 but I found that the RGB565 give the best resolution on my project.

RGB565 is good because it easy to run on MCU code

---------------------------------------------------
Screen_PreCode();

Gpu_CoCmd_FlashRead(phost, RAM_G, 4096, 768000);
Gpu_CoCmd_SetBitmap(phost, RAM_G, RGB565, 800, 480);
App_WrCoCmd_Buffer(phost, BEGIN(BITMAPS));
App_WrCoCmd_Buffer(phost, VERTEX2II(0, 0, 0, 0));
App_WrCoCmd_Buffer(phost, END());

Screen_PostCode();
---------------------------------------------------

This code work perfect for 800x480 since the image I converted to bitmap is less than 1MB.

Any suggestion for 1024x600 resolution? I do see Riverdi also released an 1280x800 resolution on EVE4.



Best regards,

10
Discussion - EVE / BT816 Read CRC Flash
« on: February 03, 2021, 07:29:16 PM »
Hi all,

Is there any way that I can read the CheckSum from the Flash on EVE3 module?

Right now, I'm storing all the image, custom font on the FLash on EVE3 module. But I need to find a way to verify that the data on the flash is correct version with my MCU program. Otherwise, it will display wrong information that I want.

Best regards,

Pages: [1]