DGUS LCD Library  1
/github/workspace/dgus_control_text.h File Reference

DGUS II LCD Text Utilites. More...

#include <stddef.h>
#include <stdint.h>
#include "dgus_reg.h"
#include "dgus.h"
Include dependency graph for dgus_control_text.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

struct __attribute__ ((packed)) dgus_control_text_display
 
DGUS_RETURN dgus_get_text (uint16_t addr, uint8_t *buf, uint8_t len)
 Read from VAR address as text Reads in 8 bit data format when using 0x02 GBK. More...
 
DGUS_RETURN dgus_set_text (uint16_t addr, char *text)
 Write text to the address VAR. More...
 
DGUS_RETURN dgus_set_text_padded (uint16_t addr, char *text, uint8_t len)
 Write text to the address VAR and clear all text after to field length len. More...
 
DGUS_RETURN dgus_get_text_vp (uint16_t addr, uint16_t *vp)
 Set the VP pointer address in memory. More...
 
DGUS_RETURN dgus_set_text_vp (uint16_t addr, uint16_t vp)
 Set the virtual pointer VP address for the control. More...
 
DGUS_RETURN dgus_get_text_pos (uint16_t addr, dgus_control_position *pos)
 Get the position of the text on the screen. More...
 
DGUS_RETURN dgus_set_text_pos (uint16_t addr, dgus_control_position pos)
 Set the position of the text on the screen. More...
 
DGUS_RETURN dgus_get_text_colour (uint16_t addr, uint16_t *colour)
 Get the colour of the text. More...
 
DGUS_RETURN dgus_set_text_colour (uint16_t addr, uint16_t colour)
 Set the colur of the text. More...
 
DGUS_RETURN dgus_get_text_bounding_size (uint16_t addr, dgus_control_size *size)
 Set the size of the box containing the text. More...
 
DGUS_RETURN dgus_set_text_bounding_size (uint16_t addr, dgus_control_size size)
 Get the size of the box containing the text. More...
 
DGUS_RETURN dgus_get_text_len (uint16_t addr, uint16_t *len)
 Get the text length. More...
 
DGUS_RETURN dgus_set_text_len (uint16_t addr, uint16_t len)
 Set the text length. More...
 
DGUS_RETURN dgus_get_text_fonts (uint16_t addr, uint8_t *font0, uint8_t *font1)
 Get the current font id. More...
 
DGUS_RETURN dgus_set_text_fonts (uint16_t addr, uint8_t font0, uint8_t font1)
 set the font ids More...
 
DGUS_RETURN dgus_get_text_font_dots (uint16_t addr, uint8_t *fontx_dots, uint8_t *fonty_dots)
 Get the elipses breakpoint. i.e. how long before we ... More...
 
DGUS_RETURN dgus_set_text_font_dots (uint16_t addr, uint8_t fontx_dots, uint8_t fonty_dots)
 Set the elipses breakpoint. i.e. how long before we ... More...
 
DGUS_RETURN dgus_get_text_encode_mode_distance (uint16_t addr, uint8_t *encode_mode, uint8_t *vert_distance, uint8_t *horiz_distance)
 Set the text encoding mode and vertical spacing. More...
 
DGUS_RETURN dgus_set_text_encode_mode_distance (uint16_t addr, uint8_t encode_mode, uint8_t vert_distance, uint8_t horiz_distance)
 get text encoding mode and vertical spacing More...
 

Variables

 dgus_control_text_display
 

Detailed Description

DGUS II LCD Text Utilites.

Author
Barry Carter
Date
01 Jan 2021

Function Documentation

◆ dgus_get_text()

DGUS_RETURN dgus_get_text ( uint16_t  addr,
uint8_t *  buf,
uint8_t  len 
)

Read from VAR address as text Reads in 8 bit data format when using 0x02 GBK.

Parameters
addr
buf
len
Returns
Response such as DGUS_TIMEOUT

◆ dgus_get_text_bounding_size()

DGUS_RETURN dgus_get_text_bounding_size ( uint16_t  addr,
dgus_control_size size 
)

Set the size of the box containing the text.

Note
addr must be an SP address and SP must be enabled
Parameters
addr
size
Returns
Response such as DGUS_TIMEOUT

◆ dgus_get_text_colour()

DGUS_RETURN dgus_get_text_colour ( uint16_t  addr,
uint16_t *  colour 
)

Get the colour of the text.

Note
addr must be an SP address and SP must be enabled
Parameters
addr
colour
Returns
Response such as DGUS_TIMEOUT

◆ dgus_get_text_encode_mode_distance()

DGUS_RETURN dgus_get_text_encode_mode_distance ( uint16_t  addr,
uint8_t *  encode_mode,
uint8_t *  vert_distance,
uint8_t *  horiz_distance 
)

Set the text encoding mode and vertical spacing.

Note
addr must be an SP address and SP must be enabled
Parameters
addr
encode_mode0x00=8bit, 0x01=GB2312, 0x02=GBK (most compatible with this lib), 0x03=BIG5, 0x04=SJIS, 0x05=UNICODE
vert_distancespacing y
horiz_distancespacing x
Returns
Response such as DGUS_TIMEOUT

◆ dgus_get_text_font_dots()

DGUS_RETURN dgus_get_text_font_dots ( uint16_t  addr,
uint8_t *  fontx_dots,
uint8_t *  fonty_dots 
)

Get the elipses breakpoint. i.e. how long before we ...

Note
addr must be an SP address and SP must be enabled
Parameters
addr
fontx_dots
fonty_dots
Returns
Response such as DGUS_TIMEOUT

◆ dgus_get_text_fonts()

DGUS_RETURN dgus_get_text_fonts ( uint16_t  addr,
uint8_t *  font0,
uint8_t *  font1 
)

Get the current font id.

Note
addr must be an SP address and SP must be enabled
Parameters
addr
font0
font1
Returns
Response such as DGUS_TIMEOUT

◆ dgus_get_text_len()

DGUS_RETURN dgus_get_text_len ( uint16_t  addr,
uint16_t *  len 
)

Get the text length.

Note
addr must be an SP address and SP must be enabled
Parameters
addr
len
Returns
Response such as DGUS_TIMEOUT

◆ dgus_get_text_pos()

DGUS_RETURN dgus_get_text_pos ( uint16_t  addr,
dgus_control_position pos 
)

Get the position of the text on the screen.

Note
addr must be an SP address and SP must be enabled
Parameters
addr
pos
Returns
Response such as DGUS_TIMEOUT

◆ dgus_get_text_vp()

DGUS_RETURN dgus_get_text_vp ( uint16_t  addr,
uint16_t *  vp 
)

Set the VP pointer address in memory.

Note
addr must be an SP address and SP must be enabled e.g. uint16_t vp; dgus_get_text_vp(0x4000, &vp);
Parameters
addraddress to write to
vpvariable to place result the memory VP address
Returns
Response such as DGUS_TIMEOUT

◆ dgus_set_text()

DGUS_RETURN dgus_set_text ( uint16_t  addr,
char *  text 
)

Write text to the address VAR.

Warning
The DGUS does not do string null termination when rendering. You will need to clear the value beforehand, or use the dgus_set_text()
Parameters
addraddress to write to
texttext to send. Must be null terinated
Returns
Response such as DGUS_TIMEOUT

◆ dgus_set_text_bounding_size()

DGUS_RETURN dgus_set_text_bounding_size ( uint16_t  addr,
dgus_control_size  size 
)

Get the size of the box containing the text.

Note
addr must be an SP address and SP must be enabled
Parameters
addr
size
Returns
Response such as DGUS_TIMEOUT

◆ dgus_set_text_colour()

DGUS_RETURN dgus_set_text_colour ( uint16_t  addr,
uint16_t  colour 
)

Set the colur of the text.

Note
addr must be an SP address and SP must be enabled
Parameters
addr
colour
Returns
Response such as DGUS_TIMEOUT

◆ dgus_set_text_encode_mode_distance()

DGUS_RETURN dgus_set_text_encode_mode_distance ( uint16_t  addr,
uint8_t  encode_mode,
uint8_t  vert_distance,
uint8_t  horiz_distance 
)

get text encoding mode and vertical spacing

Note
addr must be an SP address and SP must be enabled
Parameters
addr
encode_mode0x00=8bit, 0x01=GB2312, 0x02=GBK (most compatible with this lib), 0x03=BIG5, 0x04=SJIS, 0x05=UNICODE
vert_distancespacing y
horiz_distancespacing x
Returns
Response such as DGUS_TIMEOUT

◆ dgus_set_text_font_dots()

DGUS_RETURN dgus_set_text_font_dots ( uint16_t  addr,
uint8_t  fontx_dots,
uint8_t  fonty_dots 
)

Set the elipses breakpoint. i.e. how long before we ...

Note
addr must be an SP address and SP must be enabled
Parameters
addr
fontx_dots
fonty_dots
Returns
Response such as DGUS_TIMEOUT

◆ dgus_set_text_fonts()

DGUS_RETURN dgus_set_text_fonts ( uint16_t  addr,
uint8_t  font0,
uint8_t  font1 
)

set the font ids

Note
addr must be an SP address and SP must be enabled
Parameters
addr
font0
font1
Returns
Response such as DGUS_TIMEOUT

◆ dgus_set_text_len()

DGUS_RETURN dgus_set_text_len ( uint16_t  addr,
uint16_t  len 
)

Set the text length.

Note
addr must be an SP address and SP must be enabled
Parameters
addr
len
Returns
Response such as DGUS_TIMEOUT

◆ dgus_set_text_padded()

DGUS_RETURN dgus_set_text_padded ( uint16_t  addr,
char *  text,
uint8_t  len 
)

Write text to the address VAR and clear all text after to field length len.

Parameters
addr
text
len
Returns
Response such as DGUS_TIMEOUT

◆ dgus_set_text_pos()

DGUS_RETURN dgus_set_text_pos ( uint16_t  addr,
dgus_control_position  pos 
)

Set the position of the text on the screen.

Note
addr must be an SP address and SP must be enabled
Parameters
addr
pos
Returns
Response such as DGUS_TIMEOUT

◆ dgus_set_text_vp()

DGUS_RETURN dgus_set_text_vp ( uint16_t  addr,
uint16_t  vp 
)

Set the virtual pointer VP address for the control.

Note
addr must be an SP address and SP must be enabled
Parameters
addr
vp
Returns
Response such as DGUS_TIMEOUT

Variable Documentation

◆ dgus_control_text_display

dgus_control_text_display

Register layout for the text SP register