IPS Display 2 Click
IPS Display 2 Click is a compact add-on board that displays high-resolution graphics in embedded applications. This board features the ER-TFT1.54-2, a 1.54inch TFT LCD display from EastRising Technology, and uses the ST7789V2 controller for 262K color output. The display offers a 240x240 pixel resolution, operates through a 3-wire SPI interface, and includes additional control signals for precise display management. Its small form factor and high-resolution output make it suitable for various projects, including handheld devices, smart displays, and panels requiring clear visual output.
Click Product page
Click library
- Author : Stefan Filipovic
- Date : Jan 2024.
- Type : SPI type
Software Support
We provide a library for the IPS Display 2 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Library Description
This library contains API for IPS Display 2 Click driver.
Standard key functions :
ipsdisplay2_cfg_setup
Config Object Initialization function.
void ipsdisplay2_cfg_setup(ipsdisplay2_cfg_t *cfg)
IPS Display 2 configuration object setup function.
IPS Display 2 Click configuration object.
Definition ipsdisplay2.h:500
ipsdisplay2_init
Initialization function.
err_t ipsdisplay2_init(ipsdisplay2_t *ctx, ipsdisplay2_cfg_t *cfg)
IPS Display 2 initialization function.
IPS Display 2 Click context object.
Definition ipsdisplay2.h:481
ipsdisplay2_default_cfg
Click Default Configuration function.
err_t ipsdisplay2_default_cfg(ipsdisplay2_t *ctx)
IPS Display 2 default configuration function.
Example key functions :
ipsdisplay2_fill_screen
This function fills the screen with the selected color.
err_t ipsdisplay2_fill_screen(ipsdisplay2_t *ctx, uint16_t color)
IPS Display 2 fill screen function.
ipsdisplay2_write_string
This function writes a text string starting from the selected position in a 6x12 font size with a specified color.
err_t ipsdisplay2_write_string(ipsdisplay2_t *ctx, ipsdisplay2_point_t start_pt, uint8_t *data_in, uint16_t color)
IPS Display 2 write string function.
IPS Display 2 Click point coordinates object.
Definition ipsdisplay2.h:523
ipsdisplay2_draw_line
This function draws a line with a specified color.
err_t ipsdisplay2_draw_line(ipsdisplay2_t *ctx, ipsdisplay2_point_t start_pt, ipsdisplay2_point_t end_pt, uint16_t color)
IPS Display 2 draw line function.
Example Description
This example demonstrates the use of the IPS Display 2 Click board by showing a practical example of using the implemented functions.
The demo application is composed of two sections :
Application Init
Initializes the driver and performs the Click default configuration.
{
log_cfg_t log_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
{
log_error( &logger, " Default configuration." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
}
#define IPSDISPLAY2_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition ipsdisplay2.h:464
@ IPSDISPLAY2_ERROR
Definition ipsdisplay2.h:536
void application_init(void)
Definition main.c:31
Application Task
Showcases the text writing example as well as drawing pictures and objects, and filling the whole screen with a desired color. All data is logged on the USB UART where you can track the program flow.
{
#if IPSDISPLAY2_RESOURCES_INCLUDE_IMG
log_printf( &logger, " Drawing MIKROE logo example\r\n\n" );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
#endif
log_printf( &logger, " Writing text example\r\n\n" );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
log_printf( &logger, " RGB fill screen example\r\n\n" );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
log_printf( &logger, " Drawing objects example\r\n\n" );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
}
#define IPSDISPLAY2_COLOR_CYAN
Definition ipsdisplay2.h:426
#define IPSDISPLAY2_POS_WIDTH_MIN
IPS Display 2 position and coordinates setting.
Definition ipsdisplay2.h:388
#define IPSDISPLAY2_COLOR_LIME
Definition ipsdisplay2.h:423
#define IPSDISPLAY2_ROTATION_VERTICAL_0
IPS Display 2 rotation setting.
Definition ipsdisplay2.h:411
#define IPSDISPLAY2_COLOR_MAGENTA
Definition ipsdisplay2.h:427
#define IPSDISPLAY2_POS_WIDTH_MAX
Definition ipsdisplay2.h:389
#define IPSDISPLAY2_COLOR_RED
Definition ipsdisplay2.h:422
#define IPSDISPLAY2_POS_HEIGHT_MIN
Definition ipsdisplay2.h:390
#define IPSDISPLAY2_POS_HEIGHT_MAX
Definition ipsdisplay2.h:391
#define IPSDISPLAY2_COLOR_BLACK
IPS Display 2 RGB565 colors definition.
Definition ipsdisplay2.h:420
#define IPSDISPLAY2_COLOR_BLUE
Definition ipsdisplay2.h:424
err_t ipsdisplay2_draw_circle(ipsdisplay2_t *ctx, ipsdisplay2_point_t center_pt, uint8_t radius, uint16_t color)
IPS Display 2 draw circle function.
err_t ipsdisplay2_draw_picture(ipsdisplay2_t *ctx, uint8_t rotation, const uint16_t *image)
IPS Display 2 draw picture function.
err_t ipsdisplay2_draw_rectangle(ipsdisplay2_t *ctx, ipsdisplay2_point_t start_pt, ipsdisplay2_point_t end_pt, uint16_t color)
IPS Display 2 draw rectangle function.
void application_task(void)
Definition main.c:67
uint16_t x
Definition ipsdisplay2.h:524
uint16_t y
Definition ipsdisplay2.h:525
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Other Mikroe Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.IPSDisplay2
Additional notes and informations
Depending on the development board you are using, you may need USB UART Click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. UART terminal is available in all MikroElektronika compilers.