1 /*******************************************************************************
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
20 * http://www.renesas.com/disclaimer
21 * Copyright (C) 2012 - 2014 Renesas Electronics Corporation. All rights reserved.
22 *******************************************************************************/
23 /*******************************************************************************
24 * File Name : usb1_function_global.c
26 * $Date:: 2014-07-09 16:29:19 +0900#$
31 * Description : RZ/A1H R7S72100 USB Sample Program
34 *******************************************************************************/
37 /*******************************************************************************
38 Includes <System Includes> , "Project Includes"
39 *******************************************************************************/
40 #include "usb1_function.h"
43 /*******************************************************************************
45 *******************************************************************************/
48 /*******************************************************************************
50 *******************************************************************************/
53 /*******************************************************************************
54 Imported global variables and functions (from other files)
55 *******************************************************************************/
58 /*******************************************************************************
59 Exported global variables and functions (to be accessed by other files)
60 *******************************************************************************/
63 /*******************************************************************************
64 Private global variables and functions
65 *******************************************************************************/
66 const uint16_t g_usb1_function_bit_set
[16] =
68 0x0001, 0x0002, 0x0004, 0x0008,
69 0x0010, 0x0020, 0x0040, 0x0080,
70 0x0100, 0x0200, 0x0400, 0x0800,
71 0x1000, 0x2000, 0x4000, 0x8000
74 uint32_t g_usb1_function_data_count
[USB_FUNCTION_MAX_PIPE_NO
+ 1];
75 uint8_t * g_usb1_function_data_pointer
[USB_FUNCTION_MAX_PIPE_NO
+ 1];
77 uint16_t g_usb1_function_PipeIgnore
[USB_FUNCTION_MAX_PIPE_NO
+ 1];
78 uint16_t g_usb1_function_PipeTbl
[USB_FUNCTION_MAX_PIPE_NO
+ 1];
79 uint16_t g_usb1_function_pipe_status
[USB_FUNCTION_MAX_PIPE_NO
+ 1];
80 uint32_t g_usb1_function_PipeDataSize
[USB_FUNCTION_MAX_PIPE_NO
+ 1];
82 USB_FUNCTION_DMA_t g_usb1_function_DmaInfo
[2];
83 uint16_t g_usb1_function_DmaPipe
[2];
84 uint16_t g_usb1_function_DmaBval
[2];
85 uint16_t g_usb1_function_DmaStatus
[2];
87 uint16_t g_usb1_function_CtrZeroLengthFlag
;
89 //uint16_t g_usb1_function_ConfigNum;
90 //uint16_t g_usb1_function_Alternate[USB_FUNCTION_ALT_NO];
91 //uint16_t g_usb1_function_RemoteWakeupFlag;
92 uint16_t g_usb1_function_TestModeFlag
;
93 uint16_t g_usb1_function_TestModeSelectors
;
95 //uint16_t g_usb1_function_ReqType;
96 //uint16_t g_usb1_function_ReqTypeType;
97 //uint16_t g_usb1_function_ReqTypeRecip;
98 //uint16_t g_usb1_function_ReqRequest;
99 //uint16_t g_usb1_function_ReqValue;
100 //uint16_t g_usb1_function_ReqIndex;
101 //uint16_t g_usb1_function_ReqLength;
103 //uint16_t g_usb1_function_EPTableIndex[USB_FUNCTION_MAX_EP_NO + 1];
105 uint16_t g_usb1_function_pipecfg
[USB_FUNCTION_MAX_PIPE_NO
+ 1];
106 uint16_t g_usb1_function_pipebuf
[USB_FUNCTION_MAX_PIPE_NO
+ 1];
107 uint16_t g_usb1_function_pipemaxp
[USB_FUNCTION_MAX_PIPE_NO
+ 1];
108 uint16_t g_usb1_function_pipeperi
[USB_FUNCTION_MAX_PIPE_NO
+ 1];
111 /*******************************************************************************
112 * Function Name: usb1_function_init_status
113 * Description : Initialization USB Sample Driver Variable.
115 * Return Value : none
116 *******************************************************************************/
117 void usb1_function_init_status (void)
121 //g_usb1_function_ConfigNum = 0;
122 //g_usb1_function_RemoteWakeupFlag = DEVDRV_USBF_OFF;
123 g_usb1_function_TestModeFlag
= DEVDRV_USBF_OFF
;
124 g_usb1_function_CtrZeroLengthFlag
= 0;
127 usb1_function_clear_alt();
130 for (pipe
= 0; pipe
< (USB_FUNCTION_MAX_PIPE_NO
+ 1); ++pipe
)
132 g_usb1_function_pipe_status
[pipe
] = DEVDRV_USBF_PIPE_IDLE
;
133 g_usb1_function_PipeDataSize
[pipe
] = 0;
134 g_usb1_function_data_count
[pipe
] = 0;
136 /* pipe configuration in usb1_function_ResetEP() */
137 g_usb1_function_pipecfg
[pipe
] = 0;
138 g_usb1_function_pipebuf
[pipe
] = 0;
139 g_usb1_function_pipemaxp
[pipe
] = 0;
140 g_usb1_function_pipeperi
[pipe
] = 0;