Driver.h
Go to the documentation of this file.
#ifndef __DRIVER_H
#define __DRIVER_H
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "driver/spi_master.h"
#include "esp_system.h"
#include "driver/gpio.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#define LCD_HOST HSPI_HOST
#define DMA_CHAN 2
#define PIN_NUM_MISO 25
#define PIN_NUM_MOSI 23
#define PIN_NUM_CLK 19
#define PIN_NUM_CS 22
#define PIN_NUM_DC 21
#define PIN_NUM_RST 18
#define PIN_NUM_BCKL 5
#define LCD_WIDTH 320
#define LCD_HIGH 240
//To speed up transfers, every SPI transfer sends a bunch of lines. This define specifies how many. More means more memory use,
//but less overhead for setting up / finishing transfers. Make sure 240 is dividable by this.
#define PARALLEL_LINES 16
/*
The LCD needs a bunch of command/argument values to be initialized. They are stored in this struct.
*/
typedef struct {
uint8_t cmd;
uint8_t data[16];
uint8_t databytes; //No of data in data; bit 7 = delay after set; 0xFF = end of cmds.
} lcd_init_cmd_t;
typedef enum {
LCD_TYPE_ILI = 1,
LCD_TYPE_ST,
LCD_TYPE_MAX,
} type_lcd_t;
esp_err_t vDriver_init(void);
esp_err_t iDriver_writeFramebuffer(uint16_t ***pu16Framebuffer);
#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