Rev.1.01 2007.02.16
RJJ10J1643-0101
24
__BasicSetSerialFormat
Synopsis
<Set serial communication>
Boolean __BasicSetSerialFormat(unsigned long data1, unsigned char data2)
data1
Setup data 1
data2
Setup data 2
Description
Sets serial communication according to specified parameters.
[data1]
For data1, the following values can be set. To set multiple definition values at the same
time, use the symbol “|” to separate each specified value.
(M16C)
RAPI_COM1 UART0
RAPI_COM2 UART1
RAPI_COM3 UART2
RAPI_COM4 SI/O3
RAPI_COM5 SI/O4
For serial communication mode, the following values can be set.
(M16C) (UART0, UART1, UART2)
RAPI_SM_SYNC
Clock synchronous serial communication mode
RAPI_SM_ASYNC
Clock asynchronous serial communication mode
(M16C)(SI/O3, SI/O4)
RAPI_SIO_SM_SYNC
Clock synchronous serial communication mode
For the data length format of clock asynchronous serial communication, the following
values can be set.
If the API is used in clock synchronous serial communication mode, do not set these
values.
(M16C) (UART0, UART1, UART2)
RAPI_BIT_7
Transfer data length 7 bits
RAPI_BIT_8
Transfer data length 8 bits
RAPI_BIT_9
Transfer data length 9 bits
For the clock source of serial communication, the following values can be set.
(M16C) (UART0, UART1, UART2)
RAPI_CKDIR_INT
Internal clock is used as the clock source of serial communication.
RAPI_CKDIR_EXT
External clock is used as the clock source of serial communication.
(M16C) (SI/O3, SI/O4)
RAPI_SIO_CKDIR_INT
Internal clock is used as the clock source of serial communication.
RAPI_SIO_CKDIR_EXT
External clock is used as the clock source of serial communication.
For the stop bit length of clock asynchronous serial communication, the following
values can be set.
If the API is used in clock synchronous serial communication mode, do not set these
values.
(M16C) (UART0, UART1, UART2)
RAPI_STPB_1
1 stop bit
RAPI_STPB_2
2 stop bits
For the parity bit of clock asynchronous serial communication, the following values can
be set.