
Rev.1.00 May 22 2012
REJ09B0566
Library Reference
4.2.9 40BSerial Communication Interface R_SCI_GetStatus
6) R_SCI_GetStatus
Synopsis
Check the status of a SCI channel.
Prototype bool R_SCI_GetStatus(
uint8_t data1, // Channel selection
uint8_t * data2, // Status flags
uint8_t * data3, // Characters transmitted
uint8_t * data4
// Characters received
);
Description
Acquires status of SCI transmission / reception.
[data1]
Select channel SCIFn (where n = 0 to 7).
[data2]
The status flags shall be stored in the format:
b7 to b6 b5 b4 b3 – b0
-
0: Transmit idle
1: Transmission in progress
0: Receive idle
1: Reception in progress
-
[data3]
The storage locations for the number of characters that are have been transmitted in the current transmission.
Specify PDL_NA if this information is not required.
[data4]
The storage locations for the number of characters that are have been received in the current reception
process. Specify PDL_NA if this information is not required.
Return value
True if all parameters are valid and the operation completed; false if a parameter was out of range.
Category
SCI
Reference
R_SCI_Send, R_SCI_Receive
Remarks
None.
Program example
/* PDL definitions */
#include “r_pdl_sci.h”
/* PDL device-specific definitions */
#include “r_pdl_definitions.h”
uint8_t StatusValue;
uint32_t TxChars;
uint32_t RxChars;
void func(void)
{
/* Read the status of SCI channel 0 */
R_SCI_GetStatus(
0,
&StatusValue,
&TxChars,
&RxChars
);
}
Kommentare zu diesen Handbüchern