]> git.gir.st - tmk_keyboard.git/blob - tmk_core/tool/mbed/mbed-sdk/libraries/USBDevice/USBDevice/TARGET_RENESAS/TARGET_RZ_A1H/usb0/src/function/usb0_function_global.c
Merge commit '1fe4406f374291ab2e86e95a97341fd9c475fcb8'
[tmk_keyboard.git] / tmk_core / tool / mbed / mbed-sdk / libraries / USBDevice / USBDevice / TARGET_RENESAS / TARGET_RZ_A1H / usb0 / src / function / usb0_function_global.c
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 : usb0_function_global.c
25 * $Rev: 1116 $
26 * $Date:: 2014-07-09 16:29:19 +0900#$
27 * Device(s) : RZ/A1H
28 * Tool-Chain :
29 * OS : None
30 * H/W Platform :
31 * Description : RZ/A1H R7S72100 USB Sample Program
32 * Operation :
33 * Limitations :
34 *******************************************************************************/
35
36
37 /*******************************************************************************
38 Includes <System Includes> , "Project Includes"
39 *******************************************************************************/
40 #include "usb0_function.h"
41
42
43 /*******************************************************************************
44 Typedef definitions
45 *******************************************************************************/
46
47
48 /*******************************************************************************
49 Macro definitions
50 *******************************************************************************/
51
52
53 /*******************************************************************************
54 Imported global variables and functions (from other files)
55 *******************************************************************************/
56
57
58 /*******************************************************************************
59 Exported global variables and functions (to be accessed by other files)
60 *******************************************************************************/
61
62
63 /*******************************************************************************
64 Private global variables and functions
65 *******************************************************************************/
66 const uint16_t g_usb0_function_bit_set[16] =
67 {
68 0x0001, 0x0002, 0x0004, 0x0008,
69 0x0010, 0x0020, 0x0040, 0x0080,
70 0x0100, 0x0200, 0x0400, 0x0800,
71 0x1000, 0x2000, 0x4000, 0x8000
72 };
73
74 uint32_t g_usb0_function_data_count[USB_FUNCTION_MAX_PIPE_NO + 1];
75 uint8_t * g_usb0_function_data_pointer[USB_FUNCTION_MAX_PIPE_NO + 1];
76
77 uint16_t g_usb0_function_PipeIgnore[USB_FUNCTION_MAX_PIPE_NO + 1];
78 uint16_t g_usb0_function_PipeTbl[USB_FUNCTION_MAX_PIPE_NO + 1];
79 uint16_t g_usb0_function_pipe_status[USB_FUNCTION_MAX_PIPE_NO + 1];
80 uint32_t g_usb0_function_PipeDataSize[USB_FUNCTION_MAX_PIPE_NO + 1];
81
82 USB_FUNCTION_DMA_t g_usb0_function_DmaInfo[2];
83 uint16_t g_usb0_function_DmaPipe[2];
84 uint16_t g_usb0_function_DmaBval[2];
85 uint16_t g_usb0_function_DmaStatus[2];
86
87 uint16_t g_usb0_function_CtrZeroLengthFlag;
88
89 //uint16_t g_usb0_function_ConfigNum;
90 //uint16_t g_usb0_function_Alternate[USB_FUNCTION_ALT_NO];
91 //uint16_t g_usb0_function_RemoteWakeupFlag;
92 uint16_t g_usb0_function_TestModeFlag;
93 uint16_t g_usb0_function_TestModeSelectors;
94
95 //uint16_t g_usb0_function_ReqType;
96 //uint16_t g_usb0_function_ReqTypeType;
97 //uint16_t g_usb0_function_ReqTypeRecip;
98 //uint16_t g_usb0_function_ReqRequest;
99 //uint16_t g_usb0_function_ReqValue;
100 //uint16_t g_usb0_function_ReqIndex;
101 //uint16_t g_usb0_function_ReqLength;
102
103 //uint16_t g_usb0_function_EPTableIndex[USB_FUNCTION_MAX_EP_NO + 1];
104
105 uint16_t g_usb0_function_pipecfg[USB_FUNCTION_MAX_PIPE_NO + 1];
106 uint16_t g_usb0_function_pipebuf[USB_FUNCTION_MAX_PIPE_NO + 1];
107 uint16_t g_usb0_function_pipemaxp[USB_FUNCTION_MAX_PIPE_NO + 1];
108 uint16_t g_usb0_function_pipeperi[USB_FUNCTION_MAX_PIPE_NO + 1];
109
110
111 /*******************************************************************************
112 * Function Name: usb0_function_init_status
113 * Description : Initialization USB Sample Driver Variable.
114 * Arguments : none
115 * Return Value : none
116 *******************************************************************************/
117 void usb0_function_init_status (void)
118 {
119 uint16_t pipe;
120
121 //g_usb0_function_ConfigNum = 0;
122 //g_usb0_function_RemoteWakeupFlag = DEVDRV_USBF_OFF;
123 g_usb0_function_TestModeFlag = DEVDRV_USBF_OFF;
124 g_usb0_function_CtrZeroLengthFlag = 0;
125
126 #if 0
127 usb0_function_clear_alt();
128 #endif
129
130 for (pipe = 0; pipe < (USB_FUNCTION_MAX_PIPE_NO + 1); ++pipe)
131 {
132 g_usb0_function_pipe_status[pipe] = DEVDRV_USBF_PIPE_IDLE;
133 g_usb0_function_PipeDataSize[pipe] = 0;
134 g_usb0_function_data_count[pipe] = 0;
135
136 /* pipe configuration in usb0_function_ResetEP() */
137 g_usb0_function_pipecfg[pipe] = 0;
138 g_usb0_function_pipebuf[pipe] = 0;
139 g_usb0_function_pipemaxp[pipe] = 0;
140 g_usb0_function_pipeperi[pipe] = 0;
141 }
142 }
143
144 /* End of File */
Imprint / Impressum