Landtiger LPC1768 C BigLib 1
A self made, custom C library for the LandTiger board.
 
Loading...
Searching...
No Matches
glcd.h
Go to the documentation of this file.
1#ifndef __GLCD_H
2#define __GLCD_H
3
4#include "allocator.h"
5#include "glcd_macros.h"
6#include "glcd_types.h"
7
12#define RGB8_TO_RGB565(rgb) \
13 (u16)((((rgb >> 16) & 0xFF) >> 3) << 11 | (((rgb >> 8) & 0xFF) >> 2) << 5 | ((rgb & 0xFF) >> 3))
14
15// PUBLIC FUNCTIONS
16
22LCD_Error LCD_Init(LCD_Orientation orientation, MEM_Allocator *const alloc, const LCD_Color *const clear_to);
23
26bool LCD_IsInitialized(void);
27
29u16 LCD_GetWidth(void);
30
32u16 LCD_GetHeight(void);
33
36
39
44
50
58LCD_Error LCD_SetBackgroundColor(LCD_Color color, bool redraw_objects);
59
70LCD_Error LCD_RMAdd(LCD_Obj *const obj, LCD_ObjID *out_id, u8 options);
71
77LCD_Error LCD_RMRemove(LCD_ObjID id, bool redraw_underneath);
78
82
87
100
106LCD_Error LCD_RMSetVisibility(LCD_ObjID id, bool visible, bool redraw_underneath);
107
112
122LCD_Error LCD_RMMove(LCD_ObjID id, LCD_Coordinate new_pos, bool redraw_underneath);
123
124// FONT MANAGER
125
131
136
137// BBOX
138
144
149LCD_Error LCD_CalcBBoxForObject(const LCD_Obj *const obj, LCD_BBox *out_bbox);
150
151// DEBUG FUNCTIONS
152
157
158#endif
bool LCD_RMIsVisible(LCD_ObjID id)
Returns whether an object is visible on the screen or not.
Definition glcd.c:495
LCD_Coordinate LCD_GetCenter(void)
Returns the center of the screen at the current orientation.
Definition glcd.c:233
bool LCD_IsInitialized(void)
Checks if the LCD has been initialized.
Definition glcd.c:225
LCD_Coordinate LCD_GetSize(void)
Returns the size of the screen at the current orientation.
Definition glcd.c:231
LCD_Error LCD_FMAddFont(LCD_Font font, LCD_FontID *out_id)
Adds a new font to the font manager, and returns its ID through the out_id pointer.
Definition glcd.c:577
LCD_Error LCD_CalcBBoxForObject(const LCD_Obj *const obj, LCD_BBox *out_bbox)
Returns the bounding box of a temporary object.
Definition glcd.c:621
u16 LCD_GetHeight(void)
Returns the height of the screen at the current orientation.
Definition glcd.c:229
LCD_Error LCD_SetPointColor(LCD_Color color, LCD_Coordinate point)
Sets the color of the pixel at the specified coordinates.
Definition glcd.c:245
LCD_Error LCD_RMAdd(LCD_Obj *const obj, LCD_ObjID *out_id, u8 options)
Adds a new object to the render list, and returns its ID (if out_id is not NULL) through the out_id p...
Definition glcd.c:292
u16 LCD_GetWidth(void)
Returns the width of the screen at the current orientation.
Definition glcd.c:227
LCD_Error LCD_SetBackgroundColor(LCD_Color color, bool redraw_objects)
Sets the background color of the screen.
Definition glcd.c:264
LCD_Error LCD_Init(LCD_Orientation orientation, MEM_Allocator *const alloc, const LCD_Color *const clear_to)
Initializes TFT LCD Controller.
Definition glcd.c:200
LCD_Error LCD_RMRemove(LCD_ObjID id, bool redraw_underneath)
Removes an object from the render list by its ID. It also deallocates the memory used by that object ...
Definition glcd.c:362
LCD_Error LCD_DEBUG_RenderBBox(LCD_ObjID id)
Debug function to render the bounding box of a component.
Definition glcd.c:635
LCD_Error LCD_RMClear(void)
Removes all visible and non-visible objects from the screen.
Definition glcd.c:395
LCD_Error LCD_RMRenderTemporary(LCD_Obj *const obj)
Renders the object immediately, without adding neither to the render list nor to the memory arena....
Definition glcd.c:438
LCD_Color LCD_GetPointColor(LCD_Coordinate point)
Returns the RGB565 color of the pixel at the specified coordinates.
Definition glcd.c:237
LCD_Error LCD_RMSetVisibility(LCD_ObjID id, bool visible, bool redraw_underneath)
Shows/hides an object on/from the screen without modifying the render list.
Definition glcd.c:449
LCD_Error LCD_RMRender(void)
Manually triggers an update of the screen. Useful when you want to add multiple objects at once,...
Definition glcd.c:421
LCD_Error LCD_GetBBox(LCD_ObjID id, LCD_BBox *out_bbox)
Returns the bounding box of an object in the render list.
Definition glcd.c:602
LCD_Error LCD_FMRemoveFont(LCD_FontID id)
Removes a font from the font manager by its ID.
Definition glcd.c:588
LCD_Error LCD_RMMove(LCD_ObjID id, LCD_Coordinate new_pos, bool redraw_underneath)
Moves an object in the render list to a new position. It also updates the object's position in the RL...
Definition glcd.c:507
LCD_Error
Error codes returned by the GLCD library.
Definition glcd_errors.h:6
LCD_Orientation
Definition glcd_types.h:12
i8 LCD_FontID
Definition glcd_types.h:91
i32 LCD_ObjID
Definition glcd_types.h:195
u32 LCD_Color
Represents a color in the RGB565 format.
Definition glcd_types.h:40
Represents a generic object, made up of 1 or more basic components, that are rendered on the screen.
Definition glcd_types.h:189
uint8_t u8
Definition types.h:8
uint16_t u16
Definition types.h:7