lcdmono  2.0.0.0
Main Page

LCD Mono click

LCD Mono Click is a Click boardâ„¢ that uses the LS013B7DH03 LCD display from Sharp which combined with the EFM32, from Silicon Labs, and its energy saving capabilities creates a powerful display application.

click Product page


Click library

  • Author : MikroE Team
  • Date : Dec 2019.
  • Type : SPI type

Software Support

We provide a library for the LcdMono 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 form compilers IDE(recommended way), or downloaded from our LibStock, or found on mikroE github account.

Library Description

This library contains API for LcdMono Click driver.

Standard key functions :

  • Config Object Initialization function.

    void lcdmono_cfg_setup ( lcdmono_cfg_t *cfg );

  • Initialization function.

    LCDMONO_RETVAL lcdmono_init ( lcdmono_t *ctx, lcdmono_cfg_t *cfg );

Example key functions :

  • Draw text on the screen

    void lcdmono_draw_text ( lcdmono_t *ctx, char *text_buf, lcdmono_text_settings_t *cfg , uint8_t end_mode);

  • Display Power State

    void lcdmono_display_power ( lcdmono_t *ctx, uint8_t ctrl );

  • Reset procedure

    void lcdmono_display_reset ( lcdmono_t *ctx );

Examples Description

This application sets text on lcd displey.

The demo application is composed of two sections :

Application Init

Driver initialization - Starting LCD Mono display. Print text to the display by changing font size ...

void application_init ( void )
{
log_cfg_t log_cfg;
lcdmono_font_t font_cfg;
// Logger initialization.
log_cfg.level = LOG_LEVEL_DEBUG;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, "---- Application Init ----" );
// Click initialization.
LCDMONO_MAP_MIKROBUS( cfg, MIKROBUS_1 );
lcdmono_init( &lcdmono, &cfg );
lcdmono_display_reset( &lcdmono );
lcdmono_clear( &lcdmono );
// Background color for all text
// Display text
lcdmono_set_font( &lcdmono, &font_cfg );
tx_set.len = 3;
tx_set.start_cord_x = 25;
tx_set.start_cord_y = 15;
lcdmono_draw_text( &lcdmono, demo_text_lcd, &tx_set, LCDMONO_REFRESH_TEXT_BUFFER |
lcdmono_set_font( &lcdmono, &font_cfg );
tx_set.len = 4;
tx_set.start_cord_x = 60;
tx_set.start_cord_y = 50;
lcdmono_draw_text( &lcdmono, demo_text_mono, &tx_set, LCDMONO_CHECK_NEW_TEXT );
tx_set.len = 9;
tx_set.start_cord_x = 10;
tx_set.start_cord_y = 80;
lcdmono_draw_text( &lcdmono, demo_text_128x128px, &tx_set, LCDMONO_REFRESH_DISPLAY_END );
Delay_ms( 5000 );
lcdmono_clear( &lcdmono );
}

Application Task

Drawing an image to the display every 3 second.

void application_task ( void )
{
lcdmono_draw_const_frame( &lcdmono, demo_img_mikroe_light );
Delay_ms( 3000 );
lcdmono_draw_const_frame( &lcdmono, demo_img_mikroe );
Delay_ms( 3000 );
lcdmono_draw_const_frame( &lcdmono, demo_img_logo_light );
Delay_ms( 3000 );
lcdmono_draw_const_frame( &lcdmono, demo_img_logo );
Delay_ms( 3000 );
}

Note

  • Create Image: Save the image in resolution of 128x128 px with the extension (monochrome bmp) ... Upload the image to Image2Lcd program Set parameters to:
    1. Output file type : C array
    2. Scan Mode : Horisontal scan
    3. Bits Pixel : monochrome
    4. Max width and height : 128x128
    5. Check only MSB first
    6. Check Reverse color and adjust Normal type The image to be generated should contain about 2048 bytes ... Insert the image into the file Click_LCD_Mono_image.h
  • Create Font: Close existing project, open a new VTFT project Add label and adjust text font Generate source code Copy the font from resource.c file to this project in file Click_LCD_Mono_font.h

The full application code, and ready to use projects can be installed directly form compilers IDE(recommneded) or found on LibStock page or mikroE GitHub accaunt.

Other mikroE Libraries used in the example:

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.LcdMono

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. The terminal available in all Mikroelektronika compilers, or any other terminal application of your choice, can be used to read the message.


lcdmono_font_tahoma_8
const uint8_t lcdmono_font_tahoma_8[1679]
Definition: click_lcd_mono_font.h:209
LCDMONO_REFRESH_DISPLAY_END
#define LCDMONO_REFRESH_DISPLAY_END
Definition: lcdmono.h:92
lcdmono_font_tahoma_16
const uint8_t lcdmono_font_tahoma_16[4617]
Definition: click_lcd_mono_font.h:4
LCDMONO_REFRESH_TEXT_BUFFER
#define LCDMONO_REFRESH_TEXT_BUFFER
Definition: lcdmono.h:94
demo_img_mikroe_light
const uint8_t demo_img_mikroe_light[2048]
Definition: click_lcd_mono_image.h:400
lcdmono_text_settings_t::len
uint8_t len
Definition: lcdmono.h:140
lcdmono_text_settings_t
Definition: lcdmono.h:137
lcdmono_text_settings_t::start_cord_x
uint16_t start_cord_x
Definition: lcdmono.h:141
LCDMONO_COLOR_BLACK
#define LCDMONO_COLOR_BLACK
Definition: lcdmono.h:85
lcdmono_text_settings_t::bg_color
uint8_t bg_color
Definition: lcdmono.h:144
lcdmono_draw_text
void lcdmono_draw_text(lcdmono_t *ctx, char *__generic text_buf, lcdmono_text_settings_t *tx_set, uint8_t end_mode)
Draw text on the screen.
application_task
void application_task(void)
Definition: main.c:125
lcdmono_text_settings_t::text_color
uint8_t text_color
Definition: lcdmono.h:143
lcdmono_cfg_setup
void lcdmono_cfg_setup(lcdmono_cfg_t *cfg)
Config Object Initialization function.
lcdmono_cfg_t
Click configuration structure definition.
Definition: lcdmono.h:174
lcdmono_display_reset
void lcdmono_display_reset(lcdmono_t *ctx)
Reset procedure.
lcdmono_font_t::this_font
uint8_t *__generic this_font
Definition: lcdmono.h:123
LCDMONO_MAP_MIKROBUS
#define LCDMONO_MAP_MIKROBUS(cfg, mikrobus)
Definition: lcdmono.h:53
demo_img_logo
const uint8_t demo_img_logo[2048]
Definition: click_lcd_mono_image.h:4
demo_img_mikroe
const uint8_t demo_img_mikroe[2048]
Definition: click_lcd_mono_image.h:268
lcdmono_font_t
Definition: lcdmono.h:121
lcdmono_set_font
void lcdmono_set_font(lcdmono_t *ctx, lcdmono_font_t *dev_lcd_font)
Set font.
LCDMONO_COLOR_WHITE
#define LCDMONO_COLOR_WHITE
Definition: lcdmono.h:84
application_init
void application_init(void)
Definition: main.c:60
LCDMONO_CHECK_NEW_TEXT
#define LCDMONO_CHECK_NEW_TEXT
Definition: lcdmono.h:93
lcdmono_init
LCDMONO_RETVAL lcdmono_init(lcdmono_t *ctx, lcdmono_cfg_t *cfg)
Initialization function.
lcdmono_text_settings_t::start_cord_y
uint16_t start_cord_y
Definition: lcdmono.h:142
demo_img_logo_light
const uint8_t demo_img_logo_light[2048]
Definition: click_lcd_mono_image.h:136
lcdmono_clear
void lcdmono_clear(lcdmono_t *ctx)
Clear display.