1 /******************** (C) COPYRIGHT 2009 STMicroelectronics ********************
2 * File Name          : usb_init.c
3 * Author             : MCD Application Team
4 * Version            : V3.1.0
5 * Date               : 10/30/2009
6 * Description        : Initialization routines & global variables
7 ********************************************************************************
8 * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
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 FIRMWARE 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 
19 /* Private typedef -----------------------------------------------------------*/
20 /* Private define ------------------------------------------------------------*/
21 /* Private macro -------------------------------------------------------------*/
22 /* Private variables ---------------------------------------------------------*/
23 /*  The number of current endpoint, it will be used to specify an endpoint */
24  uint8_t	EPindex;
25 /*  The number of current device, it is an index to the Device_Table */
26 /* uint8_t	Device_no; */
27 /*  Points to the DEVICE_INFO structure of current device */
28 /*  The purpose of this register is to speed up the execution */
29 DEVICE_INFO *pInformation;
30 /*  Points to the DEVICE_PROP structure of current device */
31 /*  The purpose of this register is to speed up the execution */
32 DEVICE_PROP *pProperty;
33 /*  Temporary save the state of Rx & Tx status. */
34 /*  Whenever the Rx or Tx state is changed, its value is saved */
35 /*  in this variable first and will be set to the EPRB or EPRA */
36 /*  at the end of interrupt process */
37 uint16_t	SaveState ;
38 uint16_t  wInterrupt_Mask;
39 DEVICE_INFO	Device_Info;
40 USER_STANDARD_REQUESTS  *pUser_Standard_Requests;
41 
42 /* Extern variables ----------------------------------------------------------*/
43 /* Private function prototypes -----------------------------------------------*/
44 /* Private functions ---------------------------------------------------------*/
45 
46 /*******************************************************************************
47 * Function Name  : USB_Init
48 * Description    : USB system initialization
49 * Input          : None.
50 * Output         : None.
51 * Return         : None.
52 *******************************************************************************/
USB_Init(void)53 void USB_Init(void)
54 {
55   pInformation = &Device_Info;
56   pInformation->ControlState = 2;
57   pProperty = &Device_Property;
58   pUser_Standard_Requests = &User_Standard_Requests;
59   /* Initialize devices one by one */
60   pProperty->Init();
61 }
62 
63 /******************* (C) COPYRIGHT 2009 STMicroelectronics *****END OF FILE****/
64