📄 stdusb.h
字号:
/************************************************************************/
/* STDUSB.H */
/* */
/* Project : USB SAMPLE-BULK */
/* : */
/* Data : 2004.05.26 */
/* */
/* Memo : USB device sample-firmware for LC87F1564 */
/* */
/* Copyrigth(c) 2004 SANYO Electric Co., Ltd. All Rights Reserved. */
/************************************************************************/
/*-------------------------------------------------------------------
USB device state definition
-------------------------------------------------------------------*/
#define POWERED_STATE 0x01
#define DEFAULT_STATE 0x03
#define ADDRESSED_STATE 0x07
#define CONFIGURED_STATE 0x0f
/*-------------------------------------------------------------------
Endpoint state definition
"Endpoint_State_Table"
-------------------------------------------------------------------*/
#define DISABLE 0x00
#define SETUP_READY 0x01
#define C_READ 0x02
#define C_READ_END 0x03
#define C_WRITE 0x04
#define C_WRITE_END 0x05
#define C_NO_DATA 0x06
#define C_ADDR 0x07
#define DATA_IN 0x08
#define DATA_OUT 0x09
#define C_AC_SET 0x20 // Set Feature AudioControl
#define ERROR 0xff
/*-------------------------------------------------------------------
USB device state bit definition
-------------------------------------------------------------------*/
#define POWERED 0
#define DEFAULT 1
#define ADDRESSED 2
#define CONFIGURED 3
#define SUSPENDED 4
/*-------------------------------------------------------------------
Ohters' substitution
-------------------------------------------------------------------*/
//#define FALSE 0
//#define TRUE 1
#define EMPTY 0
#define FULL 1
/*-------------------------------------------------------------------
Standard Request Codes
"Universal Serial Bus Specification Revision 1.1" at page 187
----------------------+-------+--------+-----------------------------
bRequest value
----------------------+-------+--------+---------------------------*/
#define GET_STATUS 0x00
#define CLEAR_FEATURE 0x01
#define SET_FEATURE 0x03
#define SET_ADDRESS 0x05
#define GET_DESCRIPTOR 0x06
#define SET_DESCRIPTOR 0x07
#define GET_CONFIGURATION 0x08
#define SET_CONFIGURATION 0x09
#define GET_INTERFACE 0x0a
#define SET_INTERFACE 0x0b
#define SYNCH_FRAME 0x0c
/*-------------------------------------------------------------------
Descriptor Types
"Universal Serial Bus Specification Revision 1.1" at page 187
----------------------+-------+--------+-----------------------------
wValue_H value
----------------------+-------+--------+---------------------------*/
#define DEVICE 0x01
#define CONFIGURATION 0x02
#define STRING 0x03
#define INTERFACE 0x04
#define ENDPOINT 0x05
/*-------------------------------------------------------------------
Feature Selector
"Universal Serial Bus Specification Revision 1.1" at page 188
----------------------+-------+--------+-----------------------------
wValue_L value
----------------------+-------+--------+---------------------------*/
#define DEVICE_REMOTE_WAKEUP 0x01
#define ENDPOINT_HALT 0x00
/*-------------------------------------------------------------------
Transfer Type
"Universal Serial Bus Specification Revision 1.1" at page 204
-------------------------------------------------------------------*/
#define CONTROL 0x00
#define ISOCHRONOUS 0x01
#define BULK 0x02
#define INTERRUPT 0x03
/*-------------------------------------------------------------------
Token Code
-------------------------------------------------------------------*/
#define SETUP_CODE 0x03
#define OUT_CODE 0x00
#define IN_CODE 0x02
#define SOF_CODE 0x01
/*-------------------------------------------------------------------
峔憿懱
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -