/tags/V0.24b/usbinc/usb_conf.h |
---|
0,0 → 1,101 |
/******************** (C) COPYRIGHT 2008 STMicroelectronics ******************** |
* File Name : usb_conf.h |
* Author : MCD Application Team |
* Version : V2.0.0 |
* Date : 09/29/2008 |
* Description : Virtual Com Port Demo configuration file |
******************************************************************************** |
* THE PRESENT FIRMWARE 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. |
*******************************************************************************/ |
#ifndef __USB_CONF_H |
#define __USB_CONF_H |
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ |
/*-------------------------------------------------------------*/ |
/* define the µC and the Bufferd Mode */ |
/*-------------------------------------------------------------*/ |
//#define STR7xx /*STR7 family*/ |
//#define STR71x /* STR71x µCs*/ |
#define STR91x /*STR91x Family*/ |
#define STR91x_USB_BUFFERED /* Buffered Mode*/ |
//#define STR91x_USB_NON_BUFFERED /*Non buffered mode*/ |
/*-------------------------------------------------------------*/ |
/* EP_NUM */ |
/* defines how many endpoints are used by the device */ |
/*-------------------------------------------------------------*/ |
#define EP_NUM (4) |
/*-------------------------------------------------------------*/ |
/* -------------- Buffer Description Table -----------------*/ |
/*-------------------------------------------------------------*/ |
/* buffer table base address */ |
/* buffer table base address */ |
#define BTABLE_ADDRESS (0x00) |
/* EP0 */ |
/* rx/tx buffer base address */ |
#define ENDP0_RXADDR (0x118) |
#define ENDP0_TXADDR (0x158) |
/* EP1 */ |
/* tx buffer base address */ |
#define ENDP1_TXADDR (0x200) |
#define ENDP2_TXADDR (0x240) |
#define ENDP3_RXADDR (0x250) |
/* ISTR events */ |
/* IMR_MSK */ |
/* mask defining which events has to be handled */ |
/* by the device application software */ |
#define IMR_MSK (CNTR_CTRM | \ |
CNTR_WKUPM | \ |
CNTR_SUSPM | \ |
CNTR_ERRM | \ |
CNTR_SOFM | \ |
CNTR_ESOFM | \ |
CNTR_RESETM \ |
) |
/* CTR service routines */ |
/* associated to defined endpoints */ |
//#define EP1_IN_Callback NOP_Process |
#define EP2_IN_Callback NOP_Process |
#define EP3_IN_Callback NOP_Process |
#define EP4_IN_Callback NOP_Process |
#define EP5_IN_Callback NOP_Process |
#define EP6_IN_Callback NOP_Process |
#define EP7_IN_Callback NOP_Process |
#define EP8_IN_Callback NOP_Process |
#define EP9_IN_Callback NOP_Process |
#define EP10_IN_Callback NOP_Process |
#define EP11_IN_Callback NOP_Process |
#define EP12_IN_Callback NOP_Process |
#define EP13_IN_Callback NOP_Process |
#define EP14_IN_Callback NOP_Process |
#define EP15_IN_Callback NOP_Process |
#define EP1_OUT_Callback NOP_Process |
#define EP2_OUT_Callback NOP_Process |
//#define EP3_OUT_Callback NOP_Process |
#define EP4_OUT_Callback NOP_Process |
#define EP5_OUT_Callback NOP_Process |
#define EP6_OUT_Callback NOP_Process |
#define EP7_OUT_Callback NOP_Process |
#define EP8_OUT_Callback NOP_Process |
#define EP9_OUT_Callback NOP_Process |
#define EP10_OUT_Callback NOP_Process |
#define EP11_OUT_Callback NOP_Process |
#define EP12_OUT_Callback NOP_Process |
#define EP13_OUT_Callback NOP_Process |
#define EP14_OUT_Callback NOP_Process |
#define EP15_OUT_Callback NOP_Process |
#endif /*__USB_CONF_H*/ |
/******************* (C) COPYRIGHT 2008 STMicroelectronics *****END OF FILE****/ |
/tags/V0.24b/usbinc/usb_desc.h |
---|
0,0 → 1,55 |
/******************** (C) COPYRIGHT 2008 STMicroelectronics ******************** |
* File Name : usb_desc.h |
* Author : MCD Application Team |
* Version : V2.0.0 |
* Date : 09/29/2008 |
* Description : Descriptor Header for Virtual Com Port Demo |
******************************************************************************** |
* THE PRESENT FIRMWARE 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. |
*******************************************************************************/ |
/* Define to prevent recursive inclusion -------------------------------------*/ |
#ifndef __USB_DESC_H |
#define __USB_DESC_H |
/* Includes ------------------------------------------------------------------*/ |
/* Exported types ------------------------------------------------------------*/ |
/* Exported constants --------------------------------------------------------*/ |
/* Exported macro ------------------------------------------------------------*/ |
/* Exported define -----------------------------------------------------------*/ |
#define USB_DEVICE_DESCRIPTOR_TYPE 0x01 |
#define USB_CONFIGURATION_DESCRIPTOR_TYPE 0x02 |
#define USB_STRING_DESCRIPTOR_TYPE 0x03 |
#define USB_INTERFACE_DESCRIPTOR_TYPE 0x04 |
#define USB_ENDPOINT_DESCRIPTOR_TYPE 0x05 |
#define VIRTUAL_COM_PORT_DATA_SIZE 64 |
#define VIRTUAL_COM_PORT_INT_SIZE 8 |
#define VIRTUAL_COM_PORT_SIZ_DEVICE_DESC 18 |
#define VIRTUAL_COM_PORT_SIZ_CONFIG_DESC 67 |
#define VIRTUAL_COM_PORT_SIZ_STRING_LANGID 4 |
#define VIRTUAL_COM_PORT_SIZ_STRING_VENDOR 38 |
#define VIRTUAL_COM_PORT_SIZ_STRING_PRODUCT 60 |
#define VIRTUAL_COM_PORT_SIZ_STRING_SERIAL 22 |
#define STANDARD_ENDPOINT_DESC_SIZE 0x09 |
/* Exported functions ------------------------------------------------------- */ |
extern const u8 Virtual_Com_Port_DeviceDescriptor[VIRTUAL_COM_PORT_SIZ_DEVICE_DESC]; |
extern const u8 Virtual_Com_Port_ConfigDescriptor[VIRTUAL_COM_PORT_SIZ_CONFIG_DESC]; |
extern const u8 Virtual_Com_Port_StringLangID[VIRTUAL_COM_PORT_SIZ_STRING_LANGID]; |
extern const u8 Virtual_Com_Port_StringVendor[VIRTUAL_COM_PORT_SIZ_STRING_VENDOR]; |
extern const u8 Virtual_Com_Port_StringProduct[VIRTUAL_COM_PORT_SIZ_STRING_PRODUCT]; |
extern const u8 Virtual_Com_Port_StringSerial[VIRTUAL_COM_PORT_SIZ_STRING_SERIAL]; |
#endif /* __USB_DESC_H */ |
/******************* (C) COPYRIGHT 2008 STMicroelectronics *****END OF FILE****/ |
/tags/V0.24b/usbinc/usb_prop.h |
---|
0,0 → 1,73 |
/******************** (C) COPYRIGHT 2008 STMicroelectronics ******************** |
* File Name : usb_prop.h |
* Author : MCD Application Team |
* Version : V2.0.0 |
* Date : 09/29/2008 |
* Description : All processings related to Virtual Com Port Demo |
******************************************************************************** |
* THE PRESENT FIRMWARE 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. |
*******************************************************************************/ |
/* Define to prevent recursive inclusion -------------------------------------*/ |
#ifndef __USB_PROP_H |
#define __USB_PROP_H |
/* Includes ------------------------------------------------------------------*/ |
/* Exported types ------------------------------------------------------------*/ |
/* Exported constants --------------------------------------------------------*/ |
/* Exported macro ------------------------------------------------------------*/ |
/* Exported functions ------------------------------------------------------- */ |
void Virtual_Com_Port_init(void); |
void Virtual_Com_Port_Reset(void); |
void Virtual_Com_Port_SetConfiguration(void); |
void Virtual_Com_Port_SetDeviceAddress (void); |
void Virtual_Com_Port_Status_In (void); |
void Virtual_Com_Port_Status_Out (void); |
RESULT Virtual_Com_Port_Data_Setup(u8); |
RESULT Virtual_Com_Port_NoData_Setup(u8); |
RESULT Virtual_Com_Port_Get_Interface_Setting(u8 Interface, u8 AlternateSetting); |
u8 *Virtual_Com_Port_GetDeviceDescriptor(u16 ); |
u8 *Virtual_Com_Port_GetConfigDescriptor(u16); |
u8 *Virtual_Com_Port_GetStringDescriptor(u16); |
u8 *Virtual_Com_Port_GetLineCoding(u16 Length); |
u8 *Virtual_Com_Port_SetLineCoding(u16 Length); |
/* Exported define -----------------------------------------------------------*/ |
typedef struct |
{ |
u32 bitrate; |
u8 format; |
u8 paritytype; |
u8 datatype; |
} |
LINE_CODING; |
#define Virtual_Com_Port_GetConfiguration NOP_Process |
//#define Virtual_Com_Port_SetConfiguration NOP_Process |
#define Virtual_Com_Port_GetInterface NOP_Process |
#define Virtual_Com_Port_SetInterface NOP_Process |
#define Virtual_Com_Port_GetStatus NOP_Process |
#define Virtual_Com_Port_ClearFeature NOP_Process |
#define Virtual_Com_Port_SetEndPointFeature NOP_Process |
#define Virtual_Com_Port_SetDeviceFeature NOP_Process |
//#define Virtual_Com_Port_SetDeviceAddress NOP_Process |
#define SEND_ENCAPSULATED_COMMAND 0x00 |
#define GET_ENCAPSULATED_RESPONSE 0x01 |
#define SET_COMM_FEATURE 0x02 |
#define GET_COMM_FEATURE 0x03 |
#define CLEAR_COMM_FEATURE 0x04 |
#define SET_LINE_CODING 0x20 |
#define GET_LINE_CODING 0x21 |
#define SET_CONTROL_LINE_STATE 0x22 |
#define SEND_BREAK 0x23 |
#endif /* __USB_PROP_H */ |
/******************* (C) COPYRIGHT 2008 STMicroelectronics *****END OF FILE****/ |
/tags/V0.24b/usbinc/usb_pwr.h |
---|
0,0 → 1,59 |
/******************** (C) COPYRIGHT 2008 STMicroelectronics ******************** |
* File Name : usb_pwr.h |
* Author : MCD Application Team |
* Version : V2.0.0 |
* Date : 09/29/2008 |
* Description : Connection/disconnection & power management header |
******************************************************************************** |
* THE PRESENT FIRMWARE 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. |
*******************************************************************************/ |
/* Define to prevent recursive inclusion -------------------------------------*/ |
#ifndef __USB_PWR_H |
#define __USB_PWR_H |
/* Includes ------------------------------------------------------------------*/ |
/* Exported types ------------------------------------------------------------*/ |
typedef enum _RESUME_STATE |
{ |
RESUME_EXTERNAL, |
RESUME_INTERNAL, |
RESUME_LATER, |
RESUME_WAIT, |
RESUME_START, |
RESUME_ON, |
RESUME_OFF, |
RESUME_ESOF |
} RESUME_STATE; |
typedef enum _DEVICE_STATE |
{ |
UNCONNECTED, |
ATTACHED, |
POWERED, |
SUSPENDED, |
ADDRESSED, |
CONFIGURED |
} DEVICE_STATE; |
/* Exported constants --------------------------------------------------------*/ |
/* Exported macro ------------------------------------------------------------*/ |
/* Exported functions ------------------------------------------------------- */ |
void Suspend(void); |
void Resume_Init(void); |
void Resume(RESUME_STATE eResumeSetVal); |
RESULT PowerOn(void); |
RESULT PowerOff(void); |
/* External variables --------------------------------------------------------*/ |
extern vu32 bDeviceState; /* USB device status */ |
extern volatile bool fSuspendEnabled; /* true when suspend is possible */ |
#endif /*__USB_PWR_H*/ |
/******************* (C) COPYRIGHT 2008 STMicroelectronics *****END OF FILE****/ |