RTEMS  5.1
component_uart.h
1 /* ---------------------------------------------------------------------------- */
2 /* Atmel Microcontroller Software Support */
3 /* SAM Software Package License */
4 /* ---------------------------------------------------------------------------- */
5 /* Copyright (c) 2015, Atmel Corporation */
6 /* */
7 /* All rights reserved. */
8 /* */
9 /* Redistribution and use in source and binary forms, with or without */
10 /* modification, are permitted provided that the following condition is met: */
11 /* */
12 /* - Redistributions of source code must retain the above copyright notice, */
13 /* this list of conditions and the disclaimer below. */
14 /* */
15 /* Atmel's name may not be used to endorse or promote products derived from */
16 /* this software without specific prior written permission. */
17 /* */
18 /* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */
19 /* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
20 /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */
21 /* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */
22 /* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
23 /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */
24 /* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */
25 /* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */
26 /* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
27 /* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
28 /* ---------------------------------------------------------------------------- */
29 
30 #ifndef _SAMV71_UART_COMPONENT_
31 #define _SAMV71_UART_COMPONENT_
32 
33 /* ============================================================================= */
35 /* ============================================================================= */
38 
39 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
40 
41 typedef struct {
42  __O uint32_t UART_CR;
43  __IO uint32_t UART_MR;
44  __O uint32_t UART_IER;
45  __O uint32_t UART_IDR;
46  __I uint32_t UART_IMR;
47  __I uint32_t UART_SR;
48  __I uint32_t UART_RHR;
49  __O uint32_t UART_THR;
50  __IO uint32_t UART_BRGR;
51  __IO uint32_t UART_CMPR;
52  __I uint32_t Reserved1[47];
53  __IO uint32_t UART_WPMR;
54  __I uint32_t Reserved2[5];
55  __I uint32_t UART_VERSION;
56 } Uart;
57 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
58 /* -------- UART_CR : (UART Offset: 0x0000) Control Register -------- */
59 #define UART_CR_RSTRX (0x1u << 2)
60 #define UART_CR_RSTTX (0x1u << 3)
61 #define UART_CR_RXEN (0x1u << 4)
62 #define UART_CR_RXDIS (0x1u << 5)
63 #define UART_CR_TXEN (0x1u << 6)
64 #define UART_CR_TXDIS (0x1u << 7)
65 #define UART_CR_RSTSTA (0x1u << 8)
66 #define UART_CR_REQCLR (0x1u << 12)
67 #define UART_CR_DBGE (0x1u << 15)
68 /* -------- UART_MR : (UART Offset: 0x0004) Mode Register -------- */
69 #define UART_MR_FILTER (0x1u << 4)
70 #define UART_MR_FILTER_DISABLED (0x0u << 4)
71 #define UART_MR_FILTER_ENABLED (0x1u << 4)
72 #define UART_MR_PAR_Pos 9
73 #define UART_MR_PAR_Msk (0x7u << UART_MR_PAR_Pos)
74 #define UART_MR_PAR(value) ((UART_MR_PAR_Msk & ((value) << UART_MR_PAR_Pos)))
75 #define UART_MR_PAR_EVEN (0x0u << 9)
76 #define UART_MR_PAR_ODD (0x1u << 9)
77 #define UART_MR_PAR_SPACE (0x2u << 9)
78 #define UART_MR_PAR_MARK (0x3u << 9)
79 #define UART_MR_PAR_NO (0x4u << 9)
80 #define UART_MR_BRSRCCK (0x1u << 12)
81 #define UART_MR_BRSRCCK_PERIPH_CLK (0x0u << 12)
82 #define UART_MR_BRSRCCK_PMC_PCK (0x1u << 12)
83 #define UART_MR_CHMODE_Pos 14
84 #define UART_MR_CHMODE_Msk (0x3u << UART_MR_CHMODE_Pos)
85 #define UART_MR_CHMODE(value) ((UART_MR_CHMODE_Msk & ((value) << UART_MR_CHMODE_Pos)))
86 #define UART_MR_CHMODE_NORMAL (0x0u << 14)
87 #define UART_MR_CHMODE_AUTOMATIC (0x1u << 14)
88 #define UART_MR_CHMODE_LOCAL_LOOPBACK (0x2u << 14)
89 #define UART_MR_CHMODE_REMOTE_LOOPBACK (0x3u << 14)
90 /* -------- UART_IER : (UART Offset: 0x0008) Interrupt Enable Register -------- */
91 #define UART_IER_RXRDY (0x1u << 0)
92 #define UART_IER_TXRDY (0x1u << 1)
93 #define UART_IER_OVRE (0x1u << 5)
94 #define UART_IER_FRAME (0x1u << 6)
95 #define UART_IER_PARE (0x1u << 7)
96 #define UART_IER_TXEMPTY (0x1u << 9)
97 #define UART_IER_CMP (0x1u << 15)
98 /* -------- UART_IDR : (UART Offset: 0x000C) Interrupt Disable Register -------- */
99 #define UART_IDR_RXRDY (0x1u << 0)
100 #define UART_IDR_TXRDY (0x1u << 1)
101 #define UART_IDR_OVRE (0x1u << 5)
102 #define UART_IDR_FRAME (0x1u << 6)
103 #define UART_IDR_PARE (0x1u << 7)
104 #define UART_IDR_TXEMPTY (0x1u << 9)
105 #define UART_IDR_CMP (0x1u << 15)
106 /* -------- UART_IMR : (UART Offset: 0x0010) Interrupt Mask Register -------- */
107 #define UART_IMR_RXRDY (0x1u << 0)
108 #define UART_IMR_TXRDY (0x1u << 1)
109 #define UART_IMR_OVRE (0x1u << 5)
110 #define UART_IMR_FRAME (0x1u << 6)
111 #define UART_IMR_PARE (0x1u << 7)
112 #define UART_IMR_TXEMPTY (0x1u << 9)
113 #define UART_IMR_CMP (0x1u << 15)
114 /* -------- UART_SR : (UART Offset: 0x0014) Status Register -------- */
115 #define UART_SR_RXRDY (0x1u << 0)
116 #define UART_SR_TXRDY (0x1u << 1)
117 #define UART_SR_OVRE (0x1u << 5)
118 #define UART_SR_FRAME (0x1u << 6)
119 #define UART_SR_PARE (0x1u << 7)
120 #define UART_SR_TXEMPTY (0x1u << 9)
121 #define UART_SR_CMP (0x1u << 15)
122 #define UART_SR_SWES (0x1u << 21)
123 #define UART_SR_CLKREQ (0x1u << 22)
124 #define UART_SR_WKUPREQ (0x1u << 23)
125 /* -------- UART_RHR : (UART Offset: 0x0018) Receive Holding Register -------- */
126 #define UART_RHR_RXCHR_Pos 0
127 #define UART_RHR_RXCHR_Msk (0xffu << UART_RHR_RXCHR_Pos)
128 /* -------- UART_THR : (UART Offset: 0x001C) Transmit Holding Register -------- */
129 #define UART_THR_TXCHR_Pos 0
130 #define UART_THR_TXCHR_Msk (0xffu << UART_THR_TXCHR_Pos)
131 #define UART_THR_TXCHR(value) ((UART_THR_TXCHR_Msk & ((value) << UART_THR_TXCHR_Pos)))
132 /* -------- UART_BRGR : (UART Offset: 0x0020) Baud Rate Generator Register -------- */
133 #define UART_BRGR_CD_Pos 0
134 #define UART_BRGR_CD_Msk (0xffffu << UART_BRGR_CD_Pos)
135 #define UART_BRGR_CD(value) ((UART_BRGR_CD_Msk & ((value) << UART_BRGR_CD_Pos)))
136 /* -------- UART_CMPR : (UART Offset: 0x0024) Comparison Register -------- */
137 #define UART_CMPR_VAL1_Pos 0
138 #define UART_CMPR_VAL1_Msk (0xffu << UART_CMPR_VAL1_Pos)
139 #define UART_CMPR_VAL1(value) ((UART_CMPR_VAL1_Msk & ((value) << UART_CMPR_VAL1_Pos)))
140 #define UART_CMPR_CMPMODE (0x1u << 12)
141 #define UART_CMPR_CMPMODE_FLAG_ONLY (0x0u << 12)
142 #define UART_CMPR_CMPMODE_START_CONDITION (0x1u << 12)
143 #define UART_CMPR_CMPPAR (0x1u << 14)
144 #define UART_CMPR_VAL2_Pos 16
145 #define UART_CMPR_VAL2_Msk (0xffu << UART_CMPR_VAL2_Pos)
146 #define UART_CMPR_VAL2(value) ((UART_CMPR_VAL2_Msk & ((value) << UART_CMPR_VAL2_Pos)))
147 /* -------- UART_WPMR : (UART Offset: 0x00E4) Write Protection Mode Register -------- */
148 #define UART_WPMR_WPEN (0x1u << 0)
149 #define UART_WPMR_WPKEY_Pos 8
150 #define UART_WPMR_WPKEY_Msk (0xffffffu << UART_WPMR_WPKEY_Pos)
151 #define UART_WPMR_WPKEY(value) ((UART_WPMR_WPKEY_Msk & ((value) << UART_WPMR_WPKEY_Pos)))
152 #define UART_WPMR_WPKEY_PASSWD (0x554152u << 8)
153 /* -------- UART_VERSION : (UART Offset: 0x00FC) Version Register -------- */
154 #define UART_VERSION_VERSION_Pos 0
155 #define UART_VERSION_VERSION_Msk (0xfffu << UART_VERSION_VERSION_Pos)
156 #define UART_VERSION_MFN_Pos 16
157 #define UART_VERSION_MFN_Msk (0x7u << UART_VERSION_MFN_Pos)
160 
161 
162 #endif /* _SAMV71_UART_COMPONENT_ */
#define __IO
Definition: core_cm7.h:287
#define __O
Definition: core_cm7.h:286
Uart hardware registers.
Definition: component_uart.h:41
__I uint32_t UART_VERSION
(Uart Offset: 0x00FC) Version Register
Definition: component_uart.h:55
#define __I
Definition: core_cm7.h:284