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-11-07
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: LIN
Downloaded: 3439 times
Not followed.
License: MIT license
The LIN Click is a Click boardâ„¢ that features the TLE7259-3GE, a LIN transceiver from Infineon Technologies, with integrated wake-up and protection features.
Do you want to subscribe in order to receive notifications regarding "LIN click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "LIN click" changes.
Do you want to report abuse regarding "LIN click".
Library Description
The library includes functions to write or read data from UART. You can set state of pins(PWM - WK, INT - INH, EN - CS) you want to change it.
Key functions:
void lin_writeByte(uint8_t writeData)
- Writes one byte via UARTuint8_t lin_readByte()
- Reads one byte via UARTuint8_t lin_dataReady()
- Checks if data is ready to be read via UARTExamples description
The application is composed of three sections :
void applicationTask()
{
uint8_t tmp;
char rec;
uint8_t rdyFlag;
uint8_t mode = _LIN_READ_MODE;
if( mode == _LIN_READ_MODE )
{
// RECEIVER - UART polling
rdyFlag = lin_dataReady();
if (_LIN_DATA_READY == rdyFlag)
{
rec = lin_readByte();
mikrobus_logWrite( &rec, _LOG_BYTE );
}
}
else if( mode == _LIN_WRITE_MODE )
{
// TRANSMITER - TX each 2 sec
for (tmp = 0; tmp < 11; tmp++)
{
lin_writeByte( MESSAGE_DATA[tmp] );
if(tmp < 6)
{
Delay_ms(100);
}
}
Delay_ms(2000);
}
}
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.