Datasheet

Soft_UART_Read
417
MIKROELEKTRONIKA - SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroC PRO for AVR
CHAPTER 6
Prototype
char Soft_UART_Read(char * error);
Returns Byte received via UART.
Description
The function receives a byte via software UART.
This is a blocking function call (waits for start bit). Programmer can unblock it by
calling Soft_UART_Break routine.
Parameters :
- error: Error flag. Error code is returned through this variable.
0 - no error
1 - stop bit error
255 - user abort, Soft_UART_Break called
Requires
Software UART must be initialized before using this function. See the
Soft_UART_Init routine.
Example
char data, error;
...
// wait until data is received
do
data = Soft_UART_Read(&error);
while (error);
// Now we can work with data:
if (data) {...}