⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 usb.h

📁 Cypress cy7c63318 鼠标开发板的源代码
💻 H
字号:
//*****************************************************************************
//*****************************************************************************
//  FILENAME: USB.h
//   Version: 1.5.0.1, Updated on 2005/08/17 at 15:01:28
//  Generated by PSoC Designer ver 4.2  b1013 : 02 September, 2004
//
//  DESCRIPTION: USB User Module C Language interface file
//               for the enCoRe II family of devices
//-----------------------------------------------------------------------------
//  Copyright (c) Cypress Semiconductor 2004. All Rights Reserved.
//*****************************************************************************
//*****************************************************************************

#include <m8c.h>

//-------------------------------------------------
// USB Device type support for the USB API.
//-------------------------------------------------

//-------------------------------------------------
// fastcall16 qualifiers for the USB API.
//-------------------------------------------------
#pragma fastcall16 USB_Start
#pragma fastcall16 USB_Stop
#pragma fastcall16 USB_bCheckActivity
#pragma fastcall16 USB_bGetConfiguration
#pragma fastcall16 USB_bGetEPState
#pragma fastcall16 USB_bGetEPCount
#pragma fastcall16 USB_XLoadEP
#pragma fastcall16 USB_EnableOutEP
#pragma fastcall16 USB_DisableOutEP
#pragma fastcall16 USB_EnableEP
#pragma fastcall16 USB_DisableEP
#pragma fastcall16 USB_Force
#pragma fastcall16 USB_Suspend
#pragma fastcall16 USB_Resume
#pragma fastcall16 USB_bRWUEnabled

//-------------------------------------------------
// fastcall16 qualifiers for the HID Class API.
//-------------------------------------------------
#pragma fastcall16 USB_UpdateHIDTimer
#pragma fastcall16 USB_bGetProtocol

//-------------------------------------------------
// Prototypes of the USB API.
//-------------------------------------------------
extern void USB_Start(BYTE);
extern void USB_Stop(void);
extern BYTE USB_bCheckActivity(void);
extern BYTE USB_bGetConfiguration(void);
extern BYTE USB_bGetEPState(BYTE);
extern BYTE USB_bGetEPCount(BYTE);
extern void USB_XLoadEP(BYTE*);
extern void USB_EnableOutEP(BYTE);
extern void USB_DisableOutEP(BYTE);
extern void USB_EnableEP(BYTE);
extern void USB_DisableEP(BYTE);
extern void USB_Force(BYTE);
extern void USB_Suspend(void);
extern void USB_Resume(void);
extern BYTE USB_bRWUEnabled(void);

//-------------------------------------------------
// HID Class Prototypes of the USB API.
//-------------------------------------------------
extern BYTE USB_UpdateHIDTimer(BYTE);
extern BYTE USB_bGetProtocol(BYTE);

//-------------------------------------------------
// Constants for USB API's.
//-------------------------------------------------
#define NO_EVENT_ALLOWED               2
#define EVENT_PENDING                  1
#define NO_EVENT_PENDING               0

#define IN_BUFFER_FULL                 NO_EVENT_PENDING
#define IN_BUFFER_EMPTY                EVENT_PENDING
#define OUT_BUFFER_FULL                EVENT_PENDING
#define OUT_BUFFER_EMPTY               NO_EVENT_PENDING

#define USB_FORCE_J                    0x02
#define USB_FORCE_K                    0x01
#define USB_FORCE_SE0                  0x00
#define USB_FORCE_NONE                 0xFF

#define USB_IDLE_TIMER_RUNNING         0x02
#define USB_IDLE_TIMER_EXPIRED         0x01
#define USB_IDLE_TIMER_INDEFINITE      0x00

//-----------------------------------------------
// Transfer Completion Notification
//-----------------------------------------------
#define USB_XFER_IDLE                       0x00
#define USB_XFER_STATUS_ACK                 0x01
#define USB_XFER_PREMATURE                  0x02
#define USB_XFER_ERROR                      0x03

typedef struct {
    BYTE bStatus;
    WORD wLength;  
} T_USB_XFER_STATUS_BLOCK;

//-------------------------------------------------
// USB Global helper variables for speed
//-------------------------------------------------
extern BYTE USB_APIEPNumber;
extern BYTE USB_APICount;

//-------------------------------------------------
// USB Macro 'Functions'
//-------------------------------------------------
#define USB_LoadEP(ep,s,c)    \
    USB_APIEPNumber = ep;     \
    USB_APICount = c;         \
    USB_XLoadEP(s)

// end of file USB.h

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -