User`s manual

RX62N Group, RX621 Group 4. Library Reference
Category
SPI
Reference
R_SPI_Create, R_DMAC_GetStatus, R_DTC_GetStatus, R_SPI_GetStatus
Remarks
The amount of data for must match the total number of transfer frames (refer to parameter data3
in R_SPI_Create).
If a callback function is specified and DMAC / DTC control is not used, interrupts are used to
handle the data transfer.
Please see the notes on callback function usage in §6.
When using transmit only in slave mode, return of the function by using polling or trigger of
interrupt by using interrupt or DTC / DMAC does not ensure the end of transmission.
After using this function, use R_SPI_GetStatus to check for and clear any error flags.
Program example
/* RPDL definitions */
#include "r_pdl_spi.h"
/* RPDL device-specific definitions */
#include "r_pdl_definitions.h"
void func(void)
{
uint32_t transmit_data[8];
uint32_t receive_data[8];
/* Transmit and receive all enabled frames once */
R_SPI_Transfer(
0,
PDL_NO_DATA,
transmit_data,
receive_data,
1,
PDL_NO_FUNC,
0
);
}
R20UT0084EE0112 Rev.1.12 Page 4-211
July. 16, 2014