source: rtems/c/src/lib/libbsp/arm/rtl22xx/console/lpc22xx_uart.h @ d81d057

4.104.114.84.95
Last change on this file since d81d057 was d81d057, checked in by Joel Sherrill <joel.sherrill@…>, on 05/09/07 at 18:08:35

2007-05-09 Joel Sherrill <joel.sherrill@…>

  • Makefile.am, console/lpc22xx_uart.h: Remove warnings, cleanup and do not build SPARC code accidentally referenced in Makefile.am.
  • Property mode set to 100644
File size: 3.5 KB
Line 
1/*
2 *  Definitions for LPC22xx/LPC21xx
3 *
4 *  $Id$
5 */
6
7#ifndef LPC22XX_UART_H
8#define LPC22XX_UART_H
9
10#define FIFODEEP    16
11
12#define BD115200    115200
13#define BD38400     38400
14#define BD9600      9600
15
16#define U0_PINSEL       (0x00000005)    /* PINSEL0 Value for UART0 */
17#define U0_PINMASK      (0x0000000F)    /* PINSEL0 Mask for UART0 */
18#define U1_PINSEL       (0x00050000)    /* PINSEL0 Value for UART1 */
19#define U1_PINMASK      (0x000F0000)    /* PINSEL0 Mask for UART1 */
20
21/* Uart line control register bit descriptions */
22#define LCR_WORDLENTH_BIT         0
23#define LCR_STOPBITSEL_BIT        2
24#define LCR_PARITYENBALE_BIT      3
25#define LCR_PARITYSEL_BIT         4
26#define LCR_BREAKCONTROL_BIT      6
27#define LCR_DLAB_BIT              7
28// Line Control Register bit definitions
29#define ULCR_CHAR_5         (0 << 0)    // 5-bit character length
30#define ULCR_CHAR_6         (1 << 0)    // 6-bit character length
31#define ULCR_CHAR_7         (2 << 0)    // 7-bit character length
32#define ULCR_CHAR_8         (3 << 0)    // 8-bit character length
33#define ULCR_STOP_0         (0 << 2)    // no stop bits
34#define ULCR_STOP_1         (1 << 2)    // 1 stop bit
35#define ULCR_PAR_NO         (0 << 3)    // No Parity
36#define ULCR_PAR_ODD        (1 << 3)    // Odd Parity
37#define ULCR_PAR_EVEN       (3 << 3)    // Even Parity
38#define ULCR_PAR_MARK       (5 << 3)    // MARK "1" Parity
39#define ULCR_PAR_SPACE      (7 << 3)    // SPACE "0" Paruty
40#define ULCR_BREAK_ENABLE   (1 << 6)    // Output BREAK line condition
41#define ULCR_DLAB_ENABLE    (1 << 7)    // Enable Divisor Latch Access
42// Modem Control Register bit definitions
43#define UMCR_DTR            (1 << 0)    // Data Terminal Ready
44#define UMCR_RTS            (1 << 1)    // Request To Send
45#define UMCR_LB             (1 << 4)    // Loopback
46
47// Line Status Register bit definitions
48#define ULSR_RDR            (1 << 0)    // Receive Data Ready
49#define ULSR_OE             (1 << 1)    // Overrun Error
50#define ULSR_PE             (1 << 2)    // Parity Error
51#define ULSR_FE             (1 << 3)    // Framing Error
52#define ULSR_BI             (1 << 4)    // Break Interrupt
53#define ULSR_THRE           (1 << 5)    // Transmit Holding Register Empty
54#define ULSR_TEMT           (1 << 6)    // Transmitter Empty
55#define ULSR_RXFE           (1 << 7)    // Error in Receive FIFO
56#define ULSR_ERR_MASK       0x1E
57
58// Modem Status Register bit definitions
59#define UMSR_DCTS           (1 << 0)    // Delta Clear To Send
60#define UMSR_DDSR           (1 << 1)    // Delta Data Set Ready
61#define UMSR_TERI           (1 << 2)    // Trailing Edge Ring Indicator
62#define UMSR_DDCD           (1 << 3)    // Delta Data Carrier Detect
63#define UMSR_CTS            (1 << 4)    // Clear To Send
64#define UMSR_DSR            (1 << 5)    // Data Set Ready
65#define UMSR_RI             (1 << 6)    // Ring Indicator
66#define UMSR_DCD            (1 << 7)    // Data Carrier Detect
67
68/* Uart Interrupt Identification */
69#define IIR_RSL                   0x3
70#define IIR_RDA                   0x2
71#define IIR_CTI                   0x6
72#define IIR_THRE                  0x1
73
74/* Uart Interrupt Enable Type*/
75#define IER_RBR                   0x1
76#define IER_THRE                  0x2
77#define IER_RLS                   0x4
78
79/* Uart Receiver Errors*/
80#define RC_FIFO_OVERRUN_ERR       0x1
81#define RC_OVERRUN_ERR            0x2
82#define RC_PARITY_ERR             0x4
83#define RC_FRAMING_ERR            0x8
84#define RC_BREAK_IND              0x10
85
86typedef enum {
87  UART0 = 0,
88  UART1
89} LPC_UartChanel_t;
90#endif
91
Note: See TracBrowser for help on using the repository browser.