UARTConfigure
Description
UARTÀÇ ÀÛµ¿ ¸ðµå, Àü¼Û ¼Óµµ, Æи®Æ¼, ½ºÅé ºñÆ®, µ¥ÀÌÅÍ ºñÆ®µîÀ» ¼³Á¤ÇÑ´Ù. UART¼³Á¤µ¿¾È UARTÇϵå¿þ¾î¿Í µ¥ÀÌÅÍ ¼Û½Å ŸÀӾƿôÀÌ ¸ðµÎ ¸®¼ÂµÈ´Ù. ¶ÇÇÑ ÇöÀç ÁøÇàÁßÀÎ ¼Û¼ö½Å ¿ä±¸°¡ ¸ðµÎ Ãë¼ÒµÈ´Ù.
Á¤»óÀûÀÎ NRZ¿Í IrDAÀÛµ¿ ¸ðµå°¡ ¸ðµÎ Áö¿øµÈ´Ù. ÃÖÀú Àü¼Û ¼Óµµ´Â 300bpsÀ̸ç ÃÖ´ë Àü¼Û ¼Óµµ´Â 115200bps ÀÌ´Ù.
Syntax
S16 UARTConfigure(U8 mode, U16 baudRate, U8 parity, U8 stopBits, U8 charLen)
Parameters
mode | ÀÛµ¿ ¸ðµå Ç÷¡±× |
| UART_NORMAL_MODE | Normal NRZ mode |
| UART_IRDA_MODE | IrDA mode |
baudRate | Àü¼Û ¼Óµµ Ç÷¡±× |
| UART_300_BPS | 300 bit per second |
| UART_600_BPS | 600 bit per second |
| UART_1200_BPS | 1200 bit per second |
| UART_2400_BPS | 2400 bit per second |
| UART_4800_BPS | 4800 bit per second |
| UART_9600_BPS | 9600 bit per second |
| UART_14400_BPS | 14400 bit per second |
| UART_19200_BPS | 19200 bit per second |
| UART_28800_BPS | 28800 bit per second |
| UART_38400_BPS | 38400 bit per second |
| UART_57600_BPS | 57600 bit per second |
| UART_115200_BPS | 115200 bit per second |
parity | Æи®Æ¼ ºñÆ® Ç÷¡±× |
| NO_PARITY | Æи®Æ¼ ¼³Á¤ ¾ÈÇÔ |
| ODD_PARITY | Ȧ¼ö Æи®Æ¼ |
| EVEN_PARITY | ¦¼ö Æи®Æ¼ |
stopBits | Stop bits flag |
| ONE_STOP_BIT | 1 ½ºÅé ºñÆ® |
| TWO_STOP_BIT | 2 ½ºÅé ºñÆ® |
charLen | µ¥ÀÌÅÍ ºñÆ® Ç÷¡±× |
| SEVEN_BIT_CHAR | 7ºñÆ® ¸ðµå |
| EIGHT_BIT_CHAR | 8ºñÆ® ¸ðµå |
Returns
CVOS_OK | ¼º°ø |
CVOS_ERR_INVALID_ACCESS | À߸øµÈ UART |
CVOS_ERR_MODE | À߸øµÈ ÀÛµ¿ ¸ðµå |
CVOS_ERR_BAUD | À߸øµÈ Àü¼Û ¼Óµµ |
CVOS_ERR_PARITY | À߸øµÈ Æи®Æ¼ ºñÆ® |
CVOS_ERR_STOPBIT | À߸øµÈ ½ºÅé ºñÆ® |
CVOS_ERR_CHARLEN | À߸øµÈ µ¥ÀÌÅÍ ºñÆ® |
See Also
UARTTimeout,
UARTSend,
UARTReceive,
UARTInquire,
UARTReadData