LCD mini click
LCD mini click displays 2x16 monochrome characters on an LMB162XFW LCD display. It features the MCP23S17 port expander and the MCP4161 digital potentiometer, both from Microchip.
click Product page
Click library
- Author : Stefan Ilic
- Date : Dec 2021.
- Type : SPI type
Software Support
We provide a library for the LCD mini 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 LCD mini Click driver.
Standard key functions :
lcdmini_cfg_setup
Config Object Initialization function.
void lcdmini_cfg_setup(lcdmini_cfg_t *cfg)
LCD mini configuration object setup function.
LCD mini Click configuration object.
Definition lcdmini.h:201
lcdmini_init
Initialization function.
err_t lcdmini_init(lcdmini_t *ctx, lcdmini_cfg_t *cfg)
LCD mini initialization function.
LCD mini Click context object.
Definition lcdmini.h:178
lcdmini_default_cfg
Click Default Configuration function.
err_t lcdmini_default_cfg(lcdmini_t *ctx)
LCD mini default configuration function.
Example key functions :
lcdmini_set_backlight
Set backlight function.
void lcdmini_set_backlight(lcdmini_t *ctx, float backlight_value)
Set backlight function.
lcdmini_set_contrast
Set contrast function.
void lcdmini_set_contrast(lcdmini_t *ctx, uint8_t contrast_value)
Set contrast function.
lcdmini_display_text
LCD mini display text.
void lcdmini_display_text(lcdmini_t *ctx, uint8_t row, uint8_t column, char *data_in)
LCD mini display text.
Example Description
This is an example that demonstrates the use of the LCD mini Click board.
The demo application is composed of two sections :
Application Init
Initialization driver enables - SPI, performing hardware reset, default config, setting up the backlight, and entering text to be written.
{
log_cfg_t log_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
if ( SPI_MASTER_ERROR ==
lcdmini_init( &lcdmini, &lcdmini_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
log_printf( &logger, "---------------------\r\n" );
log_printf( &logger, " SPI LCD Config \r\n" );
log_printf( &logger, " Clear LCD display \r\n" );
log_printf( &logger, " Cursor OFF \r\n" );
{
log_error( &logger, " Default configuration." );
for ( ; ; );
}
log_printf( &logger, "---------------------\r\n" );
log_printf( &logger, " Setting Backlight \r\n" );
Delay_ms ( 100 );
log_printf( &logger, "---------------------\r\n" );
log_printf( &logger, " Set Contrast: 200 \r\n" );
Delay_ms ( 100 );
log_info( &logger, " Application Task " );
log_printf( &logger, "---------------------\r\n" );
log_printf( &logger, " Display text \r\n" );
log_printf( &logger, "---------------------\r\n" );
Delay_ms ( 500 );
}
#define LCDMINI_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition lcdmini.h:160
void lcdmini_hw_reset(lcdmini_t *ctx)
Hardware reset function.
@ LCDMINI_ERROR
Definition lcdmini.h:230
void application_init(void)
Definition main.c:31
Application Task
This example shows the written text, then the text is moved left, with changing between rows of the LCD screen.
{
Delay_ms ( 500 );
}
#define LCDMINI_SHIFT_LEFT
Definition lcdmini.h:117
void lcdmini_send_cmd(lcdmini_t *ctx, uint8_t command)
LCD mini send command.
void application_task(void)
Definition main.c:91
Note
If the screen isn't initialized you may need to restart the device.
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.LCDmini
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.