DRAFT
DRAFT DRAFT DR
DRAFT DRAFT DRAFT
D
RAF
DRAFT DRAFT DRA
FT D
RAFT DR
AFT D
DRA
FT DRAFT DRAFT
D
RAFT
DRAFT
D
RAFT
DRA
UM10601
All information provided in this document is subject to legal disclaimers.
© NXP B.V. 2012. All rights reserved.
Preliminary user manual
Rev. 1.0 — 7 November 2012
285 of 313
NXP Semiconductors
UM10601
Chapter 24: LPC800 USART API ROM driver routines
24.4 API description
The UART API contains functions to send and receive characters via any of the USART
blocks.
The following structure has to be defined to use the UART API:
typedef struct UARTD_API { // index of all the uart driver functions
uint32_t (*uart_get_mem_size)(void);
UART_HANDLE_T (*uart_setup)(uint32_t base_addr, uint8_t *ram);
uint32_t (*uart_init)(UART_HANDLE_T handle, UART_CONFIG_T *set);
//--polling functions--//
uint8_t (*uart_get_char)(UART_HANDLE_T handle);
void (*uart_put_char)(UART_HANDLE_T handle, uint8_t data);
uint32_t (*uart_get_line)(UART_HANDLE_T handle, UART_PARAM_T * param);
uint32_t (*uart_put_line)(UART_HANDLE_T handle, UART_PARAM_T * param);
//--interrupt functions--//
void (*uart_isr)(UART_HANDLE_T handle);
} UARTD_API_T ; // end of structure
24.4.1 UART get memory size
Table 271. UART API calls
API call
Description
Reference
uint32_t ramsize_in_bytes uart_get_mem_size( void) ;
UART get memory size
UART_HANDLE_T* uart_setup(uint32_t base_addr, uint8_t *ram) ;
UART set-up
uint32_t uart_init(UART_HANDLE_T* handle, UART_CONFIG set);
UART init
uint8_t uart_get_char(UART_HANDLE_T* handle);
UART get character
void uart_put_char(UART_HANDLE_T* handle, uint8_t data);
UART put character
uint32_t uart_get_line(UART_HANDLE_T* handle, UART_PARAM_T
param);
UART get line
uint32_t uart_put_line(UART_HANDLE_T* handle, UART_PARAM_T
param);
UART put line
void uart_isr(UART_HANDLE_T* handle);
UART interrupt service routine
Table 272. uart_get_mem_size
Routine
uart_get_mem_size
Prototype
uint32_t ramsize_in_bytes uart_get_mem_size( void) ;
Input parameter
None.
Return
Memory size in bytes.
Description
Get the memory size needed by one Min UART instance.