User`s manual
RX62N Group, RX621 Group 4. Library Reference
7) R_IO_PORT_Modify
Synopsis
Modify the pin states on an I/O port.
Prototype
bool R_IO_PORT_Modify(
uint16_t data1,
// Output port or port pin selection
uint8_t data2,
// Logical operation
uint8_t data3
// Modification value
);
Description
Read the output state of an I/O port or I/O port pin, modify the result and write it back to the port.
[data1]
Use either one of the following definition values (from §4.2.3).
•
One port definition or
•
One port pin definition.
[data2]
•
The logical operation to be applied to the port or port pin.
PDL_IO_PORT_AND or
PDL_IO_PORT_OR or
PDL_IO_PORT_XOR
Select between AND (&), OR (|) or Exclusive-OR (^).
[data3]
The value to be used for the modification; 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
None.
Remarks
•
If an invalid port or pin is specified, the operation of the function cannot be guaranteed.
Program example
/* RPDL definitions */
#include "r_pdl_io_port.h"
/* RPDL device-specific definitions */
#include "r_pdl_definitions.h"
void func( void )
{
/* Invert port pin P05 */
R_IO_PORT_Modify(
PDL_IO_PORT_0_5,
PDL_IO_PORT_XOR,
1
);
/* And the value port 6 with 0x55 */
R_IO_PORT_Modify(
PDL_IO_PORT_6,
PDL_IO_PORT_AND,
0x55
);
}
R20UT0084EE0112 Rev.1.12 Page 4-36
July. 16, 2014