This library provides functions for supporting a 2.4 inch TFT LCD driven by an ST7789V controller. This is the same display as used on the CY8CKIT-028-TFT shield.
Display: http://www.newhavendisplay.com/nhd24240320cfctxif-p-8176.html\n Display Controller: http://www.newhavendisplay.com/appnotes/datasheets/LCDs/ST7789V.pdf
Follow the steps bellow in order to create a simple emWin application and display some text on it.
- Create an empty application
- Add this library to the application
- Add emWin library to the application
- Enable EMWIN_NOSNTS emWin library option by adding it to the Makefile COMPONENTS list:
COMPONENTS+=EMWIN_NOSNTS
- place the following code in the main.c file:
#include "cy_pdl.h"
#include "cyhal.h"
#include "cybsp.h"
#include "GUI.h"
#include "mtb_st7789v.h"
#include "cy8ckit_028_tft_pins.h" /* This is part of the CY8CKIT-028-TFT shield library. */
/* The pins above are defined by the CY8CKIT-028-TFT library. If the display is being used on different hardware the mappings will be different. */
const mtb_st7789v_pins_t tft_pins =
{
.db08 = CY8CKIT_028_TFT_PIN_DISPLAY_DB8,
.db09 = CY8CKIT_028_TFT_PIN_DISPLAY_DB9,
.db10 = CY8CKIT_028_TFT_PIN_DISPLAY_DB10,
.db11 = CY8CKIT_028_TFT_PIN_DISPLAY_DB11,
.db12 = CY8CKIT_028_TFT_PIN_DISPLAY_DB12,
.db13 = CY8CKIT_028_TFT_PIN_DISPLAY_DB13,
.db14 = CY8CKIT_028_TFT_PIN_DISPLAY_DB14,
.db15 = CY8CKIT_028_TFT_PIN_DISPLAY_DB15,
.nrd = CY8CKIT_028_TFT_PIN_DISPLAY_NRD,
.nwr = CY8CKIT_028_TFT_PIN_DISPLAY_NWR,
.dc = CY8CKIT_028_TFT_PIN_DISPLAY_DC,
.rst = CY8CKIT_028_TFT_PIN_DISPLAY_RST
};
int main(void)
{
cy_rslt_t result;
/* Initialize the device and board peripherals */
result = cybsp_init();
CY_ASSERT(result == CY_RSLT_SUCCESS);
__enable_irq();
/* Initialize the display controller */
result = mtb_st7789v_init8(&tft_pins);
CY_ASSERT(result == CY_RSLT_SUCCESS);
GUI_Init();
GUI_DispString("Hello world!");
for(;;)
{
}
}
- Build the application and program the kit.
- API Reference Guide
- Cypress Semiconductor, an Infineon Technologies Company
- Cypress Semiconductor GitHub
- ModusToolbox
- PSoC 6 Code Examples using ModusToolbox IDE
- PSoC 6 Middleware
- PSoC 6 Resources - KBA223067
© Cypress Semiconductor Corporation, 2019-2020.