
UM10800
All information provided in this document is subject to legal disclaimers.
© NXP Semiconductors N.V. 2016. All rights reserved.
User manual
Rev. 1.2 — 5 October 2016
402 of 487
NXP Semiconductors
UM10800
Chapter 27: LPC82x ROM API USART driver routines
27.4.10 UART ROM driver variables
27.4.10.1 UART_CONFIG structure
typdef struct UART_CONFIG {
uint32_t sys_clk_in_hz; // main clock/UARTCLKDIV in Hz
uint32_t baudrate_in_hz; // Baudrate in hz
uint8_t config; //bit 1:0
// 00: 7 bits length, 01: 8 bits lenght, others: reserved
//bit3:2
// 00: No Parity, 01: reserved, 10: Even, 11: Odd
//bit4
// 0: 1 Stop bit, 1: 2 Stop bits
uint8_t sync_mod; //bit0: 0(Async mode), 1(Sync mode)
//bit1: 0(Un_RXD is sampled on the falling edge of SCLK)
// 1(Un_RXD is sampled on the rising edge of SCLK)
//bit2: 0(Start and stop bits are transmitted as in asynchronous
mode)
// 1(Start and stop bits are not transmitted)
//bit3: 0(the UART is a slave on Sync mode)
// 1(the UART is a master on Sync mode)
uint16_t error_en; //Bit0: OverrunEn, bit1: UnderrunEn, bit2: FrameErrEn,
// bit3: ParityErrEn, bit4: RxNoiseEn
}
27.4.10.2 UART_HANDLE_T
The handle to the instance of the UART driver. Each UART has one handle, so there can
be several handles for up to three UART blocks. This handle is created by Init API and
used by the transfer functions for the corresponding UART block.
typedef void *UART_HANDLE_T ; // define TYPE for uart handle pointer
27.4.10.3 UART_PARAM_T
typedef struct uart_A { // parms passed to uart driver function
uint8_t * buffer ; // The pointer of buffer.
// For uart_get_line function, buffer for receiving data.
// For uart_put_line function, buffer for transmitting data.
uint32_t size; // [IN] The size of buffer.
//[OUT] The number of bytes transmitted/received.
uint16_t transfer_mode ;
// 0x00: For uart_get_line function, transfer without
//
termination.
// For uart_put_line function, transfer without termination.
// 0x01: For uart_get_line function, stop transfer when
// <CR><LF> are received.
// For uart_put_line function, transfer is stopped after
// reaching \0. <CR><LF> characters are sent out after that.
// 0x02: For uart_get_line function, stop transfer when <LF>
// is received.
// For uart_put_line function, transfer is stopped after
// reaching \0. A <LF> character is sent out after that.