Robobo
component_udp.h
1 /* ----------------------------------------------------------------------------
2  * SAM Software Package License
3  * ----------------------------------------------------------------------------
4  * Copyright (c) 2012, Atmel Corporation
5  *
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following condition is met:
10  *
11  * - Redistributions of source code must retain the above copyright notice,
12  * this list of conditions and the disclaimer below.
13  *
14  * Atmel's name may not be used to endorse or promote products derived from
15  * this software without specific prior written permission.
16  *
17  * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
18  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
20  * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
21  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
23  * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
24  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  * ----------------------------------------------------------------------------
28  */
29 
30 #ifndef _SAM3S_UDP_COMPONENT_
31 #define _SAM3S_UDP_COMPONENT_
32 
33 /* ============================================================================= */
35 /* ============================================================================= */
38 
39 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
40 
41 typedef struct {
45  RoReg Reserved1[1];
51  RoReg Reserved2[1];
53  RoReg Reserved3[1];
54  RwReg UDP_CSR[8];
55  RwReg UDP_FDR[8];
56  RoReg Reserved4[1];
58 } Udp;
59 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
60 /* -------- UDP_FRM_NUM : (UDP Offset: 0x000) Frame Number Register -------- */
61 #define UDP_FRM_NUM_FRM_NUM_Pos 0
62 #define UDP_FRM_NUM_FRM_NUM_Msk (0x7ffu << UDP_FRM_NUM_FRM_NUM_Pos)
63 #define UDP_FRM_NUM_FRM_ERR (0x1u << 16)
64 #define UDP_FRM_NUM_FRM_OK (0x1u << 17)
65 /* -------- UDP_GLB_STAT : (UDP Offset: 0x004) Global State Register -------- */
66 #define UDP_GLB_STAT_FADDEN (0x1u << 0)
67 #define UDP_GLB_STAT_CONFG (0x1u << 1)
68 #define UDP_GLB_STAT_ESR (0x1u << 2)
69 #define UDP_GLB_STAT_RSMINPR (0x1u << 3)
70 #define UDP_GLB_STAT_RMWUPE (0x1u << 4)
71 /* -------- UDP_FADDR : (UDP Offset: 0x008) Function Address Register -------- */
72 #define UDP_FADDR_FADD_Pos 0
73 #define UDP_FADDR_FADD_Msk (0x7fu << UDP_FADDR_FADD_Pos)
74 #define UDP_FADDR_FADD(value) ((UDP_FADDR_FADD_Msk & ((value) << UDP_FADDR_FADD_Pos)))
75 #define UDP_FADDR_FEN (0x1u << 8)
76 /* -------- UDP_IER : (UDP Offset: 0x010) Interrupt Enable Register -------- */
77 #define UDP_IER_EP0INT (0x1u << 0)
78 #define UDP_IER_EP1INT (0x1u << 1)
79 #define UDP_IER_EP2INT (0x1u << 2)
80 #define UDP_IER_EP3INT (0x1u << 3)
81 #define UDP_IER_EP4INT (0x1u << 4)
82 #define UDP_IER_EP5INT (0x1u << 5)
83 #define UDP_IER_EP6INT (0x1u << 6)
84 #define UDP_IER_EP7INT (0x1u << 7)
85 #define UDP_IER_RXSUSP (0x1u << 8)
86 #define UDP_IER_RXRSM (0x1u << 9)
87 #define UDP_IER_EXTRSM (0x1u << 10)
88 #define UDP_IER_SOFINT (0x1u << 11)
89 #define UDP_IER_WAKEUP (0x1u << 13)
90 /* -------- UDP_IDR : (UDP Offset: 0x014) Interrupt Disable Register -------- */
91 #define UDP_IDR_EP0INT (0x1u << 0)
92 #define UDP_IDR_EP1INT (0x1u << 1)
93 #define UDP_IDR_EP2INT (0x1u << 2)
94 #define UDP_IDR_EP3INT (0x1u << 3)
95 #define UDP_IDR_EP4INT (0x1u << 4)
96 #define UDP_IDR_EP5INT (0x1u << 5)
97 #define UDP_IDR_EP6INT (0x1u << 6)
98 #define UDP_IDR_EP7INT (0x1u << 7)
99 #define UDP_IDR_RXSUSP (0x1u << 8)
100 #define UDP_IDR_RXRSM (0x1u << 9)
101 #define UDP_IDR_EXTRSM (0x1u << 10)
102 #define UDP_IDR_SOFINT (0x1u << 11)
103 #define UDP_IDR_WAKEUP (0x1u << 13)
104 /* -------- UDP_IMR : (UDP Offset: 0x018) Interrupt Mask Register -------- */
105 #define UDP_IMR_EP0INT (0x1u << 0)
106 #define UDP_IMR_EP1INT (0x1u << 1)
107 #define UDP_IMR_EP2INT (0x1u << 2)
108 #define UDP_IMR_EP3INT (0x1u << 3)
109 #define UDP_IMR_EP4INT (0x1u << 4)
110 #define UDP_IMR_EP5INT (0x1u << 5)
111 #define UDP_IMR_EP6INT (0x1u << 6)
112 #define UDP_IMR_EP7INT (0x1u << 7)
113 #define UDP_IMR_RXSUSP (0x1u << 8)
114 #define UDP_IMR_RXRSM (0x1u << 9)
115 #define UDP_IMR_EXTRSM (0x1u << 10)
116 #define UDP_IMR_SOFINT (0x1u << 11)
117 #define UDP_IMR_BIT12 (0x1u << 12)
118 #define UDP_IMR_WAKEUP (0x1u << 13)
119 /* -------- UDP_ISR : (UDP Offset: 0x01C) Interrupt Status Register -------- */
120 #define UDP_ISR_EP0INT (0x1u << 0)
121 #define UDP_ISR_EP1INT (0x1u << 1)
122 #define UDP_ISR_EP2INT (0x1u << 2)
123 #define UDP_ISR_EP3INT (0x1u << 3)
124 #define UDP_ISR_EP4INT (0x1u << 4)
125 #define UDP_ISR_EP5INT (0x1u << 5)
126 #define UDP_ISR_EP6INT (0x1u << 6)
127 #define UDP_ISR_EP7INT (0x1u << 7)
128 #define UDP_ISR_RXSUSP (0x1u << 8)
129 #define UDP_ISR_RXRSM (0x1u << 9)
130 #define UDP_ISR_EXTRSM (0x1u << 10)
131 #define UDP_ISR_SOFINT (0x1u << 11)
132 #define UDP_ISR_ENDBUSRES (0x1u << 12)
133 #define UDP_ISR_WAKEUP (0x1u << 13)
134 /* -------- UDP_ICR : (UDP Offset: 0x020) Interrupt Clear Register -------- */
135 #define UDP_ICR_RXSUSP (0x1u << 8)
136 #define UDP_ICR_RXRSM (0x1u << 9)
137 #define UDP_ICR_EXTRSM (0x1u << 10)
138 #define UDP_ICR_SOFINT (0x1u << 11)
139 #define UDP_ICR_ENDBUSRES (0x1u << 12)
140 #define UDP_ICR_WAKEUP (0x1u << 13)
141 /* -------- UDP_RST_EP : (UDP Offset: 0x028) Reset Endpoint Register -------- */
142 #define UDP_RST_EP_EP0 (0x1u << 0)
143 #define UDP_RST_EP_EP1 (0x1u << 1)
144 #define UDP_RST_EP_EP2 (0x1u << 2)
145 #define UDP_RST_EP_EP3 (0x1u << 3)
146 #define UDP_RST_EP_EP4 (0x1u << 4)
147 #define UDP_RST_EP_EP5 (0x1u << 5)
148 #define UDP_RST_EP_EP6 (0x1u << 6)
149 #define UDP_RST_EP_EP7 (0x1u << 7)
150 /* -------- UDP_CSR[8] : (UDP Offset: 0x030) Endpoint Control and Status Register -------- */
151 #define UDP_CSR_TXCOMP (0x1u << 0)
152 #define UDP_CSR_RX_DATA_BK0 (0x1u << 1)
153 #define UDP_CSR_RXSETUP (0x1u << 2)
154 #define UDP_CSR_STALLSENT (0x1u << 3)
155 #define UDP_CSR_ISOERROR (0x1u << 3)
156 #define UDP_CSR_TXPKTRDY (0x1u << 4)
157 #define UDP_CSR_FORCESTALL (0x1u << 5)
158 #define UDP_CSR_RX_DATA_BK1 (0x1u << 6)
159 #define UDP_CSR_DIR (0x1u << 7)
160 #define UDP_CSR_EPTYPE_Pos 8
161 #define UDP_CSR_EPTYPE_Msk (0x7u << UDP_CSR_EPTYPE_Pos)
162 #define UDP_CSR_EPTYPE_CTRL (0x0u << 8)
163 #define UDP_CSR_EPTYPE_ISO_OUT (0x1u << 8)
164 #define UDP_CSR_EPTYPE_BULK_OUT (0x2u << 8)
165 #define UDP_CSR_EPTYPE_INT_OUT (0x3u << 8)
166 #define UDP_CSR_EPTYPE_ISO_IN (0x5u << 8)
167 #define UDP_CSR_EPTYPE_BULK_IN (0x6u << 8)
168 #define UDP_CSR_EPTYPE_INT_IN (0x7u << 8)
169 #define UDP_CSR_DTGLE (0x1u << 11)
170 #define UDP_CSR_EPEDS (0x1u << 15)
171 #define UDP_CSR_RXBYTECNT_Pos 16
172 #define UDP_CSR_RXBYTECNT_Msk (0x7ffu << UDP_CSR_RXBYTECNT_Pos)
173 #define UDP_CSR_RXBYTECNT(value) ((UDP_CSR_RXBYTECNT_Msk & ((value) << UDP_CSR_RXBYTECNT_Pos)))
174 /* -------- UDP_FDR[8] : (UDP Offset: 0x050) Endpoint FIFO Data Register -------- */
175 #define UDP_FDR_FIFO_DATA_Pos 0
176 #define UDP_FDR_FIFO_DATA_Msk (0xffu << UDP_FDR_FIFO_DATA_Pos)
177 #define UDP_FDR_FIFO_DATA(value) ((UDP_FDR_FIFO_DATA_Msk & ((value) << UDP_FDR_FIFO_DATA_Pos)))
178 /* -------- UDP_TXVC : (UDP Offset: 0x074) Transceiver Control Register -------- */
179 #define UDP_TXVC_TXVDIS (0x1u << 8)
180 #define UDP_TXVC_PUON (0x1u << 9)
183 
184 
185 #endif /* _SAM3S_UDP_COMPONENT_ */
RwReg UDP_FADDR
(Udp Offset: 0x008) Function Address Register
Definition: component_udp.h:44
RoReg UDP_IMR
(Udp Offset: 0x018) Interrupt Mask Register
Definition: component_udp.h:48
volatile uint32_t RwReg
Definition: sam3n00a.h:54
WoReg UDP_IER
(Udp Offset: 0x010) Interrupt Enable Register
Definition: component_udp.h:46
volatile uint32_t WoReg
Definition: sam3n00a.h:53
RoReg UDP_ISR
(Udp Offset: 0x01C) Interrupt Status Register
Definition: component_udp.h:49
WoReg UDP_ICR
(Udp Offset: 0x020) Interrupt Clear Register
Definition: component_udp.h:50
RwReg UDP_GLB_STAT
(Udp Offset: 0x004) Global State Register
Definition: component_udp.h:43
Udp hardware registers.
Definition: component_udp.h:41
RwReg UDP_RST_EP
(Udp Offset: 0x028) Reset Endpoint Register
Definition: component_udp.h:52
volatile const uint32_t RoReg
Definition: sam3n00a.h:49
WoReg UDP_IDR
(Udp Offset: 0x014) Interrupt Disable Register
Definition: component_udp.h:47
RwReg UDP_TXVC
(Udp Offset: 0x074) Transceiver Control Register
Definition: component_udp.h:57
RoReg UDP_FRM_NUM
(Udp Offset: 0x000) Frame Number Register
Definition: component_udp.h:42