Muteki
EABI code execution on Besta® RTOS devices.
Loading...
Searching...
No Matches
lcd.h File Reference

Display canvas (LCD) type definitions. More...

#include "../../threading.h"
#include "font.h"
#include "surface.h"
#include "primitives.h"

Go to the source code of this file.

Data Structures

struct  lcd_cursor_s
 Cursor states usually linked to an LCD descriptor. More...
struct  lcd_draw_s
 Drawing routine common states. More...
struct  lcd_lock_s
 An extended part of the LCD descriptor that implements descriptor locking. More...
struct  lcd_base_s
 The LCD descriptor. More...
struct  lcd_thread_safe_s
 A thread-safe variant of the LCD descriptor used on some versions of Besta RTOS. More...

Macros

#define lcd_s   lcd_base_s

Typedefs

typedef struct lcd_cursor_s lcd_cursor_t
 lcd_cursor_s
typedef struct lcd_draw_s lcd_draw_t
 lcd_draw_s
typedef struct lcd_lock_s lcd_lock_t
 lcd_lock_s
typedef struct lcd_base_s lcd_base_t
 lcd_base_s
typedef struct lcd_thread_safe_s lcd_thread_safe_t
 lcd_thread_safe_s
typedef struct lcd_base_s lcd_t
 lcd_base_s
typedef int(*) lcd_rotate_callback_t(lcd_t *self, int rotation)
 Callback type for handling canvas rotation.

Enumerations

enum  lcd_print_flag_e { LCD_PRINT_NONE = 0 , LCD_PRINT_INVERT = 0x1 , LCD_PRINT_INVERT_ALT = 0x4 , LCD_PRINT_UNDERSCORE_ONLY = 0x40 }
 Process flags for string and character printing. More...
enum  lcd_print_str_flag_e { LCD_PRINT_STR_ENCODING_BIG5 = 0x100 , LCD_PRINT_STR_ENCODING_GB18030 = 0x200 , LCD_PRINT_STR_ENCODING_TIS_620 = 0x400 }
 Process flags for string printing only. More...
enum  lcd_str_align_e { LCD_STR_ALIGN_LEFT = 0 , LCD_STR_ALIGN_RIGHT , LCD_STR_ALIGN_CENTER }
 String alignment types. More...
enum  lcd_rotation_e {
  LCD_ROTATION_TOP_SIDE_UP = 0 , LCD_ROTATION_TOP_SIDE_LEFT , LCD_ROTATION_TOP_SIDE_DOWN , LCD_ROTATION_TOP_SIDE_RIGHT ,
  LCD_ROTATION_QUERY = 0xfe , LCD_ROTATION_APPLY = 0xff
}
 Rotation values used by lcd_rotate_callback_t. More...
enum  stroke_predefined_dash_e {
  DASH_NONE = 0 , DASH_8_8_16_0 , DASH_4 , DASH_0_4_16_4_4_4 ,
  DASH_12_4_4_4_4_4 , DASH_1 , DASH_2 , DASH_16 ,
  DASH_0_1_8_1_8_1_8_1_4_0 = 12 , DASH_4_1_8_1_7_1_9_1 , DASH_3_1_7_1_7_1_4_8 , DASH_3_1_7_1_7_1_7_1_4_0 ,
  DASH_0_1_6_1_1_1_4_1_3_1_2_1_5_2_3_0 , DASH_3_2_5_1_2_1_3_1_4_1_1_1_6_1 , DASH_7_1_6_1_6_1_6_1_3_0 , DASH_3_1_6_1_6_1_6_1_7_0 ,
  DASH_24_8 = 22 , DASH_CUSTOM = 0x100
}
 Predefined dash patterns. More...

Detailed Description

Display canvas (LCD) type definitions.

Typedef Documentation

◆ lcd_rotate_callback_t

typedef int(*) lcd_rotate_callback_t(lcd_t *self, int rotation)

Callback type for handling canvas rotation.

When rotation is set to LCD_ROTATION_QUERY, the current rotation value will be returned with no side effect. When rotation is set to LCD_ROTATION_APPLY, the canvas will rotate based on current value of lcd_t::rotation.

Parameters
selfThe LCD descriptor this was called from.
rotationNew rotation. This value will be written to lcd_t::rotation and this callback will be called recursively with LCD_ROTATION_APPLY as the rotation value to actually apply the change.
Returns
Current rotation value in effect. This will be the same as rotation when no magic value documented above was used.
See also
lcd_t::rotation Where the location value is stored in the LCD descriptor.
lcd_rotation_e Possible rotation values.

Enumeration Type Documentation

◆ lcd_print_flag_e

Process flags for string and character printing.

Todo
A lot of the bits seem to just print nothing. We need to formally look at the disassembly for this (huge!).
Enumerator
LCD_PRINT_NONE 

No extra process.

LCD_PRINT_INVERT 

Invert colors.

Within the bounding box of the glyphs to be rendered, the RGB pixel value is inverted.

LCD_PRINT_INVERT_ALT 

Seems to be an alternative version of LCD_PRINT_INVERT.

LCD_PRINT_UNDERSCORE_ONLY 

Draw underscores only.

Todo
Speculation based on behavior. Seems to be very broken with >16px fonts.

◆ lcd_print_str_flag_e

Process flags for string printing only.

Enumerator
LCD_PRINT_STR_ENCODING_BIG5 

Assume text encoding to be BIG5 instead of UTF-16.

Todo
Seems to be some unknown extension? Limited mojibake test doesn't match iconv result.
LCD_PRINT_STR_ENCODING_GB18030 

Assume text encoding to be GB18030 instead of UTF-16.

LCD_PRINT_STR_ENCODING_TIS_620 

Assume text encoding to be TIS-620 instead of UTF-16.

◆ lcd_rotation_e

Rotation values used by lcd_rotate_callback_t.

Enumerator
LCD_ROTATION_TOP_SIDE_UP 

Set the rotation so the top side of the canvas is facing up.

LCD_ROTATION_TOP_SIDE_LEFT 

Set the rotation so the top side of the canvas is facing left.

LCD_ROTATION_TOP_SIDE_DOWN 

Set the rotation so the top side of the canvas is facing down.

LCD_ROTATION_TOP_SIDE_RIGHT 

Set the rotation so the top side of the canvas is facing right.

LCD_ROTATION_QUERY 

Query the current rotation. Will not change the current location.

LCD_ROTATION_APPLY 

Actually rotate the buffer. Used internally.

◆ lcd_str_align_e

String alignment types.

Enumerator
LCD_STR_ALIGN_LEFT 

Align to top-left.

LCD_STR_ALIGN_RIGHT 

Align to top-right.

LCD_STR_ALIGN_CENTER 

Align to top-center.

◆ stroke_predefined_dash_e

Predefined dash patterns.

The numbers here follows the SVG stroke-dasharray property format.

Todo
Add graphic examples.
Enumerator
DASH_NONE 

Solid line.

DASH_CUSTOM 

Custom dash pattern.