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

4.104.114.84.95
Last change on this file since f4392b88 was f4392b88, checked in by Ralf Corsepius <ralf.corsepius@…>, on 04/25/07 at 12:50:25

2007-04-25 Ray Xu <xr@…>

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