TOP Contributors

  1. MIKROE (2653 codes)
  2. Alcides Ramos (352 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (136720 times)
  2. FAT32 Library (69928 times)
  3. Network Ethernet Library (55939 times)
  4. USB Device Library (46261 times)
  5. Network WiFi Library (41884 times)
  6. FT800 Library (41150 times)
  7. GSM click (28979 times)
  8. PID Library (26412 times)
  9. mikroSDK (26357 times)
  10. microSD click (25354 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
mikroSDK Library

Terminal 2 click

Rating:

0

Author: MIKROE

Last Updated: 2024-04-03

Package Version: 2.1.0.9

mikroSDK Library: 2.0.0.0

Category: Adapter

Downloaded: 67 times

Not followed.

License: MIT license  

Terminal 2 Click is an adapter Click board™ used as a mikroBUS™ socket expansion board. It provides an easy and elegant solution for adding the external connection capability to the Click board™, plugged on a mikroBUS™ socket. Featuring two 9-position 2.54mm pitch terminal blocks makes it an easy way to expand the development system's connectivity with the mikroBUS™ socket while keeping the bus free to use with any Click board™.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Terminal 2 click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Terminal 2 click" changes.

Do you want to report abuse regarding "Terminal 2 click".

  • Information
  • Comments (0)

mikroSDK Library Blog


Terminal 2 click

Terminal 2 Click is an adapter Click board™ used as a mikroBUS™ socket expansion board. It provides an easy and elegant solution for adding the external connection capability to the Click board™, plugged on a mikroBUS™ socket. Featuring two 9-position 2.54mm pitch terminal blocks makes it an easy way to expand the development system's connectivity with the mikroBUS™ socket while keeping the bus free to use with any Click board™.

terminal2_click.png

click Product page


Click library

  • Author : Stefan Filipovic
  • Date : Dec 2021.
  • Type : GPIO type

Software Support

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

Standard key functions :

  • terminal2_cfg_setup Config Object Initialization function.

    void terminal2_cfg_setup ( terminal2_cfg_t *cfg );
  • terminal2_init Initialization function.

    err_t terminal2_init ( terminal2_t *ctx, terminal2_cfg_t *cfg );

Example key functions :

  • terminal2_set_all_pins_high This function sets all terminal pins to high logic level.

    void terminal2_set_all_pins_high ( terminal2_t *ctx );
  • terminal2_set_all_pins_low This function sets all terminal pins to low logic level.

    void terminal2_set_all_pins_low ( terminal2_t *ctx );
  • terminal2_toggle_pin This function toggles the specified pin logic level.

    void terminal2_toggle_pin ( digital_out_t *pin );

Example Description

This example demonstates the use of Terminal 2 click board by toggling all its pins.

The demo application is composed of two sections :

Application Init

Initializes the driver and logger and sets all pins to low logic state.


void application_init ( void )
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    terminal2_cfg_t terminal2_cfg;  /**< Click config object. */

    /** 
     * Logger initialization.
     * Default baud rate: 115200
     * Default log level: LOG_LEVEL_DEBUG
     * @note If USB_UART_RX and USB_UART_TX 
     * are defined as HAL_PIN_NC, you will 
     * need to define them manually for log to work. 
     * See @b LOG_MAP_USB_UART macro definition for detailed explanation.
     */
    LOG_MAP_USB_UART( log_cfg );
    log_init( &logger, &log_cfg );
    log_info( &logger, " Application Init " );

    // Click initialization.
    terminal2_cfg_setup( &terminal2_cfg );
    TERMINAL2_MAP_MIKROBUS( terminal2_cfg, MIKROBUS_1 );
    if ( DIGITAL_OUT_UNSUPPORTED_PIN == terminal2_init( &terminal2, &terminal2_cfg ) ) 
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }
    terminal2_set_all_pins_low ( &terminal2 );

    log_info( &logger, " Application Task " );
}

Application Task

Toggles all pins from mikroBUS one by one in the span of 1 second between each pin toggle.

void application_task ( void )
{
    /**< Array of pins object addresses. */
    static digital_out_t *pin_addr[ 12 ] =
    {
        &terminal2.mosi,    // 0 MOSI
        &terminal2.miso,    // 1 MISO
        &terminal2.sck,     // 2 SCK
        &terminal2.cs,      // 3 CS
        &terminal2.rst,     // 4 RST
        &terminal2.an,      // 5 AN
        &terminal2.pwm,     // 6 PWM
        &terminal2.int_pin, // 7 INT
        &terminal2.tx_pin,  // 8 TX
        &terminal2.rx_pin,  // 9 RX
        &terminal2.scl,     // 10 SCL
        &terminal2.sda      // 11 SDA
    };
    static uint8_t pin_num = 0;
    log_printf( &logger, " Toggling pin: %u\r\n", ( uint16_t ) pin_num );
    terminal2_toggle_pin ( pin_addr[ pin_num ] );
    Delay_ms ( 1000 );
    terminal2_toggle_pin ( pin_addr[ pin_num ] );

    pin_num++;
    if ( 12 == pin_num )
    {
        pin_num = 0;
    }
}

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

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.


ALSO FROM THIS AUTHOR

Remote Weather Station with ClickCloud - GSM platform

0

What is the weather going to be like today? That’s the first question everyone asks in the morning. With this innovative project you can measure temperature and humidity in real time! You can even access this data remotely via the G2C 3G Click, a reliable connection to the Click Cloud platform, a cloud-based rapid prototyping environment.

[Learn More]

LR IoT click

0

LR IoT Click is a compact add-on board that contains a long-range LoRa transceiver. This board features Semtech Corporation’s LR1110, an ultra-low power platform integrating a LoRa® transceiver, multi-constellation GNSS, and passive WiFi AP MAC address scanner. Alongside its sub-GHz capabilities, the LR1110 also has a multi-band front-end capable of receiving 802.11b/g/n WiFi Access Point MAC addresses and GNSS (GPS, BeiDou, geostationary) satellite raw data befitting geo-positioning purposes. The acquired information is then transmitted using an LPWAN network to a geolocation server, which analyzes it and correlates the position with data from a geolocation database, enabling a unique balance between low power and performance.

[Learn More]

VU Meter click

0

VU Meter Click is a compact add-on board representing a volume unit meter that displays the intensity of an audio signal. This board features the LM3914, a monolithic integrated circuit that senses analog voltage levels and drives a 10-segment bar graph display from Texas Instruments. This Click board™ is manufactured with a sound detecting device (microphone), Op-Amp, and the LM3914, which gleams the bar graph display according to the sound’s quality. The LM3914 is an analog-controlled driver meaning it can control (turn ON or OFF) a display by an analog input voltage and eliminates the need for additional programming.

[Learn More]