Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
display-tft-st7789v/README.md
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
80 lines (66 sloc)
2.8 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Display 2.4 Inch TFT LCD (ST7789V) | |
### Overview | |
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 | |
### Quick Start | |
Follow the steps bellow in order to create a simple emWin application and display some text on it. | |
1. Create an empty application | |
2. Add this library to the application | |
3. Add emWin library to the application | |
4. Enable EMWIN_NOSNTS emWin library option by adding it to the Makefile COMPONENTS list: | |
``` | |
COMPONENTS+=EMWIN_NOSNTS | |
``` | |
5. place the following code in the main.c file: | |
```cpp | |
#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(;;) | |
{ | |
} | |
} | |
``` | |
6. Build the application and program the kit. | |
### More information | |
* [API Reference Guide](https://cypresssemiconductorco.github.io/display-tft-st7789v/html/index.html) | |
* [Cypress Semiconductor, an Infineon Technologies Company](http://www.cypress.com) | |
* [Cypress Semiconductor GitHub](https://github.com/cypresssemiconductorco) | |
* [ModusToolbox](https://www.cypress.com/products/modustoolbox-software-environment) | |
* [PSoC 6 Code Examples using ModusToolbox IDE](https://github.com/cypresssemiconductorco/Code-Examples-for-ModusToolbox-Software) | |
* [PSoC 6 Middleware](https://github.com/cypresssemiconductorco/psoc6-middleware) | |
* [PSoC 6 Resources - KBA223067](https://community.cypress.com/docs/DOC-14644) | |
--- | |
© Cypress Semiconductor Corporation, 2019-2020. |