User`s manual

RX62N Group, RX621 Group 4. Library Reference
6) R_SPI_GetStatus
Synopsis
Check the status of an SPI channel.
Prototype
bool R_SPI_GetStatus(
uint8_t data1,
// Channel selection
uint16_t * data2,
// Status flags
uint16_t * data3
// Sequence count
);
Description
Acquires the SPI channel status.
[data1]
Select channel SPIn (where n = 0 to 1).
[data2]
The status flags shall be stored in the format below.
Specify PDL_NO_PTR if this information is not required
b15
b14 b12
b11
b10 b8
0
Error command
0
Command pointer
b7
b6
b5
b4
b3
b2
b1
b0
Receive
buffer
0
Transmit
buffer
0
Parity error Mode fault Bus state Overrun error
0: Empty
1: Full
0: Full
1: Empty
0: No error
1: Detected
0: No fault
1: Detected
0: Idle
1: Active
0: No error
1: Detected
[data3]
The storage location for the number of sequence loops that have been completed in the current
transfer. Specify PDL_NO_PTR if this information is not required.
Return value
True if all parameters are valid; otherwise false.
Category
SPI
Reference
Remarks
If the status flags are read and an error or fault flag is set to 1, the flag will be cleared to 0 by this
function.
Program example
/* RPDL definitions */
#include "r_pdl_spi.h"
/* RPDL device-specific definitions */
#include "r_pdl_definitions.h"
void func(void)
{
uint16_t StatusValue;
/* Read the status of channel 0 */
R_SPI_GetStatus(
0,
&StatusValue,
PDL_NO_PTR
);
}
R20UT0084EE0112 Rev.1.12 Page 4-214
July. 16, 2014