After trying, I found that the camera screen only works smoothly when the LVGL task is closed. Currently, Layer0 is the GUI and Layer1 is the camera. I would like to add another Layer2 when Layer0 is closed and Layer1 is opened. In the center of Layer3, there should be a hollow circle with transparency in all parts except for the arc.
Therefore, I used the ARGB4444 format and performed a simple test by drawing a square on the LCD(Layer0 enable and Layer1 disable;or Layer0 disable and Layer1 enable). However, the resulting image was not transparent. Whenever the LCDIFV2_SetLayerBlendConfig function is called, there is no image on Layer3 on the LCD. However, if this function is commented out, the LCD displays the expected non-transparent image.
Below is the code,reference the example " lcdifv2_embedded_alpha_cm7" in SDK
#define LCD_WIDTH 480
#define LCD_HEIGHT 640
#define CENTER_LAYER 2
#define DEMO_FB0_ADDR ((uint32_t)s_frameBuffer[0])
AT_NONCACHEABLE_SECTION_ALIGN(
uint8_t s_frameBuffer[1][LCD_HEIGHT][LCD_WIDTH][2],
32);
void DEMO_FillFrameBuffer(void)
{
uint32_t x, y;
for (y = 0; y < LCD_HEIGHT; y++)
{
for (x = 0; x < LCD_WIDTH; x++)
{
s_frameBuffer[0][y][x][0] = 0x11;
s_frameBuffer[0][y][x][1] = 0x11;
}
}
}
void lcd_center_layer_init()
{
DEMO_FillFrameBuffer();
/* Layer 1: ARGB4444 */
const lcdifv2_buffer_config_t fb1Config = {
.strideBytes = (LCD_WIDTH * 2),
.pixelFormat = kLCDIFV2_PixelFormatARGB4444,
};
const lcdifv2_blend_config_t blend1Config = {
.alphaMode = kLCDIFV2_AlphaEmbedded,
};
LCDIFV2_SetLayerBufferConfig(LCDIFV2, CENTER_LAYER, &fb1Config);
LCDIFV2_SetLayerSize(LCDIFV2, CENTER_LAYER, 240, 240);
LCDIFV2_SetLayerOffset(LCDIFV2, CENTER_LAYER, 0, 0);
/* comment or not */
LCDIFV2_SetLayerBlendConfig(LCDIFV2, CENTER_LAYER, &blend1Config);
LCDIFV2_SetLayerBufferAddr(LCDIFV2, CENTER_LAYER, DEMO_FB0_ADDR);
LCDIFV2_EnableLayer(LCDIFV2, CENTER_LAYER, true);
LCDIFV2_TriggerLayerShadowLoad(LCDIFV2, CENTER_LAYER);
}
Is there any error in my code? Thank you.