📄 usb_app.h
字号:
/**************** (c) 2000 STMicroelectronics *******************************
NAME: usb_app.h
PROJECT: USB - ST7 FULL SPEED
VERSION: v 1.0
CREATION: 04/01/2002
AUTHOR: MICROCONTROLLER DIVISION / ST Rousset
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
This header file defines all functions that user application provides
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
MODIFICATIONS :
******************************************************************************/
#include "usb_lib.h"
#ifndef DEFINE_USB_APP
#define DEFINE_USB_APP
typedef struct USB_Interface {
// Constant import from user code
char Num_Configuration; // number of configuration
char Num_Interface; // number of interface
char Num_Strings; // number of string descriptor
char Interrupt_Mask; // USB interrupt mask
// Application import from user code
char jp0; void (*Init_Application)( void );
// USB callback functions
char jp1; void (*USER_Setup)(void);
char jp2; void (*USER_CopydataIN)(unsigned char CopyLength);
char jp3; void (*USER_CopydataOUT)(unsigned char CopyLength);
char jp4; char (*USER_Set_Configuration)(void);
char jp5; char (*USER_Set_Interface)();
char jp6; char (*USER_Get_Interface)(); // return the alternate setting number.
char jp7; void (*USER_Status_In)(void);
char jp8; void (*USER_Status_Out)(void);
char jp9; void (*USER_Set_Feature_Int)(void);
char jpA; void (*USER_Set_Feature_EP)(void);
char jpB; void (*USER_Clear_Feature_Int)(void);
char jpC; void (*USER_Clear_Feature_EP)(void);
} USB_INTERFACE;
typedef struct USB_Int_Interface {
// USB callback functions from interrupt routine
char jp1; void (*USER_Reset)(void);
char jp2; void (*USER_Suspend)(void);
char jp3; void (*USER_ESuspend)(void);
char jp4; void (*USER_SOF)(void);
} USB_INT_INTERFACE;
#pragma INTO_ROM
extern const USB_INTERFACE UI; // It is must be in the ROM
#pragma INTO_ROM
extern const USB_INT_INTERFACE UIT; // It is must be in the ROM
// Macro for calling user functions
#define USER(func) asm CALL UI.func:-1
#define USERIT(func) asm CALL UIT.func:-1
#endif // DEFINE_USB_APP
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -