#include <ezusb_loader.h>
Inheritance 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. |
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.
|
EzUSB constructor.
Definition at line 77 of file ezusb_loader.cpp. |
|
EzUSB destructor. close the handle to the device Definition at line 91 of file ezusb_loader.cpp. References forceClose(). |
|
Download the firmware to the device.
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(). |
|
Find the device, return false if device can't be found.
Definition at line 150 of file ezusb_loader.cpp. References devHandle, idProduct, and idVendor. Referenced by EzUSBJTAG::init(). |
|
Parse command line and extract options.
Definition at line 108 of file ezusb_loader.cpp. References filename, idProduct, and idVendor. Referenced by EzUSBJTAG::init(). |