User`s manual

RX62N Group, RX621 Group 4. Library Reference
8) R_IO_PORT_Wait
Synopsis
Wait for a match on an I/O port.
Prototype
bool R_IO_PORT_Wait(
uint16_t data1,
// Output port or port pin selection
uint8_t data2
// Comparison value
);
Description
Loop until an I/O port or I/O port pin matches the comparison value.
[data1]
Use either one of the following definition values (from §4.2.3).
One port definition or
One port pin definition.
[data2]
The value to be compared with; Between 0x00 and 0xFF for a port, 0 or 1 for a pin.
Return value
True if the parameters are valid; otherwise false.
Category
I/O port
References
R_IO_PORT_Set
Remarks
If an invalid port or pin is specified, the operation of the function cannot be guaranteed.
This function waits for the I/O port or port pin value to match the comparison data. If the I/O
port’s control registers are directly modified by the user, this function may lock up.
The input buffer for the specified port or pin must be switched on (see R_IO_PORT_Set).
Program example
/* RPDL definitions */
#include "r_pdl_io_port.h"
/* RPDL device-specific definitions */
#include "r_pdl_definitions.h"
void func( void )
{
/* Wait until pin P05 reads as 0 */
R_IO_PORT_Wait(
PDL_IO_PORT_0_5,
0
);
/* Wait until port 6 reads as 0x55 */
R_IO_PORT_Wait(
PDL_IO_PORT_6,
0x55
);
}
R20UT0084EE0112 Rev.1.12 Page 4-37
July. 16, 2014