📄 ui.c
字号:
/**************** (c) 2000 STMicroelectronics *******************************
NAME: ui.c
PROJECT: Sample user code for ST7 USB Full Speed library
VERSION: v 1.0
CREATION: 04/01/2002
AUTHOR: MICROCONTROLLER DIVISION / ST Rousset
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
This is the interface between USB library and the user applicaton
For the sake of DFU, USB library will be in sector 0
and UI will be in another secotr
WARNING:
Do not modify the line order in this file, it is important for the library
to find out what it wants.
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
MODIFICATIONS :
******************************************************************************/
#include "usb_reg.h"
#include "usb_app.h"
#include "appli.h"
#include "descript.h"
// USB callback functions
extern void (*USER_USB_Reset)(void);
extern void (*USER_USB_Suspend)(void);
extern void (*USER_USB_ESuspend)(void);
extern void (*USER_USB_SOF)(void);
extern void (*USER_USB_Setup)(void);
extern void (*USER_USB_CopydataIN)(unsigned char Length);
extern void (*USER_USB_CopydataOUT)(unsigned char Length);
extern char (*USER_USB_Set_Configuration)(void);
extern char (*USER_USB_Set_Interface)();
extern char (*USER_USB_Get_Interface)(); // return the alternate setting number.
extern void (*USER_USB_Status_In)(void);
extern void (*USER_USB_Status_Out)(void);
extern void (*USER_USB_Set_Feature_Int)(void);
extern void (*USER_USB_Set_Feature_EP)(void);
extern void (*USER_USB_Clear_Feature_Int)(void);
extern void (*USER_USB_Clear_Feature_EP)(void);
#pragma DATA_SEG DEFAULT_RAM
ONE_DESCRIPTOR DeviceDescriptor;
extern unsigned char Serial_Number[66];
// Export the USB interface
#pragma CONST_SEG UI_TABLE
const USB_INTERFACE UI = {
MAX_NUM_CONFIG,
MAX_NUM_INTERFACE,
NUM_STRING_DESC,
INT_MASK,
0xCC, USER_init,
0xCC, USER_USB_Setup,
0xCC, USER_USB_CopydataIN,
0xCC, USER_USB_CopydataOUT,
0xCC, USER_USB_Set_Configuration,
0xCC, USER_USB_Set_Interface,
0xCC, USER_USB_Get_Interface,
0xCC, USER_USB_Status_In,
0xCC, USER_USB_Status_Out,
0xCC, USER_USB_Set_Feature_Int,
0xCC, USER_USB_Set_Feature_EP,
0xCC, USER_USB_Clear_Feature_Int,
0xCC, USER_USB_Clear_Feature_EP
};
const USB_INT_INTERFACE UIT = {
0xCC, USER_USB_Reset,
0xCC, USER_USB_Suspend,
0xCC, USER_USB_ESuspend,
0xCC, USER_USB_SOF
};
/*
const ONE_DESCRIPTOR DeviceDescriptor = {
(char*) Appli_DeviceDescriptor0,
SIZE_DEVICE_DESC
};
*/
const ONE_DESCRIPTOR ConfigDescriptor[1] = {
(char*) Appli_ConfigDescriptor,
SIZE_CONFIG_DESC // sizeof(Sample_ConfigurationDescriptor)
};
const ONE_DESCRIPTOR StringDescriptor[NUM_STRING_DESC] = {
{ Appli_StringDescriptor, SIZE_STRING_DESCRIPTOR },
{ Appli_StringVendor, SIZE_STRING_VENDOR },
{ Appli_StringProduct, SIZE_STRING_PRODUCT },
// { Appli_StringSerial, SIZE_STRING_SERIAL },
{ Serial_Number, SIZE_STRING_SERIAL },
{ Appli_StringInterface, SIZE_STRING_INTERFACE }
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -