summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt2
-rw-r--r--apps/pio_test.c3
-rw-r--r--dma/ipe.c1
-rw-r--r--dma/ipe.h2
-rw-r--r--dma/nwl.c1
-rw-r--r--docs/Doxyfile.in2313
-rw-r--r--pcilib/bank.h9
-rw-r--r--pcilib/bar.c120
-rw-r--r--pcilib/bar.h66
-rw-r--r--pcilib/event.c16
-rw-r--r--pcilib/event.h6
-rw-r--r--pcilib/export.c17
-rw-r--r--pcilib/export.h5
-rw-r--r--pcilib/lock.h4
-rw-r--r--pcilib/locking.h2
-rw-r--r--pcilib/pci.c124
-rw-r--r--pcilib/pcilib.h1164
-rw-r--r--pcilib/property.c20
-rw-r--r--pcilib/property.h23
-rw-r--r--pcilib/register.c20
-rw-r--r--pcilib/unit.h39
-rw-r--r--pcilib/xml.c6
-rw-r--r--pcilib/xml.h46
-rw-r--r--pcitool/cli.c37
-rw-r--r--protocols/default.c1
-rw-r--r--protocols/property.c18
26 files changed, 3654 insertions, 411 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0c9df71..0a938a3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,6 +4,8 @@ set(PCILIB_VERSION "0.2.3")
set(PCILIB_ABI_VERSION "2")
cmake_minimum_required(VERSION 2.6)
+#set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH true)
+#set(CMAKE_PREFIX_PATH ${CMAKE_SYSTEM_PREFIX_PATH})
set(DISABLE_PCITOOL FALSE CACHE BOOL "Build only the library")
diff --git a/apps/pio_test.c b/apps/pio_test.c
index f211bf1..f2b73f7 100644
--- a/apps/pio_test.c
+++ b/apps/pio_test.c
@@ -60,7 +60,7 @@ int main(int argc, char *argv[]) {
exit(1);
}
- bar = pcilib_map_bar(pci, BAR);
+ bar = pcilib_resolve_bar_address(pci, BAR, 0);
if (!bar) {
pcilib_close(pci);
printf("map bar\n");
@@ -92,6 +92,5 @@ int main(int argc, char *argv[]) {
}
- pcilib_unmap_bar(pci, BAR, bar);
pcilib_close(pci);
}
diff --git a/dma/ipe.c b/dma/ipe.c
index 1c8e3e8..63f2fa3 100644
--- a/dma/ipe.c
+++ b/dma/ipe.c
@@ -15,6 +15,7 @@
#include "error.h"
#include "tools.h"
#include "debug.h"
+#include "bar.h"
#include "ipe.h"
#include "ipe_private.h"
diff --git a/dma/ipe.h b/dma/ipe.h
index 7f32d61..ce3ea4f 100644
--- a/dma/ipe.h
+++ b/dma/ipe.h
@@ -39,7 +39,7 @@ static const pcilib_dma_engine_description_t ipe_dma_engines[] = {
static const pcilib_register_bank_description_t ipe_dma_banks[] = {
{ PCILIB_REGISTER_BANK_DMA, PCILIB_REGISTER_PROTOCOL_DEFAULT, PCILIB_BAR0, 0, 0, 32, 0x0200, PCILIB_LITTLE_ENDIAN, PCILIB_LITTLE_ENDIAN, "0x%lx", "dma", "DMA Registers"},
- { PCILIB_REGISTER_BANK_DMACONF, PCILIB_REGISTER_PROTOCOL_SOFTWARE, PCILIB_BAR_NOBAR, 0, 0, 32, 0x1000, PCILIB_HOST_ENDIAN, PCILIB_HOST_ENDIAN, "0x%lx", "dmaconf", "DMA Software Registers"},
+ { PCILIB_REGISTER_BANK_DMACONF, PCILIB_REGISTER_PROTOCOL_SOFTWARE, PCILIB_BAR_NOBAR, 0, 0, 32, 0x1000, PCILIB_HOST_ENDIAN, PCILIB_HOST_ENDIAN, "0x%lx", "dmaconf", "DMA Configuration"},
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL }
};
diff --git a/dma/nwl.c b/dma/nwl.c
index 70e53f0..7f82f6a 100644
--- a/dma/nwl.c
+++ b/dma/nwl.c
@@ -13,6 +13,7 @@
#include "pcilib.h"
#include "error.h"
#include "tools.h"
+#include "bar.h"
#include "nwl_private.h"
#include "nwl_defines.h"
diff --git a/docs/Doxyfile.in b/docs/Doxyfile.in
index 1910d8b..ef98587 100644
--- a/docs/Doxyfile.in
+++ b/docs/Doxyfile.in
@@ -1,209 +1,2364 @@
-# Doxyfile 1.3.3
+# Doxyfile 1.8.9.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project.
+#
+# All text after a double hash (##) is considered a comment and is placed in
+# front of the TAG it is preceding.
+#
+# All text after a single hash (#) is considered a comment and will be ignored.
+# The format is:
+# TAG = value [value, ...]
+# For lists, items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (\" \").
#---------------------------------------------------------------------------
-# General configuration options
+# Project related configuration options
#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all text
+# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv
+# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv
+# for the list of possible encodings.
+# The default value is: UTF-8.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by
+# double-quotes, unless you are using Doxywizard) that should identify the
+# project for which the documentation is generated. This name is used in the
+# title of most generated pages and in a few other places.
+# The default value is: My Project.
+
PROJECT_NAME = pcilib
-PROJECT_NUMBER =
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
+# could be handy for archiving the generated documentation or if some version
+# control system is used.
+
+PROJECT_NUMBER =
+
+# Using the PROJECT_BRIEF tag one can provide an optional one line description
+# for a project that appears at the top of each page and should give viewer a
+# quick idea about the purpose of the project. Keep the description short.
+
+PROJECT_BRIEF =
+
+# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
+# in the documentation. The maximum height of the logo should not exceed 55
+# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
+# the logo to the output directory.
+
+PROJECT_LOGO =
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
+# into which the generated documentation will be written. If a relative path is
+# entered, it will be relative to the location where doxygen was started. If
+# left blank the current directory will be used.
+
OUTPUT_DIRECTORY = ${PCILIB_DOC_DIR}
+
+# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
+# directories (in 2 levels) under the output directory of each output format and
+# will distribute the generated files over these directories. Enabling this
+# option can be useful when feeding doxygen a huge amount of source files, where
+# putting all generated files in the same directory would otherwise causes
+# performance problems for the file system.
+# The default value is: NO.
+
+CREATE_SUBDIRS = NO
+
+# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII
+# characters to appear in the names of generated files. If set to NO, non-ASCII
+# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode
+# U+3044.
+# The default value is: NO.
+
+ALLOW_UNICODE_NAMES = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese,
+# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States),
+# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian,
+# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian,
+# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian,
+# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish,
+# Ukrainian and Vietnamese.
+# The default value is: English.
+
OUTPUT_LANGUAGE = English
-USE_WINDOWS_ENCODING = NO
+
+# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member
+# descriptions after the members that are listed in the file and class
+# documentation (similar to Javadoc). Set to NO to disable this.
+# The default value is: YES.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief
+# description of a member or function before the detailed description
+#
+# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+# The default value is: YES.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator that is
+# used to form the text in various listings. Each string in this list, if found
+# as the leading text of the brief description, will be stripped from the text
+# and the result, after processing the whole list, is used as the annotated
+# text. Otherwise, the brief description is used as-is. If left blank, the
+# following values are used ($name is automatically replaced with the name of
+# the entity):The $name class, The $name widget, The $name file, is, provides,
+# specifies, contains, represents, a, an and the.
+
+ABBREVIATE_BRIEF =
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# doxygen will generate a detailed section even if there is only a brief
+# description.
+# The default value is: NO.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+# The default value is: NO.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path
+# before files name in the file list and in the header files. If set to NO the
+# shortest path that makes the file name unique will be used
+# The default value is: YES.
+
+FULL_PATH_NAMES = NO
+
+# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
+# Stripping is only done if one of the specified strings matches the left-hand
+# part of the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the path to
+# strip.
+#
+# Note that you can specify absolute paths here, but also relative paths, which
+# will be relative from the directory where doxygen is started.
+# This tag requires that the tag FULL_PATH_NAMES is set to YES.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
+# path mentioned in the documentation of a class, which tells the reader which
+# header file to include in order to use a class. If left blank only the name of
+# the header file containing the class definition is used. Otherwise one should
+# specify the list of include paths that are normally passed to the compiler
+# using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
+# less readable) file names. This can be useful is your file systems doesn't
+# support long names like on DOS, Mac, or CD-ROM.
+# The default value is: NO.
+
+SHORT_NAMES = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
+# first line (until the first dot) of a Javadoc-style comment as the brief
+# description. If set to NO, the Javadoc-style will behave just like regular Qt-
+# style comments (thus requiring an explicit @brief command for a brief
+# description.)
+# The default value is: NO.
+
+JAVADOC_AUTOBRIEF = YES
+
+# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first
+# line (until the first dot) of a Qt-style comment as the brief description. If
+# set to NO, the Qt-style will behave just like regular Qt-style comments (thus
+# requiring an explicit \brief command for a brief description.)
+# The default value is: NO.
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a
+# multi-line C++ special comment block (i.e. a block of //! or /// comments) as
+# a brief description. This used to be the default behavior. The new default is
+# to treat a multi-line C++ comment block as a detailed description. Set this
+# tag to YES if you prefer the old behavior instead.
+#
+# Note that setting this tag to YES also means that rational rose comments are
+# not recognized any more.
+# The default value is: NO.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the
+# documentation from any documented member that it re-implements.
+# The default value is: YES.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new
+# page for each member. If set to NO, the documentation of a member will be part
+# of the file/class/namespace that contains it.
+# The default value is: NO.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen
+# uses this value to replace tabs by spaces in code fragments.
+# Minimum value: 1, maximum value: 16, default value: 4.
+
+TAB_SIZE = 8
+
+# This tag can be used to specify a number of aliases that act as commands in
+# the documentation. An alias has the form:
+# name=value
+# For example adding
+# "sideeffect=@par Side Effects:\n"
+# will allow you to put the command \sideeffect (or @sideeffect) in the
+# documentation, which will result in a user-defined paragraph with heading
+# "Side Effects:". You can put \n's in the value part of an alias to insert
+# newlines.
+
+ALIASES =
+ALIASES += a{1}="\a \1" b{1}="\b \1"
+
+# This tag can be used to specify a number of word-keyword mappings (TCL only).
+# A mapping has the form "name=value". For example adding "class=itcl::class"
+# will allow you to use the command class in the itcl::class meaning.
+
+TCL_SUBST =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
+# only. Doxygen will then generate output that is more tailored for C. For
+# instance, some of the names that are used will be different. The list of all
+# members will be omitted, etc.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_FOR_C = NO
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
+# Python sources only. Doxygen will then generate output that is more tailored
+# for that language. For instance, namespaces will be presented as packages,
+# qualified scopes will look different, etc.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources. Doxygen will then generate output that is tailored for Fortran.
+# The default value is: NO.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for VHDL.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# Doxygen selects the parser to use depending on the extension of the files it
+# parses. With this tag you can assign which parser to use for a given
+# extension. Doxygen has a built-in mapping, but you can override or extend it
+# using this tag. The format is ext=language, where ext is a file extension, and
+# language is one of the parsers supported by doxygen: IDL, Java, Javascript,
+# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran:
+# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran:
+# Fortran. In the later case the parser tries to guess whether the code is fixed
+# or free formatted code, this is the default for Fortran type files), VHDL. For
+# instance to make doxygen treat .inc files as Fortran files (default is PHP),
+# and .f files as C (default is Fortran), use: inc=Fortran f=C.
+#
+# Note: For files without extension you can use no_extension as a placeholder.
+#
+# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
+# the files are not read by doxygen.
+
+EXTENSION_MAPPING =
+
+# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
+# according to the Markdown format, which allows for more readable
+# documentation. See http://daringfireball.net/projects/markdown/ for details.
+# The output of markdown processing is further processed by doxygen, so you can
+# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in
+# case of backward compatibilities issues.
+# The default value is: YES.
+
+MARKDOWN_SUPPORT = YES
+
+# When enabled doxygen tries to link words that correspond to documented
+# classes, or namespaces to their corresponding documentation. Such a link can
+# be prevented in individual cases by putting a % sign in front of the word or
+# globally by setting AUTOLINK_SUPPORT to NO.
+# The default value is: YES.
+
+AUTOLINK_SUPPORT = YES
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should set this
+# tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string);
+# versus func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+# The default value is: NO.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+# The default value is: NO.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:
+# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen
+# will parse them like normal C++ but will assume all classes use public instead
+# of private inheritance when no explicit protection keyword is present.
+# The default value is: NO.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate
+# getter and setter methods for a property. Setting this option to YES will make
+# doxygen to replace the get and set methods by a property in the documentation.
+# This will only work if the methods are indeed getting or setting a simple
+# type. If this is not the case, or you want to show the methods anyway, you
+# should set this option to NO.
+# The default value is: YES.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+# The default value is: NO.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES to allow class member groups of the same type
+# (for instance a group of public functions) to be put as a subgroup of that
+# type (e.g. under the Public Functions section). Set it to NO to prevent
+# subgrouping. Alternatively, this can be done per class using the
+# \nosubgrouping command.
+# The default value is: YES.
+
+SUBGROUPING = YES
+
+# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions
+# are shown inside the group in which they are included (e.g. using \ingroup)
+# instead of on a separate page (for HTML and Man pages) or section (for LaTeX
+# and RTF).
+#
+# Note that this feature does not work in combination with
+# SEPARATE_MEMBER_PAGES.
+# The default value is: NO.
+
+INLINE_GROUPED_CLASSES = NO
+
+# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions
+# with only public data fields or simple typedef fields will be shown inline in
+# the documentation of the scope in which they are defined (i.e. file,
+# namespace, or group documentation), provided this scope is documented. If set
+# to NO, structs, classes, and unions are shown on a separate page (for HTML and
+# Man pages) or section (for LaTeX and RTF).
+# The default value is: NO.
+
+INLINE_SIMPLE_STRUCTS = NO
+
+# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or
+# enum is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically be
+# useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+# The default value is: NO.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
+# cache is used to resolve symbols given their name and scope. Since this can be
+# an expensive process and often the same symbol appears multiple times in the
+# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small
+# doxygen will become slower. If the cache is too large, memory is wasted. The
+# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range
+# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536
+# symbols. At the end of a run doxygen will report the cache usage and suggest
+# the optimal cache size from a speed point of view.
+# Minimum value: 0, maximum value: 9, default value: 0.
+
+LOOKUP_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in
+# documentation are documented, even if no documentation was available. Private
+# class members and static file members will be hidden unless the
+# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.
+# Note: This will also disable the warnings about undocumented members that are
+# normally produced when WARNINGS is set to YES.
+# The default value is: NO.
+
EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will
+# be included in the documentation.
+# The default value is: NO.
+
EXTRACT_PRIVATE = NO
+
+# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal
+# scope will be included in the documentation.
+# The default value is: NO.
+
+EXTRACT_PACKAGE = NO
+
+# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be
+# included in the documentation.
+# The default value is: NO.
+
EXTRACT_STATIC = NO
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined
+# locally in source files will be included in the documentation. If set to NO,
+# only classes defined in header files are included. Does not have any effect
+# for Java sources.
+# The default value is: YES.
+
EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. If set to YES, local methods,
+# which are defined in the implementation section but not in the interface are
+# included in the documentation. If set to NO, only methods in the interface are
+# included.
+# The default value is: NO.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base name of
+# the file that contains the anonymous namespace. By default anonymous namespace
+# are hidden.
+# The default value is: NO.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all
+# undocumented members inside documented classes or files. If set to NO these
+# members will be included in the various overviews, but no documentation
+# section is generated. This option has no effect if EXTRACT_ALL is enabled.
+# The default value is: NO.
+
HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy. If set
+# to NO, these classes will be included in the various overviews. This option
+# has no effect if EXTRACT_ALL is enabled.
+# The default value is: NO.
+
HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend
+# (class|struct|union) declarations. If set to NO, these declarations will be
+# included in the documentation.
+# The default value is: NO.
+
HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any
+# documentation blocks found inside the body of a function. If set to NO, these
+# blocks will be appended to the function's detailed documentation block.
+# The default value is: NO.
+
HIDE_IN_BODY_DOCS = NO
-BRIEF_MEMBER_DESC = YES
-REPEAT_BRIEF = YES
-ALWAYS_DETAILED_SEC = NO
-INLINE_INHERITED_MEMB = NO
-FULL_PATH_NAMES = NO
-STRIP_FROM_PATH =
+
+# The INTERNAL_DOCS tag determines if documentation that is typed after a
+# \internal command is included. If the tag is set to NO then the documentation
+# will be excluded. Set it to YES to include the internal documentation.
+# The default value is: NO.
+
INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file
+# names in lower-case letters. If set to YES, upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+# The default value is: system dependent.
+
CASE_SENSE_NAMES = YES
-SHORT_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with
+# their full class and namespace scopes in the documentation. If set to YES, the
+# scope will be hidden.
+# The default value is: NO.
+
HIDE_SCOPE_NAMES = NO
+
+# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will
+# append additional text to a page's title, such as Class Reference. If set to
+# YES the compound reference will be hidden.
+# The default value is: NO.
+
+HIDE_COMPOUND_REFERENCE= NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of
+# the files that are included by a file in the documentation of that file.
+# The default value is: YES.
+
SHOW_INCLUDE_FILES = YES
-JAVADOC_AUTOBRIEF = NO
-MULTILINE_CPP_IS_BRIEF = NO
-DETAILS_AT_TOP = NO
-INHERIT_DOCS = YES
+
+# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each
+# grouped member an include statement to the documentation, telling the reader
+# which file to include in order to use the member.
+# The default value is: NO.
+
+SHOW_GROUPED_MEMB_INC = NO
+
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include
+# files with double quotes in the documentation rather than with sharp brackets.
+# The default value is: NO.
+
+FORCE_LOCAL_INCLUDES = NO
+
+# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the
+# documentation for inline members.
+# The default value is: YES.
+
INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the
+# (detailed) documentation of file and class members alphabetically by member
+# name. If set to NO, the members will appear in declaration order.
+# The default value is: YES.
+
SORT_MEMBER_DOCS = YES
-DISTRIBUTE_GROUP_DOC = NO
-TAB_SIZE = 8
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief
+# descriptions of file, namespace and class members alphabetically by member
+# name. If set to NO, the members will appear in declaration order. Note that
+# this will also influence the order of the classes in the class list.
+# The default value is: NO.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the
+# (brief and detailed) documentation of class members so that constructors and
+# destructors are listed first. If set to NO the constructors will appear in the
+# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.
+# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief
+# member documentation.
+# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting
+# detailed member documentation.
+# The default value is: NO.
+
+SORT_MEMBERS_CTORS_1ST = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy
+# of group names into alphabetical order. If set to NO the group names will
+# appear in their defined order.
+# The default value is: NO.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by
+# fully-qualified names, including namespaces. If set to NO, the class list will
+# be sorted only by class name, not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the alphabetical
+# list.
+# The default value is: NO.
+
+SORT_BY_SCOPE_NAME = NO
+
+# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper
+# type resolution of all parameters of a function it will reject a match between
+# the prototype and the implementation of a member function even if there is
+# only one candidate or it is obvious which candidate to choose by doing a
+# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still
+# accept a match between prototype and implementation in such cases.
+# The default value is: NO.
+
+STRICT_PROTO_MATCHING = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo
+# list. This list is created by putting \todo commands in the documentation.
+# The default value is: YES.
+
GENERATE_TODOLIST = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test
+# list. This list is created by putting \test commands in the documentation.
+# The default value is: YES.
+
GENERATE_TESTLIST = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug
+# list. This list is created by putting \bug commands in the documentation.
+# The default value is: YES.
+
GENERATE_BUGLIST = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO)
+# the deprecated list. This list is created by putting \deprecated commands in
+# the documentation.
+# The default value is: YES.
+
GENERATE_DEPRECATEDLIST= YES
-ALIASES =
-ENABLED_SECTIONS =
+
+# The ENABLED_SECTIONS tag can be used to enable conditional documentation
+# sections, marked by \if <section_label> ... \endif and \cond <section_label>
+# ... \endcond blocks.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
+# initial value of a variable or macro / define can have for it to appear in the
+# documentation. If the initializer consists of more lines than specified here
+# it will be hidden. Use a value of 0 to hide initializers completely. The
+# appearance of the value of individual variables and macros / defines can be
+# controlled using \showinitializer or \hideinitializer command in the
+# documentation regardless of this setting.
+# Minimum value: 0, maximum value: 10000, default value: 30.
+
MAX_INITIALIZER_LINES = 30
-OPTIMIZE_OUTPUT_FOR_C = NO
-OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at
+# the bottom of the documentation of classes and structs. If set to YES, the
+# list will mention the files that were used to generate the documentation.
+# The default value is: YES.
+
SHOW_USED_FILES = YES
-SUBGROUPING = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This
+# will remove the Files entry from the Quick Index and from the Folder Tree View
+# (if specified).
+# The default value is: YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces
+# page. This will remove the Namespaces entry from the Quick Index and from the
+# Folder Tree View (if specified).
+# The default value is: YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command command input-file, where command is the value of the
+# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided
+# by doxygen. Whatever the program writes to standard output is used as the file
+# version. For an example see the documentation.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
+# by doxygen. The layout file controls the global structure of the generated
+# output files in an output format independent way. To create the layout file
+# that represents doxygen's defaults, run doxygen with the -l option. You can
+# optionally specify a file name after the option, if omitted DoxygenLayout.xml
+# will be used as the name of the layout file.
+#
+# Note that if you run doxygen from a directory containing a file called
+# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
+# tag is left empty.
+
+LAYOUT_FILE =
+
+# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
+# the reference definitions. This must be a list of .bib files. The .bib
+# extension is automatically appended if omitted. This requires the bibtex tool
+# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info.
+# For LaTeX the style of the bibliography can be controlled using
+# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the
+# search path. See also \cite for info how to create references.
+
+CITE_BIB_FILES =
+
#---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
+# Configuration options related to warning and progress messages
#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated to
+# standard output by doxygen. If QUIET is set to YES this implies that the
+# messages are off.
+# The default value is: NO.
+
QUIET = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES
+# this implies that the warnings are on.
+#
+# Tip: Turn warnings on while writing the documentation.
+# The default value is: YES.
+
WARNINGS = YES
+
+# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate
+# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag
+# will automatically be disabled.
+# The default value is: YES.
+
WARN_IF_UNDOCUMENTED = NO
+
+# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some parameters
+# in a documented function, or documenting parameters that don't exist or using
+# markup commands wrongly.
+# The default value is: YES.
+
WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
+# are documented, but have no documentation for their parameters or return
+# value. If set to NO, doxygen will only warn about wrong or incomplete
+# parameter documentation, but not about the absence of documentation.
+# The default value is: NO.
+
+WARN_NO_PARAMDOC = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that doxygen
+# can produce. The string should contain the $file, $line, and $text tags, which
+# will be replaced by the file and line number from which the warning originated
+# and the warning text. Optionally the format may contain $version, which will
+# be replaced by the version of the file (if it could be obtained via
+# FILE_VERSION_FILTER)
+# The default value is: $file:$line: $text.
+
WARN_FORMAT = "$file:$line: $text"
-WARN_LOGFILE =
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning and error
+# messages should be written. If left blank the output is written to standard
+# error (stderr).
+
+WARN_LOGFILE =
+
#---------------------------------------------------------------------------
-# configuration options related to the input files
+# Configuration options related to the input files
#---------------------------------------------------------------------------
-INPUT = ${CMAKE_SOURCE_DIR}/pcilib/
+
+# The INPUT tag is used to specify the files and/or directories that contain
+# documented source files. You may enter file names like myfile.cpp or
+# directories like /usr/src/myproject. Separate the files or directories with
+# spaces.
+# Note: If this tag is empty the current directory is searched.
+
+INPUT = ${CMAKE_SOURCE_DIR}/pcilib/
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
+# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
+# documentation (see: http://www.gnu.org/software/libiconv) for the list of
+# possible encodings.
+# The default value is: UTF-8.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
+# *.h) to filter out the source-files in the directories. If left blank the
+# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii,
+# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp,
+# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown,
+# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf,
+# *.qsf, *.as and *.js.
+
FILE_PATTERNS = *.h \
*.c
+
+# The RECURSIVE tag can be used to specify whether or not subdirectories should
+# be searched for input files as well.
+# The default value is: NO.
+
RECURSIVE = NO
-EXCLUDE =
+
+# The EXCLUDE tag can be used to specify files and/or directories that should be
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+#
+# Note that relative paths are relative to the directory from which doxygen is
+# run.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
+# directories that are symbolic links (a Unix file system feature) are excluded
+# from the input.
+# The default value is: NO.
+
EXCLUDE_SYMLINKS = NO
-EXCLUDE_PATTERNS =
-EXAMPLE_PATH =
-EXAMPLE_PATTERNS =
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories.
+#
+# Note that the wildcards are matched against the file with absolute path, so to
+# exclude all test directories for example use the pattern */test/*
+
+EXCLUDE_PATTERNS =
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+#
+# Note that the wildcards are matched against the file with absolute path, so to
+# exclude all test directories use the pattern */test/*
+
+EXCLUDE_SYMBOLS =
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or directories
+# that contain example code fragments that are included (see the \include
+# command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
+# *.h) to filter out the source-files in the directories. If left blank all
+# files are included.
+
+EXAMPLE_PATTERNS =
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude commands
+# irrespective of the value of the RECURSIVE tag.
+# The default value is: NO.
+
EXAMPLE_RECURSIVE = NO
-IMAGE_PATH =
-INPUT_FILTER =
+
+# The IMAGE_PATH tag can be used to specify one or more files or directories
+# that contain images that are to be included in the documentation (see the
+# \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command:
+#
+# <filter> <input-file>
+#
+# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the
+# name of an input file. Doxygen will then use the output that the filter
+# program writes to standard output. If FILTER_PATTERNS is specified, this tag
+# will be ignored.
+#
+# Note that the filter must not add or remove lines; it is applied before the
+# code is scanned, but not when the output code is generated. If lines are added
+# or removed, the anchors will not be placed correctly.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form: pattern=filter
+# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
+# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
+# patterns match the file name, INPUT_FILTER is applied.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will also be used to filter the input files that are used for
+# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).
+# The default value is: NO.
+
FILTER_SOURCE_FILES = NO
+
+# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
+# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and
+# it is also possible to disable source filtering for a specific pattern using
+# *.ext= (so without naming a filter).
+# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.
+
+FILTER_SOURCE_PATTERNS =
+
+# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
+# is part of the input, its contents will be placed on the main page
+# (index.html). This can be useful if you have a project on for instance GitHub
+# and want to reuse the introduction page also for the doxygen output.
+
+USE_MDFILE_AS_MAINPAGE =
+
#---------------------------------------------------------------------------
-# configuration options related to source browsing
+# Configuration options related to source browsing
#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will be
+# generated. Documented entities will be cross-referenced with these sources.
+#
+# Note: To get rid of all source code in the generated output, make sure that
+# also VERBATIM_HEADERS is set to NO.
+# The default value is: NO.
+
SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body of functions,
+# classes and enums directly into the documentation.
+# The default value is: NO.
+
INLINE_SOURCES = YES
+
+# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any
+# special comment blocks from generated source code fragments. Normal C, C++ and
+# Fortran comments will always remain visible.
+# The default value is: YES.
+
STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES then for each documented
+# function all documented functions referencing it will be listed.
+# The default value is: NO.
+
REFERENCED_BY_RELATION = YES
+
+# If the REFERENCES_RELATION tag is set to YES then for each documented function
+# all documented entities called/used by that function will be listed.
+# The default value is: NO.
+
REFERENCES_RELATION = YES
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set
+# to YES then the hyperlinks from functions in REFERENCES_RELATION and
+# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will
+# link to the documentation.
+# The default value is: YES.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the
+# source code will show a tooltip with additional information such as prototype,
+# brief description and links to the definition and documentation. Since this
+# will make the HTML file larger and loading of large files a bit slower, you
+# can opt to disable this feature.
+# The default value is: YES.
+# This tag requires that the tag SOURCE_BROWSER is set to YES.
+
+SOURCE_TOOLTIPS = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code will
+# point to the HTML generated by the htags(1) tool instead of doxygen built-in
+# source browser. The htags tool is part of GNU's global source tagging system
+# (see http://www.gnu.org/software/global/global.html). You will need version
+# 4.8.6 or higher.
+#
+# To use it do the following:
+# - Install the latest version of global
+# - Enable SOURCE_BROWSER and USE_HTAGS in the config file
+# - Make sure the INPUT points to the root of the source tree
+# - Run doxygen as normal
+#
+# Doxygen will invoke htags (and that will in turn invoke gtags), so these
+# tools must be available from the command line (i.e. in the search path).
+#
+# The result: instead of the source browser generated by doxygen, the links to
+# source code will now point to the output of htags.
+# The default value is: NO.
+# This tag requires that the tag SOURCE_BROWSER is set to YES.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a
+# verbatim copy of the header file for each class for which an include is
+# specified. Set to NO to disable this.
+# See also: Section \class.
+# The default value is: YES.
+
VERBATIM_HEADERS = YES
+
#---------------------------------------------------------------------------
-# configuration options related to the alphabetical class index
+# Configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all
+# compounds will be generated. Enable this if the project contains a lot of
+# classes, structs, unions or interfaces.
+# The default value is: YES.
+
ALPHABETICAL_INDEX = NO
+
+# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in
+# which the alphabetical index list will be split.
+# Minimum value: 1, maximum value: 20, default value: 5.
+# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
+
COLS_IN_ALPHA_INDEX = 5
-IGNORE_PREFIX =
+
+# In case all classes in a project start with a common prefix, all classes will
+# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
+# can be used to specify a prefix (or a list of prefixes) that should be ignored
+# while generating the index headers.
+# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
+
+IGNORE_PREFIX =
+
#---------------------------------------------------------------------------
-# configuration options related to the HTML output
+# Configuration options related to the HTML output
#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output
+# The default value is: YES.
+
GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: html.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
+# generated HTML page (for example: .htm, .php, .asp).
+# The default value is: .html.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
HTML_FILE_EXTENSION = .html
-HTML_HEADER =
-HTML_FOOTER =
-HTML_STYLESHEET =
-HTML_ALIGN_MEMBERS = YES
+
+# The HTML_HEADER tag can be used to specify a user-defined HTML header file for
+# each generated HTML page. If the tag is left blank doxygen will generate a
+# standard header.
+#
+# To get valid HTML the header file that includes any scripts and style sheets
+# that doxygen needs, which is dependent on the configuration options used (e.g.
+# the setting GENERATE_TREEVIEW). It is highly recommended to start with a
+# default header using
+# doxygen -w html new_header.html new_footer.html new_stylesheet.css
+# YourConfigFile
+# and then modify the file new_header.html. See also section "Doxygen usage"
+# for information on how to generate the default header that doxygen normally
+# uses.
+# Note: The header is subject to change so you typically have to regenerate the
+# default header when upgrading to a newer version of doxygen. For a description
+# of the possible markers and block names see the documentation.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
+# generated HTML page. If the tag is left blank doxygen will generate a standard
+# footer. See HTML_HEADER for more information on how to generate a default
+# footer and what special commands can be used inside the footer. See also
+# section "Doxygen usage" for information on how to generate the default footer
+# that doxygen normally uses.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
+# sheet that is used by each HTML page. It can be used to fine-tune the look of
+# the HTML output. If left blank doxygen will generate a default style sheet.
+# See also section "Doxygen usage" for information on how to generate the style
+# sheet that doxygen normally uses.
+# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as
+# it is more robust and this tag (HTML_STYLESHEET) will in the future become
+# obsolete.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_STYLESHEET =
+
+# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined
+# cascading style sheets that are included after the standard style sheets
+# created by doxygen. Using this option one can overrule certain style aspects.
+# This is preferred over using HTML_STYLESHEET since it does not replace the
+# standard style sheet and is therefore more robust against future updates.
+# Doxygen will copy the style sheet files to the output directory.
+# Note: The order of the extra style sheet files is of importance (e.g. the last
+# style sheet in the list overrules the setting of the previous ones in the
+# list). For an example see the documentation.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_EXTRA_STYLESHEET =
+
+# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the HTML output directory. Note
+# that these files will be copied to the base HTML output directory. Use the
+# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
+# files. In the HTML_STYLESHEET file, use the file name only. Also note that the
+# files will be copied as-is; there are no commands or markers available.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_EXTRA_FILES =
+
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
+# will adjust the colors in the style sheet and background images according to
+# this color. Hue is specified as an angle on a colorwheel, see
+# http://en.wikipedia.org/wiki/Hue for more information. For instance the value
+# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300
+# purple, and 360 is red again.
+# Minimum value: 0, maximum value: 359, default value: 220.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_HUE = 220
+
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors
+# in the HTML output. For a value of 0 the output will use grayscales only. A
+# value of 255 will produce the most vivid colors.
+# Minimum value: 0, maximum value: 255, default value: 100.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_SAT = 100
+
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the
+# luminance component of the colors in the HTML output. Values below 100
+# gradually make the output lighter, whereas values above 100 make the output
+# darker. The value divided by 100 is the actual gamma applied, so 80 represents
+# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not
+# change the gamma.
+# Minimum value: 40, maximum value: 240, default value: 80.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_GAMMA = 80
+
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
+# page will contain the date and time when the page was generated. Setting this
+# to NO can help when comparing the output of multiple runs.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_TIMESTAMP = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_DYNAMIC_SECTIONS = NO
+
+# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries
+# shown in the various tree structured indices initially; the user can expand
+# and collapse entries dynamically later on. Doxygen will expand the tree to
+# such a level that at most the specified number of entries are visible (unless
+# a fully collapsed tree already exceeds this amount). So setting the number of
+# entries 1 will produce a full collapsed tree by default. 0 is a special value
+# representing an infinite number of entries and will result in a full expanded
+# tree by default.
+# Minimum value: 0, maximum value: 9999, default value: 100.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_INDEX_NUM_ENTRIES = 100
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files will be
+# generated that can be used as input for Apple's Xcode 3 integrated development
+# environment (see: http://developer.apple.com/tools/xcode/), introduced with
+# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a
+# Makefile in the HTML output directory. Running make will produce the docset in
+# that directory and running make install will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at
+# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
+# for more information.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_DOCSET = NO
+
+# This tag determines the name of the docset feed. A documentation feed provides
+# an umbrella under which multiple documentation sets from a single provider
+# (such as a company or product suite) can be grouped.
+# The default value is: Doxygen generated docs.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# This tag specifies a string that should uniquely identify the documentation
+# set bundle. This should be a reverse domain-name style string, e.g.
+# com.mycompany.MyDocSet. Doxygen will append .docset to the name.
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify
+# the documentation publisher. This should be a reverse domain-name style
+# string, e.g. com.mycompany.MyDocSet.documentation.
+# The default value is: org.doxygen.Publisher.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_PUBLISHER_ID = org.doxygen.Publisher
+
+# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
+# The default value is: Publisher.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_PUBLISHER_NAME = Publisher
+
+# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
+# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
+# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop
+# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on
+# Windows.
+#
+# The HTML Help Workshop contains a compiler that can convert all HTML output
+# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML
+# files are now used as the Windows 98 help format, and will replace the old
+# Windows help format (.hlp) on all Windows platforms in the future. Compressed
+# HTML files also contain an index, a table of contents, and you can search for
+# words in the documentation. The HTML workshop also contains a viewer for
+# compressed HTML files.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
GENERATE_HTMLHELP = NO
-CHM_FILE =
-HHC_LOCATION =
+
+# The CHM_FILE tag can be used to specify the file name of the resulting .chm
+# file. You can add a path in front of the file if the result should not be
+# written to the html output directory.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+CHM_FILE =
+
+# The HHC_LOCATION tag can be used to specify the location (absolute path
+# including file name) of the HTML help compiler (hhc.exe). If non-empty,
+# doxygen will try to run the HTML help compiler on the generated index.hhp.
+# The file has to be specified with full path.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+HHC_LOCATION =
+
+# The GENERATE_CHI flag controls if a separate .chi index file is generated
+# (YES) or that it should be included in the master .chm file (NO).
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
GENERATE_CHI = NO
+
+# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc)
+# and project file content.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+CHM_INDEX_ENCODING =
+
+# The BINARY_TOC flag controls whether a binary table of contents is generated
+# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it
+# enables the Previous and Next buttons.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members to
+# the table of contents of the HTML help documentation and to the tree view.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
TOC_EXPAND = NO
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that
+# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help
+# (.qch) of the generated HTML documentation.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify
+# the file name of the resulting .qch file. The path specified is relative to
+# the HTML output folder.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
+# Project output. For more information please see Qt Help Project / Namespace
+# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace).
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
+# Help Project output. For more information please see Qt Help Project / Virtual
+# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual-
+# folders).
+# The default value is: doc.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
+# filter to add. For more information please see Qt Help Project / Custom
+# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
+# filters).
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_CUST_FILTER_NAME =
+
+# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
+# custom filter to add. For more information please see Qt Help Project / Custom
+# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
+# filters).
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_CUST_FILTER_ATTRS =
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
+# project's filter section matches. Qt Help Project / Filter Attributes (see:
+# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes).
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_SECT_FILTER_ATTRS =
+
+# The QHG_LOCATION tag can be used to specify the location of Qt's
+# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the
+# generated .qhp file.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHG_LOCATION =
+
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be
+# generated, together with the HTML files, they form an Eclipse help plugin. To
+# install this plugin and make it available under the help contents menu in
+# Eclipse, the contents of the directory containing the HTML and XML files needs
+# to be copied into the plugins directory of eclipse. The name of the directory
+# within the plugins directory should be the same as the ECLIPSE_DOC_ID value.
+# After copying Eclipse needs to be restarted before the help appears.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_ECLIPSEHELP = NO
+
+# A unique identifier for the Eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have this
+# name. Each documentation set should have its own identifier.
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.
+
+ECLIPSE_DOC_ID = org.doxygen.Project
+
+# If you want full control over the layout of the generated HTML pages it might
+# be necessary to disable the index and replace it with your own. The
+# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top
+# of each HTML page. A value of NO enables the index and the value YES disables
+# it. Since the tabs in the index contain the same information as the navigation
+# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
DISABLE_INDEX = NO
-ENUM_VALUES_PER_LINE = 4
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information. If the tag
+# value is set to YES, a side panel will be generated containing a tree-like
+# index structure (just like the one that is generated for HTML Help). For this
+# to work a browser that supports JavaScript, DHTML, CSS and frames is required
+# (i.e. any modern browser). Windows users are probably better off using the
+# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can
+# further fine-tune the look of the index. As an example, the default style
+# sheet generated by doxygen has an example that shows how to put an image at
+# the root of the tree instead of the PROJECT_NAME. Since the tree basically has
+# the same information as the tab index, you could consider setting
+# DISABLE_INDEX to YES when enabling this option.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
GENERATE_TREEVIEW = NO
+
+# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that
+# doxygen will group on one line in the generated HTML documentation.
+#
+# Note that a value of 0 will completely suppress the enum values from appearing
+# in the overview section.
+# Minimum value: 0, maximum value: 20, default value: 4.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+ENUM_VALUES_PER_LINE = 4
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used
+# to set the initial width (in pixels) of the frame in which the tree is shown.
+# Minimum value: 0, maximum value: 1500, default value: 250.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
TREEVIEW_WIDTH = 250
+
+# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to
+# external symbols imported via tag files in a separate window.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+EXT_LINKS_IN_WINDOW = NO
+
+# Use this tag to change the font size of LaTeX formulas included as images in
+# the HTML documentation. When you change the font size after a successful
+# doxygen run you need to manually remove any form_*.png images from the HTML
+# output directory to force them to be regenerated.
+# Minimum value: 8, maximum value: 50, default value: 10.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+FORMULA_FONTSIZE = 10
+
+# Use the FORMULA_TRANPARENT tag to determine whether or not the images
+# generated for formulas are transparent PNGs. Transparent PNGs are not
+# supported properly for IE 6.0, but are supported on all modern browsers.
+#
+# Note that when changing this option you need to delete any form_*.png files in
+# the HTML output directory before the changes have effect.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+FORMULA_TRANSPARENT = YES
+
+# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
+# http://www.mathjax.org) which uses client side Javascript for the rendering
+# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX
+# installed or if you want to formulas look prettier in the HTML output. When
+# enabled you may also need to install MathJax separately and configure the path
+# to it using the MATHJAX_RELPATH option.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+USE_MATHJAX = NO
+
+# When MathJax is enabled you can set the default output format to be used for
+# the MathJax output. See the MathJax site (see:
+# http://docs.mathjax.org/en/latest/output.html) for more details.
+# Possible values are: HTML-CSS (which is slower, but has the best
+# compatibility), NativeMML (i.e. MathML) and SVG.
+# The default value is: HTML-CSS.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_FORMAT = HTML-CSS
+
+# When MathJax is enabled you need to specify the location relative to the HTML
+# output directory using the MATHJAX_RELPATH option. The destination directory
+# should contain the MathJax.js script. For instance, if the mathjax directory
+# is located at the same level as the HTML output directory, then
+# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax
+# Content Delivery Network so you can quickly see the result without installing
+# MathJax. However, it is strongly recommended to install a local copy of
+# MathJax from http://www.mathjax.org before deployment.
+# The default value is: http://cdn.mathjax.org/mathjax/latest.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
+
+# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
+# extension names that should be enabled during MathJax rendering. For example
+# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_EXTENSIONS =
+
+# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
+# of code that will be used on startup of the MathJax code. See the MathJax site
+# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an
+# example see the documentation.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_CODEFILE =
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box for
+# the HTML output. The underlying search engine uses javascript and DHTML and
+# should work on any modern browser. Note that when using HTML help
+# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)
+# there is already a search function so this one should typically be disabled.
+# For large projects the javascript based search engine can be slow, then
+# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to
+# search using the keyboard; to jump to the search box use <access key> + S
+# (what the <access key> is depends on the OS and browser, but it is typically
+# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down
+# key> to jump into the search results window, the results can be navigated
+# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel
+# the search. The filter options can be selected when the cursor is inside the
+# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys>
+# to select a filter and <Enter> or <escape> to activate or cancel the filter
+# option.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+SEARCHENGINE = NO
+
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
+# implemented using a web server instead of a web client using Javascript. There
+# are two flavors of web server based searching depending on the EXTERNAL_SEARCH
+# setting. When disabled, doxygen will generate a PHP script for searching and
+# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing
+# and searching needs to be provided by external tools. See the section
+# "External Indexing and Searching" for details.
+# The default value is: NO.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+SERVER_BASED_SEARCH = NO
+
+# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP
+# script for searching. Instead the search results are written to an XML file
+# which needs to be processed by an external indexer. Doxygen will invoke an
+# external search engine pointed to by the SEARCHENGINE_URL option to obtain the
+# search results.
+#
+# Doxygen ships with an example indexer (doxyindexer) and search engine
+# (doxysearch.cgi) which are based on the open source search engine library
+# Xapian (see: http://xapian.org/).
+#
+# See the section "External Indexing and Searching" for details.
+# The default value is: NO.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+EXTERNAL_SEARCH = NO
+
+# The SEARCHENGINE_URL should point to a search engine hosted by a web server
+# which will return the search results when EXTERNAL_SEARCH is enabled.
+#
+# Doxygen ships with an example indexer (doxyindexer) and search engine
+# (doxysearch.cgi) which are based on the open source search engine library
+# Xapian (see: http://xapian.org/). See the section "External Indexing and
+# Searching" for details.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+SEARCHENGINE_URL =
+
+# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
+# search data is written to a file for indexing by an external tool. With the
+# SEARCHDATA_FILE tag the name of this file can be specified.
+# The default file is: searchdata.xml.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+SEARCHDATA_FILE = searchdata.xml
+
+# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the
+# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is
+# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple
+# projects and redirect the results back to the right project.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+EXTERNAL_SEARCH_ID =
+
+# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
+# projects other than the one defined by this configuration file, but that are
+# all added to the same external search index. Each project needs to have a
+# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of
+# to a relative location where the documentation can be found. The format is:
+# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+EXTRA_SEARCH_MAPPINGS =
+
#---------------------------------------------------------------------------
-# configuration options related to the LaTeX output
+# Configuration options related to the LaTeX output
#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output.
+# The default value is: YES.
+
GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: latex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked.
+#
+# Note that when enabling USE_PDFLATEX this option is only used for generating
+# bitmaps for formulas in the HTML output, but not in the Makefile that is
+# written to the output directory.
+# The default file is: latex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate
+# index for LaTeX.
+# The default file is: makeindex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX
+# documents. This may be useful for small projects and may help to save some
+# trees in general.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used by the
+# printer.
+# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x
+# 14 inches) and executive (7.25 x 10.5 inches).
+# The default value is: a4.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
PAPER_TYPE = a4wide
-EXTRA_PACKAGES =
-LATEX_HEADER =
+
+# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names
+# that should be included in the LaTeX output. To get the times font for
+# instance you can specify
+# EXTRA_PACKAGES=times
+# If left blank no extra packages will be included.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the
+# generated LaTeX document. The header should contain everything until the first
+# chapter. If it is left blank doxygen will generate a standard header. See
+# section "Doxygen usage" for information on how to let doxygen write the
+# default header to a separate file.
+#
+# Note: Only use a user-defined header if you know what you are doing! The
+# following commands have a special meaning inside the header: $title,
+# $datetime, $date, $doxygenversion, $projectname, $projectnumber,
+# $projectbrief, $projectlogo. Doxygen will replace $title with the empty
+# string, for the replacement values of the other commands the user is referred
+# to HTML_HEADER.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_HEADER =
+
+# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the
+# generated LaTeX document. The footer should contain everything after the last
+# chapter. If it is left blank doxygen will generate a standard footer. See
+# LATEX_HEADER for more information on how to generate a default footer and what
+# special commands can be used inside the footer.
+#
+# Note: Only use a user-defined footer if you know what you are doing!
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_FOOTER =
+
+# The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined
+# LaTeX style sheets that are included after the standard style sheets created
+# by doxygen. Using this option one can overrule certain style aspects. Doxygen
+# will copy the style sheet files to the output directory.
+# Note: The order of the extra style sheet files is of importance (e.g. the last
+# style sheet in the list overrules the setting of the previous ones in the
+# list).
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_EXTRA_STYLESHEET =
+
+# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the LATEX_OUTPUT output
+# directory. Note that the files will be copied as-is; there are no commands or
+# markers available.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_EXTRA_FILES =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is
+# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will
+# contain links (just like the HTML output) instead of page references. This
+# makes the output suitable for online browsing using a PDF viewer.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
PDF_HYPERLINKS = NO
+
+# If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate
+# the PDF file directly from the LaTeX files. Set this option to YES, to get a
+# higher quality PDF documentation.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
USE_PDFLATEX = NO
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode
+# command to the generated LaTeX files. This will instruct LaTeX to keep running
+# if errors occur, instead of asking the user for help. This option is also used
+# when generating formulas in HTML.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
LATEX_BATCHMODE = NO
+
+# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the
+# index chapters (such as File Index, Compound Index, etc.) in the output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
LATEX_HIDE_INDICES = NO
+
+# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source
+# code with syntax highlighting in the LaTeX output.
+#
+# Note that which sources are shown also depends on other settings such as
+# SOURCE_BROWSER.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_SOURCE_CODE = NO
+
+# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
+# bibliography, e.g. plainnat, or ieeetr. See
+# http://en.wikipedia.org/wiki/BibTeX and \cite for more info.
+# The default value is: plain.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_BIB_STYLE = plain
+
#---------------------------------------------------------------------------
-# configuration options related to the RTF output
+# Configuration options related to the RTF output
#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES, doxygen will generate RTF output. The
+# RTF output is optimized for Word 97 and may not look too pretty with other RTF
+# readers/editors.
+# The default value is: NO.
+
GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: rtf.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES, doxygen generates more compact RTF
+# documents. This may be useful for small projects and may help to save some
+# trees in general.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will
+# contain hyperlink fields. The RTF file will contain links (just like the HTML
+# output) instead of page references. This makes the output suitable for online
+# browsing using Word or some other Word compatible readers that support those
+# fields.
+#
+# Note: WordPad (write) and others do not support links.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
RTF_HYPERLINKS = NO
-RTF_STYLESHEET_FILE =
-RTF_EXTENSIONS_FILE =
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's config
+# file, i.e. a series of assignments. You only have to provide replacements,
+# missing definitions are set to their default value.
+#
+# See also section "Doxygen usage" for information on how to generate the
+# default style sheet that doxygen normally uses.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an RTF document. Syntax is
+# similar to doxygen's config file. A template extensions file can be generated
+# using doxygen -e rtf extensionFile.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_EXTENSIONS_FILE =
+
+# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code
+# with syntax highlighting in the RTF output.
+#
+# Note that which sources are shown also depends on other settings such as
+# SOURCE_BROWSER.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_SOURCE_CODE = NO
+
#---------------------------------------------------------------------------
-# configuration options related to the man page output
+# Configuration options related to the man page output
#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES, doxygen will generate man pages for
+# classes and files.
+# The default value is: NO.
+
GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it. A directory man3 will be created inside the directory specified by
+# MAN_OUTPUT.
+# The default directory is: man.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to the generated
+# man pages. In case the manual section does not start with a number, the number
+# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is
+# optional.
+# The default value is: .3.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
MAN_EXTENSION = .3
+
+# The MAN_SUBDIR tag determines the name of the directory created within
+# MAN_OUTPUT in which the man pages are placed. If defaults to man followed by
+# MAN_EXTENSION with the initial . removed.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_SUBDIR =
+
+# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it
+# will generate one additional man file for each entity documented in the real
+# man page(s). These additional files only source the real man page, but without
+# them the man command would be unable to find the correct page.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
MAN_LINKS = NO
+
#---------------------------------------------------------------------------
-# configuration options related to the XML output
+# Configuration options related to the XML output
#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES, doxygen will generate an XML file that
+# captures the structure of the code including all documentation.
+# The default value is: NO.
+
GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: xml.
+# This tag requires that the tag GENERATE_XML is set to YES.
+
XML_OUTPUT = xml
-XML_SCHEMA =
-XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES, doxygen will dump the program
+# listings (including syntax highlighting and cross-referencing information) to
+# the XML output. Note that enabling this will significantly increase the size
+# of the XML output.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_XML is set to YES.
+
+XML_PROGRAMLISTING = YES
+
#---------------------------------------------------------------------------
-# configuration options for the AutoGen Definitions output
+# Configuration options related to the DOCBOOK output
#---------------------------------------------------------------------------
+
+# If the GENERATE_DOCBOOK tag is set to YES, doxygen will generate Docbook files
+# that can be used to generate PDF.
+# The default value is: NO.
+
+GENERATE_DOCBOOK = NO
+
+# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in
+# front of it.
+# The default directory is: docbook.
+# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
+
+DOCBOOK_OUTPUT = docbook
+
+# If the DOCBOOK_PROGRAMLISTING tag is set to YES, doxygen will include the
+# program listings (including syntax highlighting and cross-referencing
+# information) to the DOCBOOK output. Note that enabling this will significantly
+# increase the size of the DOCBOOK output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
+
+DOCBOOK_PROGRAMLISTING = NO
+
+#---------------------------------------------------------------------------
+# Configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an
+# AutoGen Definitions (see http://autogen.sf.net) file that captures the
+# structure of the code including all documentation. Note that this feature is
+# still experimental and incomplete at the moment.
+# The default value is: NO.
+
GENERATE_AUTOGEN_DEF = NO
+
#---------------------------------------------------------------------------
-# configuration options related to the Perl module output
+# Configuration options related to the Perl module output
#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES, doxygen will generate a Perl module
+# file that captures the structure of the code including all documentation.
+#
+# Note that this feature is still experimental and incomplete at the moment.
+# The default value is: NO.
+
GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES, doxygen will generate the necessary
+# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI
+# output from the Perl module output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
+
PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES, the Perl module output will be nicely
+# formatted so it can be parsed by a human reader. This is useful if you want to
+# understand what is going on. On the other hand, if this tag is set to NO, the
+# size of the Perl module output will be much smaller and Perl will parse it
+# just the same.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
+
PERLMOD_PRETTY = YES
-PERLMOD_MAKEVAR_PREFIX =
+
+# The names of the make variables in the generated doxyrules.make file are
+# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful
+# so different doxyrules.make files included by the same Makefile don't
+# overwrite each other's variables.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
+
+PERLMOD_MAKEVAR_PREFIX =
+
#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
+# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES, doxygen will evaluate all
+# C-preprocessor directives found in the sources and include files.
+# The default value is: YES.
+
ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names
+# in the source code. If set to NO, only conditional compilation will be
+# performed. Macro expansion can be done in a controlled way by setting
+# EXPAND_ONLY_PREDEF to YES.
+# The default value is: NO.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
MACRO_EXPANSION = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
+# the macro expansion is limited to the macros specified with the PREDEFINED and
+# EXPAND_AS_DEFINED tags.
+# The default value is: NO.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
EXPAND_ONLY_PREDEF = NO
+
+# If the SEARCH_INCLUDES tag is set to YES, the include files in the
+# INCLUDE_PATH will be searched if a #include is found.
+# The default value is: YES.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
SEARCH_INCLUDES = YES
-INCLUDE_PATH =
-INCLUDE_FILE_PATTERNS =
-PREDEFINED =
-EXPAND_AS_DEFINED =
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by the
+# preprocessor.
+# This tag requires that the tag SEARCH_INCLUDES is set to YES.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will be
+# used.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that are
+# defined before the preprocessor is started (similar to the -D option of e.g.
+# gcc). The argument of the tag is a list of macros of the form: name or
+# name=definition (no spaces). If the definition and the "=" are omitted, "=1"
+# is assumed. To prevent a macro definition from being undefined via #undef or
+# recursively expanded use the := operator instead of the = operator.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+PREDEFINED =
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
+# tag can be used to specify a list of macro names that should be expanded. The
+# macro definition that is found in the sources will be used. Use the PREDEFINED
+# tag if you want to use a different macro definition that overrules the
+# definition found in the source code.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+EXPAND_AS_DEFINED =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
+# remove all references to function-like macros that are alone on a line, have
+# an all uppercase name, and do not end with a semicolon. Such function macros
+# are typically used for boiler-plate code, and will confuse the parser if not
+# removed.
+# The default value is: YES.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
SKIP_FUNCTION_MACROS = YES
+
#---------------------------------------------------------------------------
-# Configuration::addtions related to external references
+# Configuration options related to external references
#---------------------------------------------------------------------------
-TAGFILES =
-GENERATE_TAGFILE =
+
+# The TAGFILES tag can be used to specify one or more tag files. For each tag
+# file the location of the external documentation should be added. The format of
+# a tag file without this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where loc1 and loc2 can be relative or absolute paths or URLs. See the
+# section "Linking to external documentation" for more information about the use
+# of tag files.
+# Note: Each tag file must have a unique name (where the name does NOT include
+# the path). If a tag file is not located in the directory in which doxygen is
+# run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create a
+# tag file that is based on the input files it reads. See section "Linking to
+# external documentation" for more information about the usage of tag files.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES, all external class will be listed in
+# the class index. If set to NO, only the inherited external classes will be
+# listed.
+# The default value is: NO.
+
ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will be
+# listed.
+# The default value is: YES.
+
EXTERNAL_GROUPS = YES
+
+# If the EXTERNAL_PAGES tag is set to YES, all external pages will be listed in
+# the related pages index. If set to NO, only the current project's pages will
+# be listed.
+# The default value is: YES.
+
+EXTERNAL_PAGES = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of 'which perl').
+# The default file (with absolute path) is: /usr/bin/perl.
+
PERL_PATH = /usr/bin/perl
+
#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
+# Configuration options related to the dot tool
#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram
+# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to
+# NO turns the diagrams off. Note that this option also works with HAVE_DOT
+# disabled, but it is recommended to install and use dot, since it yields more
+# powerful graphs.
+# The default value is: YES.
+
CLASS_DIAGRAMS = YES
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see:
+# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# You can include diagrams made with dia in doxygen documentation. Doxygen will
+# then run dia to produce the diagram and insert it in the documentation. The
+# DIA_PATH tag allows you to specify the directory where the dia binary resides.
+# If left empty dia is assumed to be found in the default search path.
+
+DIA_PATH =
+
+# If set to YES the inheritance and collaboration graphs will hide inheritance
+# and usage relations if the target is undocumented or is not a class.
+# The default value is: YES.
+
HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz (see:
+# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent
+# Bell Labs. The other options in this section have no effect if this option is
+# set to NO
+# The default value is: NO.
+
HAVE_DOT = NO
+
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
+# to run in parallel. When set to 0 doxygen will base this on the number of
+# processors available in the system. You can set it explicitly to a value
+# larger than 0 to get control over the balance between CPU load and processing
+# speed.
+# Minimum value: 0, maximum value: 32, default value: 0.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_NUM_THREADS = 0
+
+# When you want a differently looking font in the dot files that doxygen
+# generates you can specify the font name using DOT_FONTNAME. You need to make
+# sure dot is able to find the font, which can be done by putting it in a
+# standard location or by setting the DOTFONTPATH environment variable or by
+# setting DOT_FONTPATH to the directory containing the font.
+# The default value is: Helvetica.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_FONTNAME = Helvetica
+
+# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of
+# dot graphs.
+# Minimum value: 4, maximum value: 24, default value: 10.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the default font as specified with
+# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set
+# the path where dot can find it using this tag.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for
+# each documented class showing the direct and indirect inheritance relations.
+# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
CLASS_GRAPH = YES
+
+# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a
+# graph for each documented class showing the direct and indirect implementation
+# dependencies (inheritance, containment, and class references variables) of the
+# class with other documented classes.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
COLLABORATION_GRAPH = YES
+
+# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for
+# groups, showing the direct groups dependencies.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+GROUP_GRAPHS = YES
+
+# If the UML_LOOK tag is set to YES, doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
UML_LOOK = NO
+
+# If the UML_LOOK tag is enabled, the fields and methods are shown inside the
+# class node. If there are many fields or methods and many nodes the graph may
+# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the
+# number of items for each type to make the size more manageable. Set this to 0
+# for no limit. Note that the threshold may be exceeded by 50% before the limit
+# is enforced. So when you set the threshold to 10, up to 15 fields may appear,
+# but if the number exceeds 15, the total amount of fields shown is limited to
+# 10.
+# Minimum value: 0, maximum value: 100, default value: 10.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+UML_LIMIT_NUM_FIELDS = 10
+
+# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and
+# collaboration graphs will show the relations between templates and their
+# instances.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
TEMPLATE_RELATIONS = NO
+
+# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to
+# YES then doxygen will generate a graph for each documented file showing the
+# direct and indirect include dependencies of the file with other documented
+# files.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
INCLUDE_GRAPH = YES
+
+# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are
+# set to YES then doxygen will generate a graph for each documented file showing
+# the direct and indirect include dependencies of the file with other documented
+# files.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
INCLUDED_BY_GRAPH = YES
+
+# If the CALL_GRAPH tag is set to YES then doxygen will generate a call
+# dependency graph for every global function or class method.
+#
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable call graphs for selected
+# functions only using the \callgraph command.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
CALL_GRAPH = NO
+
+# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller
+# dependency graph for every global function or class method.
+#
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable caller graphs for selected
+# functions only using the \callergraph command.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical
+# hierarchy of all classes instead of a textual one.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
GRAPHICAL_HIERARCHY = YES
+
+# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the
+# dependencies a directory has on other directories in a graphical way. The
+# dependency relations are determined by the #include relations between the
+# files in the directories.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DIRECTORY_GRAPH = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot.
+# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order
+# to make the SVG files visible in IE 9+ (other browsers do not have this
+# requirement).
+# Possible values are: png, jpg, gif and svg.
+# The default value is: png.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
DOT_IMAGE_FORMAT = png
-DOT_PATH =
-DOTFILE_DIRS =
-MAX_DOT_GRAPH_WIDTH = 1024
-MAX_DOT_GRAPH_HEIGHT = 1024
+
+# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
+# enable generation of interactive SVG images that allow zooming and panning.
+#
+# Note that this requires a modern browser other than Internet Explorer. Tested
+# and working are Firefox, Chrome, Safari, and Opera.
+# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make
+# the SVG files visible. Older versions of IE do not have SVG support.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+INTERACTIVE_SVG = NO
+
+# The DOT_PATH tag can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_PATH =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the \dotfile
+# command).
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOTFILE_DIRS =
+
+# The MSCFILE_DIRS tag can be used to specify one or more directories that
+# contain msc files that are included in the documentation (see the \mscfile
+# command).
+
+MSCFILE_DIRS =
+
+# The DIAFILE_DIRS tag can be used to specify one or more directories that
+# contain dia files that are included in the documentation (see the \diafile
+# command).
+
+DIAFILE_DIRS =
+
+# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the
+# path where java can find the plantuml.jar file. If left blank, it is assumed
+# PlantUML is not used or called during a preprocessing step. Doxygen will
+# generate a warning when it encounters a \startuml command in this case and
+# will not generate output for the diagram.
+
+PLANTUML_JAR_PATH =
+
+# When using plantuml, the specified paths are searched for files specified by
+# the !include statement in a plantuml block.
+
+PLANTUML_INCLUDE_PATH =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes
+# that will be shown in the graph. If the number of nodes in a graph becomes
+# larger than this value, doxygen will truncate the graph, which is visualized
+# by representing a node as a red box. Note that doxygen if the number of direct
+# children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that
+# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+# Minimum value: 0, maximum value: 10000, default value: 50.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_GRAPH_MAX_NODES = 50
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs
+# generated by dot. A depth value of 3 means that only nodes reachable from the
+# root by following a path via at most 3 edges will be shown. Nodes that lay
+# further from the root node will be omitted. Note that setting this option to 1
+# or 2 may greatly reduce the computation time needed for large code bases. Also
+# note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+# Minimum value: 0, maximum value: 1000, default value: 0.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
MAX_DOT_GRAPH_DEPTH = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not seem
+# to support this out of the box.
+#
+# Warning: Depending on the platform used, enabling this option may lead to
+# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
+# read).
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_TRANSPARENT = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10) support
+# this, this feature is disabled by default.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page
+# explaining the meaning of the various boxes and arrows in the dot generated
+# graphs.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate dot
+# files that are used to generate the various graphs.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
DOT_CLEANUP = YES
-#---------------------------------------------------------------------------
-# Configuration::addtions related to the search engine
-#---------------------------------------------------------------------------
-SEARCHENGINE = NO
-CGI_NAME = search.cgi
-CGI_URL =
-DOC_URL =
-DOC_ABSPATH =
-BIN_ABSPATH = /usr/local/bin/
-EXT_DOC_PATHS =
diff --git a/pcilib/bank.h b/pcilib/bank.h
index 2f90321..f974b0a 100644
--- a/pcilib/bank.h
+++ b/pcilib/bank.h
@@ -8,9 +8,10 @@
#define PCILIB_REGISTER_BANK1 1
#define PCILIB_REGISTER_BANK2 2
#define PCILIB_REGISTER_BANK3 3
-#define PCILIB_REGISTER_BANK_PROPERTY 64 /**< Registers abstracting properties and other computed registers */
-#define PCILIB_REGISTER_BANK_DMA 96 /**< First BANK address to be used by DMA engines */
+#define PCILIB_REGISTER_BANK_CONF 64 /**< Configuration registers */
+#define PCILIB_REGISTER_BANK_PROPERTY 65 /**< Registers abstracting properties and other computed registers */
#define PCILIB_REGISTER_BANK_DMACONF 96 /**< DMA configuration in the software registers */
+#define PCILIB_REGISTER_BANK_DMA 97 /**< First BANK address to be used by DMA engines */
#define PCILIB_REGISTER_BANK_DYNAMIC 128 /**< First BANK address to map dynamic XML configuration */
#define PCILIB_REGISTER_PROTOCOL_INVALID ((pcilib_register_protocol_t)-1)
#define PCILIB_REGISTER_PROTOCOL0 0 /**< First PROTOCOL address to be used in the event engine */
@@ -60,7 +61,7 @@ typedef struct {
uintptr_t write_addr; /**< protocol specific (normally offset in the BAR of the first address used to write registers) */
uint8_t access; /**< Default register size in bits (or word-size in plain addressing mode) */
- size_t size; /**< Number of register addresses (plain addressing) in the bank (more register names can be defined if bit-fields/views are used) */
+ size_t size; /**< The size of the bank in bytes (i.e. number of registers in plain addressing mode multiplied by access; this does not limit number of register names since indefinite number of names can be provided if bit-fields/views are used) */
pcilib_endianess_t raw_endianess; /**< Specifies endianess in the plain-addressing mode, PCILIB_HOST_ENDIAN have to be specified if no conversion desired.
Conversion applied after protocol. This value does not get into the account in register-access mode */
pcilib_endianess_t endianess; /**< Specifies endianess in the register-access mode, this may differ from raw_endianess if multi-word registers are used.
@@ -163,8 +164,8 @@ pcilib_register_protocol_t pcilib_find_register_protocol_by_addr(pcilib_t *ctx,
pcilib_register_protocol_t pcilib_find_register_protocol_by_name(pcilib_t *ctx, const char *name);
pcilib_register_protocol_t pcilib_find_register_protocol(pcilib_t *ctx, const char *name);
-
int pcilib_get_register_bank_attr_by_id(pcilib_t *ctx, pcilib_register_bank_t bank, const char *attr, pcilib_value_t *val);
+int pcilib_get_register_bank_attr(pcilib_t *ctx, const char *bankname, const char *attr, pcilib_value_t *val);
#ifdef __cplusplus
}
diff --git a/pcilib/bar.c b/pcilib/bar.c
index 074a0b2..095fa4a 100644
--- a/pcilib/bar.c
+++ b/pcilib/bar.c
@@ -130,6 +130,41 @@ void pcilib_unmap_bar(pcilib_t *ctx, pcilib_bar_t bar, void *data) {
#endif
}
+char *pcilib_resolve_bar_address(pcilib_t *ctx, pcilib_bar_t bar, uintptr_t addr) {
+ if (bar == PCILIB_BAR_DETECT) {
+ bar = pcilib_detect_bar(ctx, addr, 1);
+ if (bar != PCILIB_BAR_INVALID) {
+ size_t offset = addr - ctx->board_info.bar_start[bar];
+ if ((offset < ctx->board_info.bar_length[bar])&&(ctx->bar_space[bar])) {
+ if (!ctx->bar_space[bar]) {
+ if (!pcilib_map_bar(ctx, bar)) {
+ pcilib_error("Failed to map the requested bar (%i)", bar);
+ return NULL;
+ }
+ }
+ return ctx->bar_space[bar] + offset + (ctx->board_info.bar_start[bar] & ctx->page_mask);
+ }
+ }
+ } else {
+ if (!ctx->bar_space[bar]) {
+ if (!pcilib_map_bar(ctx, bar)) {
+ pcilib_error("Failed to map the requested bar (%i)", bar);
+ return NULL;
+ }
+ }
+
+ if (addr < ctx->board_info.bar_length[bar]) {
+ return ctx->bar_space[bar] + addr + (ctx->board_info.bar_start[bar] & ctx->page_mask);
+ }
+
+ if ((addr >= ctx->board_info.bar_start[bar])&&(addr < (ctx->board_info.bar_start[bar] + ctx->board_info.bar_length[ctx->reg_bar]))) {
+ return ctx->bar_space[bar] + (addr - ctx->board_info.bar_start[bar]) + (ctx->board_info.bar_start[bar] & ctx->page_mask);
+ }
+ }
+
+ return NULL;
+}
+
int pcilib_map_register_space(pcilib_t *ctx) {
int err;
pcilib_register_bank_t i;
@@ -183,6 +218,91 @@ int pcilib_map_register_space(pcilib_t *ctx) {
return 0;
}
+char *pcilib_resolve_register_address(pcilib_t *ctx, pcilib_bar_t bar, uintptr_t addr) {
+ if (bar == PCILIB_BAR_DETECT) {
+ // First checking the default register bar
+ size_t offset = addr - ctx->board_info.bar_start[ctx->reg_bar];
+ if ((addr > ctx->board_info.bar_start[ctx->reg_bar])&&(offset < ctx->board_info.bar_length[ctx->reg_bar])) {
+ return pcilib_resolve_bar_address(ctx, ctx->reg_bar, addr - ctx->board_info.bar_start[ctx->reg_bar]);
+ }
+ }
+ // Otherwise trying to detect
+ return pcilib_resolve_bar_address(ctx, bar, addr);
+}
+
+int pcilib_map_data_space(pcilib_t *ctx, uintptr_t addr) {
+ int err;
+ pcilib_bar_t i;
+
+ if (!ctx->data_bar_mapped) {
+ const pcilib_board_info_t *board_info = pcilib_get_board_info(ctx);
+ if (!board_info) return PCILIB_ERROR_FAILED;
+
+ err = pcilib_map_register_space(ctx);
+ if (err) {
+ pcilib_error("Error mapping register space");
+ return err;
+ }
+
+ int data_bar = -1;
+
+ for (i = 0; i < PCILIB_MAX_BARS; i++) {
+ if ((ctx->bar_space[i])||(!board_info->bar_length[i])) continue;
+
+ if (addr) {
+ if (board_info->bar_start[i] == addr) {
+ data_bar = i;
+ break;
+ }
+ } else {
+ if (data_bar >= 0) {
+ data_bar = -1;
+ break;
+ }
+
+ data_bar = i;
+ }
+ }
+
+
+ if (data_bar < 0) {
+ if (addr) pcilib_error("Unable to find the specified data space (%lx)", addr);
+ else pcilib_error("Unable to find the data space");
+ return PCILIB_ERROR_NOTFOUND;
+ }
+
+ ctx->data_bar = data_bar;
+
+ if (!ctx->bar_space[data_bar]) {
+ char *data_space = pcilib_map_bar(ctx, data_bar);
+ if (data_space) ctx->bar_space[data_bar] = data_space;
+ else {
+ pcilib_error("Unable to map the data space");
+ return PCILIB_ERROR_FAILED;
+ }
+ }
+
+ ctx->data_bar_mapped = 0;
+ }
+
+ return 0;
+}
+
+char *pcilib_resolve_data_space(pcilib_t *ctx, uintptr_t addr, size_t *size) {
+ int err;
+
+ err = pcilib_map_data_space(ctx, addr);
+ if (err) {
+ pcilib_error("Failed to map the specified address space (%lx)", addr);
+ return NULL;
+ }
+
+ if (size) *size = ctx->board_info.bar_length[ctx->data_bar];
+
+ return ctx->bar_space[ctx->data_bar] + (ctx->board_info.bar_start[ctx->data_bar] & ctx->page_mask);
+}
+
+
int pcilib_read(pcilib_t *ctx, pcilib_bar_t bar, uintptr_t addr, size_t size, void *buf) {
void *data;
diff --git a/pcilib/bar.h b/pcilib/bar.h
index 9ab1cc0..deb6f81 100644
--- a/pcilib/bar.h
+++ b/pcilib/bar.h
@@ -5,9 +5,75 @@
extern "C" {
#endif
+/**
+ * Detects in which PCI BAR the specified buffer is residing. The complete specified buffer
+ * of \a size bytes should fit into the BAR. Otherwise, an error will be returned.
+ * @param[in] ctx - pcilib context
+ * @param[in] addr - physical address of the begining of the buffer
+ * @param[in] size - the size of the buffer
+ * @return - return the BAR (numbered from 0) or PCILIB_BAR_INVALID if buffer does not belong to any BAR.
+ */
pcilib_bar_t pcilib_detect_bar(pcilib_t *ctx, uintptr_t addr, size_t size);
+
+/**
+ * Maps the specified bar to the address space of the process. This function may be called multiple times for
+ * the same bar. It will only map the BAR once. Normally, the required BARs will be automatically mapped when
+ * BAR addresses are resolved with pcilib_resolve_bar_address() and similar.
+ * @param[in,out] ctx - pcilib context
+ * @param[in] bar - the PCI BAR number (numbered from 0)
+ * return - the address where the BAR is mapped. You can't use this address directly,
+ * instead pcilib_resolve_register_address(ctx, bar, 0) have to be used to find
+ * the start of the BAR in virtual address space.
+ */
+void *pcilib_map_bar(pcilib_t *ctx, pcilib_bar_t bar);
+
+/**
+ * Unmaps the specified bar from the address space of the process. Actually, it will only unmap the BAR if it is
+ * not used by DMA or Event egines. So, it is fine to include the calls to pcilib_map_bar() / pcilib_unmap_bar()
+ * when a specific BAR is needed. On other hand, there is a little point in doing so. The BAR may be left mapped
+ * and will be automatically umapped when pcilib_close() is called.
+ * @param[in,out] ctx - pcilib context
+ * @param[in] bar - BAR number (numbered from 0)
+ * @param[in,out] data - The address returned by pcilib_map_bar() call
+ */
+void pcilib_unmap_bar(pcilib_t *ctx, pcilib_bar_t bar, void *data);
+
+/**
+ * Detects the BAR and mapping offset of the specified PCI buffer. The complete specified buffer
+ * of \a size bytes should fit into the BAR. Otherwise, an error will be returned.
+ * @param[in] ctx - pcilib context
+ * @param[in,out] bar - the function will check if the buffer belongs to the specified BAR unless bar is PCILIB_BAR_DETECT.
+ * It will be set to the actually detected BAR in the last case.
+ * @param[in,out] addr - specifies the address to detect. The address may be specified as absolute physical address or offset in the BAR.
+ * On success, the addr will contain offset which should be added to the address returned by pcilib_map_bar()
+ * to get position of BAR mapping in virtual address space.
+ * @param[in] size - the size of the buffer
+ * @return - error code or 0 in case of success
+ */
int pcilib_detect_address(pcilib_t *ctx, pcilib_bar_t *bar, uintptr_t *addr, size_t size);
+/**
+ * Resolves the virtual address and the size of PCI BAR space used for data exchange.
+ * This is left-over from older version of pcilib and currently unused. We may reconsider
+ * how it is organized and implemented. The data_space parameter may go into the model definition.
+ * @param[in] ctx - pcilib context
+ * @param[in] addr - may hint there the data space is located, use 0 to autodetect
+ * @param[out] size - the size of data space is returned
+ * @return - virtual address of data space (ready to use) or NULL if detection has failed
+ */
+char *pcilib_resolve_data_space(pcilib_t *ctx, uintptr_t addr, size_t *size);
+
+
+/**
+ * The wrapper arround pcilib_resolve_bar_address() provided for backward compatibility.
+ * If bar is not specified, it first checks the first BAR with registers, before searching
+ * in other available BARs.
+ * @param[in,out] ctx - pcilib context
+ * @param[in] bar - specifies the BAR address belong to, use PCILIB_BAR_DETECT for autodetection
+ * @param[in] addr - specifies the physical address on the PCI bus or offset in the BAR if \a bar is specified
+ * @return - the virtual address in the process address space or NULL in case of error
+ */
+char *pcilib_resolve_register_address(pcilib_t *ctx, pcilib_bar_t bar, uintptr_t addr);
#ifdef __cplusplus
}
diff --git a/pcilib/event.c b/pcilib/event.c
index 2fc77ab..6b37dac 100644
--- a/pcilib/event.c
+++ b/pcilib/event.c
@@ -147,6 +147,9 @@ int pcilib_configure_preprocessing_threads(pcilib_t *ctx, size_t max_threads) {
}
int pcilib_start(pcilib_t *ctx, pcilib_event_t event_mask, pcilib_event_flags_t flags) {
+ int err;
+ pcilib_register_value_t max_threads;
+
const pcilib_event_api_description_t *api;
const pcilib_model_description_t *model_info = pcilib_get_model_description(ctx);
@@ -156,6 +159,12 @@ int pcilib_start(pcilib_t *ctx, pcilib_event_t event_mask, pcilib_event_flags_t
return PCILIB_ERROR_NOTSUPPORTED;
}
+ err = pcilib_read_register(ctx, "conf", "max_threads", &max_threads);
+ if (!err) {
+ err = pcilib_configure_preprocessing_threads(ctx, max_threads);
+ if (err) pcilib_warning("Error (%i) configuring number of preprocessing threads", err);
+ }
+
if (api->start)
return api->start(ctx->event_ctx, event_mask, flags);
@@ -430,7 +439,12 @@ int pcilib_grab(pcilib_t *ctx, pcilib_event_t event_mask, size_t *size, void **d
pcilib_grab_callback_user_data_t user = {ctx, size, data};
err = pcilib_start(ctx, event_mask, PCILIB_EVENT_FLAGS_DEFAULT);
- if (!err) err = pcilib_trigger(ctx, event_mask, 0, NULL);
+ if (!err) {
+ if (timeout == PCILIB_TIMEOUT_IMMEDIATE) {
+ err = pcilib_trigger(ctx, event_mask, 0, NULL);
+ timeout = PCILIB_EVENT_TIMEOUT;
+ }
+ }
if (!err) {
err = pcilib_get_next_event(ctx, timeout, &eid, 0, NULL);
if (!err) pcilib_grab_callback(event_mask, eid, &user);
diff --git a/pcilib/event.h b/pcilib/event.h
index f14abeb..ff12612 100644
--- a/pcilib/event.h
+++ b/pcilib/event.h
@@ -84,6 +84,12 @@ extern "C" {
int pcilib_init_event_engine(pcilib_t *ctx);
+/*
+ * Configures maximal number of preprocessing threads. Actual amount of threads
+ * may be bigger. For instance, additionaly a real-time reader thread will be
+ * executed for most of hardware
+ */
+int pcilib_configure_preprocessing_threads(pcilib_t *ctx, size_t max_threads);
#ifdef __cplusplus
}
diff --git a/pcilib/export.c b/pcilib/export.c
index 8e1a7d2..6ee6a2c 100644
--- a/pcilib/export.c
+++ b/pcilib/export.c
@@ -12,16 +12,27 @@ const char *pcilib_data_types[] = { "default", "string", "double", "long" };
#include "protocols/software.h"
#include "protocols/property.h"
-const pcilib_register_protocol_description_t pcilib_protocols[] = {
+const pcilib_register_protocol_description_t pcilib_standard_register_protocols[] = {
{ PCILIB_REGISTER_PROTOCOL_DEFAULT, &pcilib_default_protocol_api, NULL, NULL, "default", "" },
{ PCILIB_REGISTER_PROTOCOL_SOFTWARE, &pcilib_software_protocol_api, NULL, NULL, "software_registers", "" },
{ PCILIB_REGISTER_PROTOCOL_PROPERTY, &pcilib_property_protocol_api, NULL, NULL, "property_registers", "" },
{ 0 }
};
-const pcilib_register_bank_description_t pcilib_property_register_bank =
- { PCILIB_REGISTER_BANK_PROPERTY, PCILIB_REGISTER_PROTOCOL_PROPERTY, PCILIB_BAR_NOBAR, 0, 0, 32, 0, PCILIB_HOST_ENDIAN, PCILIB_HOST_ENDIAN, "%lu", "property", "Computed registers interfacing properties"};
+const pcilib_register_bank_description_t pcilib_standard_register_banks[] = {
+ { PCILIB_REGISTER_BANK_CONF, PCILIB_REGISTER_PROTOCOL_SOFTWARE, PCILIB_BAR_NOBAR, 0, 0, 32, 0, PCILIB_HOST_ENDIAN, PCILIB_HOST_ENDIAN, "%lu", "conf", "pcilib configuration"},
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL }
+};
+
+const pcilib_register_description_t pcilib_standard_registers[] = {
+ {0x0000, 0, 32, PCILIB_VERSION, 0x00000000, PCILIB_REGISTER_R , PCILIB_REGISTER_STANDARD, PCILIB_REGISTER_BANK_CONF, "version", "Version"},
+ {0x0004, 0, 32, 0, 0x00000000, PCILIB_REGISTER_RW , PCILIB_REGISTER_STANDARD, PCILIB_REGISTER_BANK_CONF, "max_threads", "Limits number of threads used by event engines (0 - unlimited)"},
+ {0, 0, 0, 0, 0x00000000, 0, 0, 0, NULL, NULL}
+};
+
+const pcilib_register_bank_description_t pcilib_property_register_bank =
+ { PCILIB_REGISTER_BANK_PROPERTY, PCILIB_REGISTER_PROTOCOL_PROPERTY, PCILIB_BAR_NOBAR, 0, 0, 8 * sizeof(pcilib_register_value_t), 0, PCILIB_HOST_ENDIAN, PCILIB_HOST_ENDIAN, "%lu", "property", "Computed registers interfacing properties"};
#include "dma/nwl.h"
diff --git a/pcilib/export.h b/pcilib/export.h
index 7d3ff35..2046d71 100644
--- a/pcilib/export.h
+++ b/pcilib/export.h
@@ -8,7 +8,10 @@
extern const char *pcilib_data_types[];
-extern const pcilib_register_protocol_description_t pcilib_protocols[];
+extern const pcilib_register_protocol_description_t pcilib_standard_register_protocols[];
+extern const pcilib_register_bank_description_t pcilib_standard_register_banks[];
+extern const pcilib_register_description_t pcilib_standard_registers[];
+
extern const pcilib_dma_description_t pcilib_dma[];
extern const pcilib_register_protocol_api_description_t pcilib_default_protocol_api;
diff --git a/pcilib/lock.h b/pcilib/lock.h
index e3a5b02..0b2a7be 100644
--- a/pcilib/lock.h
+++ b/pcilib/lock.h
@@ -50,7 +50,7 @@ void pcilib_free_lock(pcilib_lock_t *lock_ctx);
/**
* this function gives the identifier name associated to a lock in the kernel space
- * @param[in] loc - pointer to the lock we want the name
+ * @param[in] lock - pointer to the lock we want the name
* @return string corresponding to the name
*/
const char *pcilib_lock_get_name(pcilib_lock_t *lock);
@@ -64,7 +64,7 @@ const char *pcilib_lock_get_name(pcilib_lock_t *lock);
void pcilib_lock_ref(pcilib_lock_t *lock);
/**
- * Decrement reference count(number of processes that may access the given lock).
+ * Decrement reference count (number of processes that may access the given lock)
* Not thread/process safe unless system supports stdatomic (gcc 4.9+). In this case, the access should be synchronized by the caller
* @param[in,out] lock - pointer to initialized lock
*/
diff --git a/pcilib/locking.h b/pcilib/locking.h
index 5e4c6e9..b8126a8 100644
--- a/pcilib/locking.h
+++ b/pcilib/locking.h
@@ -67,7 +67,7 @@ pcilib_lock_t *pcilib_get_lock_by_id(pcilib_t *ctx, pcilib_lock_id_t id);
*this function verify if the lock requested exists in the kernel space. If yes, then nothing is done, else we create the lock in the kernel space. This function also gives the number of processes that may request the lock afterwards, including the one that just created it.
*@param[in] ctx - the pcilib_t structure running
*@param[in] flags - the flag defining the property of the lock
- *@param[in@ lock_id - the identifier name for the lock
+ *@param[in] lock_id - the identifier name for the lock
*@return the corresponding lock, or a new one if it did not exist before
*/
pcilib_lock_t *pcilib_get_lock(pcilib_t *ctx, pcilib_lock_flags_t flags, const char *lock_id, ...);
diff --git a/pcilib/pci.c b/pcilib/pci.c
index ae892a2..4b8b8bb 100644
--- a/pcilib/pci.c
+++ b/pcilib/pci.c
@@ -107,7 +107,6 @@ static int pcilib_detect_model(pcilib_t *ctx, const char *model) {
pcilib_t *pcilib_open(const char *device, const char *model) {
int err, xmlerr;
- size_t i;
pcilib_t *ctx = malloc(sizeof(pcilib_t));
if (!model)
@@ -167,10 +166,9 @@ pcilib_t *pcilib_open(const char *device, const char *model) {
memset(ctx->register_ctx, 0, PCILIB_DEFAULT_REGISTER_SPACE * sizeof(pcilib_register_context_t));
-
- for (i = 0; pcilib_protocols[i].api; i++);
- memcpy(ctx->protocols, pcilib_protocols, i * sizeof(pcilib_register_protocol_description_t));
- ctx->num_protocols = i;
+ pcilib_add_register_protocols(ctx, PCILIB_MODEL_MODIFICATON_FLAGS_DEFAULT, 0, pcilib_standard_register_protocols, NULL);
+ pcilib_add_register_banks(ctx, PCILIB_MODEL_MODIFICATON_FLAGS_DEFAULT, 0, pcilib_standard_register_banks, NULL);
+ pcilib_add_registers(ctx, PCILIB_MODEL_MODIFICATON_FLAGS_DEFAULT, 0, pcilib_standard_registers, NULL);
err = pcilib_detect_model(ctx, model);
if ((err)&&(err != PCILIB_ERROR_NOTFOUND)) {
@@ -248,122 +246,6 @@ pcilib_context_t *pcilib_get_implementation_context(pcilib_t *ctx) {
}
-int pcilib_map_data_space(pcilib_t *ctx, uintptr_t addr) {
- int err;
- pcilib_bar_t i;
-
- if (!ctx->data_bar_mapped) {
- const pcilib_board_info_t *board_info = pcilib_get_board_info(ctx);
- if (!board_info) return PCILIB_ERROR_FAILED;
-
- err = pcilib_map_register_space(ctx);
- if (err) {
- pcilib_error("Error mapping register space");
- return err;
- }
-
- int data_bar = -1;
-
- for (i = 0; i < PCILIB_MAX_BARS; i++) {
- if ((ctx->bar_space[i])||(!board_info->bar_length[i])) continue;
-
- if (addr) {
- if (board_info->bar_start[i] == addr) {
- data_bar = i;
- break;
- }
- } else {
- if (data_bar >= 0) {
- data_bar = -1;
- break;
- }
-
- data_bar = i;
- }
- }
-
-
- if (data_bar < 0) {
- if (addr) pcilib_error("Unable to find the specified data space (%lx)", addr);
- else pcilib_error("Unable to find the data space");
- return PCILIB_ERROR_NOTFOUND;
- }
-
- ctx->data_bar = data_bar;
-
- if (!ctx->bar_space[data_bar]) {
- char *data_space = pcilib_map_bar(ctx, data_bar);
- if (data_space) ctx->bar_space[data_bar] = data_space;
- else {
- pcilib_error("Unable to map the data space");
- return PCILIB_ERROR_FAILED;
- }
- }
-
- ctx->data_bar_mapped = 0;
- }
-
- return 0;
-}
-
-char *pcilib_resolve_register_address(pcilib_t *ctx, pcilib_bar_t bar, uintptr_t addr) {
- if (bar == PCILIB_BAR_DETECT) {
- // First checking the default register bar
- size_t offset = addr - ctx->board_info.bar_start[ctx->reg_bar];
- if ((addr > ctx->board_info.bar_start[ctx->reg_bar])&&(offset < ctx->board_info.bar_length[ctx->reg_bar])) {
- if (!ctx->bar_space[ctx->reg_bar]) {
- pcilib_error("The register bar is not mapped");
- return NULL;
- }
-
- return ctx->bar_space[ctx->reg_bar] + offset + (ctx->board_info.bar_start[ctx->reg_bar] & ctx->page_mask);
- }
-
- // Otherwise trying to detect
- bar = pcilib_detect_bar(ctx, addr, 1);
- if (bar != PCILIB_BAR_INVALID) {
- size_t offset = addr - ctx->board_info.bar_start[bar];
- if ((offset < ctx->board_info.bar_length[bar])&&(ctx->bar_space[bar])) {
- if (!ctx->bar_space[bar]) {
- pcilib_error("The requested bar (%i) is not mapped", bar);
- return NULL;
- }
- return ctx->bar_space[bar] + offset + (ctx->board_info.bar_start[bar] & ctx->page_mask);
- }
- }
- } else {
- if (!ctx->bar_space[bar]) {
- pcilib_error("The requested bar (%i) is not mapped", bar);
- return NULL;
- }
-
- if (addr < ctx->board_info.bar_length[bar]) {
- return ctx->bar_space[bar] + addr + (ctx->board_info.bar_start[bar] & ctx->page_mask);
- }
-
- if ((addr >= ctx->board_info.bar_start[bar])&&(addr < (ctx->board_info.bar_start[bar] + ctx->board_info.bar_length[ctx->reg_bar]))) {
- return ctx->bar_space[bar] + (addr - ctx->board_info.bar_start[bar]) + (ctx->board_info.bar_start[bar] & ctx->page_mask);
- }
- }
-
- return NULL;
-}
-
-char *pcilib_resolve_data_space(pcilib_t *ctx, uintptr_t addr, size_t *size) {
- int err;
-
- err = pcilib_map_data_space(ctx, addr);
- if (err) {
- pcilib_error("Failed to map the specified address space (%lx)", addr);
- return NULL;
- }
-
- if (size) *size = ctx->board_info.bar_length[ctx->data_bar];
-
- return ctx->bar_space[ctx->data_bar] + (ctx->board_info.bar_start[ctx->data_bar] & ctx->page_mask);
-}
-
-
void pcilib_close(pcilib_t *ctx) {
pcilib_bar_t bar;
diff --git a/pcilib/pcilib.h b/pcilib/pcilib.h
index 30bcdab..272df8d 100644
--- a/pcilib/pcilib.h
+++ b/pcilib/pcilib.h
@@ -91,13 +91,13 @@ typedef enum {
typedef enum {
PCILIB_STREAMING_STOP = 0, /**< stop streaming */
- PCILIB_STREAMING_CONTINUE = 1, /**< wait the default DMA timeout for a new data */
- PCILIB_STREAMING_WAIT = 2, /**< wait the specified timeout for a new data */
- PCILIB_STREAMING_CHECK = 3, /**< do not wait for the data, bail out imideatly if no data ready */
- PCILIB_STREAMING_FAIL = 4, /**< fail if data is not available on timeout */
+ PCILIB_STREAMING_CONTINUE = 1, /**< wait DMA timeout and return gracefuly if no new data appeared */
+ PCILIB_STREAMING_WAIT = 2, /**< wait the specified timeout and return gracefuly if no new data appeared */
+ PCILIB_STREAMING_CHECK = 3, /**< check if more data is available without waiting, return gracefuly if no data is ready */
+ PCILIB_STREAMING_TIMEOUT_MASK = 3, /**< mask specifying all timeout modes */
+ PCILIB_STREAMING_FAIL = 4, /**< a flag indicating that the error should be generated if no data is available upon the timeout (whatever timeout mode is used) */
PCILIB_STREAMING_REQ_FRAGMENT = 5, /**< only fragment of a packet is read, wait for next fragment and fail if no data during DMA timeout */
- PCILIB_STREAMING_REQ_PACKET = 6, /**< wait for next packet and fail if no data during the specified timeout */
- PCILIB_STREAMING_TIMEOUT_MASK = 3 /**< mask specifying all timeout modes */
+ PCILIB_STREAMING_REQ_PACKET = 6 /**< wait for next packet and fail if no data during the specified timeout */
} pcilib_streaming_action_t;
typedef enum {
@@ -199,169 +199,1117 @@ typedef struct {
#define PCILIB_IRQ_SOURCE_DEFAULT 0
#define PCILIB_MODEL_DETECT NULL
-
+/**
+ * Callback function called when pcilib wants to log a new message
+ * @param[in,out] arg - logging context provided with pcilib_set_logger() call
+ * @param[in] file - source file generating the message
+ * @param[in] line - source line generating the message
+ * @param[in] prio - the message priority (messages with priority bellow the currently set loglevel are already filtered)
+ * @param[in] msg - message or printf-style formating string
+ * @param[in] va - vairable parameters defined by formating string
+ */
typedef void (*pcilib_logger_t)(void *arg, const char *file, int line, pcilib_log_priority_t prio, const char *msg, va_list va);
-/**<
+/**
* Callback function called when new data is read by DMA streaming function
- * @ctx - DMA Engine context
- * @flags - DMA Flags
- * @bufsize - size of data in bytes
- * @buf - data
- * @returns
- * <0 - error, stop streaming (the value is negative error code)
- * 0 - stop streaming (PCILIB_STREAMING_STOP)
- * 1 - wait DMA timeout and return gracefuly if no data (PCILIB_STREAMING_CONTINUE)
- * 2 - wait the specified timeout and return gracefuly if no data (PCILIB_STREAMING_WAIT)
- * 3 - check if more data is available without waiting, return gracefuly if not (PCILIB_STREAMING_CHECK)
- * 5 - wait DMA timeout and fail if no data (PCILIB_STREAMING_REQ_FRAGMENT)
- * 6 - wait the specified timeout and fail if no data (PCILIB_STREAMING_REQ_PACKET)
+ * @param[in,out] ctx - DMA Engine context
+ * @param[in] flags - DMA Flags
+ * @param[in] bufsize - size of data in bytes
+ * @param[in] buf - data
+ * @return - #pcilib_streaming_action_t instructing how the streaming should continue or a negative error code in the case of error
*/
typedef int (*pcilib_dma_callback_t)(void *ctx, pcilib_dma_flags_t flags, size_t bufsize, void *buf);
-typedef int (*pcilib_event_callback_t)(pcilib_event_id_t event_id, pcilib_event_info_t *info, void *user);
-typedef int (*pcilib_event_rawdata_callback_t)(pcilib_event_id_t event_id, pcilib_event_info_t *info, pcilib_event_flags_t flags, size_t size, void *data, void *user);
+
+/**
+ * Callback function called when new event is generated by event engine
+ * @param[in] event_id - event id
+ * @param[in] info - event description (depending on event engine may provide additional fields on top of #pcilib_event_info_t)
+ * @param[in,out] user - User-specific data provided in pcilib_stream() call
+ * @return - #pcilib_streaming_action_t instructing how the streaming should continue or a negative error code in the case of error
+ */
+typedef int (*pcilib_event_callback_t)(pcilib_event_id_t event_id, const pcilib_event_info_t *info, void *user);
+
+/**
+ * Callback function called when new portion of raw data is read by event engine
+ * @param[in] event_id - id of the event this data will be associated with if processing is successful
+ * @param[in] info - event description (depending on event engine may provide additional fields on top of #pcilib_event_info_t)
+ * @param[in] flags - may indicate if it is the last portion of data for current event
+ * @param[in] size - size of data in bytes
+ * @param[in,out] data - data (the callback may modify the data, but the size should be kept of course)
+ * @param[in,out] user - User-specific data provided in pcilib_stream() call
+ * @return - #pcilib_streaming_action_t instructing how the streaming should continue or a negative error code in the case of error
+ */
+typedef int (*pcilib_event_rawdata_callback_t)(pcilib_event_id_t event_id, const pcilib_event_info_t *info, pcilib_event_flags_t flags, size_t size, void *data, void *user);
#ifdef __cplusplus
extern "C" {
#endif
+/***********************************************************************************************************//**
+ * \defgroup public_api_global Global Public API (logging, etc.)
+ * Global functions which does not require existing pcilib context
+ * @{
+ */
-
+/**
+ * Replaces default logging function.
+ * @param min_prio - messages with priority below \a min_prio will be ignored
+ * @param logger - configures a new logging function or restores the default one if NULL is passed
+ * @param arg - logging context, this parameter will be passed through to the \a logger
+ * @return - error code or 0 on success
+ */
int pcilib_set_logger(pcilib_log_priority_t min_prio, pcilib_logger_t logger, void *arg);
+/** public_api_global
+ * @}
+ */
+
+
+/***********************************************************************************************************//**
+ * \defgroup public_api Public API
+ * Base pcilib functions which does not belong to the specific APIs
+ * @{
+ */
+
+/**
+ * Initializes pcilib context, detects model configuration, and populates model-specific registers.
+ * Event and DMA engines will not be started automatically, but calls to pcilib_start() / pcilib_start_dma()
+ * are provided for this purpose. In the end, the context should be cleaned using pcilib_stop().
+ * @param[in] device - path to the device file [/dev/fpga0]
+ * @param[in] model - specifies the model of hardware, autodetected if NULL is passed
+ * @return - initialized context or NULL in the case of error
+ */
pcilib_t *pcilib_open(const char *device, const char *model);
+
+/**
+ * Destroy pcilib context and all memory associated with it. The function will stop event engine if necessary,
+ * but DMA engine stay running if it was already running before pcilib_open() was called
+ * @param[in,out] ctx - pcilib context
+ */
void pcilib_close(pcilib_t *ctx);
-pcilib_property_info_t *pcilib_get_property_list(pcilib_t *ctx, const char *branch, pcilib_list_flags_t flags);
-void pcilib_free_property_info(pcilib_t *ctx, pcilib_property_info_t *info);
-pcilib_register_info_t *pcilib_get_register_list(pcilib_t *ctx, const char *bank, pcilib_list_flags_t flags);
-pcilib_register_info_t *pcilib_get_register_info(pcilib_t *ctx, const char *req_bank_name, const char *req_reg_name, pcilib_list_flags_t flags);
-void pcilib_free_register_info(pcilib_t *ctx, pcilib_register_info_t *info);
+/**
+ * Should reset the hardware and software in default state. It is implementation-specific, but is not actively
+ * used in existing implementations because the hardware is initialized from bash scripts which are often
+ * changed by Michele and his band. On the software side, it probably should reset all software registers
+ * to default value and may be additionaly re-start and clear DMA. However, this is not implemented yet.
+ * @param[in,out] ctx - pcilib context
+ * @return - error code or 0 on success
+ */
+
+int pcilib_reset(pcilib_t *ctx);
+/** public_api
+ * @}
+ */
-int pcilib_start_dma(pcilib_t *ctx, pcilib_dma_engine_t dma, pcilib_dma_flags_t flags);
-int pcilib_stop_dma(pcilib_t *ctx, pcilib_dma_engine_t dma, pcilib_dma_flags_t flags);
- // Interrupt API is preliminary and can be significantly changed in future
-int pcilib_enable_irq(pcilib_t *ctx, pcilib_irq_type_t irq_type, pcilib_dma_flags_t flags);
-int pcilib_acknowledge_irq(pcilib_t *ctx, pcilib_irq_type_t irq_type, pcilib_irq_source_t irq_source);
-int pcilib_disable_irq(pcilib_t *ctx, pcilib_dma_flags_t flags);
+/***********************************************************************************************************//**
+ * \defgroup public_api_pci Public PCI API (MMIO)
+ * API for manipulation with memory-mapped PCI BAR space
+ * @{
+ */
-int pcilib_wait_irq(pcilib_t *ctx, pcilib_irq_hw_source_t source, pcilib_timeout_t timeout, size_t *count);
-int pcilib_clear_irq(pcilib_t *ctx, pcilib_irq_hw_source_t source);
+/**
+ * Resolves the phisycal PCI address to a virtual address in the process address space.
+ * The required BAR will be mapped if necessary.
+ * @param[in,out] ctx - pcilib context
+ * @param[in] bar - specifies the BAR address belong to, use PCILIB_BAR_DETECT for autodetection
+ * @param[in] addr - specifies the physical address on the PCI bus or offset in the BAR if \a bar is specified
+ * @return - the virtual address in the process address space or NULL in case of error
+ */
+char *pcilib_resolve_bar_address(pcilib_t *ctx, pcilib_bar_t bar, uintptr_t addr);
+
+/**
+ * Performs PIO read from the PCI BAR. The BAR will be automatically mapped and unmapped if necessary.
+ * @param[in,out] ctx - pcilib context
+ * @param[in] bar - the BAR to read, use PCILIB_BAR_DETECT to detect bar by the specified physical address
+ * @param[in] addr - absolute physical address to read or the offset in the specified bar
+ * @param[in] size - number of bytes to read
+ * @param[out] buf - the read data will be placed in this buffer
+ * @return - error code or 0 on success
+ */
+int pcilib_read(pcilib_t *ctx, pcilib_bar_t bar, uintptr_t addr, size_t size, void *buf);
+
+/**
+ * Performs PIO write to the PCI BAR. The BAR will be automatically mapped and unmapped if necessary.
+ * @param[in,out] ctx - pcilib context
+ * @param[in] bar - the BAR to write, use PCILIB_BAR_DETECT to detect bar by the specified physical address
+ * @param[in] addr - absolute physical address to write or the offset in the specified bar
+ * @param[in] size - number of bytes to write
+ * @param[out] buf - the pointer to the data to be written
+ * @return - error code or 0 on success
+ */
+int pcilib_write(pcilib_t *ctx, pcilib_bar_t bar, uintptr_t addr, size_t size, void *buf);
+
+/**
+ * Performs PIO read from the PCI BAR. The specified address is treated as FIFO and will be read
+ * \a n times. The BAR will be automatically mapped and unmapped if necessary.
+ * @param[in,out] ctx - pcilib context
+ * @param[in] bar - the BAR to read, use PCILIB_BAR_DETECT to detect bar by the specified physical address
+ * @param[in] addr - absolute physical address to read or the offset in the specified bar
+ * @param[in] access - the size of FIFO register in bytes (i.e. if `access = 4`, the 32-bit reads from FIFO will be performed)
+ * @param[in] n - specifies how many times the data should be read from FIFO
+ * @param[out] buf - the data will be placed in this buffer which should be at least `n * access` bytes long
+ * @return - error code or 0 on success
+ */
+int pcilib_read_fifo(pcilib_t *ctx, pcilib_bar_t bar, uintptr_t addr, uint8_t access, size_t n, void *buf);
+
+/**
+ * Performs PIO write to the PCI BAR. The specified address is treated as FIFO and will be written
+ * \a n times. The BAR will be automatically mapped and unmapped if necessary.
+ * @param[in,out] ctx - pcilib context
+ * @param[in] bar - the BAR to write, use PCILIB_BAR_DETECT to detect bar by the specified physical address
+ * @param[in] addr - absolute physical address to write or the offset in the specified bar
+ * @param[in] access - the size of FIFO register in bytes (i.e. if `access = 4`, the 32-bit writes to FIFO will be performed)
+ * @param[in] n - specifies how many times the data should be written to FIFO
+ * @param[out] buf - buffer to write which should be at least `n * access` bytes long
+ * @return - error code or 0 on success
+ */
+int pcilib_write_fifo(pcilib_t *ctx, pcilib_bar_t bar, uintptr_t addr, uint8_t access, size_t n, void *buf);
+
+/** public_api_pci
+ * @}
+ */
+
+
+/***********************************************************************************************************//**
+ * \defgroup public_api_register Public Register API
+ * API for register manipulations
+ * @{
+ */
+
+/**
+ * Returns the list of registers provided by the hardware model.
+ * @param[in,out] ctx - pcilib context
+ * @param[in] bank - if set, only register within the specified bank will be returned
+ * @param[in] flags - currently ignored
+ * @return - the list of the register which should be cleaned with pcilib_free_register_info() or NULL in the case of error
+ */
+pcilib_register_info_t *pcilib_get_register_list(pcilib_t *ctx, const char *bank, pcilib_list_flags_t flags);
-void *pcilib_map_bar(pcilib_t *ctx, pcilib_bar_t bar);
-void pcilib_unmap_bar(pcilib_t *ctx, pcilib_bar_t bar, void *data);
-char *pcilib_resolve_register_address(pcilib_t *ctx, pcilib_bar_t bar, uintptr_t addr); // addr is offset if bar is specified
-char *pcilib_resolve_data_space(pcilib_t *ctx, uintptr_t addr, size_t *size);
+/**
+ * Returns the information about the specified register
+ * @param[in,out] ctx - pcilib context
+ * @param[in] bank - indicates the bank where to look for register, autodetected if NULL is passed
+ * @param[in] reg - the name of the register
+ * @param[in] flags - currently ignored
+ * @return - information about the specified register which should be cleaned with pcilib_free_register_info() or NULL in the case of error
+ */
+pcilib_register_info_t *pcilib_get_register_info(pcilib_t *ctx, const char *bank, const char *reg, pcilib_list_flags_t flags);
+
+/**
+ * Cleans up the memory occupied by register list returned from the pcilib_get_register_list() and pcilib_get_register_info() calls
+ * @param[in,out] ctx - pcilib context
+ * @param[in,out] info - buffer to clean
+ */
+void pcilib_free_register_info(pcilib_t *ctx, pcilib_register_info_t *info);
+/**
+ * Finds register id corresponding to the specified bank and register names. It is faster
+ * to access registers by id instead of names. Therefore, in long running applications it
+ * is preferred to resolve names of all required registers during initialization and access
+ * them using ids only.
+ * @param[in,out] ctx - pcilib context
+ * @param[in] bank - should specify the bank name if register with the same name may occur in multiple banks, NULL otherwise
+ * @param[in] reg - the name of the register
+ * @return - register id or PCILIB_REGISTER_INVALID if register is not found
+ */
pcilib_register_t pcilib_find_register(pcilib_t *ctx, const char *bank, const char *reg);
-pcilib_event_t pcilib_find_event(pcilib_t *ctx, const char *event);
-pcilib_event_data_type_t pcilib_find_event_data_type(pcilib_t *ctx, pcilib_event_t event, const char *data_type);
-pcilib_dma_engine_t pcilib_find_dma_by_addr(pcilib_t *ctx, pcilib_dma_direction_t direction, pcilib_dma_engine_addr_t dma);
-int pcilib_read(pcilib_t *ctx, pcilib_bar_t bar, uintptr_t addr, size_t size, void *buf);
-int pcilib_write(pcilib_t *ctx, pcilib_bar_t bar, uintptr_t addr, size_t size, void *buf);
-int pcilib_write_fifo(pcilib_t *ctx, pcilib_bar_t bar, uintptr_t addr, uint8_t fifo_size, size_t n, void *buf);
-int pcilib_read_fifo(pcilib_t *ctx, pcilib_bar_t bar, uintptr_t addr, uint8_t fifo_size, size_t n, void *buf);
+/**
+ * Extracts additional information about the specified register. The additional information
+ * is model-specific and are provided as extra XML attributes in XML-described registers.
+ * The available attributes are only restricted by used XSD schema.
+ * @param[in,out] ctx - pcilib context
+ * @param[in] reg - register id
+ * @param[in] attr - requested attribute name
+ * @param[in,out] val - the value of attribute is returned here (see \ref public_api_value),
+ * pcilib_clean_value() will be executed if \a val contains data. Therefore it should be always initialized to 0 before first use
+ * @return - error code or 0 on success
+ */
+int pcilib_get_register_attr_by_id(pcilib_t *ctx, pcilib_register_t reg, const char *attr, pcilib_value_t *val);
-int pcilib_skip_dma(pcilib_t *ctx, pcilib_dma_engine_t dma);
-int pcilib_stream_dma(pcilib_t *ctx, pcilib_dma_engine_t dma, uintptr_t addr, size_t size, pcilib_dma_flags_t flags, pcilib_timeout_t timeout, pcilib_dma_callback_t cb, void *cbattr);
-int pcilib_push_dma(pcilib_t *ctx, pcilib_dma_engine_t dma, uintptr_t addr, size_t size, pcilib_dma_flags_t flags, pcilib_timeout_t timeout, void *buf, size_t *written_bytes);
-int pcilib_read_dma(pcilib_t *ctx, pcilib_dma_engine_t dma, uintptr_t addr, size_t size, void *buf, size_t *read_bytes);
-int pcilib_read_dma_custom(pcilib_t *ctx, pcilib_dma_engine_t dma, uintptr_t addr, size_t size, pcilib_dma_flags_t flags, pcilib_timeout_t timeout, void *buf, size_t *read_bytes);
-int pcilib_write_dma(pcilib_t *ctx, pcilib_dma_engine_t dma, uintptr_t addr, size_t size, void *buf, size_t *written_bytes);
-double pcilib_benchmark_dma(pcilib_t *ctx, pcilib_dma_engine_addr_t dma, uintptr_t addr, size_t size, size_t iterations, pcilib_dma_direction_t direction);
+/**
+ * Extracts additional information about the specified register.
+ * Equivalent to the pcilib_get_register_attr_by_id(), but first resolves register id using the specified bank and name.
+ * @param[in,out] ctx - pcilib context
+ * @param[in] bank - should specify the bank name if register with the same name may occur in multiple banks, NULL otherwise
+ * @param[in] regname - register name
+ * @param[in] attr - requested attribute name
+ * @param[in,out] val - the value of attribute is returned here (see \ref public_api_value),
+ * pcilib_clean_value() will be executed if \a val contains data. Therefore it should be always initialized to 0 before first use
+ * @return - error code or 0 on success
+ */
+int pcilib_get_register_attr(pcilib_t *ctx, const char *bank, const char *regname, const char *attr, pcilib_value_t *val);
+/**
+ * Reads one or multiple sequential registers from the specified register bank. This function may provide access
+ * to the undefined registers in the bank. In other cases, the pcilib_read_register() / pcilib_read_register_by_id()
+ * calls are preferred.
+ * @param[in,out] ctx - pcilib context
+ * @param[in] bank - the bank to read (should be specified, no autodetection)
+ * @param[in] addr - the register address within the bank, addresses are counted in bytes not registers (i.e. it is offset in bytes from the start of register bank)
+ * @param[in] n - number of registers to read; i.e. `n * register_size` bytes will be read, where \a register_size is defined in the bank configuration (see #pcilib_register_bank_description_t)
+ * @param[out] buf - the buffer of `n * register_size` bytes long where the data will be stored
+ * @return - error code or 0 on success
+ */
int pcilib_read_register_space(pcilib_t *ctx, const char *bank, pcilib_register_addr_t addr, size_t n, pcilib_register_value_t *buf);
-int pcilib_write_register_space(pcilib_t *ctx, const char *bank, pcilib_register_addr_t addr, size_t n, pcilib_register_value_t *buf);
+
+/**
+ * Writes one or multiple sequential registers from the specified register bank. This function may provide access
+ * to the undefined registers in the bank. In other cases, the pcilib_write_register() / pcilib_write_register_by_id()
+ * calls are preferred.
+ * @param[in,out] ctx - pcilib context
+ * @param[in] bank - the bank to write (should be specified, no autodetection)
+ * @param[in] addr - the register address within the bank, addresses are counted in bytes not registers (i.e. it is offset in bytes from the start of register bank)
+ * @param[in] n - number of registers to write; i.e. `n * register_size` bytes will be written, where \a register_size is defined in the bank configuration (see #pcilib_register_bank_description_t)
+ * @param[in] buf - the buffer of `n * register_size` bytes long with the data
+ * @return - error code or 0 on success
+ */
+int pcilib_write_register_space(pcilib_t *ctx, const char *bank, pcilib_register_addr_t addr, size_t n, const pcilib_register_value_t *buf);
+
+/**
+ * Reads the specified register.
+ * @param[in,out] ctx - pcilib context
+ * @param[in] reg - register id
+ * @param[out] value - the register value is returned here
+ * @return - error code or 0 on success
+ */
int pcilib_read_register_by_id(pcilib_t *ctx, pcilib_register_t reg, pcilib_register_value_t *value);
+
+/**
+ * Writes to the specified register.
+ * @param[in,out] ctx - pcilib context
+ * @param[in] reg - register id
+ * @param[in] value - the register value to write
+ * @return - error code or 0 on success
+ */
int pcilib_write_register_by_id(pcilib_t *ctx, pcilib_register_t reg, pcilib_register_value_t value);
+
+/**
+ * Reads the specified register.
+ * Equivalent to the pcilib_read_register_by_id(), but first resolves register id using the specified bank and name.
+ * @param[in,out] ctx - pcilib context
+ * @param[in] bank - should specify the bank name if register with the same name may occur in multiple banks, NULL otherwise
+ * @param[in] regname - the name of the register
+ * @param[out] value - the register value is returned here
+ * @return - error code or 0 on success
+ */
int pcilib_read_register(pcilib_t *ctx, const char *bank, const char *regname, pcilib_register_value_t *value);
+
+/**
+ * Writes to the specified register.
+ * Equivalent to the pcilib_write_register_by_id(), but first resolves register id using the specified bank and name.
+ * @param[in,out] ctx - pcilib context
+ * @param[in] bank - should specify the bank name if register with the same name may occur in multiple banks, NULL otherwise
+ * @param[in] regname - the name of the register
+ * @param[in] value - the register value to write
+ * @return - error code or 0 on success
+ */
int pcilib_write_register(pcilib_t *ctx, const char *bank, const char *regname, pcilib_register_value_t value);
-int pcilib_read_register_view(pcilib_t *ctx, const char *bank, const char *regname, const char *unit, pcilib_value_t *value);
-int pcilib_write_register_view(pcilib_t *ctx, const char *bank, const char *regname, const char *unit, const pcilib_value_t *value);
-int pcilib_read_register_view_by_id(pcilib_t *ctx, pcilib_register_t reg, const char *view, pcilib_value_t *val);
-int pcilib_write_register_view_by_id(pcilib_t *ctx, pcilib_register_t reg, const char *view, const pcilib_value_t *valarg);
+
+
+/**
+ * Reads a view of the specified register. The views allow to convert values to standard units
+ * or get self-explanatory names associated with the values (enums).
+ * @param[in,out] ctx - pcilib context
+ * @param[in] reg - register id
+ * @param[in] view - specifies the name of the view associated with register or desired units
+ * @param[out] value - the register value is returned here (see \ref public_api_value),
+ * pcilib_clean_value() will be executed if \a val contains data. Therefore it should be always initialized to 0 before first use.
+ * @return - error code or 0 on success
+ */
+int pcilib_read_register_view_by_id(pcilib_t *ctx, pcilib_register_t reg, const char *view, pcilib_value_t *value);
+
+/**
+ * Writes the specified register using value represented in the specified view. The views allow to convert values from standard units
+ * or self-explanatory names associated with the values (enums).
+ * @param[in,out] ctx - pcilib context
+ * @param[in] reg - register id
+ * @param[in] view - specifies the name of the view associated with register or the used units
+ * @param[in] value - the register value in the specified view (see \ref public_api_value)
+ * @return - error code or 0 on success
+ */
+int pcilib_write_register_view_by_id(pcilib_t *ctx, pcilib_register_t reg, const char *view, const pcilib_value_t *value);
+
+/**
+ * Reads a view of the specified register. The views allow to convert values to standard units
+ * or get self-explanatory names associated with the values (enums).
+ * Equivalent to the pcilib_read_register_view_by_id(), but first resolves register id using the specified bank and name.
+ * @param[in,out] ctx - pcilib context
+ * @param[in] bank - should specify the bank name if register with the same name may occur in multiple banks, NULL otherwise
+ * @param[in] regname - the name of the register
+ * @param[in] view - specifies the name of the view associated with register or desired units
+ * @param[out] value - the register value is returned here (see \ref public_api_value),
+ * pcilib_clean_value() will be executed if \a val contains data. Therefore it should be always initialized to 0 before first use
+ * @return - error code or 0 on success
+ */
+int pcilib_read_register_view(pcilib_t *ctx, const char *bank, const char *regname, const char *view, pcilib_value_t *value);
+
+
+/**
+ * Writes the specified register using value represented in the specified view. The views allow to convert values from standard units
+ * or self-explanatory names associated with the values (enums).
+ * Equivalent to the pcilib_write_register_view_by_id(), but first resolves register id using the specified bank and name.
+ * @param[in,out] ctx - pcilib context
+ * @param[in] bank - should specify the bank name if register with the same name may occur in multiple banks, NULL otherwise
+ * @param[in] regname - the name of the register
+ * @param[in] view - specifies the name of the view associated with register or the used units
+ * @param[in] value - the register value in the specified view (see \ref public_api_value)
+ * @return - error code or 0 on success
+ */
+int pcilib_write_register_view(pcilib_t *ctx, const char *bank, const char *regname, const char *view, const pcilib_value_t *value);
+
+/** public_api_register
+ * @}
+ */
+
+/***********************************************************************************************************//**
+ * \defgroup public_api_property Public Property API
+ * Properties is another abstraction on top of registers allowing arbitrary data types and computed registers
+ * @{
+ */
+
+/**
+ * Returns the list of properties available under the specified path
+ * @param[in,out] ctx - pcilib context
+ * @param[in] branch - path or NULL to return the top-level properties
+ * @param[in] flags - not used at the moment
+ * @return - the list of the properties which should be cleaned with pcilib_free_property_info() or NULL in the case of error
+ */
+pcilib_property_info_t *pcilib_get_property_list(pcilib_t *ctx, const char *branch, pcilib_list_flags_t flags);
+
+/**
+ * Cleans up the memory occupied by property list returned from the pcilib_get_property_list() call
+ * @param[in,out] ctx - pcilib context
+ * @param[in,out] info - buffer to clean
+ */
+void pcilib_free_property_info(pcilib_t *ctx, pcilib_property_info_t *info);
+
+/**
+ * Extracts additional information about the specified register.
+ * Equivalent to the pcilib_get_register_attr_by_id(), but first resolves register id using the specified bank and name.
+ * @param[in,out] ctx - pcilib context
+ * @param[in] prop - property name (full name including path)
+ * @param[in] attr - requested attribute name
+ * @param[in,out] val - the value of attribute is returned here (see \ref public_api_value),
+ * pcilib_clean_value() will be executed if \a val contains data. Therefore it should be always initialized to 0 before first use
+ * @return - error code or 0 on success
+ */
+int pcilib_get_property_attr(pcilib_t *ctx, const char *prop, const char *attr, pcilib_value_t *val);
+
+/**
+ * Reads / computes the property value.
+ * @param[in,out] ctx - pcilib context
+ * @param[in] prop - property name (full name including path)
+ * @param[out] val - the register value is returned here (see \ref public_api_value),
+ * pcilib_clean_value() will be executed if \a val contains data. Therefore it should be always initialized to 0 before first use
+ * @return - error code or 0 on success
+ */
int pcilib_get_property(pcilib_t *ctx, const char *prop, pcilib_value_t *val);
+
+/**
+ * Writes the property value or executes the code associated with property
+ * @param[in,out] ctx - pcilib context
+ * @param[in] prop - property name (full name including path)
+ * @param[out] val - the property value (see \ref public_api_value),
+ * @return - error code or 0 on success
+ */
int pcilib_set_property(pcilib_t *ctx, const char *prop, const pcilib_value_t *val);
-void pcilib_clean_value(pcilib_t *ctx, pcilib_value_t *val);
-int pcilib_copy_value(pcilib_t *ctx, pcilib_value_t *dst, const pcilib_value_t *src);
-int pcilib_set_value_from_float(pcilib_t *ctx, pcilib_value_t *val, double fval);
-int pcilib_set_value_from_int(pcilib_t *ctx, pcilib_value_t *val, long ival);
-int pcilib_set_value_from_register_value(pcilib_t *ctx, pcilib_value_t *value, pcilib_register_value_t regval);
-int pcilib_set_value_from_static_string(pcilib_t *ctx, pcilib_value_t *value, const char *str);
-double pcilib_get_value_as_float(pcilib_t *ctx, const pcilib_value_t *val, int *err);
-long pcilib_get_value_as_int(pcilib_t *ctx, const pcilib_value_t *val, int *err);
-pcilib_register_value_t pcilib_get_value_as_register_value(pcilib_t *ctx, const pcilib_value_t *val, int *err);
-int pcilib_convert_value_unit(pcilib_t *ctx, pcilib_value_t *val, const char *unit_name);
-int pcilib_convert_value_type(pcilib_t *ctx, pcilib_value_t *val, pcilib_value_type_t type);
+/** public_api_property
+ * @}
+ */
-int pcilib_get_property_attr(pcilib_t *ctx, const char *prop, const char *attr, pcilib_value_t *val);
-int pcilib_get_register_attr_by_id(pcilib_t *ctx, pcilib_register_t reg, const char *attr, pcilib_value_t *val);
-int pcilib_get_register_attr(pcilib_t *ctx, const char *bank, const char *regname, const char *attr, pcilib_value_t *val);
-int pcilib_get_register_bank_attr(pcilib_t *ctx, const char *bankname, const char *attr, pcilib_value_t *val);
+/***********************************************************************************************************//**
+ * \defgroup public_api_dma Public DMA API
+ * High speed interface for reading and writting unstructured data
+ * @{
+ */
-int pcilib_reset(pcilib_t *ctx);
-int pcilib_trigger(pcilib_t *ctx, pcilib_event_t event, size_t trigger_size, void *trigger_data);
+/**
+ * This function resolves the ID of DMA engine from its address and direction.
+ * It is a bit confusing, but addresses should be able to represent bi-directional
+ * DMA engines. Unfortunatelly, implementation often is limited to uni-directional
+ * engines. In this case, two DMA engines with different IDs can be virtually
+ * combined in a DMA engine with the uniq address. This will allow user to specify
+ * the same engine address in all types of accesses and we will resolve the appropriate
+ * engine ID depending on the requested direction.
+ * @param[in,out] ctx - pcilib context
+ * @param[in] direction - DMA direction (to/from device)
+ * @param[in] dma - address of DMA engine
+ * @return - ID of DMA engine or PCILIB_DMA_INVALID if the specified engine does not exist
+ */
+pcilib_dma_engine_t pcilib_find_dma_by_addr(pcilib_t *ctx, pcilib_dma_direction_t direction, pcilib_dma_engine_addr_t dma);
-/*
- * The recording of new events will be stopped after reaching max_events records
- * or when the specified amount of time is elapsed. However, the @pcilib_stop
- * function should be called still.
- * NOTE: This options may not be respected if the PCILIB_EVENT_FLAG_RAW_DATA_ONLY
- * is specified.
+/**
+ * Starts DMA engine. This call will allocate DMA buffers and pass their bus addresses to the hardware.
+ * - During the call, the C2S engine may start writting data. The written buffers are marked as
+ * ready and can be read-out using pcilib_stream_dma() and pcilib_read_dma() calls. If no empty
+ * buffers left, the C2S DMA engine will stall until some buffers are read out.
+ * - The S2C engine waits until the data is pushed with pcilib_push_data() call
+ *
+ * After pcilib_start_dma() call, the pcilib_stop_dma() function should be necessarily called. However,
+ * it will clean up the process memory, but only in some cases actually stop the DMA engine.
+ * This depends on \a flags passed to both pcilib_start_dma() and pcilib_stop_dma() calls.
+ * if PCILIB_DMA_FLAG_PERSISTENT flag is passed to the pcilib_start_dma(), the DMA engine
+ * will remain running unless the same flag is also passed to the pcilib_stop_dma() call.
+ * The allocated DMA buffers will stay intact and the hardware may continue reading / writting
+ * data while there is space/data left. However, the other functions of DMA API should not
+ * be called after pcilib_stop_dma() until new pcilib_start_dma() call is issued.
+ *
+ * The process- and thread-safety is implementation depedent. However, currently the process-
+ * safety is ensured while accessing the kernel memory (todo: this may get complicated if we
+ * provide a way to perform DMA directly to the user-supplied pages).
+ * The thread-safety is not provided by currently implemented DMA engines. The DMA functions
+ * may be called from multiple threads, but it is user responsibility to ensure that only a
+ * single DMA-related call is running. On other hand, the DMA and register APIs may be used
+ * in parallel.
+ *
+ * @param[in,out] ctx - pcilib context
+ * @param[in] dma - ID of DMA engine, the ID should first be resolved using pcilib_find_dma_by_addr()
+ * @param[in] flags - PCILIB_DMA_FLAG_PERSISTENT indicates that engine should be kept running after pcilib_stop_dma() call
+ * @return - error code or 0 on success
*/
-int pcilib_configure_autostop(pcilib_t *ctx, size_t max_events, pcilib_timeout_t duration);
+int pcilib_start_dma(pcilib_t *ctx, pcilib_dma_engine_t dma, pcilib_dma_flags_t flags);
-/*
- * Request auto-triggering while grabbing
+/**
+ * Stops DMA engine or just cleans up the process-specific memory buffers (see
+ * pcilib_start_dma() for details). No DMA API calls allowed after this point
+ * until pcilib_start_dma() is called anew.
+ *
+ * @param[in,out] ctx - pcilib context
+ * @param[in] dma - ID of DMA engine, the ID should first be resolved using pcilib_find_dma_by_addr()
+ * @param[in] flags - PCILIB_DMA_FLAG_PERSISTENT indicates that engine should be actually stopped independent of the flags passed to pcilib_start_dma() call
+ * @return - error code or 0 on success
+ */
+int pcilib_stop_dma(pcilib_t *ctx, pcilib_dma_engine_t dma, pcilib_dma_flags_t flags);
+
+/**
+ * Tries to drop all pending data in the DMA channel. It will drop not only data currently in the DMA buffers,
+ * but will allow hardware to write more and will drop the newly written data as well. The standard DMA timeout
+ * is allowed to receive new data. If hardware continuously writes data, after #PCILIB_DMA_SKIP_TIMEOUT
+ * microseconds the function will exit with #PCILIB_ERROR_TIMEOUT error.
+ *
+ * @param[in,out] ctx - pcilib context
+ * @param[in] dma - ID of DMA engine, the ID should first be resolved using pcilib_find_dma_by_addr()
+ * @return - error code or 0 on success
*/
-int pcilib_configure_autotrigger(pcilib_t *ctx, pcilib_timeout_t interval, pcilib_event_t event, size_t trigger_size, void *trigger_data);
-/*
- * Request streaming the rawdata from the event engine. It is fastest way to acuqire data.
- * No memory copies will be performed and DMA buffers will be directly passed to the user
- * callback. However, to prevent data loss, no processing should be done on the data. The
- * user callback is only expected to copy data into the appropriate place and return control
- * to the event engine.
- * The performance can be boosted further by disabling any data processing within the event
- * engine. Just pass PCILIB_EVENT_FLAG_RAW_DATA_ONLY flag to the @pcilib_start function.
+int pcilib_skip_dma(pcilib_t *ctx, pcilib_dma_engine_t dma);
+
+/**
+ * Reads data from DMA buffers and pass it to the specified callback function. The return code of the callback
+ * function determines if streaming should continue and how much to wait for next data to arrive before
+ * triggering timeout.
+ * The function is process- and thread-safe. The PCILIB_ERROR_BUSY will be returned immediately if DMA is used
+ * by another thread or process.
+ *
+ * The function waits the specified \a timeout microseconds for the first data. Afterwards, the waiting time
+ * for next portion of data depends on the last return code \a (ret) from callback function.
+ * If `ret & PCILIB_STREAMING_TIMEOUT_MASK` is
+ * - PCILIB_STREAMING_STOP - the streaming stops
+ * - PCILIB_STREAMING_CONTINUE - the standard DMA timeout will be used to wait for a new data
+ * - PCILIB_STREAMING_WAIT - the timeout specified in the function arguments will be used to wait for a new data
+ * - PCILIB_STREAMING_CHECK - the function will return if new data is not available immediately
+ * The function return code depends on the return code from the callback as well. If no data received within the specified
+ * timeout and no callback is called, the PCILIB_ERROR_TIMEOUT is returned. Otherwise, success is returned unless
+ * PCILIB_STREAMING_FAIL flag has been set in the callback return code before the timeout was triggered.
+ *
+ * @param[in,out] ctx - pcilib context
+ * @param[in] dma - ID of DMA engine, the ID should first be resolved using pcilib_find_dma_by_addr()
+ * @param[in] addr - instructs DMA to start reading at the specified address (not supported by existing DMA engines)
+ * @param[in] size - instructs DMA to read only \a size bytes (not supported by existing DMA engines)
+ * @param[in] flags - not used by existing DMA engines
+ * @param[in] timeout - specifies number of microseconds to wait before reporting timeout, special values #PCILIB_TIMEOUT_IMMEDIATE and #PCILIB_TIMEOUT_INFINITE are supported.
+ * @param[in] cb - callback function to call
+ * @param[in,out] cbattr - passed through as the first parameter of callback function
+ * @return - error code or 0 on success
*/
-int pcilib_configure_rawdata_callback(pcilib_t *ctx, pcilib_event_rawdata_callback_t callback, void *user);
+int pcilib_stream_dma(pcilib_t *ctx, pcilib_dma_engine_t dma, uintptr_t addr, size_t size, pcilib_dma_flags_t flags, pcilib_timeout_t timeout, pcilib_dma_callback_t cb, void *cbattr);
-/*
- * Configures maximal number of preprocessing threads. Actual amount of threads
- * may be bigger. For instance, additionaly a real-time reader thread will be
- * executed for most of hardware
+/**
+ * Reads data from DMA until timeout is hit, a full DMA packet is read, or the specified number of bytes are read.
+ * The function is process- and thread-safe. The #PCILIB_ERROR_BUSY will be returned immediately if DMA is used
+ * by another thread or process.
+ *
+ * We can't read arbitrary number of bytes from DMA. A full DMA packet is always read. The DMA packet is not equal
+ * to DMA buffer, but may consist of multiple buffers and the size may vary during run time. This may cause problems
+ * if not treated properly. While the number of actually read bytes is bellow the specified size, the function may
+ * continue to read the data. But as the new packet is started, it should fit completely in the provided buffer space
+ * or PCILIB_ERROR_TOOBIG error will be returned. Therefore, it is a good practice to read only a single packet at
+ * once and provide buffer capable to store the larges possible packet.
+ *
+ * Unless #PCILIB_DMA_FLAG_MULTIPACKET flag is specified, the function will stop after the first full packet is read.
+ * Otherwise, the reading will continue until all `size` bytes are read or timeout is hit. The stanard DMA timeout
+ * should be met while reading DMA buffers belonging to the same packet. Otherwise, PCILIB_ERROR_TIMEOUT is returned
+ * and number of bytes read so far is returned in the `rdsize`.
+ * If #PCILIB_DMA_FLAG_WAIT flag is specified, the number of microseconds specified in the `timeout` parameter are
+ * allowed for a new packet to come. If no new data arrived in the specified timeout, the function returns successfuly
+ * and number of read bytes is returned in the `rdsize`.
+ *
+ * We can't put the read data back into the DMA. Therefore, even in the case of error some data may be returned. The
+ * number of actually read bytes is always reported in `rdsize` and the specified amount of data is always written
+ * to the provided buffer.
+ *
+ * @param[in,out] ctx - pcilib context
+ * @param[in] dma - ID of DMA engine, the ID should first be resolved using pcilib_find_dma_by_addr()
+ * @param[in] addr - instructs DMA to start reading at the specified address (not supported by existing DMA engines)
+ * @param[in] size - specifies how many bytes should be read
+ * @param[in] flags - Various flags controlling the function behavior
+ * - #PCILIB_DMA_FLAG_MULTIPACKET indicates that multiple DMA packets will be read (not recommended, use pcilib_stream_dma() in this case)
+ * - #PCILIB_DMA_FLAG_WAIT indicates that we need to wait the specified timeout between consequitive DMA packets (default DMA timeout is used otherwise)
+ * @param[in] timeout - specifies number of microseconds to wait before reporting timeout, special values #PCILIB_TIMEOUT_IMMEDIATE and #PCILIB_TIMEOUT_INFINITE are supported.
+ * This parameter specifies timeout between consequtive DMA packets, the standard DMA timeout is expected between buffers belonging to the same DMA packet.
+ * @param[out] buf - the buffer of \a size bytes long to store the data
+ * @param[out] rdsize - number of bytes which were actually read. The correct value will be reported in both case if function has finished successfully or if error has happened.
+ * @return - error code or 0 on success. In both cases some data may be returned in the buffer, check `rdsize`.
+ */
+int pcilib_read_dma_custom(pcilib_t *ctx, pcilib_dma_engine_t dma, uintptr_t addr, size_t size, pcilib_dma_flags_t flags, pcilib_timeout_t timeout, void *buf, size_t *rdsize);
+
+/**
+ * Reads data from DMA until timeout is hit, a full DMA packet is read, or the specified number of bytes are read.
+ * Please, check detailed explanation when reading is stopped in the description of pcilib_read_dma_custom().
+ * The function is process- and thread-safe. The #PCILIB_ERROR_BUSY will be returned immediately if DMA is used
+ * by another thread or process.
+ *
+ * The function actually executes the pcilib_read_dma_custom() without special flags and with default DMA timeout
+ *
+ * @param[in,out] ctx - pcilib context
+ * @param[in] dma - ID of DMA engine, the ID should first be resolved using pcilib_find_dma_by_addr()
+ * @param[in] addr - instructs DMA to start reading at the specified address (not supported by existing DMA engines)
+ * @param[in] size - specifies how many bytes should be read
+ * @param[out] buf - the buffer of \a size bytes long to store the data
+ * @param[out] rdsize - number of bytes which were actually read. The correct value will be reported in both case if function has finished successfully or if error has happened.
+ * @return - error code or 0 on success. In both cases some data may be returned in the buffer, check `rdsize`.
+ */
+int pcilib_read_dma(pcilib_t *ctx, pcilib_dma_engine_t dma, uintptr_t addr, size_t size, void *buf, size_t *rdsize);
+
+/**
+ * Pushes new data to the DMA engine. The actual behavior is implementation dependent. The successful exit does not mean
+ * what all data have reached hardware, but only guarantees that it is stored in DMA buffers and the hardware is instructed
+ * to start reading buffers. The function may return #PCILIB_ERROR_TIMEOUT is all DMA buffers are occupied and no buffers is
+ * read by the hardware within the specified timeout. Even if an error is returned, part of the data may be already send to
+ * DMA and can't be revoked back. Number of actually written bytes is always returned in the `wrsize`.
+ *
+ * The function is process- and thread-safe. The #PCILIB_ERROR_BUSY will be returned immediately if DMA is used
+ * by another thread or process.
+ *
+ * @param[in,out] ctx - pcilib context
+ * @param[in] dma - ID of DMA engine, the ID should first be resolved using pcilib_find_dma_by_addr()
+ * @param[in] addr - instructs DMA to start writting at the specified address (not supported by existing DMA engines)
+ * @param[in] size - specifies how many bytes should be written
+ * @param[in] flags - Various flags controlling the function behavior
+ * - #PCILIB_DMA_FLAG_EOP indicates that this is the last data in the DMA packet
+ * - #PCILIB_DMA_FLAG_WAIT requires function to block until the data actually reach hardware. #PCILIB_ERROR_TIMEOUT may be returned if it takes longer when the specified timeout.
+ * @param[in] timeout - specifies number of microseconds to wait before reporting timeout, special values #PCILIB_TIMEOUT_IMMEDIATE and #PCILIB_TIMEOUT_INFINITE are supported.
+ * @param[out] buf - the buffer with the data
+ * @param[out] wrsize - number of bytes which were actually written. The correct value will be reported in both case if function has finished successfully or if error has happened.
+ * @return - error code or 0 on success. In both cases some data may be written to the DMA, check `wrsize`.
+ */
+int pcilib_push_dma(pcilib_t *ctx, pcilib_dma_engine_t dma, uintptr_t addr, size_t size, pcilib_dma_flags_t flags, pcilib_timeout_t timeout, void *buf, size_t *wrsize);
+
+
+/**
+ * Pushes new data to the DMA engine and blocks until hardware gets it all. Even if an error has occured, a
+ * part of the data may be already had send to DMA and can't be revoked back. Number of actually written bytes
+ * is always returned in the `wrsize`.
+ *
+ * The function is process- and thread-safe. The #PCILIB_ERROR_BUSY will be returned immediately if DMA is used
+ * by another thread or process.
+
+ * The function actually executes the pcilib_push_dma() with #PCILIB_DMA_FLAG_EOP and #PCILIB_DMA_FLAG_WAIT flags set and
+ * the default DMA timeout.
+ *
+ * @param[in,out] ctx - pcilib context
+ * @param[in] dma - ID of DMA engine, the ID should first be resolved using pcilib_find_dma_by_addr()
+ * @param[in] addr - instructs DMA to start writting at the specified address (not supported by existing DMA engines)
+ * @param[in] size - specifies how many bytes should be written
+ * @param[out] buf - the buffer with the data
+ * @param[out] wrsize - number of bytes which were actually written. The correct value will be reported in both case if function has finished successfully or if error has happened.
+ * @return - error code or 0 on success. In both cases some data may be written to the DMA, check `wrsize`.
+ */
+int pcilib_write_dma(pcilib_t *ctx, pcilib_dma_engine_t dma, uintptr_t addr, size_t size, void *buf, size_t *wrsize);
+
+/**
+ * Benchmarks the DMA implementation. The reported performance may be significantly affected by several environmental variables.
+ * - PCILIB_BENCHMARK_HARDWARE - if set will not copy the data out, but immediately drop as it lended in DMA buffers. This allows to remove influence of memcpy performance.
+ * - PCILIB_BENCHMARK_STREAMING - if set will not re-initialized the DMA on each iteration. If DMA is properly implemented this should have only marginal influence on performance
+ *
+ * The function is process- and thread-safe. The #PCILIB_ERROR_BUSY will be returned immediately if DMA is used
+ * by another thread or process.
+ *
+ * @param[in,out] ctx - pcilib context
+ * @param[in] dma - Address of DMA engine
+ * @param[in] addr - Benchmark will read and write data at the specified address (ignored by existing DMA engines)
+ * @param[in] size - specifies how many bytes should be read and written at each iteration
+ * @param[in] iterations - number of iterations to execute
+ * @param[in] direction - Specifies if DMA reading or writting should be benchmarked, bi-directional benchmark is possible as well
+ * @return - bandwidth in MiB/s (Mebibytes per second)
+ */
+double pcilib_benchmark_dma(pcilib_t *ctx, pcilib_dma_engine_addr_t dma, uintptr_t addr, size_t size, size_t iterations, pcilib_dma_direction_t direction);
+
+/** public_api_dma
+ * @}
+ */
+
+/***********************************************************************************************************//**
+ * \defgroup public_api_irq Public IRQ API
+ * This is actually part of DMA API. IRQ handling is currently provided by DMA engine.
+ * However, the IRQs are barely used so far. Therefore, the API can be significantly changed when confronted with harsh reallity.
+ * @{
+ */
+
+int pcilib_enable_irq(pcilib_t *ctx, pcilib_irq_type_t irq_type, pcilib_dma_flags_t flags);
+int pcilib_disable_irq(pcilib_t *ctx, pcilib_dma_flags_t flags);
+int pcilib_wait_irq(pcilib_t *ctx, pcilib_irq_hw_source_t source, pcilib_timeout_t timeout, size_t *count);
+int pcilib_acknowledge_irq(pcilib_t *ctx, pcilib_irq_type_t irq_type, pcilib_irq_source_t irq_source);
+int pcilib_clear_irq(pcilib_t *ctx, pcilib_irq_hw_source_t source);
+
+/** public_api_irq
+ * @}
*/
-int pcilib_configure_preprocessing_threads(pcilib_t *ctx, size_t max_threads);
+/***********************************************************************************************************//**
+ * \defgroup public_api_event Public Event API
+ * High level API for reading the structured data from hardware
+ * @{
+ */
+
+/**
+ * Provides access to the context of event engine. This may be required to call implementation-specific
+ * functions of event engine.
+ * @param [in,out] ctx - pcilib context
+ * @return - context of event engine or NULL in the case of error. Depending on the implementation can be extension of pcilib_contex_t, it should be safe to type cast if you are running the correct engine.
+ */
pcilib_context_t *pcilib_get_event_engine(pcilib_t *ctx);
-int pcilib_start(pcilib_t *ctx, pcilib_event_t event_mask, pcilib_event_flags_t flags);
+/**
+ * Resolves the event ID based on its name.
+ * @param [in,out] ctx - pcilib context
+ * @param [in] event - the event name
+ * @return - the event ID or PCILIB_EVENT_INVALID if event is not found
+ */
+pcilib_event_t pcilib_find_event(pcilib_t *ctx, const char *event);
+
+
+/**
+ * Analyzes current configuration, allocates necessary buffers and spawns required data processing threads.
+ * Depending on the implementation and the current configuration, the actual event grabbing may start already
+ * here. In this case, the preprocessed events will be storred in the temporary buffers and may be lost if
+ * pcilib_stop() is called before reading them out. Alternatively, the actual grabbing may only commend when
+ * the pcilib_stream() or pcilib_get_next_event() functions are executed.
+ * The function is non-blocking and will return immediately after allocating required memory and spawning
+ * of the preprocessing threads. It is important to call pcilib_stop() in the end.
+ *
+ * The grabbing will stop automatically if conditions defined using pcilib_configure_autostop() function
+ * are met. It also possible to stop grabbing using pcilib_stop() call at any moment.
+ *
+ * The process- and thread-safety is implementation depedent. However, normally the event engine will depend
+ * on DMA and if DMA engine is process-safe it will ensure the process-safety for event engine as well.
+ * The thread-safety is not directly ensured by currently implemented Event engines. The functions of Event
+ * engine may be called from multiple threads, but it is the user responsibility to ensure that only a single
+ * function of Event engine is running at each moment. On other hand, the Event and register APIs may be used
+ * in parallel.
+ *
+ * @param[in,out] ctx - pcilib context
+ * @param[in] ev_mask - specifies events to listen for, use #PCILIB_EVENTS_ALL to grab all events
+ * @param[in] flags - various implementation-specific flags controlling operation of event engine
+ * - #PCILIB_EVENT_FLAG_PREPROCESS - requires event preprocessing (i.e. event data is decoded before it is requested, this is often required for multi-threaded processing)
+ * - #PCILIB_EVENT_FLAG_RAW_DATA_ONLY - disables data processing at all, only raw data will be provided in this case
+ * @return - error code or 0 on success
+ */
+int pcilib_start(pcilib_t *ctx, pcilib_event_t ev_mask, pcilib_event_flags_t flags);
+
+
+/**
+ * Stops event grabbing and optionally cleans up the used memory.
+ * This function operates in two modes. If #PCILIB_EVENT_FLAG_STOP_ONLY flag is specified, the
+ * event grabbing is stopped, but all memory structures are kept intact. This also forces the
+ * blocked pcilib_stream() and pcilib_get_next_event() to return after a short while.
+
+ * Unlike DMA engine, the event engine is not persistent and is always completely stopped when
+ * application is finished. Therefore, later the pcilib_stop() should be necessarily called
+ * again without #PCILIB_EVENT_FLAG_STOP_ONLY flag to commend full clean up and release all
+ * used memory. Such call may only be issued when no threads are using Event engine any more.
+ * There should be no functions waiting for next event to appear and all of the obtained event
+ * data should be already returned back to the system.
+ *
+ * pcilib_stop executed with #PCILIB_EVENT_FLAG_STOP_ONLY is thread safe. The full version of
+ * the function is not and should be never called in parallel with any other action of the
+ * event engine. Actually, it is thread safe in the case of ipecamera, but this is not
+ * guaranteed for other event engines.
+ *
+ * @param[in,out] ctx - pcilib context
+ * @param[in] flags - flags specifying operation mode
+ * - #PCILIB_EVENT_FLAG_STOP_ONLY - instructs library to keep all the data structures intact and to onlystop the data grabbing
+ * @return - error code or 0 on success
+ */
int pcilib_stop(pcilib_t *ctx, pcilib_event_flags_t flags);
+/**
+ * Streams the incomming events to the provided callback function. If Event engine is not started
+ * yet, it will be started and terminated upon the completion of the call. The streaming will
+ * continue while Event engine is started and the callback function does not return an error (negative)
+ * or #PCILIB_STREAMING_STOP.
+ *
+ * The callback is called only when all the data associated with the event is received from hardware.
+ * So, the raw data is necessarily present, but availability of alternative data formats is
+ * optional. Depending on the implementation and current configuration, the data decoding can be
+ * performed beforehand, in parallel with callback execution, or only them the data is
+ * requested with pcilib_get_data() or pcilib_copy_data() calls.
+ *
+ * The function is thread-safe. The multiple requests to pcilib_stream() and pcilib_get_next_event()
+ * will be automatically serialized by the event engine. The pcilib_stream() is running in the
+ * single thread and no new calls to callback are issued until currently executed callback
+ * returns. The client application may get hold on the data from multiple events simultaneously.
+ * However, the data could be overwritten meanwhile by the hardware. The pcilib_return_data()
+ * will inform if it has happened by returning #PCILIB_ERROR_OVERWRITTEN.
+ *
+ * @param[in,out] ctx - pcilib context
+ * @param[in] callback - callback function to call for each event, the streaming is stopped if it return #PCILIB_STREAMING_STOP or negative value indicating the error
+ * @param[in,out] user - used data is passed through as the last parameter of callback function
+ * @return - error code or 0 on success
+ */
int pcilib_stream(pcilib_t *ctx, pcilib_event_callback_t callback, void *user);
+
+/**
+ * Waits until the next event is available.
+ * The event is only returned when all the data associated with the event is received from hardware.
+ * So, the raw data is necessarily present, but availability of alternative data formats is
+ * optional. Depending on the implementation and current configuration, the data decoding can be
+ * performed beforehand, in parallel, or only them the data is requested with pcilib_get_data()
+ * or pcilib_copy_data() calls.
+ *
+ * The function is thread-safe. The multiple requests to pcilib_stream() and pcilib_get_next_event()
+ * will be automatically serialized by the event engine. The client application may get hold on
+ * the data from multiple events simultaneously. However, the data could be overwritten meanwhile
+ * by the hardware. The pcilib_return_data() will inform if it has happened by returning
+ * #PCILIB_ERROR_OVERWRITTEN.
+ *
+ * @param[in,out] ctx - pcilib context
+ * @param[in] timeout - specifies number of microseconds to wait for next event before reporting timeout, special values #PCILIB_TIMEOUT_IMMEDIATE and #PCILIB_TIMEOUT_INFINITE are supported.
+ * @param[out] evid - the event ID is returned in this parameter
+ * @param[in] info_size - the size of the passed event info structure (the implementation of event engine may extend the standad #pcilib_event_info_t definition and provide extra information about the event.
+ If big enough info buffer is provided, this additional information will be copied as well. Otherwise only standard information is provided.
+ * @param[out] info - The information about the recorded event is written to `info`
+ * @return - error code or 0 on success
+ */
int pcilib_get_next_event(pcilib_t *ctx, pcilib_timeout_t timeout, pcilib_event_id_t *evid, size_t info_size, pcilib_event_info_t *info);
+/**
+ * Requests the streaming the rawdata from the event engine. The callback will be called
+ * each time new DMA packet is received. It is the fastest way to acuqire data.
+ * No memory copies performed and DMA buffers are directly passed to the specified callback.
+ * However, to prevent data loss, no long processing is allowed is only expected to copy data
+ * into the appropriate place and return control to the event engine.
+ *
+ * This function should be exectued before the grabbing is started with pcilib_start().
+ * The performance can be boosted further by disabling any data processing within the event
+ * engine. This is achieved by passing the #PCILIB_EVENT_FLAG_RAW_DATA_ONLY flag to pcilib_start()
+ * function while starting the grabbing.
+ *
+ * @param[in,out] ctx - pcilib context
+ * @param[in] callback - callback function to call for each event, the streaming is stopped if it return #PCILIB_STREAMING_STOP or negative value indicating the error
+ * @param[in,out] user - used data is passed through as the last parameter of callback function
+ * @return - error code or 0 on success
+ */
+int pcilib_configure_rawdata_callback(pcilib_t *ctx, pcilib_event_rawdata_callback_t callback, void *user);
+
+/**
+ * Configures conditions when the grabbing will be stopped automatically. The recording of new events may be
+ * stopped after reaching max_events records or when the specified amount of time is elapsed whatever happens
+ * first. However, the pcilib_stop() function still must be called afterwards.
+ *
+ * This function should be exectued before the grabbing is started with pcilib_start().
+ * NOTE that this options might not be respected if grabbing is started with the
+ * #PCILIB_EVENT_FLAG_RAW_DATA_ONLY flag specified.
+ *
+ * @param[in,out] ctx - pcilib context
+ * @param[in] max_events - specifies number of events after which the grabbing is stopped
+ * @param[in] duration - specifies number of microseconds to run the grabbing, special values #PCILIB_TIMEOUT_IMMEDIATE and #PCILIB_TIMEOUT_INFINITE are supported.
+ * @return - error code or 0 on success
+ */
+int pcilib_configure_autostop(pcilib_t *ctx, size_t max_events, pcilib_timeout_t duration);
+
+/**
+ * Request the auto-triggering while grabbing. The software triggering is currently not supported (but planned).
+ * Therefore it is fully relied on hardware support. If no hardware support is available, #PCILIB_ERROR_NOTSUPPORTED
+ * will be returned.
+ *
+ * This function should be exectued before the grabbing is started with pcilib_start().
+ *
+ * @param[in,out] ctx - pcilib context
+ * @param[in] interval - instructs hardware that each `interval` microseconds a new trigger should be issued
+ * @param[in] event - specifies ID of the event which will be triggered
+ * @param[in] trigger_size - specifies the size of `trigger` buffer
+ * @param[in] trigger_data - this implementation-specific buffer which will be passed through to the Event engine
+ * @return - error code or 0 on success
+ */
+int pcilib_configure_autotrigger(pcilib_t *ctx, pcilib_timeout_t interval, pcilib_event_t event, size_t trigger_size, void *trigger_data);
+
+/**
+ * Issues a single software trigger for the specified event. No hardware support is required. The function
+ * is fully thread safe and can be called while other thread is blocked in the pcilib_stream() or pcilib_get_next_event()
+ * calls.
+ *
+ * @param[in,out] ctx - pcilib context
+ * @param[in] event - specifies ID of the event to trigger
+ * @param[in] trigger_size - specifies the size of `trigger` buffer
+ * @param[in] trigger_data - this implementation-specific buffer which will be passed through to the Event engine
+ * @return - error code or 0 on success
+ */
+int pcilib_trigger(pcilib_t *ctx, pcilib_event_t event, size_t trigger_size, void *trigger_data);
+
+/** public_api_event
+ * @}
+ */
+
+/***********************************************************************************************************//**
+ * \defgroup public_api_event_data Public Event Data API
+ * A part of Event API actually providing access to the data
+ * @{
+ */
+
+/**
+ * Resolves the data type based on its name.
+ * @param[in,out] ctx - pcilib context
+ * @param[in] event - the ID of the event producing the data
+ * @param[in] data_type - the name of data type
+ * @return - the data type or PCILIB_EVENT_DATA_TYPE_INVALID if the specified type is not found
+ */
+pcilib_event_data_type_t pcilib_find_event_data_type(pcilib_t *ctx, pcilib_event_t event, const char *data_type);
+
+/**
+ * This is a simples way to grab the data from the event engine. The event engine is started, a software trigger
+ * for the specified event is issued if `timeout` is equal to PCILIB_TIMEOUT_IMMEDIATE, event is grabbed and the
+ * default data is copied into the user buffer. Then, the grabbing is stopped.
+ * @param[in,out] ctx - pcilib context
+ * @param[in] event - the event to trigger and/or event mask to grab
+ * @param[in,out] size - specifies the size of the provided buffer (if user supplies the buffer), the amount of data actually written is returned in this paramter
+ * @param[in,out] data - Either contains a pointer to user-supplied buffer where the data will be written or pointer to NULL otherwise.
+ In the later case, the pointer to newly allocated buffer will be returned in case of success. It is responsibility of the user to free the memory in this case.
+ In case of failure, the content of data is undefined.
+ * @param[in] timeout - either is equal to #PCILIB_TIMEOUT_IMMEDIATE for immediate software trigger or specifies number of microseconds to wait for event triggered by hardware
+ * @return - error code or 0 on success
+ */
+int pcilib_grab(pcilib_t *ctx, pcilib_event_t event, size_t *size, void **data, pcilib_timeout_t timeout);
+
+/**
+ * Copies the data of the specified type associated with the specified event into the provided buffer. May return #PCILIB_ERROR_OVERWRITTEN
+ * if the data was overwritten during the call.
+ *
+ * @param[in,out] ctx - pcilib context
+ * @param[in] event_id - specifies the ID of event to get data from
+ * @param[in] data_type - specifies the desired type of data
+ - PCILIB_EVENT_DATA will request the default data type
+ - PCILIB_EVENT_RAW_DATA will request the raw data
+ - The other types of data may be defined by event engine
+ * @param[in] size - specifies the size of provided buffer in bytes
+ * @param[out] buf - the data will be copied in this buffer if it is big enough, otherwise #PCILIB_ERROR_TOOBIG will be returned
+ * @param[out] retsize - the number of actually written bytes will be returned in this parameter
+ * @return - error code or 0 on success
+ */
int pcilib_copy_data(pcilib_t *ctx, pcilib_event_id_t event_id, pcilib_event_data_type_t data_type, size_t size, void *buf, size_t *retsize);
+
+/**
+ * Copies the data of the specified type associated with the specified event into the provided buffer. May return #PCILIB_ERROR_OVERWRITTEN
+ * if the data was overwritten during the call. This is very similar to pcilib_copy_data(), but allows to specify implementation specific
+ * argument explaining the requested data format.
+ *
+ * @param[in,out] ctx - pcilib context
+ * @param[in] event_id - specifies the ID of event to get data from
+ * @param[in] data_type - specifies the desired type of data
+ - PCILIB_EVENT_DATA will request the default data type
+ - PCILIB_EVENT_RAW_DATA will request the raw data
+ - The other types of data may be defined by event engine
+ * @param[in] arg_size - specifies the size of `arg` in bytes
+ * @param[in] arg - implementation-specific argument expalining the requested data format
+ * @param[in] size - specifies the size of provided buffer in bytes
+ * @param[out] buf - the data will be copied in this buffer if it is big enough, otherwise #PCILIB_ERROR_TOOBIG will be returned
+ * @param[out] retsize - the number of actually written bytes will be returned in this parameter
+ * @return - error code or 0 on success
+ */
int pcilib_copy_data_with_argument(pcilib_t *ctx, pcilib_event_id_t event_id, pcilib_event_data_type_t data_type, size_t arg_size, void *arg, size_t size, void *buf, size_t *retsize);
+
+
+/**
+ * Returns pointer to the data of the specified type associated with the specified event. The data should be returned back to the
+ * Event engine using pcilib_return_data() call. WARNING: Current implementation may overwrite the data before the pcilib_return_data()
+ * call is executed. In this case the #PCILIB_ERROR_OVERWRITTEN error will be returned by pcilib_return_data() call. I guess this is
+ * a bad idea and have to be changed. Meanwhile, for the ipecamera implementation the image data will be never overwritten. However,
+ * the raw data may get overwritten and the error code of pcilib_return_data() has to be consulted.
+ *
+ * @param[in,out] ctx - pcilib context
+ * @param[in] event_id - specifies the ID of event to get data from
+ * @param[in] data_type - specifies the desired type of data
+ - PCILIB_EVENT_DATA will request the default data type
+ - PCILIB_EVENT_RAW_DATA will request the raw data
+ - The other types of data may be defined by event engine
+ * @param[out] size_or_err - contain error code if function returns NULL or number of actually written bytes otherwise
+ * @return - the pointer to the requested data or NULL otherwise
+ */
void *pcilib_get_data(pcilib_t *ctx, pcilib_event_id_t event_id, pcilib_event_data_type_t data_type, size_t *size_or_err);
+
+/**
+ * Returns pointer to the data of the specified type associated with the specified event. The data should be returned back to the
+ * Event engine using pcilib_return_data() call. WARNING: Current implementation may overwrite the data before the pcilib_return_data()
+ * call is executed, @see pcilib_get_data() for details. Overall this function is very similar to pcilib_get_data(), but allows to
+ * specify implementation specific argument explaining the requested data format.
+ *
+ * @param[in,out] ctx - pcilib context
+ * @param[in] event_id - specifies the ID of event to get data from
+ * @param[in] data_type - specifies the desired type of data
+ - PCILIB_EVENT_DATA will request the default data type
+ - PCILIB_EVENT_RAW_DATA will request the raw data
+ - The other types of data may be defined by event engine
+ * @param[in] arg_size - specifies the size of `arg` in bytes
+ * @param[in] arg - implementation-specific argument expalining the requested data format
+ * @param[out] size_or_err - contain error code if function returns NULL or number of actually written bytes otherwise
+ * @return - the pointer to the requested data or NULL otherwise
+ */
void *pcilib_get_data_with_argument(pcilib_t *ctx, pcilib_event_id_t event_id, pcilib_event_data_type_t data_type, size_t arg_size, void *arg, size_t *size_or_err);
+
/*
- * This function is provided to find potentially corrupted data. If the data is overwritten by
- * the time return_data is called it will return error.
+ * This function returns data obtained using pcilib_get_data() or pcilib_get_data_with_argument() calls.
+ * It occasionally may return #PCILIB_ERROR_OVERWRITTEN error indicating that the data was overwritten
+ * between pcilib_get_data() and pcilib_return_data() calls, @see pcilib_get_data() for details.
+ * @param[in,out] ctx - pcilib context
+ * @param[in] event_id - specifies the ID of event to get data from
+ * @param[in] data_type - specifies the data type request in the pcilib_get_data() call
+ * @param[in,out] data - specifies the buffer returned by pcilib_get_data() call
+ * @return - #PCILIB_ERROR_OVERWRITTEN or 0 if data is still valid
*/
int pcilib_return_data(pcilib_t *ctx, pcilib_event_id_t event_id, pcilib_event_data_type_t data_type, void *data);
-/*
- * @param data - will be allocated and shuld be freed if NULL, otherwise used and size should contain correct size.
- * In case of failure the content of data is undefined.
- * @param timeout - will be autotriggered if NULL
+/** public_api_event_data
+ * @}
+ */
+
+
+/***********************************************************************************************************//**
+ * \defgroup public_api_value Polymorphic values
+ * API for manipulation of data formats and units
+ * @{
+ */
+
+/**
+ * Destroys the polymorphic value and frees any extra used memory, but does not free #pcilib_value_t itself
+ * @param[in] ctx - pcilib context
+ * @param[in,out] val - initialized polymorphic value
+ */
+void pcilib_clean_value(pcilib_t *ctx, pcilib_value_t *val);
+
+/**
+ * Copies the polymorphic value. If `dst` already contains the value, cleans it first.
+ * Therefore, before first usage the value should be always initialized to 0.
+ * @param[in] ctx - pcilib context
+ * @param[in,out] dst - initialized polymorphic value
+ * @param[in] src - initialized polymorphic value
+ * @return - 0 on success or memory error
+ */
+int pcilib_copy_value(pcilib_t *ctx, pcilib_value_t *dst, const pcilib_value_t *src);
+
+/**
+ * Initializes the polymorphic value from floating-point number. If `val` already contains the value, cleans it first.
+ * Therefore, before first usage the value should be always initialized to 0.
+ * @param[in] ctx - pcilib context
+ * @param[in,out] val - initialized polymorphic value
+ * @param[in] fval - initializer
+ * @return - 0 on success or memory error
*/
-int pcilib_grab(pcilib_t *ctx, pcilib_event_t event_mask, size_t *size, void **data, pcilib_timeout_t timeout);
+int pcilib_set_value_from_float(pcilib_t *ctx, pcilib_value_t *val, double fval);
+
+/**
+ * Initializes the polymorphic value from integer. If `val` already contains the value, cleans it first.
+ * Therefore, before first usage the value should be always initialized to 0.
+ * @param[in] ctx - pcilib context
+ * @param[in,out] val - initialized polymorphic value
+ * @param[in] ival - initializer
+ * @return - 0 on success or memory error
+ */
+int pcilib_set_value_from_int(pcilib_t *ctx, pcilib_value_t *val, long ival);
+
+/**
+ * Initializes the polymorphic value from the register value. If `val` already contains the value, cleans it first.
+ * Therefore, before first usage the value should be always initialized to 0.
+ * @param[in] ctx - pcilib context
+ * @param[in,out] val - initialized polymorphic value
+ * @param[in] regval - initializer
+ * @return - 0 on success or memory error
+ */
+int pcilib_set_value_from_register_value(pcilib_t *ctx, pcilib_value_t *val, pcilib_register_value_t regval);
+
+/**
+ * Initializes the polymorphic value from the static string. The string is not copied, but only referenced.
+ * If `val` already contains the value, cleans it first. Therefore, before first usage the value should be always initialized to 0.
+ * @param[in] ctx - pcilib context
+ * @param[in,out] val - initialized polymorphic value
+ * @param[in] str - initializer
+ * @return - 0 on success or memory error
+ */
+int pcilib_set_value_from_static_string(pcilib_t *ctx, pcilib_value_t *val, const char *str);
+
+/**
+ * Get the floating point value from the polymorphic type. May inmply impliced type conversion,
+ * for isntance parsing the number from the string. Will return 0. and report an error if
+ * conversion failed.
+ * @param[in] ctx - pcilib context
+ * @param[in] val - initialized polymorphic value of arbitrary type
+ * @param[out] err - error code or 0 on sccuess
+ * @return - the value or 0 in the case of error
+ */
+double pcilib_get_value_as_float(pcilib_t *ctx, const pcilib_value_t *val, int *err);
+
+/**
+ * Get the integer value from the polymorphic type. May inmply impliced type conversion
+ * resulting in precision loss if the `val` stores floating-point number. The warning
+ * message will be printed in this case, but no error returned.
+ * @param[in] ctx - pcilib context
+ * @param[in] val - initialized polymorphic value of arbitrary type
+ * @param[out] err - error code or 0 on sccuess
+ * @return - the value or 0 in the case of error
+ */
+long pcilib_get_value_as_int(pcilib_t *ctx, const pcilib_value_t *val, int *err);
+
+/**
+ * Get the integer value from the polymorphic type. May inmply impliced type conversion
+ * resulting in precision loss if the `val` stores floating-point number or complete
+ * data corruption if negative number is stored. The warning message will be printed
+ * in this case, but no error returned.
+ * @param[in] ctx - pcilib context
+ * @param[in] val - initialized polymorphic value of arbitrary type
+ * @param[out] err - error code or 0 on sccuess
+ * @return - the value or 0 in the case of error
+ */
+pcilib_register_value_t pcilib_get_value_as_register_value(pcilib_t *ctx, const pcilib_value_t *val, int *err);
+
+
+/**
+ * Convert the units of the supplied polymorphic value. The error will be reported if currently used units of the
+ * value are unknown, the requested conversion is not supported, or the value is not numeric.
+ * @param[in] ctx - pcilib context
+ * @param[in,out] val - initialized polymorphic value of any numeric type
+ * @param[in] unit_name - the requested units
+ * @return err - error code or 0 on sccuess
+ */
+int pcilib_convert_value_unit(pcilib_t *ctx, pcilib_value_t *val, const char *unit_name);
+
+/**
+ * Convert the type of the supplied polymorphic value. The error will be reported if conversion
+ * is not supported or failed due to non-conformant content.
+ * @param[in] ctx - pcilib context
+ * @param[in,out] val - initialized polymorphic value of any type
+ * @param[in] type - the requested type
+ * @return err - error code or 0 on sccuess
+ */
+int pcilib_convert_value_type(pcilib_t *ctx, pcilib_value_t *val, pcilib_value_type_t type);
+
+/** public_api_value
+ * @}
+ */
+
#ifdef __cplusplus
}
diff --git a/pcilib/property.c b/pcilib/property.c
index 1a20de1..a39594c 100644
--- a/pcilib/property.c
+++ b/pcilib/property.c
@@ -17,15 +17,31 @@
int pcilib_add_registers_from_properties(pcilib_t *ctx, size_t n, pcilib_view_context_t* const *view_ctx, pcilib_view_description_t* const *v) {
+ int err;
+
pcilib_view_t i;
pcilib_register_t pos = 0;
pcilib_register_description_t regs[n];
+ int access;
+ pcilib_register_bank_t bank;
+
+ bank = pcilib_find_register_bank_by_addr(ctx, pcilib_property_register_bank.addr);
+ if (bank == PCILIB_REGISTER_BANK_INVALID) {
+ err = pcilib_add_register_banks(ctx, 0, 1, &pcilib_property_register_bank, &bank);
+ if (err) {
+ pcilib_error("Error (%i) adding register bank (%s)", err, pcilib_property_register_bank.name);
+ return err;
+ }
+ }
+
+ access = ctx->banks[bank].access;
+
for (i = 0; i < n; i++) {
if ((v[i]->flags&PCILIB_VIEW_FLAG_REGISTER) == 0) continue;
regs[pos++] = (pcilib_register_description_t){
- .addr = view_ctx[i]->view,
+ .addr = view_ctx[i]->view * access,
.bits = 8 * sizeof(pcilib_register_value_t),
.mode = v[i]->mode,
.type = PCILIB_REGISTER_PROPERTY,
@@ -246,7 +262,7 @@ int pcilib_get_property_attr(pcilib_t *ctx, const char *prop, const char *attr,
return PCILIB_ERROR_NOTFOUND;
}
- if (!view_ctx->xml) return NULL;
+ if (!view_ctx->xml) return PCILIB_ERROR_NOTFOUND;
return pcilib_get_xml_attr(ctx, view_ctx->xml, attr, val);
}
diff --git a/pcilib/property.h b/pcilib/property.h
index 75ec053..c62e340 100644
--- a/pcilib/property.h
+++ b/pcilib/property.h
@@ -5,30 +5,31 @@
extern "C" {
#endif
/**
- * This is an internal function used to add property view for all model registers. It is automatically
+ * This is an internal function used to add property views for all model registers. It is automatically
* called from pcilib_add_registers and should not be called by the users. On error no new views are
* initalized.
- * @param[in,out] ctx - pcilib context
- * @param[in] n - number of views to initialize.
- * @param[in] banks - array containing a bank id for each of the considered registers
- * @param[in] desc - register descriptions
- * @return - error or 0 on success
+ * @param[in,out] ctx - pcilib context
+ * @param[in] n - number of views to initialize.
+ * @param[in] banks - array containing a bank id for each of the considered registers
+ * @param[in] registers - register descriptions
+ * @return - error or 0 on success
*/
int pcilib_add_properties_from_registers(pcilib_t *ctx, size_t n, const pcilib_register_bank_t *banks, const pcilib_register_description_t *registers);
/**
+ * This is an internal function used to add registers providing alternative access to values of the properties.
* To reduce number of required interfaces, some of the property views may be also mapped into the
* model as registers. The client application, then, is able to use either register or property APIs
* to access them. This is an internal function which processes the supplied views, finds which views
* have to be mapped in the register space, and finally pushes corresponding registers into the model.
* The function is automatically called from pcilib_add_views and should never be called by the user.
* On error no new registers are added.
- * @param[in,out] ctx - pcilib context
- * @param[in] n - number of views to analyze.
- * @param[in] view_ctx - views to analyze
- * @param[in] view - array of pointers to corresponding view descriptions
- * @return - error or 0 on success
+ * @param[in,out] ctx - pcilib context
+ * @param[in] n - number of views to analyze.
+ * @param[in] view_ctx - views to analyze
+ * @param[in] view - array of pointers to corresponding view descriptions
+ * @return - error or 0 on success
*/
int pcilib_add_registers_from_properties(pcilib_t *ctx, size_t n, pcilib_view_context_t* const *view_ctx, pcilib_view_description_t* const *view);
diff --git a/pcilib/register.c b/pcilib/register.c
index a166bbd..1f1cf9e 100644
--- a/pcilib/register.c
+++ b/pcilib/register.c
@@ -174,14 +174,14 @@ static int pcilib_read_register_space_internal(pcilib_t *ctx, pcilib_register_ba
return PCILIB_ERROR_NOTSUPPORTED;
}
- if (b->protocol == PCILIB_REGISTER_PROTOCOL_PROPERTY) space_size = ctx->num_views;
+ if (b->protocol == PCILIB_REGISTER_PROTOCOL_PROPERTY) space_size = ctx->num_views * access;
else space_size = b->size;
- if (((addr + n) > space_size)||(((addr + n) == space_size)&&(bits))) {
+ if (((addr + n * access) > space_size)||(((addr + n * access) == space_size)&&(bits))) {
if ((b->format)&&(strchr(b->format, 'x')))
- pcilib_error("Accessing register (%u regs at addr 0x%x) out of register space (%u registers total)", bits?(n+1):n, addr, space_size);
+ pcilib_error("Accessing register (%u regs at addr 0x%x) out of register space (%u %u-bit registers total)", bits?(n+1):n, addr, space_size / access, access * 8);
else
- pcilib_error("Accessing register (%u regs at addr %u) out of register space (%u registers total)", bits?(n+1):n, addr, space_size);
+ pcilib_error("Accessing register (%u regs at addr %u) out of register space (%u %u-bit registers total)", bits?(n+1):n, addr, space_size / access, access * 8);
return PCILIB_ERROR_OUTOFRANGE;
}
@@ -285,7 +285,7 @@ int pcilib_read_register(pcilib_t *ctx, const char *bank, const char *regname, p
}
-static int pcilib_write_register_space_internal(pcilib_t *ctx, pcilib_register_bank_t bank, pcilib_register_addr_t addr, size_t n, pcilib_register_size_t offset, pcilib_register_size_t bits, pcilib_register_value_t rwmask, pcilib_register_value_t *buf) {
+static int pcilib_write_register_space_internal(pcilib_t *ctx, pcilib_register_bank_t bank, pcilib_register_addr_t addr, size_t n, pcilib_register_size_t offset, pcilib_register_size_t bits, pcilib_register_value_t rwmask, const pcilib_register_value_t *buf) {
int err;
size_t i;
@@ -304,14 +304,14 @@ static int pcilib_write_register_space_internal(pcilib_t *ctx, pcilib_register_b
return PCILIB_ERROR_NOTSUPPORTED;
}
- if (b->protocol == PCILIB_REGISTER_PROTOCOL_PROPERTY) space_size = ctx->num_views;
+ if (b->protocol == PCILIB_REGISTER_PROTOCOL_PROPERTY) space_size = ctx->num_views * access;
else space_size = b->size;
- if (((addr + n) > space_size)||(((addr + n) == space_size)&&(bits))) {
+ if (((addr + n * access) > space_size)||(((addr + n * access) == space_size)&&(bits))) {
if ((b->format)&&(strchr(b->format, 'x')))
- pcilib_error("Accessing register (%u regs at addr 0x%x) out of register space (%u registers total)", bits?(n+1):n, addr, space_size);
+ pcilib_error("Accessing register (%u regs at addr 0x%x) out of register space (%u %u-bit registers total)", bits?(n+1):n, addr, space_size / access, access * 8);
else
- pcilib_error("Accessing register (%u regs at addr %u) out of register space (%u registers total)", bits?(n+1):n, addr, space_size);
+ pcilib_error("Accessing register (%u regs at addr %u) out of register space (%u %u-bit registers total)", bits?(n+1):n, addr, space_size / access, access * 8);
return PCILIB_ERROR_OUTOFRANGE;
}
@@ -364,7 +364,7 @@ static int pcilib_write_register_space_internal(pcilib_t *ctx, pcilib_register_b
return err;
}
-int pcilib_write_register_space(pcilib_t *ctx, const char *bank, pcilib_register_addr_t addr, size_t n, pcilib_register_value_t *buf) {
+int pcilib_write_register_space(pcilib_t *ctx, const char *bank, pcilib_register_addr_t addr, size_t n, const pcilib_register_value_t *buf) {
pcilib_register_bank_t bank_id = pcilib_find_register_bank(ctx, bank);
if (bank_id == PCILIB_REGISTER_BANK_INVALID) {
if (bank) pcilib_error("Invalid register bank is specified (%s)", bank);
diff --git a/pcilib/unit.h b/pcilib/unit.h
index 2351f26..77161b7 100644
--- a/pcilib/unit.h
+++ b/pcilib/unit.h
@@ -40,41 +40,56 @@ extern "C" {
* already registered unit. The function will copy the context of unit description, but name,
* transform, and other strings in the structure are considered to have static duration
* and will not be copied. On error no new units are initalized.
- * @param[in,out] ctx - pcilib context
- * @param[in] n - number of units to initialize. It is OK to pass 0 if protocols variable is NULL terminated (last member of protocols array have all members set to 0)
- * @param[in] desc - unit descriptions
- * @return - error or 0 on success
+ * @param[in,out] ctx - pcilib context
+ * @param[in] n - number of units to initialize. It is OK to pass 0 if protocols variable is NULL terminated (last member of protocols array have all members set to 0)
+ * @param[in] desc - unit descriptions
+ * @return - error or 0 on success
*/
int pcilib_add_units(pcilib_t *ctx, size_t n, const pcilib_unit_description_t *desc);
/**
* Destroys data associated with units. This is an internal function and will
* be called during clean-up.
- * @param[in,out] ctx - pcilib context
- * @param[in] start - specifies first unit to clean (used to clean only part of the units to keep the defined state if pcilib_add_units has failed)
+ * @param[in,out] ctx - pcilib context
+ * @param[in] start - specifies first unit to clean (used to clean only part of the units to keep the defined state if pcilib_add_units has failed)
*/
void pcilib_clean_units(pcilib_t *ctx, pcilib_unit_t start);
+/**
+ * Find unit id using supplied name.
+ * @param[in] ctx - pcilib context
+ * @param[in] unit - the requested unit name
+ * @return - unit id or PCILIB_UNIT_INVALID if error not found or error has occured
+ */
pcilib_unit_t pcilib_find_unit_by_name(pcilib_t *ctx, const char *unit);
+
+/**
+ * Find the required transform between two specified units.
+ * @param[in] ctx - pcilib context
+ * @param[in] from - the source unit
+ * @param[in] to - destination unit
+ * @return - the pointer to unit transform or NULL in case of error. If no transform required (i.e. \a from = \a to),
+ the function will return #pcilib_unit_transform_t structure with \a transform field set to NULL.
+ */
pcilib_unit_transform_t *pcilib_find_transform_by_unit_names(pcilib_t *ctx, const char *from, const char *to);
/**
* Converts value to the requested units. It is error to convert values with unspecified units.
* This is internal function, use pcilib_value_convert_value_unit instead.
- * @param[in,out] ctx - pcilib context
- * @param[in] trans - the requested unit transform
+ * @param[in,out] ctx - pcilib context
+ * @param[in] trans - the requested unit transform
* @param[in,out] value - the value to be converted (changed on success)
- * @return - error or 0 on success
+ * @return - error or 0 on success
*/
int pcilib_transform_unit(pcilib_t *ctx, const pcilib_unit_transform_t *trans, pcilib_value_t *value);
/**
* Converts value to the requested units. It is error to convert values with unspecified units.
* This is internal function, use pcilib_value_convert_value_unit instead.
- * @param[in,out] ctx - pcilib context
- * @param[in] name - specifies the requested unit of the value
+ * @param[in,out] ctx - pcilib context
+ * @param[in] to - specifies the requested unit of the value
* @param[in,out] value - the value to be converted (changed on success)
- * @return - error or 0 on success
+ * @return - error or 0 on success
*/
int pcilib_transform_unit_by_name(pcilib_t *ctx, const char *to, pcilib_value_t *value);
diff --git a/pcilib/xml.c b/pcilib/xml.c
index bc48a34..50aaa35 100644
--- a/pcilib/xml.c
+++ b/pcilib/xml.c
@@ -1,5 +1,5 @@
/**
- * @file pcilib_xml.c
+ * @file xml.c
* @version 1.0
*
* @brief this file is the main source file for the implementation of dynamic registers using xml and several funtionalities for the "pci-tool" line command tool from XML files. the xml part has been implemented using libxml2
@@ -550,7 +550,7 @@ static int pcilib_xml_create_transform_view(pcilib_t *ctx, xmlXPathContextPtr xp
pcilib_view_context_t *view_ctx;
pcilib_access_mode_t mode = 0;
- pcilib_transform_view_description_t desc = {0};
+ pcilib_transform_view_description_t desc = {{0}};
desc.base.api = &pcilib_transform_view_api;
desc.base.type = PCILIB_TYPE_DOUBLE;
@@ -668,7 +668,7 @@ static int pcilib_xml_create_enum_view(pcilib_t *ctx, xmlXPathContextPtr xpath,
xmlNodeSetPtr nodeset;
pcilib_view_context_t *view_ctx;
- pcilib_enum_view_description_t desc = {0};
+ pcilib_enum_view_description_t desc = {{0}};
desc.base.type = PCILIB_TYPE_STRING;
desc.base.unit = pcilib_xml_enum_view_unit;
diff --git a/pcilib/xml.h b/pcilib/xml.h
index e4a5744..d8a9693 100644
--- a/pcilib/xml.h
+++ b/pcilib/xml.h
@@ -40,45 +40,43 @@ struct pcilib_xml_s {
extern "C" {
#endif
-/** pcilib_init_xml
- * Initializes XML stack and loads a default set of XML files. The default location for model XML files is
- * /usr/local/share/pcilib/models/<current_model>. This can be altered using CMake PCILIB_MODEL_DIR variable
- * while building or using PCILIB_MODEL_DIR environmental variable dynamicly. More XML files can be added
- * later using pcilib_process_xml call.
- * @param[in,out] ctx - pcilib context
- * @param[in] model - the name of the model
- * @return - error or 0 on success
+/** Initializes XML stack and loads a default set of XML files.
+ * The default location for XML files is /usr/local/share/pcilib/models/@b{model}.
+ * This can be altered using CMake PCILIB_MODEL_DIR variable while building or using
+ * PCILIB_MODEL_DIR environmental variable dynamicly. More XML files can be added
+ * later using pcilib_process_xml() call.
+ *
+ * @param[in,out] ctx - pcilib context
+ * @param[in] model - the name of the model
+ * @return - error or 0 on success
*/
int pcilib_init_xml(pcilib_t *ctx, const char *model);
-/** pcilib_free_xml
- * this function free the xml parts of the pcilib_t running, and some libxml ashes
- * @param[in] ctx the pcilib_t running
+/** Cleans up memory used by various XML structures
+ * @param[in] ctx - the pcilib_t context
*/
void pcilib_free_xml(pcilib_t *ctx);
-/** pcilib_process_xml
- * Processes a bunch of XML files in the specified directory. During the initialization, all XML files
+/** Processes a bunch of XML files in the specified directory. During the initialization, all XML files
* in the corresponding model directory will be loaded. This function allows to additionally load XML
* files from the specified subdirectories of the model directory. I.e. the XML files from the
- * /usr/local/share/pcilib/models/<current_model>/<location> will be loaded. As with pcilib_init_xml,
+ * /usr/local/share/pcilib/models/@b{current_model}/@b{location} will be loaded. As with pcilib_init_xml,
* the directory can be adjusted using CMake build configuration or PCILIB_MODEL_DIR environmental
* variable.
- * @param[in] ctx - pcilib context
- * @param[in] location - Specifies sub-directory with XML files relative to the model directory.
- * @return - error or 0 on success
+ * @param[in] ctx - pcilib context
+ * @param[in] location - Specifies sub-directory with XML files relative to the model directory.
+ * @return - error or 0 on success
*/
int pcilib_process_xml(pcilib_t *ctx, const char *location);
-/** pcilib_get_xml_attr
- * This is an internal function which returns a specified node attribute in the pcilib_value_t structure.
+/** This is an internal function which returns a specified node attribute in the pcilib_value_t structure.
* This function should not be used directly. Instead subsystem specific calls like pcilib_get_register_attr,
* pcilib_get_property_attr, ...have to be used.
- * @param[in] ctx - pcilib context
- * @param[in] node - LibXML2 node
- * @param[in] attr - attribute name
- * @param[out] val - the result will be returned in this variable. Prior to first usage pcilib_value_t variable should be initalized to 0.
- * @return - error or 0 on success
+ * @param[in] ctx - pcilib context
+ * @param[in] node - LibXML2 node
+ * @param[in] attr - attribute name
+ * @param[out] val - the result will be returned in this variable. Prior to first usage pcilib_value_t variable should be initalized to 0.
+ * @return - error or 0 on success
*/
int pcilib_get_xml_attr(pcilib_t *ctx, pcilib_xml_node_t *node, const char *attr, pcilib_value_t *val);
diff --git a/pcitool/cli.c b/pcitool/cli.c
index 1cf59fb..0696ef4 100644
--- a/pcitool/cli.c
+++ b/pcitool/cli.c
@@ -964,19 +964,19 @@ int Benchmark(pcilib_t *handle, ACCESS_MODE mode, pcilib_dma_engine_addr_t dma,
err = pcilib_wait_irq(handle, 0, 0, &irqs);
if (err) irqs = 0;
- printf("%8zu KB - ", size / 1024);
+ printf("%8zu KiB - ", size / 1024);
printf("RW: ");
if (mbs < 0) printf("failed ... ");
- else printf("%8.2lf MB/s", mbs);
+ else printf("%8.2lf MiB/s", mbs);
printf(", R: ");
if (mbs_in < 0) printf("failed ... ");
- else printf("%8.2lf MB/s", mbs_in);
+ else printf("%8.2lf MiB/s", mbs_in);
printf(", W: ");
if (mbs_out < 0) printf("failed ... ");
- else printf("%8.2lf MB/s", mbs_out);
+ else printf("%8.2lf MiB/s", mbs_out);
if (irqs) {
printf(", IRQs: %lu", irqs);
@@ -1022,13 +1022,12 @@ int Benchmark(pcilib_t *handle, ACCESS_MODE mode, pcilib_dma_engine_addr_t dma,
if (!err) err = posix_memalign( (void**)&check, 256, max_size );
if ((err)||(!buf)||(!check)) Error("Allocation of %i bytes of memory have failed", max_size);
- data = pcilib_map_bar(handle, bar);
- if (!data) Error("Can't map bar %i", bar);
-
if (mode == ACCESS_FIFO) {
- fifo = data + (addr - board_info->bar_start[bar]) + (board_info->bar_start[bar] & pcilib_get_page_mask());
-// pcilib_resolve_register_address(handle, bar, addr);
+ fifo = pcilib_resolve_bar_address(handle, bar, addr);
if (!fifo) Error("Can't resolve address (%lx) in bar (%u)", addr, bar);
+ } else {
+ data = pcilib_resolve_bar_address(handle, bar, 0);
+ if (!data) Error("Can't resolve start of bar (%u)", bar);
}
if (mode == ACCESS_FIFO)
@@ -1052,7 +1051,7 @@ int Benchmark(pcilib_t *handle, ACCESS_MODE mode, pcilib_dma_engine_addr_t dma,
gettimeofday(&end,NULL);
time = (end.tv_sec - start.tv_sec)*1000000 + (end.tv_usec - start.tv_usec);
- printf("%8zu bytes - read: %8.2lf MB/s", size, 1000000. * size * BENCHMARK_ITERATIONS / (time * 1024. * 1024.));
+ printf("%8zu bytes - read: %8.2lf MiB/s", size, 1000000. * size * BENCHMARK_ITERATIONS / (time * 1024. * 1024.));
fflush(0);
@@ -1071,11 +1070,9 @@ int Benchmark(pcilib_t *handle, ACCESS_MODE mode, pcilib_dma_engine_addr_t dma,
gettimeofday(&end,NULL);
time = (end.tv_sec - start.tv_sec)*1000000 + (end.tv_usec - start.tv_usec);
- printf(", write: %8.2lf MB/s\n", 1000000. * size * BENCHMARK_ITERATIONS / (time * 1024. * 1024.));
+ printf(", write: %8.2lf MiB/s\n", 1000000. * size * BENCHMARK_ITERATIONS / (time * 1024. * 1024.));
}
- pcilib_unmap_bar(handle, bar, data);
-
printf("\n\nOpen-Transfer-Close time: \n");
for (size = 4 ; size < max_size; size *= 8) {
@@ -1092,7 +1089,7 @@ int Benchmark(pcilib_t *handle, ACCESS_MODE mode, pcilib_dma_engine_addr_t dma,
gettimeofday(&end,NULL);
time = (end.tv_sec - start.tv_sec)*1000000 + (end.tv_usec - start.tv_usec);
- printf("%8zu bytes - read: %8.2lf MB/s", size, 1000000. * size * BENCHMARK_ITERATIONS / (time * 1024. * 1024.));
+ printf("%8zu bytes - read: %8.2lf MiB/s", size, 1000000. * size * BENCHMARK_ITERATIONS / (time * 1024. * 1024.));
fflush(0);
@@ -1110,7 +1107,7 @@ int Benchmark(pcilib_t *handle, ACCESS_MODE mode, pcilib_dma_engine_addr_t dma,
gettimeofday(&end,NULL);
time = (end.tv_sec - start.tv_sec)*1000000 + (end.tv_usec - start.tv_usec);
- printf(", write: %8.2lf MB/s", 1000000. * size * BENCHMARK_ITERATIONS / (time * 1024. * 1024.));
+ printf(", write: %8.2lf MiB/s", 1000000. * size * BENCHMARK_ITERATIONS / (time * 1024. * 1024.));
if (mode == ACCESS_BAR) {
gettimeofday(&start,NULL);
@@ -1122,7 +1119,7 @@ int Benchmark(pcilib_t *handle, ACCESS_MODE mode, pcilib_dma_engine_addr_t dma,
gettimeofday(&end,NULL);
time = (end.tv_sec - start.tv_sec)*1000000 + (end.tv_usec - start.tv_usec);
- printf(", write-verify: %8.2lf MB/s", 1000000. * size * BENCHMARK_ITERATIONS / (time * 1024. * 1024.));
+ printf(", write-verify: %8.2lf MiB/s", 1000000. * size * BENCHMARK_ITERATIONS / (time * 1024. * 1024.));
if (errors) printf(", errors: %u of %u", errors, BENCHMARK_ITERATIONS);
}
printf("\n");
@@ -1687,7 +1684,7 @@ typedef struct {
struct timeval stop_time;
} GRABContext;
-int GrabCallback(pcilib_event_id_t event_id, pcilib_event_info_t *info, void *user) {
+int GrabCallback(pcilib_event_id_t event_id, const pcilib_event_info_t *info, void *user) {
int err = 0;
void *data;
size_t size;
@@ -1784,7 +1781,7 @@ int GrabCallback(pcilib_event_id_t event_id, pcilib_event_info_t *info, void *us
return PCILIB_STREAMING_CONTINUE;
}
-int raw_data(pcilib_event_id_t event_id, pcilib_event_info_t *info, pcilib_event_flags_t flags, size_t size, void *data, void *user) {
+int raw_data(pcilib_event_id_t event_id, const pcilib_event_info_t *info, pcilib_event_flags_t flags, size_t size, void *data, void *user) {
int err;
GRABContext *ctx = (GRABContext*)user;
@@ -2149,7 +2146,7 @@ int TriggerAndGrab(pcilib_t *handle, GRAB_MODE grab_mode, const char *evname, co
}
if (flags&PCILIB_EVENT_FLAG_PREPROCESS) {
- pcilib_configure_preprocessing_threads(handle, threads);
+ pcilib_write_register(handle, "conf", "max_threads", threads);
}
if (grab_mode&GRAB_MODE_TRIGGER) {
@@ -3419,7 +3416,7 @@ int main(int argc, char **argv) {
buffer *= 1024 * 1024;
} else {
buffer = get_free_memory();
- if (buffer < 256) Error("Not enough free memory (%lz MB) for buffering", buffer / 1024 / 1024);
+ if (buffer < 256) Error("Not enough free memory (%lz MiB) for buffering", buffer / 1024 / 1024);
buffer -= 128 + buffer/16;
}
diff --git a/protocols/default.c b/protocols/default.c
index 5e344cf..cbc53a8 100644
--- a/protocols/default.c
+++ b/protocols/default.c
@@ -5,6 +5,7 @@
#include "tools.h"
#include "model.h"
#include "error.h"
+#include "bar.h"
#define default_datacpy(dst, src, access, bank) pcilib_datacpy(dst, src, access, 1, bank->raw_endianess)
diff --git a/protocols/property.c b/protocols/property.c
index 0c7cf5d..978f22e 100644
--- a/protocols/property.c
+++ b/protocols/property.c
@@ -8,13 +8,16 @@
#include "error.h"
-int pcilib_property_registers_read(pcilib_t *ctx, pcilib_register_bank_context_t *bank, pcilib_register_addr_t addr, pcilib_register_value_t *regval) {
+int pcilib_property_registers_read(pcilib_t *ctx, pcilib_register_bank_context_t *bank_ctx, pcilib_register_addr_t addr, pcilib_register_value_t *regval) {
int err;
- pcilib_view_t view = addr;
+ const pcilib_register_bank_description_t *b = bank_ctx->bank;
+ int access = b->access / 8;
+
+ pcilib_view_t view = addr / access;
pcilib_value_t val = {0};
- if ((view == PCILIB_VIEW_INVALID)||(view >= ctx->num_views))
+ if ((view == PCILIB_VIEW_INVALID)||(view >= ctx->num_views)||(addr % access))
return PCILIB_ERROR_INVALID_ARGUMENT;
err = pcilib_get_property(ctx, ctx->views[view]->name, &val);
@@ -26,13 +29,16 @@ int pcilib_property_registers_read(pcilib_t *ctx, pcilib_register_bank_context_t
}
-int pcilib_property_registers_write(pcilib_t *ctx, pcilib_register_bank_context_t *bank, pcilib_register_addr_t addr, pcilib_register_value_t regval) {
+int pcilib_property_registers_write(pcilib_t *ctx, pcilib_register_bank_context_t *bank_ctx, pcilib_register_addr_t addr, pcilib_register_value_t regval) {
int err;
- pcilib_view_t view = addr;
+ const pcilib_register_bank_description_t *b = bank_ctx->bank;
+ int access = b->access / 8;
+
+ pcilib_view_t view = addr / access;
pcilib_value_t val = {0};
- if ((view == PCILIB_VIEW_INVALID)||(view >= ctx->num_views))
+ if ((view == PCILIB_VIEW_INVALID)||(view >= ctx->num_views)||(addr % access))
return PCILIB_ERROR_INVALID_ARGUMENT;
err = pcilib_set_value_from_register_value(ctx, &val, regval);