2006-11-22 07:03:10 -06:00
|
|
|
/***************************************************************************
|
|
|
|
* Copyright (C) 2006 by Dominic Rath *
|
|
|
|
* Dominic.Rath@gmx.de *
|
|
|
|
* *
|
|
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or *
|
|
|
|
* (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
* This program is distributed in the hope that it will be useful, *
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
* GNU General Public License for more details. *
|
|
|
|
* *
|
|
|
|
* You should have received a copy of the GNU General Public License *
|
2016-05-16 15:41:00 -05:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
2006-11-22 07:03:10 -06:00
|
|
|
***************************************************************************/
|
2012-01-27 10:45:29 -06:00
|
|
|
|
2015-09-21 14:07:46 -05:00
|
|
|
#ifndef OPENOCD_PLD_PLD_H
|
|
|
|
#define OPENOCD_PLD_PLD_H
|
2006-11-22 07:03:10 -06:00
|
|
|
|
2009-12-03 06:14:25 -06:00
|
|
|
#include <helper/command.h>
|
2006-11-22 07:03:10 -06:00
|
|
|
|
2009-11-13 10:15:00 -06:00
|
|
|
struct pld_device;
|
2006-11-22 07:03:10 -06:00
|
|
|
|
2009-11-10 03:21:29 -06:00
|
|
|
#define __PLD_DEVICE_COMMAND(name) \
|
2012-01-27 10:45:29 -06:00
|
|
|
COMMAND_HELPER(name, struct pld_device *pld)
|
2009-11-10 03:21:29 -06:00
|
|
|
|
2012-01-27 10:45:29 -06:00
|
|
|
struct pld_driver {
|
2010-12-29 15:07:21 -06:00
|
|
|
const char *name;
|
2009-11-10 03:21:29 -06:00
|
|
|
__PLD_DEVICE_COMMAND((*pld_device_command));
|
2009-11-23 11:30:02 -06:00
|
|
|
const struct command_registration *commands;
|
2009-11-13 10:15:00 -06:00
|
|
|
int (*load)(struct pld_device *pld_device, const char *filename);
|
2009-11-13 10:14:52 -06:00
|
|
|
};
|
2006-11-22 07:03:10 -06:00
|
|
|
|
2012-01-27 10:45:29 -06:00
|
|
|
#define PLD_DEVICE_COMMAND_HANDLER(name) \
|
|
|
|
static __PLD_DEVICE_COMMAND(name)
|
2009-11-10 03:21:29 -06:00
|
|
|
|
2012-01-27 10:45:29 -06:00
|
|
|
struct pld_device {
|
2009-11-13 10:14:52 -06:00
|
|
|
struct pld_driver *driver;
|
2006-11-22 07:03:10 -06:00
|
|
|
void *driver_priv;
|
2009-11-13 10:15:00 -06:00
|
|
|
struct pld_device *next;
|
|
|
|
};
|
2006-11-22 07:03:10 -06:00
|
|
|
|
2009-11-13 15:25:47 -06:00
|
|
|
int pld_register_commands(struct command_context *cmd_ctx);
|
2009-11-09 05:38:34 -06:00
|
|
|
|
2009-11-13 10:15:00 -06:00
|
|
|
struct pld_device *get_pld_device_by_num(int num);
|
2006-11-22 07:03:10 -06:00
|
|
|
|
2012-01-27 10:45:29 -06:00
|
|
|
#define ERROR_PLD_DEVICE_INVALID (-1000)
|
|
|
|
#define ERROR_PLD_FILE_LOAD_FAILED (-1001)
|
2006-11-22 07:03:10 -06:00
|
|
|
|
2015-09-21 14:07:46 -05:00
|
|
|
#endif /* OPENOCD_PLD_PLD_H */
|