1 | /* |
---|
2 | * Copyright (c) 2011 Sebastian Huber. All rights reserved. |
---|
3 | * |
---|
4 | * embedded brains GmbH |
---|
5 | * Obere Lagerstr. 30 |
---|
6 | * 82178 Puchheim |
---|
7 | * Germany |
---|
8 | * <rtems@embedded-brains.de> |
---|
9 | * |
---|
10 | * The license and distribution terms for this file may be |
---|
11 | * found in the file LICENSE in this distribution or at |
---|
12 | * http://www.rtems.com/license/LICENSE. |
---|
13 | */ |
---|
14 | |
---|
15 | #ifndef LIBBSP_ARM_LM3S69XX_UART_H |
---|
16 | #define LIBBSP_ARM_LM3S69XX_UART_H |
---|
17 | |
---|
18 | #include <libchip/serial.h> |
---|
19 | #include <bsp/utility.h> |
---|
20 | |
---|
21 | #ifdef __cplusplus |
---|
22 | extern "C" { |
---|
23 | #endif /* __cplusplus */ |
---|
24 | |
---|
25 | typedef struct { |
---|
26 | #define UARTDR_OE BSP_BIT32(11) |
---|
27 | #define UARTDR_BE BSP_BIT32(10) |
---|
28 | #define UARTDR_PE BSP_BIT32(9) |
---|
29 | #define UARTDR_FE BSP_BIT32(8) |
---|
30 | #define UARTDR_DATA(val) BSP_FLD32(val, 0, 7) |
---|
31 | uint32_t dr; |
---|
32 | |
---|
33 | uint32_t rsr_ecr; |
---|
34 | uint32_t reserved [4]; |
---|
35 | |
---|
36 | #define UARTFR_TXFE BSP_BIT32(7) |
---|
37 | #define UARTFR_RXFF BSP_BIT32(6) |
---|
38 | #define UARTFR_TXFF BSP_BIT32(5) |
---|
39 | #define UARTFR_RXFE BSP_BIT32(4) |
---|
40 | #define UARTFR_BUSY BSP_BIT32(3) |
---|
41 | uint32_t fr; |
---|
42 | uint32_t ilpr; |
---|
43 | uint32_t ibrd; |
---|
44 | uint32_t fbrd; |
---|
45 | |
---|
46 | #define UARTLCRH_SPS BSP_BIT32(7) |
---|
47 | #define UARTLCRH_WLEN(val) BSP_FLD32(val, 5, 6) |
---|
48 | #define UARTLCRH_FEN BSP_BIT32(4) |
---|
49 | #define UARTLCRH_STP2 BSP_BIT32(3) |
---|
50 | #define UARTLCRH_EPS BSP_BIT32(2) |
---|
51 | #define UARTLCRH_PEN BSP_BIT32(1) |
---|
52 | #define UARTLCRH_BRK BSP_BIT32(0) |
---|
53 | uint32_t lcrh; |
---|
54 | |
---|
55 | #define UARTCTL_RXE BSP_BIT32(9) |
---|
56 | #define UARTCTL_TXE BSP_BIT32(8) |
---|
57 | #define UARTCTL_LBE BSP_BIT32(7) |
---|
58 | #define UARTCTL_SIRLP BSP_BIT32(2) |
---|
59 | #define UARTCTL_SIREN BSP_BIT32(1) |
---|
60 | #define UARTCTL_UARTEN BSP_BIT32(0) |
---|
61 | uint32_t ctl; |
---|
62 | |
---|
63 | #define UARTIFLS_RXIFLSEL(val) BSP_FLD32(val, 3, 5) |
---|
64 | #define UARTIFLS_TXIFLSEL(val) BSP_FLD32(val, 0, 2) |
---|
65 | uint32_t ifls; |
---|
66 | |
---|
67 | #define UARTI_OE BSP_BIT32(10) |
---|
68 | #define UARTI_BE BSP_BIT32(9) |
---|
69 | #define UARTI_PE BSP_BIT32(8) |
---|
70 | #define UARTI_FE BSP_BIT32(7) |
---|
71 | #define UARTI_RT BSP_BIT32(6) |
---|
72 | #define UARTI_TX BSP_BIT32(5) |
---|
73 | #define UARTI_RX BSP_BIT32(4) |
---|
74 | uint32_t im; |
---|
75 | uint32_t ris; |
---|
76 | uint32_t mis; |
---|
77 | uint32_t icr; |
---|
78 | } lm3s69xx_uart; |
---|
79 | |
---|
80 | extern console_fns lm3s69xx_uart_fns; |
---|
81 | |
---|
82 | #ifdef __cplusplus |
---|
83 | } |
---|
84 | #endif /* __cplusplus */ |
---|
85 | |
---|
86 | #endif /* LIBBSP_ARM_LM3S69XX_UART_H */ |
---|