User`s manual

RX62N Group, RX621 Group 5. Usage Examples
while (data_received == false);
data_received = false;
// Receive data (ID = 0x0A) by CPU ISR
R_SCI_Receive(
2,
PDL_NO_DATA,
receive_data,
10,
SCI1rx,
SCI1Er
);
while (data_received == false);
/* -------------------------------------------- */
/* Async MP mode, data Reception, by polling */
/* -------------------------------------------- */
id_received = false;
// Wait by polling, until receive matching Station ID (0x01)
id_received = R_SCI_Receive(
2,
0x0100 | PDL_SCI_MP_ID_CYCLE,
PDL_NO_PTR,
0,
PDL_NO_FUNC,
SCI1Er
);
if (id_received == true)
{
// Receive data (ID = 0x01) by polling
R_SCI_Receive(
2,
PDL_NO_DATA,
receive_data,
10,
PDL_NO_FUNC,
SCI1Er
);
}
}
void SCI1rx(void)
{
data_received = true;
}
void SCI1Er(void)
{
error_happen = true;
}
Figure 5-22: Example of SCI Reception code in Asynchronous Multi-Processor mode
R20UT0084EE0112 Rev.1.12 Page 5-42
July. 16, 2014