Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
grove_lcd.h
Go to the documentation of this file.
1/* grove_lcd.h - Public API for the Grove RGB LCD device */
2/*
3 * Copyright (c) 2015 Intel Corporation
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 */
7#ifndef ZEPHYR_INCLUDE_DISPLAY_GROVE_LCD_H_
8#define ZEPHYR_INCLUDE_DISPLAY_GROVE_LCD_H_
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
28#define GROVE_LCD_NAME "GLCD"
29
37void glcd_print(const struct device *port, char *data, uint32_t size);
38
39
47void glcd_cursor_pos_set(const struct device *port, uint8_t col, uint8_t row);
48
54void glcd_clear(const struct device *port);
55
56/* Defines for the GLCD_CMD_DISPLAY_SWITCH options */
57#define GLCD_DS_DISPLAY_ON (1 << 2)
58#define GLCD_DS_DISPLAY_OFF (0 << 2)
59#define GLCD_DS_CURSOR_ON (1 << 1)
60#define GLCD_DS_CURSOR_OFF (0 << 1)
61#define GLCD_DS_BLINK_ON (1 << 0)
62#define GLCD_DS_BLINK_OFF (0 << 0)
74void glcd_display_state_set(const struct device *port, uint8_t opt);
75
84
85/* Defines for the GLCD_CMD_INPUT_SET to change text direction */
86#define GLCD_IS_SHIFT_INCREMENT (1 << 1)
87#define GLCD_IS_SHIFT_DECREMENT (0 << 1)
88#define GLCD_IS_ENTRY_LEFT (1 << 0)
89#define GLCD_IS_ENTRY_RIGHT (0 << 0)
100void glcd_input_state_set(const struct device *port, uint8_t opt);
101
110
111/* Defines for the LCD_FUNCTION_SET */
112#define GLCD_FS_8BIT_MODE (1 << 4)
113#define GLCD_FS_ROWS_2 (1 << 3)
114#define GLCD_FS_ROWS_1 (0 << 3)
115#define GLCD_FS_DOT_SIZE_BIG (1 << 2)
116#define GLCD_FS_DOT_SIZE_LITTLE (0 << 2)
117/* Bits 0, 1 are not defined for this register */
118
128void glcd_function_set(const struct device *port, uint8_t opt);
129
137uint8_t glcd_function_get(const struct device *port);
138
139
140/* Available color selections */
141#define GROVE_RGB_WHITE 0
142#define GROVE_RGB_RED 1
143#define GROVE_RGB_GREEN 2
144#define GROVE_RGB_BLUE 3
150void glcd_color_select(const struct device *port, uint8_t color);
151
152
161void glcd_color_set(const struct device *port, uint8_t r, uint8_t g,
162 uint8_t b);
163
164
172int glcd_initialize(const struct device *port);
173
174
179#ifdef __cplusplus
180}
181#endif
182
183#endif /* ZEPHYR_INCLUDE_DISPLAY_GROVE_LCD_H_ */
workaround assembler barfing for ST r
Definition: asm-macro-32-bit-gnu.h:24
void glcd_input_state_set(const struct device *port, uint8_t opt)
Function to change the input state.
void glcd_print(const struct device *port, char *data, uint32_t size)
Send text to the screen.
uint8_t glcd_display_state_get(const struct device *port)
return the display feature set associated with the device
int glcd_initialize(const struct device *port)
Initialize the Grove LCD panel.
void glcd_display_state_set(const struct device *port, uint8_t opt)
Function to change the display state.
uint8_t glcd_input_state_get(const struct device *port)
return the input set associated with the device
void glcd_cursor_pos_set(const struct device *port, uint8_t col, uint8_t row)
Set text cursor position for next additions.
void glcd_clear(const struct device *port)
Clear the current display.
uint8_t glcd_function_get(const struct device *port)
return the function set associated with the device
void glcd_color_select(const struct device *port, uint8_t color)
Set LCD background to a predefined color.
void glcd_function_set(const struct device *port, uint8_t opt)
Function to set the functional state of the display.
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.
__UINT32_TYPE__ uint32_t
Definition: stdint.h:60
__UINT8_TYPE__ uint8_t
Definition: stdint.h:58
Runtime device structure (in ROM) per driver instance.
Definition: device.h:367
static fdata_t data[2]
Definition: test_fifo_contexts.c:15