?? usbop.h
字號:
/*----------------------------------------------------------------------------
文 件:USB下載器USB通信類.
功 能:提供下載過程USB通信.
時 間:2008-2
百強(qiáng)電子世界網(wǎng)http://www.bqmcu.com.cn
飛雪浪子 QQ:570733482 jztdx@163.com
----------------------------------------------------------------------------*/
// USBOP.h: interface for the CUSBOP class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_USBOP_H__1160A1C7_6AF6_4B15_A091_316DB6090F4E__INCLUDED_)
#define AFX_USBOP_H__1160A1C7_6AF6_4B15_A091_316DB6090F4E__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "usb.h"
#define USBDEV_SHARED_VENDOR 0x16c0 /* VOTI */
#define USBDEV_SHARED_PRODUCT 0x05dc /* Obdev's free shared PID */
#define USB_ERROR_NOTFOUND 1
#define USB_ERROR_ACCESS 2
#define USB_ERROR_IO 3
#define USBASP_FUNC_CONNECT 1
#define USBASP_FUNC_DISCONNECT 2
#define USBASP_FUNC_TRANSMIT 3
#define USBASP_FUNC_READFLASH 4
#define USBASP_FUNC_ENABLEPROG 5
#define USBASP_FUNC_WRITEFLASH 6
#define USBASP_FUNC_READEEPROM 7
#define USBASP_FUNC_WRITEEEPROM 8
#define USBASP_FUNC_SPEED 9
#define USBASP_FUNC_UART 10
#define USBASP_FUNC_SETTING 11
#define PROG_STATE_IDLE 0
#define PROG_STATE_WRITEFLASH 1
#define PROG_STATE_READFLASH 2
#define PROG_STATE_READEEPROM 3
#define PROG_STATE_WRITEEEPROM 4
#define ISP_SCK_SLOW 0
#define ISP_SCK_FAST 1
#define USBASP_BLOCKFLAG_FIRST 1
#define USBASP_BLOCKFLAG_LAST 2
#define USBASP_READBLOCKSIZE 200
#define USBASP_WRITEBLOCKSIZE 200
class CUSBOP
{
public:
CUSBOP();
virtual ~CUSBOP();
public:
int usbaspOpen();
BOOL usbaspClose();
BOOL usbaspTransmit(unsigned char receive, unsigned char functionid,unsigned char send[4], unsigned char * buffer, int buffersize);
BOOL usbaspConnect();
BOOL usbaspDisconnect();
int usbaspInitialize();
BOOL usbaspEnterProMode();
unsigned char usbaspCheck(); //0 連接usb設(shè)備,其他沒有正常連接
BOOL usbaspEnable();
int usbaspCmd(unsigned char cmd[4], unsigned char res[4]);
int usbaspReceive(unsigned char *p);
int usbaspSetting(unsigned char p[4]);
BOOL mcuResert();
};
#endif // !defined(AFX_USBOP_H__1160A1C7_6AF6_4B15_A091_316DB6090F4E__INCLUDED_)
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -