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-01-03
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Port expander
Downloaded: 3703 times
Not followed.
License: MIT license
The LLC SPI click is a very useful Click board which can be utilized as the level converter for logic signals. The topology of this logic level conversion (LLC) circuit is perfectly suited for SPI communication between devices with unmatched voltages of their logic signals.
Do you want to subscribe in order to receive notifications regarding "LLC SPI click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "LLC SPI click" changes.
Do you want to report abuse regarding "LLC SPI click".
Library Description
The library contains functions for writing data to SPI wires and reading data from SPI wires.
Key functions:
void spillc_setCS(uint8_t state)
- Function for set CS pin state.void spillc_write(uint8_t *pBuf, uint16_t nBytes)
- Function executes write sequence of n bytes.void spillc_read(uint8_t *pBuf, uint16_t nBytes)
- Function executes read sequence of n bytes.void spillc_transfer(uint8_t *pIn, uint8_t *pOut, uint16_t nBytes)
- Function should executes read/write sequence of n bytes.Examples description
The application is composed of the three sections :
Note - Connection between BarGraph and SPI-LLC is made through SPI interface. You can connect a BarGraph click and SPI-LLC click with the wires to make the connection between click boards. We use the BarGraph click to demonstrate the functions of the SPI-LLC click.
void applicationTask()
{
uint16_t convert;
uint8_t tmp[2];
uint8_t cnt;
// BarGraph display
for (cnt = 0; cnt <= 10; cnt++)
{
convert = (uint16_t)((1 << cnt) - 1);
tmp[1] = (convert & 0x00FF);
tmp[0] = (convert & 0xFF00) >> 8;
spillc_setCS(0);
spillc_write(&tmp[0], 2);
spillc_setCS(1);
Delay_ms( 1000 );
}
}
Other mikroE Libraries used in the example:
I2C
Additional notes and information
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.