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

Pages: 1 [2] 3
16
Discussion - EVE / Re: ASTC Custom Font from Flash
« on: November 21, 2022, 02:51:23 PM »
Hi Rudolph,

Thank you for the response. I tried with font 24, it getting better but if the string a long enough (ex. "堵住位于一次性使用输血通用管路上的排气阀。") , the display still going crazy.

Since I use 1024x600 display. I do need bigger font to fit and easy to read for user. Unless there is upscale for text font. I will try with difference methods as you mentions and see how it works.

Thanks,

17
Discussion - EVE / Re: ASTC Custom Font from Flash
« on: November 17, 2022, 03:09:24 PM »
Here is my sample code. I don't think I use up RAM_DL.
Although my complete program will be more but even with this simple code, it still doesn't work.
I also tried with NotoSansCJK-Regular.ttf font and it does the same thing.

I have attached converted chars that using EAB 2.6.1. I'm not sure how the xfont look up for the character in glyph from flash but everytime I tried with 'H', the display go white. Is there any limitation of ASTC font table from Flash? I know the limit of UTF-8 is 127 if using RAM_G for glyph, but I'm not sure for directly from Flash.

I'm using Code Composer Studio 10.4.0 and also make sure that UTF-8 is enable for text file encoding. (Preferences --> Workspace --> Text file encoding (UTF-8).

Quote
// Font Map
// 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   

#define FONT_S_HANDLE  (1)   // Small Font
#define FONT_M_HANDLE  (2)   // Medium Font


int main(void)
{
   DisplayConfiguration();   // Setup Display, SPI at 16Mhz, 1024x600
    Gpu_CoCmd_FlashHelper_SwitchFullMode(phost);   // Switch Built-In flash to FULL MODE
   
   // Load XFont from Flash
   //Load font 30
   Gpu_CoCmd_FlashRead(phost, RAM_G + 1000000, 5188800, 8832);
   Gpu_Hal_WaitCmdfifo_empty(phost);

   //Load font 36
   Gpu_CoCmd_FlashRead(phost, RAM_G + 1000000 + 8832, 7219008, 8832);
   Gpu_Hal_WaitCmdfifo_empty(phost);
   
   while(1){
      // Screen PreCode
      Gpu_CoCmd_Dlstart(phost);
      App_WrCoCmd_Buffer(phost, CLEAR_COLOR_RGB(0, 0, 0));
      App_WrCoCmd_Buffer(phost,CLEAR(1,1,1));


      // Set Font Handle
      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);

      App_WrCoCmd_Buffer(phost, COLOR_RGB(0xFF,0xCA,0x18));

      // Reset Font BitMap (to make sure the bitmap is at correct xfont in case previous SetBitMap for image in use)
      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");

      //Gpu_CoCmd_Text(phost, 550, 133/2 + 266, FONT_M_HANDLE, OPT_CENTERY, "P = 130 mmHg");

      //Gpu_CoCmd_FillWidth(phost, 50);
      // Gpu_CoCmd_Text(phost, 10, 100, FONT_M_HANDLE, 0, "值停力功加务动储修入\n关其匹升卡却器一上下\n不与中\n主和品分到制\n前传位低");


      // Screen PostCode
      App_WrCoCmd_Buffer(phost, DISPLAY());
      Gpu_CoCmd_Swap(phost);
      App_Flush_Co_Buffer(phost); //Download the commands into fifo
      while(EVE_busy()); // Gpu_Hal_WaitCmdfifo_empty(phost); //Wait till coprocessor completes the operation   

      // Delay(100ms)
   }

   return 0;
}


p/s: I'm try to get the BRT_AN_042 from https://brtchip.com/software-examples/eve-examples/ but the links doesn't work anymore. Is there any where I can download this file?
Thanks,

18
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)

19
Discussion - EVE / Re: Monochrome Button
« on: October 03, 2022, 12:53:06 AM »
Hi Rudolph,

How do you count the numbers of sequence  use in this. I can only count up to 31, how it is 38?

Thanks,

Yes, I regulary use two rects over each other to draw frames.
An alternative would be using LINE_STRIP, but then the width of the frame depends on LINE_WIDTH so you can't have rounded corners and thin frames with LINE_STRIP.

Try this in EVE Screen Editor:

Code: [Select]
CLEAR_COLOR_RGB(0,0,0)
CLEAR(1, 1, 1)
LINE_WIDTH(80)
BEGIN(RECTS)
COLOR_RGB(255,215,0)
TAG(100)
VERTEX2F(1600, 1600)
VERTEX2F(3200, 2240)
TAG(110)
VERTEX2F(1600, 2560)
VERTEX2F(3200, 3200)
COLOR_RGB(0,0,0)
TAG(110)
VERTEX2F(1632, 2592)
VERTEX2F(3168, 3168)
END()
TAG(100)
COLOR_RGB(0,0,0)
CMD_TEXT(150, 120, 28, OPT_CENTER, "MUTE")
TAG(110)
COLOR_RGB(255,215,0)
CMD_TEXT(150, 180, 28, OPT_CENTER, "NEXT")
TAG(0)

As for efficiency, this sequence uses 38 32bit words on the display-list.
The only way to get away with less would be to use images for the buttons.
In contrast, a single FLAT button with the text "MUTE" uses 16 or 20 32bit words, depending on the posistion of the screen, just the button without TAG or color commands.

Doing this in discrete commands also allows to split the display list in a part that is static and therefore only needs to be transferred once (see CMD_APPEND) and the part that is transferred for every refresh because it changes.

In this example the first rectangles could be moved to the static section.

You could easily add visual feedback to this by for example not drawing the second
rectangle when the button is touched and changing the color of the text to black.

20
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,

21
Discussion - EVE / Re: Monochrome Button
« on: July 11, 2022, 04:34:37 PM »
Hi Rudolph,

I do another way that draw a bigger gold color button and then draw a smaller black color button inside and it still works.

Which one is more effective? Two buttons OR Rects and Button?

Best regards,

22
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,

23
Discussion - EVE / Re: EAB 2.5.1 xfont.py not found
« on: May 06, 2022, 02:20:22 PM »
I use the font that found in sample application (EveApps v1.2-rc3\EveApps\DemoUnicode\Test\font) font_chinese._simkai.ttf and NotoSansCJK-Regular.ttf

This error show I'm missing the xfont.py
Is this related to the Python Library?

Best regards,

24
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,

25
Discussion - EVE / Re: BT817Q CMD_SPINNER fails
« on: February 08, 2022, 03:17:33 PM »
Is there any way we can make display() macro run first before swap? Because I have a code that run the display every 100Hz. With other EVE, that work fine. But with EVE4. When I run the Spinner before Display() cmd. I do see a delay refresh rate. Like button color change when pressed.

26
Discussion - EVE / Re: BT817Q VERTEX2II y not display correctly
« on: June 16, 2021, 04:16:22 PM »
The problem only happen if I change the Y-position. I changed the code to RGB565 and load the image to the RAM_G and it works fine. I guess I have to go that way for now.

I'm getting a new EVE4 7" from Riverdi and see if because the hardware problem.

27
Discussion - EVE / Re: BT817Q VERTEX2II y not display correctly
« on: June 15, 2021, 04:26:36 PM »
Hi. I tried both with VERTEX2F and VERTEX2II

Code: [Select]
    // Draw Belmont 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, VERTEX2F(270*16, 0*16));
    App_WrCoCmd_Buffer(phost, END());

This works fine. IMG_8120.JPG

When I change the Y.

Code: [Select]
    // Draw Belmont 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, VERTEX2F(270*16, 1*16));
    App_WrCoCmd_Buffer(phost, END());

Will not display. Please see the attach. IMG_8121.JPG

I configure the display as below.
Code: [Select]
/* Default is IPS 1024 x 600 */
#define DispWidth     1024L
#define DispHeight    600L
#define DispHCycle    1344L
#define DispHOffset   160L
#define DispHSync0    0L
#define DispHSync1    100L //70L
#define DispVCycle    635L
#define DispVOffset   23L
#define DispVSync0    0
#define DispVSync1    10L
#define DispPCLK      1
#define DispSwizzle   0
#define DispPCLKPol   1
#define DispCSpread   0
#define DispDither    1 //0
#define DispPLCLKFREQ  0xD12        // 51Mhz
#define DispPCLK2x     0


28
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.


29
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 ?

30
Hi,

I used COMPRESSED_RGBA_ASTC_4x4_KHR and I do see some lost of quality. Is there any other option that can keep the quality as same as RGB565?

Thanks,

Pages: 1 [2] 3