|
Packit |
7488c9 |
#ifndef __ezusb_H
|
|
Packit |
7488c9 |
#define __ezusb_H
|
|
Packit |
7488c9 |
/*
|
|
Packit |
7488c9 |
* Copyright (c) 2001 Stephen Williams (steve@icarus.com)
|
|
Packit |
7488c9 |
* Copyright (c) 2002 David Brownell (dbrownell@users.sourceforge.net)
|
|
Packit |
7488c9 |
*
|
|
Packit |
7488c9 |
* This source code is free software; you can redistribute it
|
|
Packit |
7488c9 |
* and/or modify it in source code form under the terms of the GNU
|
|
Packit |
7488c9 |
* General Public License as published by the Free Software
|
|
Packit |
7488c9 |
* Foundation; either version 2 of the License, or (at your option)
|
|
Packit |
7488c9 |
* any later version.
|
|
Packit |
7488c9 |
*
|
|
Packit |
7488c9 |
* This program is distributed in the hope that it will be useful,
|
|
Packit |
7488c9 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
7488c9 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
Packit |
7488c9 |
* GNU General Public License for more details.
|
|
Packit |
7488c9 |
*
|
|
Packit |
7488c9 |
* You should have received a copy of the GNU General Public License
|
|
Packit |
7488c9 |
* along with this program; if not, write to the Free Software
|
|
Packit |
7488c9 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
|
Packit |
7488c9 |
*/
|
|
Packit |
7488c9 |
#ident "$Id: ezusb.h,v 1.4 2008/10/13 21:25:29 dbrownell Exp $"
|
|
Packit |
7488c9 |
|
|
Packit |
7488c9 |
|
|
Packit |
7488c9 |
/*
|
|
Packit |
7488c9 |
* This function loads the firmware from the given file into RAM.
|
|
Packit |
7488c9 |
* The file is assumed to be in Intel HEX format. If fx2 is set, uses
|
|
Packit |
7488c9 |
* appropriate reset commands. Stage == 0 means this is a single stage
|
|
Packit |
7488c9 |
* load (or the first of two stages). Otherwise it's the second of
|
|
Packit |
7488c9 |
* two stages; the caller preloaded the second stage loader.
|
|
Packit |
7488c9 |
*
|
|
Packit |
7488c9 |
* The target processor is reset at the end of this download.
|
|
Packit |
7488c9 |
*/
|
|
Packit |
7488c9 |
extern int ezusb_load_ram (int dev, const char *path, int fx2, int stage);
|
|
Packit |
7488c9 |
|
|
Packit |
7488c9 |
|
|
Packit |
7488c9 |
/*
|
|
Packit |
7488c9 |
* This function stores the firmware from the given file into EEPROM.
|
|
Packit |
7488c9 |
* The file is assumed to be in Intel HEX format. This uses the right
|
|
Packit |
7488c9 |
* CPUCS address to terminate the EEPROM load with a reset command,
|
|
Packit |
7488c9 |
* where FX parts behave differently than FX2 ones. The configuration
|
|
Packit |
7488c9 |
* byte is as provided here (zero for an21xx parts) and the EEPROM
|
|
Packit |
7488c9 |
* type is set so that the microcontroller will boot from it.
|
|
Packit |
7488c9 |
*
|
|
Packit |
7488c9 |
* The caller must have preloaded a second stage loader that knows
|
|
Packit |
7488c9 |
* how to respond to the EEPROM write request.
|
|
Packit |
7488c9 |
*/
|
|
Packit |
7488c9 |
extern int ezusb_load_eeprom (
|
|
Packit |
7488c9 |
int dev, /* usbfs device handle */
|
|
Packit |
7488c9 |
const char *path, /* path to hexfile */
|
|
Packit |
7488c9 |
const char *type, /* fx, fx2, an21 */
|
|
Packit |
7488c9 |
int config /* config byte for fx/fx2; else zero */
|
|
Packit |
7488c9 |
);
|
|
Packit |
7488c9 |
|
|
Packit |
7488c9 |
|
|
Packit |
7488c9 |
/* boolean flag, says whether to write extra messages to stderr */
|
|
Packit |
7488c9 |
extern int verbose;
|
|
Packit |
7488c9 |
|
|
Packit |
7488c9 |
|
|
Packit |
7488c9 |
/*
|
|
Packit |
7488c9 |
* $Log: ezusb.h,v $
|
|
Packit |
7488c9 |
* Revision 1.4 2008/10/13 21:25:29 dbrownell
|
|
Packit |
7488c9 |
* Whitespace fixes.
|
|
Packit |
7488c9 |
*
|
|
Packit |
7488c9 |
* Revision 1.3 2002/04/12 00:28:21 dbrownell
|
|
Packit |
7488c9 |
* support "-t an21" to program EEPROMs for those microcontrollers
|
|
Packit |
7488c9 |
*
|
|
Packit |
7488c9 |
* Revision 1.2 2002/02/26 19:55:05 dbrownell
|
|
Packit |
7488c9 |
* 2nd stage loader support
|
|
Packit |
7488c9 |
*
|
|
Packit |
7488c9 |
* Revision 1.1 2001/06/12 00:00:50 stevewilliams
|
|
Packit |
7488c9 |
* Added the fxload program.
|
|
Packit |
7488c9 |
* Rework root makefile and hotplug.spec to install in prefix
|
|
Packit |
7488c9 |
* location without need of spec file for install.
|
|
Packit |
7488c9 |
*
|
|
Packit |
7488c9 |
*/
|
|
Packit |
7488c9 |
#endif
|