📄 armusb.h
字号:
/************************************************************************
*File : Armusb.h *
*By : hugang, hgx2000@mail.china.com *
************************************************************************/
#ifndef __ARMUSB_H__
#define __ARMUSB_H__
#include "44b0reg.h"
#include "usb.h"
#include "usbhal.h"
#include "usbd12.h"
#include "usb110.h"
#include "usbchap9.h"
#include "usbisr.h"
#include "usbmass.h"
/**************************************************************************/
/* macro */
/**************************************************************************/
#define MSB(x) (((x) >> 8) & 0xFF)
#define LSB(x) ((x) & 0xFF)
#ifndef FALSE
#define FALSE 0
#endif
#ifndef TRUE
#define TRUE (!FALSE)
#endif
#define true TRUE
#define false FALSE
//#define JINGZHUANG
#define USB_DISABLE_INTERRUPT rINTMSK = rINTMSK | BIT_EINT0
#define USB_ENABLE_INTERRUPT rINTMSK = rINTMSK & (~BIT_EINT0)
#ifdef JINGZHUANG
#define USB_D12_SUSPEND rPDATC |= 0x0800
#define USB_D12_COMMAND rPDATC |= 0x0400
#define USB_D12_DATA rPDATC &= 0xfbff
#define USB_D12_PORT (*(volatile unsigned char *)0x04000000)
#else
#define USB_D12_SUSPEND rPDATC |= 0x8000
#define USB_D12_CMDPROT (*(volatile unsigned char *)0x04000001)
#define USB_D12_DATAPROT (*(volatile unsigned char *)0x04000000)
#endif
#define DMA_IDLE 0
#define DMA_RUNNING 1
#define DMA_PENDING 2
#define USB_ISR_DEBUG 0
#define USB_SER_DEBUG 0
#define USB_SETUP_DEBUG 0
#define USB_CHAP9_DEBUG 0
#define USB_MASS_DEBUG 1
#define USB_EP0_DEBUG 0
#define USB_EP1_DEBUG 0
#define USB_EP2_DEBUG 0
#define DEBUGF(debug, x) do { if(debug){ DM_Printf x; } } while(0)
typedef union _ARMBOARD_FLAGS
{
struct _FLAGS
{
unsigned bTimer : 1;
unsigned bBus_Reset : 1;
unsigned bSuspend : 1;
unsigned bSetup_Packet : 1;
unsigned bRemote_Wakeup : 1;
unsigned bIn_ISR : 1;
unsigned bControl_State : 2;
unsigned bConfiguration : 1;
unsigned bVerbose : 1;
unsigned bCommand : 1;
unsigned bEP1_RxDone : 1;
unsigned bEP2_RxDone : 1;
unsigned bEP1Buf_Full : 1;
unsigned bEP2Buf_Full : 1;
unsigned bDMA_State : 2;
unsigned bSetup_DMA : 1;
unsigned bLED : 2; // Used for LED
unsigned bRead : 1; // TRUE = Read, FALSE = Write. Now this bit is not used, just reserved for future usage.
} bits;
unsigned short nValue;
} ARMUSBFLAGS;
#endif /*__ARMUSB_H__*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -