utl7segr  2.0.0.0
Main Page

UT-L 7-SEG R click

UT-L 7-SEG R click carries two SMD ultra thin LED 7-SEG displays and the MAX6969 constant-current LED driver from Maxim Integrated. The click is designed to run on either 3.3V or 5V power supply. It communicates with the target microcontroller over SPI interface.

click Product page


Click library

  • Author : Stefan Ilic
  • Date : Jun 2021.
  • Type : SPI type

Software Support

We provide a library for the UT-L7-SEGR 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 UT-L7-SEGR Click driver.

Standard key functions :

Example key functions :

  • utl7segr_generic_write This function writes a desired number of data bytes starting from the selected register by using SPI serial interface.
    err_t utl7segr_generic_write ( utl7segr_t *ctx, uint8_t *data_in );
  • utl7segr_display_state This function turns display on and off.
    void utl7segr_display_state ( utl7segr_t *ctx, uint8_t state );
  • utl7segr_display_number This function is used to show the number on the display.
    void utl7segr_display_number ( utl7segr_t *ctx, uint8_t number, uint8_t dot_pos );

Example Description

The demo application shows basic usage of the UT 7 SEG display.

The demo application is composed of two sections :

Application Init

Configuring clicks and log objects. Settings the click in the default configuration.

void application_init ( void ) {
log_cfg_t log_cfg;
utl7segr_cfg_t utl7segr_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, "---- Application Init ----" );
// Click initialization.
utl7segr_cfg_setup( &utl7segr_cfg );
UTL7SEGR_MAP_MIKROBUS( utl7segr_cfg, MIKROBUS_1 );
err_t init_flag = utl7segr_init( &utl7segr, &utl7segr_cfg );
if ( init_flag == SPI_MASTER_ERROR ) {
log_error( &logger, " Application Init Error. " );
log_info( &logger, " Please, run program again... " );
for ( ; ; );
}
utl7segr_default_cfg ( &utl7segr );
log_info( &logger, " Application Task " );
}

Application Task

Draws numbers from 0 to 99 on the screen.

void application_task ( void ) {
log_info( &logger, "---- Number counter ----" );
for ( uint8_t cnt = 0; cnt < 100; cnt++ ) {
Delay_ms ( 500 );
}
}

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.UT-L7-SEGR

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.


UTL7SEGR_MAP_MIKROBUS
#define UTL7SEGR_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition: utl7segr.h:96
utl7segr_default_cfg
void utl7segr_default_cfg(utl7segr_t *ctx)
UT-L 7-SEG R default configuration function.
utl7segr_t
UT-L 7-SEG R Click context object.
Definition: utl7segr.h:113
application_task
void application_task(void)
Definition: main.c:61
UTL7SEGR_DOT_LEFT
#define UTL7SEGR_DOT_LEFT
UT-L 7-SEG R description setting.
Definition: utl7segr.h:72
utl7segr_cfg_t
UT-L 7-SEG R Click configuration object.
Definition: utl7segr.h:131
utl7segr_generic_write
err_t utl7segr_generic_write(utl7segr_t *ctx, uint8_t *data_in)
UT-L 7-SEG R data writing function.
utl7segr_init
err_t utl7segr_init(utl7segr_t *ctx, utl7segr_cfg_t *cfg)
UT-L 7-SEG R initialization function.
application_init
void application_init(void)
Definition: main.c:28
utl7segr_display_number
err_t utl7segr_display_number(utl7segr_t *ctx, uint8_t number, uint8_t dot_pos)
UT-L 7-SEG R display number function.
utl7segr_cfg_setup
void utl7segr_cfg_setup(utl7segr_cfg_t *cfg)
UT-L 7-SEG R configuration object setup function.
utl7segr_display_state
void utl7segr_display_state(utl7segr_t *ctx, uint8_t state)
UT-L 7-SEG R display state function.