Skip to content

Instantly share code, notes, and snippets.

@maciekmm
Created March 26, 2019 11:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maciekmm/26911509b706b32a587db78c0bb12efb to your computer and use it in GitHub Desktop.
Save maciekmm/26911509b706b32a587db78c0bb12efb to your computer and use it in GitHub Desktop.
static void lcd_start(void)
{
/* LCD Initialization */
BSP_LCD_Init();
/* LCD Initialization */
BSP_LCD_LayerDefaultInit(0, (unsigned int)lcd_image_bg);
BSP_LCD_LayerDefaultInit(1, (unsigned int)lcd_image_fg);
/* Enable the LCD */
BSP_LCD_DisplayOn();
/* Select the LCD Background Layer */
BSP_LCD_SelectLayer(0);
/* Clear the Background Layer */
BSP_LCD_Clear(LCD_COLOR_BLACK);
BSP_LCD_SetBackColor(LCD_COLOR_BLACK);
BSP_LCD_SetColorKeying(1,LCD_COLOR_BLACK);
/* Select the LCD Foreground Layer */
BSP_LCD_SelectLayer(1);
/* Clear the Foreground Layer */
BSP_LCD_Clear(LCD_COLOR_BLACK);
BSP_LCD_SetBackColor(LCD_COLOR_BLACK);
/* Configure the transparency for foreground and background :
Increase the transparency */
BSP_LCD_SetTransparency(0, 255);
//BSP_LCD_SetTransparency(1, 100);
BSP_LCD_SetTransparency(1, 255);
}
int initialize_touchscreen(void)
{
uint8_t status = 0;
status = BSP_TS_Init(BSP_LCD_GetXSize(), BSP_LCD_GetYSize());
if(status != TS_OK) return -1;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment