ipsdisplay  2.1.0.0
Main Page

IPS Display click

PRVIH_PAR_RECENICA_SA_PRODUCT_PAGE_DA_ISPRATE_CELINU

[click Product page](CLICK_PRODUCT_PAGE_LINK)


Click library

  • Author : Stefan Filipovic
  • Date : Jan 2024.
  • Type : SPI type

Software Support

We provide a library for the IPS Display 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 Click driver.

Standard key functions :

Example key functions :

Example Description

This example demonstrates the use of the IPS Display 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;
ipsdisplay_cfg_t ipsdisplay_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
ipsdisplay_cfg_setup( &ipsdisplay_cfg );
IPSDISPLAY_MAP_MIKROBUS( ipsdisplay_cfg, MIKROBUS_1 );
if ( SPI_MASTER_ERROR == ipsdisplay_init( &ipsdisplay, &ipsdisplay_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
if ( IPSDISPLAY_ERROR == ipsdisplay_default_cfg ( &ipsdisplay ) )
{
log_error( &logger, " Default configuration." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
}

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 )
{
ipsdisplay_point_t start_pt, end_pt;
#if IPSDISPLAY_RESOURCES_INCLUDE_IMG
log_printf( &logger, " Drawing MIKROE logo example\r\n\n" );
ipsdisplay_draw_picture ( &ipsdisplay, IPSDISPLAY_ROTATION_HORIZONTAL_180, ipsdisplay_img_mikroe );
Delay_ms ( 3000 );
#endif
log_printf( &logger, " Writing text example\r\n\n" );
Delay_ms ( 1000 );
start_pt.x = 5;
start_pt.y = 70;
ipsdisplay_write_string ( &ipsdisplay, start_pt, " MIKROE ", IPSDISPLAY_COLOR_RED );
start_pt.y += 20;
ipsdisplay_write_string ( &ipsdisplay, start_pt, " IPS display click", IPSDISPLAY_COLOR_RED );
start_pt.y += 20;
ipsdisplay_write_string ( &ipsdisplay, start_pt, " 135x240px ", IPSDISPLAY_COLOR_RED );
start_pt.y += 20;
ipsdisplay_write_string ( &ipsdisplay, start_pt, "ST7789V controller", IPSDISPLAY_COLOR_RED );
start_pt.y += 20;
ipsdisplay_write_string ( &ipsdisplay, start_pt, " TEST EXAMPLE ", IPSDISPLAY_COLOR_RED );
Delay_ms ( 3000 );
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 );
ipsdisplay_draw_line ( &ipsdisplay, start_pt, end_pt, IPSDISPLAY_COLOR_BLUE );
Delay_ms ( 1000 );
ipsdisplay_draw_line ( &ipsdisplay, start_pt, end_pt, IPSDISPLAY_COLOR_BLUE );
Delay_ms ( 1000 );
start_pt.x = 35;
start_pt.y = 40;
end_pt.x = 100;
end_pt.y = 100;
ipsdisplay_draw_rectangle ( &ipsdisplay, start_pt, end_pt, IPSDISPLAY_COLOR_CYAN );
Delay_ms ( 1000 );
start_pt.y += 100;
end_pt.y += 100;
ipsdisplay_draw_rectangle ( &ipsdisplay, start_pt, end_pt, IPSDISPLAY_COLOR_CYAN );
Delay_ms ( 1000 );
start_pt.x = 67;
start_pt.y = 120;
ipsdisplay_draw_circle ( &ipsdisplay, start_pt, start_pt.x, IPSDISPLAY_COLOR_MAGENTA );
Delay_ms ( 2000 );
}

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.IPSDisplay

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.


ipsdisplay_draw_circle
err_t ipsdisplay_draw_circle(ipsdisplay_t *ctx, ipsdisplay_point_t center_pt, uint8_t radius, uint16_t color)
IPS Display draw circle function.
IPSDISPLAY_POS_HEIGHT_MIN
#define IPSDISPLAY_POS_HEIGHT_MIN
Definition: ipsdisplay.h:386
IPSDISPLAY_COLOR_BLACK
#define IPSDISPLAY_COLOR_BLACK
IPS Display RGB565 colors definition.
Definition: ipsdisplay.h:416
ipsdisplay_point_t
IPS Display Click point coordinates object.
Definition: ipsdisplay.h:516
IPSDISPLAY_COLOR_RED
#define IPSDISPLAY_COLOR_RED
Definition: ipsdisplay.h:418
ipsdisplay_cfg_t
IPS Display Click configuration object.
Definition: ipsdisplay.h:494
ipsdisplay_draw_rectangle
err_t ipsdisplay_draw_rectangle(ipsdisplay_t *ctx, ipsdisplay_point_t start_pt, ipsdisplay_point_t end_pt, uint16_t color)
IPS Display draw rectangle function.
ipsdisplay_t
IPS Display Click context object.
Definition: ipsdisplay.h:476
IPSDISPLAY_COLOR_LIME
#define IPSDISPLAY_COLOR_LIME
Definition: ipsdisplay.h:419
ipsdisplay_point_t::y
uint16_t y
Definition: ipsdisplay.h:518
application_task
void application_task(void)
Definition: main.c:67
ipsdisplay_draw_picture
err_t ipsdisplay_draw_picture(ipsdisplay_t *ctx, uint8_t rotation, const uint16_t *image)
IPS Display draw picture function.
IPSDISPLAY_COLOR_BLUE
#define IPSDISPLAY_COLOR_BLUE
Definition: ipsdisplay.h:420
ipsdisplay_init
err_t ipsdisplay_init(ipsdisplay_t *ctx, ipsdisplay_cfg_t *cfg)
IPS Display initialization function.
IPSDISPLAY_POS_WIDTH_MAX
#define IPSDISPLAY_POS_WIDTH_MAX
Definition: ipsdisplay.h:385
ipsdisplay_cfg_setup
void ipsdisplay_cfg_setup(ipsdisplay_cfg_t *cfg)
IPS Display configuration object setup function.
ipsdisplay_draw_line
err_t ipsdisplay_draw_line(ipsdisplay_t *ctx, ipsdisplay_point_t start_pt, ipsdisplay_point_t end_pt, uint16_t color)
IPS Display draw line function.
IPSDISPLAY_ERROR
@ IPSDISPLAY_ERROR
Definition: ipsdisplay.h:529
IPSDISPLAY_POS_WIDTH_MIN
#define IPSDISPLAY_POS_WIDTH_MIN
IPS Display position and coordinates setting.
Definition: ipsdisplay.h:384
ipsdisplay_default_cfg
err_t ipsdisplay_default_cfg(ipsdisplay_t *ctx)
IPS Display default configuration function.
IPSDISPLAY_COLOR_MAGENTA
#define IPSDISPLAY_COLOR_MAGENTA
Definition: ipsdisplay.h:423
ipsdisplay_point_t::x
uint16_t x
Definition: ipsdisplay.h:517
ipsdisplay_write_string
err_t ipsdisplay_write_string(ipsdisplay_t *ctx, ipsdisplay_point_t start_pt, uint8_t *data_in, uint16_t color)
IPS Display write string function.
IPSDISPLAY_ROTATION_HORIZONTAL_180
#define IPSDISPLAY_ROTATION_HORIZONTAL_180
Definition: ipsdisplay.h:410
ipsdisplay_fill_screen
err_t ipsdisplay_fill_screen(ipsdisplay_t *ctx, uint16_t color)
IPS Display fill screen function.
application_init
void application_init(void)
Definition: main.c:31
IPSDISPLAY_MAP_MIKROBUS
#define IPSDISPLAY_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition: ipsdisplay.h:460
IPSDISPLAY_POS_HEIGHT_MAX
#define IPSDISPLAY_POS_HEIGHT_MAX
Definition: ipsdisplay.h:387
IPSDISPLAY_COLOR_CYAN
#define IPSDISPLAY_COLOR_CYAN
Definition: ipsdisplay.h:422