summaryrefslogtreecommitdiffstats
path: root/uc_str912/prj_blinky_complex_startup/src/usb_init.c
diff options
context:
space:
mode:
authorBert Lange <b.lange@fzd.de>2011-11-07 15:41:50 +0100
committerBert Lange <b.lange@fzd.de>2011-11-07 15:41:50 +0100
commitd190f1c37139ec38667a3d6e566dbe1b0549f84d (patch)
tree7885f39318cb7852afc24992dd08cb6bb953ac03 /uc_str912/prj_blinky_complex_startup/src/usb_init.c
parentacc2681723f43b3c8ccb29055bec9d63cb863c78 (diff)
downloadzpu-d190f1c37139ec38667a3d6e566dbe1b0549f84d.zip
zpu-d190f1c37139ec38667a3d6e566dbe1b0549f84d.tar.gz
initial commit
Diffstat (limited to 'uc_str912/prj_blinky_complex_startup/src/usb_init.c')
-rw-r--r--uc_str912/prj_blinky_complex_startup/src/usb_init.c64
1 files changed, 64 insertions, 0 deletions
diff --git a/uc_str912/prj_blinky_complex_startup/src/usb_init.c b/uc_str912/prj_blinky_complex_startup/src/usb_init.c
new file mode 100644
index 0000000..0580c26
--- /dev/null
+++ b/uc_str912/prj_blinky_complex_startup/src/usb_init.c
@@ -0,0 +1,64 @@
+/******************** (C) COPYRIGHT 2006 STMicroelectronics ********************
+* File Name : usb_init.c
+* Author : MCD Application Team
+* Date First Issued : 05/18/2006 : Version 1.0
+* Description : initialization routines & global variables
+********************************************************************************
+* History:
+* 05/24/2006 : Version 1.1
+* 05/18/2006 : Version 1.0
+********************************************************************************
+* THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH
+* CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. AS
+* A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT
+* OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT
+* OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION
+* CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
+*******************************************************************************/
+#include "91x_lib.h"
+#include "USB_lib.h"
+
+/* Save token on endpoint 0 */
+ BYTE EP0_Token ;
+
+/* Interrupt flags. */
+/* Each bit represents an interrupt is coming to that endpoint */
+ WORD Token_Event ;
+
+/* The number of current endpoint, it will be used to specify an endpoint */
+ BYTE EPindex;
+
+/* Points to the DEVICE_INFO structure of current device */
+/* The purpose of this register is to speed up the execution */
+DEVICE_INFO *pInformation;
+
+/* Points to the DEVICE_PROP structure of current device */
+/* The purpose of this register is to speed up the execution */
+DEVICE_PROP *pProperty;
+
+/* Temporary save the state of Rx & Tx status. */
+/* Whenever the Rx or Tx state is changed, its value is saved */
+/* in this variable first and will be set to the EPRB or EPRA */
+/* at the end of interrupt process */
+ WORD SaveState ;
+
+ WORD wInterrupt_Mask;
+
+ DEVICE_INFO Device_Info;
+
+/*==========================================================================*/
+/* USB system initialization */
+/*==========================================================================*/
+void USB_Init()
+{
+ SetCNTR(0x0003);
+ Token_Event = 0; /* Flags of each endpoint interrupt */
+ pInformation = &Device_Info;
+ pInformation->ControlState = 2;
+ pProperty = &Device_Property;
+ /* Initialize devices one by one */
+ pProperty->Init();
+
+} /* USB_Init() */
+
+/*==========================================================================*/
OpenPOWER on IntegriCloud