📄 usb_libs.h
字号:
/**************** (c) 2000 STMicroelectronics *******************************
NAME: usb_libs.c
PROJECT: USB - ST7 FULL SPEED
VERSION: v 1.0
CREATION: 02/01/2002
AUTHOR: MICROCONTROLLER DIVISION / ST Rousset
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
Functions used inside the USB library
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
MODIFICATIONS:
******************************************************************************/
#ifndef USBLIBS_DEFINE_H
#define USBLIBS_DEFINE_H
#define SetBit(var, bit) var |= (1 << bit)
#define ClrBit(var, bit) var &= ~(1 << bit)
#define ValBit(var, bit) (var & (1 << bit))
/*_vUSB_StateMachine selector*/
#define WAIT_SETUP 0x00 // The USB cell is waiting for a SETUP on EP0
#define SETTING_UP 0x01 // The USB Cell is computing the SETUP request
#define IN_DATA 0x02 // Wait for a IN stage to send datas
#define OUT_DATA 0x03 // Wait for a OUT stage to receive datas
#define WAIT_STATUS_IN 0x04 // Wait for a IN status stage in to close the OUT data stage
#define WAIT_STATUS_OUT 0x05 // Wait for a OUT status stage in to close the IN data stage
#define ONE_MORE_IN 0x12 // Last DATA IN Transfer before STATUS OUT.
#define ONE_MORE_OUT 0x13 // Last DATA IN Transfer before STATUS OUT.
#define ADDRESS2SET 0x06 // Device address
#define STATE_ERROR 0x07 // Error on Request
#define MACHINESTATE 0x0F // STATE MACHINE STATUS MASK
#ifdef DECLARE_EP1
/*-----------------------------------------------------------------------------
ROUTINE NAME : USB_EP1_XEvent
DESCRIPTION : This function is called when there is a USB CTR on EP1 transmitter
-----------------------------------------------------------------------------*/
void _USB_EP1_XEvent(void);
#ifdef MCU_ST7265
/*-----------------------------------------------------------------------------
ROUTINE NAME : USB_EP1_REvent
DESCRIPTION : This function is called when there is a USB CTR on EP1 receiver
WARNING : This function may be called from interrupt routine
-----------------------------------------------------------------------------*/
void _USB_EP1_REvent(void);
#endif
#endif //DECLARE_EP1
#ifdef DECLARE_EP2
/*-----------------------------------------------------------------------------
ROUTINE NAME : USB_EP2_XEvent
DESCRIPTION : This function is called when there is a USB CTR on EP2 transmitter
-----------------------------------------------------------------------------*/
void _USB_EP2_XEvent(void);
/*-----------------------------------------------------------------------------
ROUTINE NAME : USB_EP2_REvent
DESCRIPTION : This function is called when there is a USB CTR on EP2 receiver
WARNING : This function may be called from interrupt routine
-----------------------------------------------------------------------------*/
void _USB_EP2_REvent(void);
#endif
#ifdef MCU_ST7SCR
#ifdef DECLARE_EP3
/*-----------------------------------------------------------------------------
ROUTINE NAME : USB_EP3_XEvent
DESCRIPTION : This function is called when there is a USB CTR on EP3 transmitter
-----------------------------------------------------------------------------*/
void _USB_EP3_XEvent(void);
#endif
#ifdef DECLARE_EP4
/*-----------------------------------------------------------------------------
ROUTINE NAME : USB_EP4_XEvent
DESCRIPTION : This function is called when there is a USB CTR on EP4 transmitter
-----------------------------------------------------------------------------*/
void _USB_EP4_XEvent(void);
#endif
#ifdef DECLARE_EP5
/*-----------------------------------------------------------------------------
ROUTINE NAME : USB_EP5_XEvent
DESCRIPTION : This function is called when there is a USB CTR on EP5 transmitter
-----------------------------------------------------------------------------*/
void _USB_EP5_XEvent(void);
#endif
#endif // MCU_ST7SCR
#endif // USBLIBS_DEFINE_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -