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: 2021-05-19
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Port expander
Downloaded: 2196 times
Not followed.
License: MIT license
Expand 8 Click is a compact add-on board that contains a multi-port I/O expander with bi-directional input/outputs. This board features the MAX7317, 10-Port SPI-interfaced I/O expander with overvoltage and hot-insertion protection from Maxim Integrated. The MAX7317 provides microprocessors with 10 I/O ports rated to 7V. Each port can be individually configured as either an open-drain output or an overvoltage-protected Schmitt input that supports hot insertion. All port pins remain high impedance in Power-Down mode with up to 8V asserted on them.
Do you want to subscribe in order to receive notifications regarding "Expand 8 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Expand 8 click" changes.
Do you want to report abuse regarding "Expand 8 click".
Library Description
The library covers all the necessary functions to control Expand 8 click board.
The library performs a standard SPI interface communication.
Key functions:
void expand8_write_data ( uint8_t addr, uint8_t tx_data );
- Generic write data function.uint8_t expand8_read_data ( uint8_t addr );
- Generic read data function.EXPAND8_RETVAL_T expand8_set_port ( uint8_t sel_port, uint8_t sel_imped );
- Set port function.Examples description
The application is composed of three sections :
void application_task ( ) { expand8_set_port( select_port, EXPAND8_SET_LOW_IMPEDANCE ); mikrobus_logWrite( " Port P", _LOG_TEXT ); ByteToStr( select_port, demo_text ); Ltrim( demo_text ); mikrobus_logWrite( demo_text, _LOG_TEXT ); mikrobus_logWrite( " ON", _LOG_LINE ); mikrobus_logWrite( "- - - - - - - - - - -", _LOG_LINE ); Delay_ms( 1000 ); expand8_set_port( select_port, EXPAND8_SET_HIGH_IMPEDANCE ); mikrobus_logWrite( " Port P", _LOG_TEXT ); ByteToStr( select_port, demo_text ); Ltrim( demo_text ); mikrobus_logWrite( demo_text, _LOG_TEXT ); mikrobus_logWrite( " OFF", _LOG_LINE ); mikrobus_logWrite( "---------------------", _LOG_LINE ); Delay_ms( 1000 ); select_port++; if ( select_port > EXPAND8_ADDR_OUT_LVL_PORT_P9 ) { select_port = EXPAND8_ADDR_OUT_LVL_PORT_P0; } }
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.