User`s manual

RX62N Group, RX621 Group 4. Library Reference
2) R_IO_PORT_ReadControl
Synopsis
Read an I/O port’s control registers.
Prototype
bool R_IO_PORT_ReadControl(
uint16_t data1,
// Port or port pin selection
uint8_t data2,
// Control register selection
uint8_t * data3
// Data storage location
);
Description
Read an I/O port pin control setting.
[data1]
Use either one of the following definition values (from §4.2.3).
One port definition or
One port pin definition.
[data2]
Select the register to be read.
PDL_IO_PORT_DIRECTION or
Data direction register.
PDL_IO_PORT_INPUT_BUFFER or
Input buffer control register.
PDL_IO_PORT_PULL_UP or
Pull-up control register. Valid for ports 9 to E and G.
PDL_IO_PORT_TYPE
Open-drain control register. Valid for ports 0 to 3 and C.
[data3]
The address to where the register value shall be stored.
The value will be between 0x00 and 0xFF for a port; 0 or 1 for a pin.
Return value
True if all parameters are valid and exclusive; otherwise false.
Category
I/O port
References
None.
Remarks
Ensure that the specified register is valid for the selected port pin.
Program example
/* RPDL definitions */
#include "r_pdl_io_port.h"
/* RPDL device-specific definitions */
#include "r_pdl_definitions.h"
void func(void)
{
uint8_t direction;
uint8_t output;
/* Read the direction register for port PC */
R_IO_PORT_ReadControl(
PDL_IO_PORT_C,
PDL_IO_PORT_DIRECTION,
&direction
);
/* Read the output type for pin P03 */
R_IO_PORT_ReadControl(
PDL_IO_PORT_0_3,
PDL_IO_PORT_TYPE,
&output
);
}
R20UT0084EE0112 Rev.1.12 Page 4-30
July. 16, 2014