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: 2019-03-21
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Adapter
Downloaded: 3120 times
Not followed.
License: MIT license
Adapter Click is a breakout board which simplifies connection of add-on boards with IDC10 headers to mikroBUS socket.
Do you want to subscribe in order to receive notifications regarding "Adapter click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Adapter click" changes.
Do you want to report abuse regarding "Adapter click".
Library Description
The library initializes and defines both the I2C and SPI bus driver and offeres drivers that offer a choice for writing and reading one byte into registers. It also alows to user to set state on CS, PWM, TX and RX pins and to check the state of INT pin.
Key functions:
uint8_t adapter_readData( uint8_t regAddress );
- Function read the 8-bit data from the chosen register.Example Description
The application is composed of three sections:
// I2C example void applicationTask() { uint8_t rdValue; uint8_t logTxt[ 50 ]; rdValue = adapter_readData( 0xFD ); IntToStr( rdValue, logTxt ); Ltrim( logTxt ); mikrobus_logWrite( " Read data : ", _LOG_LINE ); mikrobus_logWrite( logTxt, _LOG_LINE ); mikrobus_logWrite( "-----------------", _LOG_LINE ); Delay_ms( 2000 ); } // SPI example void applicationTask() { adapter_turnPwmOn(); adapter_writeData( 0x00, 0x79 ); }
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