Home |
RTTarget-32 Programming Manual Function RTInitCOMPort System Management BIOS (SMBIOS) Advanced Programmable Interrupt Controller (APIC) |
Function RTInitCOMPortRTInitCOMPort initializes a port and prepares it for communication: int RTInitCOMPort(int Port, int IOBase, int IRQ, int Baudrate, int Parity, int StopBits, int WordLength, int ReceiveBufferSize, int SendBufferSize, int Protocol); ParametersPortRT_COM1, RT_COM2, RT_COM3, or RT_COM4 (0 .. 3). IOBaseAny 16-bit integer. The array RTDefaultCOMIOBase can be used for 'standard' ports. IRQ0 .. 31. The array RTDefaultCOMIRQ can be used for 'standard' ports. Interrupt sharing is only supported for port pairs COM1/COM3 and COM2/COM4. For best performance, individual IRQs are recommended. Baudrate50 .. 115200. A baud rate input clock frequency of 1.8432 Mhz (the PCs default) is assumed. If a different value is used by the target, you must scale the baud rate accordingly. See RTLoc: Locating a Program, section COMPort Command for details. ParityValues PARITY_NONE, PARITY_ODD, PARITY_EVEN, PARITY_MARK, and PARITY_SPACE (all defined in Rttcom.h and windows.h) are supported. StopBitsValues 1 and 2 are supported. WordLengthValues 5, 6, 7 and 8 are supported. ReceiveBufferSizeAny size between 1 and 2G is supported. The buffer is allocated from the default Win32 process heap. SendBufferSizeAny size between 1 and 2G is supported. The buffer is allocated from the default Win32 process heap. ProtocolRT_NO_PROT, RT_XON_XOFF, RT_RTS_CTS, or RT_DTR_DSR. return value0 on failure and a value > 0 on success. Parameters IOBase, IRQ, ReceiveBufferSize, and SendBufferSize are evaluated only the first time InitCOMPort is called for a particular port. Subsequent calls can only be used to change the UART initialization. If InitCOMPort detects a 16550 UART, its FIFO is automatically enabled at trigger level 8.
|