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

Main Menu
Menu

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.

Show posts Menu

Messages - pauljiao

#16
Here is an example code in python to access the registers of flash:

def bb(*b):
    return pad4(array.array('B', b).tostring())

def txrx(eve, txpart, n_rx):
    eve.cmd_flashspidesel()
    eve.cmd_flashspitx(len(txpart))
    eve.c(bb(*txpart))
    eve.cmd_flashspirx(0, n_rx)
    if n_rx:
        eve.finish()
        return array.array('B', eve.rdstr(0, n_rx))

def do_sfdp(eve):
    """ Dump the SFDP area in binary """
    eve.cmd_flashdetach()
    eve.cmd_flashspidesel()

    eve.cmd_flashspitx(1)
    eve.c(bb(0x9f))
    eve.cmd_flashspirx(0, 3)
    eve.finish()
    print repr(array.array('B', eve.rdstr(0, 3)).tolist())
#17
Discussion - EVE / Re: ARGB4 image corruption.
January 20, 2021, 02:45:30 AM
how do you get ARGB4 bitmap ? through PNG decoding from cmd_loadimage at run-time or pre-processing PNG into ARGB4 through EAB?
#18
If the glyph is in ASTC and stored in flash, the address shall offset from 0x800000.
See the picture from programming guide
#19
You may check the EvChargePoint example project ,which is under installation path
"Examples\Advanced"
#20
Discussion - EVE / Re: Auto-increment on spinner
November 02, 2020, 09:21:20 AM
what is spinner button? do you mean "ESD SpinBox" Widget?

#21
Discussion - EVE / Re: ESD 4.8 - STM32 - Image
July 22, 2020, 10:30:04 AM
I rememeber the default location of assets is on the SD card unless it is specially designated to flash.
#22
Discussion - EVE / Re: Image corruption
June 24, 2020, 03:39:07 AM
T.Pierret, Glad to know your issue is fixed.

The coprocessor command cmd_setbitmap is just to generate a series of display list for graphics engine:

bitmap_source()
bitmap_layout()
bitmap_layout_h
bitmap_size
bitmap_size_h
bitmap_ext_format (if required)




Quote
In the current case, the splash image is 800x480 and the icons, 80x80. Why are they requested however?

The bitmap_size_h/bitmap_layout_h set by splash image(larger image) changed the graphics context and it kept effective until it is changed by the following display list. I think it may cause the issue of displaying smaller icon.
#23
For calibration process of capacitive touch screen, it shall be done in compatability mode (single touch) only.

It is not possible to do the calibration at the extended mode.

So to read the final touch point coordinate (after the calibration process),  REG_CTOUCH_TOUCH_XY at address 0x302124  shall be read.  The coordinate before the calibration process is stored to REG_CTOUCH_RAW_XY at 0x30211c.   

These are what I understand from programming guide.
#24
Discussion - EVE / Re: Image corruption
June 23, 2020, 09:32:28 AM
Several comments:
1)  is the JPEG image displayed correctly before the icon is shown?
2)  Suggest to use cmd_setbitmap at 4th step (Display Icon) because it will take care of bitmap_layout_h/bitmap_size_h, which was generated in JPEG image loading.  If not, better send
bitmap_layout_h and bitmap_size_h with bitmap_layout and bitmap_size commands.  Otherwsise,
it may have issues if these commands have affected the graphics context.
#25
Discussion - EVE / Re: UTF-8 Encoding Error
May 08, 2020, 04:48:19 AM
Simon, as far as I knew, rendering the glyph from flash needs
1) The glyph is based on ASTC.
2) The starting address in flash shall be 64 bytes aligned.  From the screenshot, you may see the address 10000 is not 64 bytes aligned.

#26
Discussion - EVE / Re: BT816 : flash reading fail
May 08, 2020, 04:24:27 AM
As far as I knew,  BT815/6 cannot work with a blank flash chip.  It requires a flash driver called blob locating at the first block of the flash chip.  After erasing of the flash, the first block of the flash chip might be erased too.  So you may need reprogram the blob to the flash before reading/writing.  The Blob file can be obtained from EAB.
#27
Discussion - EVE / Re: issue with EVE Asset Builder 1.2.0
February 11, 2020, 02:14:55 AM
It seems the "dithering" feature in EAB does not work well on all the cases.
I suggest to disable the "dithering" by calling command line with option "-d" such as:

".\eab_tools.exe  image_convert -i inputFile.png -f ARGB1555 -d "

".\eab_tools.exe" is located at installation path of EAB.
#28
You can try to update the file "Ft_Esd_CircleLine.c" under "Libraries\Ft_Esd_Widgets" folder of ESD installation path with the following content:
It will enable the alpha property of ESD circle line widget after you reboot the ESD.

Quote
#include "Ft_Esd.h"
#include "Ft_Esd_Dl.h"
#include "Ft_Esd_CircleLine.h"

extern Ft_Gpu_Hal_Context_t *Ft_Esd_Host;

void Ft_Esd_CircleLine_SetDSTAlpha();
void Ft_Esd_CircleLine_ClearDSTAlpha();
void Ft_Esd_CircleLine_Draw_Point(int x, int y, int radius);
void Ft_Esd_CircleLine_Draw_Point_Float(ft_float_t x, ft_float_t y, ft_float_t radius);
void Ft_Esd_CircleLine_Draw_Square(int x, int y, int side);

ESD_METHOD(Ft_Esd_CircleLine_Render_Func, Context = Ft_Esd_CircleLine)
ESD_PARAMETER(x, Type = int)
ESD_PARAMETER(y, Type = int)
ESD_PARAMETER(radius, Type = int)
ESD_PARAMETER(border, Type = int)
ESD_PARAMETER(color, Type = ft_argb32_t)
void Ft_Esd_CircleLine_Render_Func(Ft_Esd_CircleLine *context, int x, int y, int radius, int border, ft_argb32_t color);

void Ft_Esd_CircleLine_Render_Func(Ft_Esd_CircleLine *context, int x, int y, int radius, int border, ft_argb32_t color)
{
   if (radius < 0)
      return;
   int a = ((color & 0xFF000000)) >> 24;
   int r = ((color & 0x00FF0000)) >> 16;
   int g = ((color & 0x0000FF00)) >> 8;
   int b = ((color & 0x000000FF));
   int innerRadius = radius - border;
   if (innerRadius < 0)
      innerRadius = 0;

   Ft_Esd_Primitive = 0;
   Ft_Gpu_CoCmd_SendCmd(Ft_Esd_Host, SAVE_CONTEXT());

   Ft_Esd_Rect16 scissor = Ft_Esd_Rect16_Crop(context->Widget.GlobalRect, Ft_Esd_Dl_Scissor_Get());
   Ft_Gpu_CoCmd_SendCmd(Ft_Esd_Host, SCISSOR_XY(scissor.X, scissor.Y));
   Ft_Gpu_CoCmd_SendCmd(Ft_Esd_Host, SCISSOR_SIZE(scissor.Width, scissor.Height));
   
   Ft_Gpu_CoCmd_SendCmd(Ft_Esd_Host, COLOR_MASK(0, 0, 0, 1));

    //Draw the rectangle covering whole circle with alpha value 0
   Ft_Esd_CircleLine_ClearDSTAlpha();   
   Ft_Esd_CircleLine_Draw_Square(x - radius - 1, y - radius - 1, (radius * 2) + 2);
   
   //Draw outer circle with desired alpha value
    Ft_Gpu_CoCmd_SendCmd(Ft_Esd_Host, COLOR_A(a));
   Ft_Esd_CircleLine_SetDSTAlpha();
   Ft_Esd_CircleLine_Draw_Point(x, y, radius);
   
   //Draw inner circle with alpha value 0
   Ft_Esd_CircleLine_ClearDSTAlpha();   
   if (innerRadius > 0)
   {
      Ft_Esd_CircleLine_Draw_Point(x, y, innerRadius);
   }

   // Finally draw final color 
   Ft_Gpu_CoCmd_SendCmd(Ft_Esd_Host, COLOR_RGB(r, g, b));
   Ft_Gpu_CoCmd_SendCmd(Ft_Esd_Host, COLOR_A(a));
   Ft_Gpu_CoCmd_SendCmd(Ft_Esd_Host, COLOR_MASK(1, 1, 1, 1));
   Ft_Gpu_CoCmd_SendCmd(Ft_Esd_Host, BLEND_FUNC(DST_ALPHA, ONE_MINUS_DST_ALPHA));
   Ft_Esd_CircleLine_Draw_Square(x - radius, y - radius, radius * 2);

   Ft_Gpu_CoCmd_SendCmd(Ft_Esd_Host, RESTORE_CONTEXT());
}

void Ft_Esd_CircleLine_SetDSTAlpha()
{
   Ft_Gpu_CoCmd_SendCmd(Ft_Esd_Host, BLEND_FUNC(SRC_ALPHA, ZERO));
}

void Ft_Esd_CircleLine_ClearDSTAlpha()
{
   Ft_Gpu_CoCmd_SendCmd(Ft_Esd_Host, BLEND_FUNC(ZERO, ZERO));
}

void Ft_Esd_CircleLine_Draw_Square(int x, int y, int side)
{
#if (EVE_MODEL >= EVE_FT810)
   Ft_Gpu_CoCmd_SendCmd(Ft_Esd_Host, VERTEX_FORMAT(4));
#endif
   Ft_Gpu_CoCmd_SendCmd(Ft_Esd_Host, BEGIN(RECTS));
   Ft_Gpu_CoCmd_SendCmd(Ft_Esd_Host, LINE_WIDTH(16));
   Ft_Gpu_CoCmd_SendCmd(Ft_Esd_Host, VERTEX2F((x * 16), (y * 16)));
   x += side;
   y += side;
   Ft_Gpu_CoCmd_SendCmd(Ft_Esd_Host, VERTEX2F((x * 16), (y * 16)));
   // Ft_Gpu_CoCmd_SendCmd(Ft_Esd_Host, END());
}

void Ft_Esd_CircleLine_Draw_Point(int x, int y, int radius)
{
   Ft_Esd_CircleLine_Draw_Point_Float((ft_float_t)x, (ft_float_t)y, (ft_float_t)radius);
}

// FIXME: Use ft_int16_f4_t as fixed point instead of float
void Ft_Esd_CircleLine_Draw_Point_Float(ft_float_t x, ft_float_t y, ft_float_t radius)
{
#if (EVE_MODEL >= EVE_FT810)
   Ft_Gpu_CoCmd_SendCmd(Ft_Esd_Host, VERTEX_FORMAT(4));
#endif
   Ft_Gpu_CoCmd_SendCmd(Ft_Esd_Host, BEGIN(FTPOINTS));
   int iR = (radius * 16.0f) + 0.5f;
   Ft_Gpu_CoCmd_SendCmd(Ft_Esd_Host, POINT_SIZE(iR));
   int iX = (x * 16.0f) + 0.5f;
   int iY = (y * 16.0f) + 0.5f;
   Ft_Gpu_CoCmd_SendCmd(Ft_Esd_Host, VERTEX2F(iX, iY));
   // Ft_Gpu_CoCmd_SendCmd(Ft_Esd_Host, END());
}

#29
Discussion - EVE / Re: Question for method BLENDING
January 09, 2020, 09:40:46 AM
Please check the code below in the ESE and it shall get the effect as the enclosed image.

Try to change the "ALPHA_TEST" and replace the value with 125 to see the semi-transparent effect of contour.

Quote
CLEAR_COLOR_RGB(255,255,255)
CLEAR_COLOR_A(255)
CLEAR(1, 1, 1)

CMD_GRADIENT(100, 207, 0x007FFF, 244, 189, 0x7FFF00)

SAVE_CONTEXT()
SCISSOR_XY(100, 100)
SCISSOR_SIZE(100, 100)

COLOR_RGB(255,255,255)
COLOR_A(255)

COLOR_MASK(0,0,0,1)
BLEND_FUNC(ZERO, ZERO) #clear Alpha

BEGIN(RECTS)
VERTEX2II(100,100,0,0)
VERTEX2II(200,200,0,0)

COLOR_A(255) # ALPHA_TEST
BLEND_FUNC(SRC_ALPHA, ZERO) #Set Alpha
POINT_SIZE(800)
BEGIN(POINTS)
VERTEX2II(150,150, 0,0)

BLEND_FUNC(ZERO, ZERO) #clear Alpha
POINT_SIZE(400)
BEGIN(POINTS)
VERTEX2II(150,150, 0,0)

COLOR_RGB(245,58,41)
COLOR_A(255) #ALPHA_TEST
COLOR_MASK(1,1,1,1)
BLEND_FUNC(DST_ALPHA, ONE_MINUS_DST_ALPHA)


BEGIN(RECTS)
VERTEX2II(100,100,0,0)
VERTEX2II(200,200,0,0)

RESTORE_CONTEXT()


#30
Discussion - EVE / Re: Question for method BLENDING
January 08, 2020, 03:22:03 AM
I found in ESD 4.8 there is the widget "ESD Circle Line" and "ESD Gradient" can fit most of your requirement, except the semitransparent.  Please have a check the image I enclosed.