Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

EzUSB Class Reference

EzUSB user-level program upload facility. More...

#include <ezusb_loader.h>

Inheritance diagram for EzUSB:

Inheritance graph
[legend]
Collaboration diagram for EzUSB:

Collaboration graph
[legend]
List of all members.

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


The documentation for this class was generated from the following files:
Generated on Fri May 16 13:01:49 2003 for Jelie by doxygen1.2.15