From 3bb38c315653476ac92d4eed300e1bd0b58745db Mon Sep 17 00:00:00 2001 From: Tomek CEDRO Date: Thu, 16 Jun 2011 05:11:26 +0000 Subject: INTERFACE: Adding new place for generic interface driver and routines in src/interface. Adding interface signal definitions and routines. Adding bitbang functionality that works on signals. --- src/interface/interface.h | 52 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 src/interface/interface.h (limited to 'src/interface/interface.h') diff --git a/src/interface/interface.h b/src/interface/interface.h new file mode 100644 index 00000000..36fbe1dd --- /dev/null +++ b/src/interface/interface.h @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2011 Tomasz Boleslaw CEDRO + * + * 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 + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + + +// THIS FILE IS UNUSABLE AT THE MOMENT BUT WILL BE USED AS GENERIC OPENOCD DRIVER STRUCTURE + +#ifndef OOCD_INTERFACE_H +#define OOCD_INTERFACE_H + +/** Some generic interface signal definitions. */ + +/// Interface Signal type declaration (single linked list element). +typedef struct oocd_interface_signal { + /// Signal name string. + char *name; + /// Mask value for selected signal. + unsigned int mask; + /// Value can be 0,1, or -1 for unknown state. + int value; + /// Pointer to the next element on the signals list. + struct oocd_interface_signal *next; +} oocd_interface_signal_t; + +typedef enum oocd_interface_operation { + UNDEFINED = 0, + READ, + WRITE, + SET, + CLEAR +} oocd_interface_operation_t; + +int oocd_interface_signal_add(char *name, unsigned int mask); +int oocd_interface_signal_del(char *name); +oocd_interface_signal_t *oocd_interface_signal_find(char *name); + +#endif -- cgit v1.2.3