📄 fucdlayer.h
字号:
#ifndef __FUCDLAYER_H__#define __FUCDLAYER_H__#include <wx/wx.h>#include "dfu.h"#include "atmel.h"class UsbDevInfo { private: wxString *_name; struct usb_device *_device; usb_dev_handle *_handle; int _devnum; public: UsbDevInfo(struct usb_device *dev, int devnum); wxString *GetName() { return _name; }; void Prepare(); void Close(); usb_dev_handle *GetHandle() { return _handle; };};class FucdLayer { protected: wxString filename; int n_devices; int _activedev; UsbDevInfo *devinfos[MAX_DEVICES]; unsigned char **firmware; unsigned int fwsize; unsigned char _opermode; public: FucdLayer(); void SetFilename(const wxString fname); bool FindDevices(); unsigned int GetFwSize() { return fwsize; }; unsigned char ** GetFw() { return firmware; }; void GetDevNames(wxChoice* choice); void Prepare(); int GetActive() { return (_activedev < n_devices ? _activedev: -1 ); }; void SetActive(int active) { _activedev=active; }; void Close(); public: // PORTED FUCTIONS // ***** atmel.c ***** bool AtmelFirmwareUpgrade(wxGauge*); bool ReadFirmware(); int DownloadFirmware(); bool AtmelGetFwVersion(wxString &ver); bool AtmelGetModeOfOperation(); // ***** dfu.c ***** int DFUDetach(); int DFUDownload(usb_dev_handle *dev, char *Buffer, unsigned long Bytes, unsigned short Block); int DFUGetStatus(usb_dev_handle * dev, struct dfu_status *status); unsigned char DFUGetState(usb_dev_handle * dev, char *state); int DeviceFirmwareUpgrade(int idVendor, int idProduct); protected: // internal functions void _init_usb_subsystem();};#endif // __FUCDLAYER_H__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -