Renesas RJJ10J1643-0101 User Manual
Page 53

Rev.1.01 2007.02.16
RJJ10J1643-0101
51
__PollingSerialReceiving
Synopsis
reception> unsigned int __PollingSerialReceiving(unsigned long data) data Setup data Description Performs reception of serial communication by polling. This API gets received data by [data] For data, the following values can be set. (M16C) RAPI_COM1 UART0 RAPI_COM2 UART1 RAPI_COM3 UART2 RAPI_COM4 SI/O3 RAPI_COM5 SI/O4 (R8C) RAPI_COM1 UART0 RAPI_COM2 UART1 (H8/300H) RAPI_COM1 SCI3 channel 1 RAPI_COM2 SCI3 channel 2 RAPI_COM3 SCI3 channel 3 Return value Out of the receive data counts requested, the number of unreceived data is returned. Functionality Serial I/O Reference __ConfigSerialDriverNotify , __SetSerialInterrupt , __StartSerialReceiving Remark • The specifiable serial ports differ with each CPU used. • If an undefined value is specified in the argument, operation of the API cannot be guaranteed. Program example #include ”rapi_sif_r8c_13.h” unsigned int buffer[10], count;
an amount specified by __StartSerialReceiving. When acquisition of received data is
complete, it calls a notification function (if a notification function is registered).
void func( void )
{
………………
/* Reception interrupt disable */
__SetSerialInterrupt( RAPI_COM1 | RAPI_INT_TX_DIS | RAPI_INT_RX_DIS );
/* Start reception */
__StartSerialReceiving( RAPI_COM1, 5, buffer );
do{
count = __PollingSerialReceiving( RAPI_COM1 );
}while(count)
………………
}