OpenOCD
pld.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 /***************************************************************************
4  * Copyright (C) 2006 by Dominic Rath *
5  * Dominic.Rath@gmx.de *
6  ***************************************************************************/
7 
8 #ifndef OPENOCD_PLD_PLD_H
9 #define OPENOCD_PLD_PLD_H
10 
11 #include <helper/command.h>
12 
13 struct pld_device;
14 
15 #define __PLD_DEVICE_COMMAND(name) \
16  COMMAND_HELPER(name, struct pld_device *pld)
17 
18 struct pld_driver {
19  const char *name;
20  __PLD_DEVICE_COMMAND((*pld_device_command));
22  int (*load)(struct pld_device *pld_device, const char *filename);
23 };
24 
25 #define PLD_DEVICE_COMMAND_HANDLER(name) \
26  static __PLD_DEVICE_COMMAND(name)
27 
28 struct pld_device {
29  struct pld_driver *driver;
30  void *driver_priv;
31  struct pld_device *next;
32 };
33 
34 int pld_register_commands(struct command_context *cmd_ctx);
35 
36 struct pld_device *get_pld_device_by_num(int num);
37 
38 #define ERROR_PLD_DEVICE_INVALID (-1000)
39 #define ERROR_PLD_FILE_LOAD_FAILED (-1001)
40 
41 #endif /* OPENOCD_PLD_PLD_H */
struct pld_device * get_pld_device_by_num(int num)
Definition: pld.c:29
int pld_register_commands(struct command_context *cmd_ctx)
Definition: pld.c:225
Definition: pld.h:28
void * driver_priv
Definition: pld.h:30
struct pld_device * next
Definition: pld.h:31
struct pld_driver * driver
Definition: pld.h:29
Definition: pld.h:18
__PLD_DEVICE_COMMAND((*pld_device_command))
int(* load)(struct pld_device *pld_device, const char *filename)
Definition: pld.h:22
const char * name
Definition: pld.h:19
const struct command_registration * commands
Definition: pld.h:21