Mikroelektronika MIKROE-738 Datenbogen
mikroC PRO for PIC32
MikroElektronika
593
UARTx_Data_Ready
Prototype
unsigned UARTx_Data_Ready();
Description The function tests if data in receive buffer is ready for reading.
Parameters None.
Returns
Parameters None.
Returns
-
1
if data is ready for reading
-
0
if there is no data in the receive register
Requires
Routine requires at least one UART module.
Used UART module must be initialized before using this routine. See UARTx_Init and UARTx_Init_
Advanced routines.
Example
unsigned receive;
...
// read data if ready
if (UART1_Data_Ready())
receive = UART1_Read();
Notes
UART library routines require you to specify the module you want to use. To select the desired UART
module, simply change the letter
x in the routine prototype for a number from 1 to 6.
Number of UART modules per MCU differs from chip to chip. Please, read the appropriate datasheet
before utilizing this library.
UARTx_Tx_Idle
Prototype
char UARTx_Tx_Idle();
Description Use the function to test if the transmit shift register is empty or not.
Parameters None.
Returns
Parameters None.
Returns
-
1
if the data has been transmitted
-
0
otherwise
Requires
Routine requires at least one UART module.
Used UART module must be initialized before using this routine. See UARTx_Init and UARTx_Init_
Advanced routines.
Example
// If the previous data has been shifted out, send next data:
if (UART1_Tx_Idle() == 1) {
UART1_Write(_data);
}
Notes
UART library routines require you to specify the module you want to use. To select the desired UART
module, simply change the letter
x in the routine prototype for a number from 1 to 6.
Number of UART modules per MCU differs from chip to chip. Please, read the appropriate datasheet
before utilizing this library.