ESP32-WROVER-KIT-LCD-DRIVER
Driver.h
Go to the documentation of this file.
1 
9 #ifndef __DRIVER_H
10 #define __DRIVER_H
11 
12 #include <stdio.h>
13 #include <stdlib.h>
14 #include <string.h>
15 #include "driver/spi_master.h"
16 #include "esp_system.h"
17 #include "driver/gpio.h"
18 #include "freertos/FreeRTOS.h"
19 #include "freertos/task.h"
20 
21 #define LCD_HOST HSPI_HOST
22 #define DMA_CHAN 2
23 
24 #define PIN_NUM_MISO 25
25 #define PIN_NUM_MOSI 23
26 #define PIN_NUM_CLK 19
27 #define PIN_NUM_CS 22
28 
29 #define PIN_NUM_DC 21
30 #define PIN_NUM_RST 18
31 #define PIN_NUM_BCKL 5
32 
33 #define LCD_WIDTH 320
34 #define LCD_HIGH 240
35 
36 //To speed up transfers, every SPI transfer sends a bunch of lines. This define specifies how many. More means more memory use,
37 //but less overhead for setting up / finishing transfers. Make sure 240 is dividable by this.
38 #define PARALLEL_LINES 16
39 
40 /*
41  The LCD needs a bunch of command/argument values to be initialized. They are stored in this struct.
42 */
43 typedef struct {
44  uint8_t cmd;
45  uint8_t data[16];
46  uint8_t databytes; //No of data in data; bit 7 = delay after set; 0xFF = end of cmds.
48 
49 typedef enum {
53 } type_lcd_t;
54 
55 esp_err_t vDriver_init(void);
56 esp_err_t iDriver_writeFramebuffer(uint16_t ***pu16Framebuffer);
57 
58 #endif /* __DRIVER_H */
LCD_TYPE_ST
@ LCD_TYPE_ST
Definition: Driver.h:51
LCD_TYPE_MAX
@ LCD_TYPE_MAX
Definition: Driver.h:52
iDriver_writeFramebuffer
esp_err_t iDriver_writeFramebuffer(uint16_t ***pu16Framebuffer)
write framebuffer to LCD via SPI
Definition: Driver.c:341
set
set(srcs "src/LCD.c" "src/Driver.c") idf_component_register(SRCS "$
Definition: CMakeLists.txt:1
LCD_TYPE_ILI
@ LCD_TYPE_ILI
Definition: Driver.h:50
vDriver_init
esp_err_t vDriver_init(void)
Initialize the driver.
Definition: Driver.c:130
type_lcd_t
type_lcd_t
Definition: Driver.h:49
pu16Framebuffer
uint16_t ** pu16Framebuffer
Definition: LCD.c:23
lcd_init_cmd_t::databytes
uint8_t databytes
Definition: Driver.h:46
lcd_init_cmd_t::cmd
uint8_t cmd
Definition: Driver.h:44
lcd_init_cmd_t
Definition: Driver.h:43