Common LCD functions
git submodule add https://github.com/liyanboy74/dispcolor.git components/dispcolor
Edit #define DISPCOLOR_type
in dispcolor.h
file , or Define DISPCOLOR_type
=1
or 2
or ...
Clone GC9A01 Component
Edit CMakeLists.txt
file and edit patch of header gc9a01.h
as below example:
set(LCD_Header_Dir "../gc9a01")
#include <stdio.h>
#include <string.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "driver/gpio.h"
#include "sdkconfig.h"
#include "dispcolor.h"
#define STACK_SIZE 2048
void LCD(void * arg)
{
dispcolor_Init(240,240);
dispcolor_FillCircleWu(120,120,100,YELLOW);
dispcolor_Update();
for(;;)
{
}
}
void app_main(void)
{
TaskHandle_t LCDHandle;
xTaskCreate(LCD,"Test LCD",STACK_SIZE,NULL,tskIDLE_PRIORITY,&LCDHandle);
configASSERT(LCDHandle);
}
Clone SIMLCD Component
Edit CMakeLists.txt
file and edit patch of header simlcd.h
as below example:
set(LCD_Header_Dir "../simlcd")
You may need to edit the following functions :
void dispcolor_Init(uint16_t Width, uint16_t Height);
void dispcolor_Update();
void dispcolor_DrawPixel(int16_t x, int16_t y, uint16_t color);
void dispcolor_FillRect(int16_t x, int16_t y, int16_t w, int16_t h,uint16_t color);