Renesas M16C/62P Group Computer Hardware User Manual


 
Rev.1.00 2007.11.1
REC10B0002-0100
80
__ReadIOPortRegister
Synopsis
<Read from I/O port register>
Boolean __ReadIOPortRegister(unsigned long data1, unsigned int *data2)
data1 Setup data 1
data2 Pointer to the variable in which the value read from I/O port register is stored.
Description
Gets the value of a specified I/O port from each relevant register.
[data1]
Specify an I/O port register from which data is read. The definition values
corresponding to each I/O port register are listed below.
RAPI_PORT_0 Port P0 register RAPI_PORT_1 Port P1 register
RAPI_PORT_2 Port P2 register RAPI_PORT_3 Port P3 register
RAPI_PORT_4 Port P4 register RAPI_PORT_5 Port P5 register
RAPI_PORT_6 Port P6 register RAPI_PORT_7 Port P7 register
RAPI_PORT_8 Port P8 register RAPI_PORT_9 Port P9 register
RAPI_PORT_10 Port P10 register RAPI_PORT_11 Port P11 register
RAPI_PORT_12 Port P12 register RAPI_PORT_13 Port P13 register
RAPI_PORT_14 Port P14 register
Return value
If the I/O port register specification is incorrect, RAPI_FALSE is returned; otherwise,
RAPI_TRUE is returned.
Functionality
I/O port
Reference
__SetIOPort, __ReadIOPort, __WriteIOPort, __SetIOPortRegister,
__WriteIOPortRegister
Remark
If an undefined value is specified in the first argument, operation of the API cannot
be guaranteed.
Program example
#include " rapi_io_port_m16c_62p.h"
void func( void )
{
unsigned int data;
/* Get the value of port P1 register */
__ReadIOPortRegister( RAPI_PORT_1, &data );
}