Sergey Pastor / grbl
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers usb_init.c Source File

usb_init.c

00001 /******************** (C) COPYRIGHT 2010 STMicroelectronics ********************
00002 * File Name          : usb_init.c
00003 * Author             : MCD Application Team
00004 * Version            : V3.2.1
00005 * Date               : 07/05/2010
00006 * Description        : Initialization routines & global variables
00007 ********************************************************************************
00008 * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
00009 * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
00010 * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
00011 * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
00012 * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
00013 * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
00014 *******************************************************************************/
00015 
00016 /* Includes ------------------------------------------------------------------*/
00017 #include "usb_lib.h"
00018 
00019 /* Private typedef -----------------------------------------------------------*/
00020 /* Private define ------------------------------------------------------------*/
00021 /* Private macro -------------------------------------------------------------*/
00022 /* Private variables ---------------------------------------------------------*/
00023 /*  The number of current endpoint, it will be used to specify an endpoint */
00024  uint8_t    EPindex;
00025 /*  The number of current device, it is an index to the Device_Table */
00026 /* uint8_t  Device_no; */
00027 /*  Points to the DEVICE_INFO structure of current device */
00028 /*  The purpose of this register is to speed up the execution */
00029 DEVICE_INFO *pInformation;
00030 /*  Points to the DEVICE_PROP structure of current device */
00031 /*  The purpose of this register is to speed up the execution */
00032 DEVICE_PROP *pProperty;
00033 /*  Temporary save the state of Rx & Tx status. */
00034 /*  Whenever the Rx or Tx state is changed, its value is saved */
00035 /*  in this variable first and will be set to the EPRB or EPRA */
00036 /*  at the end of interrupt process */
00037 uint16_t    SaveState ;
00038 uint16_t  wInterrupt_Mask;
00039 DEVICE_INFO Device_Info;
00040 USER_STANDARD_REQUESTS  *pUser_Standard_Requests;
00041 
00042 /* Extern variables ----------------------------------------------------------*/
00043 /* Private function prototypes -----------------------------------------------*/
00044 /* Private functions ---------------------------------------------------------*/
00045 
00046 /*******************************************************************************
00047 * Function Name  : USB_Init
00048 * Description    : USB system initialization
00049 * Input          : None.
00050 * Output         : None.
00051 * Return         : None.
00052 *******************************************************************************/
00053 void USB_Init(void)
00054 {
00055   pInformation = &Device_Info;
00056   pInformation->ControlState = 2;
00057   pProperty = &Device_Property;
00058   pUser_Standard_Requests = &User_Standard_Requests;
00059   /* Initialize devices one by one */
00060   pProperty->Init();
00061 }
00062 
00063 /******************* (C) COPYRIGHT 2010 STMicroelectronics *****END OF FILE****/