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