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().
2109

被折叠的 条评论
为什么被折叠?



