2015-07-08 00:41:20 +00:00
|
|
|
/*
|
|
|
|
* This file is subject to the terms of the GFX License. If a copy of
|
|
|
|
* the license was not distributed with this file, you can obtain one at:
|
|
|
|
*
|
2018-10-01 15:32:39 +00:00
|
|
|
* http://ugfx.io/license.html
|
2015-07-08 00:41:20 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _GDISP_LLD_BOARD_H
|
|
|
|
#define _GDISP_LLD_BOARD_H
|
|
|
|
|
2018-02-27 07:44:21 +00:00
|
|
|
#define ALLOW_2ND_LAYER GFXON
|
2017-10-01 08:00:49 +00:00
|
|
|
|
2015-07-08 00:41:20 +00:00
|
|
|
static const ltdcConfig driverCfg = {
|
2015-07-11 06:13:05 +00:00
|
|
|
480, 272, // Width, Height (pixels)
|
2015-07-08 21:55:02 +00:00
|
|
|
41, 10, // Horizontal, Vertical sync (pixels)
|
|
|
|
13, 2, // Horizontal, Vertical back porch (pixels)
|
|
|
|
32, 2, // Horizontal, Vertical front porch (pixels)
|
2015-07-08 00:41:20 +00:00
|
|
|
0, // Sync flags
|
|
|
|
0x000000, // Clear color (RGB888)
|
|
|
|
|
|
|
|
{ // Background layer config
|
2017-10-01 08:00:49 +00:00
|
|
|
(LLDCOLOR_TYPE *)SDRAM_DEVICE_ADDR, // Frame buffer address
|
2015-07-11 06:13:05 +00:00
|
|
|
480, 272, // Width, Height (pixels)
|
2015-07-08 00:41:20 +00:00
|
|
|
480 * LTDC_PIXELBYTES, // Line pitch (bytes)
|
|
|
|
LTDC_PIXELFORMAT, // Pixel format
|
|
|
|
0, 0, // Start pixel position (x, y)
|
2015-07-11 06:13:05 +00:00
|
|
|
480, 272, // Size of virtual layer (cx, cy)
|
2017-10-01 08:00:49 +00:00
|
|
|
0x00000000, // Default color (ARGB8888)
|
|
|
|
0x000000, // Color key (RGB888)
|
2015-07-08 00:41:20 +00:00
|
|
|
LTDC_BLEND_FIX1_FIX2, // Blending factors
|
|
|
|
0, // Palette (RGB888, can be NULL)
|
|
|
|
0, // Palette length
|
|
|
|
0xFF, // Constant alpha factor
|
|
|
|
LTDC_LEF_ENABLE // Layer configuration flags
|
|
|
|
},
|
2015-07-08 01:26:23 +00:00
|
|
|
|
2017-10-01 08:00:49 +00:00
|
|
|
#if ALLOW_2ND_LAYER
|
|
|
|
{ // Foreground layer config (if turned on)
|
|
|
|
(LLDCOLOR_TYPE *)(SDRAM_DEVICE_ADDR+(480 * 272 * LTDC_PIXELBYTES)), // Frame buffer address
|
|
|
|
480, 272, // Width, Height (pixels)
|
|
|
|
480 * LTDC_PIXELBYTES, // Line pitch (bytes)
|
|
|
|
LTDC_PIXELFORMAT, // Pixel format
|
|
|
|
0, 0, // Start pixel position (x, y)
|
|
|
|
480, 272, // Size of virtual layer (cx, cy)
|
|
|
|
0x00000000, // Default color (ARGB8888)
|
|
|
|
0x000000, // Color key (RGB888)
|
|
|
|
LTDC_BLEND_MOD1_MOD2, // Blending factors
|
|
|
|
0, // Palette (RGB888, can be NULL)
|
|
|
|
0, // Palette length
|
|
|
|
0xFF, // Constant alpha factor
|
|
|
|
LTDC_LEF_ENABLE // Layer configuration flags
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
LTDC_UNUSED_LAYER_CONFIG
|
|
|
|
#endif
|
2015-07-08 00:41:20 +00:00
|
|
|
};
|
|
|
|
|
2015-10-23 08:24:49 +00:00
|
|
|
static GFXINLINE void init_board(GDisplay* g) {
|
2017-10-01 08:00:49 +00:00
|
|
|
// This is function only called once with the display for the background layer.
|
|
|
|
(void)g;
|
2015-07-08 00:41:20 +00:00
|
|
|
}
|
|
|
|
|
2015-10-23 08:24:49 +00:00
|
|
|
static GFXINLINE void post_init_board(GDisplay* g)
|
2015-07-08 00:41:20 +00:00
|
|
|
{
|
2017-10-01 08:00:49 +00:00
|
|
|
// This is function may be called twice - once for the background display and once
|
|
|
|
// for the foreground display.
|
|
|
|
// Note: It doesn't get called for the foreground display unless gfxconf.h has been
|
|
|
|
// setup for two displays on this controller.
|
2015-07-08 01:26:23 +00:00
|
|
|
(void)g;
|
2015-07-08 00:41:20 +00:00
|
|
|
}
|
|
|
|
|
2018-11-03 00:51:23 +00:00
|
|
|
static GFXINLINE void set_backlight(GDisplay* g, gU8 percent)
|
2015-07-08 00:41:20 +00:00
|
|
|
{
|
2017-10-01 08:00:49 +00:00
|
|
|
// This is function may be called with the display for either the foreground
|
|
|
|
// or the background layer.
|
|
|
|
// Note: It can't be called for the foreground display unless gfxconf.h has been
|
|
|
|
// setup for two displays on this controller.
|
2015-07-08 01:26:23 +00:00
|
|
|
(void)g;
|
|
|
|
(void)percent;
|
2015-07-08 00:41:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* _GDISP_LLD_BOARD_H */
|