User`s manual

RX62N Group, RX621 Group 4. Library Reference
Category
SCI
Reference
R_SCI_Create, R_SCI_Control, R_SCI_GetStatus
Remarks
The maximum number of characters to be received is 65535.
Wait until a transmission on the same channel is complete before calling this function.
If callback function func1 is specified, reception interrupts are used.
Please see the notes on callback function usage in §6.
If polling mode is used, the RXI flag will be used to manage the data reception.
If the SCI channel’s control registers are directly modified by the user, this function may lock up.
If no error callback function func2 is specified, the error flags are cleared automatically to allow
the reception process to complete.
Callback functions are executed by the interrupt processing function. This means that no other
interrupt can be processed until a callback function has completed.
In Multi-processor mode, R_SCI_Receive is to be called in a pair: the first one is to receive ID (ID
cycle); the second one is to receive data (Data cycle). For ID reception, it could be done by
reception interrupt (by specifying func1), or by internal polling operation (without specifying
func1). For Data reception, it will be the same as normal Asynchronous mode.
For a usage example of Multi-processor mode, please refer to section 5.12.4.
For the ID cycle, the DMAC / DTC trigger control will be ignored.
If synchronous reception and transmission are required, a transmission must be started at the
same time as reception. Please refer to the usage example in section 5.12.3.
If PDL_SCI_RX_CONTINUOUS_ENABLE is selected, reception will not be terminated once the
callback function is activated. Instead, new data arriving will be stored at the start of the buffer
and the callback function activated again as required.
Program example
/* PDL functions */
#include "r_pdl_sci.h"
/* RPDL device-specific definitions */
#include "r_pdl_definitions.h"
volatile uint8_t SCI1ReceiveBuffer[10];
/* SCI channel 1 receive data handler */
void SCI1RxFunc(void){}
/* SCI channel 1 error handler */
void SCI1ErrFunc(void){}
void func( void )
{
uint8_t temp;
/* Wait for 1 character to be received on channel 0 */
R_SCI_Receive(
0,
PDL_NO_DATA,
&temp,
1,
PDL_NO_FUNC,
PDL_NO_FUNC
);
/* Start the reception of 9 characters on channel 1 */
R_SCI_Receive(
1,
PDL_NO_DATA,
SCI1ReceiveBuffer,
9,
SCI1RxFunc,
SCI1ErrFunc
);
}
R20UT0084EE0112 Rev.1.12 Page 4-178
July. 16, 2014