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

DGUS II LCD Driver Utility functions. More...

#include <stddef.h>
#include <stdint.h>
#include "dgus_reg.h"
#include "dgus.h"
Include dependency graph for dgus_util.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_cmd_music
 Layout of the music command register. More...
 
DGUS_RETURN dgus_get_page (uint16_t *page)
 Get the currently displayed page ID number. More...
 
DGUS_RETURN dgus_set_page (uint8_t page)
 Change DGUS page. More...
 
DGUS_RETURN dgus_set_icon (uint16_t icon_addr, uint8_t val)
 Change an icon to index val. More...
 
DGUS_RETURN dgus_get_brightness (uint8_t *brightness)
 Get the current brightness for the display. More...
 
DGUS_RETURN dgus_set_brightness (uint8_t brightness)
 Get the current brightness for the display. More...
 
DGUS_RETURN dgus_get_volume (uint8_t *volume)
 Get the current volume. More...
 
DGUS_RETURN dgus_set_volume (uint8_t volume)
 Set the current volume level. More...
 
DGUS_RETURN dgus_system_reset (uint8_t full_reset)
 Reset the DGUS display. More...
 
DGUS_RETURN dgus_get_system_config (dgus_cmd_system_config *config)
 Read the system configuration variable. More...
 
DGUS_RETURN dgus_play_sound (uint8_t sound_id, uint8_t section_id, uint8_t volume, uint8_t play_mode)
 PLay a stored wav by id. More...
 

Variables

 dgus_cmd_music
 
 dgus_cmd_led_config
 
 dgus_cmd_system_config
 

Detailed Description

DGUS II LCD Driver Utility functions.

Author
Barry Carter
Date
01 Jan 2021

Function Documentation

◆ __attribute__()

struct __attribute__ ( (packed)  )

Layout of the music command register.

System configuration information.

Brightnedd LED configuration.

Returns
typedef struct

< Start playback of the Wav Id

< Play back on the segment id

< Volume level to play 0-0x80

< 0 stop, 1 pause, 2 play

< Brightness while not in idle (0x0- 0x64)

< Brightness while in idle (0x0- 0x64)

< Time before we idle /5ms

< 0x0 to read this register, 0x5A to write. Write data at your peril

< RO Current touchscreen sensitivility value

< RO Touch Mode. Regular DGUS, raw or paint

< Serial comms CRC Enabled

< Buzzer on (1)/off(0)

< RO Load the 22_.bin configuration file

< Global control over auto upload. Controls that auto-upload will be disabled)

< Global audio control over button press audio

< Enable or disbale backlight standby mode

< Current screen orientation. 00=0, 01 = 90, 10=180, 11=270

◆ dgus_get_brightness()

DGUS_RETURN dgus_get_brightness ( uint8_t *  brightness)

Get the current brightness for the display.

Parameters
brightnessvalue from 0 - 100%
Returns
DGUS_RETURN

◆ dgus_get_page()

DGUS_RETURN dgus_get_page ( uint16_t *  page)

Get the currently displayed page ID number.

Parameters
pagea pointer the page id variable
Returns
DGUS_RETURN

◆ dgus_get_system_config()

DGUS_RETURN dgus_get_system_config ( dgus_cmd_system_config config)

Read the system configuration variable.

Parameters
config
Returns
DGUS_RETURN

◆ dgus_get_volume()

DGUS_RETURN dgus_get_volume ( uint8_t *  volume)

Get the current volume.

Parameters
volumepointer. 0-255 volume
Returns
DGUS_RETURN

◆ dgus_play_sound()

DGUS_RETURN dgus_play_sound ( uint8_t  sound_id,
uint8_t  section_id,
uint8_t  volume,
uint8_t  play_mode 
)

PLay a stored wav by id.

Parameters
sound_idid of the wav from the designer
section_idsection of the wav to play
volume
play_mode0x0 stop, 0x1 pause, 0x2 play || or section_id to loop back to (firmware version dependant)
Returns
DGUS_RETURN

◆ dgus_set_brightness()

DGUS_RETURN dgus_set_brightness ( uint8_t  brightness)

Get the current brightness for the display.

Parameters
brightnessvalue from 0 - 100%
Returns
DGUS_RETURN

◆ dgus_set_icon()

DGUS_RETURN dgus_set_icon ( uint16_t  icon_addr,
uint8_t  val 
)

Change an icon to index val.

Parameters
icon_addrVP of the icon
valindex to set to
Returns
DGUS_RETURN

◆ dgus_set_page()

DGUS_RETURN dgus_set_page ( uint8_t  page)

Change DGUS page.

Parameters
pagepage id
Returns
DGUS_RETURN

◆ dgus_set_volume()

DGUS_RETURN dgus_set_volume ( uint8_t  volume)

Set the current volume level.

Parameters
volume0-255
Returns
DGUS_RETURN

◆ dgus_system_reset()

DGUS_RETURN dgus_system_reset ( uint8_t  full_reset)

Reset the DGUS display.

Parameters
full_reset0 or 1. 1 will perform a full reset including T5 chip, NAND and all peripherals
Returns
DGUS_RETURN

Variable Documentation

◆ dgus_cmd_led_config

dgus_cmd_led_config

Led config

◆ dgus_cmd_music

dgus_cmd_music

Music cmd

◆ dgus_cmd_system_config

dgus_cmd_system_config

sys config