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.h File Reference

Contains driver functions to communicate with LCD display using different protocols and controllers. More...

#include "lcd_low.h"

Go to the source code of this file.

Functions

LCD_error_t lcd__Init (LCD_handle_t device)
 Initializes the specific LCD device. More...
 
LCD_error_t lcd__DisplayOn (LCD_handle_t device)
 Turns on the LCD display for the specific device. More...
 
LCD_error_t lcd__DisplayOff (LCD_handle_t device)
 Turns off the LCD display for the specific device. More...
 
LCD_error_t lcd__DrawRect (LCD_handle_t device, const uint16_t x, const uint16_t y, const uint16_t width, const uint16_t height, const uint16_t color)
 Draws rectangle on the LCD display in specific position and color. More...
 
LCD_error_t lcd__DrawImage (LCD_handle_t device, const uint16_t x, const uint16_t y, const LCD_image_t *image)
 Draws image on the LCD display in specific position. More...
 
LCD_error_t lcd__DrawText (LCD_handle_t device, 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)
 Draws text on the LCD display with specified properties. More...
 
LCD_error_t lcd__ClearScreen (LCD_handle_t device, const uint16_t color)
 Clears the screen of the LCD display with specified color. More...
 
LCD_error_t lcd__Destroy (LCD_handle_t *device)
 Destroys the specific LCD driver instance. More...
 

Detailed Description

Contains driver functions to communicate with LCD display using different protocols and controllers.

Author
Damian Úlusarczyk

Function Documentation

◆ lcd__ClearScreen()

LCD_error_t lcd__ClearScreen ( LCD_handle_t  device,
const uint16_t  color 
)

Clears the screen of the LCD display with specified color.

Parameters
deviceHandle of the selected LCD device
color16-bit color value (format RGB565) to fill the screen
Returns
LCD_error_t Status code of the operation

◆ lcd__Destroy()

LCD_error_t lcd__Destroy ( LCD_handle_t device)

Destroys the specific LCD driver instance.

Frees the memory allocated dynamically for the driver instance.

Parameters
devicePointer to handle for the selected LCD device
Returns
LCD_error_t Status code of the operation

◆ lcd__DisplayOff()

LCD_error_t lcd__DisplayOff ( LCD_handle_t  device)

Turns off the LCD display for the specific device.

Parameters
deviceHandle of the selected LCD device
Returns
LCD_error_t Status code of the operation

◆ lcd__DisplayOn()

LCD_error_t lcd__DisplayOn ( LCD_handle_t  device)

Turns on the LCD display for the specific device.

Note
Display should be turned on after using lcd__Init() function.
Parameters
deviceHandle for the selected LCD device
Returns
LCD_error_t Status code of the operation

◆ lcd__DrawImage()

LCD_error_t lcd__DrawImage ( LCD_handle_t  device,
const uint16_t  x,
const uint16_t  y,
const LCD_image_t image 
)

Draws image on the LCD display in specific position.

Parameters
deviceHandle of the selected LCD device
xPosition of the top left pixel of the image in X-axis
yPosition of the top left pixel of the image in Y-axis
imagePointer to the image to be drawn
Returns
LCD_error_t Status code of the operation

◆ lcd__DrawRect()

LCD_error_t lcd__DrawRect ( LCD_handle_t  device,
const uint16_t  x,
const uint16_t  y,
const uint16_t  width,
const uint16_t  height,
const uint16_t  color 
)

Draws rectangle on the LCD display in specific position and color.

Parameters
deviceHandle of the selected LCD device
xPosition of the top left pixel of the rectangle in X-axis
yPosition of the top left pixel of the rectangle in Y-axis
widthWidth of the rectangle (in pixels)
heightHeight of the rectangle (in pixels)
color16-bit color value (format RGB565) of the rectangle
Returns
LCD_error_t Status code of the operation

◆ lcd__DrawText()

LCD_error_t lcd__DrawText ( LCD_handle_t  device,
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 
)

Draws text on the LCD display with specified properties.

Parameters
deviceHandle of the selected LCD device
xPosition of the top left pixel of the first character in X-axis
yPosition of the top left pixel of the first character in Y-axis
textText to be drawn
letterSpacingLetter spacing value in pixels
lineSpacingLine spacing value in pixels
fontPointer to the font of the drawn text
fontColor16-bit color value (format RGB565) of the font
bgrColor16-bit color value (format RGB565) of the text background
Returns
LCD_error_t Status code of the operation

◆ lcd__Init()

LCD_error_t lcd__Init ( LCD_handle_t  device)

Initializes the specific LCD device.

Prepares the LCD display to work with the driver.

Note
This method need to be called before using any other driver functions.
Parameters
deviceHandle for the selected LCD device
Returns
LCD_error_t Status code of the operation