User`s manual
RX62N Group, RX621 Group 4. Library Reference
1) R_IO_PORT_Set
Synopsis
Configure an I/O port.
Prototype
bool R_IO_PORT_Set(
uint16_t data1,
// Port pin selection
uint8_t data2
// Configuration
);
Description
Set the operating conditions for I/O port pins.
[data1]
Select the port pins to be configured (from §4.2.3). Do not use any whole-port definitions.
Multiple pins on the same port may be specified, using "|" to separate each pin.
[data2]
Choose the pin settings. Use "|" to separate each selection.
If no selection is made, the control setting will be left unchanged.
•
Direction control
PDL_IO_PORT_INPUT or
PDL_IO_PORT_OUTPUT
Input or output.
•
Input buffer control
PDL_IO_PORT_INPUT_BUFFER_ON or
PDL_IO_PORT_INPUT_BUFFER_OFF
On or off.
•
Input pull-up resistor control
PDL_IO_PORT_PULL_UP_ON or
PDL_IO_PORT_PULL_UP_OFF
On or off. Valid for ports 9 to E and G.
•
Output type control
PDL_IO_PORT_OPEN_DRAIN or
PDL_IO_PORT_CMOS
NMOS open-drain or CMOS push-pull output.
Valid for ports 0 to 3 and C.
Return value
True if all parameters are valid and exclusive; otherwise false.
Category
I/O port
References
None.
Remarks
•
Ensure that the specified functions are valid for the selected port pin.
•
The data direction and input buffer registers may be modified by other driver Create functions.
Take care to not overwrite existing settings.
Program example
/* RPDL definitions */
#include "r_pdl_io_port.h"
/* RPDL device-specific definitions */
#include "r_pdl_definitions.h"
void func(void)
{
/* Set up port P93 as an input port with the pull-resistor on */
R_IO_PORT_Set(
PDL_IO_PORT_9_3,
PDL_IO_PORT_INPUT | PDL_IO_PORT_INPUT_BUFFER_ON | \
PDL_IO_PORT_PULL_UP_ON
);
}
R20UT0084EE0112 Rev.1.12 Page 4-29
July. 16, 2014