[PSoC6] CY8CKIT-028-TFT / PSoC63 / CY8C6347BZI-BLD53 / CYPRESS

2020. 7. 15. 11:21💿/Firmware

  본글은 CE223726_EmWin_TFT_Display_ST7789.pdf 의 번역 및 개인 자료 보관용입니다.
너그럽게 봐주시고 잘못된 정보가 있으면 피드백 감사합니다.

:+:+:+:+:+: DEVICE :+:+:+:+:+:+:

Base : PSoC6 (PSoC63) "CY8C6347BZI-BLD53"
Kit(Shield) : CY8CKIT - 028 - TFT -> TFT DISPLAY SHIELD
Example : CE223726_EmWin_TFT_Display_ST7789.pdf
For details of EmWin Graphics Library API : See the Emwin documentation UM03001_emWin5.pdf

CE223726_EmWin_TFT_Display_ST7789

:+:+:+:+:+: REFERENCE :+:+:+:+:+:+:


Newhaven 2.4″ 320×240 TFT display with a Sitronix ST7789 display 

The ST7789S controller has a resolution of 240x320 pixels.
This controller supports various color palettes.
This project uses the 16 bits per pixel RGB 5-6-5 color palette (5 bits R, 6 bits G, 6 bits G).
Per the EmWin user guide Section 15.6 “Fixed Palette Modes”, this color palette is named

< GUICC_M565. >

1. EmWin Graphics Library:
2. Application Code:


  GUIDRV_FlexColor_Config 함수는 디스플레이 드라이버를 설정합니다.  ST7789S 컨트롤러의 해상도는 240x320입니다. 그러나 TFT 실드에 사용되는 디스플레이의 해상도는 320x240입니다. 이러한 X 및 Y 해상도의 교환으로 인해 방향이 X 및 Y 축을 교환하고 Y 축을 미러링하도록 설정됩니다.



The configuration structure is updated with the display orientation; the GUIDRV_FlexColor_Config function sets up the display driver.  The ST7789S controller has a resolution of 240x320.  However, the display used in the TFT shield has a resolution of 320x240. Because of this swapping of X and Y resolutions, the orientation is set to swap X and Y axes and mirror the Y axis.

CONFIG_FLEXCOLOR Config = {0};
Config.Orientation = GUI_MIRROR_Y | GUI_SWAP_XY;
GUIDRV_FlexColor_Config(pDevice, &Config);

 


   PortAPI 구조체는 GraphicLCDIntf 병렬 인터페이스를 통해 읽기 및 쓰기를 수행하는 API에 대한 포인터를 설정합니다.

GUIDRV_FlexColor_SetFunc 함수는 PortAPI, 특정 디스플레이 컨트롤러 및 인터페이스를 구성하기 위해 호출됩니다.


  The PortAPI structure sets the pointers to the APIs that perform read and write through the GraphicLCDIntf parallel interface. The GUIDRV_FlexColor_SetFunc function is called to configure the Port APIs, specific display controller,
and interface.
GUI_PORT_API PortAPI = {0};
PortAPI.pfWrite8_A0 = GraphicLCDIntf_1_Write8_A0;
PortAPI.pfWrite8_A1 = GraphicLCDIntf_1_Write8_A1;
PortAPI.pfWriteM8_A1 = GraphicLCDIntf_1_WriteM8_A1;
PortAPI.pfRead8_A1 = GraphicLCDIntf_1_Read8_A1;
PortAPI.pfReadM8_A1 = GraphicLCDIntf_1_ReadM8_A1;
GUIDRV_FlexColor_SetFunc(pDevice, &PortAPI, GUIDRV_FLEXCOLOR_F66709, GUIDRV_FLEXCOLOR_M16C0B8);
See Section 33.7.4 “GUIDRV_FlexColor” in the EmWin user guide for details.

 


  EmWin 라이브러리의 RAM 할당을 관리합니다. 정의된 GUI_NUMBYTES 매크로의 값은 응용 프로그램에서 사용하는 EmWin라이브러리 기능을 기반으로 한 대략적인 메모리 요구 사항에 따라 설정해야합니다(EmWin Lib. Datasheet참조). 
 - 다양한 기능의 메모리 사용에 대한 자세한 내용은 EmWin 사용 설명서의 37.2 절 "메모리 요구 사항"을 참조.  이 코드 예제에서는 메모리 크기가 임의로 0x1000 바이트로 설정되었습니다. 응용 프로그램에서 사용되는 기능에 따라 더 작은 값으로 설정할 수 있습니다.


There is manages the RAM allocation for the EmWin library. 
The value of the macro GUI_NUMBYTES macro must be set according to the approximate memory requirement based on EmWin library features used by the application. 
This will depend on the various options enabled in the GUIConf.h file. 
See Section 37.2, “Memory Requirements” in the EmWin user guide for details on the memory usage for various features. For this code example, the memory size has been set to an arbitrary 0x1000 bytes. You can set this to a smaller value based on the features used in your application.

#define GUI_NUMBYTES  0x8000

void GUI_X_Config(void) 
{
  //
  // 32 bit aligned memory area
  //
  static U32 aMemory[GUI_NUMBYTES / 4];
  //
  // Assign memory to emWin
  //
  GUI_ALLOC_AssignMemory(aMemory, GUI_NUMBYTES);
  //
  // Set default font
  //
  GUI_SetDefaultFont(GUI_FONT_6X8);
}

 

Pins Setting