User`s manual

RX62N Group, RX621 Group 4. Library Reference
4) R_SPI_Transfer
Synopsis
Transfer data over an SPI channel.
Prototype
bool R_SPI_Transfer(
uint8_t data1,
// Channel selection
uint8_t data2,
// DMAC / DTC control
uint32_t * data3,
// Transmit data start address
uint32_t * data4,
// Receive data start address
uint16_t data5,
// Sequence loop count
void * func,
// Callback function
uint8_t data6
// Interrupt priority level
);
Description
In Master mode, transfer the data to and/or from the Slave device.
In Slave mode, transfer the data under control of the Master device.
[data1]
Select channel SPIn (where n = 0 to 1).
[data2]
Select the automatic data transfer options.
The default setting is shown in bold. Specify PDL_NO_DATA to use the default.
DMAC / DTC trigger control
PDL_SPI_DMAC_DTC_TRIGGER_DISABLE or
PDL_SPI_DMAC_TRIGGER_ENABLE or
PDL_SPI_DTC_TRIGGER_ENABLE
Disable or enable activation of the DMAC
or DTC for data transmission and
reception.
[data3]
The start address of the data to be transmitted. The data must be stored as 32-bit values.
Specify PDL_NO_PTR if no data is to be transmitted (or if the data content is not important), or if the
DMAC or DTC shall be used to handle the data transfer.
[data4]
The start address of the data to be received. The data will be stored as 32-bit values.
Specify PDL_NO_PTR if no data is to be received, or if the DMAC or DTC shall be used to handle
the data transfer.
[data5]
The number of times that the command sequence will be executed.
If the DMAC or DTC shall be used to handle the transfer, specify PDL_NO_DATA.
[func]
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 handle the data transfer until completion
or an error occurs.
Interrupts
The function to be called when the transfer has completed or an error has
occurred.
DMAC or DTC
The function to be called if an error has occurred or when the DMAC or DTC
passes on the transfer interrupt.
If PDL_NO_FUNC is specified, this function will exit without checking the
transfer result. Use R_DMAC_GetStatus or R_DTC_GetStatus to monitor
the transfer status, R_SPI_GetStatus to check for errors and R_SPI_Control
to stop the SPI transfer.
[data6]
The interrupt priority level. Select between 1 (lowest priority) and 15 (highest priority).
This parameter will be ignored if PDL_NO_FUNC is specified for parameter func.
Return value
True if all parameters are valid; otherwise false.
R20UT0084EE0112 Rev.1.12 Page 4-210
July. 16, 2014