User`s manual
RX62N Group, RX621 Group 4. Library Reference
5) R_SCI_Receive
Synopsis
Receive data on a SCI channel.
Prototype
bool R_SCI_Receive(
uint8_t data1,
// Channel selection
uint16_t data2,
// Channel configuration (and Station ID of receiving device)
uint8_t * data3,
// Data start address
uint16_t data4,
// Receive threshold
void * func1,
// Callback function
void * func2
// Callback function
);
Description
Enable SCI reception and acquire any incoming data.
[data1]
Select channel SCIn (where n = 0 to 6, but not 4).
[data2]
Control options.
The default options are shown in bold. Specify PDL_NO_DATA to use the defaults.
•
DMAC / DTC trigger control
The default setting is shown in bold. May also specify PDL_NO_DATA to use the defaults.
PDL_SCI_DMAC_DTC_TRIGGER_DISABLE or
PDL_SCI_DMAC_TRIGGER_ENABLE or
PDL_SCI_DTC_TRIGGER_ENABLE
Disable or enable activation of the DMAC
or DTC when a data byte is received.
•
Continuous receive mode (valid only in asynchronous mode)
PDL_SCI_RX_CONTINUOUS_DISABLE or
PDL_SCI_RX_CONTINUOUS_ENABLE
Disable or enable continuous receive mode
when interrupt is used to receive.
•
ID reception control (valid only in Multi-processor mode).
PDL_SCI_MP_ID_CYCLE
Use the upper byte as the station ID.
The valid ID range is 0 to 255.
[data3]
The start address of the storage area for the expected data.
Specify PDL_NO_PTR if no data shall be processed by this function e.g. if the DMAC or DTC shall
be used to process the received data, or for ID cycle in Multi-processor mode.
[data4]
The number of bytes that must be received before the function completes or the callback function is
called.
Specify 0 for the ID cycle in Multi-processor mode.
If the DMAC or DTC shall be used to handle the received data, specify PDL_NO_DATA.
[func1]
Specify PDL_NO_FUNC or a callback function name, depending on the required transfer method.
Transfer method
Parameter
Polling
PDL_NO_FUNC. This function will continue until the required number of
bytes has been received.
Interrupts
The function to be called when the number of received bytes reaches the
threshold number.
DMAC
Either the function to be called when each byte is received, or
PDL_NO_FUNC if the callback function specified in R_DMAC_Create will be
used.
DTC
The function to be called at the interval specified in R_DTC_Create.
[func2]
The function to be called if a receive error occurs. Specify PDL_NO_FUNC to ignore errors.
Return value
True if all parameters are valid and the operation completed; false if a parameter was out of range.
R20UT0084EE0112 Rev.1.12 Page 4-177
July. 16, 2014