Display Driver#
The display driver is responsible for all interactions with the display. As such, it includes many functions to set various screen elements’ values. The driver defines a command struct, which represents a command to be sent to the display. The driver exposes the following functions:
Display_Error_t Display_Init(void)— Initializes UART and resets the display.Display_Error_t Display_Reset(void)— Sends the reset command to the display.Display_Error_t Display_Send(Display_Cmd_t cmd)— Send the given command to the display. In general, this function shouldn’t be called directly. See FILLER for more details on where it’s called.Display_Error_t Display_Fault(fault_bitmap_t faultCode)— Display the fault page on the display, presentingfaultCodeto the user.
Command Structure#
A more detailed description of the command structure is given below. For more information on the command syntax, see the Nextion Documentation:
char* compOrCmd— Either a component or a command, depending on the next few valueschar *attr— When the above is a component, the attribute of that component. Else,NULLchar *op— The operation when the above two are set, usually=. Else, NULLnumArgs— The number of arguments the command takes. Should be 1 if setting componentargTypes[]— A list of the argument types to followargs— The actual arguments for the command (strings or ints)
- group Display
Defines
-
MAX_ARGS 2#
Enums
-
enum DisplayError_t#
Error types
Values:
-
enumerator DISPLAY_ERR_NONE#
-
enumerator DISPLAY_ERR_PARSE#
-
enumerator DISPLAY_ERR_INV_INSTR#
-
enumerator DISPLAY_ERR_INV_COMP#
-
enumerator DISPLAY_ERR_INV_PGID#
-
enumerator DISPLAY_ERR_INV_VAR#
-
enumerator DISPLAY_ERR_INV_VAROP#
-
enumerator DISPLAY_ERR_ASSIGN#
-
enumerator DISPLAY_ERR_PARAMS#
-
enumerator DISPLAY_ERR_MAX_ARGS#
-
enumerator DISPLAY_ERR_OTHER#
-
enumerator DISPLAY_ERR_NONE#
Functions
-
DisplayError_t Display_Send(DisplayCmd_t cmd)#
Sends a display message.
- Returns:
DisplayError_t
-
DisplayError_t Display_Init(void)#
Initializes the display.
- Returns:
DisplayError_t
-
DisplayError_t Display_Reset(void)#
Resets (reboots) the display.
- Returns:
DisplayError_t
-
DisplayError_t Display_Error()#
Overwrites any processing commands and triggers the display fault screen.
- Returns:
DisplayError_t
-
DisplayError_t Display_Evac(uint8_t SOC_percent, uint32_t supp_mv)#
Overwrites any processing commands and triggers the evacuation screen.
- Parameters:
SOC_percent – the state of charge of the battery in percent
supp_mv – the voltage of the battery in millivolts
- Returns:
DisplayError_t
Variables
-
char *compOrCmd#
-
char *attr#
-
char *op#
-
uint8_t numArgs#
-
char *str#
-
char *str
-
uint32_t num#
-
uint32_t num
-
union DisplayCmd_t::[anonymous] args[MAX_ARGS]#
-
struct DisplayCmd_t#
- #include <Display.h>
Packages relevant display command data
-
MAX_ARGS 2#