RTEMS 6.1-rc6
Loading...
Searching...
No Matches
sc16is752-regs.h
1/*
2 * Copyright (c) 2016 embedded brains GmbH & Co. KG
3 *
4 * The license and distribution terms for this file may be
5 * found in the file LICENSE in this distribution or at
6 * http://www.rtems.org/license/LICENSE.
7 */
8
9#ifndef LIBBSP_ARM_ATSAM_SC16IS752_H
10#define LIBBSP_ARM_ATSAM_SC16IS752_H
11
12#ifdef __cplusplus
13extern "C" {
14#endif /* __cplusplus */
15
16/* General register set */
17#define SC16IS752_RHR 0x0
18#define SC16IS752_THR 0x0
19#define SC16IS752_IER 0x1
20#define SC16IS752_FCR 0x2
21#define SC16IS752_IIR 0x2
22#define SC16IS752_LCR 0x3
23#define SC16IS752_MCR 0x4
24#define SC16IS752_LSR 0x5
25#define SC16IS752_MSR 0x6
26#define SC16IS752_TCR 0x6
27#define SC16IS752_SPR 0x7
28#define SC16IS752_TLR 0x7
29#define SC16IS752_TXLVL 0x8
30#define SC16IS752_RXLVL 0x9
31#define SC16IS752_IODIR 0xA
32#define SC16IS752_IOSTATE 0xB
33#define SC16IS752_IOINTENA 0xC
34#define SC16IS752_IOCONTROL 0xE
35#define SC16IS752_EFCR 0xF
36
37/* Special register set */
38#define SC16IS752_DLL 0x0
39#define SC16IS752_DLH 0x1
40
41/* Enhanced register set */
42#define SC16IS752_EFR 0x2
43#define SC16IS752_XON1 0x4
44#define SC16IS752_XON2 0x5
45#define SC16IS752_XOFF1 0x6
46#define SC16IS752_XOFF2 0x7
47
48/* FCR */
49#define SC16IS752_FCR_FIFO_EN 0x01
50#define SC16IS752_FCR_RX_FIFO_RST 0x02
51#define SC16IS752_FCR_TX_FIFO_RST 0x04
52#define SC16IS752_FCR_TX_FIFO_TRG_8 0x00
53#define SC16IS752_FCR_TX_FIFO_TRG_16 0x10
54#define SC16IS752_FCR_TX_FIFO_TRG_32 0x20
55#define SC16IS752_FCR_TX_FIFO_TRG_56 0x30
56#define SC16IS752_FCR_RX_FIFO_TRG_8 0x00
57#define SC16IS752_FCR_RX_FIFO_TRG_16 0x40
58#define SC16IS752_FCR_RX_FIFO_TRG_56 0x80
59#define SC16IS752_FCR_RX_FIFO_TRG_60 0xc0
60
61/* EFCR */
62#define SC16IS752_EFCR_RS485_ENABLE (1u << 0)
63#define SC16IS752_EFCR_RX_DISABLE (1u << 1)
64#define SC16IS752_EFCR_TX_DISABLE (1u << 2)
65#define SC16IS752_EFCR_RTSCON (1u << 4)
66#define SC16IS752_EFCR_RTSINVER (1u << 5)
67
68/* IER */
69#define SC16IS752_IER_RHR (1u << 0)
70#define SC16IS752_IER_THR (1u << 1)
71#define SC16IS752_IER_RECEIVE_LINE_STATUS (1u << 2)
72#define SC16IS752_IER_MODEM_STATUS (1u << 3)
73#define SC16IS752_IER_SLEEP_MODE (1u << 4)
74#define SC16IS752_IER_XOFF (1u << 5)
75#define SC16IS752_IER_RTS (1u << 6)
76#define SC16IS752_IER_CTS (1u << 7)
77
78/* IIR */
79#define SC16IS752_IIR_TX_INTERRUPT (1u << 1)
80#define SC16IS752_IIR_RX_INTERRUPT (1u << 2)
81
82/* LCR */
83#define SC16IS752_LCR_CHRL_5_BIT (0u << 1) | (0u << 0)
84#define SC16IS752_LCR_CHRL_6_BIT (0u << 1) | (1u << 0)
85#define SC16IS752_LCR_CHRL_7_BIT (1u << 1) | (0u << 0)
86#define SC16IS752_LCR_CHRL_8_BIT (1u << 1) | (1u << 0)
87#define SC16IS752_LCR_2_STOP_BIT (1u << 2)
88#define SC16IS752_LCR_SET_PARITY (1u << 3)
89#define SC16IS752_LCR_EVEN_PARITY (1u << 4)
90#define SC16IS752_LCR_BREAK (1u << 5)
91#define SC16IS752_LCR_ENABLE_DIVISOR (1u << 7)
92
93/* LSR */
94#define SC16IS752_LSR_TXEMPTY (1u << 5)
95#define SC16IS752_LSR_RXRDY (1u << 0)
96#define SC16IS752_LSR_ERROR_BITS (7u << 2)
97
98/* MCR */
99#define SC16IS752_MCR_DTR (1u << 0)
100#define SC16IS752_MCR_RTS (1u << 1)
101#define SC16IS752_MCR_TCR_TLR (1u << 2)
102#define SC16IS752_MCR_LOOPBACK (1u << 4)
103#define SC16IS752_MCR_XON_ANY (1u << 5)
104#define SC16IS752_MCR_IRDA_ENABLE (1u << 6)
105#define SC16IS752_MCR_PRESCALE_NEEDED (1u << 7)
106
107/* MSR */
108#define SC16IS752_MSR_dCTS (1u << 0)
109#define SC16IS752_MSR_dDSR (1u << 1)
110#define SC16IS752_MSR_dRI (1u << 2)
111#define SC16IS752_MSR_dCD (1u << 3)
112#define SC16IS752_MSR_CTS (1u << 4)
113#define SC16IS752_MSR_DSR (1u << 5)
114#define SC16IS752_MSR_RI (1u << 6)
115#define SC16IS752_MSR_CD (1u << 7)
116
117/* EFR */
118#define SC16IS752_EFR_ENHANCED_FUNC_ENABLE (1u << 4)
119#define SC16IS752_EFR_SPECIAL_CHAR_DETECT (1u << 5)
120#define SC16IS752_EFR_RTS_FLOW_CTRL_EN (1u << 6)
121#define SC16IS752_EFR_CTS_FLOW_CTRL_EN (1u << 7)
122
123/* IOCONTROL: User accessible. Therefore see sc16is752.h for the defines. */
124
125#define SC16IS752_FIFO_DEPTH 64
126
127#ifdef __cplusplus
128}
129#endif /* __cplusplus */
130
131#endif /* LIBBSP_ARM_ATSAM_SC16IS752_H */