Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
Grove display APIs

Grove display APIs. More...

Macros

#define GROVE_LCD_NAME   "GLCD"
 
#define GLCD_DS_DISPLAY_ON   (1 << 2)
 
#define GLCD_DS_DISPLAY_OFF   (0 << 2)
 
#define GLCD_DS_CURSOR_ON   (1 << 1)
 
#define GLCD_DS_CURSOR_OFF   (0 << 1)
 
#define GLCD_DS_BLINK_ON   (1 << 0)
 
#define GLCD_DS_BLINK_OFF   (0 << 0)
 
#define GLCD_IS_SHIFT_INCREMENT   (1 << 1)
 
#define GLCD_IS_SHIFT_DECREMENT   (0 << 1)
 
#define GLCD_IS_ENTRY_LEFT   (1 << 0)
 
#define GLCD_IS_ENTRY_RIGHT   (0 << 0)
 
#define GLCD_FS_8BIT_MODE   (1 << 4)
 
#define GLCD_FS_ROWS_2   (1 << 3)
 
#define GLCD_FS_ROWS_1   (0 << 3)
 
#define GLCD_FS_DOT_SIZE_BIG   (1 << 2)
 
#define GLCD_FS_DOT_SIZE_LITTLE   (0 << 2)
 
#define GROVE_RGB_WHITE   0
 
#define GROVE_RGB_RED   1
 
#define GROVE_RGB_GREEN   2
 
#define GROVE_RGB_BLUE   3
 

Functions

void glcd_print (const struct device *port, char *data, uint32_t size)
 Send text to the screen. More...
 
void glcd_cursor_pos_set (const struct device *port, uint8_t col, uint8_t row)
 Set text cursor position for next additions. More...
 
void glcd_clear (const struct device *port)
 Clear the current display. More...
 
void glcd_display_state_set (const struct device *port, uint8_t opt)
 Function to change the display state. More...
 
uint8_t glcd_display_state_get (const struct device *port)
 return the display feature set associated with the device More...
 
void glcd_input_state_set (const struct device *port, uint8_t opt)
 Function to change the input state. More...
 
uint8_t glcd_input_state_get (const struct device *port)
 return the input set associated with the device More...
 
void glcd_function_set (const struct device *port, uint8_t opt)
 Function to set the functional state of the display. More...
 
uint8_t glcd_function_get (const struct device *port)
 return the function set associated with the device More...
 
void glcd_color_select (const struct device *port, uint8_t color)
 Set LCD background to a predefined color. More...
 
void glcd_color_set (const struct device *port, uint8_t r, uint8_t g, uint8_t b)
 Set LCD background to custom RGB color value. More...
 
int glcd_initialize (const struct device *port)
 Initialize the Grove LCD panel. More...
 

Detailed Description

Grove display APIs.

Macro Definition Documentation

◆ GLCD_DS_BLINK_OFF

#define GLCD_DS_BLINK_OFF   (0 << 0)

◆ GLCD_DS_BLINK_ON

#define GLCD_DS_BLINK_ON   (1 << 0)

◆ GLCD_DS_CURSOR_OFF

#define GLCD_DS_CURSOR_OFF   (0 << 1)

◆ GLCD_DS_CURSOR_ON

#define GLCD_DS_CURSOR_ON   (1 << 1)

◆ GLCD_DS_DISPLAY_OFF

#define GLCD_DS_DISPLAY_OFF   (0 << 2)

◆ GLCD_DS_DISPLAY_ON

#define GLCD_DS_DISPLAY_ON   (1 << 2)

◆ GLCD_FS_8BIT_MODE

#define GLCD_FS_8BIT_MODE   (1 << 4)

◆ GLCD_FS_DOT_SIZE_BIG

#define GLCD_FS_DOT_SIZE_BIG   (1 << 2)

◆ GLCD_FS_DOT_SIZE_LITTLE

#define GLCD_FS_DOT_SIZE_LITTLE   (0 << 2)

◆ GLCD_FS_ROWS_1

#define GLCD_FS_ROWS_1   (0 << 3)

◆ GLCD_FS_ROWS_2

#define GLCD_FS_ROWS_2   (1 << 3)

◆ GLCD_IS_ENTRY_LEFT

#define GLCD_IS_ENTRY_LEFT   (1 << 0)

◆ GLCD_IS_ENTRY_RIGHT

#define GLCD_IS_ENTRY_RIGHT   (0 << 0)

◆ GLCD_IS_SHIFT_DECREMENT

#define GLCD_IS_SHIFT_DECREMENT   (0 << 1)

◆ GLCD_IS_SHIFT_INCREMENT

#define GLCD_IS_SHIFT_INCREMENT   (1 << 1)

◆ GROVE_LCD_NAME

#define GROVE_LCD_NAME   "GLCD"

◆ GROVE_RGB_BLUE

#define GROVE_RGB_BLUE   3

◆ GROVE_RGB_GREEN

#define GROVE_RGB_GREEN   2

◆ GROVE_RGB_RED

#define GROVE_RGB_RED   1

◆ GROVE_RGB_WHITE

#define GROVE_RGB_WHITE   0

Function Documentation

◆ glcd_clear()

void glcd_clear ( const struct device port)

#include <include/display/grove_lcd.h>

Clear the current display.

Parameters
portPointer to device structure for driver instance.

◆ glcd_color_select()

void glcd_color_select ( const struct device port,
uint8_t  color 
)

#include <include/display/grove_lcd.h>

Set LCD background to a predefined color.

Parameters
portPointer to device structure for driver instance.
colorOne of the predefined color options

◆ glcd_color_set()

void glcd_color_set ( const struct device port,
uint8_t  r,
uint8_t  g,
uint8_t  b 
)

#include <include/display/grove_lcd.h>

Set LCD background to custom RGB color value.

Parameters
portPointer to device structure for driver instance.
rA numeric value for the red color (max is 255)
gA numeric value for the green color (max is 255)
bA numeric value for the blue color (max is 255)

◆ glcd_cursor_pos_set()

void glcd_cursor_pos_set ( const struct device port,
uint8_t  col,
uint8_t  row 
)

#include <include/display/grove_lcd.h>

Set text cursor position for next additions.

Parameters
portPointer to device structure for driver instance.
colthe column for the cursor to be moved to (0-15)
rowthe row it should be moved to (0 or 1)

◆ glcd_display_state_get()

uint8_t glcd_display_state_get ( const struct device port)

#include <include/display/grove_lcd.h>

return the display feature set associated with the device

Parameters
portthe Grove LCD to get the display features set
Returns
the display feature set associated with the device.

◆ glcd_display_state_set()

void glcd_display_state_set ( const struct device port,
uint8_t  opt 
)

#include <include/display/grove_lcd.h>

Function to change the display state.

This function provides the user the ability to change the state of the display as per needed. Controlling things like powering on or off the screen, the option to display the cursor or not, and the ability to blink the cursor.

Parameters
portPointer to device structure for driver instance.
optAn 8bit bitmask of GLCD_DS_* options.

◆ glcd_function_get()

uint8_t glcd_function_get ( const struct device port)

#include <include/display/grove_lcd.h>

return the function set associated with the device

Parameters
portthe Grove LCD to get the functions set
Returns
the function features set associated with the device.

◆ glcd_function_set()

void glcd_function_set ( const struct device port,
uint8_t  opt 
)

#include <include/display/grove_lcd.h>

Function to set the functional state of the display.

Parameters
portPointer to device structure for driver instance.
optA bitmask of GLCD_FS_* options

This function provides the user the ability to change the state of the display as per needed. Controlling things like the number of rows, dot size, and text display quality.

◆ glcd_initialize()

int glcd_initialize ( const struct device port)

#include <include/display/grove_lcd.h>

Initialize the Grove LCD panel.

Parameters
portPointer to device structure for driver instance.
Returns
Returns 0 if all passes

◆ glcd_input_state_get()

uint8_t glcd_input_state_get ( const struct device port)

#include <include/display/grove_lcd.h>

return the input set associated with the device

Parameters
portthe Grove LCD to get the input features set
Returns
the input set associated with the device.

◆ glcd_input_state_set()

void glcd_input_state_set ( const struct device port,
uint8_t  opt 
)

#include <include/display/grove_lcd.h>

Function to change the input state.

This function provides the user the ability to change the state of the text input. Controlling things like text entry from the left or right side, and how far to increment on new text

Parameters
portPointer to device structure for driver instance.
optA bitmask of GLCD_IS_* options

◆ glcd_print()

void glcd_print ( const struct device port,
char *  data,
uint32_t  size 
)

#include <include/display/grove_lcd.h>

Send text to the screen.

Parameters
portPointer to device structure for driver instance.
datathe ASCII text to display
sizethe length of the text in bytes