FX2LP_8051 Class Reference

Class to access the FX2 microcontroller. More...

#include <usbp_fx2lp_8051.h>

Inheritance diagram for FX2LP_8051:

iUSB_Device

Public Member Functions

 FX2LP_8051 ()
 FX2LP_8051 (iUSB_Driver *ud)
virtual ~FX2LP_8051 ()
void setUSB (iUSB_Driver *ud)
int downloadFirmware (string file, int vid, int pid)
 Read in the configuration file and download it to the embedded microcontroller.
int LED (int led, bool on_off)
 Change the LEDs connected to the FX2s IO ports.
int i2c_write (byte addr, byte *b, byte len)
 I2C write.

Data Fields

iUSB_DriverUsbD
 Pointer to the USB interface.

Detailed Description

Class to access the FX2 microcontroller.

Definition at line 38 of file usbp_fx2lp_8051.h.


Constructor & Destructor Documentation

FX2LP_8051::FX2LP_8051 (  )  [inline]

Definition at line 49 of file usbp_fx2lp_8051.h.

FX2LP_8051::FX2LP_8051 ( iUSB_Driver ud  )  [inline]

Definition at line 50 of file usbp_fx2lp_8051.h.

References UsbD.

virtual FX2LP_8051::~FX2LP_8051 (  )  [inline, virtual]

Definition at line 51 of file usbp_fx2lp_8051.h.

References UsbD.


Member Function Documentation

void FX2LP_8051::setUSB ( iUSB_Driver ud  )  [inline, virtual]

Implements iUSB_Device.

Definition at line 53 of file usbp_fx2lp_8051.h.

References UsbD.

int FX2LP_8051::downloadFirmware ( string  file,
int  vid,
int  pid 
) [virtual]

Read in the configuration file and download it to the embedded microcontroller.

The FX2 8051 code is written to memory via a set of vendor specific commands

<

Todo:
stdio??

Todo:
add readback to verify

If Fimrware has been loaded successfully, need to re-enumerate with the new VID/PID

Implements iUSB_Device.

Definition at line 71 of file usbp_fx2lp_8051.cpp.

References iUSB_Driver::deviceOpen(), CConfigFiles::ihxAddress, CConfigFiles::ihxClose(), CConfigFiles::ihxLen, CConfigFiles::ihxOpen(), CConfigFiles::ihxRead(), CConfigFiles::ihxType, CConfigFiles::MAX_IHX_RECORD_LEN, UPL_ERR, UPL_OK, and UsbD.

int FX2LP_8051::LED ( int  led,
bool  on_off 
) [virtual]

Change the LEDs connected to the FX2s IO ports.

Implements iUSB_Device.

Definition at line 46 of file usbp_fx2lp_8051.cpp.

References iUSB_Driver::controlWrite(), UPL_OK, and UsbD.

int FX2LP_8051::i2c_write ( byte  addr,
byte b,
byte  len 
) [virtual]

I2C write.

Implements iUSB_Device.

Definition at line 198 of file usbp_fx2lp_8051.cpp.

References iUSB_Driver::controlWrite(), UPL_OK, and UsbD.


Field Documentation

iUSB_Driver* FX2LP_8051::UsbD

Pointer to the USB interface.

Definition at line 47 of file usbp_fx2lp_8051.h.

Referenced by downloadFirmware(), FX2LP_8051(), i2c_write(), LED(), setUSB(), and ~FX2LP_8051().


The documentation for this class was generated from the following files:
Generated on Mon Mar 5 20:44:21 2007 for usbp by  doxygen 1.5.1-p1