summaryrefslogtreecommitdiff
path: root/tool/mbed/mbed-sdk/libraries/USBDevice/USBDevice/TARGET_RENESAS/TARGET_RZ_A1H/inc/usb_function.h
blob: 090e51c10fb25f877f46fa7f3ec20cb1220009f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
/*******************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only
* intended for use with Renesas products. No other uses are authorized. This
* software is owned by Renesas Electronics Corporation and is protected under
* all applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT
* LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
* AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
* TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS
* ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE
* FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR
* ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE
* BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software
* and to discontinue the availability of this software. By using this software,
* you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclaimer
* Copyright (C) 2012 - 2014 Renesas Electronics Corporation. All rights reserved.
*******************************************************************************/
/*******************************************************************************
* File Name    : usb_function.h
* $Rev: 1116 $
* $Date:: 2014-07-09 16:29:19 +0900#$
* Description  : RZ/A1H R7S72100 USB Sample Program
*******************************************************************************/
#ifndef USB_FUNCTION_H
#define USB_FUNCTION_H

/*******************************************************************************
Includes   <System Includes> , "Project Includes"
*******************************************************************************/
#include "r_typedefs.h"
#include "iodefine.h"
#include "rza_io_regrw.h"

/*******************************************************************************
Macro definitions
*******************************************************************************/
#define USB_FUNCTION_ALT_NO         (255)
#define USB_FUNCTION_ALT_SET        (0xff)

#define USB_FUNCTION_BITUPLLE       (0x0002u)
#define USB_FUNCTION_BITUCKSEL      (0x0004u)
#define USB_FUNCTION_BITBWAIT       (0x003fu)

#define USB_FUNCTION_BUSWAIT_02     (0x0000u)
#define USB_FUNCTION_BUSWAIT_03     (0x0001u)
#define USB_FUNCTION_BUSWAIT_04     (0x0002u)
#define USB_FUNCTION_BUSWAIT_05     (0x0003u)
#define USB_FUNCTION_BUSWAIT_06     (0x0004u)
#define USB_FUNCTION_BUSWAIT_07     (0x0005u)
#define USB_FUNCTION_BUSWAIT_08     (0x0006u)
#define USB_FUNCTION_BUSWAIT_09     (0x0007u)
#define USB_FUNCTION_BUSWAIT_10     (0x0008u)
#define USB_FUNCTION_BUSWAIT_11     (0x0009u)
#define USB_FUNCTION_BUSWAIT_12     (0x000au)
#define USB_FUNCTION_BUSWAIT_13     (0x000bu)
#define USB_FUNCTION_BUSWAIT_14     (0x000cu)
#define USB_FUNCTION_BUSWAIT_15     (0x000du)
#define USB_FUNCTION_BUSWAIT_16     (0x000eu)
#define USB_FUNCTION_BUSWAIT_17     (0x000fu)

#define USB_FUNCTION_BITRESUME      (0x0020u)
#define USB_FUNCTION_BITUACT        (0x0010u)
#define USB_FUNCTION_HSPROC         (0x0004u)
#define USB_FUNCTION_HSMODE         (0x0003u)
#define USB_FUNCTION_FSMODE         (0x0002u)
#define USB_FUNCTION_LSMODE         (0x0001u)
#define USB_FUNCTION_UNDECID        (0x0000u)

#define USB_FUNCTION_BITRCNT        (0x8000u)
#define USB_FUNCTION_BITDREQE       (0x1000u)
#define USB_FUNCTION_BITMBW         (0x0c00u)
#define USB_FUNCTION_BITMBW_8       (0x0000u)
#define USB_FUNCTION_BITMBW_16      (0x0400u)
#define USB_FUNCTION_BITMBW_32      (0x0800u)
#define USB_FUNCTION_BITBYTE_LITTLE (0x0000u)
#define USB_FUNCTION_BITBYTE_BIG    (0x0100u)
#define USB_FUNCTION_BITISEL        (0x0020u)
#define USB_FUNCTION_BITCURPIPE     (0x000fu)

#define USB_FUNCTION_CFIFO_READ     (0x0000u)
#define USB_FUNCTION_CFIFO_WRITE    (0x0020u)

#define USB_FUNCTION_BITBVAL        (0x8000u)
#define USB_FUNCTION_BITBCLR        (0x4000u)
#define USB_FUNCTION_BITFRDY        (0x2000u)
#define USB_FUNCTION_BITDTLN        (0x0fffu)

#define USB_FUNCTION_BITVBSE        (0x8000u)
#define USB_FUNCTION_BITRSME        (0x4000u)
#define USB_FUNCTION_BITSOFE        (0x2000u)
#define USB_FUNCTION_BITDVSE        (0x1000u)
#define USB_FUNCTION_BITCTRE        (0x0800u)
#define USB_FUNCTION_BITVBINT       (0x8000u)
#define USB_FUNCTION_BITRESM        (0x4000u)
#define USB_FUNCTION_BITSOFR        (0x2000u)
#define USB_FUNCTION_BITDVST        (0x1000u)
#define USB_FUNCTION_BITCTRT        (0x0800u)

#define USB_FUNCTION_BITBEMPE       (0x0400u)
#define USB_FUNCTION_BITNRDYE       (0x0200u)
#define USB_FUNCTION_BITBRDYE       (0x0100u)
#define USB_FUNCTION_BITBEMP        (0x0400u)
#define USB_FUNCTION_BITNRDY        (0x0200u)
#define USB_FUNCTION_BITBRDY        (0x0100u)

#define USB_FUNCTION_BITDVSQ        (0x0070u)
#define USB_FUNCTION_BITDVSQS       (0x0030u)
#define USB_FUNCTION_DS_SPD_CNFG    (0x0070u)
#define USB_FUNCTION_DS_SPD_ADDR    (0x0060u)
#define USB_FUNCTION_DS_SPD_DFLT    (0x0050u)
#define USB_FUNCTION_DS_SPD_POWR    (0x0040u)
#define USB_FUNCTION_DS_CNFG        (0x0030u)
#define USB_FUNCTION_DS_ADDS        (0x0020u)
#define USB_FUNCTION_DS_DFLT        (0x0010u)
#define USB_FUNCTION_DS_POWR        (0x0000u)
#define USB_FUNCTION_BITVALID       (0x0008u)
#define USB_FUNCTION_BITCTSQ        (0x0007u)
#define USB_FUNCTION_CS_SQER        (0x0006u)
#define USB_FUNCTION_CS_WRND        (0x0005u)
#define USB_FUNCTION_CS_WRSS        (0x0004u)
#define USB_FUNCTION_CS_WRDS        (0x0003u)
#define USB_FUNCTION_CS_RDSS        (0x0002u)
#define USB_FUNCTION_CS_RDDS        (0x0001u)
#define USB_FUNCTION_CS_IDST        (0x0000u)

#define USB_FUNCTION_PIPExBUF       (64u)

#define USB_FUNCTION_D0FIFO         (0)
#define USB_FUNCTION_D1FIFO         (1)
#define USB_FUNCTION_DMA_READY      (0)
#define USB_FUNCTION_DMA_BUSY       (1)
#define USB_FUNCTION_DMA_BUSYEND    (2)

#define USB_FUNCTION_FIFO_USE       (0x7000)

#endif /* USB_FUNCTION_FUNCTION_H */

/* End of File */