ipsdisplay2 2.1.0.0
Loading...
Searching...
No Matches
Main Page

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 :

Example key functions :

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.

void application_init ( void )
{
log_cfg_t log_cfg;
ipsdisplay2_cfg_t ipsdisplay2_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
ipsdisplay2_cfg_setup( &ipsdisplay2_cfg );
IPSDISPLAY2_MAP_MIKROBUS( ipsdisplay2_cfg, MIKROBUS_1 );
if ( SPI_MASTER_ERROR == ipsdisplay2_init( &ipsdisplay2, &ipsdisplay2_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
if ( IPSDISPLAY2_ERROR == ipsdisplay2_default_cfg ( &ipsdisplay2 ) )
{
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.

void application_task ( void )
{
ipsdisplay2_point_t start_pt, end_pt;
#if IPSDISPLAY2_RESOURCES_INCLUDE_IMG
log_printf( &logger, " Drawing MIKROE logo example\r\n\n" );
ipsdisplay2_draw_picture ( &ipsdisplay2, IPSDISPLAY2_ROTATION_VERTICAL_0, ipsdisplay2_img_mikroe );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
#endif
log_printf( &logger, " Writing text example\r\n\n" );
Delay_ms ( 1000 );
start_pt.x = 60;
start_pt.y = 70;
ipsdisplay2_write_string ( &ipsdisplay2, start_pt, " MIKROE ", IPSDISPLAY2_COLOR_RED );
start_pt.y += 20;
ipsdisplay2_write_string ( &ipsdisplay2, start_pt, " IPS display Click", IPSDISPLAY2_COLOR_RED );
start_pt.y += 20;
ipsdisplay2_write_string ( &ipsdisplay2, start_pt, " 240x240px ", IPSDISPLAY2_COLOR_RED );
start_pt.y += 20;
ipsdisplay2_write_string ( &ipsdisplay2, start_pt, "ST7789V controller", IPSDISPLAY2_COLOR_RED );
start_pt.y += 20;
ipsdisplay2_write_string ( &ipsdisplay2, start_pt, " TEST EXAMPLE ", IPSDISPLAY2_COLOR_RED );
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 );
ipsdisplay2_draw_line ( &ipsdisplay2, start_pt, end_pt, IPSDISPLAY2_COLOR_BLUE );
Delay_ms ( 1000 );
ipsdisplay2_draw_line ( &ipsdisplay2, start_pt, end_pt, IPSDISPLAY2_COLOR_BLUE );
Delay_ms ( 1000 );
start_pt.x = 60;
start_pt.y = 40;
end_pt.x = 180;
end_pt.y = 100;
ipsdisplay2_draw_rectangle ( &ipsdisplay2, start_pt, end_pt, IPSDISPLAY2_COLOR_CYAN );
Delay_ms ( 1000 );
start_pt.y += 100;
end_pt.y += 100;
ipsdisplay2_draw_rectangle ( &ipsdisplay2, start_pt, end_pt, IPSDISPLAY2_COLOR_CYAN );
Delay_ms ( 1000 );
start_pt.x = 120;
start_pt.y = 120;
ipsdisplay2_draw_circle ( &ipsdisplay2, start_pt, start_pt.x, IPSDISPLAY2_COLOR_MAGENTA );
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.