Rev 1 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1 | Rev 196 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | /******************** (C) COPYRIGHT 2006 STMicroelectronics ******************** |
1 | /******************** (C) COPYRIGHT 2008 STMicroelectronics ******************** |
2 | * File Name : usb_init.c |
2 | * File Name : usb_init.c |
3 | * Author : MCD Application Team |
3 | * Author : MCD Application Team |
- | 4 | * Version : V4.0.0 |
|
4 | * Date First Issued : 10/27/2003 : V1.0 |
5 | * Date : 09/29/2008 |
5 | * Description : Initialization routines & global variables |
6 | * Description : Initialization routines & global variables. |
6 | ******************************************************************************** |
7 | ******************************************************************************** |
7 | * History: |
- | |
8 | * 09/18/2006 : V3.0 |
- | |
9 | * 09/01/2006 : V2.0 |
- | |
10 | * 10/27/2003 : V1.0 |
- | |
11 | ******************************************************************************** |
- | |
12 | * THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS |
8 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS |
13 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. |
9 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. |
14 | * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, |
10 | * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, |
15 | * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE |
11 | * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE |
16 | * CONTENT OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING |
12 | * CONTENT OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING |
17 | * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. |
13 | * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. |
Line 23... | Line 19... | ||
23 | /* Private define ------------------------------------------------------------*/ |
19 | /* Private define ------------------------------------------------------------*/ |
24 | /* Private macro -------------------------------------------------------------*/ |
20 | /* Private macro -------------------------------------------------------------*/ |
25 | /* Private variables ---------------------------------------------------------*/ |
21 | /* Private variables ---------------------------------------------------------*/ |
Line 26... | Line 22... | ||
26 | 22 | ||
27 | /* The number of current endpoint, it will be used to specify an endpoint */ |
23 | /* The number of current endpoint, it will be used to specify an endpoint */ |
- | 24 | u8 EPindex; |
|
28 | u8 EPindex; |
25 | |
29 | /* The number of current device, it is an index to the Device_Table */ |
26 | /* The number of current device, it is an index to the Device_Table */ |
30 | /* u8 Device_no; */ |
27 | /* u8 Device_no; */ |
31 | /* Points to the DEVICE_INFO structure of current device */ |
28 | /* Points to the DEVICE_INFO structure of current device */ |
32 | /* The purpose of this register is to speed up the execution */ |
29 | /* The purpose of this register is to speed up the execution */ |
- | 30 | DEVICE_INFO *pInformation; |
|
33 | DEVICE_INFO *pInformation; |
31 | |
34 | /* Points to the DEVICE_PROP structure of current device */ |
32 | /* Points to the DEVICE_PROP structure of current device */ |
35 | /* The purpose of this register is to speed up the execution */ |
33 | /* The purpose of this register is to speed up the execution */ |
- | 34 | DEVICE_PROP *pProperty; |
|
36 | DEVICE_PROP *pProperty; |
35 | |
37 | /* Temporary save the state of Rx & Tx status. */ |
36 | /* Temporary save the state of Rx & Tx status. */ |
38 | /* Whenever the Rx or Tx state is changed, its value is saved */ |
37 | /* Whenever the Rx or Tx state is changed, its value is saved */ |
39 | /* in this variable first and will be set to the EPRB or EPRA */ |
38 | /* in this variable first and will be set to the EPRB or EPRA */ |
40 | /* at the end of interrupt process */ |
39 | /* at the end of interrupt process */ |
41 | u16 SaveState ; |
40 | u16 SaveState ; |
42 | u16 wInterrupt_Mask; |
41 | u16 wInterrupt_Mask; |
43 | DEVICE_INFO Device_Info; |
- | |
44 | 42 | DEVICE_INFO Device_Info; |
|
45 | USER_STANDARD_REQUESTS *pUser_Standard_Requests; |
- | |
46 | /* Extern variables ----------------------------------------------------------*/ |
43 | USER_STANDARD_REQUESTS *pUser_Standard_Requests; |
47 | /* Private function prototypes -----------------------------------------------*/ |
44 | /* Private function prototypes -----------------------------------------------*/ |
Line 48... | Line 45... | ||
48 | /* Private functions ---------------------------------------------------------*/ |
45 | /* Private functions ---------------------------------------------------------*/ |
49 | 46 | ||
50 | /******************************************************************************* |
47 | /******************************************************************************* |
51 | * Function Name : USB_Init |
48 | * Function Name : USB_Init |
52 | * Description : USB system initialization |
49 | * Description : USB system initialization |
53 | * Input : |
50 | * Input : None. |
54 | * Output : |
51 | * Output : None. |
55 | * Return : |
52 | * Return : None. |
56 | *******************************************************************************/ |
53 | *******************************************************************************/ |
57 | void USB_Init(void) |
54 | void USB_Init(void) |
58 | { |
55 | { |
59 | pInformation = &Device_Info; |
56 | pInformation = &Device_Info; |
60 | pInformation->ControlState = 2; |
57 | pInformation->ControlState = 2; |
61 | pProperty = &Device_Property; |
58 | pProperty = &Device_Property; |
62 | pUser_Standard_Requests = &User_Standard_Requests; |
59 | pUser_Standard_Requests = &User_Standard_Requests; |
63 | /* Initialize devices one by one */ |
60 | /* Initialize devices one by one */ |
64 | pProperty->Init(); |
61 | pProperty->Init(); |