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: 2018-02-14
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Optical
Downloaded: 5982 times
Not followed.
License: MIT license
IrDA 3 click is an intelligent IR transceiver device that can both send and receive UART commands via the IR interface.
Do you want to subscribe in order to receive notifications regarding "IrDA 3 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "IrDA 3 click" changes.
Do you want to report abuse regarding "IrDA 3 click".
Library description
The library contains functions that perform UART reading, writing and UART rx buffer checking.
Key functions:
void irda3_writeByte(uint8_t input); - Function writes (sends) one byte to the UART RX buffer
uint8_t irda3_readByte(); - Function reads (receives) one byte from the UART RX buffer
uint8_t irda3_byteReady(); - Function checks state of the RX buffer (new data is placed in)
void irda3_reset(); - Function resets the and sets back in normal operating mode
Example description
void applicationTask() { uint8_t tmp; uint8_t rdyFlag; // RECEIVER - UART polling #ifdef __RX__ rdyFlag = irda3_byteReady(); if (1 == rdyFlag) { tmp = irda3_readByte(); mikrobus_logWrite( &tmp, _LOG_BYTE ); } #endif // TRANSMITER - TX each 2 sec #ifdef __TX__ for (tmp = 0; tmp < 9; tmp++) { irda3_writeByte( MESSAGE_DATA[tmp] ); mikrobus_logWrite( "MESSAGE SENT", _LOG_LINE ); } Delay_ms(2000); #endif }
Additional notes and information
Depending on the development board you are using, you may need USB UART click, USB UART 2 clickor 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.