]> git.gir.st - tmk_keyboard.git/blob - tmk_core/tool/mbed/mbed-sdk/libraries/USBHost/USBHost/TARGET_RENESAS/TARGET_RZ_A1H/inc/usb_host.h
Merge commit '1fe4406f374291ab2e86e95a97341fd9c475fcb8'
[tmk_keyboard.git] / tmk_core / tool / mbed / mbed-sdk / libraries / USBHost / USBHost / TARGET_RENESAS / TARGET_RZ_A1H / inc / usb_host.h
1 /*******************************************************************************
2 * DISCLAIMER
3 * This software is supplied by Renesas Electronics Corporation and is only
4 * intended for use with Renesas products. No other uses are authorized. This
5 * software is owned by Renesas Electronics Corporation and is protected under
6 * all applicable laws, including copyright laws.
7 * THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
8 * THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT
9 * LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
10 * AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
11 * TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS
12 * ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE
13 * FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR
14 * ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE
15 * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
16 * Renesas reserves the right, without notice, to make changes to this software
17 * and to discontinue the availability of this software. By using this software,
18 * you agree to the additional terms and conditions found by accessing the
19 * following link:
20 * http://www.renesas.com/disclaimer
21 * Copyright (C) 2012 - 2014 Renesas Electronics Corporation. All rights reserved.
22 *******************************************************************************/
23 /*******************************************************************************
24 * File Name : usb_host.h
25 * $Rev: 1116 $
26 * $Date:: 2014-07-09 16:29:19 +0900#$
27 * Description : RZ/A1H R7S72100 USB Sample Program
28 *******************************************************************************/
29 #ifndef USB_HOST_H
30 #define USB_HOST_H
31
32
33 /*******************************************************************************
34 Includes <System Includes> , "Project Includes"
35 *******************************************************************************/
36 #include "r_typedefs.h"
37 #include "iodefine.h"
38 #include "rza_io_regrw.h"
39
40
41 /*******************************************************************************
42 Typedef definitions
43 *******************************************************************************/
44
45
46 /*******************************************************************************
47 Macro definitions
48 *******************************************************************************/
49 #define USB_HOST_DEVICE_0 (0u)
50 #define USB_HOST_DEVICE_1 (1u)
51 #define USB_HOST_DEVICE_2 (2u)
52 #define USB_HOST_DEVICE_3 (3u)
53 #define USB_HOST_DEVICE_4 (4u)
54 #define USB_HOST_DEVICE_5 (5u)
55 #define USB_HOST_DEVICE_6 (6u)
56 #define USB_HOST_DEVICE_7 (7u)
57 #define USB_HOST_DEVICE_8 (8u)
58 #define USB_HOST_DEVICE_9 (9u)
59 #define USB_HOST_DEVICE_10 (10u)
60
61 #define USB_HOST_ENDPOINT_DESC (0x05)
62
63 #define USB_HOST_BITUPLLE (0x0002u)
64 #define USB_HOST_BITUCKSEL (0x0004u)
65 #define USB_HOST_BITBWAIT (0x003fu)
66
67 #define USB_HOST_BUSWAIT_02 (0x0000u)
68 #define USB_HOST_BUSWAIT_03 (0x0001u)
69 #define USB_HOST_BUSWAIT_04 (0x0002u)
70 #define USB_HOST_BUSWAIT_05 (0x0003u)
71 #define USB_HOST_BUSWAIT_06 (0x0004u)
72 #define USB_HOST_BUSWAIT_07 (0x0005u)
73 #define USB_HOST_BUSWAIT_08 (0x0006u)
74 #define USB_HOST_BUSWAIT_09 (0x0007u)
75 #define USB_HOST_BUSWAIT_10 (0x0008u)
76 #define USB_HOST_BUSWAIT_11 (0x0009u)
77 #define USB_HOST_BUSWAIT_12 (0x000au)
78 #define USB_HOST_BUSWAIT_13 (0x000bu)
79 #define USB_HOST_BUSWAIT_14 (0x000cu)
80 #define USB_HOST_BUSWAIT_15 (0x000du)
81 #define USB_HOST_BUSWAIT_16 (0x000eu)
82 #define USB_HOST_BUSWAIT_17 (0x000fu)
83
84 #define USB_HOST_FS_JSTS (0x0001u)
85 #define USB_HOST_LS_JSTS (0x0002u)
86
87 #define USB_HOST_BITRST (0x0040u)
88 #define USB_HOST_BITRESUME (0x0020u)
89 #define USB_HOST_BITUACT (0x0010u)
90 #define USB_HOST_HSPROC (0x0004u)
91 #define USB_HOST_HSMODE (0x0003u)
92 #define USB_HOST_FSMODE (0x0002u)
93 #define USB_HOST_LSMODE (0x0001u)
94 #define USB_HOST_UNDECID (0x0000u)
95
96 #define USB_HOST_BITRCNT (0x8000u)
97 #define USB_HOST_BITDREQE (0x1000u)
98 #define USB_HOST_BITMBW (0x0c00u)
99 #define USB_HOST_BITMBW_8 (0x0000u)
100 #define USB_HOST_BITMBW_16 (0x0400u)
101 #define USB_HOST_BITMBW_32 (0x0800u)
102 #define USB_HOST_BITBYTE_LITTLE (0x0000u)
103 #define USB_HOST_BITBYTE_BIG (0x0100u)
104 #define USB_HOST_BITISEL (0x0020u)
105 #define USB_HOST_BITCURPIPE (0x000fu)
106
107 #define USB_HOST_CFIFO_READ (0x0000u)
108 #define USB_HOST_CFIFO_WRITE (0x0020u)
109
110 #define USB_HOST_BITBVAL (0x8000u)
111 #define USB_HOST_BITBCLR (0x4000u)
112 #define USB_HOST_BITFRDY (0x2000u)
113 #define USB_HOST_BITDTLN (0x0fffu)
114
115 #define USB_HOST_BITBEMPE (0x0400u)
116 #define USB_HOST_BITNRDYE (0x0200u)
117 #define USB_HOST_BITBRDYE (0x0100u)
118 #define USB_HOST_BITBEMP (0x0400u)
119 #define USB_HOST_BITNRDY (0x0200u)
120 #define USB_HOST_BITBRDY (0x0100u)
121
122 #define USB_HOST_BITBCHGE (0x4000u)
123 #define USB_HOST_BITDTCHE (0x1000u)
124 #define USB_HOST_BITATTCHE (0x0800u)
125 #define USB_HOST_BITEOFERRE (0x0040u)
126 #define USB_HOST_BITBCHG (0x4000u)
127 #define USB_HOST_BITDTCH (0x1000u)
128 #define USB_HOST_BITATTCH (0x0800u)
129 #define USB_HOST_BITEOFERR (0x0040u)
130
131 #define USB_HOST_BITSIGNE (0x0020u)
132 #define USB_HOST_BITSACKE (0x0010u)
133 #define USB_HOST_BITSIGN (0x0020u)
134 #define USB_HOST_BITSACK (0x0010u)
135
136 #define USB_HOST_BITSUREQ (0x4000u)
137 #define USB_HOST_BITSQSET (0x0080u)
138 #define USB_HOST_PID_STALL2 (0x0003u)
139 #define USB_HOST_PID_STALL (0x0002u)
140 #define USB_HOST_PID_BUF (0x0001u)
141 #define USB_HOST_PID_NAK (0x0000u)
142
143 #define USB_HOST_PIPExBUF (64u)
144
145 #define USB_HOST_D0FIFO (0)
146 #define USB_HOST_D1FIFO (1)
147 #define USB_HOST_DMA_READY (0)
148 #define USB_HOST_DMA_BUSY (1)
149 #define USB_HOST_DMA_BUSYEND (2)
150
151 #define USB_HOST_FIFO_USE (0x7000)
152
153 #define USB_HOST_FIFOERROR (0xffff)
154 #define USB_HOST_WRITEEND (0)
155 #define USB_HOST_WRITESHRT (1)
156 #define USB_HOST_WRITING (2)
157 #define USB_HOST_WRITEDMA (3)
158 #define USB_HOST_READEND (0)
159 #define USB_HOST_READSHRT (1)
160 #define USB_HOST_READING (2)
161 #define USB_HOST_READOVER (3)
162 #define USB_HOST_READZERO (4)
163
164 #define USB_HOST_CMD_IDLE (0x0000)
165 #define USB_HOST_CMD_DOING (0x0001)
166 #define USB_HOST_CMD_DONE (0x0002)
167 #define USB_HOST_CMD_NORES (0x0003)
168 #define USB_HOST_CMD_STALL (0x0004)
169 #define USB_HOST_CMD_FIELD (0x000f)
170
171 #if 0
172 #define USB_HOST_CHG_CMDFIELD( r, v ) do { r &= ( ~USB_HOST_CMD_FIELD ); \
173 r |= v; } while(0)
174 #endif
175
176 #define USB_HOST_MODE_WRITE (0x0100)
177 #define USB_HOST_MODE_READ (0x0200)
178 #define USB_HOST_MODE_NO_DATA (0x0300)
179 #define USB_HOST_MODE_FIELD (0x0f00)
180
181 #define USB_HOST_STAGE_SETUP (0x0010)
182 #define USB_HOST_STAGE_DATA (0x0020)
183 #define USB_HOST_STAGE_STATUS (0x0030)
184 #define USB_HOST_STAGE_FIELD (0x00f0)
185
186 #if 0
187 #define USB_HOST_CHG_STAGEFIELD( r, v ) do { r &= ( ~USB_HOST_STAGE_FIELD ); \
188 r |= v; } while(0)
189 #endif
190
191 #define USB_HOST_DEVADD_MASK (0x7fc0)
192
193
194 /*******************************************************************************
195 Imported global variables and functions (from other files)
196 *******************************************************************************/
197 extern uint16_t g_usb_host_elt_clockmode;
198
199 #endif /* USB_HOST_H */
200
201 /* End of File */
Imprint / Impressum