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]
Rating:
Author: MIKROE
Last Updated: 2020-07-21
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Port expander
Downloaded: 2200 times
Not followed.
License: MIT license
EXPAND 5 Click features a low-voltage 24-bit I2C and SMBus I/O expander. This 24-bit I/O expander is designed to provide general-purpose remote I/O expansion for most microcontroller families via the I2C serial interface.
Do you want to subscribe in order to receive notifications regarding "EXPAND 5 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "EXPAND 5 click" changes.
Do you want to report abuse regarding "EXPAND 5 click".
Library Description
The library covers necessary functions that enables the usage of the EXPAND 5 click board. User can configure polarity and direction of every pin and get or set state of each and every pin.
Key functions:
void expand5_set_all_dir( uint8_t bank0, uint8_t bank1, uint8_t bank2 );
- Function is used to set pins' direction ( I/O ) setting in all banks.void expand5_write_pin ( uint16_t pin, uint8_t pin_val );
- Function is used to set a single output pin's logic level.void expand5_write_all_banks ( uint8_t bank0, uint8_t bank1, uint8_t bank2 );
- Function is used to set logic levels in all banks.Examples description
The application is composed of three sections :
void application_task ( )
{
for ( pin_num = EXPAND5_P00; pin_num <= EXPAND5_P27; pin_num++ )
{
expand5_write_all_banks ( bank_low, bank_low, bank_low );
expand5_write_pin ( pin_num, EXPAND5_HIGH );
mikrobus_logWrite( "Pin ", _LOG_TEXT );
ByteToStr( pin_num, log_txt );
Ltrim( log_txt );
mikrobus_logWrite( log_txt, _LOG_TEXT );
mikrobus_logWrite( " is high!", _LOG_LINE );
Delay_ms( 100 );
expand5_write_all_banks ( bank_low, bank_low, bank_low );
}
mikrobus_logWrite( "-------------------", _LOG_LINE );
Delay_ms( 1000 );
}
Other mikroE Libraries used in the example:
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.
Library Description
The library covers necessary functions that enables the usage of the EXPAND 5 click board. User can configure polarity and direction of every pin and get or set state of each and every pin.
Key functions:
void expand5_set_all_dir( uint8_t bank0, uint8_t bank1, uint8_t bank2 );
- Function is used to set pins' direction ( I/O ) setting in all banks.void expand5_write_pin ( uint16_t pin, uint8_t pin_val );
- Function is used to set a single output pin's logic level.void expand5_write_all_banks ( uint8_t bank0, uint8_t bank1, uint8_t bank2 );
- Function is used to set logic levels in all banks.Examples description
The application is composed of three sections :
void application_task ( )
{
for ( pin_num = EXPAND5_P00; pin_num <= EXPAND5_P27; pin_num++ )
{
expand5_write_all_banks ( bank_low, bank_low, bank_low );
expand5_write_pin ( pin_num, EXPAND5_HIGH );
mikrobus_logWrite( "Pin ", _LOG_TEXT );
ByteToStr( pin_num, log_txt );
Ltrim( log_txt );
mikrobus_logWrite( log_txt, _LOG_TEXT );
mikrobus_logWrite( " is high!", _LOG_LINE );
Delay_ms( 100 );
expand5_write_all_banks ( bank_low, bank_low, bank_low );
}
mikrobus_logWrite( "-------------------", _LOG_LINE );
Delay_ms( 1000 );
}
Other mikroE Libraries used in the example:
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.