Converted TestStub driver to new format.
This commit is contained in:
parent
b6986f5b16
commit
6ac1710dc5
3 changed files with 27 additions and 94 deletions
|
@ -8,17 +8,15 @@
|
||||||
/**
|
/**
|
||||||
* @file drivers/gdisp/TestStub/gdisp_lld.c
|
* @file drivers/gdisp/TestStub/gdisp_lld.c
|
||||||
* @brief GDISP Graphics Driver subsystem low level driver source (stub).
|
* @brief GDISP Graphics Driver subsystem low level driver source (stub).
|
||||||
*
|
|
||||||
* @addtogroup GDISP
|
|
||||||
* @{
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "gfx.h"
|
#include "gfx.h"
|
||||||
|
|
||||||
#if GFX_USE_GDISP /*|| defined(__DOXYGEN__)*/
|
#if GFX_USE_GDISP /*|| defined(__DOXYGEN__)*/
|
||||||
|
|
||||||
/* Include the emulation code for things we don't support */
|
#define GDISP_DRIVER_VMT GDISPVMT_TestStub
|
||||||
#include "gdisp/lld/emulation.c"
|
#include "../drivers/gdisp/TestStub/gdisp_lld_config.h"
|
||||||
|
#include "gdisp/lld/gdisp_lld.h"
|
||||||
|
|
||||||
#ifndef GDISP_SCREEN_HEIGHT
|
#ifndef GDISP_SCREEN_HEIGHT
|
||||||
#define GDISP_SCREEN_HEIGHT 128
|
#define GDISP_SCREEN_HEIGHT 128
|
||||||
|
@ -26,93 +24,35 @@
|
||||||
#ifndef GDISP_SCREEN_WIDTH
|
#ifndef GDISP_SCREEN_WIDTH
|
||||||
#define GDISP_SCREEN_WIDTH 128
|
#define GDISP_SCREEN_WIDTH 128
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef GDISP_INITIAL_CONTRAST
|
||||||
|
#define GDISP_INITIAL_CONTRAST 50
|
||||||
|
#endif
|
||||||
|
#ifndef GDISP_INITIAL_BACKLIGHT
|
||||||
|
#define GDISP_INITIAL_BACKLIGHT 100
|
||||||
|
#endif
|
||||||
|
|
||||||
/* ---- Required Routines ---- */
|
LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
|
||||||
/*
|
|
||||||
The following 2 routines are required.
|
|
||||||
All other routines are optional.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Low level GDISP driver initialization.
|
|
||||||
*
|
|
||||||
* @notapi
|
|
||||||
*/
|
|
||||||
bool_t gdisp_lld_init(void) {
|
|
||||||
/* Initialise the GDISP structure */
|
/* Initialise the GDISP structure */
|
||||||
GDISP.Width = GDISP_SCREEN_WIDTH;
|
g->g.Width = GDISP_SCREEN_WIDTH;
|
||||||
GDISP.Height = GDISP_SCREEN_HEIGHT;
|
g->g.Height = GDISP_SCREEN_HEIGHT;
|
||||||
GDISP.Orientation = GDISP_ROTATE_0;
|
g->g.Orientation = GDISP_ROTATE_0;
|
||||||
GDISP.Powermode = powerOff;
|
g->g.Powermode = powerOn;
|
||||||
GDISP.Backlight = 100;
|
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
||||||
GDISP.Contrast = 50;
|
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
||||||
#if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP
|
|
||||||
GDISP.clipx0 = 0;
|
|
||||||
GDISP.clipy0 = 0;
|
|
||||||
GDISP.clipx1 = GDISP.Width;
|
|
||||||
GDISP.clipy1 = GDISP.Height;
|
|
||||||
#endif
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
#if GDISP_HARDWARE_DRAWPIXEL
|
||||||
* @brief Draws a pixel on the display.
|
void gdisp_lld_draw_pixel(GDisplay *g) {
|
||||||
*
|
(void) g;
|
||||||
* @param[in] x X location of the pixel
|
}
|
||||||
* @param[in] y Y location of the pixel
|
#endif
|
||||||
* @param[in] color The color of the pixel
|
|
||||||
*
|
|
||||||
* @notapi
|
|
||||||
*/
|
|
||||||
void gdisp_lld_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|
||||||
(void)x;
|
|
||||||
(void)y;
|
|
||||||
(void)color;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ---- Optional Routines ---- */
|
|
||||||
|
|
||||||
#if (GDISP_NEED_PIXELREAD && GDISP_HARDWARE_PIXELREAD) || defined(__DOXYGEN__)
|
|
||||||
/**
|
|
||||||
* @brief Get the color of a particular pixel.
|
|
||||||
* @note Optional.
|
|
||||||
* @note If x,y is off the screen, the result is undefined.
|
|
||||||
*
|
|
||||||
* @param[in] x, y The start of the text
|
|
||||||
*
|
|
||||||
* @notapi
|
|
||||||
*/
|
|
||||||
color_t gdisp_lld_get_pixel_color(coord_t x, coord_t y) {
|
|
||||||
(void)x;
|
|
||||||
(void)y;
|
|
||||||
|
|
||||||
|
#if GDISP_HARDWARE_PIXELREAD
|
||||||
|
color_t gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||||
|
(void) g;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (GDISP_NEED_SCROLL && GDISP_HARDWARE_SCROLL) || defined(__DOXYGEN__)
|
|
||||||
/**
|
|
||||||
* @brief Scroll vertically a section of the screen.
|
|
||||||
* @note Optional.
|
|
||||||
* @note If x,y + cx,cy is off the screen, the result is undefined.
|
|
||||||
* @note If lines is >= cy, it is equivelent to a area fill with bgcolor.
|
|
||||||
*
|
|
||||||
* @param[in] x, y The start of the area to be scrolled
|
|
||||||
* @param[in] cx, cy The size of the area to be scrolled
|
|
||||||
* @param[in] lines The number of lines to scroll (Can be positive or negative)
|
|
||||||
* @param[in] bgcolor The color to fill the newly exposed area.
|
|
||||||
*
|
|
||||||
* @notapi
|
|
||||||
*/
|
|
||||||
void gdisp_lld_vertical_scroll(coord_t x, coord_t y, coord_t cx, coord_t cy, int lines, color_t bgcolor) {
|
|
||||||
(void)x;
|
|
||||||
(void)y;
|
|
||||||
(void)cx;
|
|
||||||
(void)cy;
|
|
||||||
(void)lines;
|
|
||||||
(void)bgcolor;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* GFX_USE_GDISP */
|
#endif /* GFX_USE_GDISP */
|
||||||
/** @} */
|
|
||||||
|
|
|
@ -1,5 +1,2 @@
|
||||||
# List the required driver.
|
|
||||||
GFXSRC += $(GFXLIB)/drivers/gdisp/TestStub/gdisp_lld.c
|
|
||||||
|
|
||||||
# Required include directories
|
|
||||||
GFXINC += $(GFXLIB)/drivers/gdisp/TestStub
|
GFXINC += $(GFXLIB)/drivers/gdisp/TestStub
|
||||||
|
GFXSRC += $(GFXLIB)/drivers/gdisp/TestStub/gdisp_lld.c
|
||||||
|
|
|
@ -22,14 +22,10 @@
|
||||||
/* Driver hardware support. */
|
/* Driver hardware support. */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
||||||
#define GDISP_DRIVER_NAME "TestStub"
|
#define GDISP_HARDWARE_DRAWPIXEL TRUE
|
||||||
|
#define GDISP_HARDWARE_PIXELREAD TRUE
|
||||||
#define GDISP_HARDWARE_SCROLL GDISP_NEED_SCROLL
|
|
||||||
#define GDISP_HARDWARE_PIXELREAD GDISP_NEED_PIXELREAD
|
|
||||||
|
|
||||||
#define GDISP_PIXELFORMAT GDISP_PIXELFORMAT_RGB565
|
#define GDISP_PIXELFORMAT GDISP_PIXELFORMAT_RGB565
|
||||||
#define GDISP_PACKED_PIXELS FALSE
|
|
||||||
#define GDISP_PACKED_LINES FALSE
|
|
||||||
|
|
||||||
#endif /* GFX_USE_GDISP */
|
#endif /* GFX_USE_GDISP */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue