TOP Contributors

  1. MIKROE (2653 codes)
  2. Alcides Ramos (351 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 (136662 times)
  2. FAT32 Library (69898 times)
  3. Network Ethernet Library (55918 times)
  4. USB Device Library (46248 times)
  5. Network WiFi Library (41881 times)
  6. FT800 Library (41126 times)
  7. GSM click (28971 times)
  8. PID Library (26406 times)
  9. mikroSDK (26343 times)
  10. microSD click (25350 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

Expand 9 click

Rating:

0

Author: MIKROE

Last Updated: 2024-04-03

Package Version: 2.1.0.10

mikroSDK Library: 2.0.0.0

Category: Port expander

Downloaded: 63 times

Not followed.

License: MIT license  

Expand 9 Click is a compact add-on board that contains a multi-port I/O expander. This board features the SX1509QB, the world’s lowest voltage level shifting GPIO expander from Semtech Corporation. The SX1509QB comes in a 16-channel configuration and allows easy serial expansion of I/O through a standard I2C serial interface. It also has a built-in level shifting feature making it highly flexible in power supply systems where communication between incompatible I/O voltages is required, an integrated LED driver for enhanced lighting, and a keypad scanning engine to implement keypad applications up to 8x8 matrix.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Expand 9 click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Expand 9 click" changes.

Do you want to report abuse regarding "Expand 9 click".

  • Information
  • Comments (0)

mikroSDK Library Blog


Expand 9 click

Expand 9 Click is a compact add-on board that contains a multi-port I/O expander. This board features the SX1509QB, the world’s lowest voltage level shifting GPIO expander from Semtech Corporation. The SX1509QB comes in a 16-channel configuration and allows easy serial expansion of I/O through a standard I2C serial interface. It also has a built-in level shifting feature making it highly flexible in power supply systems where communication between incompatible I/O voltages is required, an integrated LED driver for enhanced lighting, and a keypad scanning engine to implement keypad applications up to 8x8 matrix.

expand_9_click.png

click Product page


Click library

  • Author : Nenad Filipovic
  • Date : Aug 2021.
  • Type : I2C type

Software Support

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

Standard key functions :

  • expand9_cfg_setup Config Object Initialization function.

    void expand9_cfg_setup ( expand9_cfg_t *cfg );
  • expand9_init Initialization function.

    err_t expand9_init ( expand9_t *ctx, expand9_cfg_t *cfg );
  • expand9_default_cfg Click Default Configuration function.

    err_t expand9_default_cfg ( expand9_t *ctx );

Example key functions :

  • expand9_set_ch_output_state Expand 9 set channel output state function.

    err_t expand9_set_ch_output_state ( expand9_t *ctx, uint8_t ch_pos, expand9_ch_state_value_t ch_state );
  • expand9_led_driver_config Expand 9 LED driver configuration function.

    err_t expand9_led_driver_config ( expand9_t *ctx, uint8_t ch_pos, uint8_t freq_div, uint8_t lin_log );
  • expand9_soft_reset Expand 9 software reset function.

    err_t expand9_soft_reset ( expand9_t *ctx );

Example Description

This is an example that demonstrates the use of the Expand 9 Click board™. The library initializes and defines the I2C bus drivers to write and read data from registers.

The demo application is composed of two sections :

Application Init

The initialization of I2C module, log UART, and additional pins. After driver initialization the app set default settings.


void application_init ( void ) 
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    expand9_cfg_t expand9_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.
    expand9_cfg_setup( &expand9_cfg );
    EXPAND9_MAP_MIKROBUS( expand9_cfg, MIKROBUS_1 );
    err_t init_flag = expand9_init( &expand9, &expand9_cfg );
    if ( I2C_MASTER_ERROR == init_flag ) 
    {
        log_error( &logger, " Application Init Error. " );
        log_info( &logger, " Please, run program again... " );

        for ( ; ; );
    }

    expand9_default_cfg ( &expand9 );
    log_info( &logger, " Application Task " );
    Delay_ms ( 100 );
}

Application Task

his is an example that demonstrates the use of the Expand 9 Click board™. This example shows the capabilities of the Expand 9 click by toggling each of 16 available channels. Results are being sent to the Usart Terminal where you can track their changes.


void application_task ( void ) 
{   
    expand9_soft_reset( &expand9 );
    Delay_ms ( 100 );

    for ( uint8_t cnt = 0; cnt < 16; cnt++ )
    {
        expand9_set_ch_output_state( &expand9, cnt, CH_OUTPUT_ON );
        Delay_ms ( 100 );
        expand9_set_ch_output_state( &expand9, cnt, CH_OUTPUT_OFF );
        Delay_ms ( 100 );
    }

    for ( uint8_t cnt = 15; cnt > 0; cnt-- )
    {
        expand9_set_ch_output_state( &expand9, cnt, CH_OUTPUT_ON );
        Delay_ms ( 100 );
        expand9_set_ch_output_state( &expand9, cnt, CH_OUTPUT_OFF );
        Delay_ms ( 100 );
    }

    expand9_soft_reset( &expand9 );
    Delay_ms ( 100 );

    for ( uint8_t cnt = 0; cnt < 16; cnt++ )
    {
        expand9_led_driver_config( &expand9, cnt, EXPAND9_FREQ_DIV_1, EXPAND9_LED_MODE_LINEAR );
        expand9_set_intensity( &expand9, cnt, 10 );
        Delay_ms ( 100 );
        expand9_led_driver_config( &expand9, cnt, EXPAND9_FREQ_DIV_1, EXPAND9_LED_MODE_LINEAR );
        expand9_set_intensity( &expand9, cnt, 200 );
        Delay_ms ( 100 );
    }

    for ( uint8_t cnt = 15; cnt > 0; cnt-- )
    {
        expand9_led_driver_config( &expand9, cnt, EXPAND9_FREQ_DIV_1, EXPAND9_LED_MODE_LINEAR );
        expand9_set_intensity( &expand9, cnt, 200 );
        Delay_ms ( 100 );
        expand9_led_driver_config( &expand9, cnt, EXPAND9_FREQ_DIV_1, EXPAND9_LED_MODE_LINEAR );
        expand9_set_intensity( &expand9, cnt, 10 );
        Delay_ms ( 100 );
    }
}

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

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

I2C Extend click

0

I2C Extend Click is a compact add-on board for applications that require extending the I2C communication bus over a long distance. This board features the LTC4331 - an I2C slave device extender over a rugged differential link, from Analog Devices.

[Learn More]

GSR click

5

GSR click can be used to measure the electrodermal activity (EDA) of the human body, also known as the galvanic skin response (GSR). EDA is actually the property of the human body that causes continuous variation in the electrical characteristics of the skin.

[Learn More]

NFC Tag 4 click

5

NFC Tag 4 Click is NFC RFID tag device, offering 16 Kbit of electrically erasable programmable memory (EEPROM). This Click Board offer two communication interfaces. The first one is an I2C serial link and can be operated from a DC power supply.

[Learn More]