LCD-ESP32-Driver 1.0
Project includes component for controlling LCD displays. Currently supports only one LCD controller - SSD1283A but it may change in the future.
Loading...
Searching...
No Matches
lcd_low.h
Go to the documentation of this file.
1/*
2 * MIT License
3 *
4 * Copyright (c) 2022 Damian Úlusarczyk
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
7 * and associated documentation files (the "Software"), to deal in the Software without restriction,
8 * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
10 * subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be included in all copies or substantial
13 * portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
16 * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
18 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19 *
20 */
27#ifndef LCD_LOW_H
28#define LCD_LOW_H
29
30#include <stdbool.h>
31#include <stdint.h>
32#include <stddef.h>
33
34#include "lcd_error_codes.h"
35#include "lcd_image.h"
36#include "lcd_font.h"
37
38typedef struct LCD_com_t LCD_com_t;
40typedef struct LCD_t LCD_t;
41
43typedef struct LCD_com_t * LCD_com_handle_t;
47typedef struct LCD_t * LCD_handle_t;
48
55{
57 bool (*write_cmd)(LCD_handle_t base, const uint8_t cmd);
59 bool (*write_single_bytes)(LCD_handle_t base, const uint8_t *data, const size_t dataSize);
61 bool (*write_two_bytes)(LCD_handle_t base, const uint16_t data);
62};
63
70{
78 LCD_error_t (*DrawRect)(LCD_handle_t base, const uint16_t x, const uint16_t y, const uint16_t width,
79 const uint16_t height, const uint16_t color);
81 LCD_error_t (*DrawImage)(LCD_handle_t base, const uint16_t x, const uint16_t y, const LCD_image_t *image);
85 LCD_error_t (*DrawText)(LCD_handle_t base, uint16_t x, uint16_t y, const char *text,
86 const int16_t letterSpacing, const int16_t lineSpacing, const LCD_font_t *font,
87 const uint16_t fontColor, const uint16_t bgrColor);
89 LCD_error_t (*ClearScreen)(LCD_handle_t base, const uint16_t color);
92};
93
99struct LCD_t
100{
101 uint16_t width;
102 uint16_t height;
106};
107
108#endif /* LCD_LOW_H */
Contains error codes as an enumeration.
LCD_error_t
Describes the status of performed operation with LCD display.
Definition: lcd_error_codes.h:38
Contains representation of the fonts to be drawn on LCD display and methods that simplify the work wi...
Contains representation of the images to be drawn on LCD display and methods that simplify the work w...
struct LCD_com_t * LCD_com_handle_t
Definition: lcd_low.h:43
struct LCD_t * LCD_handle_t
Definition: lcd_low.h:47
struct LCD_controller_t * LCD_controller_handle_t
Definition: lcd_low.h:45
Structure containing function interface for low-level communication with specific LCD controller (som...
Definition: lcd_low.h:55
bool(* write_single_bytes)(LCD_handle_t base, const uint8_t *data, const size_t dataSize)
Definition: lcd_low.h:59
bool(* write_two_bytes)(LCD_handle_t base, const uint16_t data)
Definition: lcd_low.h:61
bool(* write_cmd)(LCD_handle_t base, const uint8_t cmd)
Definition: lcd_low.h:57
Structure containing function interface to implement by specific LCD controller.
Definition: lcd_low.h:70
LCD_error_t(* DisplayOn)(LCD_handle_t base)
Definition: lcd_low.h:74
LCD_error_t(* DisplayOff)(LCD_handle_t base)
Definition: lcd_low.h:76
LCD_error_t(* Init)(LCD_handle_t base)
Definition: lcd_low.h:72
LCD_error_t(* DrawImage)(LCD_handle_t base, const uint16_t x, const uint16_t y, const LCD_image_t *image)
Definition: lcd_low.h:81
LCD_error_t(* DrawRect)(LCD_handle_t base, const uint16_t x, const uint16_t y, const uint16_t width, const uint16_t height, const uint16_t color)
Definition: lcd_low.h:78
LCD_error_t(* Destroy)(LCD_handle_t base)
Definition: lcd_low.h:91
LCD_error_t(* ClearScreen)(LCD_handle_t base, const uint16_t color)
Definition: lcd_low.h:89
LCD_error_t(* DrawText)(LCD_handle_t base, uint16_t x, uint16_t y, const char *text, const int16_t letterSpacing, const int16_t lineSpacing, const LCD_font_t *font, const uint16_t fontColor, const uint16_t bgrColor)
Definition: lcd_low.h:85
Describes properties of the font to be drawn on LCD display.
Definition: lcd_font.h:43
Describes properties of the image to be drawn on LCD display.
Definition: lcd_image.h:39
Base structure describing characteristics of LCD display and its driver.
Definition: lcd_low.h:100
LCD_controller_handle_t controller
Definition: lcd_low.h:105
uint16_t height
Definition: lcd_low.h:102
bool displayState
Definition: lcd_low.h:103
uint16_t width
Definition: lcd_low.h:101
LCD_com_handle_t com
Definition: lcd_low.h:104