PER Firmware
Loading...
Searching...
No Matches
nextion.h File Reference

Nextion display driver interface. More...

#include <stdint.h>
#include <strbuf.h>

Go to the source code of this file.

Macros

#define NXT_CMD_TERM   "\xFF\xFF\xFF"
 
#define ASCII_OFFSET   48
 
#define NXT_BACKGROUND_COLOR   ".bco="
 
#define NXT_FONT_COLOR   ".pco="
 
#define NXT_VALUE   ".val="
 
#define NXT_TEXT   ".txt="
 
#define NXT_BORDERW   ".borderw="
 
#define NXT_BORDER_COLOR   ".borderc="
 
#define NXT_PAGE   "page "
 
#define NXT_BRIGHTNESS   "dims="
 
#define NXT_BAUD   "bauds="
 

Functions

void NXT_setFloat (char *obj_name, char *param, float num, uint8_t precision)
 Sets a float value to a specified object parameter on the Nextion display.
 
void NXT_setValue (char *obj_name, uint16_t val)
 Sets a value to a specified object on the Nextion display.
 
void NXT_setBackground (char *obj_name, uint16_t val)
 Sets the background color of a specified object on the Nextion display.
 
void NXT_setFontColor (char *obj_name, uint16_t val)
 Sets the font color of a specified object on the Nextion display.
 
void NXT_setBorderWidth (char *obj_name, uint16_t val)
 Sets the border width of a specified object on the Nextion display.
 
void NXT_setBorderColor (char *obj_name, uint16_t val)
 Sets the border color of a specified object on the Nextion display.
 
void NXT_setText (char *obj_name, char *text)
 Sets the text of a Nextion display object.
 
void NXT_setTextFormatted (char *obj_name, const char *format,...)
 Sets the text of a Nextion display object using printf-style formatting.
 
void NXT_setPage (char *page_name)
 Sets the current page on the Nextion display.
 
void NXT_setBrightness (uint8_t brightness)
 Sets the brightness of the Nextion display.
 
void NXT_setBaud (uint32_t baud)
 Sets the baud rate for the Nextion display.
 

Detailed Description

Nextion display driver interface.

Interface for controlling Nextion display modules through serial communication.

Author
Matthew Flanagan (matth.nosp@m.ewda.nosp@m.vidfl.nosp@m.anag.nosp@m.an@ou.nosp@m.tloo.nosp@m.k.com)
Luke Oxley (lcoxl.nosp@m.ey@p.nosp@m.urdue.nosp@m..edu)
Irving Wang (irvin.nosp@m.gw@p.nosp@m.urdue.nosp@m..edu)

Function Documentation

◆ NXT_setBackground()

void NXT_setBackground ( char * obj_name,
uint16_t val )

Sets the background color of a specified object on the Nextion display.

Parameters
obj_nameThe name of the object on the Nextion display.
valThe background color value to set for the specified object.

◆ NXT_setBaud()

void NXT_setBaud ( uint32_t baud)

Sets the baud rate for the Nextion display.

Parameters
baudThe desired baud rate to set for the Nextion display.

◆ NXT_setBorderColor()

void NXT_setBorderColor ( char * obj_name,
uint16_t val )

Sets the border color of a specified object on the Nextion display.

Parameters
obj_nameThe name of the object on the Nextion display.
valThe border color value to set for the specified object.

◆ NXT_setBorderWidth()

void NXT_setBorderWidth ( char * obj_name,
uint16_t val )

Sets the border width of a specified object on the Nextion display.

Parameters
obj_nameThe name of the object on the Nextion display.
valThe border width value to set for the specified object.

◆ NXT_setBrightness()

void NXT_setBrightness ( uint8_t percentage)

Sets the brightness of the Nextion display.

Parameters
percentageThe desired brightness level as a percentage (0-100).

◆ NXT_setFloat()

void NXT_setFloat ( char * obj_name,
char * param,
float num,
uint8_t precision )

Sets a float value to a specified object parameter on the Nextion display.

Parameters
obj_nameThe name of the object on the Nextion display.
paramThe parameter of the object to set the float value to.
numThe float value to set.
precisionThe number of decimal places to include in the formatted float value.

◆ NXT_setFontColor()

void NXT_setFontColor ( char * obj_name,
uint16_t val )

Sets the font color of a specified object on the Nextion display.

Parameters
obj_nameThe name of the object on the Nextion display.
valThe font color value to set for the specified object.

◆ NXT_setPage()

void NXT_setPage ( char * page_name)

Sets the current page on the Nextion display.

Parameters
page_nameThe name of the page to set on the Nextion display.

◆ NXT_setText()

void NXT_setText ( char * obj_name,
char * text )

Sets the text of a Nextion display object.

Parameters
obj_nameThe name of the Nextion object (e.g., "t0").
textThe text to set for the specified obect.

◆ NXT_setTextFormatted()

void NXT_setTextFormatted ( char * obj_name,
const char * format,
... )

Sets the text of a Nextion display object using printf-style formatting.

Parameters
obj_nameThe name of the Nextion object (e.g., "t0").
formatPrintf-style format string.
...Variable arguments for format string.

◆ NXT_setValue()

void NXT_setValue ( char * obj_name,
uint16_t val )

Sets a value to a specified object on the Nextion display.

Parameters
obj_nameThe name of the object on the Nextion display.
valThe value to set for the specified object.