Skip to content

Commit

Permalink
st7796
Browse files Browse the repository at this point in the history
  • Loading branch information
rzeldent committed Mar 6, 2024
1 parent 63f72a4 commit acfa05c
Show file tree
Hide file tree
Showing 8 changed files with 389 additions and 8 deletions.
File renamed without changes.
File renamed without changes.
16 changes: 16 additions & 0 deletions include/esp_lcd_panel_st7796.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#pragma once

#include <esp_lcd.h>
#include <esp_lcd_types.h>
#include <esp_lcd_panel_vendor.h>

#ifdef __cplusplus
extern "C"
{
#endif

esp_err_t esp_lcd_new_panel_gc9a01(const esp_lcd_panel_io_handle_t io, const esp_lcd_panel_dev_config_t *config, esp_lcd_panel_handle_t *handle);

#ifdef __cplusplus
}
#endif
2 changes: 1 addition & 1 deletion src/esp_lcd_st7796.c → src/_esp_lcd_st7796.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifdef LCD_ST7796_SPI
#ifdef _LCD_ST7796_SPI

/*
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
Expand Down
10 changes: 5 additions & 5 deletions src/esp_lcd_gc9a01.c → src/esp_lcd_panel_gc9a01.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ifdef LCD_GC9A01_SPI

#include <esp_lcd_gc9a01.h>
#include <esp_lcd_panel_gc9a01.h>
#include <esp32-hal-log.h>
#include <esp_rom_gpio.h>
#include <esp_heap_caps.h>
Expand All @@ -23,7 +23,7 @@ typedef struct
const uint16_t cmds_size;
} gc9a01_panel_t;

const lcd_init_cmd_t vendor_specific_init_default[] = {
const lcd_init_cmd_t gc9a01_vendor_specific_init_default[] = {
// Enable Inter Register
{0xfe, (const uint8_t[]){0x00}, 0, 0},
{0xef, (const uint8_t[]){0x00}, 0, 0},
Expand Down Expand Up @@ -67,7 +67,7 @@ const lcd_init_cmd_t vendor_specific_init_default[] = {
{0x67, (const uint8_t[]){0x00, 0x3C, 0x00, 0x00, 0x00, 0x01, 0x54, 0x10, 0x32, 0x98}, 10, 0},
{0x74, (const uint8_t[]){0x10, 0x45, 0x80, 0x00, 0x00, 0x4E, 0x00}, 7, 0},
{0x98, (const uint8_t[]){0x3e, 0x07}, 2, 0},
{0x99, (const uint8_t[]){0x3e, 0x07}, 2, 0},
{0x99, (const uint8_t[]){0x3e, 0x07}, 2, 0}
};

esp_err_t gc9a01_reset(esp_lcd_panel_t *panel)
Expand Down Expand Up @@ -139,8 +139,8 @@ esp_err_t gc9a01_init(esp_lcd_panel_t *panel)
return res;
}

const lcd_init_cmd_t *cmd = vendor_specific_init_default;
uint16_t cmds_size = sizeof(vendor_specific_init_default) / sizeof(lcd_init_cmd_t);
const lcd_init_cmd_t *cmd = gc9a01_vendor_specific_init_default;
uint16_t cmds_size = sizeof(gc9a01_vendor_specific_init_default) / sizeof(lcd_init_cmd_t);
if (ph->cmd)
{
cmd = ph->cmd;
Expand Down
Loading

0 comments on commit acfa05c

Please sign in to comment.