diff options
author | Tomek CEDRO <cederom@tlen.pl> | 2011-06-16 05:11:26 +0000 |
---|---|---|
committer | Tomek CEDRO <cederom@tlen.pl> | 2011-06-16 05:11:26 +0000 |
commit | 3bb38c315653476ac92d4eed300e1bd0b58745db (patch) | |
tree | a8b0f1205962ddc2b0dbd56704fb714744738d17 /src/interface/interface.h | |
parent | c8b57198025c414f8d19577e6846021843c2a751 (diff) | |
download | openocd+libswd-3bb38c315653476ac92d4eed300e1bd0b58745db.tar.gz openocd+libswd-3bb38c315653476ac92d4eed300e1bd0b58745db.tar.bz2 openocd+libswd-3bb38c315653476ac92d4eed300e1bd0b58745db.tar.xz openocd+libswd-3bb38c315653476ac92d4eed300e1bd0b58745db.zip |
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.
Diffstat (limited to 'src/interface/interface.h')
-rw-r--r-- | src/interface/interface.h | 52 |
1 files changed, 52 insertions, 0 deletions
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 <cederom@tlen.pl> + * + * 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 |