sGUI
V1.0
|
Files | |
file | lcd.h |
Simple graphic library main functionality. | |
file | lcd_lld.h |
Simple graphic library controller communication interface. | |
Data Structures | |
struct | _BMP_Header |
Bitmap header. More... | |
struct | _BMP |
Bitmap image. More... | |
Typedefs | |
typedef struct _BMP_Header | BMP_Header |
Bitmap header. | |
typedef struct _BMP | BMP |
Bitmap image. | |
typedef enum _BMP_STATUS | BMP_STATUS |
Error codes. | |
Enumerations | |
enum | _BMP_STATUS { BMP_OK = 0, BMP_ERROR, BMP_OUT_OF_MEMORY, BMP_IO_ERROR, BMP_FILE_NOT_FOUND, BMP_FILE_NOT_SUPPORTED, BMP_FILE_INVALID, BMP_INVALID_ARGUMENT, BMP_TYPE_MISMATCH, BMP_ERROR_NUM } |
Error codes. More... | |
Functions | |
void | LCD_SetTextColor (LCDCOLOR Color) |
Sets the Text color. More... | |
void | LCD_SetBackColor (LCDCOLOR Color) |
Sets the Background color. More... | |
void | LCD_SetFont (FONT_T *pFont) |
Sets the current font. More... | |
FONT_T * | LCD_GetFont (void) |
Gets the current font. More... | |
uint8_t | LCD_GetLineCount (void) |
Gets the current count of possible lines. More... | |
void | LCD_ClearLine (uint8_t Line) |
Clears the selected line. More... | |
void | LCD_DisplayCharXY (uint16_t x, uint16_t y, char Ascii) |
Displays one character (16dots width, 24dots height) on the LCD. Position is set with a x- and a y-coordinate. More... | |
void | LCD_DisplayCharLine (uint8_t Line, uint8_t Column, char Ascii) |
Displays one character (16dots width, 24dots height) on the LCD. Position is set with a line and a column. More... | |
void | LCD_DisplayStringXY (uint16_t x, uint16_t y, const char *ptr) |
Displays a string on the LCD. Position is set with the x- and y-coordinate. More... | |
void | LCD_DisplayStringLine (uint8_t Line, const char *ptr) |
Displays a string on a line on the LCD. Position is set with a line number. More... | |
void | LCD_DisplayStringCenterLine (uint8_t Line, const char *ptr) |
Displays a string on the LCD. Position is set at the y-coordinate on center of the display. More... | |
void | LCD_Log_AddMsg (char *ptr) |
Add a log message to the screen. More... | |
void | LCD_Log_Update (void) |
Update the log messages on the display. This is used, if the screen is overwritten by user. | |
void | LCD_DrawLine (uint16_t Xstart, uint16_t Ystart, uint16_t Xstop, uint16_t Ystop, LCDCOLOR Color) |
Draw a line on the display starting at (Xstart/Ystart) and ending at (Xstop/Ystop). This function draws the line with the Bresenham's line algorithm. More... | |
void | LCD_DrawRect (uint16_t Xpos, uint16_t Ypos, uint16_t width, uint16_t height, LCDCOLOR Color) |
Displays a rectangle. More... | |
void | LCD_DrawRectF (uint16_t Xpos, uint16_t Ypos, uint16_t width, uint16_t height, LCDCOLOR Color) |
Displays a filled rectangle. More... | |
void | LCD_DrawCircle (uint16_t Xpos, uint16_t Ypos, uint16_t Radius, LCDCOLOR Color) |
Displays a circle. More... | |
void | LCD_DrawCircleF (uint8_t Xpos, uint16_t Ypos, uint16_t Radius, LCDCOLOR Color) |
Displays a filled circle. More... | |
BMP_STATUS | LCD_BMP_DrawBitmap (const char *filename, uint16_t Xpos, uint16_t Ypos) |
Reads the specified BMP image file and print it to the LCD. It does only read bitmaps with 16, 24 or 32 bits per pixel and uncompressed. To use this, the fatfs must be mounted. More... | |
BMP_STATUS | LCD_BMP_ReadFile (BMP *bmp, const char *filename) |
Reads the specified BMP image file. It does only read bitmaps with 16, 24 or 32 bits per pixel and uncompressed. To use this, the fatfs must be mounted. More... | |
uint32_t | LCD_BMP_GetWidth (BMP *bmp) |
Returns the image's width. More... | |
uint32_t | LCD_BMP_GetHeight (BMP *bmp) |
Returns the image's height. More... | |
uint16_t | LCD_BMP_GetDepth (BMP *bmp) |
Returns the image's color depth (bits per pixel). More... | |
BMP_STATUS | LCD_BMP_GetPixelRGB (BMP *bmp, uint32_t x, uint32_t y, uint8_t *r, uint8_t *g, uint8_t *b) |
Populates the arguments with the specified pixel's RGB values. More... | |
const char * | LCD_BMP_GetErrorDescription (uint8_t errorcode) |
Returns a description of the last error code. More... | |
static void | LCD_Clear (LCDCOLOR Color) |
Clears the whole LCD. More... | |
static void | LCD_Init (void) |
Initialize the interface, controller and the display. | |
static void | LCD_FillArea (uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color) |
Fill a specified area on the display with the same color. More... | |
static void | LCD_WriteArea (uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t *pData) |
Write an array of data to a specified area on the display. More... | |
static void | LCD_WritePixel (uint16_t x, uint16_t y, uint16_t pixel) |
Write one pixel to the display. More... | |
enum _BMP_STATUS |
Error codes.
BMP_STATUS LCD_BMP_DrawBitmap | ( | const char * | filename, |
uint16_t | Xpos, | ||
uint16_t | Ypos | ||
) |
Reads the specified BMP image file and print it to the LCD.
It does only read bitmaps with 16, 24 or 32 bits per pixel and uncompressed.
To use this, the fatfs must be mounted.
[in] | filename | Name of the file (incl. ending and directory) on the sdcard. |
[in] | Xpos | Start X position of the bitmap. |
[in] | Ypos | Start Y position of the bitmap. |
Definition at line 127 of file bmp.c.
uint16_t LCD_BMP_GetDepth | ( | BMP * | bmp | ) |
const char* LCD_BMP_GetErrorDescription | ( | uint8_t | errorcode | ) |
uint32_t LCD_BMP_GetHeight | ( | BMP * | bmp | ) |
BMP_STATUS LCD_BMP_GetPixelRGB | ( | BMP * | bmp, |
uint32_t | x, | ||
uint32_t | y, | ||
uint8_t * | r, | ||
uint8_t * | g, | ||
uint8_t * | b | ||
) |
uint32_t LCD_BMP_GetWidth | ( | BMP * | bmp | ) |
BMP_STATUS LCD_BMP_ReadFile | ( | BMP * | bmp, |
const char * | filename | ||
) |
Reads the specified BMP image file.
It does only read bitmaps with 16, 24 or 32 bits per pixel and uncompressed. To use this, the fatfs must be mounted.
[out] | bmp | Pointer to the bitmap data buffer. |
[in] | filename | File to read into the buffer. |
Definition at line 200 of file bmp.c.
|
inlinestatic |
void LCD_ClearLine | ( | uint8_t | Line | ) |
void LCD_DisplayCharLine | ( | uint8_t | Line, |
uint8_t | Column, | ||
char | Ascii | ||
) |
Displays one character (16dots width, 24dots height) on the LCD. Position is set with a line and a column.
[in] | Line | The Line where to display the character shape. This parameter can be one of the following values:
|
[in] | Column | Start column address. |
[in] | Ascii | Character ascii code, must be between 0x20 and 0x7E. |
Definition at line 223 of file text.c.
void LCD_DisplayCharXY | ( | uint16_t | x, |
uint16_t | y, | ||
char | Ascii | ||
) |
Displays one character (16dots width, 24dots height) on the LCD. Position is set with a x- and a y-coordinate.
[in] | x | X-Position in pixel |
[in] | y | Y-Position in pixel |
[in] | Ascii | Character ascii code, must be between 0x20 and 0x7E. |
Definition at line 199 of file text.c.
void LCD_DisplayStringCenterLine | ( | uint8_t | Line, |
const char * | ptr | ||
) |
void LCD_DisplayStringLine | ( | uint8_t | Line, |
const char * | ptr | ||
) |
Displays a string on a line on the LCD. Position is set with a line number.
[in] | Line | The Line where to display the character shape. |
[in] | *ptr | Pointer to string to display on LCD. |
Definition at line 250 of file text.c.
void LCD_DisplayStringXY | ( | uint16_t | x, |
uint16_t | y, | ||
const char * | ptr | ||
) |
Displays a string on the LCD. Position is set with the x- and y-coordinate.
[in] | x | X-Position in pixel |
[in] | y | Y-Position in pixel |
[in] | *ptr | Pointer to string to display on LCD. |
Definition at line 236 of file text.c.
void LCD_DrawCircle | ( | uint16_t | Xpos, |
uint16_t | Ypos, | ||
uint16_t | Radius, | ||
LCDCOLOR | Color | ||
) |
Displays a circle.
[in] | Xpos | specifies the X position of the center. |
[in] | Ypos | specifies the Y position of the center. |
[in] | Radius | radius of the circle. |
[in] | Color | specifies the color of the line. |
Definition at line 191 of file geometry.c.
void LCD_DrawCircleF | ( | uint8_t | Xpos, |
uint16_t | Ypos, | ||
uint16_t | Radius, | ||
LCDCOLOR | Color | ||
) |
Displays a filled circle.
[in] | Xpos | specifies the X position of the center. |
[in] | Ypos | specifies the Y position of the center. |
[in] | Radius | radius of the circle. |
[in] | Color | specifies the color of the line. |
Definition at line 212 of file geometry.c.
void LCD_DrawLine | ( | uint16_t | Xstart, |
uint16_t | Ystart, | ||
uint16_t | Xstop, | ||
uint16_t | Ystop, | ||
LCDCOLOR | Color | ||
) |
Draw a line on the display starting at (Xstart/Ystart) and ending at (Xstop/Ystop). This function draws the line with the Bresenham's line algorithm.
[in] | Xstart | specifies the X start position. |
[in] | Ystart | specifies the Y start position. |
[in] | Xstop | specifies the X stop position. |
[in] | Ystop | specifies the Y stop position. |
[in] | Color | specifies the color of the line. |
Definition at line 103 of file geometry.c.
void LCD_DrawRect | ( | uint16_t | Xpos, |
uint16_t | Ypos, | ||
uint16_t | width, | ||
uint16_t | height, | ||
LCDCOLOR | Color | ||
) |
Displays a rectangle.
[in] | Xpos | specifies the X position. |
[in] | Ypos | specifies the Y position. |
[in] | width | display rectangle width. |
[in] | height | display rectangle height. |
[in] | Color | specifies the color of the line. |
Definition at line 161 of file geometry.c.
void LCD_DrawRectF | ( | uint16_t | Xpos, |
uint16_t | Ypos, | ||
uint16_t | width, | ||
uint16_t | height, | ||
LCDCOLOR | Color | ||
) |
Displays a filled rectangle.
[in] | Xpos | specifies the X position. |
[in] | Ypos | specifies the Y position. |
[in] | width | display rectangle width. |
[in] | height | display rectangle height. |
[in] | Color | specifies the color of the line. |
Definition at line 178 of file geometry.c.
|
inlinestatic |
Fill a specified area on the display with the same color.
[in] | x1 | start column from the left. |
[in] | y1 | start row from the top. |
[in] | x2 | end column from the left. |
[in] | y2 | end row from the top. |
[in] | color | Color in format of 16-Bit in the RGB 5-6-5 format. |
Definition at line 104 of file lcd_lld.h.
FONT_T* LCD_GetFont | ( | void | ) |
uint8_t LCD_GetLineCount | ( | void | ) |
void LCD_Log_AddMsg | ( | char * | ptr | ) |
void LCD_SetBackColor | ( | LCDCOLOR | Color | ) |
void LCD_SetFont | ( | FONT_T * | Font | ) |
void LCD_SetTextColor | ( | LCDCOLOR | Color | ) |
|
inlinestatic |
Write an array of data to a specified area on the display.
[in] | x1 | start column from the left. |
[in] | y1 | start row from the top. |
[in] | x2 | end column from the left. |
[in] | y2 | end row from the top. |
[in] | pData | Pointer to the array of pixels in format of 16-Bit color value in the RGB 5-6-5 format. |
Definition at line 118 of file lcd_lld.h.
|
inlinestatic |