EzUSB 类 参考

EzUSB user-level program upload facility.
#include

Inheritance diagram for EzUSB:

 

Collaboration diagram for EzUSB:

 

Public Methods
  EzUSB (const char *filename=NULL)
  EzUSB constructor. More...


virtual  ~EzUSB ()
  EzUSB destructor. More...


virtual void  forceClose (void)
  Reset the UBS device. Must be called when an OS asyncronous event (like SIGTERM) is caught.


void  parseCmdLine (int argc, char *argv[])
  Parse command line and extract options. More...


bool  findDevice (void)
  Find the device, return false if device can't be found. More...


bool  downloadFirmware (const char *firmware)
  Download the firmware to the device. More...

 


Protected Methods
int  read_head (FILE *fh, struct intels **doutp)
  Read Intel hex file.


int  shunt (usb_dev_handle *pdev, int at, void *d, int len)
  Send a control message.

 


Protected Attributes
usb_dev_handle *  devHandle
  USB device Handle, used for device access.


int  idVendor
  Vendor identifier.


int  idProduct
  Product identifier.


char  filename [1024]
  Filename to open.


EzUSB::intels  intels
  Internal structure for hex file.

 

--------------------------------------------------------------------------------

Detailed Description
EzUSB user-level program upload facility.
This class provide all necessary facilities to upload a program into the EzUSB microcontroller. It is purely user space so no kernel driver is needed. It relays on the libusb that hide kernel's USB ioctl.


Definition at line 41 of file ezusb_loader.h.


--------------------------------------------------------------------------------

Constructor & Destructor Documentation
EzUSB::EzUSB  (  const char *    filename = NULL  )  
 
   EzUSB constructor.


Parameters:
filename  the firmware to load into the EzUSB device 

Definition at line 77 of file ezusb_loader.cpp.

References devHandle, filename, idProduct, and idVendor.
 


EzUSB::~EzUSB  (     )  [virtual]
 
   EzUSB destructor.

close the handle to the device

Definition at line 91 of file ezusb_loader.cpp.

References forceClose().
 

 

--------------------------------------------------------------------------------

Member Function Documentation
bool EzUSB::downloadFirmware  (  const char *    firmware  )  
 
   Download the firmware to the device.


Returns:
true if the firmware has sucessfully been downloaded into the EzUSB device, false otherwise.
Parameters:
firmware  the hex file containing the firmware. Will be overriden if the option -f is provided and parsed by parseCmdLine 

Definition at line 195 of file ezusb_loader.cpp.

References EzUSB::intels::addr, EzUSB::intels::data, devHandle, filename, EzUSB::intels::len, EzUSB::intels::nxt, read_head(), and shunt().

Referenced by EzUSBJTAG::init().
 


bool EzUSB::findDevice  (  void     )  
 
   Find the device, return false if device can't be found.


Returns:
true if device is found, false otherwise.
Definition at line 150 of file ezusb_loader.cpp.

References devHandle, idProduct, and idVendor.

Referenced by EzUSBJTAG::init().
 


void EzUSB::parseCmdLine  (  int    argc, 
  char *    argv[]
 )  
 
   Parse command line and extract options.


Parameters:
argc  number of command line argument 
argv  array of char* that contains the arguments 

Returns:
nothing.
Definition at line 108 of file ezusb_loader.cpp.

References filename, idProduct, and idVendor.

Referenced by EzUSBJTAG::init().

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值