📄 usb_pre.h
字号:
#ifndef __USB_USER_PRE_H
#define __USB_USER_PRE_H
#include "usb.h"
//-----------------------------------------------------------------------
#define FUSB200_MAX_EP 10 // 1..10
#define FUSB200_MAX_FIFO 10 // 0.. 9
#define EP0MAXPACKETSIZE 0x40
// #define EP0FIFOSIZE 64 // EP0_FIFO
// Max. Packet Size define
#define MX_PA_SZ_8 8
#define MX_PA_SZ_16 16
#define MX_PA_SZ_32 32
#define MX_PA_SZ_64 64
#define MX_PA_SZ_128 128
#define MX_PA_SZ_256 256
#define MX_PA_SZ_512 512
#define MX_PA_SZ_1024 1024
#define MASK_F0 0xF0
// Block Size define
#define BLK512BYTE 1
#define BLK1024BYTE 2
#define BLK64BYTE 1
#define BLK128BYTE 2
// Block toggle number define
#define SINGLE_BLK 1
#define DOUBLE_BLK 2
#define TRIBLE_BLK 3
// Endpoint transfer type
#define TF_TYPE_CONTROL 0
#define TF_TYPE_ISOCHRONOUS 1
#define TF_TYPE_BULK 2
#define TF_TYPE_INTERRUPT 3
// Endpoint or FIFO direction define
#define DIRECTION_IN 1
#define DIRECTION_OUT 0
// FIFO number define
#define FIFO0 0x0
#define FIFO1 0x1
#define FIFO2 0x2
#define FIFO3 0x3
#define FIFO4 0x4
#define FIFO5 0x5
#define FIFO6 0x6
#define FIFO7 0x7
#define FIFO8 0x8
#define FIFO9 0x9
// Descriptor Table uses the following parameters : fixed
#define DEVICE_LENGTH 0x12
#define CONFIG_LENGTH 0x09
#define INTERFACE_LENGTH 0x09
#define EP_LENGTH 0x07
#define DEVICE_QUALIFIER_LENGTH 0x0A
// Endpoint number define
#define EP0 0x00
#define EP1 0x01
#define EP2 0x02
#define EP3 0x03
#define EP4 0x04
#define EP5 0x05
#define EP6 0x06
#define EP7 0x07
#define EP8 0x08
#define EP9 0x09
#define EP10 0x10
#define EP11 0x11
#define EP12 0x12
#define EP13 0x13
#define EP14 0x14
#define EP15 0x15
#define STRING_00_LENGTH 0x04
#define STRING_10_LENGTH 0x32
#define STRING_20_LENGTH 0x10
#define STRING_30_LENGTH 0x2e
#define STRING_40_LENGTH 0x26
#define STRING_50_LENGTH 0x10
#define STRING_60_LENGTH 0x1e
#define STRING_70_LENGTH 0x10
#define STRING_80_LENGTH 0x0e
#define STRING_90_LENGTH 0x00
#endif /* __USB_USER_PRE_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -