ESP32 LCD Driver v1.0
LCD Driver Documenation
Loading...
Searching...
No Matches
esp_lcd.h File Reference

Liquid Crystal Display header file. More...

#include "driver/gpio.h"
Include dependency graph for esp_lcd.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  lcd_t
 LCD object. More...
 

Macros

#define LCD_FAIL   -1
 
#define LCD_OK   0
 
#define LCD_DATA_LINE   4
 

Typedefs

typedef int lcd_err_t
 

Enumerations

enum  lcd_state_t {
  LCD_INACTIVE = 0 , LCD_ACTIVE = 1 , LCD_INACTIVE = 0 , LCD_ACTIVE = 1 ,
  LCD_INACTIVE = 0 , LCD_ACTIVE = 1
}
 

Functions

void lcdDefault (lcd_t *const lcd)
 LCD default constructor. More...
 
void lcdInit (lcd_t *const lcd)
 Initialize LCD object. More...
 
void lcdCtor (lcd_t *lcd, gpio_num_t data[LCD_DATA_LINE], gpio_num_t en, gpio_num_t regSel)
 LCD constructor. More...
 
lcd_err_t lcdSetText (lcd_t *const lcd, char *text, int x, int y)
 Set text. More...
 
lcd_err_t lcdSetInt (lcd_t *const lcd, int val, int x, int y)
 Set integer. More...
 
lcd_err_t lcdClear (lcd_t *const lcd)
 Clear LCD screen Detailed description starts here. More...
 
void lcdFree (lcd_t *const lcd)
 Reset pins to default configuration. More...
 
void assert_lcd (lcd_err_t lcd_error)
 

Detailed Description

Liquid Crystal Display header file.

Author
Jesus Minjares (https://github.com/jminjares4)
Version
0.1
Date
2022-08-15

Macro Definition Documentation

◆ LCD_DATA_LINE

#define LCD_DATA_LINE   4

4-Bit data line

◆ LCD_FAIL

#define LCD_FAIL   -1

LCD fail error

◆ LCD_OK

#define LCD_OK   0

LCD success

Typedef Documentation

◆ lcd_err_t

typedef int lcd_err_t

LCD error type

Enumeration Type Documentation

◆ lcd_state_t

Enumerator
LCD_INACTIVE 

LCD inactive

LCD_ACTIVE 

LCD active

LCD_INACTIVE 

LCD inactive

LCD_ACTIVE 

LCD active

LCD_INACTIVE 

LCD inactive

LCD_ACTIVE 

LCD active

Function Documentation

◆ assert_lcd()

void assert_lcd ( lcd_err_t  lcd_error)

◆ lcdClear()

lcd_err_t lcdClear ( lcd_t *const  lcd)

Clear LCD screen Detailed description starts here.

Parameters
lcdpointer to LCD object
Returns
lcd error status
See also
lcd_err_t

◆ lcdCtor()

void lcdCtor ( lcd_t lcd,
gpio_num_t  data[LCD_DATA_LINE],
gpio_num_t  en,
gpio_num_t  regSel 
)

LCD constructor.

Detailed description starts here

Parameters
lcdpointer to LCD object
datalcd data array
enlcd en
regSelregister select
Returns
None

◆ lcdDefault()

void lcdDefault ( lcd_t *const  lcd)

LCD default constructor.

Parameters
lcdpointer to LCD object
Note
This function call will use hardcode pins. If you want to use custom pins
See also
lcd_ctor
Returns
None

◆ lcdFree()

void lcdFree ( lcd_t *const  lcd)

Reset pins to default configuration.

Freeing GPIO pins.

Parameters
lcdpointer to LCD object
Note
This function will set GPIO pins to reset configuration, disabling the LCD.
See also
gpio_reset_pin()

◆ lcdInit()

void lcdInit ( lcd_t *const  lcd)

Initialize LCD object.

Parameters
lcdpointer to LCD object
Note
Must constructor LCD object.
See also
lcd_ctor() and
lcd_default()
Returns
None

◆ lcdSetInt()

lcd_err_t lcdSetInt ( lcd_t *const  lcd,
int  val,
int  x,
int  y 
)

Set integer.

Detailed description starts here

Parameters
lcdpointer to LCD object
valinteger value to be displayed
xlocation at x-axis
ylocation at y-axis
Returns
lcd error status
See also
lcd_err_t

◆ lcdSetText()

lcd_err_t lcdSetText ( lcd_t *const  lcd,
char *  text,
int  x,
int  y 
)

Set text.

Detailed description starts here

Parameters
lcdpointer to LCD object
textstring text
xlocation at x-axis
ylocation at y-axis
Returns
lcd error status
See also
lcd_err_t