mikroC

mikroC - C Compiler for Microchip PIC microcontrollers

making it simple...

Usart_Data_Ready

Prototype

char Usart_Data_Ready(void);

 

 

Returns

Function returns 1 if data is ready or 0 if there is no data.

 

 

Description

Use the function to test if data is ready for transmission.

 

 

Requires

USART HW module must be initialized and communication established before using

 

this function. See Usart_Init.

 

 

Example

int receive;

 

...

 

// If data is ready, read it:

 

if (Usart_Data_Ready()) receive = Usart_Read;

 

 

Usart_Read

Prototype

char Usart_Read(void);

 

 

Returns

Returns the received byte. If byte is not received, returns 0.

 

 

Description

Function receives a byte via USART. Use the function Usart_Data_Ready to test if

 

data is ready first.

 

 

Requires

USART HW module must be initialized and communication established before using

 

this function. See Usart_Init.

 

 

Example

int receive;

 

...

 

// If data is ready, read it:

 

if (Usart_Data_Ready()) receive = Usart_Read;

 

 

page

 

272

MikroElektronika: Development tools - Books - Compilers