diff options
Diffstat (limited to 'usrp')
254 files changed, 0 insertions, 42704 deletions
diff --git a/usrp/.gitignore b/usrp/.gitignore deleted file mode 100644 index 4af69afee..000000000 --- a/usrp/.gitignore +++ /dev/null @@ -1,31 +0,0 @@ -/*.cache -/*.la -/*.lo -/*.pc -/.deps -/.la -/.libs -/.lo -/Makefile -/Makefile.in -/aclocal.m4 -/autom4te.cache -/config.cache -/config.h -/config.h.in -/config.log -/config.status -/configure -/depcomp -/install-sh -/ltmain.sh -/libtool -/ltmain.sh -/make.log -/missing -/missing -/stamp-h -/py-compile -/stamp-h.in -/stamp-h1 -/usrp.iss diff --git a/usrp/Makefile.am b/usrp/Makefile.am deleted file mode 100644 index cde72e1eb..000000000 --- a/usrp/Makefile.am +++ /dev/null @@ -1,33 +0,0 @@ -# -# Copyright 2003 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -include $(top_srcdir)/Makefile.common - -EXTRA_DIST += \ - usrp.pc.in \ - usrp.iss.in \ - usrp.inf - -SUBDIRS = host firmware fpga doc - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = \ - usrp.pc diff --git a/usrp/README b/usrp/README deleted file mode 100644 index df8277c3c..000000000 --- a/usrp/README +++ /dev/null @@ -1,29 +0,0 @@ -# -# README -- the short version -# - -The top level makefile handles the host code and FX2 firmware. - -Besides the normal gcc suite and all the auto tools, you'll need -the SDCC free C compiler to build the firmware. You MUST -USE VERSION 2.4.0 or VERSION 2.5.0 due to some problems with variable -initialization. http://sdcc.sourceforge.net - - -The high level interface to the USRP using our standard FPGA bitstram -is contained in usrp/host/lib/usrp_standard.h - -If you've got doxygen installed, there are html docs in -usrp/doc/html/index.html - - -# Compiling the verilog (not required unless you're modifying it) - -If you want to build the FPGA .rbf file from source (not required; we -provide pre-compiled .rbf files in usrp/fpga/rbf directory), you'll -need Altera's no cost Quartus II development tools. We're currently -building with Quartus II 5.1sp1 Web Edition. The project file is -usrp/fpga/toplevel/usrp_std/usrp_std.qpf. The toplevel verilog file -is usrp/fpga/toplevel/usrp_std/usrp_std.v. The bulk of the verilog -modules are contained in usrp/fpga/sdr_lib - diff --git a/usrp/doc/.gitignore b/usrp/doc/.gitignore deleted file mode 100644 index fdf7036a8..000000000 --- a/usrp/doc/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -/Makefile -/Makefile.in -/html -/latex -/man -/Doxyfile -/.la -/.lo -/.deps -/.libs -/*.la -/*.lo -/xml -/usrp_guide.html diff --git a/usrp/doc/Doxyfile.in b/usrp/doc/Doxyfile.in deleted file mode 100644 index 33c5bcf03..000000000 --- a/usrp/doc/Doxyfile.in +++ /dev/null @@ -1,1158 +0,0 @@ -# -# Copyright 2001,2004,2005 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -# Doxyfile 1.3.7 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project -# -# All text after a 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 (" ") - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded -# by quotes) that should identify the project. - -PROJECT_NAME = "Universal Software Radio Peripheral" - -# 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 = - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# 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 = - -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create -# 2 levels of 10 sub-directories 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 -# cause performance problems for the file system. - -CREATE_SUBDIRS = 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. -# The default language is English, other supported languages are: -# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, -# Finnish, French, German, Greek, Hungarian, Italian, Japanese, Japanese-en -# (Japanese with English messages), Korean, Korean-en, Norwegian, Polish, Portuguese, -# Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) 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. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES (the default) 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. - -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" "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. - -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. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES then 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. - -FULL_PATH_NAMES = NO - -# If the FULL_PATH_NAMES tag is set to YES then 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. - -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 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. - -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 -# comments will behave just like the Qt-style comments (thus requiring an -# explicit @brief command for a brief description. - -JAVADOC_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 behaviour. -# 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 behaviour instead. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. - -INHERIT_DOCS = 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. - -DISTRIBUTE_GROUP_DOC = 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. - -TAB_SIZE = 8 - -# This tag can be used to specify a number of aliases that acts -# 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 = - -# 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. - -OPTIMIZE_OUTPUT_FOR_C = NO - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources -# only. Doxygen will then generate output that is more tailored for Java. -# For instance, namespaces will be presented as packages, qualified scopes -# will look different, etc. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the SUBGROUPING tag to YES (the default) 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. - -SUBGROUPING = YES - -#--------------------------------------------------------------------------- -# 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 and EXTRACT_STATIC tags are set to YES - -EXTRACT_ALL = YES - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. - -EXTRACT_PRIVATE = NO - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -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. - -EXTRACT_LOCAL_CLASSES = YES - -# This flag is only useful for Objective-C code. When 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 (the default) only methods in the interface are included. - -EXTRACT_LOCAL_METHODS = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) 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. - -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 (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. - -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 (the default) these declarations will be included in the -# documentation. - -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 (the default) these blocks will be appended to the -# function's detailed documentation block. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. - -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 -# users are advised to set this option to NO. - -CASE_SENSE_NAMES = YES - -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. - -SHOW_INCLUDE_FILES = YES - -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES (the default) 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. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in -# declaration order. - -SORT_BRIEF_DOCS = 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 default), 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. - -SORT_BY_SCOPE_NAME = 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. - -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. - -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. - -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. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or define consists of 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 initializer of individual variables and defines in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. - -MAX_INITIALIZER_LINES = 30 - -# 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. - -SHOW_USED_FILES = YES - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. - -WARNINGS = YES - -# If WARN_IF_UNDOCUMENTED 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. - -WARN_IF_UNDOCUMENTED = YES - -# If WARN_IF_DOC_ERROR 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. - -WARN_IF_DOC_ERROR = YES - -# 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. - -WARN_FORMAT = "$file:$line: $text" - -# 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 stderr. - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be 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. - -INPUT = @top_srcdir@/usrp/host \ - @top_srcdir@/usrp/doc/other - -# If the value of the INPUT tag contains directories, you can use the -# FILE_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 the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp -# *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm - -FILE_PATTERNS = *.h \ - *.cc \ - *.dox - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. - -RECURSIVE = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should -# 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. - -EXCLUDE = CVS \ - @top_srcdir@/usrp/host/swig - -# The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories -# that are symbolic links (a Unix filesystem feature) are excluded from the input. - -EXCLUDE_SYMLINKS = NO - -# 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. - -EXCLUDE_PATTERNS = moc_*.cc - -# 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. -# Possible values are YES and NO. If left blank NO is used. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are 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. - -INPUT_FILTER = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). - -FILTER_SOURCE_FILES = NO - -#--------------------------------------------------------------------------- -# 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 also -# VERBATIM_HEADERS is set to NO. - -SOURCE_BROWSER = NO - -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C and C++ comments will always remain visible. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES (the default) -# then for each documented function all documented -# functions referencing it will be listed. - -REFERENCED_BY_RELATION = YES - -# If the REFERENCES_RELATION tag is set to YES (the default) -# then for each documented function all documented entities -# called/used by that function will be listed. - -REFERENCES_RELATION = YES - -# If the VERBATIM_HEADERS tag is set to YES (the default) 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. - -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# 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. - -ALPHABETICAL_INDEX = NO - -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) - -COLS_IN_ALPHA_INDEX = 5 - -# 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 one or more prefixes that -# should be ignored while generating the index headers. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. - -GENERATE_HTML = @enable_html_docs@ - -# 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. If left blank `html' will be used as the default path. - -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). If it is left blank -# doxygen will generate files with .html extension. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a -# standard header. - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. - -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 the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own -# stylesheet in the HTML output directory as well, or it will be erased! - -HTML_STYLESHEET = - -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to -# NO a bullet list will be used. - -HTML_ALIGN_MEMBERS = YES - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) -# of the generated HTML documentation. - -GENERATE_HTMLHELP = NO - -# If the GENERATE_HTMLHELP tag is set to YES, 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. - -CHM_FILE = - -# If the GENERATE_HTMLHELP tag is set to YES, 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. - -HHC_LOCATION = - -# If the GENERATE_HTMLHELP tag is set to YES, 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). - -GENERATE_CHI = NO - -# If the GENERATE_HTMLHELP tag is set to YES, 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. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. - -TOC_EXPAND = NO - -# The DISABLE_INDEX tag can be used to turn on/off the condensed index at -# top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. - -DISABLE_INDEX = NO - -# This tag can be used to set the number of enum values (range [1..20]) -# that doxygen will group on one line in the generated HTML documentation. - -ENUM_VALUES_PER_LINE = 4 - -# If the GENERATE_TREEVIEW tag 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 (for instance Mozilla 1.0+, -# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are -# probably better off using the HTML help feature. - -GENERATE_TREEVIEW = NO - -# 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. - -TREEVIEW_WIDTH = 250 - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will -# generate Latex output. - -GENERATE_LATEX = @enable_latex_docs@ - -# 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. If left blank `latex' will be used as the default path. - -LATEX_OUTPUT = latex - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be -# invoked. If left blank `latex' will be used as the default command name. - -LATEX_CMD_NAME = latex - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the -# default command name. - -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. - -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, a4wide, letter, legal and -# executive. If left blank a4wide will be used. - -PAPER_TYPE = letter - -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX -# packages that should be included in the LaTeX output. - -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. Notice: only use this tag if you know what you are doing! - -LATEX_HEADER = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). 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. - -PDF_HYPERLINKS = YES - -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a -# higher quality PDF documentation. - -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. - -LATEX_BATCHMODE = NO - -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) -# in the output. - -LATEX_HIDE_INDICES = NO - -#--------------------------------------------------------------------------- -# 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 very pretty with -# other RTF readers or editors. - -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. If left blank `rtf' will be used as the default path. - -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. - -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 other -# programs which support those fields. -# Note: wordpad (write) and others do not support links. - -RTF_HYPERLINKS = NO - -# 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. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an rtf document. -# Syntax is similar to doxygen's config file. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will -# generate man pages - -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. If left blank `man' will be used as the default path. - -MAN_OUTPUT = man - -# The MAN_EXTENSION tag determines the extension that is added to -# the generated man pages (default is the subroutine's section .3) - -MAN_EXTENSION = .3 - -# 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 is NO. - -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# 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. - -GENERATE_XML = @enable_xml_docs@ - -# 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. If left blank `xml' will be used as the default path. - -XML_OUTPUT = xml - -# The XML_SCHEMA tag can be used to specify an XML schema, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify an XML DTD, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -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. - -XML_PROGRAMLISTING = YES - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see 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. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# 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. - -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. - -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. - -PERLMOD_PRETTY = YES - -# 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. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include -# files. - -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 (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled -# way by setting EXPAND_ONLY_PREDEF 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_PREDEFINED tags. - -EXPAND_ONLY_PREDEF = NO - -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# in the INCLUDE_PATH (see below) will be search if a #include is found. - -SEARCH_INCLUDES = YES - -# 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. - -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. - -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 -# 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. - -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. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all 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. - -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES option can be used to specify one or more tagfiles. -# Optionally an initial location of the external documentation -# can be added for each tagfile. 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. If a location is present for each tag, the installdox tool -# does not have to be run to correct the links. -# Note that 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. - -GENERATE_TAGFILE = - -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes -# will be listed. - -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. - -EXTERNAL_GROUPS = YES - -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of `which perl'). - -PERL_PATH = /usr/bin/perl - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base or -# super classes. Setting the tag to NO turns the diagrams off. Note that this -# option is superseded by the HAVE_DOT option below. This is only a fallback. It is -# recommended to install and use dot, since it yields more powerful graphs. - -CLASS_DIAGRAMS = YES - -# 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. - -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, 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) - -HAVE_DOT = @HAVE_DOT@ - -# If the CLASS_GRAPH and HAVE_DOT tags are 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 -# the CLASS_DIAGRAMS tag to NO. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH and HAVE_DOT tags are 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. - -COLLABORATION_GRAPH = 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. - -UML_LOOK = NO - -# If set to YES, the inheritance and collaboration graphs will show the -# relations between templates and their instances. - -TEMPLATE_RELATIONS = NO - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# 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. - -INCLUDE_GRAPH = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or -# indirectly include this file. - -INCLUDED_BY_GRAPH = YES - -# If the CALL_GRAPH and HAVE_DOT tags are 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. - -CALL_GRAPH = NO - -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen -# will graphical hierarchy of all classes instead of a textual one. - -GRAPHICAL_HIERARCHY = YES - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are png, jpg, or gif -# If left blank png will be used. - -DOT_IMAGE_FORMAT = png - -# The tag DOT_PATH 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 on the path. - -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). - -DOTFILE_DIRS = - -# 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. - -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. - -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). - -DOT_TRANSPARENT = NO - -# Set the DOT_MULTI_TARGETS tag to YES 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. - -DOT_MULTI_TARGETS = YES - -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and -# arrows in the dot generated graphs. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate -# the various graphs. - -DOT_CLEANUP = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to the search engine -#--------------------------------------------------------------------------- - -# The SEARCHENGINE tag specifies whether or not a search engine should be -# used. If set to NO the values of all tags below this one will be ignored. - -SEARCHENGINE = NO diff --git a/usrp/doc/Makefile.am b/usrp/doc/Makefile.am deleted file mode 100644 index 0eddc623a..000000000 --- a/usrp/doc/Makefile.am +++ /dev/null @@ -1,71 +0,0 @@ -# -# Copyright 2001,2005,2009 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -include $(top_srcdir)/Makefile.common - - -SUBDIRS = other - -man3dir = $(mandir)/man3 -usrp_docdir = $(prefix)/share/doc/usrp-$(DOCVER) - -EXTRA_DIST += \ - Doxyfile.in \ - ddc.eps \ - ddc.png \ - usrp-block-diagram.eps \ - usrp-block-diagram.png \ - usrp.jpg \ - usrp_guide.xml - -if HAS_XMLTO -DOCBOOK_HTML_FILES=usrp_guide.html -all-local: dox docbook-html -else -DOCBOOK_HTML_FILES= -all-local: dox -endif - -dist_usrp_doc_DATA = $(top_srcdir)/usrp/README - -dox: html/index.html -html/index.html: - $(MKDIR_P) html - @DOXYGEN@ - -docbook-html: usrp_guide.html - -usrp_guide.html: usrp_guide.xml - xmlto html-nochunks $(top_srcdir)/usrp/doc/usrp_guide.xml - -install-data-local: - $(MKDIR_P) $(DESTDIR)$(usrp_docdir)/html - @for i in $(DOCBOOK_HTML_FILES); do \ - echo "$(INSTALL_DATA) $$i $(DESTDIR)$(usrp_docdir)/html"; \ - $(INSTALL_DATA) $$i $(DESTDIR)$(usrp_docdir)/html; \ - done - cp -r html $(DESTDIR)$(usrp_docdir) - -uninstall-local: - $(RM) -fr $(DESTDIR)$(usrp_docdir)/html - -clean-local: - $(RM) -fr latex html man xml $(DOCBOOK_HTML_FILES) diff --git a/usrp/doc/ddc.eps b/usrp/doc/ddc.eps deleted file mode 100644 index 8931a16a4..000000000 --- a/usrp/doc/ddc.eps +++ /dev/null @@ -1,3105 +0,0 @@ -%!PS-Adobe-3.0 EPSF-3.0 -%%BoundingBox: 0 0 755 575 -%%Pages: 0 -%%Creator: Sun Microsystems, Inc. -%%Title: none -%%CreationDate: none -%%LanguageLevel: 2 -%%EndComments -%%BeginPreview: 760 575 1 1725 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000010008000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000300FE001800C100000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000701CF001800C300000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000F03830018000300000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000003F03000018000300000000000 -%00000000000000001F800000000000031800000000000000000000000000780000000000000000 -%000000000000000000000000000000000000000000F00019C03000000000000000000000000000 -%0000000007303000019E0CFC0000000000 -%00000000000000007FE00000000000031800000000000000C00000000000F80000000000000000 -%000000000000000000000000000000000000000001E00019C03000000000000000000000000000 -%000000000030638001FF0C7C0000000000 -%000000000000000060700000000000030000000000000000C00000000000C00000000000000000 -%000000000000000000000000000000000000000003000019E03000000000000000000000000000 -%0000000000307FE001C38C300000000000 -%0000000000000000E0380000000000030000000000000000C00000000000C00000000000000000 -%000000000000000000000000000000000000000003000031F03000000000000000000000000000 -%000000000030787001C18C300000000000 -%0000000000000000E0000C04202002030842002100110181F01000000001F02000000000000000 -%000000000000000000000000000000000000000007C08031B03000000000000000000000000000 -%000000000030703001818C300000000000 -%0000000000000000E0007F86FDF87FC3187FC0FF803F8FF1F8FE001FFC03F9FC00000000000000 -%00000000000000000000000000000000000000000FE7F031B83000000000000000000000000000 -%0000000000307033F181CC300000000000 -%00000000000000007C00E3879FBC78C31879C1CF803F9C70E1C7001FFC00C38E00000000000000 -%0000000000000000000000000000000000000000030E38219C3000000000000000000000000000 -%0000000000307033F981CC300000000000 -%00000000000000003FC0C1C70E0C70631860E30780381838C38300000000C30600000000000000 -%0000000000000000000000000000000000000000030C18618C3000000000000000000000000000 -%00000000003070300181CC300000000000 -%000000000000000007E000C60E0C60631860630380380038C30180000000C30000000000000000 -%0000000000000000000000000000000000000000030C00618E3000000000000000000000000000 -%000000000030303001818C300000000000 -%000000000000000000F001C60E0C60731860670380380038C30380000000C3C000000000000000 -%0000000000000000000000000000000000000000030F804187300001B6DBFFFB6DB00000000000 -%000000000030303001C18C300000000000 -%000000000000000000383FC60E0C60331860670380380FF8C3FF801FFC00C1FC00000000000000 -%00000000000000000000000000000000000000000307F041833000000000000000000000000000 -%0000000000301C6001E30C300000000000 -%0000000000000001C018F8C60E0C60731860670380381E38C300001FFC00C03E00000000000000 -%00000000000000000000000000000000000000000300F8C183B000000000000000000000000000 -%0000000000300FC001FF0C3C0000000000 -%0000000000000001C019C0C60E0C60731860670380383838C30000000000C00700000000000000 -%000000000000000000000000000000000000000003001CC181F000000000000000000000000000 -%0000000000300780019C0C1C0000000000 -%0000000000000000E039C1C60E0C70631860630380383038C30180000000C30700000000000000 -%0000000000000000000000000000000000000000030C0C8180F000000000000000000000000000 -%0000000000000000000000000000000000 -%0000000000000000F071C1C60E0C70E31860638780383078E38380000000C30600000000000000 -%0000000000000000000000000000000000000000030C1D8180F000000000000000080000000000 -%0000000000000000000000000000000000 -%00000000000000007FE0E7C60E0C7FC3186061FF80381CF8F9FF00000000C3DE00000000000000 -%00000000000000000000000000000000000000000307F981807000000000000000040000000000 -%0000000000000000000000000000000000 -%00000000000000001FC07CC60E0C7F83186060FB80380F98787C00000000C0FC00000000000000 -%00000000000000000000000000000000000000000303F181803000000000000000020000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000060000000000300000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000060000000030300000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000060000000038700000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000010000000000 -%0000000000000000000000000000000000 -%00000000000000000000000000006000000001FE00000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000060000000007800000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000008000000000 -%0008000000000000000018000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000004000000000 -%000C000180000060000018000000001000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000C000380000060000018000000003000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000004000000000 -%000C000380000060000018000000003000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000C000380000060000018000000003000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%03DC1F87E1F001F87E0019E01F00F87E00 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000001000000000 -%0FFC7FC7C7FC00F0FF001FF83FC3FC7C00 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%1C3C60C38E0C0061C3801C1870E30E3000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000001000000000 -%181C60E38C0C006181801C1CE063043000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000800000000 -%181C00E3800C006300C0181CC033803000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%381C0FE381FC006300C0181CC033F03000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000400000000 -%380C7FE387FC006300C0181CC030FC3000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%181C60E38E0C006300C0181CC0300E3000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%181CC0E38C0C006381C0181CC072063000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%1C1CC0E38C1C00618180181C6067063800 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0E3CE1E38E3C0071C380181C70E38E3800 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000100000000 -%07FC7F61E7EC0078FF00181C3FC1FC1E00 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000100000000 -%01881C60E3C600383C0018080F00F00E00 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000080000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000080000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000040000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000040000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000020000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000020000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000003000000C01803C03FC00000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000003000000C0180FF03FF00000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000003000000C0181E7C38F80000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000C018301C301C0000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000008000000 -%000000000000000C018300C301C0000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000004000000 -%00000603307E000C0183000301C0000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000070330FF800C0183C0030180000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000002000000 -%0000030631C1800C0181FC030380000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000002000000 -%000003063181800C01807F03FF00000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000001863001800C018007C3FF80000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000001000000 -%0000018C303F800C018001C301C0000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000018C30FD800C018000E300C0000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000800000 -%000000DC31C1800C018600E300E0000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000800000 -%000000D83181800E038700E300E0000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000F83183800E038380C300C0000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000400000 -%0000007031C78007FF03FF83FFC0000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000007030FD8003FE00FF03FF80000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000203070800070003C03FC00000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000200000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000100000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000040000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000020000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000010000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000010000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000004000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000004000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000002600 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000003E00 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%00000000000000000000000000000000000000000000000000000000000000000000000003FE00 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000003FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000001FE00 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%00000000000000000000020000000000000000000000000000000000000000000010000000FE00 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000200000000000000000000000000000000000000000000100000007E00 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000200000000000000000000000000000000000000000000100000003E00 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000200000000000000000000000000000000000000000000100000001E00 -%0000000000000000000000000000000000 -%000007000000000004003C00000000000000000000000000000000000F00000000000000000000 -%000000000000000000000200000000000000000000000000000000000000000000100000001E00 -%0000000000000000000000000000000000 -%00000700000000000C007C00000000000000000000000000000000007FE0000000000000000000 -%000000000000000000000200000000000000000000000000000000000000000000100000000E00 -%0000000000000000000000000000000000 -%00000700000000000C00600000000000000000000000000000000007FFFE000000000000000000 -%000000000000000000000200000000000000000000000000000000000000000000100000000600 -%0000000000000000000000000000000000 -%00000700000000000C0060000000000000000000000000000000001F801F800000000000000000 -%000000000000000000000200000000000000000000000000000000000000000000100000000200 -%0000000000000000000000000000000000 -%00000719E06F03033F01FCDC1E06787800000000000000000000007C0003E00000000000000000 -%000000000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000000000000000000000000 -%0000071FF87FC3031F01F8FC7F87FDFC0000000000000000000000F80001F00000000000000000 -%000000000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000000000000000000000000 -%0000071E1870E3030C0060E0E1C78F0C0000000000000000000001C00000380000000000000000 -%000000000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000000000000000000000000 -%0000071C1C6063030C0060C0C0E7060E00000000000000000000038000001C0000000000000000 -%000000000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000000000000000000000000 -%0000071C0C6063030C0060C18067060E00000000000000000000078000000E0000000000000000 -%000000000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000000000000000000000000 -%000007180C6063030C0060C18067060E000000000000000000000CC000001B0000000000000000 -%000000000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000000000000000000000000 -%000007180C6063030C0060C18067060E0000000000000000000018600000318000000000000000 -%000000000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000000000000000000000000 -%000007180C6063030C0060C18067060E0000000000000000000018300000618000000000000000 -%000000000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000000000000000000000000 -%000007180C6063070C0060C1C067060E0000000000000000000030180000C0C000000000000000 -%000000000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000001800000000000000000 -%000007180C60E3070C0060C0C0C7060E00000000000000000000300C000180C000000000000000 -%000000000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000001800000000000000000 -%000007180C71C38F0C0060C0E1C7060E0000000000000000000060060003006000000000000000 -%000000000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000001800000000000000000 -%000007180C7F81FB0F0060C07F87060E0000000000000000000040030006002000000000000000 -%000000000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000001800000000000000000 -%000006180C6700F3070060C01E07060600000000000000000000C001800C003000000000000000 -%000000000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000001800000000000000000 -%0000000000600000000000000000000000000000000000000000C000C01C003000000000000000 -%000000000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000001800000000000000000 -%0000000000600000000000000000000000000000000000000001C0006038003800000000000000 -%000000000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000001800000000000000000 -%0000000000600000000000000000000000000000000000000601C0003070003800000000000000 -%000000000000000000700200000000000000000000000000000000000000000000100000000000 -%0000000060000001800000000000000000 -%00000000006000000000000000000000000000000000000007E1800018E0001800000000000000 -%0000000000000000007F0200000000000000000000000000000000000000000000100000000000 -%000000007E000001800000000000000000 -%00000000000000000000000000000000000000000000000007FD80000DC0001800000000000000 -%0000000000000000007FC200000000000000000000000000000000000000000000100000000000 -%000000007FC00001800000000000000000 -%00000000000000000000000000000000000000000000000007FF80000780001800000000000000 -%0000000000000000007FFA00000003FF0000000060000000000300000000000000100000000000 -%000000007FF00001800000000000000000 -%0000000000000000000000000000000000000000000000000FFF80000700001C00000000000000 -%0000000000000000007FFA00000003FF800000006000000000C300000000000000100000000000 -%00000000FFF00001800000000000000000 -%00000000000000000000000000000000000000000000000007FD80000780001800000000000000 -%0000000000000000007FC20000000301C00000000000000000C000000000000000100000000000 -%000000007FC00001800000000000000000 -%00000000000000000000000000000000000000000000000007F180000DC0001800000000000000 -%0000000000000000007F020000000300E00000000000000000C000000000000000100000000000 -%000000007E000001800000000000000000 -%00000000000001007F0000200000000000000000000000000601800018E0001800000000000000 -%00000000000000000070020000000300601800404210100301E200400420000000100000000000 -%0000000060000001800000000000000000 -%00000000000003807FF003FC0000000000000000000000000001C0003070003800000000000000 -%00000000000000000000020000000300707F03F8637EFC1FE3F31BF03F60000000100000000000 -%0000000000000001800000000000000000 -%00000000000007807FF807FF0000000000000000000000000001C0006038003800000000000000 -%0000000000000000000002000000030030E7871C63CFDE1CF0C31F3879E0000000100000000000 -%0000000000000001800000000000000000 -%00000000000006C0601C0E070000000000000000000000000000C000C018003000000000000000 -%000000000000000000000200000003003181860C6387063030C31C1C60E0000000100000000000 -%0000000000000000000000000000000000 -%00000000000006C0600C1C038000000000000000000000000000C001800C003000000000000000 -%000000000000000000000200000003003181CC006307060030C31C1CE060000000100000000000 -%0000000000000000000000000000000000 -%0000000000000C60600E18018000000000000000000000000000C0030006003000000000000000 -%000000000000000000000200000003003381CC006303060070C3181CC060000000100000000000 -%0000000000000000000000000000000000 -%0000000000000C6060063800000000000000000000000000000040060003002000000000000000 -%0000000000000000000002000000030033FFCC006303060FF0C3181CC060000000100000000000 -%0000000000000000000000000000000000 -%0000000000001C70600638000000000000000000000000000000600C0001806000000000000000 -%0000000000000000000002000000030073800C006303063E30C3181CC060000000100000000000 -%0000000000000000000000000000000000 -%000000000000183060063800000000000000000000000000000020180000C04000000000000000 -%0000000000000000000002000000030063800C006303063030C3181CC060000000100000000000 -%0000000000000000000000000000000000 -%00000000000018306006380000000000000000000000000000003070000060C000000000000000 -%00000000000000000000020000000300E1818E0E6303063030C3181C60E0000000100000000000 -%0000000000000000000000000000000000 -%000000000000383860063800000000000000000000000000000038E0000031C000000000000000 -%00000000000000000000020000000301C1C1860C6303063070C3181C60E0000000100000000000 -%0000000000000000000000000000000000 -%0000000000003FF86006180000000000000000000000000000001CC000001B8000000000000000 -%000000000000000000000200000003FFC0FF87BC63030639F0F3181C3FE0000000100000000000 -%0000000000000000000000000000000000 -%000000000000301C600E180180000000000000000000000000000F8000000F0000000000000000 -%000000000000000000000200000003FF007E01F06303061FB873181C1F60000000100000000000 -%0000000000000000000000000000000000 -%000000000000600C600C1C038000000000000000000000000000070000000E0000000000000000 -%000000000000000000000200000000000000000000000000000000000060000000100000000000 -%0000000000000000000000000000000000 -%000000000000600C601C0E038000000000000000000000000000038000001C0000000000000000 -%000000000000000000000200000000000000000000000000000000004060000000100000000000 -%0000000000000000000000000000000000 -%000000000000E00E6078078F000000000000000000000000000001E00000780000000000000000 -%0000000000000000000002000000000000000000000000000000000061C0000000100000000000 -%0000000000000000000000000000000000 -%000000000000C0067FF003FE000000000000000000000000000000F80001F00000000000000000 -%000000000000000000000200000000000000000000000000000000003F80000000100000000000 -%0000000000000000000000000000000000 -%000000000000C0067FC000F00000000000000000000000000000003E0007C00000000000000000 -%000000000000000000000200000000000000000000000000000000000F00000000100000000000 -%0000000000000000000000000000000000 -%00000000000000000000000000000000000000000000000000000007F07E000000000000000000 -%000000000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000000000000000000000000 -%00000000000000000000000000000000000000000000000000000003FFFC000000000000000000 -%000000000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000007FE0000000000000000000 -%000000000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%000000000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%000000000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000600000000000000000000 -%00000000000000000000020000000000C000000000007FE0000000000000000000100000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000600000000000000000000 -%00000000000000000000020000000000C000000000007FF8000000000000000000100000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000600000000000000000000 -%00000000000000000000020000000000C00000000000701C000000000000000000100000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000F00000000000000000000 -%00000000000000000000020000000000C00000000000701C000000000000000000100000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000F00000000000000000000 -%00000000000000000000020000000000C000E040C080700C0700E00C0000000000100000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000F00000000000000000000 -%00000000000000000000020000000000C003F860C180700C3FC3F83F8000000000100000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000001F00000000000000000000 -%00000000000000000000020000000000C0071C61E180700C71E31C738000000000100000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000001F80000000000000000000 -%00000000000000000000020000000000C00E0E61E180701C60660C61C000000000100000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000003F80000000000000000000 -%00000000000000000000020000000000C00C0631E3007FF8006700600000000000100000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000003FC0000000000000000000 -%00000000000000000000020000000000C00C0731B3007FF000E3C0780000000000100000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%00000000000000000000020000000000C00C0733330070003FE1F83F8000000000100000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%00000000000000000000020000000000C00C071B360070007C607C07C000000000100000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%00000000000000000000020000000000C00C061B3600700060600E01C000000000100000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%00000000000000000000020000000000C00C061E1E007000E0E606C0C000000000100000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%00000000000000000000020000000000C00E0E1E1E007000E0E70E60C000000000100000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%00000000000000000000020000000000FFC7FC0E1C00700077E3FC7F8000000000100000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%00000000000000000000020000000000FFC1F00E1C0070003E61F83F0000000000100000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%000000000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%000000000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%000000000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%000000000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%000000000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%000000000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000003 -%C00000000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000000000000000000000000 -%000007000000000000003C0000000000000000000000000000000000040000000000000000001F -%FC0000000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000000000000000000000000 -%00000700000000000C007C000000000000000000000000000000000004000000000000000001FC -%7FC000000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000000000000000000000000 -%00000700000000000C0060000000000000000000000000000000000004000000000000000007E0 -%07E000000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000000000000000000000000 -%00000700000000000C006000000000000000000000000000000000000400000000000000001F00 -%00F80000000000000000020000000000000000FFE3180000000000000000000000100000000000 -%0000000000000000000000000000000000 -%00000718E04703021F01F89C1E0238700000000000000000000000000400000000000000007800 -%001C0000000000000000020000000000000000FFE3186000000000000000000000100000000000 -%0000000000000000000000000000000000 -%0000071BF07F83033F01FCFC7F87FCFC000000000000000000000000040000000000000000E000 -%000E0000000000000000020000000000000000C000186000000000000000000000100000000000 -%0000000000000000000000000000000000 -%0000071F3879C3030C0060FCF1C7CF9C000000000000000000000000040000000000000000E000 -%00070000000000000000020000000000000000C000186000000000000000000000100000000000 -%0000000000000000000000000000000000 -%0000071C1C70E3030C0060C0C0C7070E000000000000000000000000040000000000000001E000 -%00038000000000000000020000000000000000C00318F81C046000000000000000100000000000 -%0000000000000000000000000000000000 -%0000071C0C6063030C0060C1C067060E0000000000000000000000000400000000000000033000 -%0007C000000000000000020000000000000000C00318FC7F07F000000000000000100000000000 -%0000000000000000000000000000000000 -%000007180C6063030C0060C18067060E0000000000000000000000000400000000000000061800 -%000CE000000000000000020000000000000000C0031870E387E000000000000000100000000000 -%0000000000000000000000000000000000 -%000007180C6063030C0060C18067060E0000000000000000000000000400000000000000061C00 -%00187000000000000000020000000000000000FFC3186181870000000000000000100000000000 -%0000000000000000000000000000000000 -%000007180C6063030C0060C18067060E0000000000000000000000000400000000000000040E00 -%00307000000000000000020000000000000000FFC3186180C60000000000000000100000000000 -%0000000000000007C00000000000000000 -%000007180C6063030C0060C18067060E00000000000000000000000004000000000000000C0700 -%00603800000000000000020000000000000000C0031861FFC60000000000000000100000000000 -%000000000000001FF00000000000000000 -%000007180C6063070C0060C0C0E7060E0000000000000000000000000400000000000000180380 -%00C03800000000000000020000000000000000C0031861FFC60000000000000000100000000000 -%00000000000000383C0000000000000000 -%000007180C70C3070C0060C0E1C7060E00000000000000000000000004000000000000001801C0 -%01801800000000000000020000000000000000C003186180060000000000000000100000000000 -%00000000000000701C0000000000000000 -%000007180C7FC3FF0F0060C07F87060E00000000000000000000000004000000000000003000E0 -%03001C00000000000000020000000000000000C003186180060000000000000000100000000000 -%00000000000000E00E0000000000000000 -%000007180C6F00F3070060C03F07060E0000000000000000000000000400000000000000300060 -%06000C00000000000000020000000000000000C003186180C60000000000000000100000000000 -%00000000000000C0060000000000000000 -%000000000060000000000000000000000000000000000000000000000400000000000000300030 -%0C000C00000000000000020000000000000000C0031871C1860000000000000000100000000000 -%00000000000001C0070000000000000000 -%000000000060000000000000000000000000000000000000000000000400000000000C00300018 -%18000400000000000070020000000000000000C003187CFF860000000000000000100000000000 -%00000000600001C0070000000000000000 -%000000000060000000000000000000000000000000000000000000000400000000000FE060000E -%3000060000000000007F020000000000000000C003183C3E060000000000000000100000000000 -%000000007E0001C0070000000000000000 -%000000000060000000000000000000000000000000000000000000000400000000000FF8600006 -%6000060000000000007FC200000000000000000000000000000000000000000000100000000000 -%000000007FC001C0070000000000000000 -%000000000060000000000000000000000000000000000000000000000400000000000FFF600003 -%C000060000000000007FFA00000000000000000000000000000000000000000000100000000000 -%00000000FFF001C0070000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000FFE600001 -%C000060000000000007FFA00000000000000000000000000000000000000000000100000000000 -%00000000FFF000C0060000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000FF8600003 -%C000060000000000007FC200000000000000000000000000000000000000000000100000000000 -%000000007FC000C0060000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000FE0600006 -%6000060000000000007F0200000000000000000000000000000000000000000000100000000000 -%000000007E000060EC0000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000C0060000C -%380006000000000000700200000000000000000000000000000000000000000000100000000000 -%00000000600000707C0000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000700018 -%180006000000000000000200000000000000000000000000000000000000000000100000000000 -%000000000000003FFC0000000000000000 -%00000000000003807FE001FC000000000000000000000000000000000400000000000000300030 -%0C000C000000000000000200000000000000000000000000000000000000000000100000000000 -%000000000000000FEE0000000000000000 -%00000000000003807FF807FE000000000000000000000000000000000400000000000000300070 -%07000C000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000000030000000000000000 -%00000000000006C0603C0E070000000000000000000000000000000004000000000000003000E0 -%03000C000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000000000000000000000000 -%00000000000006C0600C0C038000000000000000000000000000000004000000000000003001C0 -%01801C000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000000000000000000000000 -%0000000000000EE0600E1801800000000000000000000000000000000400000000000000180380 -%00E018000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000000000000000000000000 -%0000000000000C60600E1800000000000000000000000000000000000400000000000000180700 -%007038000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000000000000000000000000 -%0000000000000C60600638000000000000000000000000000000000004000000000000000C0E00 -%003838000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000000000000000000000000 -%0000000000001C70600638000000000000000000000000000000000004000000000000000C1C00 -%001C70000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000000000000000000000000 -%000000000000183060063800000000000000000000000000000000000400000000000000061800 -%000E70000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000000000000000000000000 -%000000000000183860063800000000000000000000000000000000000400000000000000033000 -%0007E0000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000000000000000000000000 -%0000000000003FF86006380000000000000000000000000000000000040000000000000001A000 -%000380000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000000000000000000000000 -%0000000000003FF8600E180180000000000000000000000000000000040000000000000000C000 -%000300000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000000000000000000000000 -%000000000000701C600E1C0180000000000000000000000000000000040000000000000000E000 -%000700000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000000000000000000000000 -%000000000000600C601C0C03800000000000000000000000000000000400000000000000007C00 -%003E00000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000000000000000000000000 -%000000000000E00E603C0F07000000000000000000000000000000000400000000000000003E00 -%00FC00000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000000000000000000000000 -%000000000000E00E7FF807FE000000000000000000000000000000000400000000000000000F80 -%01F000000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000000000000000000000000 -%000000000000C0067FE001F80000000000000000000000000000000004000000000000000003FC -%3F8000000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000000000000000000000000 -%0000000000000000000000000000000000000000000000000000000004000000000000000000FF -%FF0000000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000000000000000000000000 -%00000000000000000000000000000000000000000000000000000000040000000000000000001F -%F80000000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000001 -%000000000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%000000000000000000000200000000000000000000000000000000000000000000100000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000003 -%0000000000000000000003FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE00000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000003 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000007 -%00000000000000000000000000000000000000000000C000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000007 -%80000000000000000000000000000000000000000000C000000000000000000000000000000000 -%0000000000000000000000000000000000 -%00000000000000000000000000000000000000000000000000000000040000000000000000000F -%80000000000000000000000000000000000000000001E000000000000000000000000000000000 -%0000000000000000000000000000000000 -%00000000000000000000000000000000000000000000000000000000040000000000000000000F -%80000000000000000000000000000000000000000001E000000000000000000000000000000000 -%0000000000000000000000000000000000 -%00000000000000000000000000000000000000000000000000000000040000000000000000000F -%C0000000000000000000000000000000000000000001E000000000000000000000000000000000 -%0000000000000000000000000000000000 -%00000000000000000000000000000000000000000000000000000000040000000000000000000F -%C0000000000000000000000000000000000000000003F000000000000000000000000000000000 -%0000000000000000000000000000000000 -%00000000000000000000000000000000000000000000000000000000040000000000000000000F -%C0000000000000000000000000000000000000000003F000000000000000000000000000000000 -%0000000000000000000000000000000000 -%00000000000000000000000000000000000000000000000000000000040000000000000000001F -%C0000000000000000000000000000000000000000003F000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%00000000000000000000000000000000000000000003F000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%00000000000000000000000000000000000000000007F800000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%00000000000000000000000000000000000000000000C000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000C00000400000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000C00000400000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000800000400000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%0000000000000000000000000000000000000000000000007E0C6FC00400000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000E70C7FE00400000000000000000000 -%0007807807C0000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000C38C70600400000000000000000000 -%001FC1FE0FE0000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000C00C60600400000000000000000000 -%003863871870000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000F00C60600400000000000000000000 -%003033039830000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%0000000000000000000000000000000000000000000000007E0C60600400000000000000000000 -%007007019800000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%0000000000000000000000000000000000000000000000001F8C60600400000000000000000000 -%006007019F80000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000038C60600400000000000000000000 -%0060060187E0000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000818C60600400000000000000000000 -%0060070180F0000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000C18C60600400000000000000000000 -%007037018038000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000E38C60600400000000000000000000 -%003033039838000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%0000000000000000000000000000000000000000000000007F0C60600400000000000000000000 -%003863871830000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%001FE1FE0FF0000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%0007807C07C0000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000400000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%0000000000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -%FFFFFFFFFFFFFFFFC0000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%0000000000000000000000000000000000000000800000000000000000001803003E000F800000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%0000000000000000000000000000000000000000800000000000000000001C0300FF803FE00000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%0000000000000000000000000000000000000000800000000000000000001E0303C1C070780000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%0000000000000000000000000000000000000000800000000000000000001E030300C0E0380000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%0000000000000000000000000000000000000000800000000000000000001F030700E1C01C0000 -%00000000000000004000000000000001FF00000000006000018006086000000000000000000000 -%0000000000000000000000000000000000 -%0000000000000000000000000000000000000000800000000000000000001B83060001800C0000 -%00000000000000004000000000000001FFC0000000006000018006186000000000000000000000 -%0000000000000000000000000000000000 -%00000000000000000000000000000000000000008000000000000000000019C30E0003800E0000 -%0000000000000000400000000000000180C0000000006000000006186000000000000000000000 -%0000000000000000000000000000000000 -%00000000000000000000000000000000000000008000000000000000000019C30E0003800E0000 -%0000000000000000400000000000000180E0000000006000000006186000000000000000000000 -%0000000000000000000000000000000000 -%00000000000000000000000000000000000000008000000000000000000018E30C0003800E0000 -%0000000000000000400000000000000180603C08E00E66060D80C67E6700000000000000000000 -%0000000000000000000000000000000000 -%00000000000000000000000000000000000000008000000000000000000018630E0003800E0000 -%000000000000000040000000000000018060FF1FF83FE30E0D83F67E6FC0000000000000000000 -%0000000000000000000000000000000000 -%00000000000000000000000000000000000000008000000000000000000018330E0003800E0000 -%0000000000000000400000000000000180C1C71F3871E30E0D871E1878E0000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000183B060061800C0000 -%00000000000000004000000000000001FF83831C1C60E30F198E0E187060000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000181B060061800C0000 -%00000000000000004000000000000001FF80031C0CE0630B198C0E186060000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000181F0700E0C01C0000 -%0000000000000000400000000000000181E0071C0CE0619B198C06186060000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000180F0381C0E0380000 -%000000000000000040000000000000018060FF1C0CC0619B318C06186060000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000180701FF807FF00000 -%000000000000000040000000000000018071E31C0CC06199B18C06186060000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000180700FF001FC00000 -%000000000000000040000000000000018073831C0CE060F1B18C06186060000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%000000000000000040000000000000018073031C0C6060F1E18E0E186060000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%0000000000000000400000000000000180E3071C0C70E0F0E1861E186060000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%00000000000000004000000000000001FFC1FF9C0C3FE070E187FE1E6060000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%00000000000000004000000000000001FF80F99C0C0F6060E181E60E6060000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000003E0300000000006000FC00000003 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%00000000000000000000000000000000000000008000000000FF830000000000C003FF00000003 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%00000000000000000000000000000000000000008000000001C1C00000000000C0070780000000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%0000000000000000000000000000000000000000800000000380E00000000000C00E0180000000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%0000000000000000000000000000000000000000800000000380400000000000800C01C0000000 -%000000000000000040000000000000000C000000180000000010C0000000000000000000000000 -%0000000000000000000000000000000000 -%0000000000000000000000000000000000000000800000000380031BF81F8001801C0001FC1FC3 -%1BF03F800000000040000000000000000C000000180000000030C0000000000000000000000000 -%0000000000000000000000000000000000 -%00000000000000000000000000000000000000008000000001F0031F3839C001801800039E38E3 -%1F3879C00000000040000000000000000C00000000000000003000000000000000000000000000 -%0000000000000000000000000000000000 -%00000000000000000000000000000000000000008000000000FE031C1C60600100180007073063 -%1C1860E00000000040000000000000000C00000000000000003000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000001FC31C0C60700300180006033003 -%1C1CC060000000004000000000000001CC07001C18CF0E01F07CC07819E0000000000000000000 -%0000000000000000000000000000000000 -%0000000000000000000000000000000000000000800000000003C31C0CE070030018000E033C03 -%181CE060000000004000000000000007EC1FC07F18FFBF83FC7CC0FE1BF0000000000000000000 -%0000000000000000000000000000000000 -%0000000000000000000000000000000000000000800000000000E31C0CFFF0030018000E031FC3 -%181CFFE000000000400000000000000E3C38E0E398F1F3861C30C1C71E38000000000000000000 -%0000000000000000000000000000000000 -%0000000000000000000000000000000000000000800000000300631C0CE00006001C00CE0303E3 -%181CC00000000000400000000000000C1C6070C198E0C18E0C30C3839C18000000000000000000 -%0000000000000000000000000000000000 -%0000000000000000000000000000000000000000800000000300631C0CE00006000C01CE030073 -%181CC0000000000040000000000000180C60318018E0C1800C30C3019818000000000000000000 -%0000000000000000000000000000000000 -%0000000000000000000000000000000000000000800000000380631C0C606006000E0186073073 -%181CE0600000000040000000000000180C7FF18018C0C1803C30C301981C000000000000000000 -%0000000000000000000000000000000000 -%00000000000000000000000000000000000000008000000003C0C31C0C70600400070387063073 -%181C70E00000000040000000000000180C7FF18018C0C183FC30C701981C000000000000000000 -%0000000000000000000000000000000000 -%00000000000000000000000000000000000000008000000001FFC31C0C3DE00C0003FF03DE3DE3 -%181C3BC00000000040000000000000180C60018018C0C1878C30C701981C000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000007F031C0C1F800C0001FC01F80FC3 -%181C1F800000000040000000000000180C60018098C0C18C0C30C301981C000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%0000000000000000400000000000000C1C7031C1D8C0C18C0C30C301981C000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%0000000000000000400000000000000E1C7060C198C0C18C1C30C383981C000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%00000000000000004000000000000007FC3FE07F18C0C187FE3EC1FF181C000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%00000000000000004000000000000003CC0F803E18C0C183E61EC07C181C000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%00000000000000000000000000000000000000008000000000000007E000000000000000000000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%0000000000000000000000000000000000000000800000000000001FF800000000000000006000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000381C00000000000000006000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000700E00000000000000006000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%00000000000000000000000000000000000000008000000000000060060300860030110180F818 -%088000000000000040000000000000001E00000010000000000000380700000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000E0001FC0DF81FC3F8FF0F8FE -%0FE000000000000040000000000000003E000000300000000000003C0700000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000C0003CE0F9C38E3F9C7061C7 -%0FC0000000000000400000000000000030000000300000000000003C0700000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000C0003030E0C3073818386383 -%8E00000000000000400000000000000030000000300000000000003E0700000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000C0FE6030C0E6033800386301 -%8C000000000000004000000000000000FE1F00F07E1F037007FF00360700000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000C0FF7030C0E7033800386301 -%CC000000000000004000000000000000FE7FC1FC7C3F83F007FF00330700000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000C0077FF0C0E7FF380FF86301 -%CC0000000000000040000000000000003061C38E3071C3D0000000338700000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000E0076000C0E600381E386301 -%CC00000000000000400000000000000030E0C70630C0E38000000031C700000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000E0076000C0E6003838386301 -%CC0000000000000040000000000000003000C60030C0630000000030C700000000000000000000 -%0000000000000000000000000000000000 -%00000000000000000000000000000000000000008000000000000070077030C0E7033830386301 -%8C0000000000000040000000000000003007C60030C0630000000030E700000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000381E3870C0E3073830786383 -%8C000000000000004000000000000000303FC60031C0730007FF00307700000000000000000000 -%0000000000000000000000000000000000 -%0000000000000000000000000000000000000000800000000000001FFC1FE0C0E3FE381CF879FF -%0C0000000000000040000000000000003070C60030C0630007FF00303700000000000000000000 -%0000000000000000000000000000000000 -%00000000000000000000000000000000000000008000000000000007F00FC0C0E0FC380F983C7C -%0C00000000000000400000000000000030C0C60230C06300000000303F00000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%0000000000000000400000000000000030C0C60630C06300000000301F00000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%0000000000000000400000000000000030E1C30E38E0E300000000300F00000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%00000000000000004000000000000000307FE3FC3E7FC300000000300F00000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%00000000000000004000000000000000303C60F01E1F0300000000300700000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000080000000000000000000000000000000000000 -%000000000000000040000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%0000000000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -%FFFFFFFFFFFFFFFFC0000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000010000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000018000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000018000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%00000000000000000000000000000000000000000000000000000000000000000003C000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%00000000000000000000000000000000000000000000000000000000000000000003C000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%00000000000000000000000000000000000000000000000000000000000000000003C000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%00000000000000000000000000000000000000000000000000000000000000000007C000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%00000000000000000000000000000000000000000000000000000000000000000007C000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%0000000000000000000000000000000000000000000000000000000000000000000FE000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%0000000000000000000000000000000000000000000000000000000000000000000FE000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%0000000000000000000000000000000000000000000000000000000000000000000FF000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%0000000000000000000000000000000000000000000000000000000000000000000FF000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000010000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000010000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000010000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000010000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000010000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000010000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000010000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000010000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000010000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000010000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000010000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000010000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000010000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000010000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000010000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000010000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000010000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000010000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000010000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000010000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000010000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000010000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000010000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000010000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000010000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000010000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000010000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000010000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000010000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000010000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000010000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000010000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000010000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000010000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000010000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000010000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000010000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000010000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000010000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000010000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%0000000000000000000000000000000000000000000001F800000000000000000F000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%0000000000000000000000000000000000000000000007FE00000000C00000001F000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000E0F00000000C000000018000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000001C0300000000C000000018000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%00000000000000000000000000000000000000000000180380000000E000000038000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%00000000000000000000000000000000000000000000380003F837E3F0FC0FC07F7F1FC07EC606 -%0FE0DF81FC60700000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000003800073C3CF0C1CE0FC0187F3CE0E7C606 -%1C70FBC38E70600000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%0000000000000000000000000000000000000000000030000C0C3870C3030E0018703071C1C606 -%3830E0C30630600000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%0000000000000000000000000000000000000000000030000C0E3030C3038C001870603181C606 -%3018C0C60030E00000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%0000000000000000000000000000000000000000000030001C0E3030C7038C001870703181C606 -%3038C0C60038C00000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%0000000000000000000000000000000000000000000030001FFE3030C7FF8C0018707FF180C606 -%3FF8C0C60018C00000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%0000000000000000000000000000000000000000000038019C003030C7000C001870600180C606 -%3000C0C60019800000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%0000000000000000000000000000000000000000000018019C003030C7000C001870600181C606 -%3000C0C6000D800000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000001C030C0C3030C3030C001870703181C606 -%3018C0C6060D000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000E070E0C3030C3830C0018703871C3C70E -%3838C0C3060F000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%0000000000000000000000000000000000000000000007FE07BC3030F1EF0C0018703FE0F7C3FE -%1EF0C0C3DE07000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%0000000000000000000000000000000000000000000003F803F0303070FC0C0018700FC07DC1F6 -%07E0C0C0F806000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%00000000000000000000000000000000000000000000000000000000000000000000000001C000 -%000000000006000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%00000000000000000000000000000000000000000000000000000000000000000000000001C000 -%000000000006000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%00000000000000000000000000000000000000000000000000000000000000000000000001C000 -%00000000001C000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%00000000000000000000000000000000000000000000000000000000000000000000000001C000 -%000000000038000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000008000 -%000000000030000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000001E000187C00000000000003C0 -%0060F8000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000003E00011FF000C0000000007C0 -%0063FC000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%00000000000000000000000000000000000000000000000000000300003183001C000000000E00 -%00670E000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%00000000000000000000000000000000000000000000000000000300003303801C000000380C00 -%004606000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%00000000000000000000000000000000000000000000000000000FC1802301803E030000381F03 -%00C607000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%00000000000000000000000000000000000000000000000000000FC7F06001803F1FC000381F9F -%C0C006000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%0000000000000000000000000000000000000000000000000000070E706003801C38E000380C18 -%E08006000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%0000000000000000000000000000000000000000000000000000031C386007001C707003FF8C30 -%60800E000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%0000000000000000000000000000000000000000000000000000031C00C00E001C603003FF8C38 -%01801C000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%0000000000000000000000000000000000000000000000000000030F00C01C001C603800380C1E -%018038000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000FE307E0C038001C603800380C0F -%C10070000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000FE300F88070001C603800380C03 -%E300E0000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000003003980E0001C603800380C00 -%7303C0000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000003181981C0001C703000380C30 -%330300000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%0000000000000000000000000000000000000000000000000000031C190380001C307000000C38 -%760600000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%0000000000000000000000000000000000000000000000000000030FF103FF800F3FE000000C1F -%E60FFE000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%00000000000000000000000000000000000000000000000000000307E303FF800F0FC000000C0F -%C60FFF000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%%EndPreview -%%BeginProlog -%%BeginResource: SDRes -/b4_inc_state save def -/dict_count countdictstack def -/op_count count 1 sub def -userdict begin -0 setgray 0 setlinecap 1 setlinewidth 0 setlinejoin 10 setmiterlimit[] 0 setdash newpath -/languagelevel where {pop languagelevel 1 ne {false setstrokeadjust false setoverprint} if} if -/bdef {bind def} bind def -/c {setgray} bdef -/l {neg lineto} bdef -/rl {neg rlineto} bdef -/lc {setlinecap} bdef -/lj {setlinejoin} bdef -/lw {setlinewidth} bdef -/ml {setmiterlimit} bdef -/ld {setdash} bdef -/m {neg moveto} bdef -/ct {6 2 roll neg 6 2 roll neg 6 2 roll neg curveto} bdef -/r {rotate} bdef -/t {neg translate} bdef -/s {scale} bdef -/sw {show} bdef -/gs {gsave} bdef -/gr {grestore} bdef -/f {findfont dup length dict begin -{1 index /FID ne {def} {pop pop} ifelse} forall /Encoding ISOLatin1Encoding def -currentdict end /NFont exch definefont pop /NFont findfont} bdef -/p {closepath} bdef -/sf {scalefont setfont} bdef -/ef {eofill}bdef -/pc {closepath stroke}bdef -/ps {stroke}bdef -/pum {matrix currentmatrix}bdef -/pom {setmatrix}bdef -/bs {/aString exch def /nXOfs exch def /nWidth exch def currentpoint nXOfs 0 rmoveto pum nWidth aString stringwidth pop div 1 scale aString show pom moveto} bdef -%%EndResource -%%EndProlog -%%BeginSetup -%%EndSetup -%%Page: 1 1 -%%BeginPageSetup -%%EndPageSetup -pum -0.02834 0.02833 s -0 -20290 t -/tm matrix currentmatrix def -gs -tm setmatrix --635 -635 t -1 1 s -635 635 m 27274 635 l 27274 20924 l 635 20924 l 635 635 l eoclip newpath -0 lw 1 lj 0.000 c 17781 10461 m 14606 10461 l 14606 6016 l 20956 6016 l -20956 10461 l 17781 10461 l pc -gs -pum -15663 7567 t -65 0 m 65 -606 l 274 -606 l 321 -606 357 -603 382 -597 ct 416 -589 446 -575 471 -554 ct -503 -527 526 -492 542 -450 ct 558 -408 566 -360 566 -306 ct 566 -260 561 -219 550 -184 ct -539 -148 525 -119 509 -95 ct 492 -72 473 -54 453 -40 ct 433 -27 409 -17 381 -10 ct -353 -3 320 0 284 0 ct p -145 -71 m 275 -71 l 315 -71 346 -75 369 -82 ct 391 -90 409 -100 423 -114 ct -442 -133 457 -158 467 -190 ct 478 -222 483 -261 483 -307 ct 483 -371 473 -419 452 -453 ct -431 -487 406 -510 376 -522 ct 355 -530 320 -534 272 -534 ct 145 -534 l p ef -965 -141 m 1042 -131 l 1030 -86 1007 -52 975 -27 ct 942 -2 900 9 849 9 ct -785 9 734 -9 696 -49 ct 658 -88 640 -144 640 -215 ct 640 -289 659 -347 697 -387 ct -735 -428 784 -449 845 -449 ct 903 -449 951 -429 989 -389 ct 1026 -349 1044 -292 1044 -220 ct -1044 -216 1044 -209 1044 -200 ct 716 -200 l 719 -152 733 -115 757 -89 ct 782 -64 813 -51 849 -51 ct -877 -51 900 -58 919 -72 ct 938 -87 l 954 -110 l p -721 -261 m 966 -261 l 963 -298 953 -326 938 -344 ct 914 -373 883 -387 845 -387 ct -811 -387 783 -376 759 -353 ct 736 -330 l 723 -300 l p ef -1427 -160 m 1500 -151 l 1492 -100 1472 -61 1439 -32 ct 1406 -4 1365 9 1317 9 ct -1257 9 1209 -9 1172 -49 ct 1136 -88 1118 -144 1118 -217 ct 1118 -265 1125 -306 1141 -342 ct -1157 -378 1181 -404 1213 -422 ct 1245 -440 1280 -449 1318 -449 ct 1365 -449 1404 -437 1435 -412 ct -1465 -388 1485 -354 1493 -310 ct 1421 -299 l 1414 -328 1402 -350 1384 -365 ct -1367 -380 1345 -387 1321 -387 ct 1283 -387 1253 -374 1229 -347 ct 1206 -320 1194 -278 1194 -220 ct -1194 -161 1205 -118 1228 -91 ct 1251 -64 1280 -51 1317 -51 ct 1346 -51 1370 -60 1390 -78 ct -1409 -96 l 1422 -123 l p ef -1564 -520 m 1564 -606 l 1638 -606 l 1638 -520 l p -1564 0 m 1564 -439 l 1638 -439 l 1638 0 l p ef -1748 0 m 1748 -439 l 1815 -439 l 1815 -377 l 1829 -399 1847 -416 1870 -429 ct -1893 -442 1919 -449 1948 -449 ct 1981 -449 2007 -442 2028 -428 ct 2049 -415 2064 -396 2072 -372 ct -2107 -423 2152 -449 2208 -449 ct 2251 -449 2285 -437 2308 -412 ct 2332 -388 2343 -351 2343 -301 ct -2343 0 l 2269 0 l 2269 -276 l 2269 -306 2267 -327 2262 -340 ct 2257 -354 2249 -364 2236 -372 ct -2223 -380 2208 -384 2191 -384 ct 2160 -384 2135 -374 2114 -353 ct 2094 -333 2084 -300 2084 -255 ct -2084 0 l 2009 0 l 2009 -285 l 2009 -318 2003 -343 1991 -359 ct 1979 -376 1959 -384 1932 -384 ct -1911 -384 1891 -379 1873 -368 ct 1856 -357 1843 -340 1835 -319 ct 1827 -298 1823 -267 1823 -227 ct -1823 0 l p ef -2750 -54 m 2722 -30 2696 -14 2670 -4 ct 2645 5 2617 9 2588 9 ct 2540 9 2503 -1 2477 -25 ct -2451 -49 2438 -79 2438 -115 ct 2438 -137 2443 -156 2453 -174 ct 2463 -192 2475 -206 2491 -217 ct -2507 -228 2525 -236 2545 -241 ct 2559 -245 2581 -249 2611 -253 ct 2671 -260 2715 -268 2744 -278 ct -2744 -288 2744 -295 2744 -298 ct 2744 -328 2737 -349 2723 -362 ct 2704 -379 2676 -387 2638 -387 ct -2603 -387 2577 -381 2561 -369 ct 2544 -356 2532 -335 2524 -303 ct 2451 -313 l -2458 -345 2468 -370 2484 -389 ct 2499 -408 2521 -423 2549 -433 ct 2578 -443 2611 -449 2649 -449 ct -2687 -449 2717 -444 2740 -435 ct 2764 -427 2781 -415 2792 -402 ct 2803 -389 2811 -372 2815 -351 ct -2818 -339 2819 -316 2819 -283 ct 2819 -184 l 2819 -114 2821 -71 2824 -52 ct -2827 -34 2833 -16 2843 0 ct 2765 0 l 2757 -15 l 2752 -33 l p -2744 -220 m 2717 -209 2676 -200 2622 -192 ct 2592 -187 2570 -182 2557 -177 ct -2545 -171 2535 -163 2528 -153 ct 2521 -142 2518 -130 2518 -117 ct 2518 -98 2525 -81 2540 -68 ct -2555 -55 2577 -48 2606 -48 ct 2635 -48 2660 -54 2683 -67 ct 2705 -79 2721 -96 2732 -118 ct -2740 -135 2744 -160 2744 -193 ct p ef -3076 -66 m 3087 0 l 3066 3 3047 5 3030 5 ct 3003 5 2982 1 2968 -7 ct 2953 -15 2942 -26 2936 -40 ct -2930 -54 2927 -83 2927 -128 ct 2927 -381 l 2872 -381 l 2872 -439 l 2927 -439 l -2927 -547 l 3001 -592 l 3001 -439 l 3076 -439 l 3076 -381 l 3001 -381 l -3001 -124 l 3001 -103 3002 -89 3005 -83 ct 3008 -77 3012 -72 3018 -69 ct 3024 -65 3032 -63 3043 -63 ct -3051 -63 l 3062 -64 l p ef -3152 -520 m 3152 -606 l 3226 -606 l 3226 -520 l p -3152 0 m 3152 -439 l 3226 -439 l 3226 0 l p ef -3336 0 m 3336 -439 l 3403 -439 l 3403 -376 l 3436 -425 3482 -449 3543 -449 ct -3570 -449 3594 -444 3616 -434 ct 3638 -425 3655 -412 3666 -397 ct 3677 -382 3685 -363 3689 -342 ct -3692 -328 3693 -304 3693 -270 ct 3693 0 l 3619 0 l 3619 -267 l 3619 -297 3616 -320 3610 -335 ct -3604 -350 3594 -362 3579 -371 ct 3565 -380 3547 -384 3527 -384 ct 3496 -384 3468 -374 3445 -354 ct -3422 -334 3411 -296 3411 -239 ct 3411 0 l p ef -3799 36 m 3871 47 l 3874 69 3883 85 3896 95 ct 3915 109 3940 116 3972 116 ct -4006 116 4033 109 4052 95 ct 4071 82 4083 62 4090 38 ct 4094 22 4095 -8 4095 -57 ct -4063 -19 4022 0 3974 0 ct 3913 0 3867 -21 3833 -65 ct 3800 -108 3784 -161 3784 -222 ct -3784 -264 3791 -302 3807 -338 ct 3822 -373 3844 -400 3873 -420 ct 3901 -439 3935 -449 3974 -449 ct -4026 -449 4069 -428 4102 -386 ct 4102 -439 l 4171 -439 l 4171 -59 l 4171 8 4164 57 4150 85 ct -4136 114 4114 136 4084 153 ct 4054 169 4017 178 3972 178 ct 3920 178 3878 166 3845 142 ct -3813 119 l 3798 83 l p -3860 -227 m 3860 -169 3872 -127 3895 -101 ct 3918 -74 3946 -61 3981 -61 ct -4015 -61 4044 -74 4067 -101 ct 4090 -127 4101 -168 4101 -224 ct 4101 -278 4090 -319 4066 -346 ct -4042 -373 4013 -387 3979 -387 ct 3946 -387 3918 -374 3895 -347 ct 3872 -320 l -3860 -280 l p ef -pom -pum -16007 8520 t -62 0 m 62 -606 l 142 -606 l 142 -71 l 440 -71 l 440 0 l p ef -478 -219 m 478 -300 500 -361 545 -400 ct 583 -432 629 -449 684 -449 ct 744 -449 793 -429 832 -389 ct -870 -350 889 -295 889 -225 ct 889 -169 881 -124 864 -92 ct 847 -60 822 -34 790 -16 ct -757 0 722 9 684 9 ct 622 9 572 -9 534 -49 ct 497 -88 l 478 -145 l p -554 -219 m 554 -163 566 -121 591 -93 ct 615 -65 646 -51 684 -51 ct 721 -51 751 -65 776 -93 ct -800 -121 813 -164 813 -222 ct 813 -276 800 -317 776 -345 ct 751 -373 720 -387 684 -387 ct -646 -387 615 -373 591 -345 ct 566 -317 l 554 -275 l p ef -1062 0 m 928 -439 l 1005 -439 l 1075 -185 l 1101 -91 l 1102 -96 1110 -126 1124 -181 ct -1194 -439 l 1270 -439 l 1336 -184 l 1358 -100 l 1383 -185 l 1458 -439 l -1531 -439 l 1393 0 l 1316 0 l 1246 -263 l 1229 -337 l 1140 0 l p ef -1811 0 m 1811 -606 l 2040 -606 l 2080 -606 2111 -604 2132 -600 ct 2162 -595 2187 -586 2207 -572 ct -2227 -558 2243 -538 2255 -513 ct 2268 -488 2274 -461 2274 -430 ct 2274 -379 2257 -335 2224 -300 ct -2192 -264 2132 -246 2047 -246 ct 1891 -246 l 1891 0 l p -1891 -318 m 2048 -318 l 2100 -318 2136 -327 2158 -346 ct 2180 -366 2191 -393 2191 -428 ct -2191 -453 2185 -475 2172 -493 ct 2159 -511 2142 -523 2121 -529 ct 2108 -532 2083 -534 2046 -534 ct -1891 -534 l p ef -2644 -54 m 2616 -30 2590 -14 2564 -4 ct 2539 5 2511 9 2482 9 ct 2434 9 2397 -1 2371 -25 ct -2345 -49 2332 -79 2332 -115 ct 2332 -137 2337 -156 2347 -174 ct 2357 -192 2369 -206 2385 -217 ct -2401 -228 2419 -236 2439 -241 ct 2453 -245 2475 -249 2505 -253 ct 2565 -260 2609 -268 2638 -278 ct -2638 -288 2638 -295 2638 -298 ct 2638 -328 2631 -349 2617 -362 ct 2598 -379 2570 -387 2532 -387 ct -2497 -387 2471 -381 2455 -369 ct 2438 -356 2426 -335 2418 -303 ct 2345 -313 l -2352 -345 2362 -370 2378 -389 ct 2393 -408 2415 -423 2443 -433 ct 2472 -443 2505 -449 2543 -449 ct -2581 -449 2611 -444 2634 -435 ct 2658 -427 2675 -415 2686 -402 ct 2697 -389 2705 -372 2709 -351 ct -2712 -339 2713 -316 2713 -283 ct 2713 -184 l 2713 -114 2715 -71 2718 -52 ct -2721 -34 2727 -16 2737 0 ct 2659 0 l 2651 -15 l 2646 -33 l p -2638 -220 m 2611 -209 2570 -200 2516 -192 ct 2486 -187 2464 -182 2451 -177 ct -2439 -171 2429 -163 2422 -153 ct 2415 -142 2412 -130 2412 -117 ct 2412 -98 2419 -81 2434 -68 ct -2449 -55 2471 -48 2500 -48 ct 2529 -48 2554 -54 2577 -67 ct 2599 -79 2615 -96 2626 -118 ct -2634 -135 2638 -160 2638 -193 ct p ef -2778 -131 m 2851 -142 l 2855 -113 2867 -90 2886 -74 ct 2905 -59 2931 -51 2965 -51 ct -2999 -51 3024 -58 3041 -72 ct 3058 -86 3066 -102 3066 -121 ct 3066 -138 3059 -151 3044 -160 ct -3034 -167 3008 -175 2968 -186 ct 2913 -199 2875 -211 2854 -221 ct 2833 -231 2817 -245 2806 -263 ct -2795 -281 2790 -301 2790 -322 ct 2790 -342 2794 -360 2803 -376 ct 2812 -393 2825 -407 2840 -418 ct -2852 -427 2867 -434 2887 -440 ct 2907 -446 2929 -449 2952 -449 ct 2986 -449 3016 -444 3042 -434 ct -3069 -424 3088 -410 3100 -393 ct 3113 -376 3121 -354 3126 -325 ct 3053 -315 l -3050 -338 3040 -356 3024 -368 ct 3008 -381 2986 -387 2957 -387 ct 2923 -387 2898 -382 2884 -370 ct -2869 -359 2862 -346 2862 -331 ct 2862 -321 2865 -312 2871 -305 ct 2877 -297 2887 -290 2900 -285 ct -2907 -282 2929 -276 2965 -266 ct 3018 -252 3055 -240 3076 -231 ct 3096 -222 3113 -209 3125 -192 ct -3136 -175 3142 -154 3142 -129 ct 3142 -104 3135 -80 3121 -58 ct 3106 -37 3085 -20 3058 -8 ct -3031 3 3000 9 2965 9 ct 2908 9 2865 -1 2835 -25 ct 2805 -49 l 2786 -84 l p ef -3175 -131 m 3248 -142 l 3252 -113 3264 -90 3283 -74 ct 3302 -59 3328 -51 3362 -51 ct -3396 -51 3421 -58 3438 -72 ct 3455 -86 3463 -102 3463 -121 ct 3463 -138 3456 -151 3441 -160 ct -3431 -167 3405 -175 3365 -186 ct 3310 -199 3272 -211 3251 -221 ct 3230 -231 3214 -245 3203 -263 ct -3192 -281 3187 -301 3187 -322 ct 3187 -342 3191 -360 3200 -376 ct 3209 -393 3222 -407 3237 -418 ct -3249 -427 3264 -434 3284 -440 ct 3304 -446 3326 -449 3349 -449 ct 3383 -449 3413 -444 3439 -434 ct -3466 -424 3485 -410 3497 -393 ct 3510 -376 3518 -354 3523 -325 ct 3450 -315 l -3447 -338 3437 -356 3421 -368 ct 3405 -381 3383 -387 3354 -387 ct 3320 -387 3295 -382 3281 -370 ct -3266 -359 3259 -346 3259 -331 ct 3259 -321 3262 -312 3268 -305 ct 3274 -297 3284 -290 3297 -285 ct -3304 -282 3326 -276 3362 -266 ct 3415 -252 3452 -240 3473 -231 ct 3493 -222 3510 -209 3522 -192 ct -3533 -175 3539 -154 3539 -129 ct 3539 -104 3532 -80 3518 -58 ct 3503 -37 3482 -20 3455 -8 ct -3428 3 3397 9 3362 9 ct 3305 9 3262 -1 3232 -25 ct 3202 -49 l 3183 -84 l p ef -pom -pum -16827 9473 t -69 0 m 69 -606 l 478 -606 l 478 -534 l 149 -534 l 149 -346 l 434 -346 l -434 -275 l 149 -275 l 149 0 l p ef -585 -520 m 585 -606 l 659 -606 l 659 -520 l p -585 0 m 585 -439 l 659 -439 l 659 0 l p ef -768 0 m 768 -606 l 842 -606 l 842 0 l p ef -1118 -66 m 1129 0 l 1108 3 1089 5 1072 5 ct 1045 5 1024 1 1010 -7 ct 995 -15 984 -26 978 -40 ct -972 -54 969 -83 969 -128 ct 969 -381 l 914 -381 l 914 -439 l 969 -439 l -969 -547 l 1043 -592 l 1043 -439 l 1118 -439 l 1118 -381 l 1043 -381 l -1043 -124 l 1043 -103 1044 -89 1047 -83 ct 1050 -77 1054 -72 1060 -69 ct 1066 -65 1074 -63 1085 -63 ct -1093 -63 l 1104 -64 l p ef -1494 -141 m 1571 -131 l 1559 -86 1536 -52 1504 -27 ct 1471 -2 1429 9 1378 9 ct -1314 9 1263 -9 1225 -49 ct 1187 -88 1169 -144 1169 -215 ct 1169 -289 1188 -347 1226 -387 ct -1264 -428 1313 -449 1374 -449 ct 1432 -449 1480 -429 1518 -389 ct 1555 -349 1573 -292 1573 -220 ct -1573 -216 1573 -209 1573 -200 ct 1245 -200 l 1248 -152 1262 -115 1286 -89 ct -1311 -64 1342 -51 1378 -51 ct 1406 -51 1429 -58 1448 -72 ct 1467 -87 l 1483 -110 l -p -1250 -261 m 1495 -261 l 1492 -298 1482 -326 1467 -344 ct 1443 -373 1412 -387 1374 -387 ct -1340 -387 1312 -376 1288 -353 ct 1265 -330 l 1252 -300 l p ef -1669 0 m 1669 -439 l 1736 -439 l 1736 -372 l 1753 -403 1768 -424 1783 -434 ct -1797 -444 1813 -449 1831 -449 ct 1856 -449 1881 -441 1907 -425 ct 1882 -356 l -1863 -366 1845 -372 1827 -372 ct 1811 -372 1796 -367 1783 -357 ct 1770 -347 1761 -334 1755 -316 ct -1747 -290 1743 -261 1743 -229 ct 1743 0 l p ef -pom -gr -11317 10321 m 11312 10318 l 11099 10206 l 11093 10203 l 10924 10032 l -10921 10026 l 10811 9811 l 10808 9805 l 10769 9556 l 10769 9549 l -10808 9299 l 10811 9293 l 10921 9078 l 10924 9072 l 11093 8901 l 11099 8898 l -11312 8786 l 11317 8784 l 11564 8744 l 11571 8744 l 11817 8784 l 11823 8786 l -12036 8898 l 12041 8901 l 12210 9072 l 12213 9078 l 12324 9293 l 12326 9299 l -12366 9549 l 12366 9556 l 12326 9805 l 12324 9811 l 12213 10026 l -12210 10032 l 12041 10203 l 12036 10206 l 11823 10318 l 11817 10321 l -11571 10361 l 11564 10361 l 11317 10321 l p -11567 10319 m 11806 10279 l 12013 10171 l 12178 10004 l 12285 9794 l -12324 9552 l 12285 9310 l 12178 9100 l 12013 8933 l 11806 8825 l 11567 8786 l -11328 8825 l 11121 8933 l 10956 9100 l 10849 9310 l 10811 9552 l 10849 9794 l -10956 10004 l 11121 10171 l 11328 10279 l 11567 10319 l p -11049 9029 m 11079 8998 l 11286 9208 l 11493 9417 l 11700 9627 l 11907 9837 l -12115 10048 l 12085 10078 l 11877 9868 l 11670 9658 l 11463 9448 l -11255 9238 l 11049 9029 l p -11079 10078 m 11049 10049 l 11255 9838 l 11463 9628 l 11670 9418 l -11878 9208 l 12086 8998 l 12115 9029 l 11907 9239 l 11700 9449 l 11493 9659 l -11286 9869 l 11079 10078 l p ef -1 lw 0 lj 11317 10321 m 11312 10318 l 11099 10206 l 11093 10203 l 10924 10032 l -10921 10026 l 10811 9811 l 10808 9805 l 10769 9556 l 10769 9549 l -10808 9299 l 10811 9293 l 10921 9078 l 10924 9072 l 11093 8901 l 11099 8898 l -11312 8786 l 11317 8784 l 11564 8744 l 11571 8744 l 11817 8784 l 11823 8786 l -12036 8898 l 12041 8901 l 12210 9072 l 12213 9078 l 12324 9293 l 12326 9299 l -12366 9549 l 12366 9556 l 12326 9805 l 12324 9811 l 12213 10026 l -12210 10032 l 12041 10203 l 12036 10206 l 11823 10318 l 11817 10321 l -11571 10361 l 11564 10361 l 11317 10321 l pc -11567 10319 m 11806 10279 l 12013 10171 l 12178 10004 l 12285 9794 l -12324 9552 l 12285 9310 l 12178 9100 l 12013 8933 l 11806 8825 l 11567 8786 l -11328 8825 l 11121 8933 l 10956 9100 l 10849 9310 l 10811 9552 l 10849 9794 l -10956 10004 l 11121 10171 l 11328 10279 l 11567 10319 l pc -11049 9029 m 11079 8998 l 11286 9208 l 11493 9417 l 11700 9627 l 11907 9837 l -12115 10048 l 12085 10078 l 11877 9868 l 11670 9658 l 11463 9448 l -11255 9238 l 11049 9029 l pc -11079 10078 m 11049 10049 l 11255 9838 l 11463 9628 l 11670 9418 l -11878 9208 l 12086 8998 l 12115 9029 l 11907 9239 l 11700 9449 l 11493 9659 l -11286 9869 l 11079 10078 l pc -7989 6986 m 7538 6836 l 7539 7136 l 7989 6986 l p ef -5716 6986 m 7629 6986 l ps -14606 6986 m 14155 6836 l 14156 7136 l 14606 6986 l p ef -9526 6986 m 14246 6986 l ps -10769 9526 m 10318 9376 l 10319 9676 l 10769 9526 l p ef -5716 9526 m 10409 9526 l ps -14606 9526 m 14155 9376 l 14156 9676 l 14606 9526 l p ef -12426 9526 m 14246 9526 l ps -0 lw 1 lj 10061 16546 m 6251 16546 l 6251 12736 l 13871 12736 l 13871 16546 l -10061 16546 l pc -gs -pum -9102 13970 t -64 0 m 64 -606 l 146 -606 l 465 -130 l 465 -606 l 542 -606 l 542 0 l -459 0 l 141 -476 l 141 0 l p ef -1106 -212 m 1187 -192 l 1170 -126 1140 -76 1096 -41 ct 1052 -6 999 10 936 10 ct -870 10 817 -2 776 -29 ct 735 -56 704 -94 683 -145 ct 661 -195 651 -249 651 -307 ct -651 -370 663 -425 687 -472 ct 711 -519 745 -555 790 -580 ct 834 -604 883 -616 937 -616 ct -998 -616 1049 -601 1090 -570 ct 1131 -539 1160 -496 1176 -440 ct 1097 -421 l -1083 -465 1063 -497 1036 -517 ct 1009 -537 976 -547 935 -547 ct 889 -547 850 -536 818 -514 ct -787 -492 765 -462 752 -424 ct 740 -386 733 -348 733 -308 ct 733 -256 741 -211 756 -173 ct -771 -134 794 -105 826 -86 ct 858 -67 892 -58 929 -58 ct 974 -58 1012 -71 1043 -97 ct -1074 -123 l 1095 -161 l p ef -1284 -295 m 1284 -395 1311 -474 1366 -531 ct 1420 -588 1489 -617 1575 -617 ct -1631 -617 1681 -603 1726 -576 ct 1771 -550 1805 -512 1829 -465 ct 1852 -417 1864 -362 1864 -302 ct -1864 -240 1852 -185 1827 -137 ct 1802 -88 1767 -52 1722 -27 ct 1676 -2 1627 10 1574 10 ct -1517 10 1466 -3 1421 -31 ct 1376 -58 1342 -96 1319 -143 ct 1296 -191 l 1284 -242 l -p -1367 -294 m 1367 -220 1387 -163 1426 -121 ct 1465 -79 1515 -58 1574 -58 ct -1634 -58 1684 -79 1723 -122 ct 1762 -164 1782 -224 1782 -302 ct 1782 -352 1773 -395 1757 -431 ct -1740 -468 1715 -497 1683 -517 ct 1651 -537 1615 -547 1575 -547 ct 1518 -547 1470 -528 1429 -489 ct -1388 -450 l 1367 -385 l p ef -pom -pum -7514 14923 t -38 -194 m 113 -201 l 117 -171 125 -146 138 -126 ct 151 -107 172 -91 199 -79 ct -227 -67 258 -61 292 -61 ct 323 -61 350 -66 373 -75 ct 397 -84 414 -96 426 -112 ct -437 -128 443 -145 443 -164 ct 443 -183 437 -200 426 -214 ct 415 -228 397 -240 372 -250 ct -355 -256 319 -266 264 -279 ct 208 -293 169 -305 147 -317 ct 118 -332 96 -351 82 -374 ct -68 -396 61 -421 61 -449 ct 61 -480 69 -508 87 -535 ct 104 -561 130 -582 163 -595 ct -196 -609 233 -616 274 -616 ct 319 -616 359 -609 393 -594 ct 427 -580 454 -559 472 -531 ct -491 -502 501 -471 502 -435 ct 425 -429 l 421 -468 407 -496 383 -516 ct 359 -536 324 -545 277 -545 ct -229 -545 194 -537 171 -519 ct 149 -501 138 -480 138 -454 ct 138 -433 146 -415 162 -401 ct -177 -387 217 -372 283 -357 ct 348 -343 393 -330 417 -319 ct 452 -303 478 -282 495 -257 ct -512 -232 520 -203 520 -171 ct 520 -138 511 -108 492 -80 ct 474 -51 447 -29 413 -13 ct -378 2 339 10 296 10 ct 241 10 195 2 158 -13 ct 121 -29 92 -53 71 -85 ct 50 -117 l -39 -154 l p ef -638 -520 m 638 -606 l 712 -606 l 712 -520 l p -638 0 m 638 -439 l 712 -439 l 712 0 l p ef -822 0 m 822 -439 l 889 -439 l 889 -376 l 922 -425 968 -449 1029 -449 ct -1056 -449 1080 -444 1102 -434 ct 1124 -425 1141 -412 1152 -397 ct 1163 -382 1171 -363 1175 -342 ct -1178 -328 1179 -304 1179 -270 ct 1179 0 l 1105 0 l 1105 -267 l 1105 -297 1102 -320 1096 -335 ct -1090 -350 1080 -362 1065 -371 ct 1051 -380 1033 -384 1013 -384 ct 982 -384 954 -374 931 -354 ct -908 -334 897 -296 897 -239 ct 897 0 l p ef -1600 -141 m 1677 -131 l 1665 -86 1642 -52 1610 -27 ct 1577 -2 1535 9 1484 9 ct -1420 9 1369 -9 1331 -49 ct 1293 -88 1275 -144 1275 -215 ct 1275 -289 1294 -347 1332 -387 ct -1370 -428 1419 -449 1480 -449 ct 1538 -449 1586 -429 1624 -389 ct 1661 -349 1679 -292 1679 -220 ct -1679 -216 1679 -209 1679 -200 ct 1351 -200 l 1354 -152 1368 -115 1392 -89 ct -1417 -64 1448 -51 1484 -51 ct 1512 -51 1535 -58 1554 -72 ct 1573 -87 l 1589 -110 l -p -1356 -261 m 1601 -261 l 1598 -298 1588 -326 1573 -344 ct 1549 -373 1518 -387 1480 -387 ct -1446 -387 1418 -376 1394 -353 ct 1371 -330 l 1358 -300 l p ef -1958 10 m 2133 -616 l 2193 -616 l 2017 10 l p ef -2931 -212 m 3012 -192 l 2995 -126 2965 -76 2921 -41 ct 2877 -6 2824 10 2761 10 ct -2695 10 2642 -2 2601 -29 ct 2560 -56 2529 -94 2508 -145 ct 2486 -195 2476 -249 2476 -307 ct -2476 -370 2488 -425 2512 -472 ct 2536 -519 2570 -555 2615 -580 ct 2659 -604 2708 -616 2762 -616 ct -2823 -616 2874 -601 2915 -570 ct 2956 -539 2985 -496 3001 -440 ct 2922 -421 l -2908 -465 2888 -497 2861 -517 ct 2834 -537 2801 -547 2760 -547 ct 2714 -547 2675 -536 2643 -514 ct -2612 -492 2590 -462 2577 -424 ct 2565 -386 2558 -348 2558 -308 ct 2558 -256 2566 -211 2581 -173 ct -2596 -134 2619 -105 2651 -86 ct 2683 -67 2717 -58 2754 -58 ct 2799 -58 2837 -71 2868 -97 ct -2899 -123 l 2920 -161 l p ef -3097 -219 m 3097 -300 3119 -361 3164 -400 ct 3202 -432 3248 -449 3303 -449 ct -3363 -449 3412 -429 3451 -389 ct 3489 -350 3508 -295 3508 -225 ct 3508 -169 3500 -124 3483 -92 ct -3466 -60 3441 -34 3409 -16 ct 3376 0 3341 9 3303 9 ct 3241 9 3191 -9 3153 -49 ct -3116 -88 l 3097 -145 l p -3173 -219 m 3173 -163 3185 -121 3210 -93 ct 3234 -65 3265 -51 3303 -51 ct 3340 -51 3370 -65 3395 -93 ct -3419 -121 3432 -164 3432 -222 ct 3432 -276 3419 -317 3395 -345 ct 3370 -373 3339 -387 3303 -387 ct -3265 -387 3234 -373 3210 -345 ct 3185 -317 l 3173 -275 l p ef -3571 -131 m 3644 -142 l 3648 -113 3660 -90 3679 -74 ct 3698 -59 3724 -51 3758 -51 ct -3792 -51 3817 -58 3834 -72 ct 3851 -86 3859 -102 3859 -121 ct 3859 -138 3852 -151 3837 -160 ct -3827 -167 3801 -175 3761 -186 ct 3706 -199 3668 -211 3647 -221 ct 3626 -231 3610 -245 3599 -263 ct -3588 -281 3583 -301 3583 -322 ct 3583 -342 3587 -360 3596 -376 ct 3605 -393 3618 -407 3633 -418 ct -3645 -427 3660 -434 3680 -440 ct 3700 -446 3722 -449 3745 -449 ct 3779 -449 3809 -444 3835 -434 ct -3862 -424 3881 -410 3893 -393 ct 3906 -376 3914 -354 3919 -325 ct 3846 -315 l -3843 -338 3833 -356 3817 -368 ct 3801 -381 3779 -387 3750 -387 ct 3716 -387 3691 -382 3677 -370 ct -3662 -359 3655 -346 3655 -331 ct 3655 -321 3658 -312 3664 -305 ct 3670 -297 3680 -290 3693 -285 ct -3700 -282 3722 -276 3758 -266 ct 3811 -252 3848 -240 3869 -231 ct 3889 -222 3906 -209 3918 -192 ct -3929 -175 3935 -154 3935 -129 ct 3935 -104 3928 -80 3914 -58 ct 3899 -37 3878 -20 3851 -8 ct -3824 3 3793 9 3758 9 ct 3701 9 3658 -1 3628 -25 ct 3598 -49 l 3579 -84 l p ef -3998 -520 m 3998 -606 l 4072 -606 l 4072 -520 l p -3998 0 m 3998 -439 l 4072 -439 l 4072 0 l p ef -4183 0 m 4183 -439 l 4250 -439 l 4250 -376 l 4283 -425 4329 -449 4390 -449 ct -4417 -449 4441 -444 4463 -434 ct 4485 -425 4502 -412 4513 -397 ct 4524 -382 4532 -363 4536 -342 ct -4539 -328 4540 -304 4540 -270 ct 4540 0 l 4466 0 l 4466 -267 l 4466 -297 4463 -320 4457 -335 ct -4451 -350 4441 -362 4426 -371 ct 4412 -380 4394 -384 4374 -384 ct 4343 -384 4315 -374 4292 -354 ct -4269 -334 4258 -296 4258 -239 ct 4258 0 l p ef -4960 -141 m 5037 -131 l 5025 -86 5002 -52 4970 -27 ct 4937 -2 4895 9 4844 9 ct -4780 9 4729 -9 4691 -49 ct 4653 -88 4635 -144 4635 -215 ct 4635 -289 4654 -347 4692 -387 ct -4730 -428 4779 -449 4840 -449 ct 4898 -449 4946 -429 4984 -389 ct 5021 -349 5039 -292 5039 -220 ct -5039 -216 5039 -209 5039 -200 ct 4711 -200 l 4714 -152 4728 -115 4752 -89 ct -4777 -64 4808 -51 4844 -51 ct 4872 -51 4895 -58 4914 -72 ct 4933 -87 l 4949 -110 l -p -4716 -261 m 4961 -261 l 4958 -298 4948 -326 4933 -344 ct 4909 -373 4878 -387 4840 -387 ct -4806 -387 4778 -376 4754 -353 ct 4731 -330 l 4718 -300 l p ef -pom -pum -8136 15876 t -349 -237 m 349 -308 l 605 -309 l 605 -84 l 566 -52 525 -29 483 -13 ct -441 2 398 10 354 10 ct 295 10 241 -2 192 -27 ct 143 -53 107 -90 82 -138 ct 57 -186 45 -240 45 -300 ct -45 -359 57 -414 82 -465 ct 106 -516 142 -554 188 -579 ct 234 -604 288 -616 348 -616 ct -392 -616 432 -609 467 -595 ct 502 -581 530 -561 550 -535 ct 571 -510 586 -477 596 -436 ct -524 -416 l 515 -447 504 -472 490 -489 ct 476 -507 457 -521 432 -532 ct 407 -542 379 -547 349 -547 ct -312 -547 280 -542 253 -531 ct 227 -520 205 -505 189 -487 ct 172 -468 160 -449 150 -427 ct -135 -389 127 -349 127 -305 ct 127 -251 137 -205 155 -169 ct 174 -133 201 -106 236 -88 ct -272 -70 310 -62 350 -62 ct 385 -62 418 -68 452 -82 ct 485 -95 510 -109 527 -124 ct -527 -237 l p ef -1017 -141 m 1094 -131 l 1082 -86 1059 -52 1027 -27 ct 994 -2 952 9 901 9 ct -837 9 786 -9 748 -49 ct 710 -88 692 -144 692 -215 ct 692 -289 711 -347 749 -387 ct -787 -428 836 -449 897 -449 ct 955 -449 1003 -429 1041 -389 ct 1078 -349 1096 -292 1096 -220 ct -1096 -216 1096 -209 1096 -200 ct 768 -200 l 771 -152 785 -115 809 -89 ct 834 -64 865 -51 901 -51 ct -929 -51 952 -58 971 -72 ct 990 -87 l 1006 -110 l p -773 -261 m 1018 -261 l 1015 -298 1005 -326 990 -344 ct 966 -373 935 -387 897 -387 ct -863 -387 835 -376 811 -353 ct 788 -330 l 775 -300 l p ef -1193 0 m 1193 -439 l 1260 -439 l 1260 -376 l 1293 -425 1339 -449 1400 -449 ct -1427 -449 1451 -444 1473 -434 ct 1495 -425 1512 -412 1523 -397 ct 1534 -382 1542 -363 1546 -342 ct -1549 -328 1550 -304 1550 -270 ct 1550 0 l 1476 0 l 1476 -267 l 1476 -297 1473 -320 1467 -335 ct -1461 -350 1451 -362 1436 -371 ct 1422 -380 1404 -384 1384 -384 ct 1353 -384 1325 -374 1302 -354 ct -1279 -334 1268 -296 1268 -239 ct 1268 0 l p ef -1970 -141 m 2047 -131 l 2035 -86 2012 -52 1980 -27 ct 1947 -2 1905 9 1854 9 ct -1790 9 1739 -9 1701 -49 ct 1663 -88 1645 -144 1645 -215 ct 1645 -289 1664 -347 1702 -387 ct -1740 -428 1789 -449 1850 -449 ct 1908 -449 1956 -429 1994 -389 ct 2031 -349 2049 -292 2049 -220 ct -2049 -216 2049 -209 2049 -200 ct 1721 -200 l 1724 -152 1738 -115 1762 -89 ct -1787 -64 1818 -51 1854 -51 ct 1882 -51 1905 -58 1924 -72 ct 1943 -87 l 1959 -110 l -p -1726 -261 m 1971 -261 l 1968 -298 1958 -326 1943 -344 ct 1919 -373 1888 -387 1850 -387 ct -1816 -387 1788 -376 1764 -353 ct 1741 -330 l 1728 -300 l p ef -2145 0 m 2145 -439 l 2212 -439 l 2212 -372 l 2229 -403 2244 -424 2259 -434 ct -2273 -444 2289 -449 2307 -449 ct 2332 -449 2357 -441 2383 -425 ct 2358 -356 l -2339 -366 2321 -372 2303 -372 ct 2287 -372 2272 -367 2259 -357 ct 2246 -347 2237 -334 2231 -316 ct -2223 -290 2219 -261 2219 -229 ct 2219 0 l p ef -2723 -54 m 2695 -30 2669 -14 2643 -4 ct 2618 5 2590 9 2561 9 ct 2513 9 2476 -1 2450 -25 ct -2424 -49 2411 -79 2411 -115 ct 2411 -137 2416 -156 2426 -174 ct 2436 -192 2448 -206 2464 -217 ct -2480 -228 2498 -236 2518 -241 ct 2532 -245 2554 -249 2584 -253 ct 2644 -260 2688 -268 2717 -278 ct -2717 -288 2717 -295 2717 -298 ct 2717 -328 2710 -349 2696 -362 ct 2677 -379 2649 -387 2611 -387 ct -2576 -387 2550 -381 2534 -369 ct 2517 -356 2505 -335 2497 -303 ct 2424 -313 l -2431 -345 2441 -370 2457 -389 ct 2472 -408 2494 -423 2522 -433 ct 2551 -443 2584 -449 2622 -449 ct -2660 -449 2690 -444 2713 -435 ct 2737 -427 2754 -415 2765 -402 ct 2776 -389 2784 -372 2788 -351 ct -2791 -339 2792 -316 2792 -283 ct 2792 -184 l 2792 -114 2794 -71 2797 -52 ct -2800 -34 2806 -16 2816 0 ct 2738 0 l 2730 -15 l 2725 -33 l p -2717 -220 m 2690 -209 2649 -200 2595 -192 ct 2565 -187 2543 -182 2530 -177 ct -2518 -171 2508 -163 2501 -153 ct 2494 -142 2491 -130 2491 -117 ct 2491 -98 2498 -81 2513 -68 ct -2528 -55 2550 -48 2579 -48 ct 2608 -48 2633 -54 2656 -67 ct 2678 -79 2694 -96 2705 -118 ct -2713 -135 2717 -160 2717 -193 ct p ef -3049 -66 m 3060 0 l 3039 3 3020 5 3003 5 ct 2976 5 2955 1 2941 -7 ct 2926 -15 2915 -26 2909 -40 ct -2903 -54 2900 -83 2900 -128 ct 2900 -381 l 2845 -381 l 2845 -439 l 2900 -439 l -2900 -547 l 2974 -592 l 2974 -439 l 3049 -439 l 3049 -381 l 2974 -381 l -2974 -124 l 2974 -103 2975 -89 2978 -83 ct 2981 -77 2985 -72 2991 -69 ct 2997 -65 3005 -63 3016 -63 ct -3024 -63 l 3035 -64 l p ef -3097 -219 m 3097 -300 3119 -361 3164 -400 ct 3202 -432 3248 -449 3303 -449 ct -3363 -449 3412 -429 3451 -389 ct 3489 -350 3508 -295 3508 -225 ct 3508 -169 3500 -124 3483 -92 ct -3466 -60 3441 -34 3409 -16 ct 3376 0 3341 9 3303 9 ct 3241 9 3191 -9 3153 -49 ct -3116 -88 l 3097 -145 l p -3173 -219 m 3173 -163 3185 -121 3210 -93 ct 3234 -65 3265 -51 3303 -51 ct 3340 -51 3370 -65 3395 -93 ct -3419 -121 3432 -164 3432 -222 ct 3432 -276 3419 -317 3395 -345 ct 3370 -373 3339 -387 3303 -387 ct -3265 -387 3234 -373 3210 -345 ct 3185 -317 l 3173 -275 l p ef -3600 0 m 3600 -439 l 3667 -439 l 3667 -372 l 3684 -403 3699 -424 3714 -434 ct -3728 -444 3744 -449 3762 -449 ct 3787 -449 3812 -441 3838 -425 ct 3813 -356 l -3794 -366 3776 -372 3758 -372 ct 3742 -372 3727 -367 3714 -357 ct 3701 -347 3692 -334 3686 -316 ct -3678 -290 3674 -261 3674 -229 ct 3674 0 l p ef -pom -gr -gs -pum -1284 9366 t -79 0 m 79 -606 l 159 -606 l 159 0 l p ef -293 0 m 293 -439 l 360 -439 l 360 -376 l 393 -425 439 -449 500 -449 ct -527 -449 551 -444 573 -434 ct 595 -425 612 -412 623 -397 ct 634 -382 642 -363 646 -342 ct -649 -328 650 -304 650 -270 ct 650 0 l 576 0 l 576 -267 l 576 -297 573 -320 567 -335 ct -561 -350 551 -362 536 -371 ct 522 -380 504 -384 484 -384 ct 453 -384 425 -374 402 -354 ct -379 -334 368 -296 368 -239 ct 368 0 l p ef -769 168 m 769 -439 l 837 -439 l 837 -382 l 853 -404 871 -421 891 -432 ct -911 -443 936 -449 965 -449 ct 1002 -449 1035 -439 1064 -420 ct 1092 -400 1114 -373 1129 -338 ct -1143 -303 1151 -264 1151 -222 ct 1151 -177 1143 -137 1126 -101 ct 1110 -65 1087 -37 1056 -18 ct -1025 0 993 9 959 9 ct 934 9 912 4 892 -5 ct 873 -16 856 -29 844 -45 ct 844 168 l -p -837 -217 m 837 -160 848 -118 871 -91 ct 894 -64 922 -51 954 -51 ct 987 -51 1016 -65 1039 -93 ct -1063 -121 1075 -164 1075 -223 ct 1075 -279 1063 -321 1040 -349 ct 1017 -376 990 -390 958 -390 ct -926 -390 898 -376 873 -346 ct 849 -316 l 837 -273 l p ef -1507 0 m 1507 -64 l 1473 -14 1427 9 1368 9 ct 1342 9 1318 4 1295 -4 ct 1273 -14 1256 -27 1245 -42 ct -1234 -57 1227 -75 1222 -97 ct 1219 -112 1218 -135 1218 -167 ct 1218 -439 l 1292 -439 l -1292 -195 l 1292 -156 1294 -130 1297 -117 ct 1301 -97 1311 -82 1326 -70 ct -1342 -59 1360 -54 1383 -54 ct 1405 -54 1426 -59 1446 -71 ct 1465 -82 1479 -98 1487 -118 ct -1495 -137 1499 -166 1499 -203 ct 1499 -439 l 1574 -439 l 1574 0 l p ef -1858 -66 m 1869 0 l 1848 3 1829 5 1812 5 ct 1785 5 1764 1 1750 -7 ct 1735 -15 1724 -26 1718 -40 ct -1712 -54 1709 -83 1709 -128 ct 1709 -381 l 1654 -381 l 1654 -439 l 1709 -439 l -1709 -547 l 1783 -592 l 1783 -439 l 1858 -439 l 1858 -381 l 1783 -381 l -1783 -124 l 1783 -103 1784 -89 1787 -83 ct 1790 -77 1794 -72 1800 -69 ct 1806 -65 1814 -63 1825 -63 ct -1833 -63 l 1844 -64 l p ef -2190 0 m 2190 -381 l 2124 -381 l 2124 -439 l 2190 -439 l 2190 -485 l -2190 -515 2193 -537 2198 -551 ct 2205 -571 2218 -586 2236 -598 ct 2254 -610 2279 -616 2312 -616 ct -2333 -616 2356 -614 2381 -609 ct 2370 -544 l 2355 -547 2340 -548 2326 -548 ct -2304 -548 2288 -543 2278 -533 ct 2269 -524 2264 -506 2264 -479 ct 2264 -439 l -2350 -439 l 2350 -381 l 2264 -381 l 2264 0 l p ef -2410 0 m 2410 -439 l 2477 -439 l 2477 -372 l 2494 -403 2509 -424 2524 -434 ct -2538 -444 2554 -449 2572 -449 ct 2597 -449 2622 -441 2648 -425 ct 2623 -356 l -2604 -366 2586 -372 2568 -372 ct 2552 -372 2537 -367 2524 -357 ct 2511 -347 2502 -334 2496 -316 ct -2488 -290 2484 -261 2484 -229 ct 2484 0 l p ef -2674 -219 m 2674 -300 2696 -361 2741 -400 ct 2779 -432 2825 -449 2880 -449 ct -2940 -449 2989 -429 3028 -389 ct 3066 -350 3085 -295 3085 -225 ct 3085 -169 3077 -124 3060 -92 ct -3043 -60 3018 -34 2986 -16 ct 2953 0 2918 9 2880 9 ct 2818 9 2768 -9 2730 -49 ct -2693 -88 l 2674 -145 l p -2750 -219 m 2750 -163 2762 -121 2787 -93 ct 2811 -65 2842 -51 2880 -51 ct 2917 -51 2947 -65 2972 -93 ct -2996 -121 3009 -164 3009 -222 ct 3009 -276 2996 -317 2972 -345 ct 2947 -373 2916 -387 2880 -387 ct -2842 -387 2811 -373 2787 -345 ct 2762 -317 l 2750 -275 l p ef -3177 0 m 3177 -439 l 3244 -439 l 3244 -377 l 3258 -399 3276 -416 3299 -429 ct -3322 -442 3348 -449 3377 -449 ct 3410 -449 3436 -442 3457 -428 ct 3478 -415 3493 -396 3501 -372 ct -3536 -423 3581 -449 3637 -449 ct 3680 -449 3714 -437 3737 -412 ct 3761 -388 3772 -351 3772 -301 ct -3772 0 l 3698 0 l 3698 -276 l 3698 -306 3696 -327 3691 -340 ct 3686 -354 3678 -364 3665 -372 ct -3652 -380 3637 -384 3620 -384 ct 3589 -384 3564 -374 3543 -353 ct 3523 -333 3513 -300 3513 -255 ct -3513 0 l 3438 0 l 3438 -285 l 3438 -318 3432 -343 3420 -359 ct 3408 -376 3388 -384 3361 -384 ct -3340 -384 3320 -379 3302 -368 ct 3285 -357 3272 -340 3264 -319 ct 3256 -298 3252 -267 3252 -227 ct -3252 0 l p ef -pom -pum -2302 10319 t --1 0 m 231 -606 l 318 -606 l 566 0 l 474 0 l 404 -183 l 150 -183 l -83 0 l p -173 -248 m 379 -248 l 315 -416 l 296 -467 282 -509 272 -542 ct 265 -503 254 -465 240 -426 ct -p ef -621 0 m 621 -606 l 830 -606 l 877 -606 913 -603 938 -597 ct 972 -589 1002 -575 1027 -554 ct -1059 -527 1082 -492 1098 -450 ct 1114 -408 1122 -360 1122 -306 ct 1122 -260 1117 -219 1106 -184 ct -1095 -148 1081 -119 1065 -95 ct 1048 -72 1029 -54 1009 -40 ct 989 -27 965 -17 937 -10 ct -909 -3 876 0 840 0 ct p -701 -71 m 831 -71 l 871 -71 902 -75 925 -82 ct 947 -90 965 -100 979 -114 ct -998 -133 1013 -158 1023 -190 ct 1034 -222 1039 -261 1039 -307 ct 1039 -371 1029 -419 1008 -453 ct -987 -487 962 -510 932 -522 ct 911 -530 876 -534 828 -534 ct 701 -534 l p ef -1661 -212 m 1742 -192 l 1725 -126 1695 -76 1651 -41 ct 1607 -6 1554 10 1491 10 ct -1425 10 1372 -2 1331 -29 ct 1290 -56 1259 -94 1238 -145 ct 1216 -195 1206 -249 1206 -307 ct -1206 -370 1218 -425 1242 -472 ct 1266 -519 1300 -555 1345 -580 ct 1389 -604 1438 -616 1492 -616 ct -1553 -616 1604 -601 1645 -570 ct 1686 -539 1715 -496 1731 -440 ct 1652 -421 l -1638 -465 1618 -497 1591 -517 ct 1564 -537 1531 -547 1490 -547 ct 1444 -547 1405 -536 1373 -514 ct -1342 -492 1320 -462 1307 -424 ct 1295 -386 1288 -348 1288 -308 ct 1288 -256 1296 -211 1311 -173 ct -1326 -134 1349 -105 1381 -86 ct 1413 -67 1447 -58 1484 -58 ct 1529 -58 1567 -71 1598 -97 ct -1629 -123 l 1650 -161 l p ef -pom -gr -gs -pum -1284 6773 t -79 0 m 79 -606 l 159 -606 l 159 0 l p ef -293 0 m 293 -439 l 360 -439 l 360 -376 l 393 -425 439 -449 500 -449 ct -527 -449 551 -444 573 -434 ct 595 -425 612 -412 623 -397 ct 634 -382 642 -363 646 -342 ct -649 -328 650 -304 650 -270 ct 650 0 l 576 0 l 576 -267 l 576 -297 573 -320 567 -335 ct -561 -350 551 -362 536 -371 ct 522 -380 504 -384 484 -384 ct 453 -384 425 -374 402 -354 ct -379 -334 368 -296 368 -239 ct 368 0 l p ef -769 168 m 769 -439 l 837 -439 l 837 -382 l 853 -404 871 -421 891 -432 ct -911 -443 936 -449 965 -449 ct 1002 -449 1035 -439 1064 -420 ct 1092 -400 1114 -373 1129 -338 ct -1143 -303 1151 -264 1151 -222 ct 1151 -177 1143 -137 1126 -101 ct 1110 -65 1087 -37 1056 -18 ct -1025 0 993 9 959 9 ct 934 9 912 4 892 -5 ct 873 -16 856 -29 844 -45 ct 844 168 l -p -837 -217 m 837 -160 848 -118 871 -91 ct 894 -64 922 -51 954 -51 ct 987 -51 1016 -65 1039 -93 ct -1063 -121 1075 -164 1075 -223 ct 1075 -279 1063 -321 1040 -349 ct 1017 -376 990 -390 958 -390 ct -926 -390 898 -376 873 -346 ct 849 -316 l 837 -273 l p ef -1507 0 m 1507 -64 l 1473 -14 1427 9 1368 9 ct 1342 9 1318 4 1295 -4 ct 1273 -14 1256 -27 1245 -42 ct -1234 -57 1227 -75 1222 -97 ct 1219 -112 1218 -135 1218 -167 ct 1218 -439 l 1292 -439 l -1292 -195 l 1292 -156 1294 -130 1297 -117 ct 1301 -97 1311 -82 1326 -70 ct -1342 -59 1360 -54 1383 -54 ct 1405 -54 1426 -59 1446 -71 ct 1465 -82 1479 -98 1487 -118 ct -1495 -137 1499 -166 1499 -203 ct 1499 -439 l 1574 -439 l 1574 0 l p ef -1858 -66 m 1869 0 l 1848 3 1829 5 1812 5 ct 1785 5 1764 1 1750 -7 ct 1735 -15 1724 -26 1718 -40 ct -1712 -54 1709 -83 1709 -128 ct 1709 -381 l 1654 -381 l 1654 -439 l 1709 -439 l -1709 -547 l 1783 -592 l 1783 -439 l 1858 -439 l 1858 -381 l 1783 -381 l -1783 -124 l 1783 -103 1784 -89 1787 -83 ct 1790 -77 1794 -72 1800 -69 ct 1806 -65 1814 -63 1825 -63 ct -1833 -63 l 1844 -64 l p ef -2190 0 m 2190 -381 l 2124 -381 l 2124 -439 l 2190 -439 l 2190 -485 l -2190 -515 2193 -537 2198 -551 ct 2205 -571 2218 -586 2236 -598 ct 2254 -610 2279 -616 2312 -616 ct -2333 -616 2356 -614 2381 -609 ct 2370 -544 l 2355 -547 2340 -548 2326 -548 ct -2304 -548 2288 -543 2278 -533 ct 2269 -524 2264 -506 2264 -479 ct 2264 -439 l -2350 -439 l 2350 -381 l 2264 -381 l 2264 0 l p ef -2410 0 m 2410 -439 l 2477 -439 l 2477 -372 l 2494 -403 2509 -424 2524 -434 ct -2538 -444 2554 -449 2572 -449 ct 2597 -449 2622 -441 2648 -425 ct 2623 -356 l -2604 -366 2586 -372 2568 -372 ct 2552 -372 2537 -367 2524 -357 ct 2511 -347 2502 -334 2496 -316 ct -2488 -290 2484 -261 2484 -229 ct 2484 0 l p ef -2674 -219 m 2674 -300 2696 -361 2741 -400 ct 2779 -432 2825 -449 2880 -449 ct -2940 -449 2989 -429 3028 -389 ct 3066 -350 3085 -295 3085 -225 ct 3085 -169 3077 -124 3060 -92 ct -3043 -60 3018 -34 2986 -16 ct 2953 0 2918 9 2880 9 ct 2818 9 2768 -9 2730 -49 ct -2693 -88 l 2674 -145 l p -2750 -219 m 2750 -163 2762 -121 2787 -93 ct 2811 -65 2842 -51 2880 -51 ct 2917 -51 2947 -65 2972 -93 ct -2996 -121 3009 -164 3009 -222 ct 3009 -276 2996 -317 2972 -345 ct 2947 -373 2916 -387 2880 -387 ct -2842 -387 2811 -373 2787 -345 ct 2762 -317 l 2750 -275 l p ef -3177 0 m 3177 -439 l 3244 -439 l 3244 -377 l 3258 -399 3276 -416 3299 -429 ct -3322 -442 3348 -449 3377 -449 ct 3410 -449 3436 -442 3457 -428 ct 3478 -415 3493 -396 3501 -372 ct -3536 -423 3581 -449 3637 -449 ct 3680 -449 3714 -437 3737 -412 ct 3761 -388 3772 -351 3772 -301 ct -3772 0 l 3698 0 l 3698 -276 l 3698 -306 3696 -327 3691 -340 ct 3686 -354 3678 -364 3665 -372 ct -3652 -380 3637 -384 3620 -384 ct 3589 -384 3564 -374 3543 -353 ct 3523 -333 3513 -300 3513 -255 ct -3513 0 l 3438 0 l 3438 -285 l 3438 -318 3432 -343 3420 -359 ct 3408 -376 3388 -384 3361 -384 ct -3340 -384 3320 -379 3302 -368 ct 3285 -357 3272 -340 3264 -319 ct 3256 -298 3252 -267 3252 -227 ct -3252 0 l p ef -pom -pum -2302 7726 t --1 0 m 231 -606 l 318 -606 l 566 0 l 474 0 l 404 -183 l 150 -183 l -83 0 l p -173 -248 m 379 -248 l 315 -416 l 296 -467 282 -509 272 -542 ct 265 -503 254 -465 240 -426 ct -p ef -621 0 m 621 -606 l 830 -606 l 877 -606 913 -603 938 -597 ct 972 -589 1002 -575 1027 -554 ct -1059 -527 1082 -492 1098 -450 ct 1114 -408 1122 -360 1122 -306 ct 1122 -260 1117 -219 1106 -184 ct -1095 -148 1081 -119 1065 -95 ct 1048 -72 1029 -54 1009 -40 ct 989 -27 965 -17 937 -10 ct -909 -3 876 0 840 0 ct p -701 -71 m 831 -71 l 871 -71 902 -75 925 -82 ct 947 -90 965 -100 979 -114 ct -998 -133 1013 -158 1023 -190 ct 1034 -222 1039 -261 1039 -307 ct 1039 -371 1029 -419 1008 -453 ct -987 -487 962 -510 932 -522 ct 911 -530 876 -534 828 -534 ct 701 -534 l p ef -1661 -212 m 1742 -192 l 1725 -126 1695 -76 1651 -41 ct 1607 -6 1554 10 1491 10 ct -1425 10 1372 -2 1331 -29 ct 1290 -56 1259 -94 1238 -145 ct 1216 -195 1206 -249 1206 -307 ct -1206 -370 1218 -425 1242 -472 ct 1266 -519 1300 -555 1345 -580 ct 1389 -604 1438 -616 1492 -616 ct -1553 -616 1604 -601 1645 -570 ct 1686 -539 1715 -496 1731 -440 ct 1652 -421 l -1638 -465 1618 -497 1591 -517 ct 1564 -537 1531 -547 1490 -547 ct 1444 -547 1405 -536 1373 -514 ct -1342 -492 1320 -462 1307 -424 ct 1295 -386 1288 -348 1288 -308 ct 1288 -256 1296 -211 1311 -173 ct -1326 -134 1349 -105 1381 -86 ct 1413 -67 1447 -58 1484 -58 ct 1529 -58 1567 -71 1598 -97 ct -1629 -123 l 1650 -161 l p ef -pom -gr -8442 7781 m 8437 7778 l 8224 7666 l 8218 7663 l 8049 7492 l 8046 7486 l -7936 7271 l 7933 7265 l 7894 7016 l 7894 7009 l 7933 6759 l 7936 6753 l -8046 6538 l 8049 6532 l 8218 6361 l 8224 6358 l 8437 6246 l 8442 6244 l -8689 6204 l 8696 6204 l 8942 6244 l 8948 6246 l 9161 6358 l 9166 6361 l -9335 6532 l 9338 6538 l 9449 6753 l 9451 6759 l 9491 7009 l 9491 7016 l -9451 7265 l 9449 7271 l 9338 7486 l 9335 7492 l 9166 7663 l 9161 7666 l -8948 7778 l 8942 7781 l 8696 7821 l 8689 7821 l 8442 7781 l p -8692 7779 m 8931 7739 l 9138 7631 l 9303 7464 l 9410 7254 l 9449 7012 l -9410 6770 l 9303 6560 l 9138 6393 l 8931 6285 l 8692 6246 l 8453 6285 l -8246 6393 l 8081 6560 l 7974 6770 l 7936 7012 l 7974 7254 l 8081 7464 l -8246 7631 l 8453 7739 l 8692 7779 l p -8174 6489 m 8204 6458 l 8411 6668 l 8618 6877 l 8825 7087 l 9032 7297 l -9240 7508 l 9210 7538 l 9002 7328 l 8795 7118 l 8588 6908 l 8380 6698 l -8174 6489 l p -8204 7538 m 8174 7509 l 8380 7298 l 8588 7088 l 8795 6878 l 9003 6668 l -9211 6458 l 9240 6489 l 9032 6699 l 8825 6909 l 8618 7119 l 8411 7329 l -8204 7538 l p ef -1 lw 0 lj 8442 7781 m 8437 7778 l 8224 7666 l 8218 7663 l 8049 7492 l -8046 7486 l 7936 7271 l 7933 7265 l 7894 7016 l 7894 7009 l 7933 6759 l -7936 6753 l 8046 6538 l 8049 6532 l 8218 6361 l 8224 6358 l 8437 6246 l -8442 6244 l 8689 6204 l 8696 6204 l 8942 6244 l 8948 6246 l 9161 6358 l -9166 6361 l 9335 6532 l 9338 6538 l 9449 6753 l 9451 6759 l 9491 7009 l -9491 7016 l 9451 7265 l 9449 7271 l 9338 7486 l 9335 7492 l 9166 7663 l -9161 7666 l 8948 7778 l 8942 7781 l 8696 7821 l 8689 7821 l 8442 7781 l -pc -8692 7779 m 8931 7739 l 9138 7631 l 9303 7464 l 9410 7254 l 9449 7012 l -9410 6770 l 9303 6560 l 9138 6393 l 8931 6285 l 8692 6246 l 8453 6285 l -8246 6393 l 8081 6560 l 7974 6770 l 7936 7012 l 7974 7254 l 8081 7464 l -8246 7631 l 8453 7739 l 8692 7779 l pc -8174 6489 m 8204 6458 l 8411 6668 l 8618 6877 l 8825 7087 l 9032 7297 l -9240 7508 l 9210 7538 l 9002 7328 l 8795 7118 l 8588 6908 l 8380 6698 l -8174 6489 l pc -8204 7538 m 8174 7509 l 8380 7298 l 8588 7088 l 8795 6878 l 9003 6668 l -9211 6458 l 9240 6489 l 9032 6699 l 8825 6909 l 8618 7119 l 8411 7329 l -8204 7538 l pc -8691 7821 m 8541 8271 l 8841 8270 l 8691 7821 l p ef -8691 8181 m 8691 12701 l ps -11531 10361 m 11381 10811 l 11681 10810 l 11531 10361 l p ef -11531 10721 m 11531 12701 l ps -gs -pum -7329 12171 t -26 -131 m 99 -142 l 103 -113 115 -90 134 -74 ct 153 -59 179 -51 213 -51 ct -247 -51 272 -58 289 -72 ct 306 -86 314 -102 314 -121 ct 314 -138 307 -151 292 -160 ct -282 -167 256 -175 216 -186 ct 161 -199 123 -211 102 -221 ct 81 -231 65 -245 54 -263 ct -43 -281 38 -301 38 -322 ct 38 -342 42 -360 51 -376 ct 60 -393 73 -407 88 -418 ct -100 -427 115 -434 135 -440 ct 155 -446 177 -449 200 -449 ct 234 -449 264 -444 290 -434 ct -317 -424 336 -410 348 -393 ct 361 -376 369 -354 374 -325 ct 301 -315 l 298 -338 288 -356 272 -368 ct -256 -381 234 -387 205 -387 ct 171 -387 146 -382 132 -370 ct 117 -359 110 -346 110 -331 ct -110 -321 113 -312 119 -305 ct 125 -297 135 -290 148 -285 ct 155 -282 177 -276 213 -266 ct -266 -252 303 -240 324 -231 ct 344 -222 361 -209 373 -192 ct 384 -175 390 -154 390 -129 ct -390 -104 383 -80 369 -58 ct 354 -37 333 -20 306 -8 ct 279 3 248 9 213 9 ct 156 9 113 -1 83 -25 ct -53 -49 l 34 -84 l p ef -453 -520 m 453 -606 l 527 -606 l 527 -520 l p -453 0 m 453 -439 l 527 -439 l 527 0 l p ef -637 0 m 637 -439 l 704 -439 l 704 -376 l 737 -425 783 -449 844 -449 ct -871 -449 895 -444 917 -434 ct 939 -425 956 -412 967 -397 ct 978 -382 986 -363 990 -342 ct -993 -328 994 -304 994 -270 ct 994 0 l 920 0 l 920 -267 l 920 -297 917 -320 911 -335 ct -905 -350 895 -362 880 -371 ct 866 -380 848 -384 828 -384 ct 797 -384 769 -374 746 -354 ct -723 -334 712 -296 712 -239 ct 712 0 l p ef -pom -gr -gs -pum -11880 12223 t -342 -160 m 415 -151 l 407 -100 387 -61 354 -32 ct 321 -4 280 9 232 9 ct 172 9 124 -9 87 -49 ct -51 -88 33 -144 33 -217 ct 33 -265 40 -306 56 -342 ct 72 -378 96 -404 128 -422 ct -160 -440 195 -449 233 -449 ct 280 -449 319 -437 350 -412 ct 380 -388 400 -354 408 -310 ct -336 -299 l 329 -328 317 -350 299 -365 ct 282 -380 260 -387 236 -387 ct 198 -387 168 -374 144 -347 ct -121 -320 109 -278 109 -220 ct 109 -161 120 -118 143 -91 ct 166 -64 195 -51 232 -51 ct -261 -51 285 -60 305 -78 ct 324 -96 l 337 -123 l p ef -451 -219 m 451 -300 473 -361 518 -400 ct 556 -432 602 -449 657 -449 ct 717 -449 766 -429 805 -389 ct -843 -350 862 -295 862 -225 ct 862 -169 854 -124 837 -92 ct 820 -60 795 -34 763 -16 ct -730 0 695 9 657 9 ct 595 9 545 -9 507 -49 ct 470 -88 l 451 -145 l p -527 -219 m 527 -163 539 -121 564 -93 ct 588 -65 619 -51 657 -51 ct 694 -51 724 -65 749 -93 ct -773 -121 786 -164 786 -222 ct 786 -276 773 -317 749 -345 ct 724 -373 693 -387 657 -387 ct -619 -387 588 -373 564 -345 ct 539 -317 l 527 -275 l p ef -926 -131 m 999 -142 l 1003 -113 1015 -90 1034 -74 ct 1053 -59 1079 -51 1113 -51 ct -1147 -51 1172 -58 1189 -72 ct 1206 -86 1214 -102 1214 -121 ct 1214 -138 1207 -151 1192 -160 ct -1182 -167 1156 -175 1116 -186 ct 1061 -199 1023 -211 1002 -221 ct 981 -231 965 -245 954 -263 ct -943 -281 938 -301 938 -322 ct 938 -342 942 -360 951 -376 ct 960 -393 973 -407 988 -418 ct -1000 -427 1015 -434 1035 -440 ct 1055 -446 1077 -449 1100 -449 ct 1134 -449 1164 -444 1190 -434 ct -1217 -424 1236 -410 1248 -393 ct 1261 -376 1269 -354 1274 -325 ct 1201 -315 l -1198 -338 1188 -356 1172 -368 ct 1156 -381 1134 -387 1105 -387 ct 1071 -387 1046 -382 1032 -370 ct -1017 -359 1010 -346 1010 -331 ct 1010 -321 1013 -312 1019 -305 ct 1025 -297 1035 -290 1048 -285 ct -1055 -282 1077 -276 1113 -266 ct 1166 -252 1203 -240 1224 -231 ct 1244 -222 1261 -209 1273 -192 ct -1284 -175 1290 -154 1290 -129 ct 1290 -104 1283 -80 1269 -58 ct 1254 -37 1233 -20 1206 -8 ct -1179 3 1148 9 1113 9 ct 1056 9 1013 -1 983 -25 ct 953 -49 l 934 -84 l p ef -pom -gr -24131 6986 m 23680 6836 l 23681 7136 l 24131 6986 l p ef -20956 6986 m 23771 6986 l ps -24131 9526 m 23680 9376 l 23681 9676 l 24131 9526 l p ef -20956 9526 m 23771 9526 l ps -gs -pum -24646 7223 t -79 0 m 79 -606 l 159 -606 l 159 0 l p ef -pom -gr -gs -pum -24435 9763 t -524 -64 m 562 -39 596 -20 627 -8 ct 604 47 l 560 31 517 6 473 -27 ct 429 -2 379 10 325 10 ct -270 10 220 -2 175 -29 ct 131 -55 96 -93 72 -141 ct 48 -189 36 -243 36 -303 ct 36 -362 48 -417 72 -466 ct -97 -515 131 -552 176 -578 ct 221 -604 271 -617 326 -617 ct 382 -617 433 -603 478 -577 ct -523 -550 557 -513 580 -465 ct 604 -417 616 -363 616 -303 ct 616 -253 608 -208 593 -168 ct -578 -129 l 555 -94 l p -348 -167 m 394 -154 432 -135 462 -109 ct 509 -152 533 -217 533 -303 ct 533 -352 525 -395 508 -432 ct -491 -468 467 -497 435 -517 ct 403 -537 367 -547 327 -547 ct 267 -547 217 -527 178 -486 ct -138 -445 119 -384 119 -303 ct 119 -224 138 -163 177 -121 ct 216 -79 266 -58 327 -58 ct -355 -58 382 -63 408 -74 ct 383 -90 356 -102 328 -109 ct p ef -pom -gr -gs -pum -23747 3307 t -315 0 m 241 0 l 241 -474 l 223 -457 199 -440 170 -423 ct 141 -405 115 -393 92 -384 ct -92 -456 l 133 -476 170 -499 201 -527 ct 232 -555 254 -582 267 -608 ct 315 -608 l -p ef -897 -457 m 823 -452 l 816 -481 807 -502 795 -515 ct 775 -536 750 -547 720 -547 ct -697 -547 676 -540 658 -527 ct 634 -510 616 -485 602 -452 ct 589 -420 582 -373 581 -312 ct -599 -339 621 -360 647 -373 ct 673 -386 700 -393 729 -393 ct 778 -393 820 -375 855 -338 ct -890 -301 908 -254 908 -196 ct 908 -158 899 -123 883 -90 ct 867 -58 844 -33 815 -15 ct -787 1 754 10 718 10 ct 656 10 605 -12 566 -58 ct 527 -103 507 -178 507 -283 ct -507 -400 529 -486 572 -539 ct 610 -585 661 -608 725 -608 ct 773 -608 812 -595 842 -568 ct -873 -541 l 891 -504 l p -593 -196 m 593 -170 598 -146 609 -122 ct 620 -99 635 -81 655 -69 ct 675 -57 695 -50 717 -50 ct -748 -50 775 -63 798 -88 ct 820 -114 832 -148 832 -192 ct 832 -234 820 -267 798 -291 ct -776 -315 748 -327 714 -327 ct 680 -327 652 -315 628 -291 ct 605 -267 l 593 -235 l -p ef -952 -181 m 952 -256 l 1181 -256 l 1181 -181 l p ef -1341 0 m 1272 0 l 1272 -606 l 1346 -606 l 1346 -390 l 1378 -429 1418 -449 1467 -449 ct -1494 -449 1519 -443 1543 -432 ct 1568 -421 1587 -406 1603 -386 ct 1619 -367 1631 -343 1640 -315 ct -1648 -287 1653 -257 1653 -226 ct 1653 -150 1634 -92 1597 -51 ct 1560 -10 1515 9 1463 9 ct -1411 9 1370 -11 1341 -55 ct p -1340 -222 m 1340 -170 1347 -132 1362 -108 ct 1385 -70 1417 -51 1457 -51 ct -1489 -51 1517 -65 1541 -93 ct 1565 -121 1577 -164 1577 -220 ct 1577 -277 1565 -319 1543 -346 ct -1520 -374 1492 -387 1460 -387 ct 1428 -387 1399 -373 1376 -345 ct 1352 -317 l -1340 -276 l p ef -1723 -520 m 1723 -606 l 1797 -606 l 1797 -520 l p -1723 0 m 1723 -439 l 1797 -439 l 1797 0 l p ef -2070 -66 m 2081 0 l 2060 3 2041 5 2024 5 ct 1997 5 1976 1 1962 -7 ct 1947 -15 1936 -26 1930 -40 ct -1924 -54 1921 -83 1921 -128 ct 1921 -381 l 1866 -381 l 1866 -439 l 1921 -439 l -1921 -547 l 1995 -592 l 1995 -439 l 2070 -439 l 2070 -381 l 1995 -381 l -1995 -124 l 1995 -103 1996 -89 1999 -83 ct 2002 -77 2006 -72 2012 -69 ct 2018 -65 2026 -63 2037 -63 ct -2045 -63 l 2056 -64 l p ef -pom -pum -22596 4260 t -340 0 m 340 -55 l 312 -11 272 9 217 9 ct 182 9 150 0 121 -19 ct 92 -38 69 -65 53 -99 ct -37 -134 28 -174 28 -219 ct 28 -263 36 -302 50 -338 ct 65 -374 87 -401 116 -420 ct -145 -439 178 -449 214 -449 ct 241 -449 264 -443 285 -432 ct 306 -421 322 -406 335 -388 ct -335 -606 l 409 -606 l 409 0 l p -105 -219 m 105 -162 117 -120 141 -93 ct 164 -65 192 -51 224 -51 ct 257 -51 285 -64 307 -91 ct -330 -117 342 -158 342 -212 ct 342 -273 330 -317 307 -345 ct 284 -373 255 -387 221 -387 ct -188 -387 160 -374 138 -346 ct 116 -319 l 105 -277 l p ef -818 -54 m 790 -30 764 -14 738 -4 ct 713 5 685 9 656 9 ct 608 9 571 -1 545 -25 ct -519 -49 506 -79 506 -115 ct 506 -137 511 -156 521 -174 ct 531 -192 543 -206 559 -217 ct -575 -228 593 -236 613 -241 ct 627 -245 649 -249 679 -253 ct 739 -260 783 -268 812 -278 ct -812 -288 812 -295 812 -298 ct 812 -328 805 -349 791 -362 ct 772 -379 744 -387 706 -387 ct -671 -387 645 -381 629 -369 ct 612 -356 600 -335 592 -303 ct 519 -313 l 526 -345 536 -370 552 -389 ct -567 -408 589 -423 617 -433 ct 646 -443 679 -449 717 -449 ct 755 -449 785 -444 808 -435 ct -832 -427 849 -415 860 -402 ct 871 -389 879 -372 883 -351 ct 886 -339 887 -316 887 -283 ct -887 -184 l 887 -114 889 -71 892 -52 ct 895 -34 901 -16 911 0 ct 833 0 l 825 -15 l -820 -33 l p -812 -220 m 785 -209 744 -200 690 -192 ct 660 -187 638 -182 625 -177 ct 613 -171 603 -163 596 -153 ct -589 -142 586 -130 586 -117 ct 586 -98 593 -81 608 -68 ct 623 -55 645 -48 674 -48 ct -703 -48 728 -54 751 -67 ct 773 -79 789 -96 800 -118 ct 808 -135 812 -160 812 -193 ct -p ef -1144 -66 m 1155 0 l 1134 3 1115 5 1098 5 ct 1071 5 1050 1 1036 -7 ct 1021 -15 1010 -26 1004 -40 ct -998 -54 995 -83 995 -128 ct 995 -381 l 940 -381 l 940 -439 l 995 -439 l -995 -547 l 1069 -592 l 1069 -439 l 1144 -439 l 1144 -381 l 1069 -381 l -1069 -124 l 1069 -103 1070 -89 1073 -83 ct 1076 -77 1080 -72 1086 -69 ct 1092 -65 1100 -63 1111 -63 ct -1119 -63 l 1130 -64 l p ef -1506 -54 m 1478 -30 1452 -14 1426 -4 ct 1401 5 1373 9 1344 9 ct 1296 9 1259 -1 1233 -25 ct -1207 -49 1194 -79 1194 -115 ct 1194 -137 1199 -156 1209 -174 ct 1219 -192 1231 -206 1247 -217 ct -1263 -228 1281 -236 1301 -241 ct 1315 -245 1337 -249 1367 -253 ct 1427 -260 1471 -268 1500 -278 ct -1500 -288 1500 -295 1500 -298 ct 1500 -328 1493 -349 1479 -362 ct 1460 -379 1432 -387 1394 -387 ct -1359 -387 1333 -381 1317 -369 ct 1300 -356 1288 -335 1280 -303 ct 1207 -313 l -1214 -345 1224 -370 1240 -389 ct 1255 -408 1277 -423 1305 -433 ct 1334 -443 1367 -449 1405 -449 ct -1443 -449 1473 -444 1496 -435 ct 1520 -427 1537 -415 1548 -402 ct 1559 -389 1567 -372 1571 -351 ct -1574 -339 1575 -316 1575 -283 ct 1575 -184 l 1575 -114 1577 -71 1580 -52 ct -1583 -34 1589 -16 1599 0 ct 1521 0 l 1513 -15 l 1508 -33 l p -1500 -220 m 1473 -209 1432 -200 1378 -192 ct 1348 -187 1326 -182 1313 -177 ct -1301 -171 1291 -163 1284 -153 ct 1277 -142 1274 -130 1274 -117 ct 1274 -98 1281 -81 1296 -68 ct -1311 -55 1333 -48 1362 -48 ct 1391 -48 1416 -54 1439 -67 ct 1461 -79 1477 -96 1488 -118 ct -1496 -135 1500 -160 1500 -193 ct p ef -2070 -66 m 2081 0 l 2060 3 2041 5 2024 5 ct 1997 5 1976 1 1962 -7 ct 1947 -15 1936 -26 1930 -40 ct -1924 -54 1921 -83 1921 -128 ct 1921 -381 l 1866 -381 l 1866 -439 l 1921 -439 l -1921 -547 l 1995 -592 l 1995 -439 l 2070 -439 l 2070 -381 l 1995 -381 l -1995 -124 l 1995 -103 1996 -89 1999 -83 ct 2002 -77 2006 -72 2012 -69 ct 2018 -65 2026 -63 2037 -63 ct -2045 -63 l 2056 -64 l p ef -2118 -219 m 2118 -300 2140 -361 2185 -400 ct 2223 -432 2269 -449 2324 -449 ct -2384 -449 2433 -429 2472 -389 ct 2510 -350 2529 -295 2529 -225 ct 2529 -169 2521 -124 2504 -92 ct -2487 -60 2462 -34 2430 -16 ct 2397 0 2362 9 2324 9 ct 2262 9 2212 -9 2174 -49 ct -2137 -88 l 2118 -145 l p -2194 -219 m 2194 -163 2206 -121 2231 -93 ct 2255 -65 2286 -51 2324 -51 ct 2361 -51 2391 -65 2416 -93 ct -2440 -121 2453 -164 2453 -222 ct 2453 -276 2440 -317 2416 -345 ct 2391 -373 2360 -387 2324 -387 ct -2286 -387 2255 -373 2231 -345 ct 2206 -317 l 2194 -275 l p ef -2860 0 m 2860 -606 l 2935 -606 l 2935 -388 l 2970 -429 3013 -449 3066 -449 ct -3099 -449 3127 -442 3151 -429 ct 3175 -417 3192 -399 3203 -376 ct 3213 -354 3218 -321 3218 -278 ct -3218 0 l 3144 0 l 3144 -278 l 3144 -315 3136 -342 3119 -359 ct 3103 -376 3081 -385 3051 -385 ct -3029 -385 3008 -379 2989 -367 ct 2969 -356 2955 -340 2947 -321 ct 2939 -301 2935 -274 2935 -240 ct -2935 0 l p ef -3309 -219 m 3309 -300 3331 -361 3376 -400 ct 3414 -432 3460 -449 3515 -449 ct -3575 -449 3624 -429 3663 -389 ct 3701 -350 3720 -295 3720 -225 ct 3720 -169 3712 -124 3695 -92 ct -3678 -60 3653 -34 3621 -16 ct 3588 0 3553 9 3515 9 ct 3453 9 3403 -9 3365 -49 ct -3328 -88 l 3309 -145 l p -3385 -219 m 3385 -163 3397 -121 3422 -93 ct 3446 -65 3477 -51 3515 -51 ct 3552 -51 3582 -65 3607 -93 ct -3631 -121 3644 -164 3644 -222 ct 3644 -276 3631 -317 3607 -345 ct 3582 -373 3551 -387 3515 -387 ct -3477 -387 3446 -373 3422 -345 ct 3397 -317 l 3385 -275 l p ef -3783 -131 m 3856 -142 l 3860 -113 3872 -90 3891 -74 ct 3910 -59 3936 -51 3970 -51 ct -4004 -51 4029 -58 4046 -72 ct 4063 -86 4071 -102 4071 -121 ct 4071 -138 4064 -151 4049 -160 ct -4039 -167 4013 -175 3973 -186 ct 3918 -199 3880 -211 3859 -221 ct 3838 -231 3822 -245 3811 -263 ct -3800 -281 3795 -301 3795 -322 ct 3795 -342 3799 -360 3808 -376 ct 3817 -393 3830 -407 3845 -418 ct -3857 -427 3872 -434 3892 -440 ct 3912 -446 3934 -449 3957 -449 ct 3991 -449 4021 -444 4047 -434 ct -4074 -424 4093 -410 4105 -393 ct 4118 -376 4126 -354 4131 -325 ct 4058 -315 l -4055 -338 4045 -356 4029 -368 ct 4013 -381 3991 -387 3962 -387 ct 3928 -387 3903 -382 3889 -370 ct -3874 -359 3867 -346 3867 -331 ct 3867 -321 3870 -312 3876 -305 ct 3882 -297 3892 -290 3905 -285 ct -3912 -282 3934 -276 3970 -266 ct 4023 -252 4060 -240 4081 -231 ct 4101 -222 4118 -209 4130 -192 ct -4141 -175 4147 -154 4147 -129 ct 4147 -104 4140 -80 4126 -58 ct 4111 -37 4090 -20 4063 -8 ct -4036 3 4005 9 3970 9 ct 3913 9 3870 -1 3840 -25 ct 3810 -49 l 3791 -84 l p ef -4372 -66 m 4383 0 l 4362 3 4343 5 4326 5 ct 4299 5 4278 1 4264 -7 ct 4249 -15 4238 -26 4232 -40 ct -4226 -54 4223 -83 4223 -128 ct 4223 -381 l 4168 -381 l 4168 -439 l 4223 -439 l -4223 -547 l 4297 -592 l 4297 -439 l 4372 -439 l 4372 -381 l 4297 -381 l -4297 -124 l 4297 -103 4298 -89 4301 -83 ct 4304 -77 4308 -72 4314 -69 ct 4320 -65 4328 -63 4339 -63 ct -4347 -63 l 4358 -64 l p ef -pom -pum -23257 5213 t -177 0 m 10 -439 l 89 -439 l 183 -176 l 193 -147 203 -118 211 -87 ct 218 -110 227 -138 239 -171 ct -337 -439 l 413 -439 l 247 0 l p ef -479 -520 m 479 -606 l 553 -606 l 553 -520 l p -479 0 m 479 -439 l 553 -439 l 553 0 l p ef -951 -54 m 923 -30 897 -14 871 -4 ct 846 5 818 9 789 9 ct 741 9 704 -1 678 -25 ct -652 -49 639 -79 639 -115 ct 639 -137 644 -156 654 -174 ct 664 -192 676 -206 692 -217 ct -708 -228 726 -236 746 -241 ct 760 -245 782 -249 812 -253 ct 872 -260 916 -268 945 -278 ct -945 -288 945 -295 945 -298 ct 945 -328 938 -349 924 -362 ct 905 -379 877 -387 839 -387 ct -804 -387 778 -381 762 -369 ct 745 -356 733 -335 725 -303 ct 652 -313 l 659 -345 669 -370 685 -389 ct -700 -408 722 -423 750 -433 ct 779 -443 812 -449 850 -449 ct 888 -449 918 -444 941 -435 ct -965 -427 982 -415 993 -402 ct 1004 -389 1012 -372 1016 -351 ct 1019 -339 1020 -316 1020 -283 ct -1020 -184 l 1020 -114 1022 -71 1025 -52 ct 1028 -34 1034 -16 1044 0 ct 966 0 l -958 -15 l 953 -33 l p -945 -220 m 918 -209 877 -200 823 -192 ct 793 -187 771 -182 758 -177 ct 746 -171 736 -163 729 -153 ct -722 -142 719 -130 719 -117 ct 719 -98 726 -81 741 -68 ct 756 -55 778 -48 807 -48 ct -836 -48 861 -54 884 -67 ct 906 -79 922 -96 933 -118 ct 941 -135 945 -160 945 -193 ct -p ef -1759 -606 m 1839 -606 l 1839 -256 l 1839 -195 1832 -146 1818 -110 ct 1804 -75 1780 -45 1744 -23 ct -1708 0 1660 10 1602 10 ct 1545 10 1499 0 1463 -19 ct 1426 -38 1401 -66 1385 -104 ct -1370 -141 1362 -191 1362 -256 ct 1362 -606 l 1442 -606 l 1442 -256 l 1442 -203 1447 -164 1457 -139 ct -1467 -115 1484 -95 1507 -82 ct 1531 -68 1560 -62 1595 -62 ct 1654 -62 1696 -75 1721 -102 ct -1746 -128 1759 -180 1759 -256 ct p ef -1969 -194 m 2044 -201 l 2048 -171 2056 -146 2069 -126 ct 2082 -107 2103 -91 2130 -79 ct -2158 -67 2189 -61 2223 -61 ct 2254 -61 2281 -66 2304 -75 ct 2328 -84 2345 -96 2357 -112 ct -2368 -128 2374 -145 2374 -164 ct 2374 -183 2368 -200 2357 -214 ct 2346 -228 2328 -240 2303 -250 ct -2286 -256 2250 -266 2195 -279 ct 2139 -293 2100 -305 2078 -317 ct 2049 -332 2027 -351 2013 -374 ct -1999 -396 1992 -421 1992 -449 ct 1992 -480 2000 -508 2018 -535 ct 2035 -561 2061 -582 2094 -595 ct -2127 -609 2164 -616 2205 -616 ct 2250 -616 2290 -609 2324 -594 ct 2358 -580 2385 -559 2403 -531 ct -2422 -502 2432 -471 2433 -435 ct 2356 -429 l 2352 -468 2338 -496 2314 -516 ct -2290 -536 2255 -545 2208 -545 ct 2160 -545 2125 -537 2102 -519 ct 2080 -501 2069 -480 2069 -454 ct -2069 -433 2077 -415 2093 -401 ct 2108 -387 2148 -372 2214 -357 ct 2279 -343 2324 -330 2348 -319 ct -2383 -303 2409 -282 2426 -257 ct 2443 -232 2451 -203 2451 -171 ct 2451 -138 2442 -108 2423 -80 ct -2405 -51 2378 -29 2344 -13 ct 2309 2 2270 10 2227 10 ct 2172 10 2126 2 2089 -13 ct -2052 -29 2023 -53 2002 -85 ct 1981 -117 l 1970 -154 l p ef -2576 0 m 2576 -606 l 2803 -606 l 2849 -606 2886 -600 2914 -587 ct 2942 -575 2964 -556 2980 -531 ct -2996 -505 3004 -479 3004 -451 ct 3004 -425 2997 -400 2983 -378 ct 2969 -355 2948 -336 2919 -322 ct -2956 -311 2984 -293 3004 -267 ct 3024 -241 3033 -211 3033 -175 ct 3033 -147 3027 -120 3015 -96 ct -3003 -72 2989 -53 2971 -40 ct 2953 -26 2931 -16 2905 -10 ct 2878 -3 2845 0 2807 0 ct -p -2656 -351 m 2787 -351 l 2822 -351 2848 -353 2863 -358 ct 2884 -364 2899 -374 2909 -388 ct -2920 -402 2925 -420 2925 -441 ct 2925 -461 2920 -479 2911 -494 ct 2901 -510 2887 -520 2869 -526 ct -2851 -531 2821 -534 2777 -534 ct 2656 -534 l p -2656 -71 m 2807 -71 l 2833 -71 2851 -72 2861 -74 ct 2880 -77 2895 -83 2908 -90 ct -2920 -98 2930 -109 2938 -124 ct 2946 -139 2950 -156 2950 -175 ct 2950 -198 2944 -218 2933 -234 ct -2921 -251 2905 -263 2885 -269 ct 2864 -276 2835 -279 2796 -279 ct 2656 -279 l -p ef -pom -gr -gs -pum -6825 19235 t -497 -212 m 578 -192 l 561 -126 531 -76 487 -41 ct 443 -6 390 10 327 10 ct -261 10 208 -2 167 -29 ct 126 -56 95 -94 74 -145 ct 52 -195 42 -249 42 -307 ct 42 -370 54 -425 78 -472 ct -102 -519 136 -555 181 -580 ct 225 -604 274 -616 328 -616 ct 389 -616 440 -601 481 -570 ct -522 -539 551 -496 567 -440 ct 488 -421 l 474 -465 454 -497 427 -517 ct 400 -537 367 -547 326 -547 ct -280 -547 241 -536 209 -514 ct 178 -492 156 -462 143 -424 ct 131 -386 124 -348 124 -308 ct -124 -256 132 -211 147 -173 ct 162 -134 185 -105 217 -86 ct 249 -67 283 -58 320 -58 ct -365 -58 403 -71 434 -97 ct 465 -123 l 486 -161 l p ef -991 -141 m 1068 -131 l 1056 -86 1033 -52 1001 -27 ct 968 -2 926 9 875 9 ct -811 9 760 -9 722 -49 ct 684 -88 666 -144 666 -215 ct 666 -289 685 -347 723 -387 ct -761 -428 810 -449 871 -449 ct 929 -449 977 -429 1015 -389 ct 1052 -349 1070 -292 1070 -220 ct -1070 -216 1070 -209 1070 -200 ct 742 -200 l 745 -152 759 -115 783 -89 ct 808 -64 839 -51 875 -51 ct -903 -51 926 -58 945 -72 ct 964 -87 l 980 -110 l p -747 -261 m 992 -261 l 989 -298 979 -326 964 -344 ct 940 -373 909 -387 871 -387 ct -837 -387 809 -376 785 -353 ct 762 -330 l 749 -300 l p ef -1166 0 m 1166 -439 l 1233 -439 l 1233 -376 l 1266 -425 1312 -449 1373 -449 ct -1400 -449 1424 -444 1446 -434 ct 1468 -425 1485 -412 1496 -397 ct 1507 -382 1515 -363 1519 -342 ct -1522 -328 1523 -304 1523 -270 ct 1523 0 l 1449 0 l 1449 -267 l 1449 -297 1446 -320 1440 -335 ct -1434 -350 1424 -362 1409 -371 ct 1395 -380 1377 -384 1357 -384 ct 1326 -384 1298 -374 1275 -354 ct -1252 -334 1241 -296 1241 -239 ct 1241 0 l p ef -1806 -66 m 1817 0 l 1796 3 1777 5 1760 5 ct 1733 5 1712 1 1698 -7 ct 1683 -15 1672 -26 1666 -40 ct -1660 -54 1657 -83 1657 -128 ct 1657 -381 l 1602 -381 l 1602 -439 l 1657 -439 l -1657 -547 l 1731 -592 l 1731 -439 l 1806 -439 l 1806 -381 l 1731 -381 l -1731 -124 l 1731 -103 1732 -89 1735 -83 ct 1738 -77 1742 -72 1748 -69 ct 1754 -65 1762 -63 1773 -63 ct -1781 -63 l 1792 -64 l p ef -2182 -141 m 2259 -131 l 2247 -86 2224 -52 2192 -27 ct 2159 -2 2117 9 2066 9 ct -2002 9 1951 -9 1913 -49 ct 1875 -88 1857 -144 1857 -215 ct 1857 -289 1876 -347 1914 -387 ct -1952 -428 2001 -449 2062 -449 ct 2120 -449 2168 -429 2206 -389 ct 2243 -349 2261 -292 2261 -220 ct -2261 -216 2261 -209 2261 -200 ct 1933 -200 l 1936 -152 1950 -115 1974 -89 ct -1999 -64 2030 -51 2066 -51 ct 2094 -51 2117 -58 2136 -72 ct 2155 -87 l 2171 -110 l -p -1938 -261 m 2183 -261 l 2180 -298 2170 -326 2155 -344 ct 2131 -373 2100 -387 2062 -387 ct -2028 -387 2000 -376 1976 -353 ct 1953 -330 l 1940 -300 l p ef -2357 0 m 2357 -439 l 2424 -439 l 2424 -372 l 2441 -403 2456 -424 2471 -434 ct -2485 -444 2501 -449 2519 -449 ct 2544 -449 2569 -441 2595 -425 ct 2570 -356 l -2551 -366 2533 -372 2515 -372 ct 2499 -372 2484 -367 2471 -357 ct 2458 -347 2449 -334 2443 -316 ct -2435 -290 2431 -261 2431 -229 ct 2431 0 l p ef -2904 0 m 2904 -381 l 2838 -381 l 2838 -439 l 2904 -439 l 2904 -485 l -2904 -515 2907 -537 2912 -551 ct 2919 -571 2932 -586 2950 -598 ct 2968 -610 2993 -616 3026 -616 ct -3047 -616 3070 -614 3095 -609 ct 3084 -544 l 3069 -547 3054 -548 3040 -548 ct -3018 -548 3002 -543 2992 -533 ct 2983 -524 2978 -506 2978 -479 ct 2978 -439 l -3064 -439 l 3064 -381 l 2978 -381 l 2978 0 l p ef -3124 0 m 3124 -439 l 3191 -439 l 3191 -372 l 3208 -403 3223 -424 3238 -434 ct -3252 -444 3268 -449 3286 -449 ct 3311 -449 3336 -441 3362 -425 ct 3337 -356 l -3318 -366 3300 -372 3282 -372 ct 3266 -372 3251 -367 3238 -357 ct 3225 -347 3216 -334 3210 -316 ct -3202 -290 3198 -261 3198 -229 ct 3198 0 l p ef -3716 -141 m 3793 -131 l 3781 -86 3758 -52 3726 -27 ct 3693 -2 3651 9 3600 9 ct -3536 9 3485 -9 3447 -49 ct 3409 -88 3391 -144 3391 -215 ct 3391 -289 3410 -347 3448 -387 ct -3486 -428 3535 -449 3596 -449 ct 3654 -449 3702 -429 3740 -389 ct 3777 -349 3795 -292 3795 -220 ct -3795 -216 3795 -209 3795 -200 ct 3467 -200 l 3470 -152 3484 -115 3508 -89 ct -3533 -64 3564 -51 3600 -51 ct 3628 -51 3651 -58 3670 -72 ct 3689 -87 l 3705 -110 l -p -3472 -261 m 3717 -261 l 3714 -298 3704 -326 3689 -344 ct 3665 -373 3634 -387 3596 -387 ct -3562 -387 3534 -376 3510 -353 ct 3487 -330 l 3474 -300 l p ef -4171 168 m 4171 -46 l 4160 -30 4144 -16 4123 -6 ct 4102 4 4080 9 4056 9 ct -4004 9 3959 -10 3922 -52 ct 3884 -94 3865 -151 3865 -223 ct 3865 -267 3873 -307 3888 -342 ct -3904 -377 3926 -404 3955 -422 ct 3984 -440 4016 -449 4051 -449 ct 4105 -449 4148 -426 4179 -380 ct -4179 -439 l 4246 -439 l 4246 168 l p -3942 -220 m 3942 -164 3954 -121 3977 -93 ct 4001 -65 4029 -51 4063 -51 ct 4094 -51 4122 -64 4144 -91 ct -4167 -118 4179 -159 4179 -214 ct 4179 -272 4167 -316 4143 -346 ct 4118 -375 4090 -390 4058 -390 ct -4025 -390 3998 -376 3975 -349 ct 3953 -321 l 3942 -279 l p ef -4656 0 m 4656 -64 l 4622 -14 4576 9 4517 9 ct 4491 9 4467 4 4444 -4 ct 4422 -14 4405 -27 4394 -42 ct -4383 -57 4376 -75 4371 -97 ct 4368 -112 4367 -135 4367 -167 ct 4367 -439 l 4441 -439 l -4441 -195 l 4441 -156 4443 -130 4446 -117 ct 4450 -97 4460 -82 4475 -70 ct -4491 -59 4509 -54 4532 -54 ct 4554 -54 4575 -59 4595 -71 ct 4614 -82 4628 -98 4636 -118 ct -4644 -137 4648 -166 4648 -203 ct 4648 -439 l 4723 -439 l 4723 0 l p ef -5145 -141 m 5222 -131 l 5210 -86 5187 -52 5155 -27 ct 5122 -2 5080 9 5029 9 ct -4965 9 4914 -9 4876 -49 ct 4838 -88 4820 -144 4820 -215 ct 4820 -289 4839 -347 4877 -387 ct -4915 -428 4964 -449 5025 -449 ct 5083 -449 5131 -429 5169 -389 ct 5206 -349 5224 -292 5224 -220 ct -5224 -216 5224 -209 5224 -200 ct 4896 -200 l 4899 -152 4913 -115 4937 -89 ct -4962 -64 4993 -51 5029 -51 ct 5057 -51 5080 -58 5099 -72 ct 5118 -87 l 5134 -110 l -p -4901 -261 m 5146 -261 l 5143 -298 5133 -326 5118 -344 ct 5094 -373 5063 -387 5025 -387 ct -4991 -387 4963 -376 4939 -353 ct 4916 -330 l 4903 -300 l p ef -5320 0 m 5320 -439 l 5387 -439 l 5387 -376 l 5420 -425 5466 -449 5527 -449 ct -5554 -449 5578 -444 5600 -434 ct 5622 -425 5639 -412 5650 -397 ct 5661 -382 5669 -363 5673 -342 ct -5676 -328 5677 -304 5677 -270 ct 5677 0 l 5603 0 l 5603 -267 l 5603 -297 5600 -320 5594 -335 ct -5588 -350 5578 -362 5563 -371 ct 5549 -380 5531 -384 5511 -384 ct 5480 -384 5452 -374 5429 -354 ct -5406 -334 5395 -296 5395 -239 ct 5395 0 l p ef -6083 -160 m 6156 -151 l 6148 -100 6128 -61 6095 -32 ct 6062 -4 6021 9 5973 9 ct -5913 9 5865 -9 5828 -49 ct 5792 -88 5774 -144 5774 -217 ct 5774 -265 5781 -306 5797 -342 ct -5813 -378 5837 -404 5869 -422 ct 5901 -440 5936 -449 5974 -449 ct 6021 -449 6060 -437 6091 -412 ct -6121 -388 6141 -354 6149 -310 ct 6077 -299 l 6070 -328 6058 -350 6040 -365 ct -6023 -380 6001 -387 5977 -387 ct 5939 -387 5909 -374 5885 -347 ct 5862 -320 5850 -278 5850 -220 ct -5850 -161 5861 -118 5884 -91 ct 5907 -64 5936 -51 5973 -51 ct 6002 -51 6026 -60 6046 -78 ct -6065 -96 l 6078 -123 l p ef -6217 169 m 6209 99 l 6225 103 6239 105 6251 105 ct 6268 105 6281 103 6291 97 ct -6301 92 6309 84 6315 74 ct 6320 66 6328 48 6338 19 ct 6340 14 6342 8 6345 0 ct -6178 -439 l 6258 -439 l 6350 -184 l 6362 -152 6372 -118 6382 -83 ct 6390 -117 6400 -150 6412 -183 ct -6506 -439 l 6581 -439 l 6413 7 l 6396 55 6382 88 6372 107 ct 6358 131 6343 149 6326 161 ct -6309 172 6289 178 6265 178 ct 6251 178 l 6235 175 l p ef -pom -pum -7778 20188 t -26 -181 m 26 -256 l 255 -256 l 255 -181 l p ef -364 0 m 364 -381 l 298 -381 l 298 -439 l 364 -439 l 364 -485 l 364 -515 367 -537 372 -551 ct -379 -571 392 -586 410 -598 ct 428 -610 453 -616 486 -616 ct 507 -616 530 -614 555 -609 ct -544 -544 l 529 -547 514 -548 500 -548 ct 478 -548 462 -543 452 -533 ct 443 -524 438 -506 438 -479 ct -438 -439 l 524 -439 l 524 -381 l 438 -381 l 438 0 l p ef -555 -131 m 628 -142 l 632 -113 644 -90 663 -74 ct 682 -59 708 -51 742 -51 ct -776 -51 801 -58 818 -72 ct 835 -86 843 -102 843 -121 ct 843 -138 836 -151 821 -160 ct -811 -167 785 -175 745 -186 ct 690 -199 652 -211 631 -221 ct 610 -231 594 -245 583 -263 ct -572 -281 567 -301 567 -322 ct 567 -342 571 -360 580 -376 ct 589 -393 602 -407 617 -418 ct -629 -427 644 -434 664 -440 ct 684 -446 706 -449 729 -449 ct 763 -449 793 -444 819 -434 ct -846 -424 865 -410 877 -393 ct 890 -376 898 -354 903 -325 ct 830 -315 l 827 -338 817 -356 801 -368 ct -785 -381 763 -387 734 -387 ct 700 -387 675 -382 661 -370 ct 646 -359 639 -346 639 -331 ct -639 -321 642 -312 648 -305 ct 654 -297 664 -290 677 -285 ct 684 -282 706 -276 742 -266 ct -795 -252 832 -240 853 -231 ct 873 -222 890 -209 902 -192 ct 913 -175 919 -154 919 -129 ct -919 -104 912 -80 898 -58 ct 883 -37 862 -20 835 -8 ct 808 3 777 9 742 9 ct 685 9 642 -1 612 -25 ct -582 -49 l 563 -84 l p ef -926 10 m 1101 -616 l 1161 -616 l 985 10 l p ef -1590 -71 m 1590 0 l 1189 0 l 1189 -17 1191 -35 1198 -51 ct 1208 -79 1224 -105 1247 -132 ct -1269 -158 1302 -189 1344 -224 ct 1410 -278 1455 -321 1478 -352 ct 1501 -384 1513 -413 1513 -442 ct -1513 -471 1502 -496 1481 -516 ct 1460 -537 1432 -547 1398 -547 ct 1363 -547 1334 -536 1312 -514 ct -1291 -493 1280 -463 1280 -425 ct 1203 -433 l 1208 -490 1228 -533 1262 -563 ct -1297 -593 1342 -608 1400 -608 ct 1458 -608 1504 -592 1538 -560 ct 1572 -528 1589 -488 1589 -440 ct -1589 -416 1584 -392 1574 -368 ct 1564 -345 1548 -320 1525 -294 ct 1502 -268 1463 -233 1410 -188 ct -1365 -150 1337 -125 1324 -111 ct 1311 -98 1301 -85 1293 -71 ct p ef -2097 -66 m 2108 0 l 2087 3 2068 5 2051 5 ct 2024 5 2003 1 1989 -7 ct 1974 -15 1963 -26 1957 -40 ct -1951 -54 1948 -83 1948 -128 ct 1948 -381 l 1893 -381 l 1893 -439 l 1948 -439 l -1948 -547 l 2022 -592 l 2022 -439 l 2097 -439 l 2097 -381 l 2022 -381 l -2022 -124 l 2022 -103 2023 -89 2026 -83 ct 2029 -77 2033 -72 2039 -69 ct 2045 -65 2053 -63 2064 -63 ct -2072 -63 l 2083 -64 l p ef -2145 -219 m 2145 -300 2167 -361 2212 -400 ct 2250 -432 2296 -449 2351 -449 ct -2411 -449 2460 -429 2499 -389 ct 2537 -350 2556 -295 2556 -225 ct 2556 -169 2548 -124 2531 -92 ct -2514 -60 2489 -34 2457 -16 ct 2424 0 2389 9 2351 9 ct 2289 9 2239 -9 2201 -49 ct -2164 -88 l 2145 -145 l p -2221 -219 m 2221 -163 2233 -121 2258 -93 ct 2282 -65 2313 -51 2351 -51 ct 2388 -51 2418 -65 2443 -93 ct -2467 -121 2480 -164 2480 -222 ct 2480 -276 2467 -317 2443 -345 ct 2418 -373 2387 -387 2351 -387 ct -2313 -387 2282 -373 2258 -345 ct 2233 -317 l 2221 -275 l p ef -3043 -98 m 3043 -264 l 2878 -264 l 2878 -333 l 3043 -333 l 3043 -498 l -3113 -498 l 3113 -333 l 3278 -333 l 3278 -264 l 3113 -264 l 3113 -98 l -p ef -3407 0 m 3407 -381 l 3341 -381 l 3341 -439 l 3407 -439 l 3407 -485 l -3407 -515 3410 -537 3415 -551 ct 3422 -571 3435 -586 3453 -598 ct 3471 -610 3496 -616 3529 -616 ct -3550 -616 3573 -614 3598 -609 ct 3587 -544 l 3572 -547 3557 -548 3543 -548 ct -3521 -548 3505 -543 3495 -533 ct 3486 -524 3481 -506 3481 -479 ct 3481 -439 l -3567 -439 l 3567 -381 l 3481 -381 l 3481 0 l p ef -3598 -131 m 3671 -142 l 3675 -113 3687 -90 3706 -74 ct 3725 -59 3751 -51 3785 -51 ct -3819 -51 3844 -58 3861 -72 ct 3878 -86 3886 -102 3886 -121 ct 3886 -138 3879 -151 3864 -160 ct -3854 -167 3828 -175 3788 -186 ct 3733 -199 3695 -211 3674 -221 ct 3653 -231 3637 -245 3626 -263 ct -3615 -281 3610 -301 3610 -322 ct 3610 -342 3614 -360 3623 -376 ct 3632 -393 3645 -407 3660 -418 ct -3672 -427 3687 -434 3707 -440 ct 3727 -446 3749 -449 3772 -449 ct 3806 -449 3836 -444 3862 -434 ct -3889 -424 3908 -410 3920 -393 ct 3933 -376 3941 -354 3946 -325 ct 3873 -315 l -3870 -338 3860 -356 3844 -368 ct 3828 -381 3806 -387 3777 -387 ct 3743 -387 3718 -382 3704 -370 ct -3689 -359 3682 -346 3682 -331 ct 3682 -321 3685 -312 3691 -305 ct 3697 -297 3707 -290 3720 -285 ct -3727 -282 3749 -276 3785 -266 ct 3838 -252 3875 -240 3896 -231 ct 3916 -222 3933 -209 3945 -192 ct -3956 -175 3962 -154 3962 -129 ct 3962 -104 3955 -80 3941 -58 ct 3926 -37 3905 -20 3878 -8 ct -3851 3 3820 9 3785 9 ct 3728 9 3685 -1 3655 -25 ct 3625 -49 l 3606 -84 l p ef -3969 10 m 4144 -616 l 4204 -616 l 4028 10 l p ef -4633 -71 m 4633 0 l 4232 0 l 4232 -17 4234 -35 4241 -51 ct 4251 -79 4267 -105 4290 -132 ct -4312 -158 4345 -189 4387 -224 ct 4453 -278 4498 -321 4521 -352 ct 4544 -384 4556 -413 4556 -442 ct -4556 -471 4545 -496 4524 -516 ct 4503 -537 4475 -547 4441 -547 ct 4406 -547 4377 -536 4355 -514 ct -4334 -493 4323 -463 4323 -425 ct 4246 -433 l 4251 -490 4271 -533 4305 -563 ct -4340 -593 4385 -608 4443 -608 ct 4501 -608 4547 -592 4581 -560 ct 4615 -528 4632 -488 4632 -440 ct -4632 -416 4627 -392 4617 -368 ct 4607 -345 4591 -320 4568 -294 ct 4545 -268 4506 -233 4453 -188 ct -4408 -150 4380 -125 4367 -111 ct 4354 -98 4344 -85 4336 -71 ct p ef -pom -gr -10161 16546 m 10011 16996 l 10311 16995 l 10161 16546 l p ef -10161 18381 m 10161 16906 l ps -gs -pum -2805 3466 t -38 -194 m 113 -201 l 117 -171 125 -146 138 -126 ct 151 -107 172 -91 199 -79 ct -227 -67 258 -61 292 -61 ct 323 -61 350 -66 373 -75 ct 397 -84 414 -96 426 -112 ct -437 -128 443 -145 443 -164 ct 443 -183 437 -200 426 -214 ct 415 -228 397 -240 372 -250 ct -355 -256 319 -266 264 -279 ct 208 -293 169 -305 147 -317 ct 118 -332 96 -351 82 -374 ct -68 -396 61 -421 61 -449 ct 61 -480 69 -508 87 -535 ct 104 -561 130 -582 163 -595 ct -196 -609 233 -616 274 -616 ct 319 -616 359 -609 393 -594 ct 427 -580 454 -559 472 -531 ct -491 -502 501 -471 502 -435 ct 425 -429 l 421 -468 407 -496 383 -516 ct 359 -536 324 -545 277 -545 ct -229 -545 194 -537 171 -519 ct 149 -501 138 -480 138 -454 ct 138 -433 146 -415 162 -401 ct -177 -387 217 -372 283 -357 ct 348 -343 393 -330 417 -319 ct 452 -303 478 -282 495 -257 ct -512 -232 520 -203 520 -171 ct 520 -138 511 -108 492 -80 ct 474 -51 447 -29 413 -13 ct -378 2 339 10 296 10 ct 241 10 195 2 158 -13 ct 121 -29 92 -53 71 -85 ct 50 -117 l -39 -154 l p ef -924 -54 m 896 -30 870 -14 844 -4 ct 819 5 791 9 762 9 ct 714 9 677 -1 651 -25 ct -625 -49 612 -79 612 -115 ct 612 -137 617 -156 627 -174 ct 637 -192 649 -206 665 -217 ct -681 -228 699 -236 719 -241 ct 733 -245 755 -249 785 -253 ct 845 -260 889 -268 918 -278 ct -918 -288 918 -295 918 -298 ct 918 -328 911 -349 897 -362 ct 878 -379 850 -387 812 -387 ct -777 -387 751 -381 735 -369 ct 718 -356 706 -335 698 -303 ct 625 -313 l 632 -345 642 -370 658 -389 ct -673 -408 695 -423 723 -433 ct 752 -443 785 -449 823 -449 ct 861 -449 891 -444 914 -435 ct -938 -427 955 -415 966 -402 ct 977 -389 985 -372 989 -351 ct 992 -339 993 -316 993 -283 ct -993 -184 l 993 -114 995 -71 998 -52 ct 1001 -34 1007 -16 1017 0 ct 939 0 l -931 -15 l 926 -33 l p -918 -220 m 891 -209 850 -200 796 -192 ct 766 -187 744 -182 731 -177 ct 719 -171 709 -163 702 -153 ct -695 -142 692 -130 692 -117 ct 692 -98 699 -81 714 -68 ct 729 -55 751 -48 780 -48 ct -809 -48 834 -54 857 -67 ct 879 -79 895 -96 906 -118 ct 914 -135 918 -160 918 -193 ct -p ef -1087 0 m 1087 -439 l 1154 -439 l 1154 -377 l 1168 -399 1186 -416 1209 -429 ct -1232 -442 1258 -449 1287 -449 ct 1320 -449 1346 -442 1367 -428 ct 1388 -415 1403 -396 1411 -372 ct -1446 -423 1491 -449 1547 -449 ct 1590 -449 1624 -437 1647 -412 ct 1671 -388 1682 -351 1682 -301 ct -1682 0 l 1608 0 l 1608 -276 l 1608 -306 1606 -327 1601 -340 ct 1596 -354 1588 -364 1575 -372 ct -1562 -380 1547 -384 1530 -384 ct 1499 -384 1474 -374 1453 -353 ct 1433 -333 1423 -300 1423 -255 ct -1423 0 l 1348 0 l 1348 -285 l 1348 -318 1342 -343 1330 -359 ct 1318 -376 1298 -384 1271 -384 ct -1250 -384 1230 -379 1212 -368 ct 1195 -357 1182 -340 1174 -319 ct 1166 -298 1162 -267 1162 -227 ct -1162 0 l p ef -1801 168 m 1801 -439 l 1869 -439 l 1869 -382 l 1885 -404 1903 -421 1923 -432 ct -1943 -443 1968 -449 1997 -449 ct 2034 -449 2067 -439 2096 -420 ct 2124 -400 2146 -373 2161 -338 ct -2175 -303 2183 -264 2183 -222 ct 2183 -177 2175 -137 2158 -101 ct 2142 -65 2119 -37 2088 -18 ct -2057 0 2025 9 1991 9 ct 1966 9 1944 4 1924 -5 ct 1905 -16 1888 -29 1876 -45 ct -1876 168 l p -1869 -217 m 1869 -160 1880 -118 1903 -91 ct 1926 -64 1954 -51 1986 -51 ct 2019 -51 2048 -65 2071 -93 ct -2095 -121 2107 -164 2107 -223 ct 2107 -279 2095 -321 2072 -349 ct 2049 -376 2022 -390 1990 -390 ct -1958 -390 1930 -376 1905 -346 ct 1881 -316 l 1869 -273 l p ef -2250 0 m 2250 -606 l 2324 -606 l 2324 0 l p ef -2437 -520 m 2437 -606 l 2511 -606 l 2511 -520 l p -2437 0 m 2437 -439 l 2511 -439 l 2511 0 l p ef -2621 0 m 2621 -439 l 2688 -439 l 2688 -376 l 2721 -425 2767 -449 2828 -449 ct -2855 -449 2879 -444 2901 -434 ct 2923 -425 2940 -412 2951 -397 ct 2962 -382 2970 -363 2974 -342 ct -2977 -328 2978 -304 2978 -270 ct 2978 0 l 2904 0 l 2904 -267 l 2904 -297 2901 -320 2895 -335 ct -2889 -350 2879 -362 2864 -371 ct 2850 -380 2832 -384 2812 -384 ct 2781 -384 2753 -374 2730 -354 ct -2707 -334 2696 -296 2696 -239 ct 2696 0 l p ef -3085 36 m 3157 47 l 3160 69 3169 85 3182 95 ct 3201 109 3226 116 3258 116 ct -3292 116 3319 109 3338 95 ct 3357 82 3369 62 3376 38 ct 3380 22 3381 -8 3381 -57 ct -3349 -19 3308 0 3260 0 ct 3199 0 3153 -21 3119 -65 ct 3086 -108 3070 -161 3070 -222 ct -3070 -264 3077 -302 3093 -338 ct 3108 -373 3130 -400 3159 -420 ct 3187 -439 3221 -449 3260 -449 ct -3312 -449 3355 -428 3388 -386 ct 3388 -439 l 3457 -439 l 3457 -59 l 3457 8 3450 57 3436 85 ct -3422 114 3400 136 3370 153 ct 3340 169 3303 178 3258 178 ct 3206 178 3164 166 3131 142 ct -3099 119 l 3084 83 l p -3146 -227 m 3146 -169 3158 -127 3181 -101 ct 3204 -74 3232 -61 3267 -61 ct -3301 -61 3330 -74 3353 -101 ct 3376 -127 3387 -168 3387 -224 ct 3387 -278 3376 -319 3352 -346 ct -3328 -373 3299 -387 3265 -387 ct 3232 -387 3204 -374 3181 -347 ct 3158 -320 l -3146 -280 l p ef -3812 0 m 3812 -439 l 3879 -439 l 3879 -372 l 3896 -403 3911 -424 3926 -434 ct -3940 -444 3956 -449 3974 -449 ct 3999 -449 4024 -441 4050 -425 ct 4025 -356 l -4006 -366 3988 -372 3970 -372 ct 3954 -372 3939 -367 3926 -357 ct 3913 -347 3904 -334 3898 -316 ct -3890 -290 3886 -261 3886 -229 ct 3886 0 l p ef -4390 -54 m 4362 -30 4336 -14 4310 -4 ct 4285 5 4257 9 4228 9 ct 4180 9 4143 -1 4117 -25 ct -4091 -49 4078 -79 4078 -115 ct 4078 -137 4083 -156 4093 -174 ct 4103 -192 4115 -206 4131 -217 ct -4147 -228 4165 -236 4185 -241 ct 4199 -245 4221 -249 4251 -253 ct 4311 -260 4355 -268 4384 -278 ct -4384 -288 4384 -295 4384 -298 ct 4384 -328 4377 -349 4363 -362 ct 4344 -379 4316 -387 4278 -387 ct -4243 -387 4217 -381 4201 -369 ct 4184 -356 4172 -335 4164 -303 ct 4091 -313 l -4098 -345 4108 -370 4124 -389 ct 4139 -408 4161 -423 4189 -433 ct 4218 -443 4251 -449 4289 -449 ct -4327 -449 4357 -444 4380 -435 ct 4404 -427 4421 -415 4432 -402 ct 4443 -389 4451 -372 4455 -351 ct -4458 -339 4459 -316 4459 -283 ct 4459 -184 l 4459 -114 4461 -71 4464 -52 ct -4467 -34 4473 -16 4483 0 ct 4405 0 l 4397 -15 l 4392 -33 l p -4384 -220 m 4357 -209 4316 -200 4262 -192 ct 4232 -187 4210 -182 4197 -177 ct -4185 -171 4175 -163 4168 -153 ct 4161 -142 4158 -130 4158 -117 ct 4158 -98 4165 -81 4180 -68 ct -4195 -55 4217 -48 4246 -48 ct 4275 -48 4300 -54 4323 -67 ct 4345 -79 4361 -96 4372 -118 ct -4380 -135 4384 -160 4384 -193 ct p ef -4716 -66 m 4727 0 l 4706 3 4687 5 4670 5 ct 4643 5 4622 1 4608 -7 ct 4593 -15 4582 -26 4576 -40 ct -4570 -54 4567 -83 4567 -128 ct 4567 -381 l 4512 -381 l 4512 -439 l 4567 -439 l -4567 -547 l 4641 -592 l 4641 -439 l 4716 -439 l 4716 -381 l 4641 -381 l -4641 -124 l 4641 -103 4642 -89 4645 -83 ct 4648 -77 4652 -72 4658 -69 ct 4664 -65 4672 -63 4683 -63 ct -4691 -63 l 4702 -64 l p ef -5092 -141 m 5169 -131 l 5157 -86 5134 -52 5102 -27 ct 5069 -2 5027 9 4976 9 ct -4912 9 4861 -9 4823 -49 ct 4785 -88 4767 -144 4767 -215 ct 4767 -289 4786 -347 4824 -387 ct -4862 -428 4911 -449 4972 -449 ct 5030 -449 5078 -429 5116 -389 ct 5153 -349 5171 -292 5171 -220 ct -5171 -216 5171 -209 5171 -200 ct 4843 -200 l 4846 -152 4860 -115 4884 -89 ct -4909 -64 4940 -51 4976 -51 ct 5004 -51 5027 -58 5046 -72 ct 5065 -87 l 5081 -110 l -p -4848 -261 m 5093 -261 l 5090 -298 5080 -326 5065 -344 ct 5041 -373 5010 -387 4972 -387 ct -4938 -387 4910 -376 4886 -353 ct 4863 -330 l 4850 -300 l p ef -5897 -356 m 5497 -356 l 5497 -425 l 5897 -425 l p -5897 -172 m 5497 -172 l 5497 -241 l 5897 -241 l p ef -6264 0 m 6264 -381 l 6198 -381 l 6198 -439 l 6264 -439 l 6264 -485 l -6264 -515 6267 -537 6272 -551 ct 6279 -571 6292 -586 6310 -598 ct 6328 -610 6353 -616 6386 -616 ct -6407 -616 6430 -614 6455 -609 ct 6444 -544 l 6429 -547 6414 -548 6400 -548 ct -6378 -548 6362 -543 6352 -533 ct 6343 -524 6338 -506 6338 -479 ct 6338 -439 l -6424 -439 l 6424 -381 l 6338 -381 l 6338 0 l p ef -6455 -131 m 6528 -142 l 6532 -113 6544 -90 6563 -74 ct 6582 -59 6608 -51 6642 -51 ct -6676 -51 6701 -58 6718 -72 ct 6735 -86 6743 -102 6743 -121 ct 6743 -138 6736 -151 6721 -160 ct -6711 -167 6685 -175 6645 -186 ct 6590 -199 6552 -211 6531 -221 ct 6510 -231 6494 -245 6483 -263 ct -6472 -281 6467 -301 6467 -322 ct 6467 -342 6471 -360 6480 -376 ct 6489 -393 6502 -407 6517 -418 ct -6529 -427 6544 -434 6564 -440 ct 6584 -446 6606 -449 6629 -449 ct 6663 -449 6693 -444 6719 -434 ct -6746 -424 6765 -410 6777 -393 ct 6790 -376 6798 -354 6803 -325 ct 6730 -315 l -6727 -338 6717 -356 6701 -368 ct 6685 -381 6663 -387 6634 -387 ct 6600 -387 6575 -382 6561 -370 ct -6546 -359 6539 -346 6539 -331 ct 6539 -321 6542 -312 6548 -305 ct 6554 -297 6564 -290 6577 -285 ct -6584 -282 6606 -276 6642 -266 ct 6695 -252 6732 -240 6753 -231 ct 6773 -222 6790 -209 6802 -192 ct -6813 -175 6819 -154 6819 -129 ct 6819 -104 6812 -80 6798 -58 ct 6783 -37 6762 -20 6735 -8 ct -6708 3 6677 9 6642 9 ct 6585 9 6542 -1 6512 -25 ct 6482 -49 l 6463 -84 l p ef -pom -gr -gs -pum -15981 14102 t -62 0 m 62 -606 l 289 -606 l 335 -606 372 -600 400 -587 ct 428 -575 450 -556 466 -531 ct -482 -505 490 -479 490 -451 ct 490 -425 483 -400 469 -378 ct 455 -355 434 -336 405 -322 ct -442 -311 470 -293 490 -267 ct 510 -241 519 -211 519 -175 ct 519 -147 513 -120 501 -96 ct -489 -72 475 -53 457 -40 ct 439 -26 417 -16 391 -10 ct 364 -3 331 0 293 0 ct p -142 -351 m 273 -351 l 308 -351 334 -353 349 -358 ct 370 -364 385 -374 395 -388 ct -406 -402 411 -420 411 -441 ct 411 -461 406 -479 397 -494 ct 387 -510 373 -520 355 -526 ct -337 -531 307 -534 263 -534 ct 142 -534 l p -142 -71 m 293 -71 l 319 -71 337 -72 347 -74 ct 366 -77 381 -83 394 -90 ct -406 -98 416 -109 424 -124 ct 432 -139 436 -156 436 -175 ct 436 -198 430 -218 419 -234 ct -407 -251 391 -263 371 -269 ct 350 -276 321 -279 282 -279 ct 142 -279 l p ef -898 -54 m 870 -30 844 -14 818 -4 ct 793 5 765 9 736 9 ct 688 9 651 -1 625 -25 ct -599 -49 586 -79 586 -115 ct 586 -137 591 -156 601 -174 ct 611 -192 623 -206 639 -217 ct -655 -228 673 -236 693 -241 ct 707 -245 729 -249 759 -253 ct 819 -260 863 -268 892 -278 ct -892 -288 892 -295 892 -298 ct 892 -328 885 -349 871 -362 ct 852 -379 824 -387 786 -387 ct -751 -387 725 -381 709 -369 ct 692 -356 680 -335 672 -303 ct 599 -313 l 606 -345 616 -370 632 -389 ct -647 -408 669 -423 697 -433 ct 726 -443 759 -449 797 -449 ct 835 -449 865 -444 888 -435 ct -912 -427 929 -415 940 -402 ct 951 -389 959 -372 963 -351 ct 966 -339 967 -316 967 -283 ct -967 -184 l 967 -114 969 -71 972 -52 ct 975 -34 981 -16 991 0 ct 913 0 l 905 -15 l -900 -33 l p -892 -220 m 865 -209 824 -200 770 -192 ct 740 -187 718 -182 705 -177 ct 693 -171 683 -163 676 -153 ct -669 -142 666 -130 666 -117 ct 666 -98 673 -81 688 -68 ct 703 -55 725 -48 754 -48 ct -783 -48 808 -54 831 -67 ct 853 -79 869 -96 880 -118 ct 888 -135 892 -160 892 -193 ct -p ef -1060 0 m 1060 -439 l 1127 -439 l 1127 -376 l 1160 -425 1206 -449 1267 -449 ct -1294 -449 1318 -444 1340 -434 ct 1362 -425 1379 -412 1390 -397 ct 1401 -382 1409 -363 1413 -342 ct -1416 -328 1417 -304 1417 -270 ct 1417 0 l 1343 0 l 1343 -267 l 1343 -297 1340 -320 1334 -335 ct -1328 -350 1318 -362 1303 -371 ct 1289 -380 1271 -384 1251 -384 ct 1220 -384 1192 -374 1169 -354 ct -1146 -334 1135 -296 1135 -239 ct 1135 0 l p ef -1822 0 m 1822 -55 l 1794 -11 1754 9 1699 9 ct 1664 9 1632 0 1603 -19 ct 1574 -38 1551 -65 1535 -99 ct -1519 -134 1510 -174 1510 -219 ct 1510 -263 1518 -302 1532 -338 ct 1547 -374 1569 -401 1598 -420 ct -1627 -439 1660 -449 1696 -449 ct 1723 -449 1746 -443 1767 -432 ct 1788 -421 1804 -406 1817 -388 ct -1817 -606 l 1891 -606 l 1891 0 l p -1587 -219 m 1587 -162 1599 -120 1623 -93 ct 1646 -65 1674 -51 1706 -51 ct 1739 -51 1767 -64 1789 -91 ct -1812 -117 1824 -158 1824 -212 ct 1824 -273 1812 -317 1789 -345 ct 1766 -373 1737 -387 1703 -387 ct -1670 -387 1642 -374 1620 -346 ct 1598 -319 l 1587 -277 l p ef -2094 0 m 1960 -439 l 2037 -439 l 2107 -185 l 2133 -91 l 2134 -96 2142 -126 2156 -181 ct -2226 -439 l 2302 -439 l 2368 -184 l 2390 -100 l 2415 -185 l 2490 -439 l -2563 -439 l 2425 0 l 2348 0 l 2278 -263 l 2261 -337 l 2172 0 l p ef -2596 -520 m 2596 -606 l 2670 -606 l 2670 -520 l p -2596 0 m 2596 -439 l 2670 -439 l 2670 0 l p ef -3065 0 m 3065 -55 l 3037 -11 2997 9 2942 9 ct 2907 9 2875 0 2846 -19 ct 2817 -38 2794 -65 2778 -99 ct -2762 -134 2753 -174 2753 -219 ct 2753 -263 2761 -302 2775 -338 ct 2790 -374 2812 -401 2841 -420 ct -2870 -439 2903 -449 2939 -449 ct 2966 -449 2989 -443 3010 -432 ct 3031 -421 3047 -406 3060 -388 ct -3060 -606 l 3134 -606 l 3134 0 l p -2830 -219 m 2830 -162 2842 -120 2866 -93 ct 2889 -65 2917 -51 2949 -51 ct 2982 -51 3010 -64 3032 -91 ct -3055 -117 3067 -158 3067 -212 ct 3067 -273 3055 -317 3032 -345 ct 3009 -373 2980 -387 2946 -387 ct -2913 -387 2885 -374 2863 -346 ct 2841 -319 l 2830 -277 l p ef -3419 -66 m 3430 0 l 3409 3 3390 5 3373 5 ct 3346 5 3325 1 3311 -7 ct 3296 -15 3285 -26 3279 -40 ct -3273 -54 3270 -83 3270 -128 ct 3270 -381 l 3215 -381 l 3215 -439 l 3270 -439 l -3270 -547 l 3344 -592 l 3344 -439 l 3419 -439 l 3419 -381 l 3344 -381 l -3344 -124 l 3344 -103 3345 -89 3348 -83 ct 3351 -77 3355 -72 3361 -69 ct 3367 -65 3375 -63 3386 -63 ct -3394 -63 l 3405 -64 l p ef -3495 0 m 3495 -606 l 3570 -606 l 3570 -388 l 3605 -429 3648 -449 3701 -449 ct -3734 -449 3762 -442 3786 -429 ct 3810 -417 3827 -399 3838 -376 ct 3848 -354 3853 -321 3853 -278 ct -3853 0 l 3779 0 l 3779 -278 l 3779 -315 3771 -342 3754 -359 ct 3738 -376 3716 -385 3686 -385 ct -3664 -385 3643 -379 3624 -367 ct 3604 -356 3590 -340 3582 -321 ct 3574 -301 3570 -274 3570 -240 ct -3570 0 l p ef -pom -pum -15888 15055 t -340 0 m 340 -55 l 312 -11 272 9 217 9 ct 182 9 150 0 121 -19 ct 92 -38 69 -65 53 -99 ct -37 -134 28 -174 28 -219 ct 28 -263 36 -302 50 -338 ct 65 -374 87 -401 116 -420 ct -145 -439 178 -449 214 -449 ct 241 -449 264 -443 285 -432 ct 306 -421 322 -406 335 -388 ct -335 -606 l 409 -606 l 409 0 l p -105 -219 m 105 -162 117 -120 141 -93 ct 164 -65 192 -51 224 -51 ct 257 -51 285 -64 307 -91 ct -330 -117 342 -158 342 -212 ct 342 -273 330 -317 307 -345 ct 284 -373 255 -387 221 -387 ct -188 -387 160 -374 138 -346 ct 116 -319 l 105 -277 l p ef -832 -141 m 909 -131 l 897 -86 874 -52 842 -27 ct 809 -2 767 9 716 9 ct 652 9 601 -9 563 -49 ct -525 -88 507 -144 507 -215 ct 507 -289 526 -347 564 -387 ct 602 -428 651 -449 712 -449 ct -770 -449 818 -429 856 -389 ct 893 -349 911 -292 911 -220 ct 911 -216 911 -209 911 -200 ct -583 -200 l 586 -152 600 -115 624 -89 ct 649 -64 680 -51 716 -51 ct 744 -51 767 -58 786 -72 ct -805 -87 l 821 -110 l p -588 -261 m 833 -261 l 830 -298 820 -326 805 -344 ct 781 -373 750 -387 712 -387 ct -678 -387 650 -376 626 -353 ct 603 -330 l 590 -300 l p ef -1295 -160 m 1368 -151 l 1360 -100 1340 -61 1307 -32 ct 1274 -4 1233 9 1185 9 ct -1125 9 1077 -9 1040 -49 ct 1004 -88 986 -144 986 -217 ct 986 -265 993 -306 1009 -342 ct -1025 -378 1049 -404 1081 -422 ct 1113 -440 1148 -449 1186 -449 ct 1233 -449 1272 -437 1303 -412 ct -1333 -388 1353 -354 1361 -310 ct 1289 -299 l 1282 -328 1270 -350 1252 -365 ct -1235 -380 1213 -387 1189 -387 ct 1151 -387 1121 -374 1097 -347 ct 1074 -320 1062 -278 1062 -220 ct -1062 -161 1073 -118 1096 -91 ct 1119 -64 1148 -51 1185 -51 ct 1214 -51 1238 -60 1258 -78 ct -1277 -96 l 1290 -123 l p ef -1432 -520 m 1432 -606 l 1506 -606 l 1506 -520 l p -1432 0 m 1432 -439 l 1506 -439 l 1506 0 l p ef -1616 0 m 1616 -439 l 1683 -439 l 1683 -377 l 1697 -399 1715 -416 1738 -429 ct -1761 -442 1787 -449 1816 -449 ct 1849 -449 1875 -442 1896 -428 ct 1917 -415 1932 -396 1940 -372 ct -1975 -423 2020 -449 2076 -449 ct 2119 -449 2153 -437 2176 -412 ct 2200 -388 2211 -351 2211 -301 ct -2211 0 l 2137 0 l 2137 -276 l 2137 -306 2135 -327 2130 -340 ct 2125 -354 2117 -364 2104 -372 ct -2091 -380 2076 -384 2059 -384 ct 2028 -384 2003 -374 1982 -353 ct 1962 -333 1952 -300 1952 -255 ct -1952 0 l 1877 0 l 1877 -285 l 1877 -318 1871 -343 1859 -359 ct 1847 -376 1827 -384 1800 -384 ct -1779 -384 1759 -379 1741 -368 ct 1724 -357 1711 -340 1703 -319 ct 1695 -298 1691 -267 1691 -227 ct -1691 0 l p ef -2617 -54 m 2589 -30 2563 -14 2537 -4 ct 2512 5 2484 9 2455 9 ct 2407 9 2370 -1 2344 -25 ct -2318 -49 2305 -79 2305 -115 ct 2305 -137 2310 -156 2320 -174 ct 2330 -192 2342 -206 2358 -217 ct -2374 -228 2392 -236 2412 -241 ct 2426 -245 2448 -249 2478 -253 ct 2538 -260 2582 -268 2611 -278 ct -2611 -288 2611 -295 2611 -298 ct 2611 -328 2604 -349 2590 -362 ct 2571 -379 2543 -387 2505 -387 ct -2470 -387 2444 -381 2428 -369 ct 2411 -356 2399 -335 2391 -303 ct 2318 -313 l -2325 -345 2335 -370 2351 -389 ct 2366 -408 2388 -423 2416 -433 ct 2445 -443 2478 -449 2516 -449 ct -2554 -449 2584 -444 2607 -435 ct 2631 -427 2648 -415 2659 -402 ct 2670 -389 2678 -372 2682 -351 ct -2685 -339 2686 -316 2686 -283 ct 2686 -184 l 2686 -114 2688 -71 2691 -52 ct -2694 -34 2700 -16 2710 0 ct 2632 0 l 2624 -15 l 2619 -33 l p -2611 -220 m 2584 -209 2543 -200 2489 -192 ct 2459 -187 2437 -182 2424 -177 ct -2412 -171 2402 -163 2395 -153 ct 2388 -142 2385 -130 2385 -117 ct 2385 -98 2392 -81 2407 -68 ct -2422 -55 2444 -48 2473 -48 ct 2502 -48 2527 -54 2550 -67 ct 2572 -79 2588 -96 2599 -118 ct -2607 -135 2611 -160 2611 -193 ct p ef -2943 -66 m 2954 0 l 2933 3 2914 5 2897 5 ct 2870 5 2849 1 2835 -7 ct 2820 -15 2809 -26 2803 -40 ct -2797 -54 2794 -83 2794 -128 ct 2794 -381 l 2739 -381 l 2739 -439 l 2794 -439 l -2794 -547 l 2868 -592 l 2868 -439 l 2943 -439 l 2943 -381 l 2868 -381 l -2868 -124 l 2868 -103 2869 -89 2872 -83 ct 2875 -77 2879 -72 2885 -69 ct 2891 -65 2899 -63 2910 -63 ct -2918 -63 l 2929 -64 l p ef -3019 -520 m 3019 -606 l 3093 -606 l 3093 -520 l p -3019 0 m 3019 -439 l 3093 -439 l 3093 0 l p ef -3177 -219 m 3177 -300 3199 -361 3244 -400 ct 3282 -432 3328 -449 3383 -449 ct -3443 -449 3492 -429 3531 -389 ct 3569 -350 3588 -295 3588 -225 ct 3588 -169 3580 -124 3563 -92 ct -3546 -60 3521 -34 3489 -16 ct 3456 0 3421 9 3383 9 ct 3321 9 3271 -9 3233 -49 ct -3196 -88 l 3177 -145 l p -3253 -219 m 3253 -163 3265 -121 3290 -93 ct 3314 -65 3345 -51 3383 -51 ct 3420 -51 3450 -65 3475 -93 ct -3499 -121 3512 -164 3512 -222 ct 3512 -276 3499 -317 3475 -345 ct 3450 -373 3419 -387 3383 -387 ct -3345 -387 3314 -373 3290 -345 ct 3265 -317 l 3253 -275 l p ef -3680 0 m 3680 -439 l 3747 -439 l 3747 -376 l 3780 -425 3826 -449 3887 -449 ct -3914 -449 3938 -444 3960 -434 ct 3982 -425 3999 -412 4010 -397 ct 4021 -382 4029 -363 4033 -342 ct -4036 -328 4037 -304 4037 -270 ct 4037 0 l 3963 0 l 3963 -267 l 3963 -297 3960 -320 3954 -335 ct -3948 -350 3938 -362 3923 -371 ct 3909 -380 3891 -384 3871 -384 ct 3840 -384 3812 -374 3789 -354 ct -3766 -334 3755 -296 3755 -239 ct 3755 0 l p ef -pom -pum -16087 16008 t -73 0 m 73 -381 l 7 -381 l 7 -439 l 73 -439 l 73 -485 l 73 -515 76 -537 81 -551 ct -88 -571 101 -586 119 -598 ct 137 -610 162 -616 195 -616 ct 216 -616 239 -614 264 -609 ct -253 -544 l 238 -547 223 -548 209 -548 ct 187 -548 171 -543 161 -533 ct 152 -524 147 -506 147 -479 ct -147 -439 l 233 -439 l 233 -381 l 147 -381 l 147 0 l p ef -580 -54 m 552 -30 526 -14 500 -4 ct 475 5 447 9 418 9 ct 370 9 333 -1 307 -25 ct -281 -49 268 -79 268 -115 ct 268 -137 273 -156 283 -174 ct 293 -192 305 -206 321 -217 ct -337 -228 355 -236 375 -241 ct 389 -245 411 -249 441 -253 ct 501 -260 545 -268 574 -278 ct -574 -288 574 -295 574 -298 ct 574 -328 567 -349 553 -362 ct 534 -379 506 -387 468 -387 ct -433 -387 407 -381 391 -369 ct 374 -356 362 -335 354 -303 ct 281 -313 l 288 -345 298 -370 314 -389 ct -329 -408 351 -423 379 -433 ct 408 -443 441 -449 479 -449 ct 517 -449 547 -444 570 -435 ct -594 -427 611 -415 622 -402 ct 633 -389 641 -372 645 -351 ct 648 -339 649 -316 649 -283 ct -649 -184 l 649 -114 651 -71 654 -52 ct 657 -34 663 -16 673 0 ct 595 0 l 587 -15 l -582 -33 l p -574 -220 m 547 -209 506 -200 452 -192 ct 422 -187 400 -182 387 -177 ct 375 -171 365 -163 358 -153 ct -351 -142 348 -130 348 -117 ct 348 -98 355 -81 370 -68 ct 385 -55 407 -48 436 -48 ct -465 -48 490 -54 513 -67 ct 535 -79 551 -96 562 -118 ct 570 -135 574 -160 574 -193 ct -p ef -1030 -160 m 1103 -151 l 1095 -100 1075 -61 1042 -32 ct 1009 -4 968 9 920 9 ct -860 9 812 -9 775 -49 ct 739 -88 721 -144 721 -217 ct 721 -265 728 -306 744 -342 ct -760 -378 784 -404 816 -422 ct 848 -440 883 -449 921 -449 ct 968 -449 1007 -437 1038 -412 ct -1068 -388 1088 -354 1096 -310 ct 1024 -299 l 1017 -328 1005 -350 987 -365 ct -970 -380 948 -387 924 -387 ct 886 -387 856 -374 832 -347 ct 809 -320 797 -278 797 -220 ct -797 -161 808 -118 831 -91 ct 854 -64 883 -51 920 -51 ct 949 -51 973 -60 993 -78 ct -1012 -96 l 1025 -123 l p ef -1329 -66 m 1340 0 l 1319 3 1300 5 1283 5 ct 1256 5 1235 1 1221 -7 ct 1206 -15 1195 -26 1189 -40 ct -1183 -54 1180 -83 1180 -128 ct 1180 -381 l 1125 -381 l 1125 -439 l 1180 -439 l -1180 -547 l 1254 -592 l 1254 -439 l 1329 -439 l 1329 -381 l 1254 -381 l -1254 -124 l 1254 -103 1255 -89 1258 -83 ct 1261 -77 1265 -72 1271 -69 ct 1277 -65 1285 -63 1296 -63 ct -1304 -63 l 1315 -64 l p ef -1377 -219 m 1377 -300 1399 -361 1444 -400 ct 1482 -432 1528 -449 1583 -449 ct -1643 -449 1692 -429 1731 -389 ct 1769 -350 1788 -295 1788 -225 ct 1788 -169 1780 -124 1763 -92 ct -1746 -60 1721 -34 1689 -16 ct 1656 0 1621 9 1583 9 ct 1521 9 1471 -9 1433 -49 ct -1396 -88 l 1377 -145 l p -1453 -219 m 1453 -163 1465 -121 1490 -93 ct 1514 -65 1545 -51 1583 -51 ct 1620 -51 1650 -65 1675 -93 ct -1699 -121 1712 -164 1712 -222 ct 1712 -276 1699 -317 1675 -345 ct 1650 -373 1619 -387 1583 -387 ct -1545 -387 1514 -373 1490 -345 ct 1465 -317 l 1453 -275 l p ef -1881 0 m 1881 -439 l 1948 -439 l 1948 -372 l 1965 -403 1980 -424 1995 -434 ct -2009 -444 2025 -449 2043 -449 ct 2068 -449 2093 -441 2119 -425 ct 2094 -356 l -2075 -366 2057 -372 2039 -372 ct 2023 -372 2008 -367 1995 -357 ct 1982 -347 1973 -334 1967 -316 ct -1959 -290 1955 -261 1955 -229 ct 1955 0 l p ef -2802 -356 m 2402 -356 l 2402 -425 l 2802 -425 l p -2802 -172 m 2402 -172 l 2402 -241 l 2802 -241 l p ef -3160 0 m 3160 -606 l 3242 -606 l 3561 -130 l 3561 -606 l 3638 -606 l -3638 0 l 3555 0 l 3237 -476 l 3237 0 l p ef -pom -gr -17781 10461 m 17631 10911 l 17931 10910 l 17781 10461 l p ef -17781 13336 m 17781 10821 l ps -gs -pum -17357 3466 t -73 0 m 73 -381 l 7 -381 l 7 -439 l 73 -439 l 73 -485 l 73 -515 76 -537 81 -551 ct -88 -571 101 -586 119 -598 ct 137 -610 162 -616 195 -616 ct 216 -616 239 -614 264 -609 ct -253 -544 l 238 -547 223 -548 209 -548 ct 187 -548 171 -543 161 -533 ct 152 -524 147 -506 147 -479 ct -147 -439 l 233 -439 l 233 -381 l 147 -381 l 147 0 l p ef -264 -131 m 337 -142 l 341 -113 353 -90 372 -74 ct 391 -59 417 -51 451 -51 ct -485 -51 510 -58 527 -72 ct 544 -86 552 -102 552 -121 ct 552 -138 545 -151 530 -160 ct -520 -167 494 -175 454 -186 ct 399 -199 361 -211 340 -221 ct 319 -231 303 -245 292 -263 ct -281 -281 276 -301 276 -322 ct 276 -342 280 -360 289 -376 ct 298 -393 311 -407 326 -418 ct -338 -427 353 -434 373 -440 ct 393 -446 415 -449 438 -449 ct 472 -449 502 -444 528 -434 ct -555 -424 574 -410 586 -393 ct 599 -376 607 -354 612 -325 ct 539 -315 l 536 -338 526 -356 510 -368 ct -494 -381 472 -387 443 -387 ct 409 -387 384 -382 370 -370 ct 355 -359 348 -346 348 -331 ct -348 -321 351 -312 357 -305 ct 363 -297 373 -290 386 -285 ct 393 -282 415 -276 451 -266 ct -504 -252 541 -240 562 -231 ct 582 -222 599 -209 611 -192 ct 622 -175 628 -154 628 -129 ct -628 -104 621 -80 607 -58 ct 592 -37 571 -20 544 -8 ct 517 3 486 9 451 9 ct 394 9 351 -1 321 -25 ct -291 -49 l 272 -84 l p ef -635 10 m 810 -616 l 870 -616 l 694 10 l p ef -937 0 m 937 -606 l 1019 -606 l 1338 -130 l 1338 -606 l 1415 -606 l -1415 0 l 1332 0 l 1014 -476 l 1014 0 l p ef -pom -gr -22227 6350 m 22199 5876 l 21920 5987 l 22227 6350 l p ef -19422 3175 m 19475 3175 l ps -19528 3175 m 19581 3175 l ps -19634 3175 m 19687 3175 l ps -19740 3175 m 19793 3175 l ps -19846 3175 m 19899 3175 l ps -19952 3175 m 20006 3175 l ps -20059 3175 m 20112 3175 l ps -20165 3175 m 20218 3175 l ps -20271 3175 m 20324 3175 l ps -20377 3175 m 20430 3175 l ps -20483 3175 m 20536 3175 l ps -20590 3175 m 20643 3175 l ps -20696 3175 m 20749 3175 l ps -20802 3175 m 20855 3175 l ps -20908 3175 m 20956 3175 l ps -20956 3175 m 20958 3180 l ps -20977 3229 m 20997 3278 l ps -21017 3328 m 21037 3377 l ps -21056 3426 m 21076 3475 l ps -21096 3525 m 21115 3574 l ps -21135 3623 m 21155 3673 l ps -21175 3722 m 21194 3771 l ps -21214 3821 m 21234 3870 l ps -21254 3919 m 21273 3968 l ps -21293 4018 m 21313 4067 l ps -21332 4116 m 21352 4166 l ps -21372 4215 m 21392 4264 l ps -21411 4313 m 21431 4363 l ps -21451 4412 m 21471 4461 l ps -21490 4511 m 21510 4560 l ps -21530 4609 m 21550 4658 l ps -21569 4708 m 21589 4757 l ps -21609 4806 m 21628 4856 l ps -21648 4905 m 21668 4954 l ps -21688 5003 m 21707 5053 l ps -21727 5102 m 21747 5151 l ps -21767 5201 m 21786 5250 l ps -21806 5299 m 21826 5348 l ps -21845 5398 m 21865 5447 l ps -21885 5496 m 21905 5546 l ps -21924 5595 m 21944 5644 l ps -21964 5693 m 21984 5743 l ps -22003 5792 m 22023 5841 l ps -22043 5891 m 22063 5940 l ps -22082 5989 m 22093 6015 l ps -gr -0 20290 t -pom -count op_count sub {pop} repeat countdictstack dict_count sub {end} repeat b4_inc_state restore -%%PageTrailer -%%Trailer -%%EOF diff --git a/usrp/doc/ddc.png b/usrp/doc/ddc.png Binary files differdeleted file mode 100644 index ce35bc2a9..000000000 --- a/usrp/doc/ddc.png +++ /dev/null diff --git a/usrp/doc/inband-signaling-gigethernet b/usrp/doc/inband-signaling-gigethernet deleted file mode 100644 index 4ca7542d2..000000000 --- a/usrp/doc/inband-signaling-gigethernet +++ /dev/null @@ -1,34 +0,0 @@ -Gigabit Ethernet Interconnect for the USRP2 - -At this point, this is a place to summarize design requirements, -possible solutions, point-counterpoint, etc. - - -Requirements: - -(R1) High throughput and low latency between USRP h/w and user-space. -One of the primary reasons for switching from USB to gigabit ethernet -is to increase throughput. Many users want to be be able to build -WLAN type systems, and are thwarted by the relatively low throughput -available over the USB. Eric thinks we should shoot for at least -100MB/s full-duplex into user space, using packets with payloads on -the order of 256 to 512 bytes. The small packet size is to reduce the -latency. This is important for many MACs that people want to build on -the host side. - -(R2) Non-priviledged user programs should be able to access the USRP. -This could be implemented by a priviledged daemon that actually handles the -low level communication with the USRP2. This daemon may be desirable -for other reasons, including central point of control for -arbitrating/muxing/demuxing between multiple concurrent users (e.g., -Tx, Rx, requests, replies, various logical channels). - -(R3) Some way to flow control the host to USRP2 stream. This is -required in case the user connects an unthrottled signal generator to -the USRP. (This is not uncommon.) The USRP2 to host direction -shouldn't be a problem, since the USRP2 throughput is controlled by -its configuration. It is an error to configure the USRP2 to transmit -data at a higher rate than the transport or host can consume. - -One solution to this requirement could be having the USRP2 emit GigE -"pause" frames. We'll need to confirm that this works. diff --git a/usrp/doc/inband-signaling-usb b/usrp/doc/inband-signaling-usb deleted file mode 100644 index 14f83479a..000000000 --- a/usrp/doc/inband-signaling-usb +++ /dev/null @@ -1,314 +0,0 @@ -This file specifies the format of USB packets used for in-band data -transmission and signaling on the USRP. All packets are 512-byte long, -and are transfered using USB "bulk" transfers. - -IN packets are sent towards the host. -OUT packets are sent away from the host. - -The layout is 32-bits wide. All data is transmitted in little-endian -format across the USB. - - - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - |O|U|D|S|E| RSSI | Chan | mbz | Tag | Payload Len | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Timestamp | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | | - + + - | Payload | - . . - . . - . . - | | - + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | ... | . - +-+-+-+-+-+-+-+ . - . . - . Padding . - . . - | | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - - mbz Must be Zero: these bits must be zero in both IN and OUT packets. - - O Overrun Flag: set in an IN packet if an overrun condition was - detected. Must be zero in OUT packets. Overrun occurs when - the FPGA has data to transmit to the host and there is no - buffer space available. This generally indicates a problem on - the host. Either it is not keeping up, or it has configured - the FPGA to transmit data at a higher rate than the transport - (USB) can support. - - U Underrun Flag: set in an IN packet if an underrun condition - was detected. Must be zero in OUT packets. Underrun occurs - when the FPGA runs out of samples, and it's not between - bursts. See the "End of Burst flag" below. - - D Dropped Packet Flag: Set in an IN packet if the FPGA - discarded an OUT packet because its timestamp had already - passed. - - S Start of Burst Flag: Set in an OUT packet if the data is the - first segment of what is logically a continuous burst of data. - Must be zero in IN packets. - - E End of Burst Flag: Set in an OUT packet if the data is the - last segment of what is logically a continuous burst of data. - Must be zero in IN packets. Underruns are not reported - when the FPGA runs out of samples between bursts. - - - RSSI 6-bit Received Strength Signal Indicator: Must be zero in OUT - packets. In IN packets, indicates RSSI as reported by front end. - FIXME The format and interpretation are to be determined. - - Chan 5-bit logical channel number. Channel number 0x1f is reserved - for control information. See "Control Channel" below. Other - channels are "data channels." Each data channel is logically - independent of the others. A data channel payload field - contains a sequence of homogeneous samples. The format of the - samples is determined by the configuration associated with the - given channel. It is often the case that the payload field - contains 32-bit complex samples, each containing 16-bit real - and imaginary components. - - Tag 4-bit tag for matching IN packets with OUT packets. - [FIXME, write more...] - - Payload Len: 9-bit field that specifies the length of the payload - field in bytes. Must be in the range 0 to 504 inclusive. - - Timestamp: 32-bit timestamp. - On IN packets, the timestamp indicates the time at which the - first sample of the packet was produced by the A/D converter(s) - for that channel. On OUT packets, the timestamp specifies the - time at which the first sample in the packet should go out the - D/A converter(s) for that channel. If a packet reaches the - head of the transmit queue, and the current time is later than - the timestamp, an error is assumed to have occurred and the - packet is discarded. As a special case, the timestamp - 0xffffffff is interpreted as "Now". - - The time base is a free running 32-bit counter that is - incremented by the A/D sample-clock. - - Payload: Variable length field. Length is specified by the - Payload Len field. - - Padding: This field is 504 - Payload Len bytes long, and its content - is unspecified. This field pads the packet out to a constant - 512 bytes. - - - -"Data Channel" payload format: -------------------------------- - -If Chan != 0x1f, the packet is a "data packet" and the payload is a -sequence of homogeneous samples. The format of the samples is -determined by the configuration associated with the given channel. -It is often the case that the payload field contains 32-bit complex -samples, each containing 16-bit real and imaginary components. - - -"Control Channel" payload format: ---------------------------------- - -If Chan == 0x1f, the packet is a "control packet". The control channel -payload consists of a sequence of 0 or more sub-packets. - -Each sub-packet starts on a 32-bit boundary, and consists of an 8-bit -Opcode field, an 8-bit Length field, Length bytes of arguments, and 0, -1, 2 or 3 bytes of padding to align the tail of the sub-packet to -a 32-bit boundary. - -Control channel packets shall be processed at the head of the queue, -and shall observe the timestamp semantics described above. - - -General sub-packet format: --------------------------- - - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-//-+-+-+-+-+-+-+-+ - | Opcode | Length | <length bytes> ... | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-//-+-+-+-+-+-+-+-+ - - -Specific sub-packet formats: ----------------------------- - - RID: 6-bit Request-ID. Copied from request sub-packet into corresponding - reply sub-packet. RID allows the host to match requests and replies. - - Reg Number: 10-bit Register Number. - - - -Ping Fixed Length: - - Opcode: OP_PING_FIXED - - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Opcode | 2 | RID | Ping Value | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - -Ping Fixed Length Reply: - - Opcode: OP_PING_FIXED_REPLY - - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Opcode | 2 | RID | Ping Value | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - -Write Register: - - Opcode: OP_WRITE_REG - - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Opcode | 6 | mbz | Reg Number | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Register Value | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - -Write Register Masked: - - Opcode: OP_WRITE_REG_MASKED - - REG[Num] = (REG[Num] & ~Mask) | (Value & Mask) - - That is, only the register bits that correspond to 1's in the - mask are written with the new value. - - - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Opcode | 10 | mbz | Reg Number | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Register Value | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Mask Value | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - -Read Register: - - Opcode: OP_READ_REG - - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Opcode | 2 | RID | Reg Number | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - -Read Register Reply: - - Opcode: OP_READ_REG_REPLY - - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Opcode | 6 | RID | Reg Number | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Register Value | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - -I2C Write: - - Opcode: OP_I2C_WRITE - I2C Addr: 7-bit I2C address - Data: The bytes to write to the I2C bus - Length: Length of Data + 2 - - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Opcode | Length | mbz | I2C Addr | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Data ... . - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - -I2C Read: - - Opcode: OP_I2C_READ - I2C Addr: 7-bit I2C address - Nbytes: Number of bytes to read from I2C bus - - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Opcode | 3 | RID | mbz | I2C Addr | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Nbytes | unspecified padding | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - -I2C Read Reply: - - Opcode: OP_I2C_READ_REPLY - I2C Addr: 7-bit I2C address - Data: Length - 2 bytes of data read from I2C bus. - - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Opcode | Length | RID | mbz | I2C Addr | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Data ... . - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - -SPI Write: - - Opcode: OP_SPI_WRITE - Enables: Which SPI enables to assert (mask) - Format: Specifies format of SPI data and Opt Header Bytes - Opt Header Bytes: 2-byte field containing optional Tx bytes; see Format - Data: The bytes to write to the SPI bus - Length: Length of Data + 6 - - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Opcode | Length | mbz | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Enables | Format | Opt Header Bytes | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Data ... . - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - -SPI Read: - - Opcode: OP_SPI_READ - Enables: Which SPI enables to assert (mask) - Format: Specifies format of SPI data and Opt Header Bytes - Opt Header Bytes: 2-byte field containing optional Tx bytes; see Format - Nbytes: Number of bytes to read from SPI bus. - - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Opcode | 7 | RID | mbz | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Enables | Format | Opt Header Bytes | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Nbytes | unspecified padding | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - -SPI Read Reply: - - Opcode: OP_SPI_READ_REPLY - Data: Length - 2 bytes of data read from SPI bus. - - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Opcode | Length | RID | mbz | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Data ... . - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - -Delay: - - Opcode: OP_DELAY - Ticks: 16-bit unsigned delay count - - Delay Ticks clock ticks before executing next operation. - - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Opcode | 2 | Ticks | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - diff --git a/usrp/doc/inband-signaling-usb-host b/usrp/doc/inband-signaling-usb-host deleted file mode 100644 index 6bfdca97e..000000000 --- a/usrp/doc/inband-signaling-usb-host +++ /dev/null @@ -1,23 +0,0 @@ -# -# Copyright 2007 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# - - -See usrp/host/lib/inband/usrp_server.mbh for interface - diff --git a/usrp/doc/other/.gitignore b/usrp/doc/other/.gitignore deleted file mode 100644 index b336cc7ce..000000000 --- a/usrp/doc/other/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/Makefile -/Makefile.in diff --git a/usrp/doc/other/Makefile.am b/usrp/doc/other/Makefile.am deleted file mode 100644 index 815553a6d..000000000 --- a/usrp/doc/other/Makefile.am +++ /dev/null @@ -1,25 +0,0 @@ -# -# Copyright 2005,2010 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -include $(top_srcdir)/Makefile.common - -EXTRA_DIST += \ - mainpage.dox diff --git a/usrp/doc/other/mainpage.dox b/usrp/doc/other/mainpage.dox deleted file mode 100644 index 56068cc5f..000000000 --- a/usrp/doc/other/mainpage.dox +++ /dev/null @@ -1,9 +0,0 @@ -/*! \mainpage - -The top level interfaces to the USRP are usrp_standard_rx and -usrp_standard_tx. Also take a look at their base classes, -usrp_basic_rx, usrp_basic_tx and usrp_basic. - -See also <a href="usrp_guide.html">USRP User's and Developer's Guide</a> - -*/ diff --git a/usrp/doc/traffic-cop-dma b/usrp/doc/traffic-cop-dma deleted file mode 100644 index 0b3c3507e..000000000 --- a/usrp/doc/traffic-cop-dma +++ /dev/null @@ -1,137 +0,0 @@ -Matt, - -Here's my idea on the interface to the traffic cop. Basically I'm -thinking about treating it as 4 separate DMA channels, one for each of -the four possible "flows". In the interest of simplicity, I think we can -assign buffers 0,1 to channel 0; 2,3 to channel 1, etc... - -port assignments ------------------ - 0 SERDES - 1 DSP pipeline - 2 Gigabit ethernet MAC - 3 RAM - - -registers ---------- - - MBZ == Must Be Zero - - 3 2 1 - 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 - - -TC_DMA_SRC_{0,3} [WR] ("traffic cop DMA source, channel N") - - (The {0,3} notation means there are four of these registers, - one for each channel, named TC_DMA_SRC_0, TC_DMA_SRC_1, - TC_DMA_SRC_2, TC_DMA_3.) - - Specifies where the writing port adapter writes info the buffer, and - the maximum number of lines to write. - - 5 9 9 9 - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - |0| src | start | end (max) | step | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - src: source port number. E.g., 2 = ethernet MAC (the buffer writer) - start: starting line number for transfer (32-bit lines) - end: index of last line to write. I.e., start = 0, end = 0, xfers 1 line. - step: normally 1. - - -TC_DMA_DST_{0,3} [WR] - - Specifies the range of lines that the reading port adapter accesses. - The number of lines to be transferred is controlled by the source. - - 5 9 9 9 - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - |0| dst | start | end (max) | step | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - dst: destination port number. E.g., 1 = DSP pipeline (the buffer reader) - start: starting line number tranfer (32-bit lines) - end: Must be zero, unless a TC_DMA_CMD_SEND_0 or TC_DMA_CMD_SEND_1 - cmd is written to TC_DMA_CTRL_{0,3} in which case this - specifies the index of the last line to send to the destination. - step: normally 1. - - -TC_DMA_CTRL_{0,3} [WR] - - 27 1 4 - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | MBZ |A| cmd | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - - A: Set if "Host Approval" is required before beginning xfer to dst. - Used to allow processor to inspect packet for s/w dispatch. If set, - traffic cop sets PENDING_APPROVAL bit (and causes interrupt?) after the - 2nd line has been written into the buffer. Reader is held off - until hosts APPROVES or DROPS the buffer. - - - cmd: command - - TC_DMA_CMD_RESET 0 // abort active tranfers now; reset to idle state - TC_DMA_CMD_START 1 // begin transfers according - TC_DMA_CMD_STOP 2 // stop transfers at completion of current buffer - TC_DMA_CMD_APPROVE_0 3 // host approves xfer on even buffer, continue - TC_DMA_CMD_APPROVE_1 4 // host approves xfer on odd buffer, continue - TC_DMA_CMD_DROP_0 5 // host naks xfer on even buffer, drop buffer and continue - TC_DMA_CMD_DROP_1 6 // host naks xfer on even buffer, drop buffer and continue - TC_DMA_CMD_SEND_0 7 // copy buffer 0 to destination (processor init'd buffer) - TC_DMA_CMD_SEND_1 8 // copy buffer 1 to destination (processor init'd buffer) - - -TC_DMA_STATUS_{0,3} [RD] - - 10 10 - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | nwritten even | nwritten odd | state? | flags | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - nwritten even: number of lines written into even buffer - nwritten odd: number of lines written into odd buffer - - flag bits: - - bmTCDS_PENDING_APPROVAL_0 (1 << 0) // pending host approval on even buffer - bmTCDS_PENDING_APPROVAL_1 (1 << 1) // pending host approval on odd buffer - bmTCDS_WRITE_DONE_0 (1 << 2) // the even buffer write is complete - bmTCDS_WRITE_DONE_1 (1 << 3) // the odd buffer write is complete - -I think the combination of the "host approval" and WRITE_DONE bits -will allow us to handle the cases where the host looks and doesn't -care, and the case where the host looks, cares, and needs to wait -until it sees the whole packet. - -WRITE_DONE_* should be cleared when the corresponding buffer is -selected to be written into (e.g., when swapping buffers, and at init) -prior to writing the first line. WRITE_DONE_* is set when the -requested number of lines have been written into the buffer. - - - -I also want a "global status register" that pulls the N flag bits -from each of the 4 status registers into a single word. This should -allow me to read a single word to figure out what to do. - - -TC_DMA_STATUS_GLOBAL [RD] - - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | flags3 | flags2 | flags1 | flags0 | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - - -// some kind of registers to enable and ack interrupts - -TC_DMA_INTR_EN [WR] // enable particular interrupts -TC_DMA_INTR_CLR [WR] // clear particular pending interrupts - diff --git a/usrp/doc/usrp-block-diagram.eps b/usrp/doc/usrp-block-diagram.eps deleted file mode 100644 index 190b9dee3..000000000 --- a/usrp/doc/usrp-block-diagram.eps +++ /dev/null @@ -1,2785 +0,0 @@ -%!PS-Adobe-3.0 EPSF-3.0 -%%BoundingBox: 0 0 755 575 -%%Pages: 0 -%%Creator: Sun Microsystems, Inc. -%%Title: none -%%CreationDate: none -%%LanguageLevel: 2 -%%EndComments -%%BeginPreview: 760 575 1 1725 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000FFE300707800000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000FFE380E1FE00000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000C001C0C30700000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000C000E1830300000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000C000E3820300000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000C00077000300000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000C0003E000300000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000C0001C000700000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000FFC01C000E00000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000FFC03E001C00000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000C00037003800000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000C0006700F000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000C000E381C000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000C001C1C18000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000C00180C30000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000C00380E7FF00000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000C0070077FF00000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%08000000300701F80FF80007C00000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%08000000300707FE0FFE000FF00000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%08000000300706070C060018380000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0800000030070E038C030010180000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0800000030070C000C030030180000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0800000030070E000C030000180000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%08000000300707C00C070000380000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%08000000300703FC0FFE0000300000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000003007007E0FFC0000700000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000003007000F0FFF0000E00000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%08000000300700038C030003C00000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0800000030071C018C038007000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0800000038061C018C01800E000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0800000018060E038C03801C000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000001C0E0F070C070018000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000FFC07FE0FFF003FF80000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0800000007F001FC0FFC003FF80000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080007E00000000000000031800000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%08001FF80000000300000031800000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0800381C0000000300000031800000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0800700C0000000300000031800000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0800600E03808E07C8C0E03180E023000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0800E0000FE0FF8FCFE3F83183F83F800000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0800E0001C70F3C30FC71C31871C3F000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0800C0003038E0C30E0E0E318E0E38000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0800C0003018C0C30C0C06318C0630000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0800C0007018C0C30C0C06318FFE30000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0800C0007018C0C30C0C07318FFE30000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0800E0067018C0C30C0C07318C0030000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0800600E7018C0C30C0C06318C0030000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0800700C3038C0C30C0C06318C0630000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0800381C3830C0C30C0E0E318E0E30000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%08001FF81FF0C0C3CC07FC3187FC30000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080007E00FC0C0C1CC01F03181F030000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%080000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000018000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000018000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000018000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000018000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000018000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000018000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000018000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000018000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000018000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000018000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000018000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000018000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000018000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000018000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000018000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000018000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000018000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000018000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000018000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000018000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000018000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000018000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000018000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000018000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000018000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000018000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000018000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000018000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000018000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000018000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000018000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000018000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000018000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000018000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000018000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC00000000000000000000000000000 -%007FFFFFFFFFFFFFFFFFFFFFFFFFFFFE00000000000000000000000000000000FFFFFFFFFFFFFF -%FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC00 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000010000 -%004000000000000000000000000000020000040000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000020000000000000000000 -%004000000000000000000000000000020000000000000000000020000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000040000000000000000000 -%004000000000000000000000000000020000000000000000000010000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000100000000000000000000 -%004000000000000000000000000000020000000000000000000004000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000200000000000000000000 -%004000000000000000000000000000020000000000000000000002000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000400000000000000000000 -%004000000000000000000000000000020000000000000000000001000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000800000000000000000000 -%004000000000000000000000000000020000000000000000000000800000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000001000000000000000000000 -%004000000000000000000000000000020000000000000000000000400000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000002000000000000000000000 -%004000000000000000000000000000020000000000000000000000200000000080000000000000 -%0000000000000000000000000000000400 -%00080000000000000000000000000000000000000000000040000000C000000000000000000000 -%004000000000000000000000000000020000000000000000000000180000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000010000000000000000000000 -%004000000000000000000000000000020000000000000000000000040000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000020000000000000000000000 -%004000000000000000000000000000020000000000000000000000020000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000040000000000000000000000 -%004000000000000000000000000000020000000000000000000000010000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000080000000000000000000000 -%004000000000000000000000000000020000000000000000000000008000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000100000000000000000000000 -%004000000000000000000000000000020000000000000000000000004000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000200000000000000000000000 -%004000000000000000000000000000020000000000000000000000002000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000C00000000000000000000000 -%004000000000000000000000000000020000000000000000000000001800000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%0008000000000000000000000000000000000000000000004000020001C03FF800FE0000000000 -%00400000000000000000000000000002000000000003C03FF001FE000200000080000000000000 -%0000000000000000000000000000000400 -%0008000000000000000000000000000000000000000000004000040001E03FFC03FF8000000000 -%00400000000000000000000000000002000000000003C03FFC03FF000100000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000360300E07038000000000 -%00400000000000000000000000000002000000000003C0301C0703800000000080000000000000 -%0000000000000000000000000000000400 -%00080000000000000000000000000000000000000000000040001000036030060601C000000000 -%0040000000000000000000000000000200000000000760300E0E01800040000080000000000000 -%0000000000000000000000000000000400 -%00080000000000000000000000000000000000000000000040002000073030070C00C000000000 -%004000000000000000000000000000020000000000066030060C01C00020000080000000000000 -%0000000000000000000000000000000400 -%00080000000000000000000000000000000000000000000040004000063030030C000000000000 -%004000000000000000000000000000020000000000067030071C00000010000080000000000000 -%0000000000000000000000000000000400 -%00080000000000000000000000000000000000000000000040000000063830031C000000000000 -%0040000000000000000000000000000200000000000C3030071800000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000E1830031C00000000FFFF -%FFC0000000000000000000000000000200000000000C3030031800000001FFFF80000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400200000C1830031C00000000FFFF -%FFC0000000000000000000000000000200000000001C1830031800000003FFFF80000000000000 -%0000000000000000000000000000000400 -%0008000000000000000000000000000000000000000000007FF800000C1C30031C000000000000 -%00400000000000000000000000000003FFFFF800001C1830031800000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000001FFC30030C000000000000 -%0040000000000000000000000000000200000000001FFC30071800000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000001FFE30070C00C000000000 -%0040000000000000000000000000000200000000003FFC30061C00C00000000080000000000000 -%0000000000000000000000000000000400 -%00080000000000000000000000000000000000000000000040000000380630070E00C000000000 -%004000000000000000000000000000020000000000300E30060C01C00000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400020003006300E0701C000000000 -%004000000000000000000000000000020000000000300E300E0E03800020000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400010003007301E07838000000000 -%0040000000000000000000000000000200000000006006301C0707800040000080000000000000 -%0000000000000000000000000000000400 -%0008000000000000000000000000000000000000000000004000000070033FF801FF0000000000 -%00400000000000000000000000000002000000000060073FF803FE000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400004006003BFE0007C0000000000 -%004000000000000000000000000000020000000000E0033FE000FC000100000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400002000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000200000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000800000000000000000000000 -%004000000000000000000000000000020000000000000000000000000800000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000400000000000000000000000 -%004000000000000000000000000000020000000000000000000000001000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000200000000000000000000000 -%004000000000000000000000000000020000000000000000000000002000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000100000000000000000000000 -%004000000000000000000000000000020000000000000000000000004000000080000000000000 -%0000000000000000000000000000000400 -%0008000000000003FF800000000003000000000000000000400000080000000000000000000000 -%00400000000000000000000000000002000000000000000000000000800000008000000000003F -%F800000000003000000000000000000400 -%0008000000000003FFC00000000003000000000000000000400000040000000000000000000000 -%00400000000000000000000000000002000000000000000000000001000000008000000000003F -%FC00000000003000000000000000000400 -%000800000000000300E00000000002000000000000000000400000020000000000000000000000 -%004000000000000000000000000000020000000000000000000000020000000080000000000038 -%0E00000000002000000000000000000400 -%000800000000000300600000000000000000000000000000400000018000000000000000000000 -%0040000000000000000000000000000200000000000000000000000C0000000080000000000030 -%0700000000000000000000000000000400 -%000800000000000300700000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000100000000080000000000030 -%0700000000000000000000000000000400 -%00080000000000030070FE03F03F0330187E000000000000400000002000000000000000000000 -%004000000000000000000000000000020000000000000000000000200000000080000000000030 -%0707E03F03F8338187F000000000000400 -%00080000000000030061EF073873833838E7000000000000400000001000000000000000000000 -%004000000000000000000000000000020000000000000000000000400000000080000000000030 -%070E7073873C31818E7800000000000400 -%000800000000000301E1830E1CE0C3183181800000000000400000000800000000000000000000 -%004000000000000000000000000000020000000000000000000000800000000080000000000038 -%1E1838E0CE0C31831C1800000000000400 -%0008000000000003FF83018C0CC0E3183181C00000000000400000000400000000000000000000 -%00400000000000000000000000000002000000000000000000000100000000008000000000003F -%FC3018C0CC0631C3180C00000000000400 -%0008000000000003FE03019C01C0E30C6381C00000000000400000000200000000000000000000 -%00400000000000000000000000000002000000000000000000000200000000008000000000003F -%F03018C00C0630C3181C00000000000400 -%00080000000000030703FF9C01FFE30C63FFC00000000000400000000100000000000000000000 -%004000000000000000000000000000020000000000000000000004000000000080000000000030 -%383FF8C00FFE30C61FFC00000000000400 -%00080000000000030383001C01C0030C6380000000000000400000000040000000000000000000 -%004000000000000000000000000000020000000000000000000010000000000080000000000030 -%183000C00C003066180000000000000400 -%000800000000000301C3001C01C00306C380000000000000400000000020000000000000000000 -%004000000000000000000000000000020000000000000000000020000000000080000000000030 -%1C3000C00C003066180000000000000400 -%000800000000000300E3018C0CC04306C181800000000000400000000000000000000000010000 -%004000000000000000000000000000020000040000000000000000000000000080000000000030 -%0E3818C0CC06306C180C00000000000400 -%000800000000000300E1838E1CE0C307C1C1800000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000030 -%071838E0CE0E303C1C1C00000000000400 -%00080000000000030071E7073873C30380E7800000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000030 -%071E707387BC30380F7800000000000400 -%00080000000000030030FE03F03F8303807F000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000030 -%0387E03F03F8303807F000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800FFC0000000000030000000000C0000000000000C00400000000000000000000000000000 -%0040000000000000000000000000000200000000000000000000000000000000800FFC00000000 -%00030000000000C0000000000000C00400 -%000800FFF000000000003000C000000C0000000000000C00400000000000000000000000000000 -%0040000000000000000000000000000200000000000000000000000000000000800FFF00000000 -%0003000C000000C0000000000000C00400 -%000800E07800000000003000C000000C0000000000000C00400000000000000000000000000000 -%0040000000000000000000000000000200000000000000000000000000000000800E0780000000 -%0003000C000000C0000000000000C00400 -%000800E01800000000003000C000000C0000000000000C00400000000000000000000000000000 -%0040000000000000000000000000000200000000000000000000000000000000800E01C0000000 -%0003000C000000C0000000000000C00400 -%000800E01C00000000003000C000000C0000000000000C00400000000000000000000000000000 -%0040000000000000000000000000000200000000000000000000000000000000800E00C0000000 -%0003000E000000C0000000000000C00400 -%000800E00C1FC38183FC37E3F0FC1FCDF03F81FE1FC7FC00400000000000000000000000010000 -%0040000000000000000000000000000200000400000000000000000000000000800E00C1FE1818 -%3FE37E1F0FC0FCDF01FC0FE1FC7EC00400 -%000800E00C39E381873C3CE0C1CE1FCF3879C3CF1F8E7C00400000000020000000000000000000 -%0040000000000000000000000000000200000000000000000000200000000000800E00E38E1818 -%73E3EF0C1CF0FCFB879E1CF1F8E7C00400 -%000800E00E7063818C1C3870C3031C0E1C60E3031C1C3C00400000000040000000000000000000 -%0040000000000000000000000000000200000000000000000000100000000000800E00E3071818 -%E1E3830C3030E0E1C6063831C1C1C00400 -%000800E00E0063818C0C3030C7031C0C0CC0600318181C00400000000100000000000000000000 -%0040000000000000000000000000000200000000000000000000040000000000800E00E0071818 -%C0E3030C3038C0C0CE070031C181C00400 -%000800E00E006381980C3030C7039C0C0CC0700718181C00400000000200000000000000000000 -%0040000000000000000000000000000200000000000000000000020000000000800E00E0071818 -%C0E3030C7038C0C0CC0300718180C00400 -%000800E00C1FE381980C3030C7FF9C0C0CC030FF18381C00400000000400000000000000000000 -%0040000000000000000000000000000200000000000000000000010000000000800E00E0FF1819 -%C0E3030C7FF8C0C0EC030FF18180C00400 -%000800E00C3E6381980C3030C7001C0C0CC033E318381C00400000000800000000000000000000 -%0040000000000000000000000000000200000000000000000000008000000000800E00E3E71819 -%C0E3030C7000C0C0EC031E318180C00400 -%000800E00C7063839C0C3030C6001C0C0CC0730318181C00400000001000000000000000000000 -%0040000000000000000000000000000200000000000000000000004000000000800E00C7071818 -%C0E3030C7000C0C0CC0330318180C00400 -%000800E01C6063838C0C3030C7031C0C0CE0670318181C00400000002000000000000000000000 -%0040000000000000000000000000000200000000000000000000002000000000800E01C6071838 -%C0E3030C3030C0C0CE0730318181C00400 -%000800E03860E1878C1C3030C3871C0E1860E707181C3C00400000008000000000000000000000 -%0040000000000000000000000000000200000000000000000000001800000000800E0386071838 -%E1E3030C3830C0E1C706307180C1C00400 -%000800FFF071E1FF877C3030F1CE1C0F3879C39F180E7C00400000010000000000000000000000 -%0040000000000000000000000000000200000000000000000000000400000000800FFF039F1FF8 -%73E3030F1EF0C0FB839E39F180F7C00400 -%000800FFE03F30F983EC303070FC1C0DF01F81FB1807FC00400000020000000000000000000000 -%0040000000000000000000000000000200000000000000000000000200000000800FFE03F30FD8 -%3FE303078FE0C0DF01F81FB9807EC00400 -%0008000000000000000C0000000000000000000000000000400000040000000000000000000000 -%004000000000000000000000000000020000000000000000000000010000000080000000000000 -%00E0000000000000000000000000000400 -%0008000000000000080C0000000000000000000000000000400000080000000000000000000000 -%004000000000000000000000000000020000000000000000000000008000000080000000000000 -%C0C0000000000000000000000000000400 -%00080000000000000C1C0000000000000000000000000000400000100000000000000000000000 -%004000000000000000000000000000020000000000000000000000004000000080000000000000 -%E1C0000000000000000000000000000400 -%000800000000000007F80000000000000000000000000000400000200000000000000000000000 -%004000000000000000000000000000020000000000000000000000002000000080000000000000 -%7F80000000000000000000000000000400 -%000800000000000003E00000000000000000000000000000400000C00000000000000000000000 -%004000000000000000000000000000020000000000000000000000001800000080000000000000 -%1E00000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%0008000000000000000000000000000000000000000000004000020001C03FF801FE0000000000 -%00400000000000000000000000000002000000000003C03FF801FE000200000080000000000000 -%0000000000000000000000000000000400 -%0008000000000000000000000000000000000000000000004000040001E03FFC03FF8000000000 -%00400000000000000000000000000002000000000003C03FFC03FF000100000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000360300E07018000000000 -%00400000000000000000000000000002000000000003E0301C0703800000000080000000000000 -%0000000000000000000000000000000400 -%00080000000000000000000000000000000000000000000040001000036030070E01C000000000 -%0040000000000000000000000000000200000000000660300E0E01800040000080000000000000 -%0000000000000000000000000000000400 -%00080000000000000000000000000000000000000000000040002000073030070C00C000000000 -%004000000000000000000000000000020000000000066030060C00800020000080000000000000 -%0000000000000000000000000000000400 -%00080000000000000000000000000000000000000000000040004000063030030C000000000000 -%004000000000000000000000000000020000000000067030071C00000010000080000000000000 -%0000000000000000000000000000000400 -%00080000000000000000000000000000000000000000000040010000063830031C000000000000 -%0040000000000000000000000000000200000000000C3030031800000000000080000000000000 -%0000000000000000000000000000000400 -%0008000000000000000000000000000000000000000000007FF800000E1830031C00000000FFFF -%FFC0000000000000000000000000000200000000000C3830031800000001FFFF80000000000000 -%0000000000000000000000000000000400 -%0008000000000000000000000000000000000000000000007FF800000C1C30031C00000000FFFF -%FFC0000000000000000000000000000200000800001C1830031800000001FFFF80000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400200000C1C30031C000000000000 -%00400000000000000000000000000003FFFFF800001C1830031800000002000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000001FFC30030C000000000000 -%0040000000000000000000000000000200000000001FFC30071C00000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000001FFE30070C00C000000000 -%0040000000000000000000000000000200000000003FFC30060C00C00000000080000000000000 -%0000000000000000000000000000000400 -%00080000000000000000000000000000000000000000000040000000380630070E00C000000000 -%004000000000000000000000000000020000000000300E30060C01C00000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400020003007300E0701C000000000 -%004000000000000000000000000000020000000000300E300E0E03800020000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000003007383C03C78000000000 -%0040000000000000000000000000000200000000006006303C0787000000000080000000000000 -%0000000000000000000000000000000400 -%0008000000000000000000000000000000000000000000004000000070033FF801FF0000000000 -%00400000000000000000000000000002000000000060073FF803FE000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400004006003BFE0007C0000000000 -%004000000000000000000000000000020000000000E0033FE000F8000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000800000000000000000000000 -%004000000000000000000000000000020000000000000000000000000800000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000400000000000000000000000 -%004000000000000000000000000000020000000000000000000000001000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000100000000000000000000000 -%004000000000000000000000000000020000000000000000000000004000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000080000000000000000000000 -%004000000000000000000000000000020000000000000000000000008000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000020000000000000000000000 -%004000000000000000000000000000020000000000000000000000020000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000018000000000000000000000 -%0040000000000000000000000000000200000000000000000000000C0000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000004000000000000000000000 -%004000000000000000000000000000020000000000000000000000100000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000002000000000000000000000 -%004000000000000000000000000000020000000000000000000000200000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000001000000000000000000000 -%004000000000000000000000000000020000000000000000000000400000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000800000000000000000000 -%004000000000000000000000000000020000000000000000000000800000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000400000000000000000000 -%004000000000000000000000000000020000000000000000000001000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000200000000000000000000 -%004000000000000000000000000000020000000000000000000002000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000080000000000000000000 -%004000000000000000000000000000020000000000000000000008000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000040000000000000000000 -%004000000000000000000000000000020000000000000000000010000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000020000000000000000000 -%004000000000000000000000000000020000000000000000000020000000000080000000000000 -%0000000000000000000000000000000400 -%00080000000000000000000000000000000000000000000040000000001FFFFFFFFFFFFFFF0000 -%00400000000000000000000000000002000007FFFFFFFFFFFFFFC0000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC00000000000000000000000000000 -%0040000000000000000000000000000200000000000000000000000000000000FFFFFFFFFFFFFF -%FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC00 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0040000007FF9FF8007C001C000000020000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0040000007FF9FFE01FF801C000000020000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0040000007001C0F0383C03E000000020000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0040000006001C070700C036000000020000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0040000006001C030E00C036000000020000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0040000006001C030C000063000000020000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0040000006001C031C000063000000020000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0040000007001C071C0000E3800000020000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0040000007FF1FFE1C0FE0C1800000020000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0040000007FE1FFC1C0FE0C1800000020000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0040000006001C001C00E1FFC00000020000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0040000006001C000C0061FFC00000020000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0040000006001C000C006380E00000020000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0040000006001C000E006300600000020000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0040000006001C000781E300700000020000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0040000006001C0003FFC700700000020000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0040000006001C0000FF0600300000020000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC00000000000000000000000000000 -%00400000000000000000000000000002000000000000000000000000000000007FFFFFFFFFFFFF -%FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC00 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%00080000000000000000000000000000000000000000000040000000001FFFFFFFFFFFFFFF0000 -%00400000000000000000000000000002000007FFFFFFFFFFFFFFC0000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000080000000000000000000 -%004000000000000000000000000000020000000000000000000008000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000002000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000008000000000000000000000 -%004000000000000000000000000000020000000000000000000000080000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000010000000000000000000000 -%004000000000000000000000000000020000000000000000000000040000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000040000000000000000000000 -%004000000000000000000000000000020000000000000000000000010000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000080000000000000000000000 -%004000000000000000000000000000020000000000000000000000008000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000200000000000000000000000 -%004000000000000000000000000000020000000000000000000000002000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000C00000000000000000000000 -%004000000000000000000000000000020000000000000000000000001800000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400001003FE00060007C0000000000 -%0040000000000000000000000000000200000000003FE000E00078000400000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400002003FF800F001FF0000000000 -%0040000000000000000000000000000200000000003FF800E001FE000200000080000000000000 -%0000000000000000000000000000000400 -%00080000000000000000000000000000000000000000000040000400383E00F003C78000000000 -%004000000000000000000000000000020000000000303C01E00787000100000080000000000000 -%0000000000000000000000000000000400 -%00080000000000000000000000000000000000000000000040000800380E01F80701C000000000 -%004000000000000000000000000000020000000000300E01B00E03800080000080000000000000 -%0000000000000000000000000000000400 -%00080000000000000000000000000000000000000000000040001000380701980E00C000000000 -%004000000000000000000000000000020000000000300601B00C01C00040000080000000000000 -%0000000000000000000000000000000400 -%00080000000000000000000000000000000000000000000040002000380301980C008000000000 -%004000000000000000000000000000020000000000300703181C00800020000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400080003803039C0C000000000000 -%004000000000000000000000000000020000000000300303181C00000008000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400100003803830C1C000000000000 -%0040000000000000000000000000000200000000003003071C1800000004000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000003803830C1C000000008000 -%0040000000000000000000000000000200000800003003060C1800000000000080000000000000 -%0000000000000000000000000000000400 -%0008000000000000000000000000000000000000000000007FFC0000380386061C00000000FFFF -%FFC00000000000000000000000000003FFFFF800003003060C1800000001FFFF80000000000000 -%0000000000000000000000000000000400 -%00080000000000000000000000000000000000000000000040020000380387FE1C000000000000 -%00400000000000000000000000000002000000000030030FFE1800000002000080000000000000 -%0000000000000000000000000000000400 -%0008000000000000000000000000000000000000000000004000000038030FFF0C000000000000 -%00400000000000000000000000000002000000000030070FFE1C00000004000080000000000000 -%0000000000000000000000000000000400 -%0008000000000000000000000000000000000000000000004000C00038030C030C00C000000000 -%00400000000000000000000000000002000000000030061C070C00C00018000080000000000000 -%0000000000000000000000000000000400 -%0008000000000000000000000000000000000000000000004000000038070C030E01C000000000 -%004000000000000000000000000000020000000000300618030E01C00000000080000000000000 -%0000000000000000000000000000000400 -%00080000000000000000000000000000000000000000000040000000380E1C038701C000000000 -%004000000000000000000000000000020000000000300E18038703800000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400008003FFC180183FF8000000000 -%0040000000000000000000000000000200000000003FFC380387FF000080000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000003FF83801C1FE0000000000 -%0040000000000000000000000000000200000000003FF8300181FE000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400002000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000200000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400001000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000400000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000800000000000000000000000 -%004000000000000000000000000000020000000000000000000000000800000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000007FFE00000000000000000C100000000000400000000000000000000000000000 -%0040000000000000000000000000000200000000000000000000000000000000800000000003FF -%E00000000000000000C100000000000400 -%000800000000003FFE00000000000000000C300000000000400000004000000000000000000000 -%0040000000000000000000000000000200000000000000000000001000000000800000000003FF -%E00000000000000000C300000000000400 -%0008000000000001C0000000000000000000300000000000400000002000000000000000000000 -%00400000000000000000000000000002000000000000000000000020000000008000000000000C -%0000000000000000000300000000000400 -%0008000000000001C0000000000000000000300000000000400000000000000000000000000000 -%00400000000000000000000000000002000000000000000000000000000000008000000000000C -%0000000000000000000300000000000400 -%0008000000000001C0670F833C03C19E1C0CFC0000000000400000000800000000000000000000 -%00400000000000000000000000000002000000000000000000000000000000008000000000000C -%0270F811C03C09E1C0CFC0000000000400 -%0008000000000001C07F3FE3FF0FE1FF7F0CFC0000000000400000000400000000000000000000 -%00400000000000000000000000000002000000000000000000000100000000008000000000000C -%07F1FE1FF0FF1FF3F0CFC0000000000400 -%0008000000000001C07A30E3C31C31E3C70C300000000000400000000100000000000000000000 -%00400000000000000000000000000002000000000000000000000400000000008000000000000C -%0783061C38C31E3E30C300000000000400 -%0008000000000001C0707063839831C1830C300000000000400000000080000000000000000000 -%00400000000000000000000000000002000000000000000000000800000000008000000000000C -%0703071819C11C1C38C300000000000400 -%0008000000000001C0700063819C01C1830C300000000000400000000040000000000000000000 -%00400000000000000000000000000002000000000000000000001000000000008000000000000C -%0700071819C01C1818C300000000000400 -%0008000000000001C06003E3818F8181830C300000000000400000000000000000000000000000 -%00400000000000000000000000000002000000000000000000000000000000008000000000000C -%07001F1818F81C1818C300000000000400 -%0008000000000001C0603FE38187F181830C30000000000040000000001FFFFFFFFFFFFFFF0000 -%00400000000000000000000000000002000007FFFFFFFFFFFFFFC000000000008000000000000C -%0701FF18187F1C1818C300000000000400 -%0008000000000001C06078638180F181830C300000000000400000000000000000000000000000 -%00400000000000000000000000000002000000000000000000000000000000008000000000000C -%0703C718180F9C1818C300000000000400 -%0008000000000001C060606381803981830C300000000000400000000000000000000000000000 -%00400000000000000000000000000002000000000000000000000000000000008000000000000C -%0707071818019C1818C300000000000400 -%0008000000000001C060606381981981830C300000000000400000000000000000000000000000 -%00400000000000000000000000000002000000000000000000000000000000008000000000000C -%0706071819819C1818C300000000000400 -%0008000000000001C06060E3819C3981830C300000000000400000000000000000000000000000 -%00400000000000000000000000000002000000000000000000000000000000008000000000000C -%07070F1819C39C1818C300000000000400 -%0008000000000001C0607FE3818FF181830C3C0000000000400000000000000000000000000000 -%00400000000000000000000000000002000000000000000000000000000000008000000000000C -%0703FF1818FF1C1818C3C0000000000400 -%0008000000000001C0601E338187C181830C1C0000000000400000000000000000000000000000 -%00400000000000000000000000000002000000000000000000000000000000008000000000000C -%0701F318183E1C1818C1C0000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800FFE0000000000030004000000C0000000000000C00400000000000000000000000000000 -%0040000000000000000000000000000200000000000000000000000000000000800FFE00000000 -%00030004000000C0000000000000C00400 -%000800FFF000000000003000C000000C0000000000000C00400000000000000000000000000000 -%0040000000000000000000000000000200000000000000000000000000000000800FFF00000000 -%0003000C000000C0000000000000C00400 -%000800E03800000000003000C000000C0000000000000C00400000000000000000000000000000 -%0040000000000000000000000000000200000000000000000000000000000000800E0380000000 -%0003000C000000C0000000000000C00400 -%000800E01C00000000003000C000000C0000000000000C00400000000000000000000000000000 -%0040000000000000000000000000000200000000000000000000000000000000800E01C0000000 -%0003000C000000C0000000000000C00400 -%000800E00C0F838181EC33C3F07819CCE00F007C1B83CC0040000000001FFFFFFFFFFFFFFF0000 -%00400000000000000000000000000002000007FFFFFFFFFFFFFFC00000000000800E00C0F81818 -%1E633C1F0780DCCE00F007C1BC3CC00400 -%000800E00C3FE38187FC3FE3F1FE1FCFF83FC1FE1F8FFC00400000000000000000000000000000 -%0040000000000000000000000000000200000000000000000000000000000000800E00E1FE1818 -%7FE3FE1F1FE0FCFF83FC1FE1FC7FC00400 -%000800E00E30E3818E1C3870C3871E0E1870E3871E9C3C00400000000040000000000000000000 -%0040000000000000000000000000000200000000000000000000100000000000800E00E3061818 -%61E3870C3870E0F1C70E3871E0C3C00400 -%000800E00E7063818C0C3030C3031C0E1CE063031C181C00400000000080000000000000000000 -%0040000000000000000000000000000200000000000000000000080000000000800E00E3071818 -%C0E3030C3030C0E0C6063031C1C1C00400 -%000800E00E0063819C0C3030C6031C0C0CC0700318181C00400000000000000000000000000000 -%0040000000000000000000000000000200000000000000000000000000000000800E00E0071818 -%C0E3030C3038C0C0CC0300318181C00400 -%000800E00E03E381980C3030C7FF9C0C0CC0303F18381C00400000000400000000000000000000 -%0040000000000000000000000000000200000000000000000000010000000000800E00E03F1819 -%C0E3030C7FF8C0C0EC0301F18180C00400 -%000800E00C3FE381980C3030C7FF9C0C0CC031FF18381C00400000000000000000000000000000 -%0040000000000000000000000000000200000000000000000000000000000000800E00E1FF1819 -%C0E3030C7FF8C0C0EC031FF18180C00400 -%000800E00C786383980C3030C6001C0C0CC033C318381C00400000000000000000000000000000 -%0040000000000000000000000000000200000000000000000000000000000000800E00C3871819 -%C0E3030C7000C0C0EC033C318180C00400 -%000800E01C6063839C0C3030C7001C0C0CC0770318181C00400000002000000000000000000000 -%0040000000000000000000000000000200000000000000000000002000000000800E00C7071818 -%C0E3030C7000C0C0CC0330318180C00400 -%000800E0186063838C0C3030C3031C0C1CE0670718181C00400000004000000000000000000000 -%0040000000000000000000000000000200000000000000000000000000000000800E01C6071838 -%C0E3030C3038C0E0C606303181C1C00400 -%000800E07870E1878E1C3030C3871C0E1870E70F180C3C00400000008000000000000000000000 -%0040000000000000000000000000000200000000000000000000000800000000800E07870F1C78 -%E1E3030C3870C0E1C70E307180C3C00400 -%000800FFF03FF1FD87FC3030F1FE1C0FF03FC3FF180FFC00400000000000000000000000000000 -%0040000000000000000000000000000200000000000000000000000000000000800FFF03FF0FD8 -%7FE3030F1FE0C0FF83FC3FF1807FC00400 -%000800FFC01E307981EC303070781C0DE01F01F39803CC00400000000000000000000000000000 -%0040000000000000000000000000000200000000000000000000000000000000800FFC01F30798 -%1EE3030787C0C0CE00F00F19803CC00400 -%0008000000000000000C0000000000000000000000000000400000040000000000000000000000 -%004000000000000000000000000000020000000000000000000000010000000080000000000000 -%00C0000000000000000000000000000400 -%00080000000000000C0C0000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%C0C0000000000000000000000000000400 -%00080000000000000E380000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%F3C0000000000000000000000000000400 -%000800000000000007F00000000000000000000000000000400000200000000000000000000000 -%004000000000000000000000000000020000000000000000000000002000000080000000000000 -%7F80000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400001003FF00060007C0000000000 -%0040000000000000000000000000000200000000003FE000E000FC000400000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400002003FFC00F001FF0000000000 -%0040000000000000000000000000000200000000003FF800E003FE000200000080000000000000 -%0000000000000000000000000000000400 -%00080000000000000000000000000000000000000000000040000000381E00F003838000000000 -%004000000000000000000000000000020000000000301C01F00787800000000080000000000000 -%0000000000000000000000000000000400 -%00080000000000000000000000000000000000000000000040000800380601F80701C000000000 -%004000000000000000000000000000020000000000300E01B00E03800080000080000000000000 -%0000000000000000000000000000000400 -%00080000000000000000000000000000000000000000000040001000380701980E00C000000000 -%004000000000000000000000000000020000000000300603B00C01C00040000080000000000000 -%0000000000000000000000000000000400 -%00080000000000000000000000000000000000000000000040004000380301980C000000000000 -%004000000000000000000000000000020000000000300703181C00000010000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400080003803031C0C000000000000 -%004000000000000000000000000000020000000000300303181800000008000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400100003803830C1C000000000000 -%0040000000000000000000000000000200000000003003071C1800000004000080000000000000 -%0000000000000000000000000000000400 -%0008000000000000000000000000000000000000000000007FFA00003803870E1C00000000FFFF -%FFC00000000000000000000000000003FFFFF800003003060C1800000003FFFF80000000000000 -%0000000000000000000000000000000400 -%0008000000000000000000000000000000000000000000007FFC0000380386061C00000000FFFF -%FFC00000000000000000000000000003FFFFF800003003060C1800000001FFFF80000000000000 -%0000000000000000000000000000000400 -%00080000000000000000000000000000000000000000000040020000380307FE0C000000000000 -%00400000000000000000000000000002000000000030030FFE1800000002000080000000000000 -%0000000000000000000000000000000400 -%0008000000000000000000000000000000000000000000004001000038030FFF0C00C000000000 -%00400000000000000000000000000002000000000030070FFE1C00800004000080000000000000 -%0000000000000000000000000000000400 -%0008000000000000000000000000000000000000000000004000C00038030C030C00C000000000 -%00400000000000000000000000000002000000000030061C070C01C00018000080000000000000 -%0000000000000000000000000000000400 -%0008000000000000000000000000000000000000000000004000000038070C038601C000000000 -%004000000000000000000000000000020000000000300E18030E01800000000080000000000000 -%0000000000000000000000000000000400 -%00080000000000000000000000000000000000000000000040001000380E1C0387038000000000 -%004000000000000000000000000000020000000000301E18038703800040000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400008003FFC180183FF8000000000 -%0040000000000000000000000000000200000000003FFC380387FF000080000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000003FF83801C1FE0000000000 -%0040000000000000000000000000000200000000003FF0300181FE000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400002000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000200000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400001000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000400000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000800000000000000000000000 -%004000000000000000000000000000020000000000000000000000000800000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000200000000000000000000000 -%004000000000000000000000000000020000000000000000000000002000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000040000000000000000000000 -%004000000000000000000000000000020000000000000000000000010000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000100000000000000000000 -%004000000000000000000000000000020000000000000000000004000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000080000000000000000000 -%004000000000000000000000000000020000000000000000000008000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000040000000000000000000 -%004000000000000000000000000000020000000000000000000010000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%00080000000000000000000000000000000000000000000040000000001FFFFFFFFFFFFFFF0000 -%00400000000000000000000000000002000007FFFFFFFFFFFFFFC0000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000800000000000000000000000000000000000000000000400000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000080000000000000 -%0000000000000000000000000000000400 -%000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC00000000000000000000000000000 -%00400000000000000000000000000002000000000000000000000000000000007FFFFFFFFFFFFF -%FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC00 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%004000000000000000000000000000020000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%007FFFFFFFFFFFFFFFFFFFFFFFFFFFFE0000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%000000000000000000000000000000000000000000000000000000000000000000000000000000 -%0000000000000000000000000000000000 -%%EndPreview -%%BeginProlog -%%BeginResource: SDRes -/b4_inc_state save def -/dict_count countdictstack def -/op_count count 1 sub def -userdict begin -0 setgray 0 setlinecap 1 setlinewidth 0 setlinejoin 10 setmiterlimit[] 0 setdash newpath -/languagelevel where {pop languagelevel 1 ne {false setstrokeadjust false setoverprint} if} if -/bdef {bind def} bind def -/c {setgray} bdef -/l {neg lineto} bdef -/rl {neg rlineto} bdef -/lc {setlinecap} bdef -/lj {setlinejoin} bdef -/lw {setlinewidth} bdef -/ml {setmiterlimit} bdef -/ld {setdash} bdef -/m {neg moveto} bdef -/ct {6 2 roll neg 6 2 roll neg 6 2 roll neg curveto} bdef -/r {rotate} bdef -/t {neg translate} bdef -/s {scale} bdef -/sw {show} bdef -/gs {gsave} bdef -/gr {grestore} bdef -/f {findfont dup length dict begin -{1 index /FID ne {def} {pop pop} ifelse} forall /Encoding ISOLatin1Encoding def -currentdict end /NFont exch definefont pop /NFont findfont} bdef -/p {closepath} bdef -/sf {scalefont setfont} bdef -/ef {eofill}bdef -/pc {closepath stroke}bdef -/ps {stroke}bdef -/pum {matrix currentmatrix}bdef -/pom {setmatrix}bdef -/bs {/aString exch def /nXOfs exch def /nWidth exch def currentpoint nXOfs 0 rmoveto pum nWidth aString stringwidth pop div 1 scale aString show pom moveto} bdef -%%EndResource -%%EndProlog -%%BeginSetup -%%EndSetup -%%Page: 1 1 -%%BeginPageSetup -%%EndPageSetup -pum -0.02834 0.02833 s -0 -20290 t -/tm matrix currentmatrix def -gs -tm setmatrix --635 -635 t -1 1 s -635 635 m 27274 635 l 27274 20924 l 635 20924 l 635 635 l eoclip newpath -0.996 c 7835 7938 m 8893 6985 l 11010 6985 l 11010 8890 l 8893 8890 l -7835 7938 l p ef -0 lw 1 lj 0.000 c 7835 7938 m 8893 6985 l 11010 6985 l 11010 8890 l 8893 8890 l -7835 7938 l pc -gs -pum -8520 8228 t --1 0 m 231 -605 l 317 -605 l 565 0 l 474 0 l 403 -183 l 150 -183 l -83 0 l p -173 -248 m 378 -248 l 315 -416 l 296 -467 282 -509 272 -541 ct 264 -503 254 -464 240 -426 ct -p ef -621 0 m 621 -605 l 829 -605 l 876 -605 912 -602 937 -596 ct 972 -588 1001 -574 1026 -553 ct -1058 -526 1082 -492 1098 -450 ct 1114 -408 1121 -360 1121 -306 ct 1121 -260 1116 -219 1105 -183 ct -1095 -148 1081 -118 1064 -95 ct 1047 -72 1029 -54 1009 -40 ct 989 -27 965 -17 937 -10 ct -908 -3 876 0 839 0 ct p -701 -71 m 830 -71 l 870 -71 901 -75 924 -82 ct 947 -90 965 -100 979 -114 ct -998 -133 1012 -158 1023 -190 ct 1034 -222 1039 -261 1039 -307 ct 1039 -370 1028 -419 1008 -453 ct -987 -487 962 -510 932 -521 ct 910 -530 876 -534 828 -534 ct 701 -534 l p ef -1661 -212 m 1741 -192 l 1724 -126 1694 -76 1650 -41 ct 1607 -6 1553 10 1490 10 ct -1425 10 1372 -2 1331 -29 ct 1290 -56 1259 -94 1238 -145 ct 1216 -195 1206 -249 1206 -307 ct -1206 -370 1218 -425 1242 -472 ct 1266 -519 1300 -554 1345 -579 ct 1389 -603 1438 -615 1491 -615 ct -1552 -615 1603 -600 1644 -569 ct 1686 -538 1714 -495 1731 -439 ct 1652 -420 l -1638 -465 1617 -497 1591 -517 ct 1564 -537 1530 -547 1490 -547 ct 1443 -547 1404 -536 1373 -513 ct -1342 -491 1320 -461 1307 -424 ct 1295 -386 1288 -347 1288 -307 ct 1288 -256 1296 -211 1311 -172 ct -1326 -134 1349 -105 1381 -86 ct 1412 -67 1447 -58 1484 -58 ct 1529 -58 1567 -71 1598 -97 ct -1629 -122 l 1650 -161 l p ef -pom -gr -13955 5080 m 11733 5080 l 11733 1270 l 16178 1270 l 16178 5080 l 13955 5080 l -pc -gs -pum -13176 2513 t -69 0 m 69 -605 l 477 -605 l 477 -534 l 149 -534 l 149 -346 l 433 -346 l -433 -275 l 149 -275 l 149 0 l p ef -532 0 m 766 -315 l 560 -605 l 655 -605 l 765 -450 l 788 -418 804 -393 814 -375 ct -827 -397 843 -420 862 -444 ct 984 -605 l 1071 -605 l 858 -320 l 1087 0 l -988 0 l 836 -216 l 827 -228 818 -241 809 -256 ct 796 -234 786 -219 780 -211 ct -628 0 l p ef -1510 -71 m 1510 0 l 1110 0 l 1110 -17 1112 -35 1119 -51 ct 1129 -78 1145 -105 1168 -132 ct -1190 -158 1223 -189 1265 -223 ct 1331 -277 1375 -320 1398 -352 ct 1422 -383 1433 -413 1433 -441 ct -1433 -471 1423 -495 1402 -516 ct 1380 -536 1353 -546 1319 -546 ct 1283 -546 1255 -535 1233 -514 ct -1212 -492 1201 -463 1201 -425 ct 1124 -432 l 1129 -489 1149 -533 1183 -563 ct -1217 -593 1263 -608 1321 -608 ct 1379 -608 1425 -591 1459 -559 ct 1493 -527 1510 -487 1510 -439 ct -1510 -415 1505 -391 1495 -368 ct 1485 -345 1468 -320 1445 -294 ct 1422 -268 1384 -233 1331 -187 ct -1286 -150 1257 -125 1245 -111 ct 1232 -98 1222 -84 1213 -71 ct p ef -pom -pum -12713 3466 t -462 -605 m 542 -605 l 542 -255 l 542 -194 535 -146 522 -110 ct 508 -74 483 -45 447 -23 ct -411 0 364 10 306 10 ct 249 10 202 0 166 -19 ct 130 -38 105 -66 89 -103 ct 74 -140 66 -191 66 -255 ct -66 -605 l 146 -605 l 146 -256 l 146 -203 151 -164 161 -139 ct 171 -114 187 -95 211 -82 ct -235 -68 264 -61 299 -61 ct 358 -61 400 -75 425 -102 ct 450 -128 462 -180 462 -256 ct -p ef -673 -194 m 748 -201 l 752 -170 760 -146 773 -126 ct 786 -107 806 -91 834 -79 ct -862 -67 893 -61 927 -61 ct 958 -61 985 -66 1008 -75 ct 1031 -84 1049 -96 1060 -112 ct -1072 -128 1077 -145 1077 -164 ct 1077 -183 1072 -200 1061 -214 ct 1050 -228 1032 -240 1006 -249 ct -990 -256 954 -266 898 -279 ct 843 -292 804 -305 782 -317 ct 753 -332 731 -351 717 -373 ct -703 -396 696 -421 696 -449 ct 696 -479 704 -508 722 -534 ct 739 -561 764 -581 798 -595 ct -831 -609 868 -615 909 -615 ct 954 -615 993 -608 1028 -594 ct 1062 -579 1088 -558 1107 -530 ct -1125 -502 1135 -470 1136 -434 ct 1060 -429 l 1055 -467 1041 -496 1018 -515 ct -994 -535 959 -545 912 -545 ct 864 -545 828 -536 806 -518 ct 784 -500 773 -479 773 -454 ct -773 -432 781 -414 796 -400 ct 812 -386 852 -372 917 -357 ct 982 -342 1027 -329 1051 -318 ct -1087 -302 1113 -282 1129 -257 ct 1146 -232 1155 -203 1155 -171 ct 1155 -138 1145 -108 1127 -79 ct -1108 -51 1082 -29 1047 -13 ct 1013 2 974 10 931 10 ct 876 10 830 2 793 -13 ct 756 -29 727 -53 706 -85 ct -685 -117 l 674 -154 l p ef -1278 0 m 1278 -605 l 1506 -605 l 1552 -605 1589 -599 1617 -587 ct 1645 -574 1667 -556 1683 -530 ct -1699 -505 1706 -478 1706 -450 ct 1706 -424 1699 -400 1685 -377 ct 1671 -354 1650 -336 1622 -322 ct -1658 -311 1687 -293 1706 -267 ct 1726 -241 1736 -210 1736 -175 ct 1736 -147 1730 -120 1718 -96 ct -1706 -72 1691 -53 1673 -40 ct 1656 -26 1634 -16 1607 -10 ct 1580 -3 1548 0 1509 0 ct -p -1359 -351 m 1490 -351 l 1525 -351 1551 -353 1566 -358 ct 1586 -364 1602 -374 1612 -388 ct -1622 -402 1628 -419 1628 -441 ct 1628 -461 1623 -478 1613 -494 ct 1603 -509 1590 -520 1572 -525 ct -1554 -531 1523 -534 1480 -534 ct 1359 -534 l p -1359 -71 m 1509 -71 l 1535 -71 1553 -72 1564 -74 ct 1582 -77 1598 -83 1610 -90 ct -1623 -98 1633 -109 1641 -124 ct 1649 -139 1653 -156 1653 -175 ct 1653 -198 1647 -217 1635 -234 ct -1624 -251 1608 -262 1587 -269 ct 1567 -276 1537 -279 1499 -279 ct 1359 -279 l -p ef -2436 -71 m 2436 0 l 2036 0 l 2036 -17 2038 -35 2045 -51 ct 2055 -78 2071 -105 2094 -132 ct -2116 -158 2149 -189 2191 -223 ct 2257 -277 2301 -320 2324 -352 ct 2348 -383 2359 -413 2359 -441 ct -2359 -471 2349 -495 2328 -516 ct 2306 -536 2279 -546 2245 -546 ct 2209 -546 2181 -535 2159 -514 ct -2138 -492 2127 -463 2127 -425 ct 2050 -432 l 2055 -489 2075 -533 2109 -563 ct -2143 -593 2189 -608 2247 -608 ct 2305 -608 2351 -591 2385 -559 ct 2419 -527 2436 -487 2436 -439 ct -2436 -415 2431 -391 2421 -368 ct 2411 -345 2394 -320 2371 -294 ct 2348 -268 2310 -233 2257 -187 ct -2212 -150 2183 -125 2171 -111 ct 2158 -98 2148 -84 2139 -71 ct p ef -pom -pum -12091 4419 t -497 -212 m 577 -192 l 560 -126 530 -76 486 -41 ct 443 -6 389 10 326 10 ct -261 10 208 -2 167 -29 ct 126 -56 95 -94 74 -145 ct 52 -195 42 -249 42 -307 ct 42 -370 54 -425 78 -472 ct -102 -519 136 -554 181 -579 ct 225 -603 274 -615 327 -615 ct 388 -615 439 -600 480 -569 ct -522 -538 550 -495 567 -439 ct 488 -420 l 474 -465 453 -497 427 -517 ct 400 -537 366 -547 326 -547 ct -279 -547 240 -536 209 -513 ct 178 -491 156 -461 143 -424 ct 131 -386 124 -347 124 -307 ct -124 -256 132 -211 147 -172 ct 162 -134 185 -105 217 -86 ct 248 -67 283 -58 320 -58 ct -365 -58 403 -71 434 -97 ct 465 -122 l 486 -161 l p ef -663 -219 m 663 -300 685 -360 730 -399 ct 768 -432 814 -448 868 -448 ct 929 -448 978 -428 1016 -389 ct -1054 -349 1074 -295 1074 -225 ct 1074 -169 1065 -124 1048 -92 ct 1031 -59 1007 -34 974 -16 ct -942 0 907 9 868 9 ct 807 9 757 -9 719 -49 ct 682 -88 l 663 -145 l p -739 -219 m 739 -163 751 -121 776 -93 ct 800 -65 831 -51 868 -51 ct 905 -51 936 -65 960 -93 ct -985 -121 997 -164 997 -221 ct 997 -276 985 -317 960 -345 ct 936 -373 905 -387 868 -387 ct -831 -387 800 -373 776 -345 ct 751 -317 l 739 -275 l p ef -1166 0 m 1166 -438 l 1233 -438 l 1233 -376 l 1265 -424 1312 -448 1373 -448 ct -1399 -448 1424 -443 1446 -434 ct 1468 -424 1484 -412 1495 -396 ct 1507 -381 1514 -363 1519 -342 ct -1521 -328 1523 -304 1523 -269 ct 1523 0 l 1448 0 l 1448 -266 l 1448 -297 1446 -319 1440 -334 ct -1434 -349 1424 -361 1409 -370 ct 1394 -379 1377 -384 1357 -384 ct 1325 -384 1298 -374 1275 -354 ct -1252 -333 1241 -295 1241 -239 ct 1241 0 l p ef -1806 -66 m 1816 0 l 1795 3 1777 5 1760 5 ct 1733 5 1712 1 1697 -7 ct 1683 -15 1672 -26 1666 -40 ct -1660 -54 1657 -83 1657 -128 ct 1657 -380 l 1602 -380 l 1602 -438 l 1657 -438 l -1657 -547 l 1731 -591 l 1731 -438 l 1806 -438 l 1806 -380 l 1731 -380 l -1731 -124 l 1731 -103 1732 -89 1735 -83 ct 1737 -77 1742 -72 1748 -68 ct 1753 -65 1762 -63 1773 -63 ct -1781 -63 l 1792 -64 l p ef -1880 0 m 1880 -438 l 1947 -438 l 1947 -372 l 1964 -403 1980 -423 1995 -433 ct -2009 -443 2025 -448 2042 -448 ct 2067 -448 2093 -440 2119 -424 ct 2093 -355 l -2075 -366 2057 -371 2039 -371 ct 2022 -371 2008 -366 1995 -357 ct 1982 -347 1973 -333 1967 -316 ct -1959 -289 1955 -261 1955 -229 ct 1955 0 l p ef -2145 -219 m 2145 -300 2167 -360 2212 -399 ct 2250 -432 2296 -448 2350 -448 ct -2411 -448 2460 -428 2498 -389 ct 2536 -349 2556 -295 2556 -225 ct 2556 -169 2547 -124 2530 -92 ct -2513 -59 2489 -34 2456 -16 ct 2424 0 2389 9 2350 9 ct 2289 9 2239 -9 2201 -49 ct -2164 -88 l 2145 -145 l p -2221 -219 m 2221 -163 2233 -121 2258 -93 ct 2282 -65 2313 -51 2350 -51 ct 2387 -51 2418 -65 2442 -93 ct -2467 -121 2479 -164 2479 -221 ct 2479 -276 2467 -317 2442 -345 ct 2418 -373 2387 -387 2350 -387 ct -2313 -387 2282 -373 2258 -345 ct 2233 -317 l 2221 -275 l p ef -2647 0 m 2647 -605 l 2721 -605 l 2721 0 l p ef -2832 0 m 2832 -605 l 2906 -605 l 2906 0 l p ef -3319 -141 m 3395 -131 l 3383 -86 3361 -52 3328 -27 ct 3295 -2 3253 9 3203 9 ct -3138 9 3087 -9 3050 -49 ct 3012 -88 2993 -144 2993 -215 ct 2993 -289 3012 -346 3050 -387 ct -3089 -428 3138 -448 3198 -448 ct 3257 -448 3305 -428 3342 -388 ct 3379 -348 3398 -292 3398 -220 ct -3398 -215 3398 -209 3397 -200 ct 3070 -200 l 3073 -152 3087 -115 3111 -89 ct -3136 -64 3166 -51 3203 -51 ct 3230 -51 3253 -58 3273 -72 ct 3292 -87 l 3307 -109 l -p -3074 -261 m 3319 -261 l 3316 -298 3307 -326 3291 -344 ct 3268 -373 3237 -387 3199 -387 ct -3165 -387 3136 -376 3113 -353 ct 3090 -330 l 3077 -299 l p ef -3494 0 m 3494 -438 l 3561 -438 l 3561 -372 l 3578 -403 3594 -423 3609 -433 ct -3623 -443 3639 -448 3656 -448 ct 3681 -448 3707 -440 3733 -424 ct 3707 -355 l -3689 -366 3671 -371 3653 -371 ct 3636 -371 3622 -366 3609 -357 ct 3596 -347 3587 -333 3581 -316 ct -3573 -289 3569 -261 3569 -229 ct 3569 0 l p ef -pom -gr -13956 19115 m 11900 19115 l 11900 6350 l 16013 6350 l 16013 19115 l -13956 19115 l pc -gs -pum -12806 13017 t -69 0 m 69 -605 l 477 -605 l 477 -534 l 149 -534 l 149 -346 l 433 -346 l -433 -275 l 149 -275 l 149 0 l p ef -594 0 m 594 -605 l 822 -605 l 862 -605 893 -603 914 -599 ct 944 -594 969 -585 989 -571 ct -1009 -557 1025 -538 1038 -513 ct 1050 -488 1056 -460 1056 -430 ct 1056 -378 1040 -335 1007 -299 ct -974 -264 915 -246 829 -246 ct 674 -246 l 674 0 l p -674 -317 m 830 -317 l 882 -317 919 -327 941 -346 ct 963 -365 973 -392 973 -427 ct -973 -453 967 -474 954 -493 ct 941 -511 925 -522 904 -528 ct 890 -532 865 -534 829 -534 ct -674 -534 l p ef -1433 -237 m 1433 -308 l 1690 -308 l 1690 -84 l 1650 -52 1610 -29 1568 -13 ct -1526 2 1483 10 1439 10 ct 1379 10 1325 -2 1277 -27 ct 1228 -53 1191 -90 1167 -138 ct -1142 -186 1130 -240 1130 -299 ct 1130 -358 1142 -413 1167 -464 ct 1191 -516 1227 -553 1273 -578 ct -1319 -603 1372 -615 1433 -615 ct 1477 -615 1516 -608 1551 -594 ct 1587 -580 1615 -560 1635 -535 ct -1655 -510 1670 -476 1681 -436 ct 1608 -416 l 1599 -447 1588 -471 1574 -489 ct -1561 -506 1542 -520 1517 -531 ct 1492 -542 1464 -547 1433 -547 ct 1397 -547 1365 -541 1338 -530 ct -1311 -519 1290 -504 1273 -486 ct 1257 -468 1244 -448 1235 -426 ct 1220 -389 1212 -348 1212 -304 ct -1212 -250 1221 -205 1240 -169 ct 1259 -133 1286 -106 1321 -88 ct 1357 -70 1394 -61 1434 -61 ct -1469 -61 1503 -68 1536 -82 ct 1569 -95 1594 -109 1611 -124 ct 1611 -237 l p ef -1745 0 m 1977 -605 l 2063 -605 l 2311 0 l 2220 0 l 2149 -183 l 1896 -183 l -1829 0 l p -1919 -248 m 2124 -248 l 2061 -416 l 2042 -467 2028 -509 2018 -541 ct 2010 -503 2000 -464 1986 -426 ct -p ef -pom -gr -0.996 c 7835 17258 m 8893 16305 l 11010 16305 l 11010 18210 l 8893 18210 l -7835 17258 l p ef -0.000 c 7835 17258 m 8893 16305 l 11010 16305 l 11010 18210 l 8893 18210 l -7835 17258 l pc -gs -pum -8520 17542 t -65 0 m 65 -605 l 273 -605 l 320 -605 356 -602 381 -596 ct 416 -588 445 -574 470 -553 ct -502 -526 526 -492 542 -450 ct 558 -408 565 -360 565 -306 ct 565 -260 560 -219 549 -183 ct -539 -148 525 -118 508 -95 ct 491 -72 473 -54 453 -40 ct 433 -27 409 -17 381 -10 ct -352 -3 320 0 283 0 ct p -145 -71 m 274 -71 l 314 -71 345 -75 368 -82 ct 391 -90 409 -100 423 -114 ct -442 -133 456 -158 467 -190 ct 478 -222 483 -261 483 -307 ct 483 -370 472 -419 452 -453 ct -431 -487 406 -510 376 -521 ct 354 -530 320 -534 272 -534 ct 145 -534 l p ef -608 0 m 840 -605 l 926 -605 l 1174 0 l 1083 0 l 1012 -183 l 759 -183 l -692 0 l p -782 -248 m 987 -248 l 924 -416 l 905 -467 891 -509 881 -541 ct 873 -503 863 -464 849 -426 ct -p ef -1661 -212 m 1741 -192 l 1724 -126 1694 -76 1650 -41 ct 1607 -6 1553 10 1490 10 ct -1425 10 1372 -2 1331 -29 ct 1290 -56 1259 -94 1238 -145 ct 1216 -195 1206 -249 1206 -307 ct -1206 -370 1218 -425 1242 -472 ct 1266 -519 1300 -554 1345 -579 ct 1389 -603 1438 -615 1491 -615 ct -1552 -615 1603 -600 1644 -569 ct 1686 -538 1714 -495 1731 -439 ct 1652 -420 l -1638 -465 1617 -497 1591 -517 ct 1564 -537 1530 -547 1490 -547 ct 1443 -547 1404 -536 1373 -513 ct -1342 -491 1320 -461 1307 -424 ct 1295 -386 1288 -347 1288 -307 ct 1288 -256 1296 -211 1311 -172 ct -1326 -134 1349 -105 1381 -86 ct 1412 -67 1447 -58 1484 -58 ct 1529 -58 1567 -71 1598 -97 ct -1629 -122 l 1650 -161 l p ef -pom -gr -0.996 c 7835 10478 m 8893 9525 l 11010 9525 l 11010 11430 l 8893 11430 l -7835 10478 l p ef -0.000 c 7835 10478 m 8893 9525 l 11010 9525 l 11010 11430 l 8893 11430 l -7835 10478 l pc -gs -pum -8520 10768 t --1 0 m 231 -605 l 317 -605 l 565 0 l 474 0 l 403 -183 l 150 -183 l -83 0 l p -173 -248 m 378 -248 l 315 -416 l 296 -467 282 -509 272 -541 ct 264 -503 254 -464 240 -426 ct -p ef -621 0 m 621 -605 l 829 -605 l 876 -605 912 -602 937 -596 ct 972 -588 1001 -574 1026 -553 ct -1058 -526 1082 -492 1098 -450 ct 1114 -408 1121 -360 1121 -306 ct 1121 -260 1116 -219 1105 -183 ct -1095 -148 1081 -118 1064 -95 ct 1047 -72 1029 -54 1009 -40 ct 989 -27 965 -17 937 -10 ct -908 -3 876 0 839 0 ct p -701 -71 m 830 -71 l 870 -71 901 -75 924 -82 ct 947 -90 965 -100 979 -114 ct -998 -133 1012 -158 1023 -190 ct 1034 -222 1039 -261 1039 -307 ct 1039 -370 1028 -419 1008 -453 ct -987 -487 962 -510 932 -521 ct 910 -530 876 -534 828 -534 ct 701 -534 l p ef -1661 -212 m 1741 -192 l 1724 -126 1694 -76 1650 -41 ct 1607 -6 1553 10 1490 10 ct -1425 10 1372 -2 1331 -29 ct 1290 -56 1259 -94 1238 -145 ct 1216 -195 1206 -249 1206 -307 ct -1206 -370 1218 -425 1242 -472 ct 1266 -519 1300 -554 1345 -579 ct 1389 -603 1438 -615 1491 -615 ct -1552 -615 1603 -600 1644 -569 ct 1686 -538 1714 -495 1731 -439 ct 1652 -420 l -1638 -465 1617 -497 1591 -517 ct 1564 -537 1530 -547 1490 -547 ct 1443 -547 1404 -536 1373 -513 ct -1342 -491 1320 -461 1307 -424 ct 1295 -386 1288 -347 1288 -307 ct 1288 -256 1296 -211 1311 -172 ct -1326 -134 1349 -105 1381 -86 ct 1412 -67 1447 -58 1484 -58 ct 1529 -58 1567 -71 1598 -97 ct -1629 -122 l 1650 -161 l p ef -pom -gr -0.996 c 7835 14618 m 8893 13665 l 11010 13665 l 11010 15570 l 8893 15570 l -7835 14618 l p ef -0.000 c 7835 14618 m 8893 13665 l 11010 13665 l 11010 15570 l 8893 15570 l -7835 14618 l pc -gs -pum -8520 14896 t -65 0 m 65 -605 l 273 -605 l 320 -605 356 -602 381 -596 ct 416 -588 445 -574 470 -553 ct -502 -526 526 -492 542 -450 ct 558 -408 565 -360 565 -306 ct 565 -260 560 -219 549 -183 ct -539 -148 525 -118 508 -95 ct 491 -72 473 -54 453 -40 ct 433 -27 409 -17 381 -10 ct -352 -3 320 0 283 0 ct p -145 -71 m 274 -71 l 314 -71 345 -75 368 -82 ct 391 -90 409 -100 423 -114 ct -442 -133 456 -158 467 -190 ct 478 -222 483 -261 483 -307 ct 483 -370 472 -419 452 -453 ct -431 -487 406 -510 376 -521 ct 354 -530 320 -534 272 -534 ct 145 -534 l p ef -608 0 m 840 -605 l 926 -605 l 1174 0 l 1083 0 l 1012 -183 l 759 -183 l -692 0 l p -782 -248 m 987 -248 l 924 -416 l 905 -467 891 -509 881 -541 ct 873 -503 863 -464 849 -426 ct -p ef -1661 -212 m 1741 -192 l 1724 -126 1694 -76 1650 -41 ct 1607 -6 1553 10 1490 10 ct -1425 10 1372 -2 1331 -29 ct 1290 -56 1259 -94 1238 -145 ct 1216 -195 1206 -249 1206 -307 ct -1206 -370 1218 -425 1242 -472 ct 1266 -519 1300 -554 1345 -579 ct 1389 -603 1438 -615 1491 -615 ct -1552 -615 1603 -600 1644 -569 ct 1686 -538 1714 -495 1731 -439 ct 1652 -420 l -1638 -465 1617 -497 1591 -517 ct 1564 -537 1530 -547 1490 -547 ct 1443 -547 1404 -536 1373 -513 ct -1342 -491 1320 -461 1307 -424 ct 1295 -386 1288 -347 1288 -307 ct 1288 -256 1296 -211 1311 -172 ct -1326 -134 1349 -105 1381 -86 ct 1412 -67 1447 -58 1484 -58 ct 1529 -58 1567 -71 1598 -97 ct -1629 -122 l 1650 -161 l p ef -pom -gr -0.996 c 19984 7938 m 18926 6985 l 16809 6985 l 16809 8890 l 18926 8890 l -19984 7938 l p ef -0.000 c 19984 7938 m 18926 6985 l 16809 6985 l 16809 8890 l 18926 8890 l -19984 7938 l pc -gs -pum -17489 8228 t --1 0 m 231 -605 l 317 -605 l 565 0 l 474 0 l 403 -183 l 150 -183 l -83 0 l p -173 -248 m 378 -248 l 315 -416 l 296 -467 282 -509 272 -541 ct 264 -503 254 -464 240 -426 ct -p ef -621 0 m 621 -605 l 829 -605 l 876 -605 912 -602 937 -596 ct 972 -588 1001 -574 1026 -553 ct -1058 -526 1082 -492 1098 -450 ct 1114 -408 1121 -360 1121 -306 ct 1121 -260 1116 -219 1105 -183 ct -1095 -148 1081 -118 1064 -95 ct 1047 -72 1029 -54 1009 -40 ct 989 -27 965 -17 937 -10 ct -908 -3 876 0 839 0 ct p -701 -71 m 830 -71 l 870 -71 901 -75 924 -82 ct 947 -90 965 -100 979 -114 ct -998 -133 1012 -158 1023 -190 ct 1034 -222 1039 -261 1039 -307 ct 1039 -370 1028 -419 1008 -453 ct -987 -487 962 -510 932 -521 ct 910 -530 876 -534 828 -534 ct 701 -534 l p ef -1661 -212 m 1741 -192 l 1724 -126 1694 -76 1650 -41 ct 1607 -6 1553 10 1490 10 ct -1425 10 1372 -2 1331 -29 ct 1290 -56 1259 -94 1238 -145 ct 1216 -195 1206 -249 1206 -307 ct -1206 -370 1218 -425 1242 -472 ct 1266 -519 1300 -554 1345 -579 ct 1389 -603 1438 -615 1491 -615 ct -1552 -615 1603 -600 1644 -569 ct 1686 -538 1714 -495 1731 -439 ct 1652 -420 l -1638 -465 1617 -497 1591 -517 ct 1564 -537 1530 -547 1490 -547 ct 1443 -547 1404 -536 1373 -513 ct -1342 -491 1320 -461 1307 -424 ct 1295 -386 1288 -347 1288 -307 ct 1288 -256 1296 -211 1311 -172 ct -1326 -134 1349 -105 1381 -86 ct 1412 -67 1447 -58 1484 -58 ct 1529 -58 1567 -71 1598 -97 ct -1629 -122 l 1650 -161 l p ef -pom -gr -0.996 c 19984 17258 m 18926 16305 l 16809 16305 l 16809 18210 l 18926 18210 l -19984 17258 l p ef -0.000 c 19984 17258 m 18926 16305 l 16809 16305 l 16809 18210 l 18926 18210 l -19984 17258 l pc -gs -pum -17489 17542 t -65 0 m 65 -605 l 273 -605 l 320 -605 356 -602 381 -596 ct 416 -588 445 -574 470 -553 ct -502 -526 526 -492 542 -450 ct 558 -408 565 -360 565 -306 ct 565 -260 560 -219 549 -183 ct -539 -148 525 -118 508 -95 ct 491 -72 473 -54 453 -40 ct 433 -27 409 -17 381 -10 ct -352 -3 320 0 283 0 ct p -145 -71 m 274 -71 l 314 -71 345 -75 368 -82 ct 391 -90 409 -100 423 -114 ct -442 -133 456 -158 467 -190 ct 478 -222 483 -261 483 -307 ct 483 -370 472 -419 452 -453 ct -431 -487 406 -510 376 -521 ct 354 -530 320 -534 272 -534 ct 145 -534 l p ef -608 0 m 840 -605 l 926 -605 l 1174 0 l 1083 0 l 1012 -183 l 759 -183 l -692 0 l p -782 -248 m 987 -248 l 924 -416 l 905 -467 891 -509 881 -541 ct 873 -503 863 -464 849 -426 ct -p ef -1661 -212 m 1741 -192 l 1724 -126 1694 -76 1650 -41 ct 1607 -6 1553 10 1490 10 ct -1425 10 1372 -2 1331 -29 ct 1290 -56 1259 -94 1238 -145 ct 1216 -195 1206 -249 1206 -307 ct -1206 -370 1218 -425 1242 -472 ct 1266 -519 1300 -554 1345 -579 ct 1389 -603 1438 -615 1491 -615 ct -1552 -615 1603 -600 1644 -569 ct 1686 -538 1714 -495 1731 -439 ct 1652 -420 l -1638 -465 1617 -497 1591 -517 ct 1564 -537 1530 -547 1490 -547 ct 1443 -547 1404 -536 1373 -513 ct -1342 -491 1320 -461 1307 -424 ct 1295 -386 1288 -347 1288 -307 ct 1288 -256 1296 -211 1311 -172 ct -1326 -134 1349 -105 1381 -86 ct 1412 -67 1447 -58 1484 -58 ct 1529 -58 1567 -71 1598 -97 ct -1629 -122 l 1650 -161 l p ef -pom -gr -0.996 c 19984 10478 m 18926 9525 l 16809 9525 l 16809 11430 l 18926 11430 l -19984 10478 l p ef -0.000 c 19984 10478 m 18926 9525 l 16809 9525 l 16809 11430 l 18926 11430 l -19984 10478 l pc -gs -pum -17489 10768 t --1 0 m 231 -605 l 317 -605 l 565 0 l 474 0 l 403 -183 l 150 -183 l -83 0 l p -173 -248 m 378 -248 l 315 -416 l 296 -467 282 -509 272 -541 ct 264 -503 254 -464 240 -426 ct -p ef -621 0 m 621 -605 l 829 -605 l 876 -605 912 -602 937 -596 ct 972 -588 1001 -574 1026 -553 ct -1058 -526 1082 -492 1098 -450 ct 1114 -408 1121 -360 1121 -306 ct 1121 -260 1116 -219 1105 -183 ct -1095 -148 1081 -118 1064 -95 ct 1047 -72 1029 -54 1009 -40 ct 989 -27 965 -17 937 -10 ct -908 -3 876 0 839 0 ct p -701 -71 m 830 -71 l 870 -71 901 -75 924 -82 ct 947 -90 965 -100 979 -114 ct -998 -133 1012 -158 1023 -190 ct 1034 -222 1039 -261 1039 -307 ct 1039 -370 1028 -419 1008 -453 ct -987 -487 962 -510 932 -521 ct 910 -530 876 -534 828 -534 ct 701 -534 l p ef -1661 -212 m 1741 -192 l 1724 -126 1694 -76 1650 -41 ct 1607 -6 1553 10 1490 10 ct -1425 10 1372 -2 1331 -29 ct 1290 -56 1259 -94 1238 -145 ct 1216 -195 1206 -249 1206 -307 ct -1206 -370 1218 -425 1242 -472 ct 1266 -519 1300 -554 1345 -579 ct 1389 -603 1438 -615 1491 -615 ct -1552 -615 1603 -600 1644 -569 ct 1686 -538 1714 -495 1731 -439 ct 1652 -420 l -1638 -465 1617 -497 1591 -517 ct 1564 -537 1530 -547 1490 -547 ct 1443 -547 1404 -536 1373 -513 ct -1342 -491 1320 -461 1307 -424 ct 1295 -386 1288 -347 1288 -307 ct 1288 -256 1296 -211 1311 -172 ct -1326 -134 1349 -105 1381 -86 ct 1412 -67 1447 -58 1484 -58 ct 1529 -58 1567 -71 1598 -97 ct -1629 -122 l 1650 -161 l p ef -pom -gr -0.996 c 19984 14618 m 18926 13665 l 16809 13665 l 16809 15570 l 18926 15570 l -19984 14618 l p ef -0.000 c 19984 14618 m 18926 13665 l 16809 13665 l 16809 15570 l 18926 15570 l -19984 14618 l pc -gs -pum -17489 14896 t -65 0 m 65 -605 l 273 -605 l 320 -605 356 -602 381 -596 ct 416 -588 445 -574 470 -553 ct -502 -526 526 -492 542 -450 ct 558 -408 565 -360 565 -306 ct 565 -260 560 -219 549 -183 ct -539 -148 525 -118 508 -95 ct 491 -72 473 -54 453 -40 ct 433 -27 409 -17 381 -10 ct -352 -3 320 0 283 0 ct p -145 -71 m 274 -71 l 314 -71 345 -75 368 -82 ct 391 -90 409 -100 423 -114 ct -442 -133 456 -158 467 -190 ct 478 -222 483 -261 483 -307 ct 483 -370 472 -419 452 -453 ct -431 -487 406 -510 376 -521 ct 354 -530 320 -534 272 -534 ct 145 -534 l p ef -608 0 m 840 -605 l 926 -605 l 1174 0 l 1083 0 l 1012 -183 l 759 -183 l -692 0 l p -782 -248 m 987 -248 l 924 -416 l 905 -467 891 -509 881 -541 ct 873 -503 863 -464 849 -426 ct -p ef -1661 -212 m 1741 -192 l 1724 -126 1694 -76 1650 -41 ct 1607 -6 1553 10 1490 10 ct -1425 10 1372 -2 1331 -29 ct 1290 -56 1259 -94 1238 -145 ct 1216 -195 1206 -249 1206 -307 ct -1206 -370 1218 -425 1242 -472 ct 1266 -519 1300 -554 1345 -579 ct 1389 -603 1438 -615 1491 -615 ct -1552 -615 1603 -600 1644 -569 ct 1686 -538 1714 -495 1731 -439 ct 1652 -420 l -1638 -465 1617 -497 1591 -517 ct 1564 -537 1530 -547 1490 -547 ct 1443 -547 1404 -536 1373 -513 ct -1342 -491 1320 -461 1307 -424 ct 1295 -386 1288 -347 1288 -307 ct 1288 -256 1296 -211 1311 -172 ct -1326 -134 1349 -105 1381 -86 ct 1412 -67 1447 -58 1484 -58 ct 1529 -58 1567 -71 1598 -97 ct -1629 -122 l 1650 -161 l p ef -pom -gr -23767 18828 m 20592 18828 l 20592 13113 l 26942 13113 l 26942 18828 l -23767 18828 l pc -gs -pum -22133 15795 t -219 0 m 219 -534 l 19 -534 l 19 -605 l 499 -605 l 499 -534 l 299 -534 l -299 0 l p ef -583 0 m 583 -438 l 650 -438 l 650 -372 l 667 -403 683 -423 698 -433 ct -712 -443 728 -448 745 -448 ct 770 -448 796 -440 822 -424 ct 796 -355 l 778 -366 760 -371 742 -371 ct -725 -371 711 -366 698 -357 ct 685 -347 676 -333 670 -316 ct 662 -289 658 -261 658 -229 ct -658 0 l p ef -1162 -54 m 1134 -30 1108 -14 1082 -4 ct 1057 5 1029 9 1000 9 ct 952 9 915 -1 889 -25 ct -863 -48 850 -79 850 -115 ct 850 -137 855 -156 865 -174 ct 875 -192 887 -206 903 -217 ct -919 -228 937 -236 957 -241 ct 971 -245 993 -249 1023 -252 ct 1083 -259 1127 -268 1155 -278 ct -1156 -288 1156 -295 1156 -297 ct 1156 -328 1149 -349 1135 -361 ct 1116 -378 1087 -387 1050 -387 ct -1015 -387 989 -380 973 -368 ct 956 -356 944 -334 936 -303 ct 863 -313 l 869 -344 880 -369 896 -388 ct -911 -408 933 -422 961 -433 ct 990 -443 1023 -448 1061 -448 ct 1098 -448 1129 -444 1152 -435 ct -1175 -426 1193 -415 1204 -402 ct 1215 -388 1222 -371 1227 -351 ct 1229 -338 1231 -316 1231 -282 ct -1231 -183 l 1231 -114 1232 -70 1235 -52 ct 1238 -34 1245 -16 1254 0 ct 1176 0 l -1169 -15 l 1164 -33 l p -1155 -220 m 1128 -209 1088 -199 1034 -192 ct 1003 -187 982 -182 969 -177 ct -956 -171 947 -163 940 -153 ct 933 -142 929 -130 929 -117 ct 929 -97 937 -81 952 -68 ct -967 -54 989 -48 1018 -48 ct 1046 -48 1072 -54 1094 -67 ct 1117 -79 1133 -96 1143 -118 ct -1151 -135 1155 -160 1155 -192 ct p ef -1325 0 m 1325 -438 l 1392 -438 l 1392 -376 l 1424 -424 1471 -448 1532 -448 ct -1558 -448 1583 -443 1605 -434 ct 1627 -424 1643 -412 1654 -396 ct 1666 -381 1673 -363 1678 -342 ct -1680 -328 1682 -304 1682 -269 ct 1682 0 l 1607 0 l 1607 -266 l 1607 -297 1605 -319 1599 -334 ct -1593 -349 1583 -361 1568 -370 ct 1553 -379 1536 -384 1516 -384 ct 1484 -384 1457 -374 1434 -354 ct -1411 -333 1400 -295 1400 -239 ct 1400 0 l p ef -1772 -130 m 1845 -142 l 1849 -113 1861 -90 1880 -74 ct 1898 -59 1925 -51 1959 -51 ct -1993 -51 2018 -58 2035 -72 ct 2051 -85 2059 -102 2059 -121 ct 2059 -137 2052 -151 2038 -160 ct -2027 -167 2002 -175 1962 -185 ct 1907 -199 1869 -211 1848 -221 ct 1827 -231 1811 -245 1800 -263 ct -1789 -281 1784 -300 1784 -322 ct 1784 -341 1788 -359 1797 -376 ct 1806 -393 1818 -407 1834 -418 ct -1845 -426 1861 -433 1881 -439 ct 1901 -445 1923 -448 1945 -448 ct 1980 -448 2010 -443 2036 -433 ct -2062 -423 2081 -410 2094 -393 ct 2106 -376 2115 -353 2119 -325 ct 2047 -315 l -2043 -338 2034 -355 2018 -368 ct 2002 -381 1980 -387 1951 -387 ct 1917 -387 1892 -381 1878 -370 ct -1863 -359 1856 -346 1856 -330 ct 1856 -321 1859 -312 1865 -304 ct 1871 -296 1880 -290 1893 -285 ct -1901 -282 1923 -275 1959 -266 ct 2012 -251 2048 -240 2069 -231 ct 2090 -222 2106 -209 2118 -192 ct -2130 -175 2136 -154 2136 -128 ct 2136 -104 2129 -80 2114 -58 ct 2100 -36 2079 -20 2052 -8 ct -2024 3 1993 9 1959 9 ct 1902 9 1859 -1 1829 -25 ct 1799 -49 l 1780 -84 l p ef -2198 0 m 2198 -438 l 2265 -438 l 2265 -377 l 2279 -398 2297 -415 2320 -428 ct -2343 -442 2369 -448 2398 -448 ct 2430 -448 2457 -441 2478 -428 ct 2499 -414 2513 -396 2522 -371 ct -2556 -423 2602 -448 2657 -448 ct 2701 -448 2734 -436 2758 -412 ct 2781 -388 2793 -351 2793 -301 ct -2793 0 l 2719 0 l 2719 -276 l 2719 -306 2716 -327 2712 -340 ct 2707 -353 2698 -364 2685 -372 ct -2673 -380 2658 -384 2641 -384 ct 2610 -384 2584 -373 2564 -353 ct 2543 -332 2533 -300 2533 -254 ct -2533 0 l 2459 0 l 2459 -285 l 2459 -318 2453 -342 2441 -359 ct 2429 -375 2409 -384 2381 -384 ct -2360 -384 2341 -378 2323 -367 ct 2305 -356 2293 -340 2285 -319 ct 2277 -298 2273 -267 2273 -227 ct -2273 0 l p ef -2914 -520 m 2914 -605 l 2988 -605 l 2988 -520 l p -2914 0 m 2914 -438 l 2988 -438 l 2988 0 l p ef -3261 -66 m 3271 0 l 3250 3 3232 5 3215 5 ct 3188 5 3167 1 3152 -7 ct 3138 -15 3127 -26 3121 -40 ct -3115 -54 3112 -83 3112 -128 ct 3112 -380 l 3057 -380 l 3057 -438 l 3112 -438 l -3112 -547 l 3186 -591 l 3186 -438 l 3261 -438 l 3261 -380 l 3186 -380 l -3186 -124 l 3186 -103 3187 -89 3190 -83 ct 3192 -77 3197 -72 3203 -68 ct 3208 -65 3217 -63 3228 -63 ct -3236 -63 l 3247 -64 l p ef -pom -pum -20955 16748 t -65 0 m 65 -605 l 273 -605 l 320 -605 356 -602 381 -596 ct 416 -588 445 -574 470 -553 ct -502 -526 526 -492 542 -450 ct 558 -408 565 -360 565 -306 ct 565 -260 560 -219 549 -183 ct -539 -148 525 -118 508 -95 ct 491 -72 473 -54 453 -40 ct 433 -27 409 -17 381 -10 ct -352 -3 320 0 283 0 ct p -145 -71 m 274 -71 l 314 -71 345 -75 368 -82 ct 391 -90 409 -100 423 -114 ct -442 -133 456 -158 467 -190 ct 478 -222 483 -261 483 -307 ct 483 -370 472 -419 452 -453 ct -431 -487 406 -510 376 -521 ct 354 -530 320 -534 272 -534 ct 145 -534 l p ef -951 -54 m 923 -30 897 -14 871 -4 ct 846 5 818 9 789 9 ct 741 9 704 -1 678 -25 ct -652 -48 639 -79 639 -115 ct 639 -137 644 -156 654 -174 ct 664 -192 676 -206 692 -217 ct -708 -228 726 -236 746 -241 ct 760 -245 782 -249 812 -252 ct 872 -259 916 -268 944 -278 ct -945 -288 945 -295 945 -297 ct 945 -328 938 -349 924 -361 ct 905 -378 876 -387 839 -387 ct -804 -387 778 -380 762 -368 ct 745 -356 733 -334 725 -303 ct 652 -313 l 658 -344 669 -369 685 -388 ct -700 -408 722 -422 750 -433 ct 779 -443 812 -448 850 -448 ct 887 -448 918 -444 941 -435 ct -964 -426 982 -415 993 -402 ct 1004 -388 1011 -371 1016 -351 ct 1018 -338 1020 -316 1020 -282 ct -1020 -183 l 1020 -114 1021 -70 1024 -52 ct 1027 -34 1034 -16 1043 0 ct 965 0 l -958 -15 l 953 -33 l p -944 -220 m 917 -209 877 -199 823 -192 ct 792 -187 771 -182 758 -177 ct 745 -171 736 -163 729 -153 ct -722 -142 718 -130 718 -117 ct 718 -97 726 -81 741 -68 ct 756 -54 778 -48 807 -48 ct -835 -48 861 -54 883 -67 ct 906 -79 922 -96 932 -118 ct 940 -135 944 -160 944 -192 ct -p ef -1401 0 m 1401 -64 l 1367 -14 1320 9 1262 9 ct 1236 9 1212 4 1189 -4 ct 1167 -14 1150 -27 1139 -42 ct -1128 -57 1121 -75 1116 -97 ct 1113 -112 1112 -135 1112 -166 ct 1112 -438 l 1186 -438 l -1186 -195 l 1186 -156 1187 -130 1191 -116 ct 1195 -97 1205 -82 1220 -70 ct -1235 -59 1254 -54 1276 -54 ct 1299 -54 1320 -59 1339 -71 ct 1359 -82 1373 -98 1381 -117 ct -1389 -137 1393 -166 1393 -203 ct 1393 -438 l 1467 -438 l 1467 0 l p ef -1577 36 m 1649 47 l 1652 69 1660 85 1674 95 ct 1693 109 1718 116 1750 116 ct -1784 116 1811 109 1829 95 ct 1848 82 1861 62 1867 38 ct 1871 22 1873 -8 1873 -57 ct -1840 -19 1800 0 1751 0 ct 1691 0 1644 -21 1611 -65 ct 1578 -108 1562 -160 1562 -221 ct -1562 -263 1569 -302 1584 -337 ct 1600 -373 1622 -400 1650 -419 ct 1679 -438 1713 -448 1752 -448 ct -1804 -448 1846 -427 1880 -385 ct 1880 -438 l 1948 -438 l 1948 -59 l 1948 8 1941 57 1928 85 ct -1914 114 1892 136 1861 153 ct 1831 169 1794 178 1750 178 ct 1698 178 1656 166 1623 142 ct -1591 119 l 1576 83 l p -1638 -227 m 1638 -169 1650 -127 1672 -101 ct 1695 -74 1724 -61 1758 -61 ct -1793 -61 1821 -74 1844 -101 ct 1867 -127 1879 -168 1879 -224 ct 1879 -278 1867 -318 1843 -346 ct -1819 -373 1791 -387 1757 -387 ct 1724 -387 1696 -373 1673 -346 ct 1650 -319 l -1638 -280 l p ef -2066 0 m 2066 -605 l 2141 -605 l 2141 -388 l 2175 -428 2219 -448 2272 -448 ct -2304 -448 2333 -442 2357 -429 ct 2381 -416 2398 -398 2408 -376 ct 2418 -353 2424 -320 2424 -278 ct -2424 0 l 2349 0 l 2349 -278 l 2349 -315 2341 -342 2325 -359 ct 2309 -376 2286 -384 2257 -384 ct -2235 -384 2214 -378 2195 -367 ct 2175 -356 2161 -340 2153 -320 ct 2145 -301 2141 -274 2141 -240 ct -2141 0 l p ef -2705 -66 m 2715 0 l 2694 3 2676 5 2659 5 ct 2632 5 2611 1 2596 -7 ct 2582 -15 2571 -26 2565 -40 ct -2559 -54 2556 -83 2556 -128 ct 2556 -380 l 2501 -380 l 2501 -438 l 2556 -438 l -2556 -547 l 2630 -591 l 2630 -438 l 2705 -438 l 2705 -380 l 2630 -380 l -2630 -124 l 2630 -103 2631 -89 2634 -83 ct 2636 -77 2641 -72 2647 -68 ct 2652 -65 2661 -63 2672 -63 ct -2680 -63 l 2691 -64 l p ef -3081 -141 m 3157 -131 l 3145 -86 3123 -52 3090 -27 ct 3057 -2 3015 9 2965 9 ct -2900 9 2849 -9 2812 -49 ct 2774 -88 2755 -144 2755 -215 ct 2755 -289 2774 -346 2812 -387 ct -2851 -428 2900 -448 2960 -448 ct 3019 -448 3067 -428 3104 -388 ct 3141 -348 3160 -292 3160 -220 ct -3160 -215 3160 -209 3159 -200 ct 2832 -200 l 2835 -152 2849 -115 2873 -89 ct -2898 -64 2928 -51 2965 -51 ct 2992 -51 3015 -58 3035 -72 ct 3054 -87 l 3069 -109 l -p -2836 -261 m 3081 -261 l 3078 -298 3069 -326 3053 -344 ct 3030 -373 2999 -387 2961 -387 ct -2927 -387 2898 -376 2875 -353 ct 2852 -330 l 2839 -299 l p ef -3255 0 m 3255 -438 l 3322 -438 l 3322 -372 l 3339 -403 3355 -423 3370 -433 ct -3384 -443 3400 -448 3417 -448 ct 3442 -448 3468 -440 3494 -424 ct 3468 -355 l -3450 -366 3432 -371 3414 -371 ct 3397 -371 3383 -366 3370 -357 ct 3357 -347 3348 -333 3342 -316 ct -3334 -289 3330 -261 3330 -229 ct 3330 0 l p ef -3617 0 m 3548 0 l 3548 -605 l 3622 -605 l 3622 -389 l 3654 -428 3694 -448 3742 -448 ct -3769 -448 3795 -443 3819 -432 ct 3843 -421 3863 -406 3879 -386 ct 3894 -366 3906 -343 3915 -315 ct -3924 -287 3928 -257 3928 -225 ct 3928 -150 3910 -92 3873 -51 ct 3835 -10 3791 9 3739 9 ct -3687 9 3646 -11 3617 -54 ct p -3616 -222 m 3616 -170 3623 -132 3638 -108 ct 3661 -70 3693 -51 3733 -51 ct -3765 -51 3793 -65 3817 -93 ct 3840 -121 3852 -163 3852 -219 ct 3852 -277 3841 -319 3818 -346 ct -3796 -373 3768 -387 3736 -387 ct 3703 -387 3675 -373 3652 -345 ct 3628 -316 l -3616 -276 l p ef -3970 -219 m 3970 -300 3992 -360 4037 -399 ct 4075 -432 4121 -448 4175 -448 ct -4236 -448 4285 -428 4323 -389 ct 4361 -349 4381 -295 4381 -225 ct 4381 -169 4372 -124 4355 -92 ct -4338 -59 4314 -34 4281 -16 ct 4249 0 4214 9 4175 9 ct 4114 9 4064 -9 4026 -49 ct -3989 -88 l 3970 -145 l p -4046 -219 m 4046 -163 4058 -121 4083 -93 ct 4107 -65 4138 -51 4175 -51 ct 4212 -51 4243 -65 4267 -93 ct -4292 -121 4304 -164 4304 -221 ct 4304 -276 4292 -317 4267 -345 ct 4243 -373 4212 -387 4175 -387 ct -4138 -387 4107 -373 4083 -345 ct 4058 -317 l 4046 -275 l p ef -4761 -54 m 4733 -30 4707 -14 4681 -4 ct 4656 5 4628 9 4599 9 ct 4551 9 4514 -1 4488 -25 ct -4462 -48 4449 -79 4449 -115 ct 4449 -137 4454 -156 4464 -174 ct 4474 -192 4486 -206 4502 -217 ct -4518 -228 4536 -236 4556 -241 ct 4570 -245 4592 -249 4622 -252 ct 4682 -259 4726 -268 4754 -278 ct -4755 -288 4755 -295 4755 -297 ct 4755 -328 4748 -349 4734 -361 ct 4715 -378 4686 -387 4649 -387 ct -4614 -387 4588 -380 4572 -368 ct 4555 -356 4543 -334 4535 -303 ct 4462 -313 l -4468 -344 4479 -369 4495 -388 ct 4510 -408 4532 -422 4560 -433 ct 4589 -443 4622 -448 4660 -448 ct -4697 -448 4728 -444 4751 -435 ct 4774 -426 4792 -415 4803 -402 ct 4814 -388 4821 -371 4826 -351 ct -4828 -338 4830 -316 4830 -282 ct 4830 -183 l 4830 -114 4831 -70 4834 -52 ct -4837 -34 4844 -16 4853 0 ct 4775 0 l 4768 -15 l 4763 -33 l p -4754 -220 m 4727 -209 4687 -199 4633 -192 ct 4602 -187 4581 -182 4568 -177 ct -4555 -171 4546 -163 4539 -153 ct 4532 -142 4528 -130 4528 -117 ct 4528 -97 4536 -81 4551 -68 ct -4566 -54 4588 -48 4617 -48 ct 4645 -48 4671 -54 4693 -67 ct 4716 -79 4732 -96 4742 -118 ct -4750 -135 4754 -160 4754 -192 ct p ef -4922 0 m 4922 -438 l 4989 -438 l 4989 -372 l 5006 -403 5022 -423 5037 -433 ct -5051 -443 5067 -448 5084 -448 ct 5109 -448 5135 -440 5161 -424 ct 5135 -355 l -5117 -366 5099 -371 5081 -371 ct 5064 -371 5050 -366 5037 -357 ct 5024 -347 5015 -333 5009 -316 ct -5001 -289 4997 -261 4997 -229 ct 4997 0 l p ef -5499 0 m 5499 -55 l 5471 -11 5430 9 5376 9 ct 5341 9 5309 0 5280 -19 ct 5250 -38 5228 -65 5212 -99 ct -5195 -134 5187 -174 5187 -218 ct 5187 -262 5195 -302 5209 -338 ct 5224 -373 5246 -401 5275 -420 ct -5304 -439 5337 -448 5373 -448 ct 5399 -448 5423 -443 5444 -431 ct 5464 -420 5481 -406 5494 -388 ct -5494 -605 l 5568 -605 l 5568 0 l p -5264 -218 m 5264 -162 5276 -120 5299 -92 ct 5323 -65 5351 -51 5383 -51 ct 5416 -51 5443 -64 5466 -91 ct -5489 -117 5500 -158 5500 -212 ct 5500 -272 5489 -316 5465 -344 ct 5442 -373 5414 -387 5380 -387 ct -5347 -387 5319 -373 5297 -346 ct 5275 -319 l 5264 -277 l p ef -pom -gr -23767 12065 m 20592 12065 l 20592 6350 l 26942 6350 l 26942 12065 l -23767 12065 l pc -gs -pum -22239 9022 t -66 0 m 66 -605 l 335 -605 l 389 -605 430 -600 458 -589 ct 486 -578 508 -559 525 -531 ct -542 -504 550 -473 550 -440 ct 550 -397 536 -361 508 -331 ct 481 -302 438 -283 380 -275 ct -401 -265 417 -255 428 -245 ct 451 -223 473 -197 494 -164 ct 600 0 l 499 0 l -419 -125 l 395 -162 376 -190 361 -209 ct 346 -228 332 -242 320 -249 ct 308 -257 296 -263 284 -266 ct -275 -267 260 -268 239 -268 ct 146 -268 l 146 0 l p -146 -338 m 318 -338 l 355 -338 384 -342 404 -349 ct 425 -357 441 -369 451 -386 ct -462 -402 468 -420 468 -440 ct 468 -468 457 -492 436 -510 ct 416 -529 383 -538 338 -538 ct -146 -538 l p ef -965 -141 m 1041 -131 l 1029 -86 1007 -52 974 -27 ct 941 -2 899 9 849 9 ct -784 9 733 -9 696 -49 ct 658 -88 639 -144 639 -215 ct 639 -289 658 -346 696 -387 ct -735 -428 784 -448 844 -448 ct 903 -448 951 -428 988 -388 ct 1025 -348 1044 -292 1044 -220 ct -1044 -215 1044 -209 1043 -200 ct 716 -200 l 719 -152 733 -115 757 -89 ct 782 -64 812 -51 849 -51 ct -876 -51 899 -58 919 -72 ct 938 -87 l 953 -109 l p -720 -261 m 965 -261 l 962 -298 953 -326 937 -344 ct 914 -373 883 -387 845 -387 ct -811 -387 782 -376 759 -353 ct 736 -330 l 723 -299 l p ef -1427 -160 m 1500 -151 l 1492 -100 1471 -61 1438 -32 ct 1405 -4 1365 9 1317 9 ct -1257 9 1209 -9 1172 -48 ct 1136 -88 1118 -144 1118 -217 ct 1118 -265 1125 -306 1141 -342 ct -1157 -377 1181 -404 1213 -421 ct 1245 -439 1280 -448 1317 -448 ct 1365 -448 1404 -436 1434 -412 ct -1465 -388 1484 -354 1493 -309 ct 1420 -298 l 1413 -328 1401 -350 1384 -365 ct -1366 -380 1345 -387 1320 -387 ct 1283 -387 1252 -374 1229 -347 ct 1206 -320 1194 -277 1194 -219 ct -1194 -160 1205 -118 1228 -91 ct 1250 -64 1280 -51 1316 -51 ct 1345 -51 1370 -60 1389 -78 ct -1409 -95 l 1421 -123 l p ef -1864 -141 m 1940 -131 l 1928 -86 1906 -52 1873 -27 ct 1840 -2 1798 9 1748 9 ct -1683 9 1632 -9 1595 -49 ct 1557 -88 1538 -144 1538 -215 ct 1538 -289 1557 -346 1595 -387 ct -1634 -428 1683 -448 1743 -448 ct 1802 -448 1850 -428 1887 -388 ct 1924 -348 1943 -292 1943 -220 ct -1943 -215 1943 -209 1942 -200 ct 1615 -200 l 1618 -152 1632 -115 1656 -89 ct -1681 -64 1711 -51 1748 -51 ct 1775 -51 1798 -58 1818 -72 ct 1837 -87 l 1852 -109 l -p -1619 -261 m 1864 -261 l 1861 -298 1852 -326 1836 -344 ct 1813 -373 1782 -387 1744 -387 ct -1710 -387 1681 -376 1658 -353 ct 1635 -330 l 1622 -299 l p ef -2040 -520 m 2040 -605 l 2114 -605 l 2114 -520 l p -2040 0 m 2040 -438 l 2114 -438 l 2114 0 l p ef -2347 0 m 2180 -438 l 2259 -438 l 2353 -175 l 2363 -147 2372 -118 2381 -87 ct -2388 -110 2397 -138 2409 -171 ct 2506 -438 l 2583 -438 l 2417 0 l p ef -2949 -141 m 3025 -131 l 3013 -86 2991 -52 2958 -27 ct 2925 -2 2883 9 2833 9 ct -2768 9 2717 -9 2680 -49 ct 2642 -88 2623 -144 2623 -215 ct 2623 -289 2642 -346 2680 -387 ct -2719 -428 2768 -448 2828 -448 ct 2887 -448 2935 -428 2972 -388 ct 3009 -348 3028 -292 3028 -220 ct -3028 -215 3028 -209 3027 -200 ct 2700 -200 l 2703 -152 2717 -115 2741 -89 ct -2766 -64 2796 -51 2833 -51 ct 2860 -51 2883 -58 2903 -72 ct 2922 -87 l 2937 -109 l -p -2704 -261 m 2949 -261 l 2946 -298 2937 -326 2921 -344 ct 2898 -373 2867 -387 2829 -387 ct -2795 -387 2766 -376 2743 -353 ct 2720 -330 l 2707 -299 l p ef -pom -pum -20955 9975 t -65 0 m 65 -605 l 273 -605 l 320 -605 356 -602 381 -596 ct 416 -588 445 -574 470 -553 ct -502 -526 526 -492 542 -450 ct 558 -408 565 -360 565 -306 ct 565 -260 560 -219 549 -183 ct -539 -148 525 -118 508 -95 ct 491 -72 473 -54 453 -40 ct 433 -27 409 -17 381 -10 ct -352 -3 320 0 283 0 ct p -145 -71 m 274 -71 l 314 -71 345 -75 368 -82 ct 391 -90 409 -100 423 -114 ct -442 -133 456 -158 467 -190 ct 478 -222 483 -261 483 -307 ct 483 -370 472 -419 452 -453 ct -431 -487 406 -510 376 -521 ct 354 -530 320 -534 272 -534 ct 145 -534 l p ef -951 -54 m 923 -30 897 -14 871 -4 ct 846 5 818 9 789 9 ct 741 9 704 -1 678 -25 ct -652 -48 639 -79 639 -115 ct 639 -137 644 -156 654 -174 ct 664 -192 676 -206 692 -217 ct -708 -228 726 -236 746 -241 ct 760 -245 782 -249 812 -252 ct 872 -259 916 -268 944 -278 ct -945 -288 945 -295 945 -297 ct 945 -328 938 -349 924 -361 ct 905 -378 876 -387 839 -387 ct -804 -387 778 -380 762 -368 ct 745 -356 733 -334 725 -303 ct 652 -313 l 658 -344 669 -369 685 -388 ct -700 -408 722 -422 750 -433 ct 779 -443 812 -448 850 -448 ct 887 -448 918 -444 941 -435 ct -964 -426 982 -415 993 -402 ct 1004 -388 1011 -371 1016 -351 ct 1018 -338 1020 -316 1020 -282 ct -1020 -183 l 1020 -114 1021 -70 1024 -52 ct 1027 -34 1034 -16 1043 0 ct 965 0 l -958 -15 l 953 -33 l p -944 -220 m 917 -209 877 -199 823 -192 ct 792 -187 771 -182 758 -177 ct 745 -171 736 -163 729 -153 ct -722 -142 718 -130 718 -117 ct 718 -97 726 -81 741 -68 ct 756 -54 778 -48 807 -48 ct -835 -48 861 -54 883 -67 ct 906 -79 922 -96 932 -118 ct 940 -135 944 -160 944 -192 ct -p ef -1401 0 m 1401 -64 l 1367 -14 1320 9 1262 9 ct 1236 9 1212 4 1189 -4 ct 1167 -14 1150 -27 1139 -42 ct -1128 -57 1121 -75 1116 -97 ct 1113 -112 1112 -135 1112 -166 ct 1112 -438 l 1186 -438 l -1186 -195 l 1186 -156 1187 -130 1191 -116 ct 1195 -97 1205 -82 1220 -70 ct -1235 -59 1254 -54 1276 -54 ct 1299 -54 1320 -59 1339 -71 ct 1359 -82 1373 -98 1381 -117 ct -1389 -137 1393 -166 1393 -203 ct 1393 -438 l 1467 -438 l 1467 0 l p ef -1577 36 m 1649 47 l 1652 69 1660 85 1674 95 ct 1693 109 1718 116 1750 116 ct -1784 116 1811 109 1829 95 ct 1848 82 1861 62 1867 38 ct 1871 22 1873 -8 1873 -57 ct -1840 -19 1800 0 1751 0 ct 1691 0 1644 -21 1611 -65 ct 1578 -108 1562 -160 1562 -221 ct -1562 -263 1569 -302 1584 -337 ct 1600 -373 1622 -400 1650 -419 ct 1679 -438 1713 -448 1752 -448 ct -1804 -448 1846 -427 1880 -385 ct 1880 -438 l 1948 -438 l 1948 -59 l 1948 8 1941 57 1928 85 ct -1914 114 1892 136 1861 153 ct 1831 169 1794 178 1750 178 ct 1698 178 1656 166 1623 142 ct -1591 119 l 1576 83 l p -1638 -227 m 1638 -169 1650 -127 1672 -101 ct 1695 -74 1724 -61 1758 -61 ct -1793 -61 1821 -74 1844 -101 ct 1867 -127 1879 -168 1879 -224 ct 1879 -278 1867 -318 1843 -346 ct -1819 -373 1791 -387 1757 -387 ct 1724 -387 1696 -373 1673 -346 ct 1650 -319 l -1638 -280 l p ef -2066 0 m 2066 -605 l 2141 -605 l 2141 -388 l 2175 -428 2219 -448 2272 -448 ct -2304 -448 2333 -442 2357 -429 ct 2381 -416 2398 -398 2408 -376 ct 2418 -353 2424 -320 2424 -278 ct -2424 0 l 2349 0 l 2349 -278 l 2349 -315 2341 -342 2325 -359 ct 2309 -376 2286 -384 2257 -384 ct -2235 -384 2214 -378 2195 -367 ct 2175 -356 2161 -340 2153 -320 ct 2145 -301 2141 -274 2141 -240 ct -2141 0 l p ef -2705 -66 m 2715 0 l 2694 3 2676 5 2659 5 ct 2632 5 2611 1 2596 -7 ct 2582 -15 2571 -26 2565 -40 ct -2559 -54 2556 -83 2556 -128 ct 2556 -380 l 2501 -380 l 2501 -438 l 2556 -438 l -2556 -547 l 2630 -591 l 2630 -438 l 2705 -438 l 2705 -380 l 2630 -380 l -2630 -124 l 2630 -103 2631 -89 2634 -83 ct 2636 -77 2641 -72 2647 -68 ct 2652 -65 2661 -63 2672 -63 ct -2680 -63 l 2691 -64 l p ef -3081 -141 m 3157 -131 l 3145 -86 3123 -52 3090 -27 ct 3057 -2 3015 9 2965 9 ct -2900 9 2849 -9 2812 -49 ct 2774 -88 2755 -144 2755 -215 ct 2755 -289 2774 -346 2812 -387 ct -2851 -428 2900 -448 2960 -448 ct 3019 -448 3067 -428 3104 -388 ct 3141 -348 3160 -292 3160 -220 ct -3160 -215 3160 -209 3159 -200 ct 2832 -200 l 2835 -152 2849 -115 2873 -89 ct -2898 -64 2928 -51 2965 -51 ct 2992 -51 3015 -58 3035 -72 ct 3054 -87 l 3069 -109 l -p -2836 -261 m 3081 -261 l 3078 -298 3069 -326 3053 -344 ct 3030 -373 2999 -387 2961 -387 ct -2927 -387 2898 -376 2875 -353 ct 2852 -330 l 2839 -299 l p ef -3255 0 m 3255 -438 l 3322 -438 l 3322 -372 l 3339 -403 3355 -423 3370 -433 ct -3384 -443 3400 -448 3417 -448 ct 3442 -448 3468 -440 3494 -424 ct 3468 -355 l -3450 -366 3432 -371 3414 -371 ct 3397 -371 3383 -366 3370 -357 ct 3357 -347 3348 -333 3342 -316 ct -3334 -289 3330 -261 3330 -229 ct 3330 0 l p ef -3617 0 m 3548 0 l 3548 -605 l 3622 -605 l 3622 -389 l 3654 -428 3694 -448 3742 -448 ct -3769 -448 3795 -443 3819 -432 ct 3843 -421 3863 -406 3879 -386 ct 3894 -366 3906 -343 3915 -315 ct -3924 -287 3928 -257 3928 -225 ct 3928 -150 3910 -92 3873 -51 ct 3835 -10 3791 9 3739 9 ct -3687 9 3646 -11 3617 -54 ct p -3616 -222 m 3616 -170 3623 -132 3638 -108 ct 3661 -70 3693 -51 3733 -51 ct -3765 -51 3793 -65 3817 -93 ct 3840 -121 3852 -163 3852 -219 ct 3852 -277 3841 -319 3818 -346 ct -3796 -373 3768 -387 3736 -387 ct 3703 -387 3675 -373 3652 -345 ct 3628 -316 l -3616 -276 l p ef -3970 -219 m 3970 -300 3992 -360 4037 -399 ct 4075 -432 4121 -448 4175 -448 ct -4236 -448 4285 -428 4323 -389 ct 4361 -349 4381 -295 4381 -225 ct 4381 -169 4372 -124 4355 -92 ct -4338 -59 4314 -34 4281 -16 ct 4249 0 4214 9 4175 9 ct 4114 9 4064 -9 4026 -49 ct -3989 -88 l 3970 -145 l p -4046 -219 m 4046 -163 4058 -121 4083 -93 ct 4107 -65 4138 -51 4175 -51 ct 4212 -51 4243 -65 4267 -93 ct -4292 -121 4304 -164 4304 -221 ct 4304 -276 4292 -317 4267 -345 ct 4243 -373 4212 -387 4175 -387 ct -4138 -387 4107 -373 4083 -345 ct 4058 -317 l 4046 -275 l p ef -4761 -54 m 4733 -30 4707 -14 4681 -4 ct 4656 5 4628 9 4599 9 ct 4551 9 4514 -1 4488 -25 ct -4462 -48 4449 -79 4449 -115 ct 4449 -137 4454 -156 4464 -174 ct 4474 -192 4486 -206 4502 -217 ct -4518 -228 4536 -236 4556 -241 ct 4570 -245 4592 -249 4622 -252 ct 4682 -259 4726 -268 4754 -278 ct -4755 -288 4755 -295 4755 -297 ct 4755 -328 4748 -349 4734 -361 ct 4715 -378 4686 -387 4649 -387 ct -4614 -387 4588 -380 4572 -368 ct 4555 -356 4543 -334 4535 -303 ct 4462 -313 l -4468 -344 4479 -369 4495 -388 ct 4510 -408 4532 -422 4560 -433 ct 4589 -443 4622 -448 4660 -448 ct -4697 -448 4728 -444 4751 -435 ct 4774 -426 4792 -415 4803 -402 ct 4814 -388 4821 -371 4826 -351 ct -4828 -338 4830 -316 4830 -282 ct 4830 -183 l 4830 -114 4831 -70 4834 -52 ct -4837 -34 4844 -16 4853 0 ct 4775 0 l 4768 -15 l 4763 -33 l p -4754 -220 m 4727 -209 4687 -199 4633 -192 ct 4602 -187 4581 -182 4568 -177 ct -4555 -171 4546 -163 4539 -153 ct 4532 -142 4528 -130 4528 -117 ct 4528 -97 4536 -81 4551 -68 ct -4566 -54 4588 -48 4617 -48 ct 4645 -48 4671 -54 4693 -67 ct 4716 -79 4732 -96 4742 -118 ct -4750 -135 4754 -160 4754 -192 ct p ef -4922 0 m 4922 -438 l 4989 -438 l 4989 -372 l 5006 -403 5022 -423 5037 -433 ct -5051 -443 5067 -448 5084 -448 ct 5109 -448 5135 -440 5161 -424 ct 5135 -355 l -5117 -366 5099 -371 5081 -371 ct 5064 -371 5050 -366 5037 -357 ct 5024 -347 5015 -333 5009 -316 ct -5001 -289 4997 -261 4997 -229 ct 4997 0 l p ef -5499 0 m 5499 -55 l 5471 -11 5430 9 5376 9 ct 5341 9 5309 0 5280 -19 ct 5250 -38 5228 -65 5212 -99 ct -5195 -134 5187 -174 5187 -218 ct 5187 -262 5195 -302 5209 -338 ct 5224 -373 5246 -401 5275 -420 ct -5304 -439 5337 -448 5373 -448 ct 5399 -448 5423 -443 5444 -431 ct 5464 -420 5481 -406 5494 -388 ct -5494 -605 l 5568 -605 l 5568 0 l p -5264 -218 m 5264 -162 5276 -120 5299 -92 ct 5323 -65 5351 -51 5383 -51 ct 5416 -51 5443 -64 5466 -91 ct -5489 -117 5500 -158 5500 -212 ct 5500 -272 5489 -316 5465 -344 ct 5442 -373 5414 -387 5380 -387 ct -5347 -387 5319 -373 5297 -346 ct 5275 -319 l 5264 -277 l p ef -pom -gr -4245 18828 m 1070 18828 l 1070 13113 l 7420 13113 l 7420 18828 l 4245 18828 l -pc -gs -pum -2607 15795 t -219 0 m 219 -534 l 19 -534 l 19 -605 l 499 -605 l 499 -534 l 299 -534 l -299 0 l p ef -583 0 m 583 -438 l 650 -438 l 650 -372 l 667 -403 683 -423 698 -433 ct -712 -443 728 -448 745 -448 ct 770 -448 796 -440 822 -424 ct 796 -355 l 778 -366 760 -371 742 -371 ct -725 -371 711 -366 698 -357 ct 685 -347 676 -333 670 -316 ct 662 -289 658 -261 658 -229 ct -658 0 l p ef -1162 -54 m 1134 -30 1108 -14 1082 -4 ct 1057 5 1029 9 1000 9 ct 952 9 915 -1 889 -25 ct -863 -48 850 -79 850 -115 ct 850 -137 855 -156 865 -174 ct 875 -192 887 -206 903 -217 ct -919 -228 937 -236 957 -241 ct 971 -245 993 -249 1023 -252 ct 1083 -259 1127 -268 1155 -278 ct -1156 -288 1156 -295 1156 -297 ct 1156 -328 1149 -349 1135 -361 ct 1116 -378 1087 -387 1050 -387 ct -1015 -387 989 -380 973 -368 ct 956 -356 944 -334 936 -303 ct 863 -313 l 869 -344 880 -369 896 -388 ct -911 -408 933 -422 961 -433 ct 990 -443 1023 -448 1061 -448 ct 1098 -448 1129 -444 1152 -435 ct -1175 -426 1193 -415 1204 -402 ct 1215 -388 1222 -371 1227 -351 ct 1229 -338 1231 -316 1231 -282 ct -1231 -183 l 1231 -114 1232 -70 1235 -52 ct 1238 -34 1245 -16 1254 0 ct 1176 0 l -1169 -15 l 1164 -33 l p -1155 -220 m 1128 -209 1088 -199 1034 -192 ct 1003 -187 982 -182 969 -177 ct -956 -171 947 -163 940 -153 ct 933 -142 929 -130 929 -117 ct 929 -97 937 -81 952 -68 ct -967 -54 989 -48 1018 -48 ct 1046 -48 1072 -54 1094 -67 ct 1117 -79 1133 -96 1143 -118 ct -1151 -135 1155 -160 1155 -192 ct p ef -1325 0 m 1325 -438 l 1392 -438 l 1392 -376 l 1424 -424 1471 -448 1532 -448 ct -1558 -448 1583 -443 1605 -434 ct 1627 -424 1643 -412 1654 -396 ct 1666 -381 1673 -363 1678 -342 ct -1680 -328 1682 -304 1682 -269 ct 1682 0 l 1607 0 l 1607 -266 l 1607 -297 1605 -319 1599 -334 ct -1593 -349 1583 -361 1568 -370 ct 1553 -379 1536 -384 1516 -384 ct 1484 -384 1457 -374 1434 -354 ct -1411 -333 1400 -295 1400 -239 ct 1400 0 l p ef -1772 -130 m 1845 -142 l 1849 -113 1861 -90 1880 -74 ct 1898 -59 1925 -51 1959 -51 ct -1993 -51 2018 -58 2035 -72 ct 2051 -85 2059 -102 2059 -121 ct 2059 -137 2052 -151 2038 -160 ct -2027 -167 2002 -175 1962 -185 ct 1907 -199 1869 -211 1848 -221 ct 1827 -231 1811 -245 1800 -263 ct -1789 -281 1784 -300 1784 -322 ct 1784 -341 1788 -359 1797 -376 ct 1806 -393 1818 -407 1834 -418 ct -1845 -426 1861 -433 1881 -439 ct 1901 -445 1923 -448 1945 -448 ct 1980 -448 2010 -443 2036 -433 ct -2062 -423 2081 -410 2094 -393 ct 2106 -376 2115 -353 2119 -325 ct 2047 -315 l -2043 -338 2034 -355 2018 -368 ct 2002 -381 1980 -387 1951 -387 ct 1917 -387 1892 -381 1878 -370 ct -1863 -359 1856 -346 1856 -330 ct 1856 -321 1859 -312 1865 -304 ct 1871 -296 1880 -290 1893 -285 ct -1901 -282 1923 -275 1959 -266 ct 2012 -251 2048 -240 2069 -231 ct 2090 -222 2106 -209 2118 -192 ct -2130 -175 2136 -154 2136 -128 ct 2136 -104 2129 -80 2114 -58 ct 2100 -36 2079 -20 2052 -8 ct -2024 3 1993 9 1959 9 ct 1902 9 1859 -1 1829 -25 ct 1799 -49 l 1780 -84 l p ef -2198 0 m 2198 -438 l 2265 -438 l 2265 -377 l 2279 -398 2297 -415 2320 -428 ct -2343 -442 2369 -448 2398 -448 ct 2430 -448 2457 -441 2478 -428 ct 2499 -414 2513 -396 2522 -371 ct -2556 -423 2602 -448 2657 -448 ct 2701 -448 2734 -436 2758 -412 ct 2781 -388 2793 -351 2793 -301 ct -2793 0 l 2719 0 l 2719 -276 l 2719 -306 2716 -327 2712 -340 ct 2707 -353 2698 -364 2685 -372 ct -2673 -380 2658 -384 2641 -384 ct 2610 -384 2584 -373 2564 -353 ct 2543 -332 2533 -300 2533 -254 ct -2533 0 l 2459 0 l 2459 -285 l 2459 -318 2453 -342 2441 -359 ct 2429 -375 2409 -384 2381 -384 ct -2360 -384 2341 -378 2323 -367 ct 2305 -356 2293 -340 2285 -319 ct 2277 -298 2273 -267 2273 -227 ct -2273 0 l p ef -2914 -520 m 2914 -605 l 2988 -605 l 2988 -520 l p -2914 0 m 2914 -438 l 2988 -438 l 2988 0 l p ef -3261 -66 m 3271 0 l 3250 3 3232 5 3215 5 ct 3188 5 3167 1 3152 -7 ct 3138 -15 3127 -26 3121 -40 ct -3115 -54 3112 -83 3112 -128 ct 3112 -380 l 3057 -380 l 3057 -438 l 3112 -438 l -3112 -547 l 3186 -591 l 3186 -438 l 3261 -438 l 3261 -380 l 3186 -380 l -3186 -124 l 3186 -103 3187 -89 3190 -83 ct 3192 -77 3197 -72 3203 -68 ct 3208 -65 3217 -63 3228 -63 ct -3236 -63 l 3247 -64 l p ef -pom -pum -1429 16748 t -65 0 m 65 -605 l 273 -605 l 320 -605 356 -602 381 -596 ct 416 -588 445 -574 470 -553 ct -502 -526 526 -492 542 -450 ct 558 -408 565 -360 565 -306 ct 565 -260 560 -219 549 -183 ct -539 -148 525 -118 508 -95 ct 491 -72 473 -54 453 -40 ct 433 -27 409 -17 381 -10 ct -352 -3 320 0 283 0 ct p -145 -71 m 274 -71 l 314 -71 345 -75 368 -82 ct 391 -90 409 -100 423 -114 ct -442 -133 456 -158 467 -190 ct 478 -222 483 -261 483 -307 ct 483 -370 472 -419 452 -453 ct -431 -487 406 -510 376 -521 ct 354 -530 320 -534 272 -534 ct 145 -534 l p ef -951 -54 m 923 -30 897 -14 871 -4 ct 846 5 818 9 789 9 ct 741 9 704 -1 678 -25 ct -652 -48 639 -79 639 -115 ct 639 -137 644 -156 654 -174 ct 664 -192 676 -206 692 -217 ct -708 -228 726 -236 746 -241 ct 760 -245 782 -249 812 -252 ct 872 -259 916 -268 944 -278 ct -945 -288 945 -295 945 -297 ct 945 -328 938 -349 924 -361 ct 905 -378 876 -387 839 -387 ct -804 -387 778 -380 762 -368 ct 745 -356 733 -334 725 -303 ct 652 -313 l 658 -344 669 -369 685 -388 ct -700 -408 722 -422 750 -433 ct 779 -443 812 -448 850 -448 ct 887 -448 918 -444 941 -435 ct -964 -426 982 -415 993 -402 ct 1004 -388 1011 -371 1016 -351 ct 1018 -338 1020 -316 1020 -282 ct -1020 -183 l 1020 -114 1021 -70 1024 -52 ct 1027 -34 1034 -16 1043 0 ct 965 0 l -958 -15 l 953 -33 l p -944 -220 m 917 -209 877 -199 823 -192 ct 792 -187 771 -182 758 -177 ct 745 -171 736 -163 729 -153 ct -722 -142 718 -130 718 -117 ct 718 -97 726 -81 741 -68 ct 756 -54 778 -48 807 -48 ct -835 -48 861 -54 883 -67 ct 906 -79 922 -96 932 -118 ct 940 -135 944 -160 944 -192 ct -p ef -1401 0 m 1401 -64 l 1367 -14 1320 9 1262 9 ct 1236 9 1212 4 1189 -4 ct 1167 -14 1150 -27 1139 -42 ct -1128 -57 1121 -75 1116 -97 ct 1113 -112 1112 -135 1112 -166 ct 1112 -438 l 1186 -438 l -1186 -195 l 1186 -156 1187 -130 1191 -116 ct 1195 -97 1205 -82 1220 -70 ct -1235 -59 1254 -54 1276 -54 ct 1299 -54 1320 -59 1339 -71 ct 1359 -82 1373 -98 1381 -117 ct -1389 -137 1393 -166 1393 -203 ct 1393 -438 l 1467 -438 l 1467 0 l p ef -1577 36 m 1649 47 l 1652 69 1660 85 1674 95 ct 1693 109 1718 116 1750 116 ct -1784 116 1811 109 1829 95 ct 1848 82 1861 62 1867 38 ct 1871 22 1873 -8 1873 -57 ct -1840 -19 1800 0 1751 0 ct 1691 0 1644 -21 1611 -65 ct 1578 -108 1562 -160 1562 -221 ct -1562 -263 1569 -302 1584 -337 ct 1600 -373 1622 -400 1650 -419 ct 1679 -438 1713 -448 1752 -448 ct -1804 -448 1846 -427 1880 -385 ct 1880 -438 l 1948 -438 l 1948 -59 l 1948 8 1941 57 1928 85 ct -1914 114 1892 136 1861 153 ct 1831 169 1794 178 1750 178 ct 1698 178 1656 166 1623 142 ct -1591 119 l 1576 83 l p -1638 -227 m 1638 -169 1650 -127 1672 -101 ct 1695 -74 1724 -61 1758 -61 ct -1793 -61 1821 -74 1844 -101 ct 1867 -127 1879 -168 1879 -224 ct 1879 -278 1867 -318 1843 -346 ct -1819 -373 1791 -387 1757 -387 ct 1724 -387 1696 -373 1673 -346 ct 1650 -319 l -1638 -280 l p ef -2066 0 m 2066 -605 l 2141 -605 l 2141 -388 l 2175 -428 2219 -448 2272 -448 ct -2304 -448 2333 -442 2357 -429 ct 2381 -416 2398 -398 2408 -376 ct 2418 -353 2424 -320 2424 -278 ct -2424 0 l 2349 0 l 2349 -278 l 2349 -315 2341 -342 2325 -359 ct 2309 -376 2286 -384 2257 -384 ct -2235 -384 2214 -378 2195 -367 ct 2175 -356 2161 -340 2153 -320 ct 2145 -301 2141 -274 2141 -240 ct -2141 0 l p ef -2705 -66 m 2715 0 l 2694 3 2676 5 2659 5 ct 2632 5 2611 1 2596 -7 ct 2582 -15 2571 -26 2565 -40 ct -2559 -54 2556 -83 2556 -128 ct 2556 -380 l 2501 -380 l 2501 -438 l 2556 -438 l -2556 -547 l 2630 -591 l 2630 -438 l 2705 -438 l 2705 -380 l 2630 -380 l -2630 -124 l 2630 -103 2631 -89 2634 -83 ct 2636 -77 2641 -72 2647 -68 ct 2652 -65 2661 -63 2672 -63 ct -2680 -63 l 2691 -64 l p ef -3081 -141 m 3157 -131 l 3145 -86 3123 -52 3090 -27 ct 3057 -2 3015 9 2965 9 ct -2900 9 2849 -9 2812 -49 ct 2774 -88 2755 -144 2755 -215 ct 2755 -289 2774 -346 2812 -387 ct -2851 -428 2900 -448 2960 -448 ct 3019 -448 3067 -428 3104 -388 ct 3141 -348 3160 -292 3160 -220 ct -3160 -215 3160 -209 3159 -200 ct 2832 -200 l 2835 -152 2849 -115 2873 -89 ct -2898 -64 2928 -51 2965 -51 ct 2992 -51 3015 -58 3035 -72 ct 3054 -87 l 3069 -109 l -p -2836 -261 m 3081 -261 l 3078 -298 3069 -326 3053 -344 ct 3030 -373 2999 -387 2961 -387 ct -2927 -387 2898 -376 2875 -353 ct 2852 -330 l 2839 -299 l p ef -3255 0 m 3255 -438 l 3322 -438 l 3322 -372 l 3339 -403 3355 -423 3370 -433 ct -3384 -443 3400 -448 3417 -448 ct 3442 -448 3468 -440 3494 -424 ct 3468 -355 l -3450 -366 3432 -371 3414 -371 ct 3397 -371 3383 -366 3370 -357 ct 3357 -347 3348 -333 3342 -316 ct -3334 -289 3330 -261 3330 -229 ct 3330 0 l p ef -3617 0 m 3548 0 l 3548 -605 l 3622 -605 l 3622 -389 l 3654 -428 3694 -448 3742 -448 ct -3769 -448 3795 -443 3819 -432 ct 3843 -421 3863 -406 3879 -386 ct 3894 -366 3906 -343 3915 -315 ct -3924 -287 3928 -257 3928 -225 ct 3928 -150 3910 -92 3873 -51 ct 3835 -10 3791 9 3739 9 ct -3687 9 3646 -11 3617 -54 ct p -3616 -222 m 3616 -170 3623 -132 3638 -108 ct 3661 -70 3693 -51 3733 -51 ct -3765 -51 3793 -65 3817 -93 ct 3840 -121 3852 -163 3852 -219 ct 3852 -277 3841 -319 3818 -346 ct -3796 -373 3768 -387 3736 -387 ct 3703 -387 3675 -373 3652 -345 ct 3628 -316 l -3616 -276 l p ef -3970 -219 m 3970 -300 3992 -360 4037 -399 ct 4075 -432 4121 -448 4175 -448 ct -4236 -448 4285 -428 4323 -389 ct 4361 -349 4381 -295 4381 -225 ct 4381 -169 4372 -124 4355 -92 ct -4338 -59 4314 -34 4281 -16 ct 4249 0 4214 9 4175 9 ct 4114 9 4064 -9 4026 -49 ct -3989 -88 l 3970 -145 l p -4046 -219 m 4046 -163 4058 -121 4083 -93 ct 4107 -65 4138 -51 4175 -51 ct 4212 -51 4243 -65 4267 -93 ct -4292 -121 4304 -164 4304 -221 ct 4304 -276 4292 -317 4267 -345 ct 4243 -373 4212 -387 4175 -387 ct -4138 -387 4107 -373 4083 -345 ct 4058 -317 l 4046 -275 l p ef -4761 -54 m 4733 -30 4707 -14 4681 -4 ct 4656 5 4628 9 4599 9 ct 4551 9 4514 -1 4488 -25 ct -4462 -48 4449 -79 4449 -115 ct 4449 -137 4454 -156 4464 -174 ct 4474 -192 4486 -206 4502 -217 ct -4518 -228 4536 -236 4556 -241 ct 4570 -245 4592 -249 4622 -252 ct 4682 -259 4726 -268 4754 -278 ct -4755 -288 4755 -295 4755 -297 ct 4755 -328 4748 -349 4734 -361 ct 4715 -378 4686 -387 4649 -387 ct -4614 -387 4588 -380 4572 -368 ct 4555 -356 4543 -334 4535 -303 ct 4462 -313 l -4468 -344 4479 -369 4495 -388 ct 4510 -408 4532 -422 4560 -433 ct 4589 -443 4622 -448 4660 -448 ct -4697 -448 4728 -444 4751 -435 ct 4774 -426 4792 -415 4803 -402 ct 4814 -388 4821 -371 4826 -351 ct -4828 -338 4830 -316 4830 -282 ct 4830 -183 l 4830 -114 4831 -70 4834 -52 ct -4837 -34 4844 -16 4853 0 ct 4775 0 l 4768 -15 l 4763 -33 l p -4754 -220 m 4727 -209 4687 -199 4633 -192 ct 4602 -187 4581 -182 4568 -177 ct -4555 -171 4546 -163 4539 -153 ct 4532 -142 4528 -130 4528 -117 ct 4528 -97 4536 -81 4551 -68 ct -4566 -54 4588 -48 4617 -48 ct 4645 -48 4671 -54 4693 -67 ct 4716 -79 4732 -96 4742 -118 ct -4750 -135 4754 -160 4754 -192 ct p ef -4922 0 m 4922 -438 l 4989 -438 l 4989 -372 l 5006 -403 5022 -423 5037 -433 ct -5051 -443 5067 -448 5084 -448 ct 5109 -448 5135 -440 5161 -424 ct 5135 -355 l -5117 -366 5099 -371 5081 -371 ct 5064 -371 5050 -366 5037 -357 ct 5024 -347 5015 -333 5009 -316 ct -5001 -289 4997 -261 4997 -229 ct 4997 0 l p ef -5499 0 m 5499 -55 l 5471 -11 5430 9 5376 9 ct 5341 9 5309 0 5280 -19 ct 5250 -38 5228 -65 5212 -99 ct -5195 -134 5187 -174 5187 -218 ct 5187 -262 5195 -302 5209 -338 ct 5224 -373 5246 -401 5275 -420 ct -5304 -439 5337 -448 5373 -448 ct 5399 -448 5423 -443 5444 -431 ct 5464 -420 5481 -406 5494 -388 ct -5494 -605 l 5568 -605 l 5568 0 l p -5264 -218 m 5264 -162 5276 -120 5299 -92 ct 5323 -65 5351 -51 5383 -51 ct 5416 -51 5443 -64 5466 -91 ct -5489 -117 5500 -158 5500 -212 ct 5500 -272 5489 -316 5465 -344 ct 5442 -373 5414 -387 5380 -387 ct -5347 -387 5319 -373 5297 -346 ct 5275 -319 l 5264 -277 l p ef -pom -gr -4245 12065 m 1070 12065 l 1070 6350 l 7420 6350 l 7420 12065 l 4245 12065 l -pc -gs -pum -2713 9022 t -66 0 m 66 -605 l 335 -605 l 389 -605 430 -600 458 -589 ct 486 -578 508 -559 525 -531 ct -542 -504 550 -473 550 -440 ct 550 -397 536 -361 508 -331 ct 481 -302 438 -283 380 -275 ct -401 -265 417 -255 428 -245 ct 451 -223 473 -197 494 -164 ct 600 0 l 499 0 l -419 -125 l 395 -162 376 -190 361 -209 ct 346 -228 332 -242 320 -249 ct 308 -257 296 -263 284 -266 ct -275 -267 260 -268 239 -268 ct 146 -268 l 146 0 l p -146 -338 m 318 -338 l 355 -338 384 -342 404 -349 ct 425 -357 441 -369 451 -386 ct -462 -402 468 -420 468 -440 ct 468 -468 457 -492 436 -510 ct 416 -529 383 -538 338 -538 ct -146 -538 l p ef -965 -141 m 1041 -131 l 1029 -86 1007 -52 974 -27 ct 941 -2 899 9 849 9 ct -784 9 733 -9 696 -49 ct 658 -88 639 -144 639 -215 ct 639 -289 658 -346 696 -387 ct -735 -428 784 -448 844 -448 ct 903 -448 951 -428 988 -388 ct 1025 -348 1044 -292 1044 -220 ct -1044 -215 1044 -209 1043 -200 ct 716 -200 l 719 -152 733 -115 757 -89 ct 782 -64 812 -51 849 -51 ct -876 -51 899 -58 919 -72 ct 938 -87 l 953 -109 l p -720 -261 m 965 -261 l 962 -298 953 -326 937 -344 ct 914 -373 883 -387 845 -387 ct -811 -387 782 -376 759 -353 ct 736 -330 l 723 -299 l p ef -1427 -160 m 1500 -151 l 1492 -100 1471 -61 1438 -32 ct 1405 -4 1365 9 1317 9 ct -1257 9 1209 -9 1172 -48 ct 1136 -88 1118 -144 1118 -217 ct 1118 -265 1125 -306 1141 -342 ct -1157 -377 1181 -404 1213 -421 ct 1245 -439 1280 -448 1317 -448 ct 1365 -448 1404 -436 1434 -412 ct -1465 -388 1484 -354 1493 -309 ct 1420 -298 l 1413 -328 1401 -350 1384 -365 ct -1366 -380 1345 -387 1320 -387 ct 1283 -387 1252 -374 1229 -347 ct 1206 -320 1194 -277 1194 -219 ct -1194 -160 1205 -118 1228 -91 ct 1250 -64 1280 -51 1316 -51 ct 1345 -51 1370 -60 1389 -78 ct -1409 -95 l 1421 -123 l p ef -1864 -141 m 1940 -131 l 1928 -86 1906 -52 1873 -27 ct 1840 -2 1798 9 1748 9 ct -1683 9 1632 -9 1595 -49 ct 1557 -88 1538 -144 1538 -215 ct 1538 -289 1557 -346 1595 -387 ct -1634 -428 1683 -448 1743 -448 ct 1802 -448 1850 -428 1887 -388 ct 1924 -348 1943 -292 1943 -220 ct -1943 -215 1943 -209 1942 -200 ct 1615 -200 l 1618 -152 1632 -115 1656 -89 ct -1681 -64 1711 -51 1748 -51 ct 1775 -51 1798 -58 1818 -72 ct 1837 -87 l 1852 -109 l -p -1619 -261 m 1864 -261 l 1861 -298 1852 -326 1836 -344 ct 1813 -373 1782 -387 1744 -387 ct -1710 -387 1681 -376 1658 -353 ct 1635 -330 l 1622 -299 l p ef -2040 -520 m 2040 -605 l 2114 -605 l 2114 -520 l p -2040 0 m 2040 -438 l 2114 -438 l 2114 0 l p ef -2347 0 m 2180 -438 l 2259 -438 l 2353 -175 l 2363 -147 2372 -118 2381 -87 ct -2388 -110 2397 -138 2409 -171 ct 2506 -438 l 2583 -438 l 2417 0 l p ef -2949 -141 m 3025 -131 l 3013 -86 2991 -52 2958 -27 ct 2925 -2 2883 9 2833 9 ct -2768 9 2717 -9 2680 -49 ct 2642 -88 2623 -144 2623 -215 ct 2623 -289 2642 -346 2680 -387 ct -2719 -428 2768 -448 2828 -448 ct 2887 -448 2935 -428 2972 -388 ct 3009 -348 3028 -292 3028 -220 ct -3028 -215 3028 -209 3027 -200 ct 2700 -200 l 2703 -152 2717 -115 2741 -89 ct -2766 -64 2796 -51 2833 -51 ct 2860 -51 2883 -58 2903 -72 ct 2922 -87 l 2937 -109 l -p -2704 -261 m 2949 -261 l 2946 -298 2937 -326 2921 -344 ct 2898 -373 2867 -387 2829 -387 ct -2795 -387 2766 -376 2743 -353 ct 2720 -330 l 2707 -299 l p ef -pom -pum -1429 9975 t -65 0 m 65 -605 l 273 -605 l 320 -605 356 -602 381 -596 ct 416 -588 445 -574 470 -553 ct -502 -526 526 -492 542 -450 ct 558 -408 565 -360 565 -306 ct 565 -260 560 -219 549 -183 ct -539 -148 525 -118 508 -95 ct 491 -72 473 -54 453 -40 ct 433 -27 409 -17 381 -10 ct -352 -3 320 0 283 0 ct p -145 -71 m 274 -71 l 314 -71 345 -75 368 -82 ct 391 -90 409 -100 423 -114 ct -442 -133 456 -158 467 -190 ct 478 -222 483 -261 483 -307 ct 483 -370 472 -419 452 -453 ct -431 -487 406 -510 376 -521 ct 354 -530 320 -534 272 -534 ct 145 -534 l p ef -951 -54 m 923 -30 897 -14 871 -4 ct 846 5 818 9 789 9 ct 741 9 704 -1 678 -25 ct -652 -48 639 -79 639 -115 ct 639 -137 644 -156 654 -174 ct 664 -192 676 -206 692 -217 ct -708 -228 726 -236 746 -241 ct 760 -245 782 -249 812 -252 ct 872 -259 916 -268 944 -278 ct -945 -288 945 -295 945 -297 ct 945 -328 938 -349 924 -361 ct 905 -378 876 -387 839 -387 ct -804 -387 778 -380 762 -368 ct 745 -356 733 -334 725 -303 ct 652 -313 l 658 -344 669 -369 685 -388 ct -700 -408 722 -422 750 -433 ct 779 -443 812 -448 850 -448 ct 887 -448 918 -444 941 -435 ct -964 -426 982 -415 993 -402 ct 1004 -388 1011 -371 1016 -351 ct 1018 -338 1020 -316 1020 -282 ct -1020 -183 l 1020 -114 1021 -70 1024 -52 ct 1027 -34 1034 -16 1043 0 ct 965 0 l -958 -15 l 953 -33 l p -944 -220 m 917 -209 877 -199 823 -192 ct 792 -187 771 -182 758 -177 ct 745 -171 736 -163 729 -153 ct -722 -142 718 -130 718 -117 ct 718 -97 726 -81 741 -68 ct 756 -54 778 -48 807 -48 ct -835 -48 861 -54 883 -67 ct 906 -79 922 -96 932 -118 ct 940 -135 944 -160 944 -192 ct -p ef -1401 0 m 1401 -64 l 1367 -14 1320 9 1262 9 ct 1236 9 1212 4 1189 -4 ct 1167 -14 1150 -27 1139 -42 ct -1128 -57 1121 -75 1116 -97 ct 1113 -112 1112 -135 1112 -166 ct 1112 -438 l 1186 -438 l -1186 -195 l 1186 -156 1187 -130 1191 -116 ct 1195 -97 1205 -82 1220 -70 ct -1235 -59 1254 -54 1276 -54 ct 1299 -54 1320 -59 1339 -71 ct 1359 -82 1373 -98 1381 -117 ct -1389 -137 1393 -166 1393 -203 ct 1393 -438 l 1467 -438 l 1467 0 l p ef -1577 36 m 1649 47 l 1652 69 1660 85 1674 95 ct 1693 109 1718 116 1750 116 ct -1784 116 1811 109 1829 95 ct 1848 82 1861 62 1867 38 ct 1871 22 1873 -8 1873 -57 ct -1840 -19 1800 0 1751 0 ct 1691 0 1644 -21 1611 -65 ct 1578 -108 1562 -160 1562 -221 ct -1562 -263 1569 -302 1584 -337 ct 1600 -373 1622 -400 1650 -419 ct 1679 -438 1713 -448 1752 -448 ct -1804 -448 1846 -427 1880 -385 ct 1880 -438 l 1948 -438 l 1948 -59 l 1948 8 1941 57 1928 85 ct -1914 114 1892 136 1861 153 ct 1831 169 1794 178 1750 178 ct 1698 178 1656 166 1623 142 ct -1591 119 l 1576 83 l p -1638 -227 m 1638 -169 1650 -127 1672 -101 ct 1695 -74 1724 -61 1758 -61 ct -1793 -61 1821 -74 1844 -101 ct 1867 -127 1879 -168 1879 -224 ct 1879 -278 1867 -318 1843 -346 ct -1819 -373 1791 -387 1757 -387 ct 1724 -387 1696 -373 1673 -346 ct 1650 -319 l -1638 -280 l p ef -2066 0 m 2066 -605 l 2141 -605 l 2141 -388 l 2175 -428 2219 -448 2272 -448 ct -2304 -448 2333 -442 2357 -429 ct 2381 -416 2398 -398 2408 -376 ct 2418 -353 2424 -320 2424 -278 ct -2424 0 l 2349 0 l 2349 -278 l 2349 -315 2341 -342 2325 -359 ct 2309 -376 2286 -384 2257 -384 ct -2235 -384 2214 -378 2195 -367 ct 2175 -356 2161 -340 2153 -320 ct 2145 -301 2141 -274 2141 -240 ct -2141 0 l p ef -2705 -66 m 2715 0 l 2694 3 2676 5 2659 5 ct 2632 5 2611 1 2596 -7 ct 2582 -15 2571 -26 2565 -40 ct -2559 -54 2556 -83 2556 -128 ct 2556 -380 l 2501 -380 l 2501 -438 l 2556 -438 l -2556 -547 l 2630 -591 l 2630 -438 l 2705 -438 l 2705 -380 l 2630 -380 l -2630 -124 l 2630 -103 2631 -89 2634 -83 ct 2636 -77 2641 -72 2647 -68 ct 2652 -65 2661 -63 2672 -63 ct -2680 -63 l 2691 -64 l p ef -3081 -141 m 3157 -131 l 3145 -86 3123 -52 3090 -27 ct 3057 -2 3015 9 2965 9 ct -2900 9 2849 -9 2812 -49 ct 2774 -88 2755 -144 2755 -215 ct 2755 -289 2774 -346 2812 -387 ct -2851 -428 2900 -448 2960 -448 ct 3019 -448 3067 -428 3104 -388 ct 3141 -348 3160 -292 3160 -220 ct -3160 -215 3160 -209 3159 -200 ct 2832 -200 l 2835 -152 2849 -115 2873 -89 ct -2898 -64 2928 -51 2965 -51 ct 2992 -51 3015 -58 3035 -72 ct 3054 -87 l 3069 -109 l -p -2836 -261 m 3081 -261 l 3078 -298 3069 -326 3053 -344 ct 3030 -373 2999 -387 2961 -387 ct -2927 -387 2898 -376 2875 -353 ct 2852 -330 l 2839 -299 l p ef -3255 0 m 3255 -438 l 3322 -438 l 3322 -372 l 3339 -403 3355 -423 3370 -433 ct -3384 -443 3400 -448 3417 -448 ct 3442 -448 3468 -440 3494 -424 ct 3468 -355 l -3450 -366 3432 -371 3414 -371 ct 3397 -371 3383 -366 3370 -357 ct 3357 -347 3348 -333 3342 -316 ct -3334 -289 3330 -261 3330 -229 ct 3330 0 l p ef -3617 0 m 3548 0 l 3548 -605 l 3622 -605 l 3622 -389 l 3654 -428 3694 -448 3742 -448 ct -3769 -448 3795 -443 3819 -432 ct 3843 -421 3863 -406 3879 -386 ct 3894 -366 3906 -343 3915 -315 ct -3924 -287 3928 -257 3928 -225 ct 3928 -150 3910 -92 3873 -51 ct 3835 -10 3791 9 3739 9 ct -3687 9 3646 -11 3617 -54 ct p -3616 -222 m 3616 -170 3623 -132 3638 -108 ct 3661 -70 3693 -51 3733 -51 ct -3765 -51 3793 -65 3817 -93 ct 3840 -121 3852 -163 3852 -219 ct 3852 -277 3841 -319 3818 -346 ct -3796 -373 3768 -387 3736 -387 ct 3703 -387 3675 -373 3652 -345 ct 3628 -316 l -3616 -276 l p ef -3970 -219 m 3970 -300 3992 -360 4037 -399 ct 4075 -432 4121 -448 4175 -448 ct -4236 -448 4285 -428 4323 -389 ct 4361 -349 4381 -295 4381 -225 ct 4381 -169 4372 -124 4355 -92 ct -4338 -59 4314 -34 4281 -16 ct 4249 0 4214 9 4175 9 ct 4114 9 4064 -9 4026 -49 ct -3989 -88 l 3970 -145 l p -4046 -219 m 4046 -163 4058 -121 4083 -93 ct 4107 -65 4138 -51 4175 -51 ct 4212 -51 4243 -65 4267 -93 ct -4292 -121 4304 -164 4304 -221 ct 4304 -276 4292 -317 4267 -345 ct 4243 -373 4212 -387 4175 -387 ct -4138 -387 4107 -373 4083 -345 ct 4058 -317 l 4046 -275 l p ef -4761 -54 m 4733 -30 4707 -14 4681 -4 ct 4656 5 4628 9 4599 9 ct 4551 9 4514 -1 4488 -25 ct -4462 -48 4449 -79 4449 -115 ct 4449 -137 4454 -156 4464 -174 ct 4474 -192 4486 -206 4502 -217 ct -4518 -228 4536 -236 4556 -241 ct 4570 -245 4592 -249 4622 -252 ct 4682 -259 4726 -268 4754 -278 ct -4755 -288 4755 -295 4755 -297 ct 4755 -328 4748 -349 4734 -361 ct 4715 -378 4686 -387 4649 -387 ct -4614 -387 4588 -380 4572 -368 ct 4555 -356 4543 -334 4535 -303 ct 4462 -313 l -4468 -344 4479 -369 4495 -388 ct 4510 -408 4532 -422 4560 -433 ct 4589 -443 4622 -448 4660 -448 ct -4697 -448 4728 -444 4751 -435 ct 4774 -426 4792 -415 4803 -402 ct 4814 -388 4821 -371 4826 -351 ct -4828 -338 4830 -316 4830 -282 ct 4830 -183 l 4830 -114 4831 -70 4834 -52 ct -4837 -34 4844 -16 4853 0 ct 4775 0 l 4768 -15 l 4763 -33 l p -4754 -220 m 4727 -209 4687 -199 4633 -192 ct 4602 -187 4581 -182 4568 -177 ct -4555 -171 4546 -163 4539 -153 ct 4532 -142 4528 -130 4528 -117 ct 4528 -97 4536 -81 4551 -68 ct -4566 -54 4588 -48 4617 -48 ct 4645 -48 4671 -54 4693 -67 ct 4716 -79 4732 -96 4742 -118 ct -4750 -135 4754 -160 4754 -192 ct p ef -4922 0 m 4922 -438 l 4989 -438 l 4989 -372 l 5006 -403 5022 -423 5037 -433 ct -5051 -443 5067 -448 5084 -448 ct 5109 -448 5135 -440 5161 -424 ct 5135 -355 l -5117 -366 5099 -371 5081 -371 ct 5064 -371 5050 -366 5037 -357 ct 5024 -347 5015 -333 5009 -316 ct -5001 -289 4997 -261 4997 -229 ct 4997 0 l p ef -5499 0 m 5499 -55 l 5471 -11 5430 9 5376 9 ct 5341 9 5309 0 5280 -19 ct 5250 -38 5228 -65 5212 -99 ct -5195 -134 5187 -174 5187 -218 ct 5187 -262 5195 -302 5209 -338 ct 5224 -373 5246 -401 5275 -420 ct -5304 -439 5337 -448 5373 -448 ct 5399 -448 5423 -443 5444 -431 ct 5464 -420 5481 -406 5494 -388 ct -5494 -605 l 5568 -605 l 5568 0 l p -5264 -218 m 5264 -162 5276 -120 5299 -92 ct 5323 -65 5351 -51 5383 -51 ct 5416 -51 5443 -64 5466 -91 ct -5489 -117 5500 -158 5500 -212 ct 5500 -272 5489 -316 5465 -344 ct 5442 -373 5414 -387 5380 -387 ct -5347 -387 5319 -373 5297 -346 ct 5275 -319 l 5264 -277 l p ef -pom -gr -51 lw 13970 5080 m 13970 6350 l ps -11010 7920 m 11900 7920 l ps -11010 10460 m 11900 10460 l ps -11010 14605 m 11900 14605 l ps -11010 17245 m 11900 17245 l ps -7835 7955 m 7420 7955 l ps -7835 10460 m 7420 10460 l ps -7835 14605 m 7420 14605 l ps -7835 17245 m 7420 17245 l ps -16013 7955 m 16809 7955 l ps -19984 7920 m 20592 7920 l ps -19984 10460 m 20592 10460 l ps -16013 10495 m 16809 10495 l ps -16013 14605 m 16809 14605 l ps -16013 17245 m 16809 17245 l ps -19984 14605 m 20592 14605 l ps -19984 17245 m 20592 17245 l ps -gr -0 20290 t -pom -count op_count sub {pop} repeat countdictstack dict_count sub {end} repeat b4_inc_state restore -%%PageTrailer -%%Trailer -%%EOF diff --git a/usrp/doc/usrp-block-diagram.png b/usrp/doc/usrp-block-diagram.png Binary files differdeleted file mode 100644 index 55a0f0b38..000000000 --- a/usrp/doc/usrp-block-diagram.png +++ /dev/null diff --git a/usrp/doc/usrp.jpg b/usrp/doc/usrp.jpg Binary files differdeleted file mode 100644 index 0ddb59275..000000000 --- a/usrp/doc/usrp.jpg +++ /dev/null diff --git a/usrp/doc/usrp_guide.xml b/usrp/doc/usrp_guide.xml deleted file mode 100644 index 7c4d5d5e8..000000000 --- a/usrp/doc/usrp_guide.xml +++ /dev/null @@ -1,399 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" - "docbookx.dtd" [ -]> - -<article> - <articleinfo> - <title>USRP User's and Developer's Guide</title> - <author> - <firstname>Matt</firstname> - <surname>Ettus</surname> - <affiliation> - <orgname>Ettus Research LLC</orgname> - <address> - Ettus Research LLC - <street>604 Mariposa Ave</street> - <city>Mountain View</city>, <state>CA</state> <postcode>94041</postcode> - <country>USA</country> - <email>matt@ettus.com</email> - </address> - </affiliation> - </author> - - <abstract> - <para> - This guide explains both basic usage of the USRP as well as how to expand it. - </para> - </abstract> - - </articleinfo> - - <sect1 id="intro"> - <title>Introduction</title> - <para> - The Universal Software Radio Peripheral, or USRP (pronounced "usurp") - is designed to allow general purpose computers to function as high - bandwidth software radios. In essence, it serves as a digital - baseband and IF section of a radio communication system. In addition, - it has a well-defined electrical and mechanical interface to RF - front-ends (daughterboards) which can translate between that IF or - baseband and the RF bands of interest - </para> - <para> - The basic design philosophy behind the USRP has been to do all of the - waveform-specific processing, like modulation and demodulation, on the - host CPU. All of the high-speed general purpose operations like - digital up- and downconversion, decimation and interpolation are done - on the FPGA. - </para> - <para> - It is anticipated that the majority of USRP users will never need to - use anything other than the standard FPGA configuration. However, for - those users that wish to, the FPGA design may be changed or replaced. - All of the interfaces are well defined and documented. - </para> - <figure id="usrp-board"> - <title>USRP with Daughterboards</title> - <mediaobject> - <imageobject><imagedata fileref="usrp.jpg" format="JPG"/></imageobject> - <caption><para> - This USRP has 2 BasicTX and 2 BasicRX boards mounted on it. - Notice that the boards on the left are rotated 180 degrees. - </para></caption> - </mediaobject> - </figure> - - <sect2 id="requirements"> - <title>System Requirements</title> - <para> - The USRP requires a PC or Mac with a USB2 interface. - </para> - </sect2> - - <sect2 id="capabilities"> - <title>Capabilities</title> - <para> - The USRP has 4 high-speed analog to digital converters (ADCs), each at - 12 bits per sample, 64 million samples per second. There are also - 4 high-speed digital to analog converters (DACs), each at 14 bits per - sample, 128 million samples per second. These 4 input and 4 output - channels are connected to an Altera Cyclone EP1C12 FPGA. The FPGA, in - turn, connects to a USB2 interface chip, the Cypress FX2, and on to the - computer. The USRP connects to the computer via a high speed USB2 - interface only, and will not work with USB1.1. - </para> - <figure id="usrp-block-diagram-fig"><title>Universal Software Radio Peripheral</title> - <mediaobject> - <imageobject><imagedata fileref="usrp-block-diagram.eps" format="EPS"/></imageobject> - <imageobject><imagedata fileref="usrp-block-diagram.png" format="PNG"/></imageobject> - <caption><para></para></caption> - </mediaobject> - </figure> - </sect2> - </sect1> - <sect1 id="getting-started"> - <title>Getting Started</title> - <sect2 id="the-code"> - <title>Getting all the Software</title> - <para> - The first step in using your USRP system is to get all of GNU Radio installed. This can - sometimes be a daunting process, as there are several other libraries which will need to be - installed first. - </para> - <sect3 id="dependencies"> - <title>Library Dependencies</title> - <itemizedlist> - <listitem> - <para>SWIG</para> - <para> - We use SWIG (Simple Wrapper Interface Generator) to tie together the C++ and Python code - in the GNU Radio system. We require that you have version 1.3.24 or newer. You'll - probably have to compile it from source, which you can find here: <ulink url="http://www.swig.org">SWIG</ulink> - </para> - </listitem> - <listitem> - <para>FFTW</para> - <para> - FFTW is the library which GNU Radio uses for FFTs. GNU Radio requires version 3.0.1 or - newer, and it must be compiled for single precision. You can get it from the - <ulink url="http://www.fftw.org">FFTW Homepage</ulink> - </para> - </listitem> - <listitem> - <para>Boost Library</para> - <para> - Boost provides several low-level structures used in our C++ code. If it is not included in - your OS distribution, you can get it here: <ulink url="http://boost.org">Boost</ulink> - </para> - </listitem> - <listitem> - <para>CPP Unit</para> - <para> - CPPUnit provides our unit-testing framework. This creates automated tests to insure that - code does not break when changes are made. Get it at the <ulink url="http://cppunit.sf.net"> - CPP Unit Homepage</ulink> - </para> - </listitem> - </itemizedlist> - </sect3> - <sect3 id="getting-gradio"> - <title>Getting GNU Radio and the USRP code</title> - <para> - There are several packages of software which make up GNU Radio and the USRP support software. - Links to the latest versions of each can be found on the GNU Radio Wiki at - <ulink url="http://comsec.com/wiki?GnuRadio2.X">Download Links</ulink>. Gr-build - can greatly simplify the installation process, and its use it highly recommended. - </para> - </sect3> - <sect3 id="cvs"> - <title>Following CVS Development</title> - <para> - Development for the USRP proceeds very quickly at times, so some users may want to keep up with - the latest by following the CVS trees. There are three separate software repositories - which contain various parts of the USRP system. - <itemizedlist> - <listitem> - <para> - USRP-HW, containing the hardware and FPGA designs. - </para> - <para> - All of the schematics in this repository were created in - <ulink url="http://www.geda.seul.org">gEDA</ulink>. The board - layouts were created in <ulink url="http://pcb.sf.net">PCB</ulink>. - Verilog designs are compiled in Quartus II Web Edition from - <ulink url="http://www.altera.com">Altera</ulink>. - </para> - </listitem> - <listitem> - <para> - <ulink url="https://sourceforge.net/cvs/?group_id=22397">USRP-SW</ulink>, - USRP-SW, containing firmware and host drivers for the USRP - </para> - <para> - Host side drivers and firmware which runs in the USB2 interface chip on the board. - </para> - </listitem> - <listitem> - <para> - <ulink url="http://comsec.com/wiki?CvsAccess">GNU Radio/gr-usrp</ulink> - which contains the GNU Radio interface to the USRP - </para> - </listitem> - </itemizedlist> - </para> - </sect3> - </sect2> - <sect2 id="usrp-start"> - <title>Using your USRP</title> - <sect3 id="physical"> - <title>Mechanical Connection</title> - <para> - The USRP ships with a complete set of standoffs, nuts and bolts. There are 20 standoffs, - M3x10mm M-F, of which 4 are intended to be used as "feet" for the USRP. Place them in the 4 - corner holes on the main board, inserting the male part from below. The remaining 16 - are used to hold the daughterboards in place. Four of them should be connected to the male - portion of the 4 standoffs already inserted from below. The remaining 12 should be - connected to the board with the 12 M3x6mm screws from below. At this point there should be - 16 standoffs on the board with the male ends up to serve as a guide for the daughterboards. - The 16 M3 nuts are used to fasten the daughterboards down to the main board. - </para> - <para> - The USRP accomodates 2 TX and 2 RX daughterboards. The placement of the standoffs is designed - to prevent the accidental incorrect connection of daughterboards. The 2 sides of the USRP have - their daughterboard slots rotated 180 degrees. The USRP should not be operated without - standoffs, and daughterboards should never be connected or removed while power is applied. - </para> - </sect3> - <sect3 id="electrical"> - <title>Electrical Connections</title> - <para> - The USRP is powered by a 6V 4A power converter included in the kit. The converter is - capable of 90-260 Vac, 50/60 Hz operation, and so should work in any country. - If there is a need to use another power supply, the connector is a standard 2.1mm/5.5mm - DC power connector. The USRP itself only needs 5V at 2A, but a 6V supply was chosen to - accomodate future daughterboards. Extra power supplies are available from Ettus Research. - </para> - <para> - The included USB cable should be connected to a USB2-capable socket on a computer. The USRP - does not support USB 1.1 operation at this time. - </para> - </sect3> - <sect3 id="diagnostics"> - <title>Troubleshooting</title> - <para> - When first powered up, an LED on the USRP should be flashing at about 3-4x per second. - This indicates that the processor is running, and has put the device in a low power mode. - Once firmware has been downloaded to the USRP, the LED will blink at a slower rate. - If there is no blinking LED, check all power connections, and check for continuity - in the power fuse (F501, near the power connector). If the fuse needs replacement, it - is size 0603, 3 amps. - </para> - </sect3> - </sect2> - </sect1> - <sect1 id="fpga"> - <title>FPGA</title> - <sect2 id="fpga-std"> - <title>Standard FPGA Configuration</title> - <para> - In the standard fpga configuration, usrp_std, all samples sent over - the USB interface are in 16-bit signed integers in IQ format. When - there are multiple channels (up to 4), the channels are interleaved. - For example, with 4 channels, the sequence would be I0 Q0 I1 Q1 I2 Q2 - I3 Q3 I0 Q0, etc. - </para> - <para> - The USRP can operate in full duplex mode. When in this mode, the - transmit and receive sides are completely independent of one another. - The only consideration is that the combined data rate over the bus - must be 32 Megabytes per second or less. The multiple RX channels - (1,2, or 4) must all be the same data rate (i.e. same decimation - ratio). The same applies to the 1,2, or TX channels, which each must - be at the same data rate (which may be different from the RX rate). - </para> - <para> - On the RX side, each of the 4 ADCs can be routed to either of I or the - Q input of any of the 4 downconverters. This allows for having - multiple channels selected out of the same ADC sample stream. - </para> - <para> - The digital upconverters (DUCs) on the transmit side are actually - contained in the AD9862 CODEC chips, not in the FPGA. The only - transmit signal processing blocks in the FPGA are the interpolators. - The interpolator outputs can be routed to any of the 4 CODEC inputs. - </para> - <figure id="ddc-fig"><title>Digital Down Converter Block Diagram</title> - <mediaobject> - <imageobject><imagedata fileref="ddc.eps" format="EPS"/></imageobject> - <imageobject><imagedata fileref="ddc.png" format="PNG"/></imageobject> - <caption><para></para></caption> - </mediaobject> - </figure> - - </sect2> - </sect1> - <sect1 id="dboard-int"> - <title>Daughterboard Interface</title> - <sect2 id="power-int"> - <title>Power</title> - <para> - Daughterboards are provided with clean regulated 3.3V for the analog - and digital sections. Additionally there is a 6V connection straight from - the wall supply which is intended to supply a 5V LDO regulator. All daughterboards - may draw a combined total of 1.5 A. - </para> - </sect2> - <sect2 id="logical-int"> - <title>Logical Interface</title> - <para> - There are slots for 2 TX daughterboards, labeled TXA and TXB, and 2 - corresponding RX daughterboards, RXA and RXB. Each daughterboard slot has - access to 2 of the 4 high-speed data converter analog signals (DAC outputs - for TX, ADC inputs for RX). This allows each daughterboard which uses real - (not IQ) sampling to have 2 independent RF sections, and 2 antennas - (4 total for the system). If IQ sampling is used, each board can support - a single RF section, for a total of 2 for the whole system. - </para> - <para> - No antialias or reconstruction filtering is provided on the USRP motherboard. - This allows for maximum flexibility in frequency planning for the - daughterboards. The analog input bandwidth of the ADCs is over 200 MHz, so - IF frequencies up to that high may be chosen. If several decibels of loss - is tolerable, and IF frequency as high as 500 MHz can be used. - </para> - <para> - Every daughterboard has an I2C EEPROM (24LC024 or 24LC025) onboard - which identifies the board to the system. This allows the host - software to automatically set up the system properly based on the - installed daughterboard. The EEPROM may also store calibration values - like DC offsets or IQ imbalances. If this EEPROM is not programmed, a - warning message is printed every time USRP software is run. - </para> - </sect2> - <sect2 id="analog-int"> - <title>Analog Interface</title> - <para> - Each RX daughterboard has 2 differential analog inputs - (VINP_A/VINN_A and VINP_B/VINN_B) which are sampled at a rate of 64 MS/s. - The input impedance is approximately 1Kohm. - The motherboard has a software-controllable programmable gain amplifier - on these inputs, with 0 to 20 dB of gain. With gain set to zero, full - scale inputs are 2 Volts peak-to-peak differential. When set to 20 dB, - only .2 V pk-pk differential is needed to reach full scale. - </para> - <para> - If signals are AC-coupled, there is no need to provide DC bias as long as the - internal buffer is turned on. It will provide an approximately 2V bias. - If signals are DC-couple, a DC bias of Vdd/2 (1.65V) should be provided to - both the positive and negative inputs, and the internal buffer should be turned off. - VREF provides a clean 1 V reference. - </para> - <para> - Each TX daughterboard has a pair of differential analog outputs which are - updated at 128 MS/s. The signals (IOUTP_A/IOUTN_A and IOUTP_B/IOUTN_B) are - current-output, each varying between 0 and 20 mA. Since they are high-impedance, - they can be converted into differential voltages with a resistor. - </para> - <para> - In addition to the high-speed signals, each daughterboard has exclusive access to 2 low-speed ADC inputs - (labeled AUX_ADC_A and AUX_ADC_B) which can be read from software. - These are useful for sensing RSSI signal levels, temperatures, bias - levels, etc. Additionally, each board has shared access to 4 low-speed DAC - signals, labeled AUX_DAC_A through AUX_DAC_D. RXA and TXA share one set - of these 4 lines, and RXB and TXB share their own independent set. These - signals are useful for controlling gain of variable-gain amplifiers, for example. - AUX_ADC_REF provides a reference level for gain setting if it is necessary. - </para> - - </sect2> - <sect2 id="dig-int"> - <title>Digital Interface</title> - <para></para> - </sect2> - <sect2 id="mech-int"> - <title>Connector Pinouts</title> - - <table frame='all'><title>RX DBoard Connector</title> - <tgroup cols='3' align='left' colsep='1' rowsep='1'> - <thead> - <row> - <entry>Pin #</entry> - <entry>Name</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry>1</entry> - <entry>power</entry> - <entry>This is power</entry> - </row> - <row> - <entry>c1</entry> - <entry>c4</entry> - </row> - <row> - <entry>d1</entry> - <entry>d4</entry> - <entry>d5</entry> - </row> - </tbody> - </tgroup> - </table> - </sect2> - </sect1> - <sect1 id="dboards"> - <title>Available Daughterboards</title> - <sect2 id="basicrx"> - <title>BasicRX</title> - <para> - </para> - </sect2> - <sect2 id="basictx"> - <title>BasicTX</title> - <para> - </para> - </sect2> - </sect1> -</article> diff --git a/usrp/doc/usrp_rfx_diagrams.odp b/usrp/doc/usrp_rfx_diagrams.odp Binary files differdeleted file mode 100644 index 4521f71ce..000000000 --- a/usrp/doc/usrp_rfx_diagrams.odp +++ /dev/null diff --git a/usrp/firmware/.gitignore b/usrp/firmware/.gitignore deleted file mode 100644 index 75bb241c8..000000000 --- a/usrp/firmware/.gitignore +++ /dev/null @@ -1,25 +0,0 @@ -/Makefile -/Makefile.in -/aclocal.m4 -/configure -/config.h.in -/stamp-h.in -/libtool -/config.log -/config.h -/config.cache -/config.status -/missing -/stamp-h -/stamp-h1 -/.la -/.lo -/.deps -/.libs -/*.la -/*.lo -/autom4te.cache -/*.cache -/missing -/make.log -/usrp.pc diff --git a/usrp/firmware/Makefile.am b/usrp/firmware/Makefile.am deleted file mode 100644 index 9c0da3573..000000000 --- a/usrp/firmware/Makefile.am +++ /dev/null @@ -1,22 +0,0 @@ -# -# Copyright 2003 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -SUBDIRS = include lib src diff --git a/usrp/firmware/include/.gitignore b/usrp/firmware/include/.gitignore deleted file mode 100644 index 75bb241c8..000000000 --- a/usrp/firmware/include/.gitignore +++ /dev/null @@ -1,25 +0,0 @@ -/Makefile -/Makefile.in -/aclocal.m4 -/configure -/config.h.in -/stamp-h.in -/libtool -/config.log -/config.h -/config.cache -/config.status -/missing -/stamp-h -/stamp-h1 -/.la -/.lo -/.deps -/.libs -/*.la -/*.lo -/autom4te.cache -/*.cache -/missing -/make.log -/usrp.pc diff --git a/usrp/firmware/include/Makefile.am b/usrp/firmware/include/Makefile.am deleted file mode 100644 index e17726c07..000000000 --- a/usrp/firmware/include/Makefile.am +++ /dev/null @@ -1,61 +0,0 @@ -# -# Copyright 2003 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -usrpincludedir = $(includedir)/usrp - -usrpinclude_HEADERS = \ - usrp_i2c_addr.h \ - usrp_spi_defs.h \ - fpga_regs_common.h \ - fpga_regs_standard.h - - -noinst_HEADERS = \ - delay.h \ - fpga_regs_common.v \ - fpga_regs_standard.v \ - fpga_regs0.h \ - fx2regs.h \ - fx2utils.h \ - i2c.h \ - isr.h \ - syncdelay.h \ - timer.h \ - usb_common.h \ - usb_descriptors.h \ - usb_requests.h \ - usrp_commands.h \ - usrp_config.h \ - usrp_ids.h \ - usrp_interfaces.h - - -CODE_GENERATOR = \ - generate_regs.py - -EXTRA_DIST = \ - $(CODE_GENERATOR) - -fpga_regs_common.v: fpga_regs_common.h generate_regs.py - PYTHONPATH=$(top_srcdir)/usrp/firmware/include $(PYTHON) $(srcdir)/generate_regs.py $(srcdir)/fpga_regs_common.h $@ - -fpga_regs_standard.v: fpga_regs_standard.h generate_regs.py - PYTHONPATH=$(top_srcdir)/usrp/firmware/include $(PYTHON) $(srcdir)/generate_regs.py $(srcdir)/fpga_regs_standard.h $@ diff --git a/usrp/firmware/include/delay.h b/usrp/firmware/include/delay.h deleted file mode 100644 index f5df779e1..000000000 --- a/usrp/firmware/include/delay.h +++ /dev/null @@ -1,38 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _DELAY_H_ -#define _DELAY_H_ - -/* - * delay for approximately usecs microseconds - * Note limit of 255 usecs. - */ -void udelay (unsigned char usecs); - -/* - * delay for approximately msecs milliseconds - */ -void mdelay (unsigned short msecs); - - -#endif /* _DELAY_H_ */ diff --git a/usrp/firmware/include/fpga_regs0.h b/usrp/firmware/include/fpga_regs0.h deleted file mode 100644 index 883798301..000000000 --- a/usrp/firmware/include/fpga_regs0.h +++ /dev/null @@ -1,42 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _FPGA_REGS0_H_ -#define _FPGA_REGS0_H_ - -#define FR_RX_FREQ_0 0 -#define FR_RX_FREQ_1 1 -#define FR_RX_FREQ_2 2 -#define FR_RX_FREQ_3 3 -#define FR_TX_FREQ_0 4 -#define FR_TX_FREQ_1 5 -#define FR_TX_FREQ_2 6 -#define FR_TX_FREQ_3 7 -#define FR_COMBO 8 - - -#define FR_ADC_CLK_DIV 128 // pseudo regs mapped to FR_COMBO by f/w -#define FR_EXT_CLK_DIV 129 -#define FR_INTERP 130 -#define FR_DECIM 131 - -#endif diff --git a/usrp/firmware/include/fpga_regs_common.h b/usrp/firmware/include/fpga_regs_common.h deleted file mode 100644 index b4a496af7..000000000 --- a/usrp/firmware/include/fpga_regs_common.h +++ /dev/null @@ -1,150 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003,2004 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ -#ifndef INCLUDED_FPGA_REGS_COMMON_H -#define INCLUDED_FPGA_REGS_COMMON_H - -// This file defines registers common to all FPGA configurations. -// Registers 0 to 31 are reserved for use in this file. - - -// The FPGA needs to know the rate that samples are coming from and -// going to the A/D's and D/A's. div = 128e6 / sample_rate - -#define FR_TX_SAMPLE_RATE_DIV 0 -#define FR_RX_SAMPLE_RATE_DIV 1 - -// 2 and 3 are defined in the ATR section - -#define FR_MASTER_CTRL 4 // master enable and reset controls -# define bmFR_MC_ENABLE_TX (1 << 0) -# define bmFR_MC_ENABLE_RX (1 << 1) -# define bmFR_MC_RESET_TX (1 << 2) -# define bmFR_MC_RESET_RX (1 << 3) - -// i/o direction registers for pins that go to daughterboards. -// Setting the bit makes it an output from the FPGA to the d'board. -// top 16 is mask, low 16 is value - -#define FR_OE_0 5 // slot 0 -#define FR_OE_1 6 -#define FR_OE_2 7 -#define FR_OE_3 8 - -// i/o registers for pins that go to daughterboards. -// top 16 is a mask, low 16 is value - -#define FR_IO_0 9 // slot 0 -#define FR_IO_1 10 -#define FR_IO_2 11 -#define FR_IO_3 12 - -#define FR_MODE 13 -# define bmFR_MODE_NORMAL 0 -# define bmFR_MODE_LOOPBACK (1 << 0) // enable digital loopback -# define bmFR_MODE_RX_COUNTING (1 << 1) // Rx is counting -# define bmFR_MODE_RX_COUNTING_32BIT (1 << 2) // Rx is counting with a 32 bit counter - // low and high 16 bits are multiplexed across channel I and Q - - -// If the corresponding bit is set, internal FPGA debug circuitry -// controls the i/o pins for the associated bank of daughterboard -// i/o pins. Typically used for debugging FPGA designs. - -#define FR_DEBUG_EN 14 -# define bmFR_DEBUG_EN_TX_A (1 << 0) // debug controls TX_A i/o -# define bmFR_DEBUG_EN_RX_A (1 << 1) // debug controls RX_A i/o -# define bmFR_DEBUG_EN_TX_B (1 << 2) // debug controls TX_B i/o -# define bmFR_DEBUG_EN_RX_B (1 << 3) // debug controls RX_B i/o - - -// If the corresponding bit is set, enable the automatic DC -// offset correction control loop. -// -// The 4 low bits are significant: -// -// ADC0 = (1 << 0) -// ADC1 = (1 << 1) -// ADC2 = (1 << 2) -// ADC3 = (1 << 3) -// -// This control loop works if the attached daugherboard blocks DC. -// Currently all daughterboards do block DC. This includes: -// basic rx, dbs_rx, tv_rx, flex_xxx_rx. - -#define FR_DC_OFFSET_CL_EN 15 // DC Offset Control Loop Enable - - -// offset corrections for ADC's and DAC's (2's complement) - -#define FR_ADC_OFFSET_0 16 -#define FR_ADC_OFFSET_1 17 -#define FR_ADC_OFFSET_2 18 -#define FR_ADC_OFFSET_3 19 - - -// ------------------------------------------------------------------------ -// Automatic Transmit/Receive switching -// -// If automatic transmit/receive (ATR) switching is enabled in the -// FR_ATR_CTL register, the presence or absence of data in the FPGA -// transmit fifo selects between two sets of values for each of the 4 -// banks of daughterboard i/o pins. -// -// Each daughterboard slot has 3 16-bit registers associated with it: -// FR_ATR_MASK_*, FR_ATR_TXVAL_* and FR_ATR_RXVAL_* -// -// FR_ATR_MASK_{0,1,2,3}: -// -// These registers determine which of the daugherboard i/o pins are -// affected by ATR switching. If a bit in the mask is set, the -// corresponding i/o bit is controlled by ATR, else it's output -// value comes from the normal i/o pin output register: -// FR_IO_{0,1,2,3}. -// -// FR_ATR_TXVAL_{0,1,2,3}: -// FR_ATR_RXVAL_{0,1,2,3}: -// -// If the Tx fifo contains data, then the bits from TXVAL that are -// selected by MASK are output. Otherwise, the bits from RXVAL that -// are selected by MASK are output. - -#define FR_ATR_MASK_0 20 // slot 0 -#define FR_ATR_TXVAL_0 21 -#define FR_ATR_RXVAL_0 22 - -#define FR_ATR_MASK_1 23 // slot 1 -#define FR_ATR_TXVAL_1 24 -#define FR_ATR_RXVAL_1 25 - -#define FR_ATR_MASK_2 26 // slot 2 -#define FR_ATR_TXVAL_2 27 -#define FR_ATR_RXVAL_2 28 - -#define FR_ATR_MASK_3 29 // slot 3 -#define FR_ATR_TXVAL_3 30 -#define FR_ATR_RXVAL_3 31 - -// Clock ticks to delay rising and falling edge of T/R signal -#define FR_ATR_TX_DELAY 2 -#define FR_ATR_RX_DELAY 3 - -#endif /* INCLUDED_FPGA_REGS_COMMON_H */ diff --git a/usrp/firmware/include/fpga_regs_common.v b/usrp/firmware/include/fpga_regs_common.v deleted file mode 100644 index 8035d8565..000000000 --- a/usrp/firmware/include/fpga_regs_common.v +++ /dev/null @@ -1,117 +0,0 @@ -// -// This file is machine generated from ./fpga_regs_common.h -// Do not edit by hand; your edits will be overwritten. -// - -// This file defines registers common to all FPGA configurations. -// Registers 0 to 31 are reserved for use in this file. - - -// The FPGA needs to know the rate that samples are coming from and -// going to the A/D's and D/A's. div = 128e6 / sample_rate - -`define FR_TX_SAMPLE_RATE_DIV 7'd0 -`define FR_RX_SAMPLE_RATE_DIV 7'd1 - -// 2 and 3 are defined in the ATR section - -`define FR_MASTER_CTRL 7'd4 // master enable and reset controls - -// i/o direction registers for pins that go to daughterboards. -// Setting the bit makes it an output from the FPGA to the d'board. -// top 16 is mask, low 16 is value - -`define FR_OE_0 7'd5 // slot 0 -`define FR_OE_1 7'd6 -`define FR_OE_2 7'd7 -`define FR_OE_3 7'd8 - -// i/o registers for pins that go to daughterboards. -// top 16 is a mask, low 16 is value - -`define FR_IO_0 7'd9 // slot 0 -`define FR_IO_1 7'd10 -`define FR_IO_2 7'd11 -`define FR_IO_3 7'd12 - -`define FR_MODE 7'd13 - - -// If the corresponding bit is set, internal FPGA debug circuitry -// controls the i/o pins for the associated bank of daughterboard -// i/o pins. Typically used for debugging FPGA designs. - -`define FR_DEBUG_EN 7'd14 - - -// If the corresponding bit is set, enable the automatic DC -// offset correction control loop. -// -// The 4 low bits are significant: -// -// ADC0 = (1 << 0) -// ADC1 = (1 << 1) -// ADC2 = (1 << 2) -// ADC3 = (1 << 3) -// -// This control loop works if the attached daugherboard blocks DC. -// Currently all daughterboards do block DC. This includes: -// basic rx, dbs_rx, tv_rx, flex_xxx_rx. - -`define FR_DC_OFFSET_CL_EN 7'd15 // DC Offset Control Loop Enable - - -// offset corrections for ADC's and DAC's (2's complement) - -`define FR_ADC_OFFSET_0 7'd16 -`define FR_ADC_OFFSET_1 7'd17 -`define FR_ADC_OFFSET_2 7'd18 -`define FR_ADC_OFFSET_3 7'd19 - - -// ------------------------------------------------------------------------ -// Automatic Transmit/Receive switching -// -// If automatic transmit/receive (ATR) switching is enabled in the -// FR_ATR_CTL register, the presence or absence of data in the FPGA -// transmit fifo selects between two sets of values for each of the 4 -// banks of daughterboard i/o pins. -// -// Each daughterboard slot has 3 16-bit registers associated with it: -// FR_ATR_MASK_*, FR_ATR_TXVAL_* and FR_ATR_RXVAL_* -// -// FR_ATR_MASK_{0,1,2,3}: -// -// These registers determine which of the daugherboard i/o pins are -// affected by ATR switching. If a bit in the mask is set, the -// corresponding i/o bit is controlled by ATR, else it's output -// value comes from the normal i/o pin output register: -// FR_IO_{0,1,2,3}. -// -// FR_ATR_TXVAL_{0,1,2,3}: -// FR_ATR_RXVAL_{0,1,2,3}: -// -// If the Tx fifo contains data, then the bits from TXVAL that are -// selected by MASK are output. Otherwise, the bits from RXVAL that -// are selected by MASK are output. - -`define FR_ATR_MASK_0 7'd20 // slot 0 -`define FR_ATR_TXVAL_0 7'd21 -`define FR_ATR_RXVAL_0 7'd22 - -`define FR_ATR_MASK_1 7'd23 // slot 1 -`define FR_ATR_TXVAL_1 7'd24 -`define FR_ATR_RXVAL_1 7'd25 - -`define FR_ATR_MASK_2 7'd26 // slot 2 -`define FR_ATR_TXVAL_2 7'd27 -`define FR_ATR_RXVAL_2 7'd28 - -`define FR_ATR_MASK_3 7'd29 // slot 3 -`define FR_ATR_TXVAL_3 7'd30 -`define FR_ATR_RXVAL_3 7'd31 - -// Clock ticks to delay rising and falling edge of T/R signal -`define FR_ATR_TX_DELAY 7'd2 -`define FR_ATR_RX_DELAY 7'd3 - diff --git a/usrp/firmware/include/fpga_regs_standard.h b/usrp/firmware/include/fpga_regs_standard.h deleted file mode 100644 index 7485e2bab..000000000 --- a/usrp/firmware/include/fpga_regs_standard.h +++ /dev/null @@ -1,300 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003,2004,2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ -#ifndef INCLUDED_FPGA_REGS_STANDARD_H -#define INCLUDED_FPGA_REGS_STANDARD_H - -// Register numbers 0 to 31 are reserved for use in fpga_regs_common.h. -// Registers 64 to 79 are available for custom FPGA builds. - - -// DDC / DUC - -#define FR_INTERP_RATE 32 // [1,1024] -#define FR_DECIM_RATE 33 // [1,256] - -// DDC center freq - -#define FR_RX_FREQ_0 34 -#define FR_RX_FREQ_1 35 -#define FR_RX_FREQ_2 36 -#define FR_RX_FREQ_3 37 - -// See below for DDC Starting Phase - -// ------------------------------------------------------------------------ -// configure FPGA Rx mux -// -// 3 2 1 -// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 -// +-----------------------+-------+-------+-------+-------+-+-----+ -// | must be zero | Q3| I3| Q2| I2| Q1| I1| Q0| I0|Z| NCH | -// +-----------------------+-------+-------+-------+-------+-+-----+ -// -// There are a maximum of 4 digital downconverters in the the FPGA. -// Each DDC has two 16-bit inputs, I and Q, and two 16-bit outputs, I & Q. -// -// DDC I inputs are specified by the two bit fields I3, I2, I1 & I0 -// -// 0 = DDC input is from ADC 0 -// 1 = DDC input is from ADC 1 -// 2 = DDC input is from ADC 2 -// 3 = DDC input is from ADC 3 -// -// If Z == 1, all DDC Q inputs are set to zero -// If Z == 0, DDC Q inputs are specified by the two bit fields Q3, Q2, Q1 & Q0 -// -// NCH specifies the number of complex channels that are sent across -// the USB. The legal values are 1, 2 or 4, corresponding to 2, 4 or -// 8 16-bit values. - -#define FR_RX_MUX 38 - -// ------------------------------------------------------------------------ -// configure FPGA Tx Mux. -// -// 3 2 1 -// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 -// +-----------------------+-------+-------+-------+-------+-+-----+ -// | | DAC3 | DAC2 | DAC1 | DAC0 |0| NCH | -// +-----------------------------------------------+-------+-+-----+ -// -// NCH specifies the number of complex channels that are sent across -// the USB. The legal values are 1 or 2, corresponding to 2 or 4 -// 16-bit values. -// -// There are two interpolators with complex inputs and outputs. -// There are four DACs. (We use the DUC in each AD9862.) -// -// Each 4-bit DACx field specifies the source for the DAC and -// whether or not that DAC is enabled. Each subfield is coded -// like this: -// -// 3 2 1 0 -// +-+-----+ -// |E| N | -// +-+-----+ -// -// Where E is set if the DAC is enabled, and N specifies which -// interpolator output is connected to this DAC. -// -// N which interp output -// --- ------------------- -// 0 chan 0 I -// 1 chan 0 Q -// 2 chan 1 I -// 3 chan 1 Q - -#define FR_TX_MUX 39 - -// ------------------------------------------------------------------------ -// REFCLK control -// -// Control whether a reference clock is sent to the daughterboards, -// and what frequency. The refclk is sent on d'board i/o pin 0. -// -// 3 2 1 -// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 -// +-----------------------------------------------+-+------------+ -// | Reserved (Must be zero) |E| DIVISOR | -// +-----------------------------------------------+-+------------+ - -// -// Bit 7 -- 1 turns on refclk, 0 allows IO use -// Bits 6:0 Divider value - -#define FR_TX_A_REFCLK 40 -#define FR_RX_A_REFCLK 41 -#define FR_TX_B_REFCLK 42 -#define FR_RX_B_REFCLK 43 - -# define bmFR_REFCLK_EN 0x80 -# define bmFR_REFCLK_DIVISOR_MASK 0x7f - -// ------------------------------------------------------------------------ -// DDC Starting Phase - -#define FR_RX_PHASE_0 44 -#define FR_RX_PHASE_1 45 -#define FR_RX_PHASE_2 46 -#define FR_RX_PHASE_3 47 - -// ------------------------------------------------------------------------ -// Tx data format control register -// -// 3 2 1 -// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 -// +-------------------------------------------------------+-------+ -// | Reserved (Must be zero) | FMT | -// +-------------------------------------------------------+-------+ -// -// FMT values: - -#define FR_TX_FORMAT 48 -# define bmFR_TX_FORMAT_16_IQ 0 // 16-bit I, 16-bit Q - -// ------------------------------------------------------------------------ -// Rx data format control register -// -// 3 2 1 -// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 -// +-----------------------------------------+-+-+---------+-------+ -// | Reserved (Must be zero) |B|Q| WIDTH | SHIFT | -// +-----------------------------------------+-+-+---------+-------+ -// -// FMT values: - -#define FR_RX_FORMAT 49 - -# define bmFR_RX_FORMAT_SHIFT_MASK (0x0f << 0) // arithmetic right shift [0, 15] -# define bmFR_RX_FORMAT_SHIFT_SHIFT 0 -# define bmFR_RX_FORMAT_WIDTH_MASK (0x1f << 4) // data width in bits [1, 16] (not all valid) -# define bmFR_RX_FORMAT_WIDTH_SHIFT 4 -# define bmFR_RX_FORMAT_WANT_Q (0x1 << 9) // deliver both I & Q, else just I -# define bmFR_RX_FORMAT_BYPASS_HB (0x1 << 10) // bypass half-band filter - -// The valid combinations currently are: -// -// B Q WIDTH SHIFT -// 0 1 16 0 -// 0 1 8 8 - - -// Possible future values of WIDTH = {4, 2, 1} -// 12 takes a bit more work, since we need to know packet alignment. - -// ------------------------------------------------------------------------ -// FIXME register numbers 50 to 63 are available - -// ------------------------------------------------------------------------ -// Registers 64 to 95 are reserved for user custom FPGA builds. -// The standard USRP software will not touch these. - -#define FR_USER_0 64 -#define FR_USER_1 65 -#define FR_USER_2 66 -#define FR_USER_3 67 -#define FR_USER_4 68 -#define FR_USER_5 69 -#define FR_USER_6 70 -#define FR_USER_7 71 -#define FR_USER_8 72 -#define FR_USER_9 73 -#define FR_USER_10 74 -#define FR_USER_11 75 -#define FR_USER_12 76 -#define FR_USER_13 77 -#define FR_USER_14 78 -#define FR_USER_15 79 -#define FR_USER_16 80 -#define FR_USER_17 81 -#define FR_USER_18 82 -#define FR_USER_19 83 -#define FR_USER_20 84 -#define FR_USER_21 85 -#define FR_USER_22 86 -#define FR_USER_23 87 -#define FR_USER_24 88 -#define FR_USER_25 89 -#define FR_USER_26 90 -#define FR_USER_27 91 -#define FR_USER_28 92 -#define FR_USER_29 93 -#define FR_USER_30 94 -#define FR_USER_31 95 - -//Registers needed for multi usrp master/slave configuration -// -//Rx Master/slave control register (FR_RX_MASTER_SLAVE = FR_USER_0) -// -#define FR_RX_MASTER_SLAVE 64 -#define bitnoFR_RX_SYNC 0 -#define bitnoFR_RX_SYNC_MASTER 1 -#define bitnoFR_RX_SYNC_SLAVE 2 -# define bmFR_RX_SYNC (1 <<bitnoFR_RX_SYNC) //1 If this is a master "sync now" and send sync to slave. - // If this is a slave "sync now" (testing purpose only) - // Sync is allmost the same as reset (clear all counters and buffers) - // except that the io outputs and settings don't get reset (otherwise it couldn't send the sync to the slave) - //0 Normal operation - -# define bmFR_RX_SYNC_MASTER (1 <<bitnoFR_RX_SYNC_MASTER) //1 This is a rx sync master, output sync_rx on rx_a_io[15] - //0 This is not a rx sync master -# define bmFR_RX_SYNC_SLAVE (1 <<bitnoFR_RX_SYNC_SLAVE) //1 This is a rx sync slave, follow sync_rx on rx_a_io[bitnoFR_RX_SYNC_INPUT_IOPIN] - //0 This is not an rx sync slave. - -//Caution The master settings will output values on the io lines. -//They inheritely enable these lines as output. If you have a daughtercard which uses these lines also as output then you will burn your usrp and daughtercard. -//If you set the slave bits then your usrp won't do anything if you don't connect a master. -// Rx Master/slave control register -// -// The way this is supposed to be used is connecting a (short) 16pin flatcable from an rx daughterboard in RXA master io_rx[8..15] to slave io_rx[8..15] on RXA of slave usrp -// This can be done with basic_rx boards or dbsrx boards -//dbsrx: connect master-J25 to slave-J25 -//basic rx: connect J25 to slave-J25 -//CAUTION: pay attention to the lineup of your connector. -//The red line (pin1) should be at the same side of the daughterboards on master and slave. -//If you turnaround the cable on one end you will burn your usrp. - -//You cannot use a 16pin flatcable if you are using FLEX400 or FLEX2400 daughterboards, since these use a lot of the io pins. -//You can still link them but you must use only a 2pin or 1pin cable -//You can also use a 2-wire link. put a 2pin header on io[15],gnd of the master RXA daughterboard and connect it to io15,gnd of the slave RXA db. -//You can use a cable like the ones found with the leds on the mainbord of a PC. -//Make sure you don't twist the cable, otherwise you connect the sync output to ground. -//To be save you could also just use a single wire from master io[15] to slave io[15], but this is not optimal for signal integrity. - - -// Since rx_io[0] can normally be used as a refclk and is not exported on all daughterboards this line -// still has the refclk function if you use the master/slave setup (it is not touched by the master/slave settings). -// The master/slave circuitry will only use io pin 15 and does not touch any of the other io pins. -#define bitnoFR_RX_SYNC_INPUT_IOPIN 15 -#define bmFR_RX_SYNC_INPUT_IOPIN (1<<bitnoFR_RX_SYNC_INPUT_IOPIN) -//TODO the output pin is still hardcoded in the verilog code, make it listen to the following define -#define bitnoFR_RX_SYNC_OUTPUT_IOPIN 15 -#define bmFR_RX_SYNC_OUTPUT_IOPIN (1<<bitnoFR_RX_SYNC_OUTPUT_IOPIN) -// ======================================================================= -// READBACK Registers -// ======================================================================= - -#define FR_RB_IO_RX_A_IO_TX_A 1 // read back a-side i/o pins -#define FR_RB_IO_RX_B_IO_TX_B 2 // read back b-side i/o pins - -// ------------------------------------------------------------------------ -// FPGA Capability register -// -// 3 2 1 -// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 -// +-----------------------------------------------+-+-----+-+-----+ -// | Reserved (Must be zero) |T|NDUC |R|NDDC | -// +-----------------------------------------------+-+-----+-+-----+ -// -// Bottom 4-bits are Rx capabilities -// Next 4-bits are Tx capabilities - -#define FR_RB_CAPS 3 -# define bmFR_RB_CAPS_NDDC_MASK (0x7 << 0) // # of digital down converters 0,1,2,4 -# define bmFR_RB_CAPS_NDDC_SHIFT 0 -# define bmFR_RB_CAPS_RX_HAS_HALFBAND (0x1 << 3) -# define bmFR_RB_CAPS_NDUC_MASK (0x7 << 4) // # of digital up converters 0,1,2 -# define bmFR_RB_CAPS_NDUC_SHIFT 4 -# define bmFR_RB_CAPS_TX_HAS_HALFBAND (0x1 << 7) - - -#endif /* INCLUDED_FPGA_REGS_STANDARD_H */ diff --git a/usrp/firmware/include/fpga_regs_standard.v b/usrp/firmware/include/fpga_regs_standard.v deleted file mode 100644 index d09aa6116..000000000 --- a/usrp/firmware/include/fpga_regs_standard.v +++ /dev/null @@ -1,256 +0,0 @@ -// -// This file is machine generated from ./fpga_regs_standard.h -// Do not edit by hand; your edits will be overwritten. -// - -// Register numbers 0 to 31 are reserved for use in fpga_regs_common.h. -// Registers 64 to 79 are available for custom FPGA builds. - - -// DDC / DUC - -`define FR_INTERP_RATE 7'd32 // [1,1024] -`define FR_DECIM_RATE 7'd33 // [1,256] - -// DDC center freq - -`define FR_RX_FREQ_0 7'd34 -`define FR_RX_FREQ_1 7'd35 -`define FR_RX_FREQ_2 7'd36 -`define FR_RX_FREQ_3 7'd37 - -// See below for DDC Starting Phase - -// ------------------------------------------------------------------------ -// configure FPGA Rx mux -// -// 3 2 1 -// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 -// +-----------------------+-------+-------+-------+-------+-+-----+ -// | must be zero | Q3| I3| Q2| I2| Q1| I1| Q0| I0|Z| NCH | -// +-----------------------+-------+-------+-------+-------+-+-----+ -// -// There are a maximum of 4 digital downconverters in the the FPGA. -// Each DDC has two 16-bit inputs, I and Q, and two 16-bit outputs, I & Q. -// -// DDC I inputs are specified by the two bit fields I3, I2, I1 & I0 -// -// 0 = DDC input is from ADC 0 -// 1 = DDC input is from ADC 1 -// 2 = DDC input is from ADC 2 -// 3 = DDC input is from ADC 3 -// -// If Z == 1, all DDC Q inputs are set to zero -// If Z == 0, DDC Q inputs are specified by the two bit fields Q3, Q2, Q1 & Q0 -// -// NCH specifies the number of complex channels that are sent across -// the USB. The legal values are 1, 2 or 4, corresponding to 2, 4 or -// 8 16-bit values. - -`define FR_RX_MUX 7'd38 - -// ------------------------------------------------------------------------ -// configure FPGA Tx Mux. -// -// 3 2 1 -// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 -// +-----------------------+-------+-------+-------+-------+-+-----+ -// | | DAC3 | DAC2 | DAC1 | DAC0 |0| NCH | -// +-----------------------------------------------+-------+-+-----+ -// -// NCH specifies the number of complex channels that are sent across -// the USB. The legal values are 1 or 2, corresponding to 2 or 4 -// 16-bit values. -// -// There are two interpolators with complex inputs and outputs. -// There are four DACs. (We use the DUC in each AD9862.) -// -// Each 4-bit DACx field specifies the source for the DAC and -// whether or not that DAC is enabled. Each subfield is coded -// like this: -// -// 3 2 1 0 -// +-+-----+ -// |E| N | -// +-+-----+ -// -// Where E is set if the DAC is enabled, and N specifies which -// interpolator output is connected to this DAC. -// -// N which interp output -// --- ------------------- -// 0 chan 0 I -// 1 chan 0 Q -// 2 chan 1 I -// 3 chan 1 Q - -`define FR_TX_MUX 7'd39 - -// ------------------------------------------------------------------------ -// REFCLK control -// -// Control whether a reference clock is sent to the daughterboards, -// and what frequency. The refclk is sent on d'board i/o pin 0. -// -// 3 2 1 -// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 -// +-----------------------------------------------+-+------------+ -// | Reserved (Must be zero) |E| DIVISOR | -// +-----------------------------------------------+-+------------+ - -// -// Bit 7 -- 1 turns on refclk, 0 allows IO use -// Bits 6:0 Divider value - -`define FR_TX_A_REFCLK 7'd40 -`define FR_RX_A_REFCLK 7'd41 -`define FR_TX_B_REFCLK 7'd42 -`define FR_RX_B_REFCLK 7'd43 - - -// ------------------------------------------------------------------------ -// DDC Starting Phase - -`define FR_RX_PHASE_0 7'd44 -`define FR_RX_PHASE_1 7'd45 -`define FR_RX_PHASE_2 7'd46 -`define FR_RX_PHASE_3 7'd47 - -// ------------------------------------------------------------------------ -// Tx data format control register -// -// 3 2 1 -// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 -// +-------------------------------------------------------+-------+ -// | Reserved (Must be zero) | FMT | -// +-------------------------------------------------------+-------+ -// -// FMT values: - -`define FR_TX_FORMAT 7'd48 - -// ------------------------------------------------------------------------ -// Rx data format control register -// -// 3 2 1 -// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 -// +-----------------------------------------+-+-+---------+-------+ -// | Reserved (Must be zero) |B|Q| WIDTH | SHIFT | -// +-----------------------------------------+-+-+---------+-------+ -// -// FMT values: - -`define FR_RX_FORMAT 7'd49 - - -// The valid combinations currently are: -// -// B Q WIDTH SHIFT -// 0 1 16 0 -// 0 1 8 8 - - -// Possible future values of WIDTH = {4, 2, 1} -// 12 takes a bit more work, since we need to know packet alignment. - -// ------------------------------------------------------------------------ -// FIXME register numbers 50 to 63 are available - -// ------------------------------------------------------------------------ -// Registers 64 to 95 are reserved for user custom FPGA builds. -// The standard USRP software will not touch these. - -`define FR_USER_0 7'd64 -`define FR_USER_1 7'd65 -`define FR_USER_2 7'd66 -`define FR_USER_3 7'd67 -`define FR_USER_4 7'd68 -`define FR_USER_5 7'd69 -`define FR_USER_6 7'd70 -`define FR_USER_7 7'd71 -`define FR_USER_8 7'd72 -`define FR_USER_9 7'd73 -`define FR_USER_10 7'd74 -`define FR_USER_11 7'd75 -`define FR_USER_12 7'd76 -`define FR_USER_13 7'd77 -`define FR_USER_14 7'd78 -`define FR_USER_15 7'd79 -`define FR_USER_16 7'd80 -`define FR_USER_17 7'd81 -`define FR_USER_18 7'd82 -`define FR_USER_19 7'd83 -`define FR_USER_20 7'd84 -`define FR_USER_21 7'd85 -`define FR_USER_22 7'd86 -`define FR_USER_23 7'd87 -`define FR_USER_24 7'd88 -`define FR_USER_25 7'd89 -`define FR_USER_26 7'd90 -`define FR_USER_27 7'd91 -`define FR_USER_28 7'd92 -`define FR_USER_29 7'd93 -`define FR_USER_30 7'd94 -`define FR_USER_31 7'd95 - -//Registers needed for multi usrp master/slave configuration -// -//Rx Master/slave control register (FR_RX_MASTER_SLAVE = FR_USER_0) -// -`define FR_RX_MASTER_SLAVE 7'd64 -`define bitnoFR_RX_SYNC 0 -`define bitnoFR_RX_SYNC_MASTER 1 -`define bitnoFR_RX_SYNC_SLAVE 2 - - -//Caution The master settings will output values on the io lines. -//They inheritely enable these lines as output. If you have a daughtercard which uses these lines also as output then you will burn your usrp and daughtercard. -//If you set the slave bits then your usrp won't do anything if you don't connect a master. -// Rx Master/slave control register -// -// The way this is supposed to be used is connecting a (short) 16pin flatcable from an rx daughterboard in RXA master io_rx[8..15] to slave io_rx[8..15] on RXA of slave usrp -// This can be done with basic_rx boards or dbsrx boards -//dbsrx: connect master-J25 to slave-J25 -//basic rx: connect J25 to slave-J25 -//CAUTION: pay attention to the lineup of your connector. -//The red line (pin1) should be at the same side of the daughterboards on master and slave. -//If you turnaround the cable on one end you will burn your usrp. - -//You cannot use a 16pin flatcable if you are using FLEX400 or FLEX2400 daughterboards, since these use a lot of the io pins. -//You can still link them but you must use only a 2pin or 1pin cable -//You can also use a 2-wire link. put a 2pin header on io[15],gnd of the master RXA daughterboard and connect it to io15,gnd of the slave RXA db. -//You can use a cable like the ones found with the leds on the mainbord of a PC. -//Make sure you don't twist the cable, otherwise you connect the sync output to ground. -//To be save you could also just use a single wire from master io[15] to slave io[15], but this is not optimal for signal integrity. - - -// Since rx_io[0] can normally be used as a refclk and is not exported on all daughterboards this line -// still has the refclk function if you use the master/slave setup (it is not touched by the master/slave settings). -// The master/slave circuitry will only use io pin 15 and does not touch any of the other io pins. -`define bitnoFR_RX_SYNC_INPUT_IOPIN 15 -`define bmFR_RX_SYNC_INPUT_IOPIN (1<<bitnoFR_RX_SYNC_INPUT_IOPIN) -//TODO the output pin is still hardcoded in the verilog code, make it listen to the following define -`define bitnoFR_RX_SYNC_OUTPUT_IOPIN 15 -`define bmFR_RX_SYNC_OUTPUT_IOPIN (1<<bitnoFR_RX_SYNC_OUTPUT_IOPIN) -// ======================================================================= -// READBACK Registers -// ======================================================================= - -`define FR_RB_IO_RX_A_IO_TX_A 7'd1 // read back a-side i/o pins -`define FR_RB_IO_RX_B_IO_TX_B 7'd2 // read back b-side i/o pins - -// ------------------------------------------------------------------------ -// FPGA Capability register -// -// 3 2 1 -// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 -// +-----------------------------------------------+-+-----+-+-----+ -// | Reserved (Must be zero) |T|NDUC |R|NDDC | -// +-----------------------------------------------+-+-----+-+-----+ -// -// Bottom 4-bits are Rx capabilities -// Next 4-bits are Tx capabilities - -`define FR_RB_CAPS 7'd3 - - diff --git a/usrp/firmware/include/fx2regs.h b/usrp/firmware/include/fx2regs.h deleted file mode 100644 index 2f210f567..000000000 --- a/usrp/firmware/include/fx2regs.h +++ /dev/null @@ -1,716 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -/* -//----------------------------------------------------------------------------- -// File: FX2regs.h -// Contents: EZ-USB FX2 register declarations and bit mask definitions. -// -// $Archive: /USB/Target/Inc/fx2regs.h $ -// $Date$ -// $Revision$ -// -// -// Copyright (c) 2000 Cypress Semiconductor, All rights reserved -//----------------------------------------------------------------------------- -*/ - - -#ifndef FX2REGS_H /* Header Sentry */ -#define FX2REGS_H - -#define ALLOCATE_EXTERN // required for "right thing to happen" with fx2regs.h - -/* -//----------------------------------------------------------------------------- -// FX2 Related Register Assignments -//----------------------------------------------------------------------------- - -// The Ez-USB FX2 registers are defined here. We use FX2regs.h for register -// address allocation by using "#define ALLOCATE_EXTERN". -// When using "#define ALLOCATE_EXTERN", you get (for instance): -// xdata volatile BYTE OUT7BUF[64] _at_ 0x7B40; -// Such lines are created from FX2.h by using the preprocessor. -// Incidently, these lines will not generate any space in the resulting hex -// file; they just bind the symbols to the addresses for compilation. -// You just need to put "#define ALLOCATE_EXTERN" in your main program file; -// i.e. fw.c or a stand-alone C source file. -// Without "#define ALLOCATE_EXTERN", you just get the external reference: -// extern xdata volatile BYTE OUT7BUF[64] ;// 0x7B40; -// This uses the concatenation operator "##" to insert a comment "//" -// to cut off the end of the line, "_at_ 0x7B40;", which is not wanted. -*/ - - -#ifdef ALLOCATE_EXTERN -#define EXTERN -#define _AT_(a) at a -#else -#define EXTERN extern -#define _AT_ ;/ ## / -#endif - -typedef unsigned char BYTE; -typedef unsigned short WORD; - -EXTERN xdata _AT_(0xE400) volatile BYTE GPIF_WAVE_DATA[128]; -EXTERN xdata _AT_(0xE480) volatile BYTE RES_WAVEDATA_END ; - -// General Configuration - -EXTERN xdata _AT_(0xE600) volatile BYTE CPUCS ; // Control & Status -EXTERN xdata _AT_(0xE601) volatile BYTE IFCONFIG ; // Interface Configuration -EXTERN xdata _AT_(0xE602) volatile BYTE PINFLAGSAB ; // FIFO FLAGA and FLAGB Assignments -EXTERN xdata _AT_(0xE603) volatile BYTE PINFLAGSCD ; // FIFO FLAGC and FLAGD Assignments -EXTERN xdata _AT_(0xE604) volatile BYTE FIFORESET ; // Restore FIFOS to default state -EXTERN xdata _AT_(0xE605) volatile BYTE BREAKPT ; // Breakpoint -EXTERN xdata _AT_(0xE606) volatile BYTE BPADDRH ; // Breakpoint Address H -EXTERN xdata _AT_(0xE607) volatile BYTE BPADDRL ; // Breakpoint Address L -EXTERN xdata _AT_(0xE608) volatile BYTE UART230 ; // 230 Kbaud clock for T0,T1,T2 -EXTERN xdata _AT_(0xE609) volatile BYTE FIFOPINPOLAR ; // FIFO polarities -EXTERN xdata _AT_(0xE60A) volatile BYTE REVID ; // Chip Revision -EXTERN xdata _AT_(0xE60B) volatile BYTE REVCTL ; // Chip Revision Control - -// Endpoint Configuration - -EXTERN xdata _AT_(0xE610) volatile BYTE EP1OUTCFG ; // Endpoint 1-OUT Configuration -EXTERN xdata _AT_(0xE611) volatile BYTE EP1INCFG ; // Endpoint 1-IN Configuration -EXTERN xdata _AT_(0xE612) volatile BYTE EP2CFG ; // Endpoint 2 Configuration -EXTERN xdata _AT_(0xE613) volatile BYTE EP4CFG ; // Endpoint 4 Configuration -EXTERN xdata _AT_(0xE614) volatile BYTE EP6CFG ; // Endpoint 6 Configuration -EXTERN xdata _AT_(0xE615) volatile BYTE EP8CFG ; // Endpoint 8 Configuration -EXTERN xdata _AT_(0xE618) volatile BYTE EP2FIFOCFG ; // Endpoint 2 FIFO configuration -EXTERN xdata _AT_(0xE619) volatile BYTE EP4FIFOCFG ; // Endpoint 4 FIFO configuration -EXTERN xdata _AT_(0xE61A) volatile BYTE EP6FIFOCFG ; // Endpoint 6 FIFO configuration -EXTERN xdata _AT_(0xE61B) volatile BYTE EP8FIFOCFG ; // Endpoint 8 FIFO configuration -EXTERN xdata _AT_(0xE620) volatile BYTE EP2AUTOINLENH ; // Endpoint 2 Packet Length H (IN only) -EXTERN xdata _AT_(0xE621) volatile BYTE EP2AUTOINLENL ; // Endpoint 2 Packet Length L (IN only) -EXTERN xdata _AT_(0xE622) volatile BYTE EP4AUTOINLENH ; // Endpoint 4 Packet Length H (IN only) -EXTERN xdata _AT_(0xE623) volatile BYTE EP4AUTOINLENL ; // Endpoint 4 Packet Length L (IN only) -EXTERN xdata _AT_(0xE624) volatile BYTE EP6AUTOINLENH ; // Endpoint 6 Packet Length H (IN only) -EXTERN xdata _AT_(0xE625) volatile BYTE EP6AUTOINLENL ; // Endpoint 6 Packet Length L (IN only) -EXTERN xdata _AT_(0xE626) volatile BYTE EP8AUTOINLENH ; // Endpoint 8 Packet Length H (IN only) -EXTERN xdata _AT_(0xE627) volatile BYTE EP8AUTOINLENL ; // Endpoint 8 Packet Length L (IN only) -EXTERN xdata _AT_(0xE630) volatile BYTE EP2FIFOPFH ; // EP2 Programmable Flag trigger H -EXTERN xdata _AT_(0xE631) volatile BYTE EP2FIFOPFL ; // EP2 Programmable Flag trigger L -EXTERN xdata _AT_(0xE632) volatile BYTE EP4FIFOPFH ; // EP4 Programmable Flag trigger H -EXTERN xdata _AT_(0xE633) volatile BYTE EP4FIFOPFL ; // EP4 Programmable Flag trigger L -EXTERN xdata _AT_(0xE634) volatile BYTE EP6FIFOPFH ; // EP6 Programmable Flag trigger H -EXTERN xdata _AT_(0xE635) volatile BYTE EP6FIFOPFL ; // EP6 Programmable Flag trigger L -EXTERN xdata _AT_(0xE636) volatile BYTE EP8FIFOPFH ; // EP8 Programmable Flag trigger H -EXTERN xdata _AT_(0xE637) volatile BYTE EP8FIFOPFL ; // EP8 Programmable Flag trigger L -EXTERN xdata _AT_(0xE640) volatile BYTE EP2ISOINPKTS ; // EP2 (if ISO) IN Packets per frame (1-3) -EXTERN xdata _AT_(0xE641) volatile BYTE EP4ISOINPKTS ; // EP4 (if ISO) IN Packets per frame (1-3) -EXTERN xdata _AT_(0xE642) volatile BYTE EP6ISOINPKTS ; // EP6 (if ISO) IN Packets per frame (1-3) -EXTERN xdata _AT_(0xE643) volatile BYTE EP8ISOINPKTS ; // EP8 (if ISO) IN Packets per frame (1-3) -EXTERN xdata _AT_(0xE648) volatile BYTE INPKTEND ; // Force IN Packet End -EXTERN xdata _AT_(0xE649) volatile BYTE OUTPKTEND ; // Force OUT Packet End - -// Interrupts - -EXTERN xdata _AT_(0xE650) volatile BYTE EP2FIFOIE ; // Endpoint 2 Flag Interrupt Enable -EXTERN xdata _AT_(0xE651) volatile BYTE EP2FIFOIRQ ; // Endpoint 2 Flag Interrupt Request -EXTERN xdata _AT_(0xE652) volatile BYTE EP4FIFOIE ; // Endpoint 4 Flag Interrupt Enable -EXTERN xdata _AT_(0xE653) volatile BYTE EP4FIFOIRQ ; // Endpoint 4 Flag Interrupt Request -EXTERN xdata _AT_(0xE654) volatile BYTE EP6FIFOIE ; // Endpoint 6 Flag Interrupt Enable -EXTERN xdata _AT_(0xE655) volatile BYTE EP6FIFOIRQ ; // Endpoint 6 Flag Interrupt Request -EXTERN xdata _AT_(0xE656) volatile BYTE EP8FIFOIE ; // Endpoint 8 Flag Interrupt Enable -EXTERN xdata _AT_(0xE657) volatile BYTE EP8FIFOIRQ ; // Endpoint 8 Flag Interrupt Request -EXTERN xdata _AT_(0xE658) volatile BYTE IBNIE ; // IN-BULK-NAK Interrupt Enable -EXTERN xdata _AT_(0xE659) volatile BYTE IBNIRQ ; // IN-BULK-NAK interrupt Request -EXTERN xdata _AT_(0xE65A) volatile BYTE NAKIE ; // Endpoint Ping NAK interrupt Enable -EXTERN xdata _AT_(0xE65B) volatile BYTE NAKIRQ ; // Endpoint Ping NAK interrupt Request -EXTERN xdata _AT_(0xE65C) volatile BYTE USBIE ; // USB Int Enables -EXTERN xdata _AT_(0xE65D) volatile BYTE USBIRQ ; // USB Interrupt Requests -EXTERN xdata _AT_(0xE65E) volatile BYTE EPIE ; // Endpoint Interrupt Enables -EXTERN xdata _AT_(0xE65F) volatile BYTE EPIRQ ; // Endpoint Interrupt Requests -EXTERN xdata _AT_(0xE660) volatile BYTE GPIFIE ; // GPIF Interrupt Enable -EXTERN xdata _AT_(0xE661) volatile BYTE GPIFIRQ ; // GPIF Interrupt Request -EXTERN xdata _AT_(0xE662) volatile BYTE USBERRIE ; // USB Error Interrupt Enables -EXTERN xdata _AT_(0xE663) volatile BYTE USBERRIRQ ; // USB Error Interrupt Requests -EXTERN xdata _AT_(0xE664) volatile BYTE ERRCNTLIM ; // USB Error counter and limit -EXTERN xdata _AT_(0xE665) volatile BYTE CLRERRCNT ; // Clear Error Counter EC[3..0] -EXTERN xdata _AT_(0xE666) volatile BYTE INT2IVEC ; // Interupt 2 (USB) Autovector -EXTERN xdata _AT_(0xE667) volatile BYTE INT4IVEC ; // Interupt 4 (FIFOS & GPIF) Autovector -EXTERN xdata _AT_(0xE668) volatile BYTE INTSETUP ; // Interrupt 2&4 Setup - -// Input/Output - -EXTERN xdata _AT_(0xE670) volatile BYTE PORTACFG ; // I/O PORTA Alternate Configuration -EXTERN xdata _AT_(0xE671) volatile BYTE PORTCCFG ; // I/O PORTC Alternate Configuration -EXTERN xdata _AT_(0xE672) volatile BYTE PORTECFG ; // I/O PORTE Alternate Configuration -EXTERN xdata _AT_(0xE678) volatile BYTE I2CS ; // Control & Status -EXTERN xdata _AT_(0xE679) volatile BYTE I2DAT ; // Data -EXTERN xdata _AT_(0xE67A) volatile BYTE I2CTL ; // I2C Control -EXTERN xdata _AT_(0xE67B) volatile BYTE XAUTODAT1 ; // Autoptr1 MOVX access -EXTERN xdata _AT_(0xE67C) volatile BYTE XAUTODAT2 ; // Autoptr2 MOVX access - -#define EXTAUTODAT1 XAUTODAT1 -#define EXTAUTODAT2 XAUTODAT2 - -// USB Control - -EXTERN xdata _AT_(0xE680) volatile BYTE USBCS ; // USB Control & Status -EXTERN xdata _AT_(0xE681) volatile BYTE SUSPEND ; // Put chip into suspend -EXTERN xdata _AT_(0xE682) volatile BYTE WAKEUPCS ; // Wakeup source and polarity -EXTERN xdata _AT_(0xE683) volatile BYTE TOGCTL ; // Toggle Control -EXTERN xdata _AT_(0xE684) volatile BYTE USBFRAMEH ; // USB Frame count H -EXTERN xdata _AT_(0xE685) volatile BYTE USBFRAMEL ; // USB Frame count L -EXTERN xdata _AT_(0xE686) volatile BYTE MICROFRAME ; // Microframe count, 0-7 -EXTERN xdata _AT_(0xE687) volatile BYTE FNADDR ; // USB Function address - -// Endpoints - -EXTERN xdata _AT_(0xE68A) volatile BYTE EP0BCH ; // Endpoint 0 Byte Count H -EXTERN xdata _AT_(0xE68B) volatile BYTE EP0BCL ; // Endpoint 0 Byte Count L -EXTERN xdata _AT_(0xE68D) volatile BYTE EP1OUTBC ; // Endpoint 1 OUT Byte Count -EXTERN xdata _AT_(0xE68F) volatile BYTE EP1INBC ; // Endpoint 1 IN Byte Count -EXTERN xdata _AT_(0xE690) volatile BYTE EP2BCH ; // Endpoint 2 Byte Count H -EXTERN xdata _AT_(0xE691) volatile BYTE EP2BCL ; // Endpoint 2 Byte Count L -EXTERN xdata _AT_(0xE694) volatile BYTE EP4BCH ; // Endpoint 4 Byte Count H -EXTERN xdata _AT_(0xE695) volatile BYTE EP4BCL ; // Endpoint 4 Byte Count L -EXTERN xdata _AT_(0xE698) volatile BYTE EP6BCH ; // Endpoint 6 Byte Count H -EXTERN xdata _AT_(0xE699) volatile BYTE EP6BCL ; // Endpoint 6 Byte Count L -EXTERN xdata _AT_(0xE69C) volatile BYTE EP8BCH ; // Endpoint 8 Byte Count H -EXTERN xdata _AT_(0xE69D) volatile BYTE EP8BCL ; // Endpoint 8 Byte Count L -EXTERN xdata _AT_(0xE6A0) volatile BYTE EP0CS ; // Endpoint Control and Status -EXTERN xdata _AT_(0xE6A1) volatile BYTE EP1OUTCS ; // Endpoint 1 OUT Control and Status -EXTERN xdata _AT_(0xE6A2) volatile BYTE EP1INCS ; // Endpoint 1 IN Control and Status -EXTERN xdata _AT_(0xE6A3) volatile BYTE EP2CS ; // Endpoint 2 Control and Status -EXTERN xdata _AT_(0xE6A4) volatile BYTE EP4CS ; // Endpoint 4 Control and Status -EXTERN xdata _AT_(0xE6A5) volatile BYTE EP6CS ; // Endpoint 6 Control and Status -EXTERN xdata _AT_(0xE6A6) volatile BYTE EP8CS ; // Endpoint 8 Control and Status -EXTERN xdata _AT_(0xE6A7) volatile BYTE EP2FIFOFLGS ; // Endpoint 2 Flags -EXTERN xdata _AT_(0xE6A8) volatile BYTE EP4FIFOFLGS ; // Endpoint 4 Flags -EXTERN xdata _AT_(0xE6A9) volatile BYTE EP6FIFOFLGS ; // Endpoint 6 Flags -EXTERN xdata _AT_(0xE6AA) volatile BYTE EP8FIFOFLGS ; // Endpoint 8 Flags -EXTERN xdata _AT_(0xE6AB) volatile BYTE EP2FIFOBCH ; // EP2 FIFO total byte count H -EXTERN xdata _AT_(0xE6AC) volatile BYTE EP2FIFOBCL ; // EP2 FIFO total byte count L -EXTERN xdata _AT_(0xE6AD) volatile BYTE EP4FIFOBCH ; // EP4 FIFO total byte count H -EXTERN xdata _AT_(0xE6AE) volatile BYTE EP4FIFOBCL ; // EP4 FIFO total byte count L -EXTERN xdata _AT_(0xE6AF) volatile BYTE EP6FIFOBCH ; // EP6 FIFO total byte count H -EXTERN xdata _AT_(0xE6B0) volatile BYTE EP6FIFOBCL ; // EP6 FIFO total byte count L -EXTERN xdata _AT_(0xE6B1) volatile BYTE EP8FIFOBCH ; // EP8 FIFO total byte count H -EXTERN xdata _AT_(0xE6B2) volatile BYTE EP8FIFOBCL ; // EP8 FIFO total byte count L -EXTERN xdata _AT_(0xE6B3) volatile BYTE SUDPTRH ; // Setup Data Pointer high address byte -EXTERN xdata _AT_(0xE6B4) volatile BYTE SUDPTRL ; // Setup Data Pointer low address byte -EXTERN xdata _AT_(0xE6B5) volatile BYTE SUDPTRCTL ; // Setup Data Pointer Auto Mode -EXTERN xdata _AT_(0xE6B8) volatile BYTE SETUPDAT[8] ; // 8 bytes of SETUP data - -// GPIF - -EXTERN xdata _AT_(0xE6C0) volatile BYTE GPIFWFSELECT ; // Waveform Selector -EXTERN xdata _AT_(0xE6C1) volatile BYTE GPIFIDLECS ; // GPIF Done, GPIF IDLE drive mode -EXTERN xdata _AT_(0xE6C2) volatile BYTE GPIFIDLECTL ; // Inactive Bus, CTL states -EXTERN xdata _AT_(0xE6C3) volatile BYTE GPIFCTLCFG ; // CTL OUT pin drive -EXTERN xdata _AT_(0xE6C4) volatile BYTE GPIFADRH ; // GPIF Address H -EXTERN xdata _AT_(0xE6C5) volatile BYTE GPIFADRL ; // GPIF Address L - -EXTERN xdata _AT_(0xE6CE) volatile BYTE GPIFTCB3 ; // GPIF Transaction Count Byte 3 -EXTERN xdata _AT_(0xE6CF) volatile BYTE GPIFTCB2 ; // GPIF Transaction Count Byte 2 -EXTERN xdata _AT_(0xE6D0) volatile BYTE GPIFTCB1 ; // GPIF Transaction Count Byte 1 -EXTERN xdata _AT_(0xE6D1) volatile BYTE GPIFTCB0 ; // GPIF Transaction Count Byte 0 - -#define EP2GPIFTCH GPIFTCB1 // these are here for backwards compatibility -#define EP2GPIFTCL GPIFTCB0 // before REVE silicon (ie. REVB and REVD) -#define EP4GPIFTCH GPIFTCB1 // these are here for backwards compatibility -#define EP4GPIFTCL GPIFTCB0 // before REVE silicon (ie. REVB and REVD) -#define EP6GPIFTCH GPIFTCB1 // these are here for backwards compatibility -#define EP6GPIFTCL GPIFTCB0 // before REVE silicon (ie. REVB and REVD) -#define EP8GPIFTCH GPIFTCB1 // these are here for backwards compatibility -#define EP8GPIFTCL GPIFTCB0 // before REVE silicon (ie. REVB and REVD) - -// EXTERN xdata volatile BYTE EP2GPIFTCH _AT_ 0xE6D0; // EP2 GPIF Transaction Count High -// EXTERN xdata volatile BYTE EP2GPIFTCL _AT_ 0xE6D1; // EP2 GPIF Transaction Count Low -EXTERN xdata _AT_(0xE6D2) volatile BYTE EP2GPIFFLGSEL ; // EP2 GPIF Flag select -EXTERN xdata _AT_(0xE6D3) volatile BYTE EP2GPIFPFSTOP ; // Stop GPIF EP2 transaction on prog. flag -EXTERN xdata _AT_(0xE6D4) volatile BYTE EP2GPIFTRIG ; // EP2 FIFO Trigger -// EXTERN xdata volatile BYTE EP4GPIFTCH _AT_ 0xE6D8; // EP4 GPIF Transaction Count High -// EXTERN xdata volatile BYTE EP4GPIFTCL _AT_ 0xE6D9; // EP4 GPIF Transactionr Count Low -EXTERN xdata _AT_(0xE6DA) volatile BYTE EP4GPIFFLGSEL ; // EP4 GPIF Flag select -EXTERN xdata _AT_(0xE6DB) volatile BYTE EP4GPIFPFSTOP ; // Stop GPIF EP4 transaction on prog. flag -EXTERN xdata _AT_(0xE6DC) volatile BYTE EP4GPIFTRIG ; // EP4 FIFO Trigger -// EXTERN xdata volatile BYTE EP6GPIFTCH _AT_ 0xE6E0; // EP6 GPIF Transaction Count High -// EXTERN xdata volatile BYTE EP6GPIFTCL _AT_ 0xE6E1; // EP6 GPIF Transaction Count Low -EXTERN xdata _AT_(0xE6E2) volatile BYTE EP6GPIFFLGSEL ; // EP6 GPIF Flag select -EXTERN xdata _AT_(0xE6E3) volatile BYTE EP6GPIFPFSTOP ; // Stop GPIF EP6 transaction on prog. flag -EXTERN xdata _AT_(0xE6E4) volatile BYTE EP6GPIFTRIG ; // EP6 FIFO Trigger -// EXTERN xdata volatile BYTE EP8GPIFTCH _AT_ 0xE6E8; // EP8 GPIF Transaction Count High -// EXTERN xdata volatile BYTE EP8GPIFTCL _AT_ 0xE6E9; // EP8GPIF Transaction Count Low -EXTERN xdata _AT_(0xE6EA) volatile BYTE EP8GPIFFLGSEL ; // EP8 GPIF Flag select -EXTERN xdata _AT_(0xE6EB) volatile BYTE EP8GPIFPFSTOP ; // Stop GPIF EP8 transaction on prog. flag -EXTERN xdata _AT_(0xE6EC) volatile BYTE EP8GPIFTRIG ; // EP8 FIFO Trigger -EXTERN xdata _AT_(0xE6F0) volatile BYTE XGPIFSGLDATH ; // GPIF Data H (16-bit mode only) -EXTERN xdata _AT_(0xE6F1) volatile BYTE XGPIFSGLDATLX ; // Read/Write GPIF Data L & trigger transac -EXTERN xdata _AT_(0xE6F2) volatile BYTE XGPIFSGLDATLNOX ; // Read GPIF Data L, no transac trigger -EXTERN xdata _AT_(0xE6F3) volatile BYTE GPIFREADYCFG ; // Internal RDY,Sync/Async, RDY5CFG -EXTERN xdata _AT_(0xE6F4) volatile BYTE GPIFREADYSTAT ; // RDY pin states -EXTERN xdata _AT_(0xE6F5) volatile BYTE GPIFABORT ; // Abort GPIF cycles - -// UDMA - -EXTERN xdata _AT_(0xE6C6) volatile BYTE FLOWSTATE ; //Defines GPIF flow state -EXTERN xdata _AT_(0xE6C7) volatile BYTE FLOWLOGIC ; //Defines flow/hold decision criteria -EXTERN xdata _AT_(0xE6C8) volatile BYTE FLOWEQ0CTL ; //CTL states during active flow state -EXTERN xdata _AT_(0xE6C9) volatile BYTE FLOWEQ1CTL ; //CTL states during hold flow state -EXTERN xdata _AT_(0xE6CA) volatile BYTE FLOWHOLDOFF ; -EXTERN xdata _AT_(0xE6CB) volatile BYTE FLOWSTB ; //CTL/RDY Signal to use as master data strobe -EXTERN xdata _AT_(0xE6CC) volatile BYTE FLOWSTBEDGE ; //Defines active master strobe edge -EXTERN xdata _AT_(0xE6CD) volatile BYTE FLOWSTBHPERIOD ; //Half Period of output master strobe -EXTERN xdata _AT_(0xE60C) volatile BYTE GPIFHOLDAMOUNT ; //Data delay shift -EXTERN xdata _AT_(0xE67D) volatile BYTE UDMACRCH ; //CRC Upper byte -EXTERN xdata _AT_(0xE67E) volatile BYTE UDMACRCL ; //CRC Lower byte -EXTERN xdata _AT_(0xE67F) volatile BYTE UDMACRCQUAL ; //UDMA In only, host terminated use only - - -// Debug/Test - -EXTERN xdata _AT_(0xE6F8) volatile BYTE DBUG ; // Debug -EXTERN xdata _AT_(0xE6F9) volatile BYTE TESTCFG ; // Test configuration -EXTERN xdata _AT_(0xE6FA) volatile BYTE USBTEST ; // USB Test Modes -EXTERN xdata _AT_(0xE6FB) volatile BYTE CT1 ; // Chirp Test--Override -EXTERN xdata _AT_(0xE6FC) volatile BYTE CT2 ; // Chirp Test--FSM -EXTERN xdata _AT_(0xE6FD) volatile BYTE CT3 ; // Chirp Test--Control Signals -EXTERN xdata _AT_(0xE6FE) volatile BYTE CT4 ; // Chirp Test--Inputs - -// Endpoint Buffers - -EXTERN xdata _AT_(0xE740) volatile BYTE EP0BUF[64] ; // EP0 IN-OUT buffer -EXTERN xdata _AT_(0xE780) volatile BYTE EP1OUTBUF[64] ; // EP1-OUT buffer -EXTERN xdata _AT_(0xE7C0) volatile BYTE EP1INBUF[64] ; // EP1-IN buffer -EXTERN xdata _AT_(0xF000) volatile BYTE EP2FIFOBUF[1024] ; // 512/1024-byte EP2 buffer (IN or OUT) -EXTERN xdata _AT_(0xF400) volatile BYTE EP4FIFOBUF[1024] ; // 512 byte EP4 buffer (IN or OUT) -EXTERN xdata _AT_(0xF800) volatile BYTE EP6FIFOBUF[1024] ; // 512/1024-byte EP6 buffer (IN or OUT) -EXTERN xdata _AT_(0xFC00) volatile BYTE EP8FIFOBUF[1024] ; // 512 byte EP8 buffer (IN or OUT) - -#undef EXTERN -#undef _AT_ - -/*----------------------------------------------------------------------------- - Special Function Registers (SFRs) - The byte registers and bits defined in the following list are based - on the Synopsis definition of the 8051 Special Function Registers for EZ-USB. - If you modify the register definitions below, please regenerate the file - "ezregs.inc" which includes the same basic information for assembly inclusion. ------------------------------------------------------------------------------*/ - -sfr at 0x80 IOA; -sfr at 0x81 SP; -sfr at 0x82 DPL; -sfr at 0x83 DPH; -sfr at 0x84 DPL1; -sfr at 0x85 DPH1; -sfr at 0x86 DPS; - /* DPS */ - sbit at 0x86+0 SEL; -sfr at 0x87 PCON; /* PCON */ - //sbit IDLE = 0x87+0; - //sbit STOP = 0x87+1; - //sbit GF0 = 0x87+2; - //sbit GF1 = 0x87+3; - //sbit SMOD0 = 0x87+7; -sfr at 0x88 TCON; - /* TCON */ - sbit at 0x88+0 IT0; - sbit at 0x88+1 IE0; - sbit at 0x88+2 IT1; - sbit at 0x88+3 IE1; - sbit at 0x88+4 TR0; - sbit at 0x88+5 TF0; - sbit at 0x88+6 TR1; - sbit at 0x88+7 TF1; -sfr at 0x89 TMOD; - /* TMOD */ - //sbit M00 = 0x89+0; - //sbit M10 = 0x89+1; - //sbit CT0 = 0x89+2; - //sbit GATE0 = 0x89+3; - //sbit M01 = 0x89+4; - //sbit M11 = 0x89+5; - //sbit CT1 = 0x89+6; - //sbit GATE1 = 0x89+7; -sfr at 0x8A TL0; -sfr at 0x8B TL1; -sfr at 0x8C TH0; -sfr at 0x8D TH1; -sfr at 0x8E CKCON; - /* CKCON */ - //sbit MD0 = 0x89+0; - //sbit MD1 = 0x89+1; - //sbit MD2 = 0x89+2; - //sbit T0M = 0x89+3; - //sbit T1M = 0x89+4; - //sbit T2M = 0x89+5; -// sfr at 0x8F SPC_FNC; // Was WRS in Reg320 - /* CKCON */ - //sbit WRS = 0x8F+0; -sfr at 0x90 IOB; -sfr at 0x91 EXIF; // EXIF Bit Values differ from Reg320 - /* EXIF */ - //sbit USBINT = 0x91+4; - //sbit I2CINT = 0x91+5; - //sbit IE4 = 0x91+6; - //sbit IE5 = 0x91+7; -sfr at 0x92 MPAGE; -sfr at 0x98 SCON0; - /* SCON0 */ - sbit at 0x98+0 RI; - sbit at 0x98+1 TI; - sbit at 0x98+2 RB8; - sbit at 0x98+3 TB8; - sbit at 0x98+4 REN; - sbit at 0x98+5 SM2; - sbit at 0x98+6 SM1; - sbit at 0x98+7 SM0; -sfr at 0x99 SBUF0; - -sfr at 0x9A APTR1H; -sfr at 0x9B APTR1L; -sfr at 0x9C AUTODAT1; -sfr at 0x9D AUTOPTRH2; -sfr at 0x9E AUTOPTRL2; -sfr at 0x9F AUTODAT2; -sfr at 0xA0 IOC; -sfr at 0xA1 INT2CLR; -sfr at 0xA2 INT4CLR; - -#define AUTOPTRH1 APTR1H -#define AUTOPTRL1 APTR1L - -sfr at 0xA8 IE; - /* IE */ - sbit at 0xA8+0 EX0; - sbit at 0xA8+1 ET0; - sbit at 0xA8+2 EX1; - sbit at 0xA8+3 ET1; - sbit at 0xA8+4 ES0; - sbit at 0xA8+5 ET2; - sbit at 0xA8+6 ES1; - sbit at 0xA8+7 EA; - -sfr at 0xAA EP2468STAT; - /* EP2468STAT */ - //sbit EP2E = 0xAA+0; - //sbit EP2F = 0xAA+1; - //sbit EP4E = 0xAA+2; - //sbit EP4F = 0xAA+3; - //sbit EP6E = 0xAA+4; - //sbit EP6F = 0xAA+5; - //sbit EP8E = 0xAA+6; - //sbit EP8F = 0xAA+7; - -sfr at 0xAB EP24FIFOFLGS; -sfr at 0xAC EP68FIFOFLGS; -sfr at 0xAF AUTOPTRSETUP; - /* AUTOPTRSETUP */ - // sbit EXTACC = 0xAF+0; - // sbit APTR1FZ = 0xAF+1; - // sbit APTR2FZ = 0xAF+2; - -sfr at 0xB0 IOD; -sfr at 0xB1 IOE; -sfr at 0xB2 OEA; -sfr at 0xB3 OEB; -sfr at 0xB4 OEC; -sfr at 0xB5 OED; -sfr at 0xB6 OEE; - -sfr at 0xB8 IP; - /* IP */ - sbit at 0xB8+0 PX0; - sbit at 0xB8+1 PT0; - sbit at 0xB8+2 PX1; - sbit at 0xB8+3 PT1; - sbit at 0xB8+4 PS0; - sbit at 0xB8+5 PT2; - sbit at 0xB8+6 PS1; - -sfr at 0xBA EP01STAT; -sfr at 0xBB GPIFTRIG; - -sfr at 0xBD GPIFSGLDATH; -sfr at 0xBE GPIFSGLDATLX; -sfr at 0xBF GPIFSGLDATLNOX; - -sfr at 0xC0 SCON1; - /* SCON1 */ - sbit at 0xC0+0 RI1; - sbit at 0xC0+1 TI1; - sbit at 0xC0+2 RB81; - sbit at 0xC0+3 TB81; - sbit at 0xC0+4 REN1; - sbit at 0xC0+5 SM21; - sbit at 0xC0+6 SM11; - sbit at 0xC0+7 SM01; -sfr at 0xC1 SBUF1; -sfr at 0xC8 T2CON; - /* T2CON */ - sbit at 0xC8+0 CP_RL2; - sbit at 0xC8+1 C_T2; - sbit at 0xC8+2 TR2; - sbit at 0xC8+3 EXEN2; - sbit at 0xC8+4 TCLK; - sbit at 0xC8+5 RCLK; - sbit at 0xC8+6 EXF2; - sbit at 0xC8+7 TF2; -sfr at 0xCA RCAP2L; -sfr at 0xCB RCAP2H; -sfr at 0xCC TL2; -sfr at 0xCD TH2; -sfr at 0xD0 PSW; - /* PSW */ - sbit at 0xD0+0 P; - sbit at 0xD0+1 FL; - sbit at 0xD0+2 OV; - sbit at 0xD0+3 RS0; - sbit at 0xD0+4 RS1; - sbit at 0xD0+5 F0; - sbit at 0xD0+6 AC; - sbit at 0xD0+7 CY; -sfr at 0xD8 EICON; // Was WDCON in DS80C320 EICON; Bit Values differ from Reg320 - /* EICON */ - sbit at 0xD8+3 INT6; - sbit at 0xD8+4 RESI; - sbit at 0xD8+5 ERESI; - sbit at 0xD8+7 SMOD1; -sfr at 0xE0 ACC; -sfr at 0xE8 EIE; // EIE Bit Values differ from Reg320 - /* EIE */ - sbit at 0xE8+0 EIUSB; - sbit at 0xE8+1 EI2C; - sbit at 0xE8+2 EIEX4; - sbit at 0xE8+3 EIEX5; - sbit at 0xE8+4 EIEX6; -sfr at 0xF0 B; -sfr at 0xF8 EIP; // EIP Bit Values differ from Reg320 - /* EIP */ - sbit at 0xF8+0 PUSB; - sbit at 0xF8+1 PI2C; - sbit at 0xF8+2 EIPX4; - sbit at 0xF8+3 EIPX5; - sbit at 0xF8+4 EIPX6; - -/*----------------------------------------------------------------------------- - Bit Masks ------------------------------------------------------------------------------*/ - -#define bmBIT0 1 -#define bmBIT1 2 -#define bmBIT2 4 -#define bmBIT3 8 -#define bmBIT4 16 -#define bmBIT5 32 -#define bmBIT6 64 -#define bmBIT7 128 - -/* CPU Control & Status Register (CPUCS) */ -#define bmPRTCSTB bmBIT5 -#define bmCLKSPD (bmBIT4 | bmBIT3) -#define bmCLKSPD1 bmBIT4 -#define bmCLKSPD0 bmBIT3 -#define bmCLKINV bmBIT2 -#define bmCLKOE bmBIT1 -#define bm8051RES bmBIT0 -/* Port Alternate Configuration Registers */ -/* Port A (PORTACFG) */ -#define bmFLAGD bmBIT7 -#define bmINT1 bmBIT1 -#define bmINT0 bmBIT0 -/* Port C (PORTCCFG) */ -#define bmGPIFA7 bmBIT7 -#define bmGPIFA6 bmBIT6 -#define bmGPIFA5 bmBIT5 -#define bmGPIFA4 bmBIT4 -#define bmGPIFA3 bmBIT3 -#define bmGPIFA2 bmBIT2 -#define bmGPIFA1 bmBIT1 -#define bmGPIFA0 bmBIT0 -/* Port E (PORTECFG) */ -#define bmGPIFA8 bmBIT7 -#define bmT2EX bmBIT6 -#define bmINT6 bmBIT5 -#define bmRXD1OUT bmBIT4 -#define bmRXD0OUT bmBIT3 -#define bmT2OUT bmBIT2 -#define bmT1OUT bmBIT1 -#define bmT0OUT bmBIT0 - -/* I2C Control & Status Register (I2CS) */ -#define bmSTART bmBIT7 -#define bmSTOP bmBIT6 -#define bmLASTRD bmBIT5 -#define bmID (bmBIT4 | bmBIT3) -#define bmBERR bmBIT2 -#define bmACK bmBIT1 -#define bmDONE bmBIT0 -/* I2C Control Register (I2CTL) */ -#define bmSTOPIE bmBIT1 -#define bm400KHZ bmBIT0 -/* Interrupt 2 (USB) Autovector Register (INT2IVEC) */ -#define bmIV4 bmBIT6 -#define bmIV3 bmBIT5 -#define bmIV2 bmBIT4 -#define bmIV1 bmBIT3 -#define bmIV0 bmBIT2 -/* USB Interrupt Request & Enable Registers (USBIE/USBIRQ) */ -#define bmEP0ACK bmBIT6 -#define bmHSGRANT bmBIT5 -#define bmURES bmBIT4 -#define bmSUSP bmBIT3 -#define bmSUTOK bmBIT2 -#define bmSOF bmBIT1 -#define bmSUDAV bmBIT0 -/* Breakpoint register (BREAKPT) */ -#define bmBREAK bmBIT3 -#define bmBPPULSE bmBIT2 -#define bmBPEN bmBIT1 -/* Interrupt 2 & 4 Setup (INTSETUP) */ -#define bmAV2EN bmBIT3 -#define bmINT4IN bmBIT1 -#define bmAV4EN bmBIT0 -/* USB Control & Status Register (USBCS) */ -#define bmHSM bmBIT7 -#define bmDISCON bmBIT3 -#define bmNOSYNSOF bmBIT2 -#define bmRENUM bmBIT1 -#define bmSIGRESUME bmBIT0 -/* Wakeup Control and Status Register (WAKEUPCS) */ -#define bmWU2 bmBIT7 -#define bmWU bmBIT6 -#define bmWU2POL bmBIT5 -#define bmWUPOL bmBIT4 -#define bmDPEN bmBIT2 -#define bmWU2EN bmBIT1 -#define bmWUEN bmBIT0 -/* End Point 0 Control & Status Register (EP0CS) */ -#define bmHSNAK bmBIT7 -/* End Point 0-1 Control & Status Registers (EP0CS/EP1OUTCS/EP1INCS) */ -#define bmEPBUSY bmBIT1 -#define bmEPSTALL bmBIT0 -/* End Point 2-8 Control & Status Registers (EP2CS/EP4CS/EP6CS/EP8CS) */ -#define bmNPAK (bmBIT6 | bmBIT5 | bmBIT4) -#define bmEPFULL bmBIT3 -#define bmEPEMPTY bmBIT2 -/* Endpoint Status (EP2468STAT) SFR bits */ -#define bmEP8FULL bmBIT7 -#define bmEP8EMPTY bmBIT6 -#define bmEP6FULL bmBIT5 -#define bmEP6EMPTY bmBIT4 -#define bmEP4FULL bmBIT3 -#define bmEP4EMPTY bmBIT2 -#define bmEP2FULL bmBIT1 -#define bmEP2EMPTY bmBIT0 -/* SETUP Data Pointer Auto Mode (SUDPTRCTL) */ -#define bmSDPAUTO bmBIT0 -/* Endpoint Data Toggle Control (TOGCTL) */ -#define bmQUERYTOGGLE bmBIT7 -#define bmSETTOGGLE bmBIT6 -#define bmRESETTOGGLE bmBIT5 -#define bmTOGCTLEPMASK bmBIT3 | bmBIT2 | bmBIT1 | bmBIT0 -/* IBN (In Bulk Nak) enable and request bits (IBNIE/IBNIRQ) */ -#define bmEP8IBN bmBIT5 -#define bmEP6IBN bmBIT4 -#define bmEP4IBN bmBIT3 -#define bmEP2IBN bmBIT2 -#define bmEP1IBN bmBIT1 -#define bmEP0IBN bmBIT0 - -/* PING-NAK enable and request bits (NAKIE/NAKIRQ) */ -#define bmEP8PING bmBIT7 -#define bmEP6PING bmBIT6 -#define bmEP4PING bmBIT5 -#define bmEP2PING bmBIT4 -#define bmEP1PING bmBIT3 -#define bmEP0PING bmBIT2 -#define bmIBN bmBIT0 - -/* Interface Configuration bits (IFCONFIG) */ -#define bmIFCLKSRC bmBIT7 // set == INTERNAL -#define bm3048MHZ bmBIT6 // set == 48 MHz -#define bmIFCLKOE bmBIT5 -#define bmIFCLKPOL bmBIT4 -#define bmASYNC bmBIT3 -#define bmGSTATE bmBIT2 -#define bmIFCFG1 bmBIT1 -#define bmIFCFG0 bmBIT0 -#define bmIFCFGMASK (bmIFCFG0 | bmIFCFG1) -#define bmIFGPIF bmIFCFG1 - -/* EP 2468 FIFO Configuration bits (EP2FIFOCFG,EP4FIFOCFG,EP6FIFOCFG,EP8FIFOCFG) */ -#define bmINFM bmBIT6 -#define bmOEP bmBIT5 -#define bmAUTOOUT bmBIT4 -#define bmAUTOIN bmBIT3 -#define bmZEROLENIN bmBIT2 -// must be zero bmBIT1 -#define bmWORDWIDE bmBIT0 - -/* - * Chip Revision Control Bits (REVCTL) - used to ebable/disable revision specific features - */ -#define bmNOAUTOARM bmBIT1 // these don't match the docs -#define bmSKIPCOMMIT bmBIT0 // these don't match the docs - -#define bmDYN_OUT bmBIT1 // these do... -#define bmENH_PKT bmBIT0 - - -/* Fifo Reset bits (FIFORESET) */ -#define bmNAKALL bmBIT7 - -/* Endpoint Configuration (EPxCFG) */ -#define bmVALID bmBIT7 -#define bmIN bmBIT6 -#define bmTYPE1 bmBIT5 -#define bmTYPE0 bmBIT4 -#define bmISOCHRONOUS bmTYPE0 -#define bmBULK bmTYPE1 -#define bmINTERRUPT (bmTYPE1 | bmTYPE0) -#define bm1KBUF bmBIT3 -#define bmBUF1 bmBIT1 -#define bmBUF0 bmBIT0 -#define bmQUADBUF 0 -#define bmINVALIDBUF bmBUF0 -#define bmDOUBLEBUF bmBUF1 -#define bmTRIPLEBUF (bmBUF1 | bmBUF0) - -/* OUTPKTEND */ -#define bmSKIP bmBIT7 // low 4 bits specify which end point - -/* GPIFTRIG defs */ -#define bmGPIF_IDLE bmBIT7 // status bit - -#define bmGPIF_EP2_START 0 -#define bmGPIF_EP4_START 1 -#define bmGPIF_EP6_START 2 -#define bmGPIF_EP8_START 3 -#define bmGPIF_READ bmBIT2 -#define bmGPIF_WRITE 0 - -/* EXIF bits */ -#define bmEXIF_USBINT bmBIT4 -#define bmEXIF_I2CINT bmBIT5 -#define bmEXIF_IE4 bmBIT6 -#define bmEXIF_IE5 bmBIT7 - - -#endif /* FX2REGS_H */ diff --git a/usrp/firmware/include/fx2utils.h b/usrp/firmware/include/fx2utils.h deleted file mode 100644 index b184dec27..000000000 --- a/usrp/firmware/include/fx2utils.h +++ /dev/null @@ -1,31 +0,0 @@ -/* -*- c -*- */ -/* - * Copyright 2003 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ -#ifndef _FX2UTILS_H_ -#define _FX2UTILS_H_ - -void fx2_stall_ep0 (void); -void fx2_reset_data_toggle (unsigned char ep); -void fx2_renumerate (void); - - - -#endif /* _FX2UTILS_H_ */ diff --git a/usrp/firmware/include/generate_regs.py b/usrp/firmware/include/generate_regs.py deleted file mode 100755 index 656cd5e81..000000000 --- a/usrp/firmware/include/generate_regs.py +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/env python - -import os, os.path -import re -import sys - - -# set srcdir to the directory that contains Makefile.am -try: - srcdir = os.environ['srcdir'] -except KeyError, e: - srcdir = "." -srcdir = srcdir + '/' - -def open_src (name, mode): - global srcdir - return open (os.path.join (srcdir, name), mode) - - -def generate_fpga_regs (h_filename, v_filename): - const_width = 7 # bit width of constants - - h_file = open_src (h_filename, 'r') - v_file = open (v_filename, 'w') - v_file.write ( - '''// -// This file is machine generated from %s -// Do not edit by hand; your edits will be overwritten. -// -''' % (h_filename,)) - - pat = re.compile (r'^#define\s*(FR_\w*)\s*(\w*)(.*)$') - pat_bitno = re.compile (r'^#define\s*(bitno\w*)\s*(\w*)(.*)$') - pat_bm = re.compile (r'^#define\s*(bm\w*)\s*(\w*)(.*)$') - for line in h_file: - if re.match ('//|\s*$', line): # comment or blank line - v_file.write (line) - mo = pat.search (line) - mo_bitno =pat_bitno.search (line) - mo_bm =pat_bm.search (line) - if mo: - v_file.write ('`define %-25s %d\'d%s%s\n' % ( - mo.group (1), const_width, mo.group (2), mo.group (3))) - elif mo_bitno: - v_file.write ('`define %-25s %s%s\n' % ( - mo_bitno.group (1), mo_bitno.group (2), mo_bitno.group (3))) - elif mo_bm: - v_file.write ('`define %-25s %s%s\n' % ( - mo_bm.group (1), mo_bm.group (2), mo_bm.group (3))) - - -if __name__ == '__main__': - if len (sys.argv) != 3: - sys.stderr.write ('usage: %s file.h file.v\n' % (sys.argv[0])) - sys.exit (1) - generate_fpga_regs (sys.argv[1], sys.argv[2]) - diff --git a/usrp/firmware/include/i2c.h b/usrp/firmware/include/i2c.h deleted file mode 100644 index 273526dad..000000000 --- a/usrp/firmware/include/i2c.h +++ /dev/null @@ -1,32 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _I2C_H_ -#define _I2C_H_ - -// returns non-zero if successful, else 0 -unsigned char i2c_read (unsigned char addr, xdata unsigned char *buf, unsigned char len); - -// returns non-zero if successful, else 0 -unsigned char i2c_write (unsigned char addr, xdata const unsigned char *buf, unsigned char len); - -#endif /* _I2C_H_ */ diff --git a/usrp/firmware/include/isr.h b/usrp/firmware/include/isr.h deleted file mode 100644 index 856532890..000000000 --- a/usrp/firmware/include/isr.h +++ /dev/null @@ -1,172 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _ISR_H_ -#define _ISR_H_ - -/* - * ---------------------------------------------------------------- - * routines for managing interrupt services routines - * ---------------------------------------------------------------- - */ - -/* - * The FX2 has three discrete sets of interrupt vectors. - * The first set is the standard 8051 vector (13 8-byte entries). - * The second set is USB interrupt autovector (32 4-byte entries). - * The third set is the FIFO/GPIF autovector (14 4-byte entries). - * - * Since all the code we're running in the FX2 is ram based, we - * forego the typical "initialize the interrupt vectors at link time" - * strategy, in favor of calls at run time that install the correct - * pointers to functions. - */ - -/* - * Standard Vector numbers - */ - -#define SV_INT_0 0x03 -#define SV_TIMER_0 0x0b -#define SV_INT_1 0x13 -#define SV_TIMER_1 0x1b -#define SV_SERIAL_0 0x23 -#define SV_TIMER_2 0x2b -#define SV_RESUME 0x33 -#define SV_SERIAL_1 0x3b -#define SV_INT_2 0x43 // (INT_2) points at USB autovector -#define SV_I2C 0x4b -#define SV_INT_4 0x53 // (INT_4) points at FIFO/GPIF autovector -#define SV_INT_5 0x5b -#define SV_INT_6 0x63 - -#define SV_MIN SV_INT_0 -#define SV_MAX SV_INT_6 - -/* - * USB Auto Vector numbers - */ - -#define UV_SUDAV 0x00 -#define UV_SOF 0x04 -#define UV_SUTOK 0x08 -#define UV_SUSPEND 0x0c -#define UV_USBRESET 0x10 -#define UV_HIGHSPEED 0x14 -#define UV_EP0ACK 0x18 -#define UV_SPARE_1C 0x1c -#define UV_EP0IN 0x20 -#define UV_EP0OUT 0x24 -#define UV_EP1IN 0x28 -#define UV_EP1OUT 0x2c -#define UV_EP2 0x30 -#define UV_EP4 0x34 -#define UV_EP6 0x38 -#define UV_EP8 0x3c -#define UV_IBN 0x40 -#define UV_SPARE_44 0x44 -#define UV_EP0PINGNAK 0x48 -#define UV_EP1PINGNAK 0x4c -#define UV_EP2PINGNAK 0x50 -#define UV_EP4PINGNAK 0x54 -#define UV_EP6PINGNAK 0x58 -#define UV_EP8PINGNAK 0x5c -#define UV_ERRLIMIT 0x60 -#define UV_SPARE_64 0x64 -#define UV_SPARE_68 0x68 -#define UV_SPARE_6C 0x6c -#define UV_EP2ISOERR 0x70 -#define UV_EP4ISOERR 0x74 -#define UV_EP6ISOERR 0x78 -#define UV_EP8ISOERR 0x7c - -#define UV_MIN UV_SUDAV -#define UV_MAX UV_EP8ISOERR - -/* - * FIFO/GPIF Auto Vector numbers - */ - -#define FGV_EP2PF 0x00 -#define FGV_EP4PF 0x04 -#define FGV_EP6PF 0x08 -#define FGV_EP8PF 0x0c -#define FGV_EP2EF 0x10 -#define FGV_EP4EF 0x14 -#define FGV_EP6EF 0x18 -#define FGV_EP8EF 0x1c -#define FGV_EP2FF 0x20 -#define FGV_EP4FF 0x24 -#define FGV_EP6FF 0x28 -#define FGV_EP8FF 0x2c -#define FGV_GPIFDONE 0x30 -#define FGV_GPIFWF 0x34 - -#define FGV_MIN FGV_EP2PF -#define FGV_MAX FGV_GPIFWF - - -/* - * Hook standard interrupt vector. - * - * vector_number is from the SV_<foo> list above. - * addr is the address of the interrupt service routine. - */ -void hook_sv (unsigned char vector_number, unsigned short addr); - -/* - * Hook usb interrupt vector. - * - * vector_number is from the UV_<foo> list above. - * addr is the address of the interrupt service routine. - */ -void hook_uv (unsigned char vector_number, unsigned short addr); - -/* - * Hook fifo/gpif interrupt vector. - * - * vector_number is from the FGV_<foo> list above. - * addr is the address of the interrupt service routine. - */ -void hook_fgv (unsigned char vector_number, unsigned short addr); - -/* - * One time call to enable autovectoring for both USB and FIFO/GPIF - */ -void setup_autovectors (void); - - -/* - * Must be called in each usb interrupt handler - */ -#define clear_usb_irq() \ - EXIF &= ~bmEXIF_USBINT; \ - INT2CLR = 0 - -/* - * Must be calledin each fifo/gpif interrupt handler - */ -#define clear_fifo_gpif_irq() \ - EXIF &= ~bmEXIF_IE4; \ - INT4CLR = 0 - -#endif /* _ISR_H_ */ diff --git a/usrp/firmware/include/syncdelay.h b/usrp/firmware/include/syncdelay.h deleted file mode 100644 index 0af7d099f..000000000 --- a/usrp/firmware/include/syncdelay.h +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ -#ifndef _SYNCDELAY_H_ -#define _SYNCDELAY_H_ - -/* - * Magic delay required between access to certain xdata registers (TRM page 15-106). - * For our configuration, 48 MHz FX2 / 48 MHz IFCLK, we need three cycles. Each - * NOP is a single cycle.... - * - * From TRM page 15-105: - * - * Under certain conditions, some read and write access to the FX2 registers must - * be separated by a "synchronization delay". The delay is necessary only under the - * following conditions: - * - * - between a write to any register in the 0xE600 - 0xE6FF range and a write to one - * of the registers listed below. - * - * - between a write to one of the registers listed below and a read from any register - * in the 0xE600 - 0xE6FF range. - * - * Registers which require a synchronization delay: - * - * FIFORESET FIFOPINPOLAR - * INPKTEND EPxBCH:L - * EPxFIFOPFH:L EPxAUTOINLENH:L - * EPxFIFOCFG EPxGPIFFLGSEL - * PINFLAGSAB PINFLAGSCD - * EPxFIFOIE EPxFIFOIRQ - * GPIFIE GPIFIRQ - * UDMACRCH:L GPIFADRH:L - * GPIFTRIG EPxGPIFTRIG - * OUTPKTEND REVCTL - * GPIFTCB3 GPIFTCB2 - * GPIFTCB1 GPIFTCB0 - */ - -/* - * FIXME ensure that the peep hole optimizer isn't screwing us - */ -#define SYNCDELAY _asm nop; nop; nop; _endasm -#define NOP _asm nop; _endasm - - -#endif /* _SYNCDELAY_H_ */ diff --git a/usrp/firmware/include/timer.h b/usrp/firmware/include/timer.h deleted file mode 100644 index 3181874d5..000000000 --- a/usrp/firmware/include/timer.h +++ /dev/null @@ -1,35 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _TIMER_H_ -#define _TIMER_H_ - -/* - * Arrange to have isr_tick_handler called at 100 Hz - */ -void hook_timer_tick (unsigned short isr_tick_handler); - -#define clear_timer_irq() \ - TF2 = 0 /* clear overflow flag */ - - -#endif /* _TIMER_H_ */ diff --git a/usrp/firmware/include/usb_common.h b/usrp/firmware/include/usb_common.h deleted file mode 100644 index ae07b236c..000000000 --- a/usrp/firmware/include/usb_common.h +++ /dev/null @@ -1,37 +0,0 @@ -/* -*- c -*- */ -/* - * Copyright 2003 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _USB_COMMON_H_ -#define _USB_COMMON_H_ - -extern volatile bit _usb_got_SUDAV; - -// Provided by user application to handle VENDOR commands. -// returns non-zero if it handled the command. -unsigned char app_vendor_cmd (void); - -void usb_install_handlers (void); -void usb_handle_setup_packet (void); - -#define usb_setup_packet_avail() _usb_got_SUDAV - -#endif /* _USB_COMMON_H_ */ diff --git a/usrp/firmware/include/usb_descriptors.h b/usrp/firmware/include/usb_descriptors.h deleted file mode 100644 index 0b8c6212f..000000000 --- a/usrp/firmware/include/usb_descriptors.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -extern xdata const char high_speed_device_descr[]; -extern xdata const char high_speed_devqual_descr[]; -extern xdata const char high_speed_config_descr[]; - -extern xdata const char full_speed_device_descr[]; -extern xdata const char full_speed_devqual_descr[]; -extern xdata const char full_speed_config_descr[]; - -extern xdata unsigned char nstring_descriptors; -extern xdata char * xdata string_descriptors[]; - -/* - * We patch these locations with info read from the usrp config eeprom - */ -extern xdata char usb_desc_hw_rev_binary_patch_location_0[]; -extern xdata char usb_desc_hw_rev_binary_patch_location_1[]; -extern xdata char usb_desc_hw_rev_ascii_patch_location_0[]; -extern xdata char usb_desc_serial_number_ascii[]; diff --git a/usrp/firmware/include/usb_requests.h b/usrp/firmware/include/usb_requests.h deleted file mode 100644 index 7a543abb0..000000000 --- a/usrp/firmware/include/usb_requests.h +++ /dev/null @@ -1,88 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -// Standard USB requests. -// These are contained in end point 0 setup packets - - -#ifndef _USB_REQUESTS_H_ -#define _USB_REQUESTS_H_ - -// format of bmRequestType byte - -#define bmRT_DIR_MASK (0x1 << 7) -#define bmRT_DIR_IN (1 << 7) -#define bmRT_DIR_OUT (0 << 7) - -#define bmRT_TYPE_MASK (0x3 << 5) -#define bmRT_TYPE_STD (0 << 5) -#define bmRT_TYPE_CLASS (1 << 5) -#define bmRT_TYPE_VENDOR (2 << 5) -#define bmRT_TYPE_RESERVED (3 << 5) - -#define bmRT_RECIP_MASK (0x1f << 0) -#define bmRT_RECIP_DEVICE (0 << 0) -#define bmRT_RECIP_INTERFACE (1 << 0) -#define bmRT_RECIP_ENDPOINT (2 << 0) -#define bmRT_RECIP_OTHER (3 << 0) - - -// standard request codes (bRequest) - -#define RQ_GET_STATUS 0 -#define RQ_CLEAR_FEATURE 1 -#define RQ_RESERVED_2 2 -#define RQ_SET_FEATURE 3 -#define RQ_RESERVED_4 4 -#define RQ_SET_ADDRESS 5 -#define RQ_GET_DESCR 6 -#define RQ_SET_DESCR 7 -#define RQ_GET_CONFIG 8 -#define RQ_SET_CONFIG 9 -#define RQ_GET_INTERFACE 10 -#define RQ_SET_INTERFACE 11 -#define RQ_SYNCH_FRAME 12 - -// standard descriptor types - -#define DT_DEVICE 1 -#define DT_CONFIG 2 -#define DT_STRING 3 -#define DT_INTERFACE 4 -#define DT_ENDPOINT 5 -#define DT_DEVQUAL 6 -#define DT_OTHER_SPEED 7 -#define DT_INTERFACE_POWER 8 - -// standard feature selectors - -#define FS_ENDPOINT_HALT 0 // recip: endpoint -#define FS_DEV_REMOTE_WAKEUP 1 // recip: device -#define FS_TEST_MODE 2 // recip: device - -// Get Status device attributes - -#define bmGSDA_SELF_POWERED 0x01 -#define bmGSDA_REM_WAKEUP 0x02 - - -#endif /* _USB_REQUESTS_H_ */ diff --git a/usrp/firmware/include/usrp_commands.h b/usrp/firmware/include/usrp_commands.h deleted file mode 100644 index 20c28e264..000000000 --- a/usrp/firmware/include/usrp_commands.h +++ /dev/null @@ -1,99 +0,0 @@ -/* - * USRP - Universal Software Radio Peripheral - * - * Copyright (C) 2003,2004 Free Software Foundation, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Boston, MA 02110-1301 USA - */ - -#ifndef _USRP_COMMANDS_H_ -#define _USRP_COMMANDS_H_ - -#include <usrp_interfaces.h> -#include <usrp_spi_defs.h> - -#define MAX_EP0_PKTSIZE 64 // max size of EP0 packet on FX2 - -// ---------------------------------------------------------------- -// Vendor bmRequestType's -// ---------------------------------------------------------------- - -#define VRT_VENDOR_IN 0xC0 -#define VRT_VENDOR_OUT 0x40 - -// ---------------------------------------------------------------- -// USRP Vendor Requests -// -// Note that Cypress reserves [0xA0,0xAF]. -// 0xA0 is the firmware load function. -// ---------------------------------------------------------------- - - -// IN commands - -#define VRQ_GET_STATUS 0x80 -#define GS_TX_UNDERRUN 0 // wIndexL // returns 1 byte -#define GS_RX_OVERRUN 1 // wIndexL // returns 1 byte - -#define VRQ_I2C_READ 0x81 // wValueL: i2c address; length: how much to read - -#define VRQ_SPI_READ 0x82 // wValue: optional header bytes - // wIndexH: enables - // wIndexL: format - // len: how much to read - -// OUT commands - -#define VRQ_SET_LED 0x01 // wValueL off/on {0,1}; wIndexL: which {0,1} - -#define VRQ_FPGA_LOAD 0x02 -# define FL_BEGIN 0 // wIndexL: begin fpga programming cycle. stalls if trouble. -# define FL_XFER 1 // wIndexL: xfer up to 64 bytes of data -# define FL_END 2 // wIndexL: end programming cycle, check for success. - // stalls endpoint if trouble. - -#define VRQ_FPGA_WRITE_REG 0x03 // wIndexL: regno; data: 32-bit regval MSB first -#define VRQ_FPGA_SET_RESET 0x04 // wValueL: {0,1} -#define VRQ_FPGA_SET_TX_ENABLE 0x05 // wValueL: {0,1} -#define VRQ_FPGA_SET_RX_ENABLE 0x06 // wValueL: {0,1} -// see below VRQ_FPGA_SET_{TX,RX}_RESET - -#define VRQ_SET_SLEEP_BITS 0x07 // wValueH: mask; wValueL: bits. set bits given by mask to bits - -# define SLEEP_ADC0 0x01 -# define SLEEP_ADC1 0x02 -# define SLEEP_DAC0 0x04 -# define SLEEP_DAC1 0x08 - -#define VRQ_I2C_WRITE 0x08 // wValueL: i2c address; data: data - -#define VRQ_SPI_WRITE 0x09 // wValue: optional header bytes - // wIndexH: enables - // wIndexL: format - // len: how much to write - -#define VRQ_FPGA_SET_TX_RESET 0x0a // wValueL: {0, 1} -#define VRQ_FPGA_SET_RX_RESET 0x0b // wValueL: {0, 1} - - -// ------------------------------------------------------------------- -// we store the hashes at fixed addresses in the FX2 internal memory - -#define USRP_HASH_SLOT_0_ADDR 0xe1e0 -#define USRP_HASH_SLOT_1_ADDR 0xe1f0 - - - -#endif /* _USRP_COMMANDS_H_ */ diff --git a/usrp/firmware/include/usrp_config.h b/usrp/firmware/include/usrp_config.h deleted file mode 100644 index e77f8e4c5..000000000 --- a/usrp/firmware/include/usrp_config.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * USRP - Universal Software Radio Peripheral - * - * Copyright (C) 2003 Free Software Foundation, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Boston, MA 02110-1301 USA - */ - -/* - * configuration stuff for debugging - */ - -/* - * Define to 0 for normal use of port A, i.e., FPGA control bus. - * Define to 1 to write trace to port A for scoping with logic analyzer. - */ -#define UC_TRACE_USING_PORT_A 0 - - -/* - * Define to 0 for normal use of low 3 bits of port E, i.e., A/D, D/A SLEEP bits. - * Define to 1 to enable by default driving the GPIF state to the - * low three bits of port E. - */ -#define UC_START_WITH_GSTATE_OUTPUT_ENABLED 0 - - -/* - * Define to 1 for normal use (the board really has an FPGA on it). - * Define to 0 for debug use on board without FPGA. - */ -#define UC_BOARD_HAS_FPGA 1 diff --git a/usrp/firmware/include/usrp_i2c_addr.h b/usrp/firmware/include/usrp_i2c_addr.h deleted file mode 100644 index 0a4f3ea59..000000000 --- a/usrp/firmware/include/usrp_i2c_addr.h +++ /dev/null @@ -1,78 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ -#ifndef INCLUDED_USRP_I2C_ADDR_H -#define INCLUDED_USRP_I2C_ADDR_H - -// I2C addresses - -#define I2C_DEV_EEPROM 0x50 // 24LC02[45]: 7-bits 1010xxx - -#define I2C_ADDR_BOOT (I2C_DEV_EEPROM | 0x0) -#define I2C_ADDR_TX_A (I2C_DEV_EEPROM | 0x4) -#define I2C_ADDR_RX_A (I2C_DEV_EEPROM | 0x5) -#define I2C_ADDR_TX_B (I2C_DEV_EEPROM | 0x6) -#define I2C_ADDR_RX_B (I2C_DEV_EEPROM | 0x7) - - -// format of FX2 BOOT EEPROM -// 00: 0xC0 code for ``Read IDs from EEPROM'' -// 01: 0xFE USB Vendor ID (LSB) -// 02: 0xFF USB Vendor ID (MSB) -// 03: 0x02 USB Product ID (LSB) -// 04: 0x00 USB Product ID (MSB) -// 05: 0x01 USB Device ID (LSB) // rev1 -// 06: 0x00 USB Device ID (MSB) // 0 = unconfig'd (no firmware) -// 07: 0x00 option byte - - -// format of daughterboard EEPROM -// 00: 0xDB code for ``I'm a daughterboard'' -// 01: .. Daughterboard ID (LSB) -// 02: .. Daughterboard ID (MSB) -// 03: .. io bits 7-0 direction (bit set if it's an output from m'board) -// 04: .. io bits 15-8 direction (bit set if it's an output from m'board) -// 05: .. ADC0 DC offset correction (LSB) -// 06: .. ADC0 DC offset correction (MSB) -// 07: .. ADC1 DC offset correction (LSB) -// 08: .. ADC1 DC offset correction (MSB) -// ... -// 1f: .. negative of the sum of bytes [0x00, 0x1e] - -#define DB_EEPROM_MAGIC 0x00 -#define DB_EEPROM_MAGIC_VALUE 0xDB -#define DB_EEPROM_ID_LSB 0x01 -#define DB_EEPROM_ID_MSB 0x02 -#define DB_EEPROM_OE_LSB 0x03 -#define DB_EEPROM_OE_MSB 0x04 -#define DB_EEPROM_OFFSET_0_LSB 0x05 // offset correction for ADC or DAC 0 -#define DB_EEPROM_OFFSET_0_MSB 0x06 -#define DB_EEPROM_OFFSET_1_LSB 0x07 // offset correction for ADC or DAC 1 -#define DB_EEPROM_OFFSET_1_MSB 0x08 -#define DB_EEPROM_CHKSUM 0x1f - -#define DB_EEPROM_CLEN 0x20 // length of common portion of eeprom - -#define DB_EEPROM_CUSTOM_BASE DB_EEPROM_CLEN // first avail offset for - // daughterboard specific use - -#endif /* INCLUDED_USRP_I2C_ADDR_H */ - diff --git a/usrp/firmware/include/usrp_ids.h b/usrp/firmware/include/usrp_ids.h deleted file mode 100644 index 159151ea9..000000000 --- a/usrp/firmware/include/usrp_ids.h +++ /dev/null @@ -1,78 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003,2006,2007 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -/* - * USB Vendor and Product IDs that we use - * - * (keep in sync with usb_descriptors.a51) - */ - -#ifndef _USRP_IDS_H_ -#define _USRP_IDS_H_ - -#define USB_VID_CYPRESS 0x04b4 -#define USB_PID_CYPRESS_FX2 0x8613 - - -#define USB_VID_FSF 0xfffe // Free Software Folks -#define USB_PID_FSF_EXP_0 0x0000 // Experimental 0 -#define USB_PID_FSF_EXP_1 0x0001 // Experimental 1 -#define USB_PID_FSF_USRP 0x0002 // Universal Software Radio Peripheral -#define USB_PID_FSF_USRP_reserved 0x0003 // Universal Software Radio Peripheral -#define USB_PID_FSF_SSRP 0x0004 // Simple Software Radio Peripheral -#define USB_PID_FSF_SSRP_reserved 0x0005 // Simple Software Radio Peripheral -#define USB_PID_FSF_HPSDR 0x0006 // High Performance Software Defined Radio (Internal Boot) -#define USB_PID_FSF_HPSDR_HA 0x0007 // High Performance Software Defined Radio (Host Assisted Boot) -#define USB_PID_FSF_QS1R 0x0008 // QS1R HF receiver -#define USB_PID_FSF_EZDOP 0x0009 // ezdop <jcorgan@aeinet.com> -#define USB_PID_FSF_BDALE_Development 0x000a // Bdale Garbee <bdale@gag.com> -#define USB_PID_FSF_BDALE_TeleMetrum 0x000b // Bdale Garbee <bdale@gag.com> -#define USB_PID_FSF_BDALE_TeleDongle 0x000c // Bdale Garbee <bdale@gag.com> -#define USB_PID_FSF_BDALE_TeleTerra 0x000d // Bdale Garbee <bdale@gag.com> -#define USB_PID_FSF_BDALE_TeleBT 0x000e // Bdale Garbee <bdale@gag.com> -#define USB_PID_FSF_BDALE_TeleLaunch 0x000f // Bdale Garbee <bdale@gag.com> -#define USB_PID_FSF_BDALE_TeleLCO 0x0010 // Bdale Garbee <bdale@gag.com> -#define USB_PID_FSF_BDALE_TeleScience 0x0011 // Bdale Garbee <bdale@gag.com> -#define USB_PID_FSF_BDALE_TelePyro 0x0012 // Bdale Garbee <bdale@gag.com> -#define USB_PID_FSF_BDALE_9 0x0013 // Bdale Garbee <bdale@gag.com> -#define USB_PID_FSF_HPSDR_HERMES 0x0014 // HPSDR Hermes -#define USB_PID_FSF_THINKRF 0x0015 // Catalin Patulea <catalin.patulea@thinkrf.com> -#define USB_PID_FSF_MSA 0x0016 // Hans de Bok <hdbok@dionaea.demon.nl> Scotty's Modular Spectrum Analyzer - -#define USB_PID_FSF_LBNL_UXO 0x0018 // http://recycle.lbl.gov/~ldoolitt/uxo/ -#define USB_PID_FSF_BDALE_10 0x0019 // Bdale Garbee <bdale@gag.com> -#define USB_PID_FSF_BDALE_11 0x001a // Bdale Garbee <bdale@gag.com> -#define USB_PID_FSF_BDALE_12 0x001b // Bdale Garbee <bdale@gag.com> -#define USB_PID_FSF_BDALE_13 0x001c // Bdale Garbee <bdale@gag.com> -#define USB_PID_FSF_BDALE_14 0x001d // Bdale Garbee <bdale@gag.com> -#define USB_PID_FSF_BDALE_15 0x001e // Bdale Garbee <bdale@gag.com> -#define USB_PID_FSF_BDALE_16 0x001f // Bdale Garbee <bdale@gag.com> -#define USB_PID_FSF_BDALE_17 0x0020 // Bdale Garbee <bdale@gag.com> -#define USB_PID_FSF_BDALE_18 0x0021 // Bdale Garbee <bdale@gag.com> -#define USB_PID_FSF_BDALE_19 0x0022 // Bdale Garbee <bdale@gag.com> - - -#define USB_DID_USRP_0 0x0000 // unconfigured rev 0 USRP -#define USB_DID_USRP_1 0x0001 // unconfigured rev 1 USRP -#define USB_DID_USRP_2 0x0002 // unconfigured rev 2 USRP - -#endif /* _USRP_IDS_H_ */ diff --git a/usrp/firmware/include/usrp_interfaces.h b/usrp/firmware/include/usrp_interfaces.h deleted file mode 100644 index 8666e0490..000000000 --- a/usrp/firmware/include/usrp_interfaces.h +++ /dev/null @@ -1,47 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _USRP_INTERFACES_H_ -#define _USRP_INTERFACES_H_ - -/* - * We've now split the USRP into 3 separate interfaces. - * - * Interface 0 contains only ep0 and is used for command and status. - * Interface 1 is the Tx path and it uses ep2 OUT BULK. - * Interface 2 is the Rx path and it uses ep6 IN BULK. - */ - -#define USRP_CMD_INTERFACE 0 -#define USRP_CMD_ALTINTERFACE 0 -#define USRP_CMD_ENDPOINT 0 - -#define USRP_TX_INTERFACE 1 -#define USRP_TX_ALTINTERFACE 0 -#define USRP_TX_ENDPOINT 2 // streaming data from host to FPGA - -#define USRP_RX_INTERFACE 2 -#define USRP_RX_ALTINTERFACE 0 -#define USRP_RX_ENDPOINT 6 // streaming data from FPGA to host - - -#endif /* _USRP_INTERFACES_H_ */ diff --git a/usrp/firmware/include/usrp_spi_defs.h b/usrp/firmware/include/usrp_spi_defs.h deleted file mode 100644 index 963463ef2..000000000 --- a/usrp/firmware/include/usrp_spi_defs.h +++ /dev/null @@ -1,86 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_USRP_SPI_DEFS_H -#define INCLUDED_USRP_SPI_DEFS_H - -/* - * defines for the VRQ_SPI_READ and VRQ_SPI_WRITE commands - * - * SPI == "Serial Port Interface". SPI is a 3 wire bus plus a - * separate enable for each peripheral. The common lines are SCLK, - * SDI and SDO. The FX2 always drives SCLK and SDI, the clock and - * data lines from the FX2 to the peripheral. When enabled, a - * peripheral may drive SDO, the data line from the peripheral to the - * FX2. - * - * The SPI_READ and SPI_WRITE commands are formatted identically. - * Each specifies which peripherals to enable, whether the bits should - * be transmistted Most Significant Bit first or Least Significant Bit - * first, the number of bytes in the optional header, and the number - * of bytes to read or write in the body. - * - * The body is limited to 64 bytes. The optional header may contain - * 0, 1 or 2 bytes. For an SPI_WRITE, the header bytes are - * transmitted to the peripheral followed by the the body bytes. For - * an SPI_READ, the header bytes are transmitted to the peripheral, - * then len bytes are read back from the peripheral. - */ - -/* - * SPI_FMT_* goes in wIndexL - */ -#define SPI_FMT_xSB_MASK (1 << 7) -# define SPI_FMT_LSB (1 << 7) // least signficant bit first -# define SPI_FMT_MSB (0 << 7) // most significant bit first -#define SPI_FMT_HDR_MASK (3 << 5) -# define SPI_FMT_HDR_0 (0 << 5) // 0 header bytes -# define SPI_FMT_HDR_1 (1 << 5) // 1 header byte -# define SPI_FMT_HDR_2 (2 << 5) // 2 header bytes - -/* - * SPI_ENABLE_* goes in wIndexH - * - * For the software interface, the enables are active high. - * For reads, it's an error to have more than one enable set. - * - * [FWIW, the hardware implements them as active low. Don't change the - * definitions of these. They are related to usrp_rev1_regs.h] - */ -#define SPI_ENABLE_FPGA 0x01 // select FPGA -#define SPI_ENABLE_CODEC_A 0x02 // select AD9862 A -#define SPI_ENABLE_CODEC_B 0x04 // select AD9862 B -#define SPI_ENABLE_reserved 0x08 -#define SPI_ENABLE_TX_A 0x10 // select d'board TX A -#define SPI_ENABLE_RX_A 0x20 // select d'board RX A -#define SPI_ENABLE_TX_B 0x40 // select d'board TX B -#define SPI_ENABLE_RX_B 0x80 // select d'board RX B - -/* - * If there's one header byte, it goes in wValueL. - * - * If there are two header bytes, they go in wValueH | wValueL. - * The transmit order of the bytes (and bits within them) is - * determined by SPI_FMT_*SB - */ - -#endif /* INCLUDED_USRP_SPI_DEFS_H */ diff --git a/usrp/firmware/lib/.gitignore b/usrp/firmware/lib/.gitignore deleted file mode 100644 index 04f253234..000000000 --- a/usrp/firmware/lib/.gitignore +++ /dev/null @@ -1,18 +0,0 @@ -/*.ihx -/*.lnk -/*.lst -/*.map -/*.mem -/*.rel -/*.rst -/*.sym -/blink_leds.asm -/usrp_common.asm -/command_loop.asm -/fpga.asm -/*.asm -/usrp_gpif.c -/usrp_gpif_inline.h -/*.lib -/Makefile -/Makefile.in diff --git a/usrp/firmware/lib/Makefile.am b/usrp/firmware/lib/Makefile.am deleted file mode 100644 index a6790f010..000000000 --- a/usrp/firmware/lib/Makefile.am +++ /dev/null @@ -1,79 +0,0 @@ -# -# Copyright 2003 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -EXTRA_DIST = \ - delay.c \ - fx2utils.c \ - i2c.c \ - isr.c \ - timer.c \ - usb_common.c - - - -DEFINES= -FW_INCLUDES=-I$(top_srcdir)/usrp/firmware/include - -# with EA = 0, the FX2 implements a portion of the 8051 "external memory" -# on chip. This memory is mapped like this: -# -# The bottom 8K of memory (0x0000 - 0x1fff) is used for both data and -# code accesses. There's also 512 bytes for data only from 0xe000 - 0xe1ff. -# -# We tell the linker to start the xdata segment at 0x1800, 6K up from -# the bottom. - -LINKOPTS = --code-loc 0x0000 --code-size 0x1800 --xram-loc 0x1800 --xram-size 0x0800 - -LIBRARY = libfx2.lib - -LIBOBJS = \ - delay.rel \ - fx2utils.rel \ - i2c.rel \ - isr.rel \ - timer.rel \ - usb_common.rel - - - -all: libfx2.lib - -.c.rel: - $(XCC) $(FW_INCLUDES) $(DEFINES) -c $< -o $@ - -$(LIBRARY): $(LIBOBJS) - -rm -f $(LIBRARY) - touch $(LIBRARY) - for obj in $(LIBOBJS); do basename $$obj .rel >> $(LIBRARY) ; done - - -CLEANFILES = \ - *.ihx *.lnk *.lst *.map *.mem *.rel *.rst *.sym *.asm *.lib - -DISTCLEANFILES = \ - *.ihx *.lnk *.lst *.map *.mem *.rel *.rst *.sym *.asm *.lib - -install: all - - -# dependencies - diff --git a/usrp/firmware/lib/delay.c b/usrp/firmware/lib/delay.c deleted file mode 100644 index 13cf0eec8..000000000 --- a/usrp/firmware/lib/delay.c +++ /dev/null @@ -1,76 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -/* - * Delay approximately 1 microsecond (including overhead in udelay). - */ -static void -udelay1 (void) _naked -{ - _asm ; lcall that got us here took 4 bus cycles - ret ; 4 bus cycles - _endasm; -} - -/* - * delay for approximately usecs microseconds - */ -void -udelay (unsigned char usecs) -{ - do { - udelay1 (); - } while (--usecs != 0); -} - - -/* - * Delay approximately 1 millisecond. - * We're running at 48 MHz, so we need 48,000 clock cycles. - * - * Note however, that each bus cycle takes 4 clock cycles (not obvious, - * but explains the factor of 4 problem below). - */ -static void -mdelay1 (void) _naked -{ - _asm - mov dptr,#(-1200 & 0xffff) -002$: - inc dptr ; 3 bus cycles - mov a, dpl ; 2 bus cycles - orl a, dph ; 2 bus cycles - jnz 002$ ; 3 bus cycles - - ret - _endasm; -} - -void -mdelay (unsigned int msecs) -{ - do { - mdelay1 (); - } while (--msecs != 0); -} - - diff --git a/usrp/firmware/lib/fx2utils.c b/usrp/firmware/lib/fx2utils.c deleted file mode 100644 index 64ffcc896..000000000 --- a/usrp/firmware/lib/fx2utils.c +++ /dev/null @@ -1,54 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include "fx2utils.h" -#include "fx2regs.h" -#include "delay.h" - -void -fx2_stall_ep0 (void) -{ - EP0CS |= bmEPSTALL; -} - -void -fx2_reset_data_toggle (unsigned char ep) -{ - TOGCTL = ((ep & 0x80) >> 3 | (ep & 0x0f)); - TOGCTL |= bmRESETTOGGLE; -} - -void -fx2_renumerate (void) -{ - USBCS |= bmDISCON | bmRENUM; - - // mdelay (1500); // FIXME why 1.5 seconds? - mdelay (250); // FIXME why 1.5 seconds? - - USBIRQ = 0xff; // clear any pending USB irqs... - EPIRQ = 0xff; // they're from before the renumeration - - EXIF &= ~bmEXIF_USBINT; - - USBCS &= ~bmDISCON; // reconnect USB -} diff --git a/usrp/firmware/lib/i2c-compiler-bug.c b/usrp/firmware/lib/i2c-compiler-bug.c deleted file mode 100644 index 360b779bc..000000000 --- a/usrp/firmware/lib/i2c-compiler-bug.c +++ /dev/null @@ -1,129 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include "i2c.h" -#include "fx2regs.h" -#include <string.h> - - -// issue a stop bus cycle and wait for completion - - -// returns non-zero if successful, else 0 -unsigned char -i2c_read (unsigned char addr, xdata unsigned char *buf, unsigned char len) -{ - volatile unsigned char junk; - - if (len == 0) // reading zero bytes always works - return 1; - - // memset (buf, 0, len); // FIXME, remove - - while (I2CS & bmSTOP) // wait for stop to clear - ; - - - I2CS = bmSTART; - I2DAT = (addr << 1) | 1; // write address and direction (1's the read bit) - - while ((I2CS & bmDONE) == 0) - ; - - if ((I2CS & bmBERR) || (I2CS & bmACK) == 0) // no device answered... - goto fail; - - if (len == 1) - I2CS |= bmLASTRD; - - junk = I2DAT; // trigger the first read cycle - -#if 1 - while (len != 1){ - while ((I2CS & bmDONE) == 0) - ; - - if (I2CS & bmBERR) - goto fail; - - len--; - if (len == 1) - I2CS |= bmLASTRD; - - *buf++ = I2DAT; // get data, trigger another read - } -#endif - - // wait for final byte - - while ((I2CS & bmDONE) == 0) - ; - - if (I2CS & bmBERR) - goto fail; - - I2CS |= bmSTOP; - *buf = I2DAT; - - return 1; - - fail: - I2CS |= bmSTOP; - return 0; -} - - - -// returns non-zero if successful, else 0 -unsigned char -i2c_write (unsigned char addr, xdata const unsigned char *buf, unsigned char len) -{ - while (I2CS & bmSTOP) // wait for stop to clear - ; - - I2CS = bmSTART; - I2DAT = (addr << 1) | 0; // write address and direction (0's the write bit) - - while ((I2CS & bmDONE) == 0) - ; - - if ((I2CS & bmBERR) || (I2CS & bmACK) == 0) // no device answered... - goto fail; - - while (len > 0){ - I2DAT = *buf++; - len--; - - while ((I2CS & bmDONE) == 0) - ; - - if ((I2CS & bmBERR) || (I2CS & bmACK) == 0) // no device answered... - goto fail; - } - - I2CS |= bmSTOP; - return 1; - - fail: - I2CS |= bmSTOP; - return 0; -} diff --git a/usrp/firmware/lib/i2c.c b/usrp/firmware/lib/i2c.c deleted file mode 100644 index 0f238b5cf..000000000 --- a/usrp/firmware/lib/i2c.c +++ /dev/null @@ -1,123 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include "i2c.h" -#include "fx2regs.h" -#include <string.h> - - -// issue a stop bus cycle and wait for completion - - -// returns non-zero if successful, else 0 -unsigned char -i2c_read (unsigned char addr, xdata unsigned char *buf, unsigned char len) -{ - volatile unsigned char junk; - - if (len == 0) // reading zero bytes always works - return 1; - - while (I2CS & bmSTOP) // wait for stop to clear - ; - - I2CS = bmSTART; - I2DAT = (addr << 1) | 1; // write address and direction (1's the read bit) - - while ((I2CS & bmDONE) == 0) - ; - - if ((I2CS & bmBERR) || (I2CS & bmACK) == 0) // no device answered... - goto fail; - - if (len == 1) - I2CS |= bmLASTRD; - - junk = I2DAT; // trigger the first read cycle - - while (--len != 0){ - while ((I2CS & bmDONE) == 0) - ; - - if (I2CS & bmBERR) - goto fail; - - if (len == 1) - I2CS |= bmLASTRD; - - *buf++ = I2DAT; // get data, trigger another read - } - - // wait for final byte - - while ((I2CS & bmDONE) == 0) - ; - - if (I2CS & bmBERR) - goto fail; - - I2CS |= bmSTOP; - *buf = I2DAT; - - return 1; - - fail: - I2CS |= bmSTOP; - return 0; -} - - - -// returns non-zero if successful, else 0 -unsigned char -i2c_write (unsigned char addr, xdata const unsigned char *buf, unsigned char len) -{ - while (I2CS & bmSTOP) // wait for stop to clear - ; - - I2CS = bmSTART; - I2DAT = (addr << 1) | 0; // write address and direction (0's the write bit) - - while ((I2CS & bmDONE) == 0) - ; - - if ((I2CS & bmBERR) || (I2CS & bmACK) == 0) // no device answered... - goto fail; - - while (len > 0){ - I2DAT = *buf++; - len--; - - while ((I2CS & bmDONE) == 0) - ; - - if ((I2CS & bmBERR) || (I2CS & bmACK) == 0) // no device answered... - goto fail; - } - - I2CS |= bmSTOP; - return 1; - - fail: - I2CS |= bmSTOP; - return 0; -} diff --git a/usrp/firmware/lib/isr.c b/usrp/firmware/lib/isr.c deleted file mode 100644 index 05412daf5..000000000 --- a/usrp/firmware/lib/isr.c +++ /dev/null @@ -1,167 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include "isr.h" -#include "fx2regs.h" -#include "syncdelay.h" - -extern xdata unsigned char _standard_interrupt_vector[]; -extern xdata unsigned char _usb_autovector[]; -extern xdata unsigned char _fifo_gpif_autovector[]; - -#define LJMP_OPCODE 0x02 - -/* - * Hook standard interrupt vector. - * - * vector_number is from the SV_<foo> list. - * addr is the address of the interrupt service routine. - */ -void -hook_sv (unsigned char vector_number, unsigned short addr) -{ - bit t; - - // sanity checks - - if (vector_number < SV_MIN || vector_number > SV_MAX) - return; - - if ((vector_number & 0x0f) != 0x03 && (vector_number & 0x0f) != 0x0b) - return; - - t = EA; - EA = 0; - _standard_interrupt_vector[vector_number] = LJMP_OPCODE; - _standard_interrupt_vector[vector_number + 1] = addr >> 8; - _standard_interrupt_vector[vector_number + 2] = addr & 0xff; - EA = t; -} - -/* - * Hook usb interrupt vector. - * - * vector_number is from the UV_<foo> list. - * addr is the address of the interrupt service routine. - */ -void -hook_uv (unsigned char vector_number, unsigned short addr) -{ - bit t; - - // sanity checks - - if (vector_number < UV_MIN || vector_number > UV_MAX) - return; - - if ((vector_number & 0x3) != 0) - return; - - t = EA; - EA = 0; - _usb_autovector[vector_number] = LJMP_OPCODE; - _usb_autovector[vector_number + 1] = addr >> 8; - _usb_autovector[vector_number + 2] = addr & 0xff; - EA = t; -} - -/* - * Hook fifo/gpif interrupt vector. - * - * vector_number is from the FGV_<foo> list. - * addr is the address of the interrupt service routine. - */ -void -hook_fgv (unsigned char vector_number, unsigned short addr) -{ - bit t; - - // sanity checks - - if (vector_number < FGV_MIN || vector_number > FGV_MAX) - return; - - if ((vector_number & 0x3) != 0) - return; - - t = EA; - EA = 0; - _fifo_gpif_autovector[vector_number] = LJMP_OPCODE; - _fifo_gpif_autovector[vector_number + 1] = addr >> 8; - _fifo_gpif_autovector[vector_number + 2] = addr & 0xff; - EA = t; -} - -/* - * One time call to enable autovectoring for both USB and FIFO/GPIF. - * - * This disables all USB and FIFO/GPIF interrupts and clears - * any pending interrupts too. It leaves the master USB and FIFO/GPIF - * interrupts enabled. - */ -void -setup_autovectors (void) -{ - // disable master usb and fifo/gpif interrupt enables - EIUSB = 0; - EIEX4 = 0; - - hook_sv (SV_INT_2, (unsigned short) _usb_autovector); - hook_sv (SV_INT_4, (unsigned short) _fifo_gpif_autovector); - - // disable all fifo interrupt enables - SYNCDELAY; - EP2FIFOIE = 0; SYNCDELAY; - EP4FIFOIE = 0; SYNCDELAY; - EP6FIFOIE = 0; SYNCDELAY; - EP8FIFOIE = 0; SYNCDELAY; - - // clear all pending fifo irqs - EP2FIFOIRQ = 0xff; SYNCDELAY; - EP4FIFOIRQ = 0xff; SYNCDELAY; - EP6FIFOIRQ = 0xff; SYNCDELAY; - EP8FIFOIRQ = 0xff; SYNCDELAY; - - IBNIE = 0; - IBNIRQ = 0xff; - NAKIE = 0; - NAKIRQ = 0xff; - USBIE = 0; - USBIRQ = 0xff; - EPIE = 0; - EPIRQ = 0xff; - SYNCDELAY; GPIFIE = 0; - SYNCDELAY; GPIFIRQ = 0xff; - USBERRIE = 0; - USBERRIRQ = 0xff; - CLRERRCNT = 0; - - INTSETUP = bmAV2EN | bmAV4EN | bmINT4IN; - - // clear master irq's for usb and fifo/gpif - EXIF &= ~bmEXIF_USBINT; - EXIF &= ~bmEXIF_IE4; - - // enable master usb and fifo/gpif interrrupts - EIUSB = 1; - EIEX4 = 1; -} diff --git a/usrp/firmware/lib/timer.c b/usrp/firmware/lib/timer.c deleted file mode 100644 index 97e2f7cf9..000000000 --- a/usrp/firmware/lib/timer.c +++ /dev/null @@ -1,49 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include "timer.h" -#include "fx2regs.h" -#include "isr.h" - -/* - * Arrange to have isr_tick_handler called at 100 Hz. - * - * The cpu clock is running at 48e6. The input to the timer - * is 48e6 / 12 = 4e6. - * - * We arrange to have the timer overflow every 40000 clocks == 100 Hz - */ - -#define RELOAD_VALUE ((unsigned short) -40000) - -void -hook_timer_tick (unsigned short isr_tick_handler) -{ - ET2 = 0; // disable timer 2 interrupts - hook_sv (SV_TIMER_2, isr_tick_handler); - - RCAP2H = RELOAD_VALUE >> 8; // setup the auto reload value - RCAP2L = RELOAD_VALUE; - - T2CON = 0x04; // interrupt on overflow; reload; run - ET2 = 1; // enable timer 2 interrupts -} diff --git a/usrp/firmware/lib/usb_common.c b/usrp/firmware/lib/usb_common.c deleted file mode 100644 index 3b0547b2f..000000000 --- a/usrp/firmware/lib/usb_common.c +++ /dev/null @@ -1,386 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include "usb_common.h" -#include "fx2regs.h" -#include "syncdelay.h" -#include "fx2utils.h" -#include "isr.h" -#include "usb_descriptors.h" -#include "usb_requests.h" - -extern xdata char str0[]; -extern xdata char str1[]; -extern xdata char str2[]; -extern xdata char str3[]; -extern xdata char str4[]; -extern xdata char str5[]; - - -#define bRequestType SETUPDAT[0] -#define bRequest SETUPDAT[1] -#define wValueL SETUPDAT[2] -#define wValueH SETUPDAT[3] -#define wIndexL SETUPDAT[4] -#define wIndexH SETUPDAT[5] -#define wLengthL SETUPDAT[6] -#define wLengthH SETUPDAT[7] - -#define MSB(x) (((unsigned short) x) >> 8) -#define LSB(x) (((unsigned short) x) & 0xff) - -volatile bit _usb_got_SUDAV; - -unsigned char _usb_config = 0; -unsigned char _usb_alt_setting = 0; // FIXME really 1/interface - -xdata unsigned char *current_device_descr; -xdata unsigned char *current_devqual_descr; -xdata unsigned char *current_config_descr; -xdata unsigned char *other_config_descr; - -static void -setup_descriptors (void) -{ - if (USBCS & bmHSM){ // high speed mode - current_device_descr = high_speed_device_descr; - current_devqual_descr = high_speed_devqual_descr; - current_config_descr = high_speed_config_descr; - other_config_descr = full_speed_config_descr; - } - else { - current_device_descr = full_speed_device_descr; - current_devqual_descr = full_speed_devqual_descr; - current_config_descr = full_speed_config_descr; - other_config_descr = high_speed_config_descr; - } - - // whack the type fields - // FIXME, may not be required. - // current_config_descr[1] = DT_CONFIG; - // other_config_descr[1] = DT_OTHER_SPEED; -} - -static void -isr_SUDAV (void) interrupt -{ - clear_usb_irq (); - _usb_got_SUDAV = 1; -} - -static void -isr_USBRESET (void) interrupt -{ - clear_usb_irq (); - setup_descriptors (); -} - -static void -isr_HIGHSPEED (void) interrupt -{ - clear_usb_irq (); - setup_descriptors (); -} - -void -usb_install_handlers (void) -{ - setup_descriptors (); // ensure that they're set before use - - hook_uv (UV_SUDAV, (unsigned short) isr_SUDAV); - hook_uv (UV_USBRESET, (unsigned short) isr_USBRESET); - hook_uv (UV_HIGHSPEED, (unsigned short) isr_HIGHSPEED); - - USBIE = bmSUDAV | bmURES | bmHSGRANT; -} - -// On the FX2 the only plausible endpoints are 0, 1, 2, 4, 6, 8 -// This doesn't check to see that they're enabled - -unsigned char -plausible_endpoint (unsigned char ep) -{ - ep &= ~0x80; // ignore direction bit - - if (ep > 8) - return 0; - - if (ep == 1) - return 1; - - return (ep & 0x1) == 0; // must be even -} - -// return pointer to control and status register for endpoint. -// only called with plausible_endpoints - -xdata volatile unsigned char * -epcs (unsigned char ep) -{ - if (ep == 0x01) // ep1 has different in and out CS regs - return EP1OUTCS; - - if (ep == 0x81) - return EP1INCS; - - ep &= ~0x80; // ignore direction bit - - if (ep == 0x00) // ep0 - return EP0CS; - - return EP2CS + (ep >> 1); // 2, 4, 6, 8 are consecutive -} - -void -usb_handle_setup_packet (void) -{ - _usb_got_SUDAV = 0; - - // handle the standard requests... - - switch (bRequestType & bmRT_TYPE_MASK){ - - case bmRT_TYPE_CLASS: - case bmRT_TYPE_RESERVED: - fx2_stall_ep0 (); // we don't handle these. indicate error - break; - - case bmRT_TYPE_VENDOR: - // call the application code. - // If it handles the command it returns non-zero - - if (!app_vendor_cmd ()) - fx2_stall_ep0 (); - break; - - case bmRT_TYPE_STD: - // these are the standard requests... - - if ((bRequestType & bmRT_DIR_MASK) == bmRT_DIR_IN){ - - //////////////////////////////////// - // handle the IN requests - //////////////////////////////////// - - switch (bRequest){ - - case RQ_GET_CONFIG: - EP0BUF[0] = _usb_config; // FIXME app should handle - EP0BCH = 0; - EP0BCL = 1; - break; - - // -------------------------------- - - case RQ_GET_INTERFACE: - EP0BUF[0] = _usb_alt_setting; // FIXME app should handle - EP0BCH = 0; - EP0BCL = 1; - break; - - // -------------------------------- - - case RQ_GET_DESCR: - switch (wValueH){ - - case DT_DEVICE: - SUDPTRH = MSB (current_device_descr); - SUDPTRL = LSB (current_device_descr); - break; - - case DT_DEVQUAL: - SUDPTRH = MSB (current_devqual_descr); - SUDPTRL = LSB (current_devqual_descr); - break; - - case DT_CONFIG: - if (0 && wValueL != 1) // FIXME only a single configuration - fx2_stall_ep0 (); - else { - SUDPTRH = MSB (current_config_descr); - SUDPTRL = LSB (current_config_descr); - } - break; - - case DT_OTHER_SPEED: - if (0 && wValueL != 1) // FIXME only a single configuration - fx2_stall_ep0 (); - else { - SUDPTRH = MSB (other_config_descr); - SUDPTRL = LSB (other_config_descr); - } - break; - - case DT_STRING: - if (wValueL >= nstring_descriptors) - fx2_stall_ep0 (); - else { - xdata char *p = string_descriptors[wValueL]; - SUDPTRH = MSB (p); - SUDPTRL = LSB (p); - } - break; - - default: - fx2_stall_ep0 (); // invalid request - break; - } - break; - - // -------------------------------- - - case RQ_GET_STATUS: - switch (bRequestType & bmRT_RECIP_MASK){ - case bmRT_RECIP_DEVICE: - EP0BUF[0] = bmGSDA_SELF_POWERED; // FIXME app should handle - EP0BUF[1] = 0; - EP0BCH = 0; - EP0BCL = 2; - break; - - case bmRT_RECIP_INTERFACE: - EP0BUF[0] = 0; - EP0BUF[1] = 0; - EP0BCH = 0; - EP0BCL = 2; - break; - - case bmRT_RECIP_ENDPOINT: - if (plausible_endpoint (wIndexL)){ - EP0BUF[0] = *epcs (wIndexL) & bmEPSTALL; - EP0BUF[1] = 0; - EP0BCH = 0; - EP0BCL = 2; - } - else - fx2_stall_ep0 (); - break; - - default: - fx2_stall_ep0 (); - break; - } - break; - - // -------------------------------- - - case RQ_SYNCH_FRAME: // not implemented - default: - fx2_stall_ep0 (); - break; - } - } - - else { - - //////////////////////////////////// - // handle the OUT requests - //////////////////////////////////// - - switch (bRequest){ - - case RQ_SET_CONFIG: - _usb_config = wValueL; // FIXME app should handle - break; - - case RQ_SET_INTERFACE: - _usb_alt_setting = wValueL; // FIXME app should handle - break; - - // -------------------------------- - - case RQ_CLEAR_FEATURE: - switch (bRequestType & bmRT_RECIP_MASK){ - - case bmRT_RECIP_DEVICE: - switch (wValueL){ - case FS_DEV_REMOTE_WAKEUP: - default: - fx2_stall_ep0 (); - } - break; - - case bmRT_RECIP_ENDPOINT: - if (wValueL == FS_ENDPOINT_HALT && plausible_endpoint (wIndexL)){ - *epcs (wIndexL) &= ~bmEPSTALL; - fx2_reset_data_toggle (wIndexL); - } - else - fx2_stall_ep0 (); - break; - - default: - fx2_stall_ep0 (); - break; - } - break; - - // -------------------------------- - - case RQ_SET_FEATURE: - switch (bRequestType & bmRT_RECIP_MASK){ - - case bmRT_RECIP_DEVICE: - switch (wValueL){ - case FS_TEST_MODE: - // hardware handles this after we complete SETUP phase handshake - break; - - case FS_DEV_REMOTE_WAKEUP: - default: - fx2_stall_ep0 (); - break; - } - } - break; - - case bmRT_RECIP_ENDPOINT: - switch (wValueL){ - case FS_ENDPOINT_HALT: - if (plausible_endpoint (wIndexL)) - *epcs (wIndexL) |= bmEPSTALL; - else - fx2_stall_ep0 (); - break; - - default: - fx2_stall_ep0 (); - break; - } - break; - - // -------------------------------- - - case RQ_SET_ADDRESS: // handled by fx2 hardware - case RQ_SET_DESCR: // not implemented - default: - fx2_stall_ep0 (); - } - - } - break; - - } // bmRT_TYPE_MASK - - // ack handshake phase of device request - EP0CS |= bmHSNAK; -} diff --git a/usrp/firmware/src/.gitignore b/usrp/firmware/src/.gitignore deleted file mode 100644 index d46c52c00..000000000 --- a/usrp/firmware/src/.gitignore +++ /dev/null @@ -1,17 +0,0 @@ -/*.ihx -/*.lnk -/*.lst -/*.map -/*.mem -/*.rel -/*.rst -/*.sym -/blink_leds.asm -/usrp_common.asm -/command_loop.asm -/fpga.asm -/*.asm -/usrp_gpif.c -/usrp_gpif_inline.h -/Makefile -/Makefile.in diff --git a/usrp/firmware/src/Makefile.am b/usrp/firmware/src/Makefile.am deleted file mode 100644 index fab46cef0..000000000 --- a/usrp/firmware/src/Makefile.am +++ /dev/null @@ -1,22 +0,0 @@ -# -# Copyright 2004 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -SUBDIRS = common usrp2 diff --git a/usrp/firmware/src/common/.gitignore b/usrp/firmware/src/common/.gitignore deleted file mode 100644 index d46c52c00..000000000 --- a/usrp/firmware/src/common/.gitignore +++ /dev/null @@ -1,17 +0,0 @@ -/*.ihx -/*.lnk -/*.lst -/*.map -/*.mem -/*.rel -/*.rst -/*.sym -/blink_leds.asm -/usrp_common.asm -/command_loop.asm -/fpga.asm -/*.asm -/usrp_gpif.c -/usrp_gpif_inline.h -/Makefile -/Makefile.in diff --git a/usrp/firmware/src/common/Makefile.am b/usrp/firmware/src/common/Makefile.am deleted file mode 100644 index 95232324d..000000000 --- a/usrp/firmware/src/common/Makefile.am +++ /dev/null @@ -1,50 +0,0 @@ -# -# Copyright 2004 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -EXTRA_DIST = \ - _startup.a51 \ - blink_leds.c \ - check_mdelay.c \ - check_udelay.c \ - edit-gpif \ - fpga.h \ - fpga_load.h \ - fpga_load.c \ - gpif.c \ - gpif.gpf \ - init_gpif.c \ - usrp_common.c \ - usrp_globals.h \ - vectors.a51 \ - build_eeprom.py - -all: usrp_gpif.c - -usrp_gpif.c usrp_gpif_inline.h : gpif.c - srcdir=$(srcdir) $(PYTHON) $(srcdir)/edit-gpif $(srcdir)/gpif.c usrp_gpif.c usrp_gpif_inline.h - -CLEANFILES = \ - *.ihx *.lnk *.lst *.map *.mem *.rel *.rst *.sym *.asm *.lib \ - usrp_gpif.c usrp_gpif_inline.h - -DISTCLEANFILES = \ - *.ihx *.lnk *.lst *.map *.mem *.rel *.rst *.sym *.asm *.lib \ - usrp_gpif.c usrp_gpif_inline.h diff --git a/usrp/firmware/src/common/_startup.a51 b/usrp/firmware/src/common/_startup.a51 deleted file mode 100644 index 30a907857..000000000 --- a/usrp/firmware/src/common/_startup.a51 +++ /dev/null @@ -1,80 +0,0 @@ -;;; -*- asm -*- -;;; -;;; Copyright 2003,2004 Free Software Foundation, Inc. -;;; -;;; This file is part of GNU Radio -;;; -;;; GNU Radio is free software; you can redistribute it and/or modify -;;; it under the terms of the GNU General Public License as published by -;;; the Free Software Foundation; either version 3, or (at your option) -;;; any later version. -;;; -;;; GNU Radio is distributed in the hope that it will be useful, -;;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;;; GNU General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with GNU Radio; see the file COPYING. If not, write to -;;; the Free Software Foundation, Inc., 51 Franklin Street, -;;; Boston, MA 02110-1301, USA. - - -;;; The default external memory initialization provided by sdcc is not -;;; appropriate to the FX2. This is derived from the sdcc code, but uses -;;; the FX2 specific _MPAGE sfr. - - - ;; .area XISEG (XDATA) ; the initialized external data area - ;; .area XINIT (CODE) ; the code space consts to init XISEG - .area XSEG (XDATA) ; zero initialized xdata - .area USBDESCSEG (XDATA) ; usb descriptors - - - .area CSEG (CODE) - - ;; sfr that sets upper address byte of MOVX using @r0 or @r1 - _MPAGE = 0x0092 - -__sdcc_external_startup:: - ;; This system is now compiled with the --no-xinit-opt - ;; which means that any initialized XDATA is handled - ;; inline by code in the GSINIT segs emitted for each file. - ;; - ;; We zero XSEG and all of the internal ram to ensure - ;; a known good state for uninitialized variables. - -; _mcs51_genRAMCLEAR() start - mov r0,#l_XSEG - mov a,r0 - orl a,#(l_XSEG >> 8) - jz 00002$ - mov r1,#((l_XSEG + 255) >> 8) - mov dptr,#s_XSEG - clr a - -00001$: movx @dptr,a - inc dptr - djnz r0,00001$ - djnz r1,00001$ - - ;; We're about to clear internal memory. This will overwrite - ;; the stack which contains our return address. - ;; Pop our return address into DPH, DPL -00002$: pop dph - pop dpl - - ;; R0 and A contain 0. This loop will execute 256 times. - ;; - ;; FWIW the first iteration writes direct address 0x00, - ;; which is the location of r0. We get lucky, we're - ;; writing the correct value (0) - -00003$: mov @r0,a - djnz r0,00003$ - - push dpl ; restore our return address - push dph - - mov dpl,#0 ; indicate that data init is still required - ret diff --git a/usrp/firmware/src/common/_startup.a51.brittle b/usrp/firmware/src/common/_startup.a51.brittle deleted file mode 100644 index 2996275cf..000000000 --- a/usrp/firmware/src/common/_startup.a51.brittle +++ /dev/null @@ -1,78 +0,0 @@ -;;; -*- asm -*- -;;; -;;; Copyright 2003 Free Software Foundation, Inc. -;;; -;;; This file is part of GNU Radio -;;; -;;; GNU Radio is free software; you can redistribute it and/or modify -;;; it under the terms of the GNU General Public License as published by -;;; the Free Software Foundation; either version 3, or (at your option) -;;; any later version. -;;; -;;; GNU Radio is distributed in the hope that it will be useful, -;;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;;; GNU General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with GNU Radio; see the file COPYING. If not, write to -;;; the Free Software Foundation, Inc., 51 Franklin Street, -;;; Boston, MA 02110-1301, USA. - - -;;; The default external memory initialization provided by sdcc is not -;;; appropriate to the FX2. This is derived from the sdcc code, but uses -;;; the FX2 specific _MPAGE sfr. - - - .area XISEG (XDATA) ; the initialized external data area - .area XINIT (CODE) ; the code space consts to init XISEG - .area XSEG (XDATA) ; zero initialized xdata - .area USBDESCSEG (XDATA); usb descriptors - - - ;; BIG TIME KLUDGE! - ;; Look at usrp_main.rst and count the bytes from our - ;; "normal return location" to the first instruction following - ;; the comment: "_mcs51_getRAMCLEAR () start" - - INSTRUCTION_BYTES_TO_SKIP = 0x29 ; valid for sdcc 2.4.0 - - - .area CSEG (CODE) - - ;; sfr that sets upper address byte of MOVX using @r0 or @r1 - _MPAGE = 0x0092 - -__sdcc_external_startup:: -; _mcs51_genXINIT() start - mov r1,#l_XINIT - mov a,r1 - orl a,#(l_XINIT >> 8) - jz 00003$ - mov r2,#((l_XINIT+255) >> 8) - mov dptr,#s_XINIT - mov r0,#s_XISEG - mov _MPAGE,#(s_XISEG >> 8) -00001$: clr a - movc a,@a+dptr - movx @r0,a - inc dptr - inc r0 - cjne r0,#0,00002$ - inc _MPAGE -00002$: djnz r1,00001$ - djnz r2,00001$ - mov _MPAGE,#0xFF -00003$: - - ;; Danger! Total KLUDGE! - ;; We pop the return address, add a magic number to it - ;; then jump to that address. Believe it or not, this - ;; looks like the least kludgy way to handle this, - ;; short of patching the compiler... - - pop dph - pop dpl - mov a,#INSTRUCTION_BYTES_TO_SKIP - jmp @a+dptr diff --git a/usrp/firmware/src/common/blink_leds.c b/usrp/firmware/src/common/blink_leds.c deleted file mode 100644 index 255c69733..000000000 --- a/usrp/firmware/src/common/blink_leds.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * USRP - Universal Software Radio Peripheral - * - * Copyright (C) 2003 Free Software Foundation, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Boston, MA 02110-1301 USA - */ - -#include "usrp_common.h" - -void -main (void) -{ - unsigned short counter = 0; - - init_usrp (); - - while (1){ - unsigned char counter_high = counter >> 8; - set_led_0 (counter_high & 0x40); - set_led_1 (counter_high & 0x80); - counter++; - } -} diff --git a/usrp/firmware/src/common/build_eeprom.py b/usrp/firmware/src/common/build_eeprom.py deleted file mode 100755 index 00c2e3414..000000000 --- a/usrp/firmware/src/common/build_eeprom.py +++ /dev/null @@ -1,188 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2004,2006 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -import re -import sys -import os, os.path -from optparse import OptionParser - -# USB Vendor and Product ID's - -VID = 0xfffe # Free Software Folks -PID = 0x0002 # Universal Software Radio Peripheral - - -def hex_to_bytes (s): - if len (s) & 0x1: - raise ValueError, "Length must be even" - r = [] - for i in range (0, len(s), 2): - r.append (int (s[i:i+2], 16)) - return r - -def msb (x): - return (x >> 8) & 0xff - -def lsb (x): - return x & 0xff - -class ihx_rec (object): - def __init__ (self, addr, type, data): - self.addr = addr - self.type = type - self.data = data - -class ihx_file (object): - def __init__ (self): - self.pat = re.compile (r':[0-9A-F]{10,}') - def read (self, file): - r = [] - for line in file: - line = line.strip().upper () - if not self.pat.match (line): - raise ValueError, "Invalid hex record format" - bytes = hex_to_bytes (line[1:]) - sum = reduce (lambda x, y: x + y, bytes, 0) % 256 - if sum != 0: - raise ValueError, "Bad hex checksum" - lenx = bytes[0] - addr = (bytes[1] << 8) + bytes[2] - type = bytes[3] - data = bytes[4:-1] - if lenx != len (data): - raise ValueError, "Invalid hex record (bad length)" - if type != 0: - break; - r.append (ihx_rec (addr, type, data)) - - return r - -def get_code (filename): - """Read the intel hex format file FILENAME and return a tuple - of the code starting address and a list of bytes to load there. - """ - f = open (filename, 'r') - ifx = ihx_file () - r = ifx.read (f) - r.sort (lambda a,b: a.addr - b.addr) - code_start = r[0].addr - code_end = r[-1].addr + len (r[-1].data) - code_len = code_end - code_start - code = [0] * code_len - for x in r: - a = x.addr - l = len (x.data) - code[a-code_start:a-code_start+l] = x.data - return (code_start, code) - - -def build_eeprom_image (filename, rev): - """Build a ``C2 Load'' EEPROM image. - - For details on this format, see section 3.4.3 of - the EZ-USB FX2 Technical Reference Manual - """ - # get the code we want to run - (start_addr, bytes) = get_code (filename) - - devid = rev - - rom_header = [ - 0xC2, # boot from EEPROM - lsb (VID), - msb (VID), - lsb (PID), - msb (PID), - lsb (devid), - msb (devid), - 0 # configuration byte - ] - - # 4 byte header that indicates where to load - # the immediately follow code bytes. - code_header = [ - msb (len (bytes)), - lsb (len (bytes)), - msb (start_addr), - lsb (start_addr) - ] - - # writes 0 to CPUCS reg (brings FX2 out of reset) - trailer = [ - 0x80, - 0x01, - 0xe6, - 0x00, - 0x00 - ] - - image = rom_header + code_header + bytes + trailer - - assert (len (image) <= 256) - return image - -def build_shell_script (out, ihx_filename, rev, prefix): - - image = build_eeprom_image (ihx_filename, rev) - - out.write ('#!/bin/sh\n') - out.write ('usrper -x load_firmware ' + prefix + '/share/usrp/rev%d/std.ihx\n' % rev) - out.write ('sleep 2\n') - - # print "len(image) =", len(image) - - i2c_addr = 0x50 - rom_addr = 0x00 - - hex_image = map (lambda x : "%02x" % (x,), image) - - while (len (hex_image) > 0): - l = min (len (hex_image), 16) - out.write ('usrper i2c_write 0x%02x %02x%s\n' % - (i2c_addr, rom_addr, ''.join (hex_image[0:l]))) - hex_image = hex_image[l:] - rom_addr = rom_addr + l - out.write ('sleep 2\n') - -if __name__ == '__main__': - usage = "usage: %prog -p PREFIX -r REV [options] bootfile.ihx" - parser = OptionParser (usage=usage) - parser.add_option ("-p", "--prefix", type="string", default="", - help="Specify install prefix from configure") - parser.add_option ("-r", "--rev", type="int", default=-1, - help="Specify USRP revision number REV (2 or 4)") - (options, args) = parser.parse_args () - if len (args) != 1: - parser.print_help () - sys.exit (1) - if options.rev < 0: - sys.stderr.write ( - "You must specify the USRP revision number (2 or 4) with -r REV\n") - sys.exit (1) - if options.prefix == "": - sys.stderr.write ( - "You must specify the install prefix with -p PREFIX\n") - sys.exit (1) - - ihx_filename = args[0] - - build_shell_script (sys.stdout, ihx_filename, options.rev, options.prefix) diff --git a/usrp/firmware/src/common/check_mdelay.c b/usrp/firmware/src/common/check_mdelay.c deleted file mode 100644 index de1af47f6..000000000 --- a/usrp/firmware/src/common/check_mdelay.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - * USRP - Universal Software Radio Peripheral - * - * Copyright (C) 2003 Free Software Foundation, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Boston, MA 02110-1301 USA - */ - -#include "usrp_common.h" -#include "delay.h" - -void -main (void) -{ - init_usrp (); - - // CPUCS = 0; // 12 MHz - // CPUCS = bmCLKSPD0; // 24 MHz - CPUCS = bmCLKSPD1; // 48 MHz - - while (1){ - USRP_LED_REG ^= bmLED0; - mdelay (10); - } -} diff --git a/usrp/firmware/src/common/check_udelay.c b/usrp/firmware/src/common/check_udelay.c deleted file mode 100644 index 46885a067..000000000 --- a/usrp/firmware/src/common/check_udelay.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - * USRP - Universal Software Radio Peripheral - * - * Copyright (C) 2003 Free Software Foundation, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Boston, MA 02110-1301 USA - */ - -#include "usrp_common.h" -#include "delay.h" - -void -main (void) -{ - init_usrp (); - - // CPUCS = 0; // 12 MHz - // CPUCS = bmCLKSPD0; // 24 MHz - CPUCS = bmCLKSPD1; // 48 MHz - - while (1){ - USRP_LED_REG ^= bmLED0; - udelay (250); - } -} diff --git a/usrp/firmware/src/common/edit-gpif b/usrp/firmware/src/common/edit-gpif deleted file mode 100755 index 5367b75a5..000000000 --- a/usrp/firmware/src/common/edit-gpif +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/env python -# -*- Python -*- -# -# Copyright 2003 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - - -# Edit the gpif.c file generated by the Cypress GPIF Designer Tool and -# produce usrp_gpif.c, and usrp_gpif_inline.h, files suitable for our -# uses. - -import re -import string -import sys - -def check_flow_state (line, flow_state_dict): - mo = re.match (r'/\* Wave (\d) FlowStates \*/ (.*),', line) - if mo: - wave = int (mo.group (1)) - data = mo.group (2) - split = data.split (',', 8) - v = map (lambda x : int (x, 16), split) - # print "%s, %s" % (wave, data) - # print "split: ", split - # print "v : ", v - flow_state_dict[wave] = v - - -def delta (xseq, yseq): - # set subtraction - z = [] - for x in xseq: - if x not in yseq: - z.append (x) - return z - - -def write_define (output, name, pairs): - output.write ('#define %s()\t\\\n' % name) - output.write ('do {\t\t\t\t\t\\\n') - for reg, val in pairs: - output.write ('%14s = 0x%02x;\t\t\t\\\n' % (reg, val)) - output.write ('} while (0)\n\n') - -def write_inlines (output, dict): - regs = ['FLOWSTATE', 'FLOWLOGIC', 'FLOWEQ0CTL', 'FLOWEQ1CTL', 'FLOWHOLDOFF', - 'FLOWSTB', 'FLOWSTBEDGE', 'FLOWSTBHPERIOD', 'GPIFHOLDAMOUNT'] - - READ_FLOW_STATE = 2 - WRITE_FLOW_STATE = 3 - - read_info = zip (regs, dict[READ_FLOW_STATE]) - write_info = zip (regs, dict[WRITE_FLOW_STATE]) - - output.write ('''/* - * Machine generated by "edit-gpif". Do not edit by hand. - */ - -''') - write_define (output, 'setup_flowstate_common', read_info) - write_define (output, 'setup_flowstate_read', delta (read_info, write_info)) - write_define (output, 'setup_flowstate_write', delta (write_info, read_info)) - - -def edit_gpif (input_name, output_name, inline_name): - input = open (input_name, 'r') - output = open (output_name, 'w') - inline = open (inline_name, 'w') - flow_state_dict = {} - - output.write ('''/* - * Machine generated by "edit-gpif". Do not edit by hand. - */ - -''') - - while 1: - line = input.readline () - line = string.replace (line, '\r','') - line = re.sub (r' *$', r'', line) - - check_flow_state (line, flow_state_dict) - - line = re.sub (r'#include', r'// #include', line) - line = re.sub (r'xdata ', r'', line) - if re.search (r'GpifInit', line): - break - - output.write (line) - - output.close () - write_inlines (inline, flow_state_dict) - inline.close () - - -# gpif.c usrp_gpif.c usrp_gpif_inline.h -edit_gpif (sys.argv[1], sys.argv[2], sys.argv[3]) diff --git a/usrp/firmware/src/common/fpga.h b/usrp/firmware/src/common/fpga.h deleted file mode 100644 index 6cd5de8e2..000000000 --- a/usrp/firmware/src/common/fpga.h +++ /dev/null @@ -1,31 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ -#ifndef INCLUDED_FPGA_H -#define INCLUDED_FPGA_H - -#include "fpga_load.h" - -#if defined(HAVE_USRP2) -#include "fpga_rev2.h" -#endif - -#endif /* INCLUDED_FPGA_H */ diff --git a/usrp/firmware/src/common/fpga_load.c b/usrp/firmware/src/common/fpga_load.c deleted file mode 100644 index c3ae9e707..000000000 --- a/usrp/firmware/src/common/fpga_load.c +++ /dev/null @@ -1,193 +0,0 @@ -/* - * USRP - Universal Software Radio Peripheral - * - * Copyright (C) 2003 Free Software Foundation, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Boston, MA 02110-1301 USA - */ - -#include "usrp_common.h" -#include "fpga_load.h" -#include "delay.h" - -/* - * setup altera FPGA serial load (PS). - * - * On entry: - * don't care - * - * On exit: - * ALTERA_DCLK = 0 - * ALTERA_NCONFIG = 1 - * ALTERA_NSTATUS = 1 (input) - */ -unsigned char -fpga_load_begin (void) -{ - USRP_ALTERA_CONFIG &= ~bmALTERA_BITS; // clear all bits (NCONFIG low) - udelay (40); // wait 40 us - USRP_ALTERA_CONFIG |= bmALTERA_NCONFIG; // set NCONFIG high - - if (UC_BOARD_HAS_FPGA){ - // FIXME should really cap this loop with a counter so we - // don't hang forever on a hardware failure. - while ((USRP_ALTERA_CONFIG & bmALTERA_NSTATUS) == 0) // wait for NSTATUS to go high - ; - } - - // ready to xfer now - - return 1; -} - -/* - * clock out the low bit of bits. - * - * On entry: - * ALTERA_DCLK = 0 - * ALTERA_NCONFIG = 1 - * ALTERA_NSTATUS = 1 (input) - * - * On exit: - * ALTERA_DCLK = 0 - * ALTERA_NCONFIG = 1 - * ALTERA_NSTATUS = 1 (input) - */ - - -#if 0 - -static void -clock_out_config_byte (unsigned char bits) -{ - unsigned char i; - - // clock out configuration byte, least significant bit first - - for (i = 0; i < 8; i++){ - - USRP_ALTERA_CONFIG = ((USRP_ALTERA_CONFIG & ~bmALTERA_DATA0) | ((bits & 1) ? bmALTERA_DATA0 : 0)); - USRP_ALTERA_CONFIG |= bmALTERA_DCLK; /* set DCLK to 1 */ - USRP_ALTERA_CONFIG &= ~bmALTERA_DCLK; /* set DCLK to 0 */ - - bits = bits >> 1; - } -} - -#else - -static void -clock_out_config_byte (unsigned char bits) _naked -{ - _asm - mov a, dpl - - rrc a - mov _bitALTERA_DATA0,c - setb _bitALTERA_DCLK - clr _bitALTERA_DCLK - - rrc a - mov _bitALTERA_DATA0,c - setb _bitALTERA_DCLK - clr _bitALTERA_DCLK - - rrc a - mov _bitALTERA_DATA0,c - setb _bitALTERA_DCLK - clr _bitALTERA_DCLK - - rrc a - mov _bitALTERA_DATA0,c - setb _bitALTERA_DCLK - clr _bitALTERA_DCLK - - rrc a - mov _bitALTERA_DATA0,c - setb _bitALTERA_DCLK - clr _bitALTERA_DCLK - - rrc a - mov _bitALTERA_DATA0,c - setb _bitALTERA_DCLK - clr _bitALTERA_DCLK - - rrc a - mov _bitALTERA_DATA0,c - setb _bitALTERA_DCLK - clr _bitALTERA_DCLK - - rrc a - mov _bitALTERA_DATA0,c - setb _bitALTERA_DCLK - clr _bitALTERA_DCLK - - ret - - _endasm; -} - -#endif - -static void -clock_out_bytes (unsigned char bytecount, - unsigned char xdata *p) -{ - while (bytecount-- > 0) - clock_out_config_byte (*p++); -} - -/* - * Transfer block of bytes from packet to FPGA serial configuration port - * - * On entry: - * ALTERA_DCLK = 0 - * ALTERA_NCONFIG = 1 - * ALTERA_NSTATUS = 1 (input) - * - * On exit: - * ALTERA_DCLK = 0 - * ALTERA_NCONFIG = 1 - * ALTERA_NSTATUS = 1 (input) - */ -unsigned char -fpga_load_xfer (xdata unsigned char *p, unsigned char bytecount) -{ - clock_out_bytes (bytecount, p); - return 1; -} - -/* - * check for successful load... - */ -unsigned char -fpga_load_end (void) -{ - unsigned char status = USRP_ALTERA_CONFIG; - - if (!UC_BOARD_HAS_FPGA) // always true if we don't have FPGA - return 1; - - if ((status & bmALTERA_NSTATUS) == 0) // failed to program - return 0; - - if ((status & bmALTERA_CONF_DONE) == bmALTERA_CONF_DONE) - return 1; // everything's cool - - // I don't think this should happen. It indicates that - // programming is still in progress. - - return 0; -} diff --git a/usrp/firmware/src/common/fpga_load.h b/usrp/firmware/src/common/fpga_load.h deleted file mode 100644 index 7c36a04c8..000000000 --- a/usrp/firmware/src/common/fpga_load.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * USRP - Universal Software Radio Peripheral - * - * Copyright (C) 2003 Free Software Foundation, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Boston, MA 02110-1301 USA - */ - -#ifndef INCLUDED_FPGA_LOAD_H -#define INCLUDED_FPGA_LOAD_H - -unsigned char fpga_load_begin (void); -unsigned char fpga_load_xfer (xdata unsigned char *p, unsigned char len); -unsigned char fpga_load_end (void); - -#endif /* INCLUDED_FPGA_LOAD_H */ diff --git a/usrp/firmware/src/common/gpif.c b/usrp/firmware/src/common/gpif.c deleted file mode 100755 index 489e6e81a..000000000 --- a/usrp/firmware/src/common/gpif.c +++ /dev/null @@ -1,292 +0,0 @@ -// This program configures the General Programmable Interface (GPIF) for FX2. -// Please do not modify sections of text which are marked as "DO NOT EDIT ...". -// -// DO NOT EDIT ... -// GPIF Initialization -// Interface Timing Async -// Internal Ready Init IntRdy=1 -// CTL Out Tristate-able Binary -// SingleWrite WF Select 1 -// SingleRead WF Select 0 -// FifoWrite WF Select 3 -// FifoRead WF Select 2 -// Data Bus Idle Drive Tristate -// END DO NOT EDIT - -// DO NOT EDIT ... -// GPIF Wave Names -// Wave 0 = singlerd -// Wave 1 = singlewr -// Wave 2 = FIFORd -// Wave 3 = FIFOWr - -// GPIF Ctrl Outputs Level -// CTL 0 = WEN# CMOS -// CTL 1 = REN# CMOS -// CTL 2 = OE# CMOS -// CTL 3 = CLRST CMOS -// CTL 4 = unused CMOS -// CTL 5 = BOGUS CMOS - -// GPIF Rdy Inputs -// RDY0 = EF# -// RDY1 = FF# -// RDY2 = unused -// RDY3 = unused -// RDY4 = unused -// RDY5 = TCXpire -// FIFOFlag = FIFOFlag -// IntReady = IntReady -// END DO NOT EDIT -// DO NOT EDIT ... -// -// GPIF Waveform 0: singlerd -// -// Interval 0 1 2 3 4 5 6 Idle (7) -// _________ _________ _________ _________ _________ _________ _________ _________ -// -// AddrMode Same Val Same Val Same Val Same Val Same Val Same Val Same Val -// DataMode NO Data NO Data NO Data NO Data NO Data NO Data NO Data -// NextData SameData SameData SameData SameData SameData SameData SameData -// Int Trig No Int No Int No Int No Int No Int No Int No Int -// IF/Wait Wait 1 Wait 1 Wait 1 Wait 1 Wait 1 Wait 1 Wait 1 -// Term A -// LFunc -// Term B -// Branch1 -// Branch0 -// Re-Exec -// Sngl/CRC Default Default Default Default Default Default Default -// WEN# 0 0 0 0 0 0 0 0 -// REN# 0 0 0 0 0 0 0 0 -// OE# 0 0 0 0 0 0 0 0 -// CLRST 0 0 0 0 0 0 0 0 -// unused 0 0 0 0 0 0 0 0 -// BOGUS 0 0 0 0 0 0 0 0 -// -// END DO NOT EDIT -// DO NOT EDIT ... -// -// GPIF Waveform 1: singlewr -// -// Interval 0 1 2 3 4 5 6 Idle (7) -// _________ _________ _________ _________ _________ _________ _________ _________ -// -// AddrMode Same Val Same Val Same Val Same Val Same Val Same Val Same Val -// DataMode Activate Activate Activate Activate Activate Activate Activate -// NextData SameData SameData SameData SameData SameData SameData SameData -// Int Trig No Int No Int No Int No Int No Int No Int No Int -// IF/Wait Wait 1 IF Wait 1 Wait 1 Wait 1 Wait 1 Wait 1 -// Term A EF# -// LFunc AND -// Term B EF# -// Branch1 ThenIdle -// Branch0 ElseIdle -// Re-Exec No -// Sngl/CRC Default Default Default Default Default Default Default -// WEN# 0 1 1 1 1 1 1 0 -// REN# 0 0 0 0 0 0 0 0 -// OE# 0 0 0 0 0 0 0 0 -// CLRST 0 0 0 0 0 0 0 0 -// unused 0 0 0 0 0 0 0 0 -// BOGUS 0 0 0 0 0 0 0 0 -// -// END DO NOT EDIT -// DO NOT EDIT ... -// -// GPIF Waveform 2: FIFORd -// -// Interval 0 1 2 3 4 5 6 Idle (7) -// _________ _________ _________ _________ _________ _________ _________ _________ -// -// AddrMode Same Val Same Val Same Val Same Val Same Val Same Val Same Val -// DataMode NO Data Activate NO Data NO Data NO Data NO Data NO Data -// NextData SameData SameData SameData SameData SameData SameData SameData -// Int Trig No Int No Int No Int No Int No Int No Int No Int -// IF/Wait Wait 1 IF Wait 1 IF Wait 1 Wait 1 Wait 1 -// Term A TCXpire TCXpire -// LFunc AND AND -// Term B TCXpire TCXpire -// Branch1 Then 2 ThenIdle -// Branch0 Else 1 ElseIdle -// Re-Exec No No -// Sngl/CRC Default Default Default Default Default Default Default -// WEN# 0 0 0 0 0 0 0 0 -// REN# 0 0 0 0 0 0 0 0 -// OE# 1 1 1 0 0 0 0 0 -// CLRST 0 0 0 0 0 0 0 0 -// unused 0 0 0 0 0 0 0 0 -// BOGUS 0 0 0 0 0 0 0 0 -// -// END DO NOT EDIT -// DO NOT EDIT ... -// -// GPIF Waveform 3: FIFOWr -// -// Interval 0 1 2 3 4 5 6 Idle (7) -// _________ _________ _________ _________ _________ _________ _________ _________ -// -// AddrMode Same Val Same Val Same Val Same Val Same Val Same Val Same Val -// DataMode NO Data Activate Activate Activate Activate Activate Activate -// NextData SameData SameData SameData SameData SameData SameData SameData -// Int Trig No Int No Int No Int No Int No Int No Int No Int -// IF/Wait Wait 1 IF Wait 1 Wait 1 Wait 1 Wait 1 Wait 1 -// Term A TCXpire -// LFunc AND -// Term B TCXpire -// Branch1 ThenIdle -// Branch0 Else 1 -// Re-Exec No -// Sngl/CRC Default Default Default Default Default Default Default -// WEN# 0 0 0 0 0 0 0 0 -// REN# 0 0 0 0 0 0 0 0 -// OE# 0 0 0 0 0 0 0 0 -// CLRST 0 0 0 0 0 0 0 0 -// unused 0 0 0 0 0 0 0 0 -// BOGUS 0 0 0 0 0 0 0 0 -// -// END DO NOT EDIT - -// GPIF Program Code - -// DO NOT EDIT ... -#include "fx2.h" -#include "fx2regs.h" -#include "fx2sdly.h" // SYNCDELAY macro -// END DO NOT EDIT - -// DO NOT EDIT ... -const char xdata WaveData[128] = -{ -// Wave 0 -/* LenBr */ 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x07, -/* Opcode*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* Output*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* LFun */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, -// Wave 1 -/* LenBr */ 0x01, 0x3F, 0x01, 0x01, 0x01, 0x01, 0x01, 0x07, -/* Opcode*/ 0x22, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, -/* Output*/ 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, -/* LFun */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, -// Wave 2 -/* LenBr */ 0x01, 0x11, 0x01, 0x3F, 0x01, 0x01, 0x01, 0x07, -/* Opcode*/ 0x00, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -/* Output*/ 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* LFun */ 0x00, 0x2D, 0x00, 0x2D, 0x00, 0x00, 0x00, 0x3F, -// Wave 3 -/* LenBr */ 0x01, 0x39, 0x01, 0x01, 0x01, 0x01, 0x01, 0x07, -/* Opcode*/ 0x00, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, -/* Output*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* LFun */ 0x00, 0x2D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, -}; -// END DO NOT EDIT - -// DO NOT EDIT ... -const char xdata FlowStates[36] = -{ -/* Wave 0 FlowStates */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -/* Wave 1 FlowStates */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -/* Wave 2 FlowStates */ 0x81,0x2D,0x26,0x00,0x04,0x04,0x03,0x02,0x00, -/* Wave 3 FlowStates */ 0x81,0x2D,0x21,0x00,0x04,0x04,0x03,0x02,0x00, -}; -// END DO NOT EDIT - -// DO NOT EDIT ... -const char xdata InitData[7] = -{ -/* Regs */ 0xA0,0x00,0x00,0x00,0xEE,0x4E,0x00 -}; -// END DO NOT EDIT - -// TO DO: You may add additional code below. - -void GpifInit( void ) -{ - BYTE i; - - // Registers which require a synchronization delay, see section 15.14 - // FIFORESET FIFOPINPOLAR - // INPKTEND OUTPKTEND - // EPxBCH:L REVCTL - // GPIFTCB3 GPIFTCB2 - // GPIFTCB1 GPIFTCB0 - // EPxFIFOPFH:L EPxAUTOINLENH:L - // EPxFIFOCFG EPxGPIFFLGSEL - // PINFLAGSxx EPxFIFOIRQ - // EPxFIFOIE GPIFIRQ - // GPIFIE GPIFADRH:L - // UDMACRCH:L EPxGPIFTRIG - // GPIFTRIG - - // Note: The pre-REVE EPxGPIFTCH/L register are affected, as well... - // ...these have been replaced by GPIFTC[B3:B0] registers - - // 8051 doesn't have access to waveform memories 'til - // the part is in GPIF mode. - - IFCONFIG = 0xEE; - // IFCLKSRC=1 , FIFOs executes on internal clk source - // xMHz=1 , 48MHz internal clk rate - // IFCLKOE=0 , Don't drive IFCLK pin signal at 48MHz - // IFCLKPOL=0 , Don't invert IFCLK pin signal from internal clk - // ASYNC=1 , master samples asynchronous - // GSTATE=1 , Drive GPIF states out on PORTE[2:0], debug WF - // IFCFG[1:0]=10, FX2 in GPIF master mode - - GPIFABORT = 0xFF; // abort any waveforms pending - - GPIFREADYCFG = InitData[ 0 ]; - GPIFCTLCFG = InitData[ 1 ]; - GPIFIDLECS = InitData[ 2 ]; - GPIFIDLECTL = InitData[ 3 ]; - GPIFWFSELECT = InitData[ 5 ]; - GPIFREADYSTAT = InitData[ 6 ]; - - // use dual autopointer feature... - AUTOPTRSETUP = 0x07; // inc both pointers, - // ...warning: this introduces pdata hole(s) - // ...at E67B (XAUTODAT1) and E67C (XAUTODAT2) - - // source - AUTOPTRH1 = MSB( &WaveData ); - AUTOPTRL1 = LSB( &WaveData ); - - // destination - AUTOPTRH2 = 0xE4; - AUTOPTRL2 = 0x00; - - // transfer - for ( i = 0x00; i < 128; i++ ) - { - EXTAUTODAT2 = EXTAUTODAT1; - } - -// Configure GPIF Address pins, output initial value, - PORTCCFG = 0xFF; // [7:0] as alt. func. GPIFADR[7:0] - OEC = 0xFF; // and as outputs - PORTECFG |= 0x80; // [8] as alt. func. GPIFADR[8] - OEE |= 0x80; // and as output - -// ...OR... tri-state GPIFADR[8:0] pins -// PORTCCFG = 0x00; // [7:0] as port I/O -// OEC = 0x00; // and as inputs -// PORTECFG &= 0x7F; // [8] as port I/O -// OEE &= 0x7F; // and as input - -// GPIF address pins update when GPIFADRH/L written - SYNCDELAY; // - GPIFADRH = 0x00; // bits[7:1] always 0 - SYNCDELAY; // - GPIFADRL = 0x00; // point to PERIPHERAL address 0x0000 - -// Configure GPIF FlowStates registers for Wave 0 of WaveData - FLOWSTATE = FlowStates[ 0 ]; - FLOWLOGIC = FlowStates[ 1 ]; - FLOWEQ0CTL = FlowStates[ 2 ]; - FLOWEQ1CTL = FlowStates[ 3 ]; - FLOWHOLDOFF = FlowStates[ 4 ]; - FLOWSTB = FlowStates[ 5 ]; - FLOWSTBEDGE = FlowStates[ 6 ]; - FLOWSTBHPERIOD = FlowStates[ 7 ]; -} - diff --git a/usrp/firmware/src/common/gpif.gpf b/usrp/firmware/src/common/gpif.gpf Binary files differdeleted file mode 100755 index a954ac193..000000000 --- a/usrp/firmware/src/common/gpif.gpf +++ /dev/null diff --git a/usrp/firmware/src/common/init_gpif.c b/usrp/firmware/src/common/init_gpif.c deleted file mode 100644 index edde919be..000000000 --- a/usrp/firmware/src/common/init_gpif.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - * USRP - Universal Software Radio Peripheral - * - * Copyright (C) 2003 Free Software Foundation, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Boston, MA 02110-1301 USA - */ - -#include "usrp_common.h" - -// These are the tables generated by the Cypress GPIF Designer - -extern const char WaveData[128]; -extern const char FlowStates[36]; -extern const char InitData[7]; - -// The tool is kind of screwed up, in that it doesn't configure some -// of the ports correctly. We just use their tables and handle the -// initialization ourselves. They also declare that their static -// initialized data is in xdata, which screws us too. - -void -init_gpif (void) -{ - // we've already setup IFCONFIG before calling this... - - GPIFABORT = 0xFF; // abort any waveforms pending - SYNCDELAY; - - GPIFREADYCFG = InitData[ 0 ]; - GPIFCTLCFG = InitData[ 1 ]; - GPIFIDLECS = InitData[ 2 ]; - GPIFIDLECTL = InitData[ 3 ]; - // Hmmm, what's InitData[ 4 ] ... - GPIFWFSELECT = InitData[ 5 ]; - // GPIFREADYSTAT = InitData[ 6 ]; // I think this register is read only... - - { - BYTE i; - - for (i = 0; i < 128; i++){ - GPIF_WAVE_DATA[i] = WaveData[i]; - } - } - - FLOWSTATE = 0; /* ensure it's off */ -} diff --git a/usrp/firmware/src/common/usrp_common.c b/usrp/firmware/src/common/usrp_common.c deleted file mode 100644 index 0998653c2..000000000 --- a/usrp/firmware/src/common/usrp_common.c +++ /dev/null @@ -1,109 +0,0 @@ -/* - * USRP - Universal Software Radio Peripheral - * - * Copyright (C) 2003 Free Software Foundation, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Boston, MA 02110-1301 USA - */ - -/* - * common code for USRP - */ - -#include "usrp_common.h" - -void init_board (void); - -void -init_usrp (void) -{ - CPUCS = bmCLKSPD1; // CPU runs @ 48 MHz - CKCON = 0; // MOVX takes 2 cycles - - // IFCLK is generated internally and runs at 48 MHz; GPIF "master mode" - - IFCONFIG = bmIFCLKSRC | bm3048MHZ | bmIFCLKOE | bmIFCLKPOL | bmIFGPIF; - SYNCDELAY; - - // configure IO ports (B and D are used by GPIF) - - IOA = bmPORT_A_INITIAL; // Port A initial state - OEA = bmPORT_A_OUTPUTS; // Port A direction register - - IOC = bmPORT_C_INITIAL; // Port C initial state - OEC = bmPORT_C_OUTPUTS; // Port C direction register - - IOE = bmPORT_E_INITIAL; // Port E initial state - OEE = bmPORT_E_OUTPUTS; // Port E direction register - - - // REVCTL = bmDYN_OUT | bmENH_PKT; // highly recommended by docs - // SYNCDELAY; - - // configure end points - - EP1OUTCFG = bmVALID | bmBULK; SYNCDELAY; - EP1INCFG = bmVALID | bmBULK | bmIN; SYNCDELAY; - - EP2CFG = bmVALID | bmBULK | bmQUADBUF; SYNCDELAY; // 512 quad bulk OUT - EP4CFG = 0; SYNCDELAY; // disabled - EP6CFG = bmVALID | bmBULK | bmQUADBUF | bmIN; SYNCDELAY; // 512 quad bulk IN - EP8CFG = 0; SYNCDELAY; // disabled - - // reset FIFOs - - FIFORESET = bmNAKALL; SYNCDELAY; - FIFORESET = 2; SYNCDELAY; - // FIFORESET = 4; SYNCDELAY; - FIFORESET = 6; SYNCDELAY; - // FIFORESET = 8; SYNCDELAY; - FIFORESET = 0; SYNCDELAY; - - // configure end point FIFOs - - // let core see 0 to 1 transistion of autoout bit - - EP2FIFOCFG = bmWORDWIDE; SYNCDELAY; - EP2FIFOCFG = bmAUTOOUT | bmWORDWIDE; SYNCDELAY; - EP6FIFOCFG = bmAUTOIN | bmWORDWIDE; SYNCDELAY; - - - // prime the pump - -#if 0 - EP2BCL = 0x80; SYNCDELAY; - EP2BCL = 0x80; SYNCDELAY; - EP2BCL = 0x80; SYNCDELAY; - EP2BCL = 0x80; SYNCDELAY; -#endif - - EP0BCH = 0; SYNCDELAY; - - // arm EP1OUT so we can receive "out" packets (TRM pg 8-8) - - EP1OUTBC = 0; SYNCDELAY; - - EP2GPIFFLGSEL = 0x01; SYNCDELAY; // For EP2OUT, GPIF uses EF flag - EP6GPIFFLGSEL = 0x02; SYNCDELAY; // For EP6IN, GPIF uses FF flag - - // set autoin length for EP6 - // FIXME should be f(enumeration) - - EP6AUTOINLENH = (512) >> 8; SYNCDELAY; // this is the length for high speed - EP6AUTOINLENL = (512) & 0xff; SYNCDELAY; - - init_board (); -} - diff --git a/usrp/firmware/src/common/usrp_globals.h b/usrp/firmware/src/common/usrp_globals.h deleted file mode 100644 index 445e9e6b4..000000000 --- a/usrp/firmware/src/common/usrp_globals.h +++ /dev/null @@ -1,32 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ -#ifndef _USRP_GLOBALS_H_ -#define _USRP_GLOBALS_H_ - -extern unsigned char g_tx_enable; -extern unsigned char g_rx_enable; -extern unsigned char g_fpga_reset; -extern unsigned char g_rx_overrun; -extern unsigned char g_tx_underrun; - - -#endif /* _USRP_GLOBALS_H_ */ diff --git a/usrp/firmware/src/common/vectors.a51 b/usrp/firmware/src/common/vectors.a51 deleted file mode 100644 index e9382ab84..000000000 --- a/usrp/firmware/src/common/vectors.a51 +++ /dev/null @@ -1,180 +0,0 @@ -;;; -*- asm -*- -;;; -;;; Copyright 2003 Free Software Foundation, Inc. -;;; -;;; This file is part of GNU Radio -;;; -;;; GNU Radio is free software; you can redistribute it and/or modify -;;; it under the terms of the GNU General Public License as published by -;;; the Free Software Foundation; either version 3, or (at your option) -;;; any later version. -;;; -;;; GNU Radio is distributed in the hope that it will be useful, -;;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;;; GNU General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with GNU Radio; see the file COPYING. If not, write to -;;; the Free Software Foundation, Inc., 51 Franklin Street, -;;; Boston, MA 02110-1301, USA. -;;; - -;;; Interrupt vectors. - -;;; N.B. This object module must come first in the list of modules - - .module vectors - -;;; ---------------------------------------------------------------- -;;; standard FX2 interrupt vectors -;;; ---------------------------------------------------------------- - - .area CSEG (CODE) - .area GSINIT (CODE) - .area CSEG (CODE) -__standard_interrupt_vector:: -__reset_vector:: - ljmp s_GSINIT - - ;; 13 8-byte entries. We point them all at __isr_nop - ljmp __isr_nop ; 3 bytes - .ds 5 ; + 5 = 8 bytes for vector slot - ljmp __isr_nop - .ds 5 - ljmp __isr_nop - .ds 5 - ljmp __isr_nop - .ds 5 - ljmp __isr_nop - .ds 5 - ljmp __isr_nop - .ds 5 - ljmp __isr_nop - .ds 5 - ljmp __isr_nop - .ds 5 - ljmp __isr_nop - .ds 5 - ljmp __isr_nop - .ds 5 - ljmp __isr_nop - .ds 5 - ljmp __isr_nop - .ds 5 - ljmp __isr_nop - .ds 5 - -__isr_nop:: - reti - -;;; ---------------------------------------------------------------- -;;; the FIFO/GPIF autovector. 14 4-byte entries. -;;; must start on a 128 byte boundary. -;;; ---------------------------------------------------------------- - - . = __reset_vector + 0x0080 - -__fifo_gpif_autovector:: - ljmp __isr_nop - nop - ljmp __isr_nop - nop - ljmp __isr_nop - nop - ljmp __isr_nop - nop - ljmp __isr_nop - nop - ljmp __isr_nop - nop - ljmp __isr_nop - nop - ljmp __isr_nop - nop - ljmp __isr_nop - nop - ljmp __isr_nop - nop - ljmp __isr_nop - nop - ljmp __isr_nop - nop - ljmp __isr_nop - nop - ljmp __isr_nop - nop - - -;;; ---------------------------------------------------------------- -;;; the USB autovector. 32 4-byte entries. -;;; must start on a 256 byte boundary. -;;; ---------------------------------------------------------------- - - . = __reset_vector + 0x0100 - -__usb_autovector:: - ljmp __isr_nop - nop - ljmp __isr_nop - nop - ljmp __isr_nop - nop - ljmp __isr_nop - nop - ljmp __isr_nop - nop - ljmp __isr_nop - nop - ljmp __isr_nop - nop - ljmp __isr_nop - nop - ljmp __isr_nop - nop - ljmp __isr_nop - nop - ljmp __isr_nop - nop - ljmp __isr_nop - nop - ljmp __isr_nop - nop - ljmp __isr_nop - nop - ljmp __isr_nop - nop - ljmp __isr_nop - nop - ljmp __isr_nop - nop - ljmp __isr_nop - nop - ljmp __isr_nop - nop - ljmp __isr_nop - nop - ljmp __isr_nop - nop - ljmp __isr_nop - nop - ljmp __isr_nop - nop - ljmp __isr_nop - nop - ljmp __isr_nop - nop - ljmp __isr_nop - nop - ljmp __isr_nop - nop - ljmp __isr_nop - nop - ljmp __isr_nop - nop - ljmp __isr_nop - nop - ljmp __isr_nop - nop - ljmp __isr_nop - nop diff --git a/usrp/firmware/src/usrp2/.gitignore b/usrp/firmware/src/usrp2/.gitignore deleted file mode 100644 index 54a9e9415..000000000 --- a/usrp/firmware/src/usrp2/.gitignore +++ /dev/null @@ -1,20 +0,0 @@ -/*.ihx -/*.lnk -/*.lst -/*.map -/*.mem -/*.rel -/*.rst -/*.sym -/blink_leds.asm -/usrp_common.asm -/command_loop.asm -/fpga.asm -/*.asm -/Makefile -/Makefile.in -/usrp_gpif.c -/usrp_gpif_inline.h -/Makefile.in -/burn-usrp2-eeprom -/burn-usrp4-eeprom diff --git a/usrp/firmware/src/usrp2/Makefile.am b/usrp/firmware/src/usrp2/Makefile.am deleted file mode 100644 index 4402cd636..000000000 --- a/usrp/firmware/src/usrp2/Makefile.am +++ /dev/null @@ -1,171 +0,0 @@ -# -# Copyright 2003,2006 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -firmware2dir = $(prefix)/share/usrp/rev2 -firmware2_DATA = std.ihx - -# we put the same stuff in the rev4 directory -firmware4dir = $(prefix)/share/usrp/rev4 -firmware4_DATA = std.ihx - -EXTRA_DIST = \ - edit-gpif \ - _startup.a51 \ - blink_leds.c \ - board_specific.c \ - check_mdelay.c \ - check_udelay.c \ - eeprom_boot.a51 \ - eeprom_init.c \ - eeprom_io.c \ - eeprom_io.h \ - fpga_load.c \ - fpga_rev2.c \ - fpga_rev2.h \ - gpif.c \ - init_gpif.c \ - spi.c \ - spi.h \ - usb_descriptors.a51 \ - usrp_common.c \ - usrp_common.h \ - usrp_gpif.c \ - usrp_main.c \ - usrp_rev2_regs.h \ - vectors.a51 - - -DEFINES=-DHAVE_USRP2 -FW_INCLUDES=-I$(top_srcdir)/usrp/firmware/include \ - -I$(top_srcdir)/usrp/firmware/src/usrp2 \ - -I$(top_srcdir)/usrp/firmware/src/common \ - -I$(top_builddir)/usrp/firmware/src/common - -# with EA = 0, the FX2 implements a portion of the 8051 "external memory" -# on chip. This memory is mapped like this: -# -# The bottom 8K of memory (0x0000 - 0x1fff) is used for both data and -# code accesses. There's also 512 bytes for data only from 0xe000 - 0xe1ff. -# -# We tell the linker to start the xdata segment at 0x1800, 6K up from -# the bottom. - -MEMOPTS = --code-loc 0x0000 --code-size 0x1800 --xram-loc 0x1800 --xram-size 0x0800 \ - -Wl '-b USBDESCSEG = 0xE000' - -LIBOPTS = -L ../../lib libfx2.lib -LIBDEP = ../../lib/libfx2.lib - -LINKOPTS = $(MEMOPTS) $(LIBOPTS) - -EXECUTABLES = \ - std.ihx \ - blink_leds.ihx \ - check_mdelay.ihx \ - check_udelay.ihx \ - eeprom_boot.ihx - -STARTUP = _startup.rel - -noinst_SCRIPTS = \ - burn-usrp2-eeprom \ - burn-usrp4-eeprom - - -.c.rel: - $(XCC) $(FW_INCLUDES) $(DEFINES) \ - -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< - -.a51.rel: - test -f `basename '$<'` || $(LN_S) '$<' . - test -f ../common/`basename '$<'` -o \ - \! -f `dirname '$<'`/../common/`basename '$<'` \ - || $(LN_S) `dirname '$<'`/../common/`basename '$<'` ../common/`basename '$<'` - $(XAS) `basename '$<'` - - -EEPROM_BOOT_OBJS = eeprom_boot.rel eeprom_init.rel $(STARTUP) - -eeprom_boot.ihx: $(EEPROM_BOOT_OBJS) $(LIBDEP) - $(XCC) $(LINKOPTS) -o $@ $(EEPROM_BOOT_OBJS) - -burn-usrp2-eeprom: eeprom_boot.ihx - $(PYTHON) $(srcdir)/../common/build_eeprom.py -p$(prefix) -r2 eeprom_boot.ihx > $@ - chmod +x $@ - -burn-usrp4-eeprom: eeprom_boot.ihx - $(PYTHON) $(srcdir)/../common/build_eeprom.py -p$(prefix) -r4 eeprom_boot.ihx > $@ - chmod +x $@ - - -BLINK_LEDS_OBJS = blink_leds.rel usrp_common.rel board_specific.rel spi.rel $(STARTUP) - -blink_leds.ihx: $(BLINK_LEDS_OBJS) $(LIBDEP) - $(XCC) $(LINKOPTS) -o $@ $(BLINK_LEDS_OBJS) - - -CHECK_MDELAY_OBJS = check_mdelay.rel usrp_common.rel board_specific.rel spi.rel $(STARTUP) - -check_mdelay.ihx: $(CHECK_MDELAY_OBJS) $(LIBDEP) - $(XCC) $(LINKOPTS) -o $@ $(CHECK_MDELAY_OBJS) - - - -CHECK_UDELAY_OBJS = check_udelay.rel usrp_common.rel board_specific.rel spi.rel $(STARTUP) - -check_udelay.ihx: $(CHECK_UDELAY_OBJS) $(LIBDEP) - $(XCC) $(LINKOPTS) -o $@ $(CHECK_UDELAY_OBJS) - - - -USRP_OBJS = \ - vectors.rel \ - usrp_main.rel usrp_common.rel board_specific.rel \ - fpga_load.rel fpga_rev2.rel init_gpif.rel usrp_gpif.rel \ - usb_descriptors.rel spi.rel eeprom_io.rel $(STARTUP) - -std.ihx: $(USRP_OBJS) $(LIBDEP) - $(XCC) $(LINKOPTS) -o $@ $(USRP_OBJS) - -CLEANFILES = \ - *.ihx *.lnk *.lst *.map *.mem *.rel *.rst *.sym *.asm *.lib \ - usrp_gpif.c usrp_gpif_inline.h \ - burn-usrp2-eeprom \ - burn-usrp4-eeprom - -DISTCLEANFILES = \ - *.ihx *.lnk *.lst *.map *.mem *.rel *.rst *.sym *.asm *.lib - -# build gpif stuff - -all: usrp_gpif.c - -usrp_gpif.c usrp_gpif_inline.h : gpif.c - srcdir=$(srcdir) $(PYTHON) $(srcdir)/edit-gpif $(srcdir)/gpif.c usrp_gpif.c usrp_gpif_inline.h - - -# dependencies - -usrp_main.rel: usrp_gpif_inline.h -#usrp_main.rel: fpga.h usrp_common.h ../../include/usrp_commands.h usrp_gpif_inline.h ../../include/usrp_config.h usrp_rev2_regs.h ../../include/fx2regs.h -#usrp_common.rel: usrp_common.h ../../include/usrp_commands.h ../../include/usrp_config.h usrp_rev2_regs.h ../../include/fx2regs.h -#fpga.rel: usrp_common.h ../../include/usrp_commands.h fpga.h ../../include/usrp_config.h usrp_rev2_regs.h ../../include/fx2regs.h -#init_gpif.rel: usrp_common.h ../../include/usrp_config.h usrp_rev2_regs.h ../../include/fx2regs.h diff --git a/usrp/firmware/src/usrp2/_startup.a51 b/usrp/firmware/src/usrp2/_startup.a51 deleted file mode 100644 index 4f5309922..000000000 --- a/usrp/firmware/src/usrp2/_startup.a51 +++ /dev/null @@ -1 +0,0 @@ - .include "../common/_startup.a51" diff --git a/usrp/firmware/src/usrp2/blink_leds.c b/usrp/firmware/src/usrp2/blink_leds.c deleted file mode 100644 index c633d5d48..000000000 --- a/usrp/firmware/src/usrp2/blink_leds.c +++ /dev/null @@ -1 +0,0 @@ -#include "../common/blink_leds.c" diff --git a/usrp/firmware/src/usrp2/board_specific.c b/usrp/firmware/src/usrp2/board_specific.c deleted file mode 100644 index ef0081d84..000000000 --- a/usrp/firmware/src/usrp2/board_specific.c +++ /dev/null @@ -1,113 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include "usrp_common.h" -#include "spi.h" - -void -set_led_0 (unsigned char on) -{ - if (!on) // active low - USRP_PC |= bmPC_LED0; - else - USRP_PC &= ~bmPC_LED0; -} - -void -set_led_1 (unsigned char on) -{ - if (!on) // active low - USRP_PC |= bmPC_LED1; - else - USRP_PC &= ~bmPC_LED1; -} - -void -toggle_led_0 (void) -{ - USRP_PC ^= bmPC_LED0; -} - -void -toggle_led_1 (void) -{ - USRP_PC ^= bmPC_LED1; -} - -void -la_trace_init (void) -{ -} - -void -set_sleep_bits (unsigned char bits, unsigned char mask) -{ - // NOP on usrp1 -} - -static xdata unsigned char xbuf[1]; - -void -write_9862 (unsigned char which, unsigned char regno, unsigned char value) -{ - xbuf[0] = value; - - spi_write (0, regno & 0x3f, - which == 0 ? SPI_ENABLE_CODEC_A : SPI_ENABLE_CODEC_B, - SPI_FMT_MSB | SPI_FMT_HDR_1, - xbuf, 1); -} - -void -write_both_9862s (unsigned char regno, unsigned char value) -{ - xbuf[0] = value; - - spi_write (0, regno & 0x3f, - SPI_ENABLE_CODEC_A | SPI_ENABLE_CODEC_B, - SPI_FMT_MSB | SPI_FMT_HDR_1, - xbuf, 1); -} - -#define REG_RX_PWR_DN 1 -#define REG_TX_PWR_DN 8 -#define REG_TX_MODULATOR 20 - -static void -power_down_9862s (void) -{ - write_both_9862s (REG_RX_PWR_DN, 0x01); - write_both_9862s (REG_TX_PWR_DN, 0x0f); // pwr dn digital and analog_both - write_both_9862s (REG_TX_MODULATOR, 0x00); // coarse & fine modulators disabled -} - -void -init_board (void) -{ - la_trace_init (); - init_spi (); - - USRP_PC &= ~bmPC_nRESET; // active low reset - USRP_PC |= bmPC_nRESET; - - power_down_9862s (); -} diff --git a/usrp/firmware/src/usrp2/check_mdelay.c b/usrp/firmware/src/usrp2/check_mdelay.c deleted file mode 100644 index ea4ccdb14..000000000 --- a/usrp/firmware/src/usrp2/check_mdelay.c +++ /dev/null @@ -1 +0,0 @@ -#include "../common/check_mdelay.c" diff --git a/usrp/firmware/src/usrp2/check_udelay.c b/usrp/firmware/src/usrp2/check_udelay.c deleted file mode 100644 index d01622e5e..000000000 --- a/usrp/firmware/src/usrp2/check_udelay.c +++ /dev/null @@ -1 +0,0 @@ -#include "../common/check_udelay.c" diff --git a/usrp/firmware/src/usrp2/edit-gpif b/usrp/firmware/src/usrp2/edit-gpif deleted file mode 100755 index 5367b75a5..000000000 --- a/usrp/firmware/src/usrp2/edit-gpif +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/env python -# -*- Python -*- -# -# Copyright 2003 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - - -# Edit the gpif.c file generated by the Cypress GPIF Designer Tool and -# produce usrp_gpif.c, and usrp_gpif_inline.h, files suitable for our -# uses. - -import re -import string -import sys - -def check_flow_state (line, flow_state_dict): - mo = re.match (r'/\* Wave (\d) FlowStates \*/ (.*),', line) - if mo: - wave = int (mo.group (1)) - data = mo.group (2) - split = data.split (',', 8) - v = map (lambda x : int (x, 16), split) - # print "%s, %s" % (wave, data) - # print "split: ", split - # print "v : ", v - flow_state_dict[wave] = v - - -def delta (xseq, yseq): - # set subtraction - z = [] - for x in xseq: - if x not in yseq: - z.append (x) - return z - - -def write_define (output, name, pairs): - output.write ('#define %s()\t\\\n' % name) - output.write ('do {\t\t\t\t\t\\\n') - for reg, val in pairs: - output.write ('%14s = 0x%02x;\t\t\t\\\n' % (reg, val)) - output.write ('} while (0)\n\n') - -def write_inlines (output, dict): - regs = ['FLOWSTATE', 'FLOWLOGIC', 'FLOWEQ0CTL', 'FLOWEQ1CTL', 'FLOWHOLDOFF', - 'FLOWSTB', 'FLOWSTBEDGE', 'FLOWSTBHPERIOD', 'GPIFHOLDAMOUNT'] - - READ_FLOW_STATE = 2 - WRITE_FLOW_STATE = 3 - - read_info = zip (regs, dict[READ_FLOW_STATE]) - write_info = zip (regs, dict[WRITE_FLOW_STATE]) - - output.write ('''/* - * Machine generated by "edit-gpif". Do not edit by hand. - */ - -''') - write_define (output, 'setup_flowstate_common', read_info) - write_define (output, 'setup_flowstate_read', delta (read_info, write_info)) - write_define (output, 'setup_flowstate_write', delta (write_info, read_info)) - - -def edit_gpif (input_name, output_name, inline_name): - input = open (input_name, 'r') - output = open (output_name, 'w') - inline = open (inline_name, 'w') - flow_state_dict = {} - - output.write ('''/* - * Machine generated by "edit-gpif". Do not edit by hand. - */ - -''') - - while 1: - line = input.readline () - line = string.replace (line, '\r','') - line = re.sub (r' *$', r'', line) - - check_flow_state (line, flow_state_dict) - - line = re.sub (r'#include', r'// #include', line) - line = re.sub (r'xdata ', r'', line) - if re.search (r'GpifInit', line): - break - - output.write (line) - - output.close () - write_inlines (inline, flow_state_dict) - inline.close () - - -# gpif.c usrp_gpif.c usrp_gpif_inline.h -edit_gpif (sys.argv[1], sys.argv[2], sys.argv[3]) diff --git a/usrp/firmware/src/usrp2/eeprom_boot.a51 b/usrp/firmware/src/usrp2/eeprom_boot.a51 deleted file mode 100644 index 65e452668..000000000 --- a/usrp/firmware/src/usrp2/eeprom_boot.a51 +++ /dev/null @@ -1,573 +0,0 @@ -;-------------------------------------------------------- -; Hand tweaked minimal eeprom boot code -;-------------------------------------------------------- - .module eeprom_boot - .optsdcc -mmcs51 --model-small - -;-------------------------------------------------------- -; Public variables in this module -;-------------------------------------------------------- - .globl _eeprom_init - .globl _EP8FIFOBUF - .globl _EP6FIFOBUF - .globl _EP4FIFOBUF - .globl _EP2FIFOBUF - .globl _EP1INBUF - .globl _EP1OUTBUF - .globl _EP0BUF - .globl _CT4 - .globl _CT3 - .globl _CT2 - .globl _CT1 - .globl _USBTEST - .globl _TESTCFG - .globl _DBUG - .globl _UDMACRCQUAL - .globl _UDMACRCL - .globl _UDMACRCH - .globl _GPIFHOLDAMOUNT - .globl _FLOWSTBHPERIOD - .globl _FLOWSTBEDGE - .globl _FLOWSTB - .globl _FLOWHOLDOFF - .globl _FLOWEQ1CTL - .globl _FLOWEQ0CTL - .globl _FLOWLOGIC - .globl _FLOWSTATE - .globl _GPIFABORT - .globl _GPIFREADYSTAT - .globl _GPIFREADYCFG - .globl _XGPIFSGLDATLNOX - .globl _XGPIFSGLDATLX - .globl _XGPIFSGLDATH - .globl _EP8GPIFTRIG - .globl _EP8GPIFPFSTOP - .globl _EP8GPIFFLGSEL - .globl _EP6GPIFTRIG - .globl _EP6GPIFPFSTOP - .globl _EP6GPIFFLGSEL - .globl _EP4GPIFTRIG - .globl _EP4GPIFPFSTOP - .globl _EP4GPIFFLGSEL - .globl _EP2GPIFTRIG - .globl _EP2GPIFPFSTOP - .globl _EP2GPIFFLGSEL - .globl _GPIFTCB0 - .globl _GPIFTCB1 - .globl _GPIFTCB2 - .globl _GPIFTCB3 - .globl _GPIFADRL - .globl _GPIFADRH - .globl _GPIFCTLCFG - .globl _GPIFIDLECTL - .globl _GPIFIDLECS - .globl _GPIFWFSELECT - .globl _SETUPDAT - .globl _SUDPTRCTL - .globl _SUDPTRL - .globl _SUDPTRH - .globl _EP8FIFOBCL - .globl _EP8FIFOBCH - .globl _EP6FIFOBCL - .globl _EP6FIFOBCH - .globl _EP4FIFOBCL - .globl _EP4FIFOBCH - .globl _EP2FIFOBCL - .globl _EP2FIFOBCH - .globl _EP8FIFOFLGS - .globl _EP6FIFOFLGS - .globl _EP4FIFOFLGS - .globl _EP2FIFOFLGS - .globl _EP8CS - .globl _EP6CS - .globl _EP4CS - .globl _EP2CS - .globl _EP1INCS - .globl _EP1OUTCS - .globl _EP0CS - .globl _EP8BCL - .globl _EP8BCH - .globl _EP6BCL - .globl _EP6BCH - .globl _EP4BCL - .globl _EP4BCH - .globl _EP2BCL - .globl _EP2BCH - .globl _EP1INBC - .globl _EP1OUTBC - .globl _EP0BCL - .globl _EP0BCH - .globl _FNADDR - .globl _MICROFRAME - .globl _USBFRAMEL - .globl _USBFRAMEH - .globl _TOGCTL - .globl _WAKEUPCS - .globl _SUSPEND - .globl _USBCS - .globl _XAUTODAT2 - .globl _XAUTODAT1 - .globl _I2CTL - .globl _I2DAT - .globl _I2CS - .globl _PORTECFG - .globl _PORTCCFG - .globl _PORTACFG - .globl _INTSETUP - .globl _INT4IVEC - .globl _INT2IVEC - .globl _CLRERRCNT - .globl _ERRCNTLIM - .globl _USBERRIRQ - .globl _USBERRIE - .globl _GPIFIRQ - .globl _GPIFIE - .globl _EPIRQ - .globl _EPIE - .globl _USBIRQ - .globl _USBIE - .globl _NAKIRQ - .globl _NAKIE - .globl _IBNIRQ - .globl _IBNIE - .globl _EP8FIFOIRQ - .globl _EP8FIFOIE - .globl _EP6FIFOIRQ - .globl _EP6FIFOIE - .globl _EP4FIFOIRQ - .globl _EP4FIFOIE - .globl _EP2FIFOIRQ - .globl _EP2FIFOIE - .globl _OUTPKTEND - .globl _INPKTEND - .globl _EP8ISOINPKTS - .globl _EP6ISOINPKTS - .globl _EP4ISOINPKTS - .globl _EP2ISOINPKTS - .globl _EP8FIFOPFL - .globl _EP8FIFOPFH - .globl _EP6FIFOPFL - .globl _EP6FIFOPFH - .globl _EP4FIFOPFL - .globl _EP4FIFOPFH - .globl _EP2FIFOPFL - .globl _EP2FIFOPFH - .globl _EP8AUTOINLENL - .globl _EP8AUTOINLENH - .globl _EP6AUTOINLENL - .globl _EP6AUTOINLENH - .globl _EP4AUTOINLENL - .globl _EP4AUTOINLENH - .globl _EP2AUTOINLENL - .globl _EP2AUTOINLENH - .globl _EP8FIFOCFG - .globl _EP6FIFOCFG - .globl _EP4FIFOCFG - .globl _EP2FIFOCFG - .globl _EP8CFG - .globl _EP6CFG - .globl _EP4CFG - .globl _EP2CFG - .globl _EP1INCFG - .globl _EP1OUTCFG - .globl _REVCTL - .globl _REVID - .globl _FIFOPINPOLAR - .globl _UART230 - .globl _BPADDRL - .globl _BPADDRH - .globl _BREAKPT - .globl _FIFORESET - .globl _PINFLAGSCD - .globl _PINFLAGSAB - .globl _IFCONFIG - .globl _CPUCS - .globl _RES_WAVEDATA_END - .globl _GPIF_WAVE_DATA -;-------------------------------------------------------- -; special function registers -;-------------------------------------------------------- -_IOA = 0x0080 -_SP = 0x0081 -_DPL = 0x0082 -_DPH = 0x0083 -_DPL1 = 0x0084 -_DPH1 = 0x0085 -_DPS = 0x0086 -_PCON = 0x0087 -_TCON = 0x0088 -_TMOD = 0x0089 -_TL0 = 0x008a -_TL1 = 0x008b -_TH0 = 0x008c -_TH1 = 0x008d -_CKCON = 0x008e -_IOB = 0x0090 -_EXIF = 0x0091 -_MPAGE = 0x0092 -_SCON0 = 0x0098 -_SBUF0 = 0x0099 -_APTR1H = 0x009a -_APTR1L = 0x009b -_AUTODAT1 = 0x009c -_AUTOPTRH2 = 0x009d -_AUTOPTRL2 = 0x009e -_AUTODAT2 = 0x009f -_IOC = 0x00a0 -_INT2CLR = 0x00a1 -_INT4CLR = 0x00a2 -_IE = 0x00a8 -_EP2468STAT = 0x00aa -_EP24FIFOFLGS = 0x00ab -_EP68FIFOFLGS = 0x00ac -_AUTOPTRSETUP = 0x00af -_IOD = 0x00b0 -_IOE = 0x00b1 -_OEA = 0x00b2 -_OEB = 0x00b3 -_OEC = 0x00b4 -_OED = 0x00b5 -_OEE = 0x00b6 -_IP = 0x00b8 -_EP01STAT = 0x00ba -_GPIFTRIG = 0x00bb -_GPIFSGLDATH = 0x00bd -_GPIFSGLDATLX = 0x00be -_GPIFSGLDATLNOX = 0x00bf -_SCON1 = 0x00c0 -_SBUF1 = 0x00c1 -_T2CON = 0x00c8 -_RCAP2L = 0x00ca -_RCAP2H = 0x00cb -_TL2 = 0x00cc -_TH2 = 0x00cd -_PSW = 0x00d0 -_EICON = 0x00d8 -_ACC = 0x00e0 -_EIE = 0x00e8 -_B = 0x00f0 -_EIP = 0x00f8 -;-------------------------------------------------------- -; special function bits -;-------------------------------------------------------- -_SEL = 0x0086 -_IT0 = 0x0088 -_IE0 = 0x0089 -_IT1 = 0x008a -_IE1 = 0x008b -_TR0 = 0x008c -_TF0 = 0x008d -_TR1 = 0x008e -_TF1 = 0x008f -_RI = 0x0098 -_TI = 0x0099 -_RB8 = 0x009a -_TB8 = 0x009b -_REN = 0x009c -_SM2 = 0x009d -_SM1 = 0x009e -_SM0 = 0x009f -_EX0 = 0x00a8 -_ET0 = 0x00a9 -_EX1 = 0x00aa -_ET1 = 0x00ab -_ES0 = 0x00ac -_ET2 = 0x00ad -_ES1 = 0x00ae -_EA = 0x00af -_PX0 = 0x00b8 -_PT0 = 0x00b9 -_PX1 = 0x00ba -_PT1 = 0x00bb -_PS0 = 0x00bc -_PT2 = 0x00bd -_PS1 = 0x00be -_RI1 = 0x00c0 -_TI1 = 0x00c1 -_RB81 = 0x00c2 -_TB81 = 0x00c3 -_REN1 = 0x00c4 -_SM21 = 0x00c5 -_SM11 = 0x00c6 -_SM01 = 0x00c7 -_CP_RL2 = 0x00c8 -_C_T2 = 0x00c9 -_TR2 = 0x00ca -_EXEN2 = 0x00cb -_TCLK = 0x00cc -_RCLK = 0x00cd -_EXF2 = 0x00ce -_TF2 = 0x00cf -_P = 0x00d0 -_FL = 0x00d1 -_OV = 0x00d2 -_RS0 = 0x00d3 -_RS1 = 0x00d4 -_F0 = 0x00d5 -_AC = 0x00d6 -_CY = 0x00d7 -_INT6 = 0x00db -_RESI = 0x00dc -_ERESI = 0x00dd -_SMOD1 = 0x00df -_EIUSB = 0x00e8 -_EI2C = 0x00e9 -_EIEX4 = 0x00ea -_EIEX5 = 0x00eb -_EIEX6 = 0x00ec -_PUSB = 0x00f8 -_PI2C = 0x00f9 -_EIPX4 = 0x00fa -_EIPX5 = 0x00fb -_EIPX6 = 0x00fc -_bitS_CLK = 0x0080 -_bitS_OUT = 0x0081 -_bitS_IN = 0x0082 -_bitALTERA_DATA0 = 0x00a1 -_bitALTERA_DCLK = 0x00a3 -;-------------------------------------------------------- -; overlayable register banks -;-------------------------------------------------------- - .area REG_BANK_0 (REL,OVR,DATA) - .ds 8 -;-------------------------------------------------------- -; internal ram data -;-------------------------------------------------------- - .area DSEG (DATA) -;-------------------------------------------------------- -; overlayable items in internal ram -;-------------------------------------------------------- - .area OSEG (OVR,DATA) -;-------------------------------------------------------- -; Stack segment in internal ram -;-------------------------------------------------------- - .area SSEG (DATA) -__start__stack: - .ds 1 - -;-------------------------------------------------------- -; indirectly addressable internal ram data -;-------------------------------------------------------- - .area ISEG (DATA) -;-------------------------------------------------------- -; bit data -;-------------------------------------------------------- - .area BSEG (BIT) -;-------------------------------------------------------- -; external ram data -;-------------------------------------------------------- - .area XSEG (XDATA) -_GPIF_WAVE_DATA = 0xe400 -_RES_WAVEDATA_END = 0xe480 -_CPUCS = 0xe600 -_IFCONFIG = 0xe601 -_PINFLAGSAB = 0xe602 -_PINFLAGSCD = 0xe603 -_FIFORESET = 0xe604 -_BREAKPT = 0xe605 -_BPADDRH = 0xe606 -_BPADDRL = 0xe607 -_UART230 = 0xe608 -_FIFOPINPOLAR = 0xe609 -_REVID = 0xe60a -_REVCTL = 0xe60b -_EP1OUTCFG = 0xe610 -_EP1INCFG = 0xe611 -_EP2CFG = 0xe612 -_EP4CFG = 0xe613 -_EP6CFG = 0xe614 -_EP8CFG = 0xe615 -_EP2FIFOCFG = 0xe618 -_EP4FIFOCFG = 0xe619 -_EP6FIFOCFG = 0xe61a -_EP8FIFOCFG = 0xe61b -_EP2AUTOINLENH = 0xe620 -_EP2AUTOINLENL = 0xe621 -_EP4AUTOINLENH = 0xe622 -_EP4AUTOINLENL = 0xe623 -_EP6AUTOINLENH = 0xe624 -_EP6AUTOINLENL = 0xe625 -_EP8AUTOINLENH = 0xe626 -_EP8AUTOINLENL = 0xe627 -_EP2FIFOPFH = 0xe630 -_EP2FIFOPFL = 0xe631 -_EP4FIFOPFH = 0xe632 -_EP4FIFOPFL = 0xe633 -_EP6FIFOPFH = 0xe634 -_EP6FIFOPFL = 0xe635 -_EP8FIFOPFH = 0xe636 -_EP8FIFOPFL = 0xe637 -_EP2ISOINPKTS = 0xe640 -_EP4ISOINPKTS = 0xe641 -_EP6ISOINPKTS = 0xe642 -_EP8ISOINPKTS = 0xe643 -_INPKTEND = 0xe648 -_OUTPKTEND = 0xe649 -_EP2FIFOIE = 0xe650 -_EP2FIFOIRQ = 0xe651 -_EP4FIFOIE = 0xe652 -_EP4FIFOIRQ = 0xe653 -_EP6FIFOIE = 0xe654 -_EP6FIFOIRQ = 0xe655 -_EP8FIFOIE = 0xe656 -_EP8FIFOIRQ = 0xe657 -_IBNIE = 0xe658 -_IBNIRQ = 0xe659 -_NAKIE = 0xe65a -_NAKIRQ = 0xe65b -_USBIE = 0xe65c -_USBIRQ = 0xe65d -_EPIE = 0xe65e -_EPIRQ = 0xe65f -_GPIFIE = 0xe660 -_GPIFIRQ = 0xe661 -_USBERRIE = 0xe662 -_USBERRIRQ = 0xe663 -_ERRCNTLIM = 0xe664 -_CLRERRCNT = 0xe665 -_INT2IVEC = 0xe666 -_INT4IVEC = 0xe667 -_INTSETUP = 0xe668 -_PORTACFG = 0xe670 -_PORTCCFG = 0xe671 -_PORTECFG = 0xe672 -_I2CS = 0xe678 -_I2DAT = 0xe679 -_I2CTL = 0xe67a -_XAUTODAT1 = 0xe67b -_XAUTODAT2 = 0xe67c -_USBCS = 0xe680 -_SUSPEND = 0xe681 -_WAKEUPCS = 0xe682 -_TOGCTL = 0xe683 -_USBFRAMEH = 0xe684 -_USBFRAMEL = 0xe685 -_MICROFRAME = 0xe686 -_FNADDR = 0xe687 -_EP0BCH = 0xe68a -_EP0BCL = 0xe68b -_EP1OUTBC = 0xe68d -_EP1INBC = 0xe68f -_EP2BCH = 0xe690 -_EP2BCL = 0xe691 -_EP4BCH = 0xe694 -_EP4BCL = 0xe695 -_EP6BCH = 0xe698 -_EP6BCL = 0xe699 -_EP8BCH = 0xe69c -_EP8BCL = 0xe69d -_EP0CS = 0xe6a0 -_EP1OUTCS = 0xe6a1 -_EP1INCS = 0xe6a2 -_EP2CS = 0xe6a3 -_EP4CS = 0xe6a4 -_EP6CS = 0xe6a5 -_EP8CS = 0xe6a6 -_EP2FIFOFLGS = 0xe6a7 -_EP4FIFOFLGS = 0xe6a8 -_EP6FIFOFLGS = 0xe6a9 -_EP8FIFOFLGS = 0xe6aa -_EP2FIFOBCH = 0xe6ab -_EP2FIFOBCL = 0xe6ac -_EP4FIFOBCH = 0xe6ad -_EP4FIFOBCL = 0xe6ae -_EP6FIFOBCH = 0xe6af -_EP6FIFOBCL = 0xe6b0 -_EP8FIFOBCH = 0xe6b1 -_EP8FIFOBCL = 0xe6b2 -_SUDPTRH = 0xe6b3 -_SUDPTRL = 0xe6b4 -_SUDPTRCTL = 0xe6b5 -_SETUPDAT = 0xe6b8 -_GPIFWFSELECT = 0xe6c0 -_GPIFIDLECS = 0xe6c1 -_GPIFIDLECTL = 0xe6c2 -_GPIFCTLCFG = 0xe6c3 -_GPIFADRH = 0xe6c4 -_GPIFADRL = 0xe6c5 -_GPIFTCB3 = 0xe6ce -_GPIFTCB2 = 0xe6cf -_GPIFTCB1 = 0xe6d0 -_GPIFTCB0 = 0xe6d1 -_EP2GPIFFLGSEL = 0xe6d2 -_EP2GPIFPFSTOP = 0xe6d3 -_EP2GPIFTRIG = 0xe6d4 -_EP4GPIFFLGSEL = 0xe6da -_EP4GPIFPFSTOP = 0xe6db -_EP4GPIFTRIG = 0xe6dc -_EP6GPIFFLGSEL = 0xe6e2 -_EP6GPIFPFSTOP = 0xe6e3 -_EP6GPIFTRIG = 0xe6e4 -_EP8GPIFFLGSEL = 0xe6ea -_EP8GPIFPFSTOP = 0xe6eb -_EP8GPIFTRIG = 0xe6ec -_XGPIFSGLDATH = 0xe6f0 -_XGPIFSGLDATLX = 0xe6f1 -_XGPIFSGLDATLNOX = 0xe6f2 -_GPIFREADYCFG = 0xe6f3 -_GPIFREADYSTAT = 0xe6f4 -_GPIFABORT = 0xe6f5 -_FLOWSTATE = 0xe6c6 -_FLOWLOGIC = 0xe6c7 -_FLOWEQ0CTL = 0xe6c8 -_FLOWEQ1CTL = 0xe6c9 -_FLOWHOLDOFF = 0xe6ca -_FLOWSTB = 0xe6cb -_FLOWSTBEDGE = 0xe6cc -_FLOWSTBHPERIOD = 0xe6cd -_GPIFHOLDAMOUNT = 0xe60c -_UDMACRCH = 0xe67d -_UDMACRCL = 0xe67e -_UDMACRCQUAL = 0xe67f -_DBUG = 0xe6f8 -_TESTCFG = 0xe6f9 -_USBTEST = 0xe6fa -_CT1 = 0xe6fb -_CT2 = 0xe6fc -_CT3 = 0xe6fd -_CT4 = 0xe6fe -_EP0BUF = 0xe740 -_EP1OUTBUF = 0xe780 -_EP1INBUF = 0xe7c0 -_EP2FIFOBUF = 0xf000 -_EP4FIFOBUF = 0xf400 -_EP6FIFOBUF = 0xf800 -_EP8FIFOBUF = 0xfc00 -;-------------------------------------------------------- -; external initialized ram data -;-------------------------------------------------------- -;-------------------------------------------------------- -; interrupt vector -;-------------------------------------------------------- - .area CSEG (CODE) -__interrupt_vect: - ljmp __sdcc_gsinit_startup -;-------------------------------------------------------- -; global & static initialisations -;-------------------------------------------------------- - .area GSINIT (CODE) - .area GSFINAL (CODE) - .area GSINIT (CODE) -__sdcc_gsinit_startup: - mov sp,#__start__stack - 1 - lcall __sdcc_external_startup - mov a,dpl - jz __sdcc_init_data - ljmp __sdcc_program_startup -__sdcc_init_data: - .area GSFINAL (CODE) - ljmp __sdcc_program_startup -;-------------------------------------------------------- -; Home -;-------------------------------------------------------- - .area HOME (CODE) - .area CSEG (CODE) -;-------------------------------------------------------- -; code -;-------------------------------------------------------- - .area CSEG (CODE) -__sdcc_program_startup: - lcall _eeprom_init -; return from _eeprom_init will spin here - sjmp . - .area CSEG (CODE) diff --git a/usrp/firmware/src/usrp2/eeprom_init.c b/usrp/firmware/src/usrp2/eeprom_init.c deleted file mode 100644 index a6f6cbe2d..000000000 --- a/usrp/firmware/src/usrp2/eeprom_init.c +++ /dev/null @@ -1,116 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include "usrp_common.h" -#include "usrp_commands.h" -#include "spi.h" - -/* - * the host side fpga loader code pushes an MD5 hash of the bitstream - * into hash1. - */ -#define USRP_HASH_SIZE 16 -xdata at USRP_HASH_SLOT_0_ADDR unsigned char hash0[USRP_HASH_SIZE]; - - -#define enable_codecs() USRP_PA &= ~(bmPA_SEN_CODEC_A | bmPA_SEN_CODEC_B) -#define disable_all() USRP_PA |= (bmPA_SEN_CODEC_A | bmPA_SEN_CODEC_B) - -static void -write_byte_msb (unsigned char v); - -void -write_both_9862s (unsigned char header_lo, unsigned char v) -{ - enable_codecs (); - - write_byte_msb (header_lo); - write_byte_msb (v); - - disable_all (); -} - -// ---------------------------------------------------------------- - -static void -write_byte_msb (unsigned char v) -{ - unsigned char n = 8; - do { - v = (v << 1) | (v >> 7); // rotate left (MSB into bottom bit) - bitS_OUT = v & 0x1; - bitS_CLK = 1; - bitS_CLK = 0; - } while (--n != 0); -} - -// ---------------------------------------------------------------- - -#define REG_RX_PWR_DN 1 -#define REG_TX_PWR_DN 8 -#define REG_TX_MODULATOR 20 - -void eeprom_init (void) -{ - unsigned short counter; - unsigned char i; - - // configure IO ports (B and D are used by GPIF) - - IOA = bmPORT_A_INITIAL; // Port A initial state - OEA = bmPORT_A_OUTPUTS; // Port A direction register - - IOC = bmPORT_C_INITIAL; // Port C initial state - OEC = bmPORT_C_OUTPUTS; // Port C direction register - - IOE = bmPORT_E_INITIAL; // Port E initial state - OEE = bmPORT_E_OUTPUTS; // Port E direction register - - EP0BCH = 0; SYNCDELAY; - - // USBCS &= ~bmRENUM; // chip firmware handles commands - USBCS = 0; // chip firmware handles commands - - USRP_PC &= ~bmPC_nRESET; // active low reset - USRP_PC |= bmPC_nRESET; - - // init_spi (); - bitS_OUT = 0; /* idle state has CLK = 0 */ - - write_both_9862s (REG_RX_PWR_DN, 0x01); - write_both_9862s (REG_TX_PWR_DN, 0x0f); // pwr dn digital and analog_both - write_both_9862s (REG_TX_MODULATOR, 0x00); // coarse & fine modulators disabled - - // zero firmware hash slot - i = 0; - do { - hash0[i] = 0; - i++; - } while (i != USRP_HASH_SIZE); - - counter = 0; - while (1){ - counter++; - if (counter & 0x8000) - IOC ^= bmPC_LED0; - } -} diff --git a/usrp/firmware/src/usrp2/eeprom_io.c b/usrp/firmware/src/usrp2/eeprom_io.c deleted file mode 100644 index 9eeb53636..000000000 --- a/usrp/firmware/src/usrp2/eeprom_io.c +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include "eeprom_io.h" -#include "i2c.h" -#include "delay.h" - -// returns non-zero if successful, else 0 -unsigned char -eeprom_read (unsigned char i2c_addr, unsigned char eeprom_offset, - xdata unsigned char *buf, unsigned char len) -{ - // We setup a random read by first doing a "zero byte write". - // Writes carry an address. Reads use an implicit address. - - static xdata unsigned char cmd[1]; - cmd[0] = eeprom_offset; - if (!i2c_write(i2c_addr, cmd, 1)) - return 0; - - return i2c_read(i2c_addr, buf, len); -} - - -#if 0 - -// returns non-zero if successful, else 0 -unsigned char -eeprom_write (unsigned char i2c_addr, unsigned char eeprom_offset, - const xdata unsigned char *buf, unsigned char len) -{ - static xdata unsigned char cmd[2]; - unsigned char ok; - - while (len-- > 0){ - cmd[0] = eeprom_offset++; - cmd[1] = *buf++; - ok = i2c_write(i2c_addr, cmd, 2); - mdelay(10); // delay 10ms worst case write time - if (!ok) - return 0; - } - return 1; -} - -#endif diff --git a/usrp/firmware/src/usrp2/eeprom_io.h b/usrp/firmware/src/usrp2/eeprom_io.h deleted file mode 100644 index 558017b12..000000000 --- a/usrp/firmware/src/usrp2/eeprom_io.h +++ /dev/null @@ -1,38 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_EEPROM_IO_H -#define INCLUDED_EEPROM_IO_H - - -// returns non-zero if successful, else 0 -unsigned char -eeprom_read (unsigned char i2c_addr, unsigned char eeprom_offset, - xdata unsigned char *buf, unsigned char len); - -// returns non-zero if successful, else 0 -unsigned char -eeprom_write (unsigned char i2c_addr, unsigned char eeprom_offset, - const xdata unsigned char *buf, unsigned char len); - - -#endif /* INCLUDED_EEPROM_IO_H */ diff --git a/usrp/firmware/src/usrp2/fpga_load.c b/usrp/firmware/src/usrp2/fpga_load.c deleted file mode 100644 index b0256e925..000000000 --- a/usrp/firmware/src/usrp2/fpga_load.c +++ /dev/null @@ -1 +0,0 @@ -#include "../common/fpga_load.c" diff --git a/usrp/firmware/src/usrp2/fpga_rev2.c b/usrp/firmware/src/usrp2/fpga_rev2.c deleted file mode 100644 index cca961dc4..000000000 --- a/usrp/firmware/src/usrp2/fpga_rev2.c +++ /dev/null @@ -1,122 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include "fpga.h" -#include "fpga_regs_common.h" -#include "usrp_common.h" -#include "usrp_globals.h" -#include "spi.h" - -unsigned char g_tx_reset = 0; -unsigned char g_rx_reset = 0; - -void -fpga_write_reg (unsigned char regno, const xdata unsigned char *regval) -{ - spi_write (0, 0x00 | (regno & 0x7f), - SPI_ENABLE_FPGA, - SPI_FMT_MSB | SPI_FMT_HDR_1, - regval, 4); -} - - -static xdata unsigned char regval[4] = {0, 0, 0, 0}; - -static void -write_fpga_master_ctrl (void) -{ - unsigned char v = 0; - if (g_tx_enable) - v |= bmFR_MC_ENABLE_TX; - if (g_rx_enable) - v |= bmFR_MC_ENABLE_RX; - if (g_tx_reset) - v |= bmFR_MC_RESET_TX; - if (g_rx_reset) - v |= bmFR_MC_RESET_RX; - regval[3] = v; - - fpga_write_reg (FR_MASTER_CTRL, regval); -} - -// Resets both AD9862's and the FPGA serial bus interface. - -void -fpga_set_reset (unsigned char on) -{ - on &= 0x1; - - if (on){ - USRP_PC &= ~bmPC_nRESET; // active low - g_tx_enable = 0; - g_rx_enable = 0; - g_tx_reset = 0; - g_rx_reset = 0; - } - else - USRP_PC |= bmPC_nRESET; -} - -void -fpga_set_tx_enable (unsigned char on) -{ - on &= 0x1; - g_tx_enable = on; - - write_fpga_master_ctrl (); - - if (on){ - g_tx_underrun = 0; - fpga_clear_flags (); - } -} - -void -fpga_set_rx_enable (unsigned char on) -{ - on &= 0x1; - g_rx_enable = on; - - write_fpga_master_ctrl (); - if (on){ - g_rx_overrun = 0; - fpga_clear_flags (); - } -} - -void -fpga_set_tx_reset (unsigned char on) -{ - on &= 0x1; - g_tx_reset = on; - - write_fpga_master_ctrl (); -} - -void -fpga_set_rx_reset (unsigned char on) -{ - on &= 0x1; - g_rx_reset = on; - - write_fpga_master_ctrl (); -} diff --git a/usrp/firmware/src/usrp2/fpga_rev2.h b/usrp/firmware/src/usrp2/fpga_rev2.h deleted file mode 100644 index 54ec3f9fa..000000000 --- a/usrp/firmware/src/usrp2/fpga_rev2.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * USRP - Universal Software Radio Peripheral - * - * Copyright (C) 2003,2004 Free Software Foundation, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Boston, MA 02110-1301 USA - */ - -#ifndef INCLUDED_FPGA_REV1_H -#define INCLUDED_FPGA_REV1_H - -void fpga_set_reset (unsigned char v); -void fpga_set_tx_enable (unsigned char v); -void fpga_set_rx_enable (unsigned char v); -void fpga_set_tx_reset (unsigned char v); -void fpga_set_rx_reset (unsigned char v); - -unsigned char fpga_has_room_for_packet (void); -unsigned char fpga_has_packet_avail (void); - -#if (UC_BOARD_HAS_FPGA) -/* - * return TRUE iff FPGA internal fifo has room for 512 bytes. - */ -#define fpga_has_room_for_packet() (GPIFREADYSTAT & bmFPGA_HAS_SPACE) - -/* - * return TRUE iff FPGA internal fifo has at least 512 bytes available. - */ -#define fpga_has_packet_avail() (GPIFREADYSTAT & bmFPGA_PKT_AVAIL) - -#else /* no FPGA on board. fake it. */ - -#define fpga_has_room_for_packet() TRUE -#define fpga_has_packet_avail() TRUE - -#endif - -#define fpga_clear_flags() \ - do { \ - USRP_PE |= bmPE_FPGA_CLR_STATUS; \ - USRP_PE &= ~bmPE_FPGA_CLR_STATUS; \ - } while (0) - - -#endif /* INCLUDED_FPGA_REV1_H */ diff --git a/usrp/firmware/src/usrp2/gpif.c b/usrp/firmware/src/usrp2/gpif.c deleted file mode 100644 index f6745a43b..000000000 --- a/usrp/firmware/src/usrp2/gpif.c +++ /dev/null @@ -1,292 +0,0 @@ -// This program configures the General Programmable Interface (GPIF) for FX2. -// Please do not modify sections of text which are marked as "DO NOT EDIT ...". -// -// DO NOT EDIT ... -// GPIF Initialization -// Interface Timing Async -// Internal Ready Init IntRdy=1 -// CTL Out Tristate-able Binary -// SingleWrite WF Select 1 -// SingleRead WF Select 0 -// FifoWrite WF Select 3 -// FifoRead WF Select 2 -// Data Bus Idle Drive Tristate -// END DO NOT EDIT - -// DO NOT EDIT ... -// GPIF Wave Names -// Wave 0 = singlerd -// Wave 1 = singlewr -// Wave 2 = FIFORd -// Wave 3 = FIFOWr - -// GPIF Ctrl Outputs Level -// CTL 0 = WEN# CMOS -// CTL 1 = REN# CMOS -// CTL 2 = OE# CMOS -// CTL 3 = CLRST CMOS -// CTL 4 = unused CMOS -// CTL 5 = BOGUS CMOS - -// GPIF Rdy Inputs -// RDY0 = EF# -// RDY1 = FF# -// RDY2 = unused -// RDY3 = unused -// RDY4 = unused -// RDY5 = TCXpire -// FIFOFlag = FIFOFlag -// IntReady = IntReady -// END DO NOT EDIT -// DO NOT EDIT ... -// -// GPIF Waveform 0: singlerd -// -// Interval 0 1 2 3 4 5 6 Idle (7) -// _________ _________ _________ _________ _________ _________ _________ _________ -// -// AddrMode Same Val Same Val Same Val Same Val Same Val Same Val Same Val -// DataMode NO Data NO Data NO Data NO Data NO Data NO Data NO Data -// NextData SameData SameData SameData SameData SameData SameData SameData -// Int Trig No Int No Int No Int No Int No Int No Int No Int -// IF/Wait Wait 1 Wait 1 Wait 1 Wait 1 Wait 1 Wait 1 Wait 1 -// Term A -// LFunc -// Term B -// Branch1 -// Branch0 -// Re-Exec -// Sngl/CRC Default Default Default Default Default Default Default -// WEN# 0 0 0 0 0 0 0 0 -// REN# 0 0 0 0 0 0 0 0 -// OE# 0 0 0 0 0 0 0 0 -// CLRST 0 0 0 0 0 0 0 0 -// unused 0 0 0 0 0 0 0 0 -// BOGUS 0 0 0 0 0 0 0 0 -// -// END DO NOT EDIT -// DO NOT EDIT ... -// -// GPIF Waveform 1: singlewr -// -// Interval 0 1 2 3 4 5 6 Idle (7) -// _________ _________ _________ _________ _________ _________ _________ _________ -// -// AddrMode Same Val Same Val Same Val Same Val Same Val Same Val Same Val -// DataMode Activate Activate Activate Activate Activate Activate Activate -// NextData SameData SameData SameData SameData SameData SameData SameData -// Int Trig No Int No Int No Int No Int No Int No Int No Int -// IF/Wait Wait 1 IF Wait 1 Wait 1 Wait 1 Wait 1 Wait 1 -// Term A EF# -// LFunc AND -// Term B EF# -// Branch1 ThenIdle -// Branch0 ElseIdle -// Re-Exec No -// Sngl/CRC Default Default Default Default Default Default Default -// WEN# 0 1 1 1 1 1 1 0 -// REN# 0 0 0 0 0 0 0 0 -// OE# 0 0 0 0 0 0 0 0 -// CLRST 0 0 0 0 0 0 0 0 -// unused 0 0 0 0 0 0 0 0 -// BOGUS 0 0 0 0 0 0 0 0 -// -// END DO NOT EDIT -// DO NOT EDIT ... -// -// GPIF Waveform 2: FIFORd -// -// Interval 0 1 2 3 4 5 6 Idle (7) -// _________ _________ _________ _________ _________ _________ _________ _________ -// -// AddrMode Same Val Same Val Same Val Same Val Same Val Same Val Same Val -// DataMode NO Data Activate NO Data NO Data NO Data NO Data NO Data -// NextData SameData SameData SameData SameData SameData SameData SameData -// Int Trig No Int No Int No Int No Int No Int No Int No Int -// IF/Wait Wait 1 IF Wait 1 IF Wait 1 Wait 1 Wait 1 -// Term A TCXpire TCXpire -// LFunc AND AND -// Term B TCXpire TCXpire -// Branch1 Then 2 ThenIdle -// Branch0 Else 1 ElseIdle -// Re-Exec No No -// Sngl/CRC Default Default Default Default Default Default Default -// WEN# 0 0 0 0 0 0 0 0 -// REN# 1 0 0 0 0 0 0 0 -// OE# 1 1 1 0 0 0 0 0 -// CLRST 0 0 0 0 0 0 0 0 -// unused 0 0 0 0 0 0 0 0 -// BOGUS 0 0 0 0 0 0 0 0 -// -// END DO NOT EDIT -// DO NOT EDIT ... -// -// GPIF Waveform 3: FIFOWr -// -// Interval 0 1 2 3 4 5 6 Idle (7) -// _________ _________ _________ _________ _________ _________ _________ _________ -// -// AddrMode Same Val Same Val Same Val Same Val Same Val Same Val Same Val -// DataMode NO Data Activate Activate Activate Activate Activate Activate -// NextData SameData SameData SameData SameData SameData SameData SameData -// Int Trig No Int No Int No Int No Int No Int No Int No Int -// IF/Wait Wait 1 IF Wait 1 Wait 1 Wait 1 Wait 1 Wait 1 -// Term A TCXpire -// LFunc AND -// Term B TCXpire -// Branch1 ThenIdle -// Branch0 Else 1 -// Re-Exec No -// Sngl/CRC Default Default Default Default Default Default Default -// WEN# 0 0 0 0 0 0 0 0 -// REN# 0 0 0 0 0 0 0 0 -// OE# 0 0 0 0 0 0 0 0 -// CLRST 0 0 0 0 0 0 0 0 -// unused 0 0 0 0 0 0 0 0 -// BOGUS 0 0 0 0 0 0 0 0 -// -// END DO NOT EDIT - -// GPIF Program Code - -// DO NOT EDIT ... -#include "fx2.h" -#include "fx2regs.h" -#include "fx2sdly.h" // SYNCDELAY macro -// END DO NOT EDIT - -// DO NOT EDIT ... -const char xdata WaveData[128] = -{ -// Wave 0 -/* LenBr */ 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x07, -/* Opcode*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* Output*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* LFun */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, -// Wave 1 -/* LenBr */ 0x01, 0x3F, 0x01, 0x01, 0x01, 0x01, 0x01, 0x07, -/* Opcode*/ 0x22, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, -/* Output*/ 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, -/* LFun */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, -// Wave 2 -/* LenBr */ 0x01, 0x11, 0x01, 0x3F, 0x01, 0x01, 0x01, 0x07, -/* Opcode*/ 0x00, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -/* Output*/ 0x06, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* LFun */ 0x00, 0x2D, 0x00, 0x2D, 0x00, 0x00, 0x00, 0x3F, -// Wave 3 -/* LenBr */ 0x01, 0x39, 0x01, 0x01, 0x01, 0x01, 0x01, 0x07, -/* Opcode*/ 0x00, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, -/* Output*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* LFun */ 0x00, 0x2D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, -}; -// END DO NOT EDIT - -// DO NOT EDIT ... -const char xdata FlowStates[36] = -{ -/* Wave 0 FlowStates */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -/* Wave 1 FlowStates */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -/* Wave 2 FlowStates */ 0x81,0x2D,0x26,0x00,0x04,0x04,0x03,0x02,0x00, -/* Wave 3 FlowStates */ 0x81,0x2D,0x21,0x00,0x04,0x04,0x03,0x02,0x00, -}; -// END DO NOT EDIT - -// DO NOT EDIT ... -const char xdata InitData[7] = -{ -/* Regs */ 0xA0,0x00,0x00,0x00,0xEE,0x4E,0x00 -}; -// END DO NOT EDIT - -// TO DO: You may add additional code below. - -void GpifInit( void ) -{ - BYTE i; - - // Registers which require a synchronization delay, see section 15.14 - // FIFORESET FIFOPINPOLAR - // INPKTEND OUTPKTEND - // EPxBCH:L REVCTL - // GPIFTCB3 GPIFTCB2 - // GPIFTCB1 GPIFTCB0 - // EPxFIFOPFH:L EPxAUTOINLENH:L - // EPxFIFOCFG EPxGPIFFLGSEL - // PINFLAGSxx EPxFIFOIRQ - // EPxFIFOIE GPIFIRQ - // GPIFIE GPIFADRH:L - // UDMACRCH:L EPxGPIFTRIG - // GPIFTRIG - - // Note: The pre-REVE EPxGPIFTCH/L register are affected, as well... - // ...these have been replaced by GPIFTC[B3:B0] registers - - // 8051 doesn't have access to waveform memories 'til - // the part is in GPIF mode. - - IFCONFIG = 0xEE; - // IFCLKSRC=1 , FIFOs executes on internal clk source - // xMHz=1 , 48MHz internal clk rate - // IFCLKOE=0 , Don't drive IFCLK pin signal at 48MHz - // IFCLKPOL=0 , Don't invert IFCLK pin signal from internal clk - // ASYNC=1 , master samples asynchronous - // GSTATE=1 , Drive GPIF states out on PORTE[2:0], debug WF - // IFCFG[1:0]=10, FX2 in GPIF master mode - - GPIFABORT = 0xFF; // abort any waveforms pending - - GPIFREADYCFG = InitData[ 0 ]; - GPIFCTLCFG = InitData[ 1 ]; - GPIFIDLECS = InitData[ 2 ]; - GPIFIDLECTL = InitData[ 3 ]; - GPIFWFSELECT = InitData[ 5 ]; - GPIFREADYSTAT = InitData[ 6 ]; - - // use dual autopointer feature... - AUTOPTRSETUP = 0x07; // inc both pointers, - // ...warning: this introduces pdata hole(s) - // ...at E67B (XAUTODAT1) and E67C (XAUTODAT2) - - // source - AUTOPTRH1 = MSB( &WaveData ); - AUTOPTRL1 = LSB( &WaveData ); - - // destination - AUTOPTRH2 = 0xE4; - AUTOPTRL2 = 0x00; - - // transfer - for ( i = 0x00; i < 128; i++ ) - { - EXTAUTODAT2 = EXTAUTODAT1; - } - -// Configure GPIF Address pins, output initial value, - PORTCCFG = 0xFF; // [7:0] as alt. func. GPIFADR[7:0] - OEC = 0xFF; // and as outputs - PORTECFG |= 0x80; // [8] as alt. func. GPIFADR[8] - OEE |= 0x80; // and as output - -// ...OR... tri-state GPIFADR[8:0] pins -// PORTCCFG = 0x00; // [7:0] as port I/O -// OEC = 0x00; // and as inputs -// PORTECFG &= 0x7F; // [8] as port I/O -// OEE &= 0x7F; // and as input - -// GPIF address pins update when GPIFADRH/L written - SYNCDELAY; // - GPIFADRH = 0x00; // bits[7:1] always 0 - SYNCDELAY; // - GPIFADRL = 0x00; // point to PERIPHERAL address 0x0000 - -// Configure GPIF FlowStates registers for Wave 0 of WaveData - FLOWSTATE = FlowStates[ 0 ]; - FLOWLOGIC = FlowStates[ 1 ]; - FLOWEQ0CTL = FlowStates[ 2 ]; - FLOWEQ1CTL = FlowStates[ 3 ]; - FLOWHOLDOFF = FlowStates[ 4 ]; - FLOWSTB = FlowStates[ 5 ]; - FLOWSTBEDGE = FlowStates[ 6 ]; - FLOWSTBHPERIOD = FlowStates[ 7 ]; -} - diff --git a/usrp/firmware/src/usrp2/gpif.gpf b/usrp/firmware/src/usrp2/gpif.gpf Binary files differdeleted file mode 100755 index 854e25399..000000000 --- a/usrp/firmware/src/usrp2/gpif.gpf +++ /dev/null diff --git a/usrp/firmware/src/usrp2/init_gpif.c b/usrp/firmware/src/usrp2/init_gpif.c deleted file mode 100644 index 0f5944b3b..000000000 --- a/usrp/firmware/src/usrp2/init_gpif.c +++ /dev/null @@ -1 +0,0 @@ -#include "../common/init_gpif.c" diff --git a/usrp/firmware/src/usrp2/spi.c b/usrp/firmware/src/usrp2/spi.c deleted file mode 100644 index f5803c55b..000000000 --- a/usrp/firmware/src/usrp2/spi.c +++ /dev/null @@ -1,381 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004,2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include "spi.h" -#include "usrp_rev2_regs.h" - -static void -setup_enables (unsigned char enables) -{ - // Software eanbles are active high. - // Hardware enables are active low. - - // Uhh, the CODECs are active low, but the FPGA is active high... - enables ^= SPI_ENABLE_FPGA; - - // KLUDGE: This code is fragile, but reasonably fast... - // low three bits of enables go into port A - USRP_PA = USRP_PA | (0x7 << 3); // disable FPGA, CODEC_A, CODEC_B - USRP_PA ^= (enables & 0x7) << 3; // enable specified devs - - // high four bits of enables go into port E - USRP_PE = USRP_PE | (0xf << 4); // disable TX_A, RX_A, TX_B, RX_B - USRP_PE ^= (enables & 0xf0); // enable specified devs -} - -#define disable_all() setup_enables (0) - -void -init_spi (void) -{ - disable_all (); /* disable all devs */ - bitS_OUT = 0; /* idle state has CLK = 0 */ -} - -#if 0 -static unsigned char -count_bits8 (unsigned char v) -{ - static unsigned char count4[16] = { - 0, // 0 - 1, // 1 - 1, // 2 - 2, // 3 - 1, // 4 - 2, // 5 - 2, // 6 - 3, // 7 - 1, // 8 - 2, // 9 - 2, // a - 3, // b - 2, // c - 3, // d - 3, // e - 4 // f - }; - return count4[v & 0xf] + count4[(v >> 4) & 0xf]; -} - -#else - -static unsigned char -count_bits8 (unsigned char v) -{ - unsigned char count = 0; - if (v & (1 << 0)) count++; - if (v & (1 << 1)) count++; - if (v & (1 << 2)) count++; - if (v & (1 << 3)) count++; - if (v & (1 << 4)) count++; - if (v & (1 << 5)) count++; - if (v & (1 << 6)) count++; - if (v & (1 << 7)) count++; - return count; -} -#endif - -static void -write_byte_msb (unsigned char v); - -static void -write_bytes_msb (const xdata unsigned char *buf, unsigned char len); - -static void -read_bytes_msb (xdata unsigned char *buf, unsigned char len); - - -// returns non-zero if successful, else 0 -unsigned char -spi_read (unsigned char header_hi, unsigned char header_lo, - unsigned char enables, unsigned char format, - xdata unsigned char *buf, unsigned char len) -{ - if (count_bits8 (enables) > 1) - return 0; // error, too many enables set - - setup_enables (enables); - - if (format & SPI_FMT_LSB){ // order: LSB -#if 1 - return 0; // error, not implemented -#else - switch (format & SPI_FMR_HDR_MASK){ - case SPI_FMT_HDR_0: - break; - case SPI_FMT_HDR_1: - write_byte_lsb (header_lo); - break; - case SPI_FMT_HDR_2: - write_byte_lsb (header_lo); - write_byte_lsb (header_hi); - break; - default: - return 0; // error - } - if (len != 0) - read_bytes_lsb (buf, len); -#endif - } - - else { // order: MSB - - switch (format & SPI_FMT_HDR_MASK){ - case SPI_FMT_HDR_0: - break; - case SPI_FMT_HDR_1: - write_byte_msb (header_lo); - break; - case SPI_FMT_HDR_2: - write_byte_msb (header_hi); - write_byte_msb (header_lo); - break; - default: - return 0; // error - } - if (len != 0) - read_bytes_msb (buf, len); - } - - disable_all (); - return 1; // success -} - - -// returns non-zero if successful, else 0 -unsigned char -spi_write (unsigned char header_hi, unsigned char header_lo, - unsigned char enables, unsigned char format, - const xdata unsigned char *buf, unsigned char len) -{ - setup_enables (enables); - - if (format & SPI_FMT_LSB){ // order: LSB -#if 1 - return 0; // error, not implemented -#else - switch (format & SPI_FMR_HDR_MASK){ - case SPI_FMT_HDR_0: - break; - case SPI_FMT_HDR_1: - write_byte_lsb (header_lo); - break; - case SPI_FMT_HDR_2: - write_byte_lsb (header_lo); - write_byte_lsb (header_hi); - break; - default: - return 0; // error - } - if (len != 0) - write_bytes_lsb (buf, len); -#endif - } - - else { // order: MSB - - switch (format & SPI_FMT_HDR_MASK){ - case SPI_FMT_HDR_0: - break; - case SPI_FMT_HDR_1: - write_byte_msb (header_lo); - break; - case SPI_FMT_HDR_2: - write_byte_msb (header_hi); - write_byte_msb (header_lo); - break; - default: - return 0; // error - } - if (len != 0) - write_bytes_msb (buf, len); - } - - disable_all (); - return 1; // success -} - -// ---------------------------------------------------------------- - -static void -write_byte_msb (unsigned char v) -{ - v = (v << 1) | (v >> 7); // rotate left (MSB into bottom bit) - bitS_OUT = v & 0x1; - bitS_CLK = 1; - bitS_CLK = 0; - - v = (v << 1) | (v >> 7); // rotate left (MSB into bottom bit) - bitS_OUT = v & 0x1; - bitS_CLK = 1; - bitS_CLK = 0; - - v = (v << 1) | (v >> 7); // rotate left (MSB into bottom bit) - bitS_OUT = v & 0x1; - bitS_CLK = 1; - bitS_CLK = 0; - - v = (v << 1) | (v >> 7); // rotate left (MSB into bottom bit) - bitS_OUT = v & 0x1; - bitS_CLK = 1; - bitS_CLK = 0; - - v = (v << 1) | (v >> 7); // rotate left (MSB into bottom bit) - bitS_OUT = v & 0x1; - bitS_CLK = 1; - bitS_CLK = 0; - - v = (v << 1) | (v >> 7); // rotate left (MSB into bottom bit) - bitS_OUT = v & 0x1; - bitS_CLK = 1; - bitS_CLK = 0; - - v = (v << 1) | (v >> 7); // rotate left (MSB into bottom bit) - bitS_OUT = v & 0x1; - bitS_CLK = 1; - bitS_CLK = 0; - - v = (v << 1) | (v >> 7); // rotate left (MSB into bottom bit) - bitS_OUT = v & 0x1; - bitS_CLK = 1; - bitS_CLK = 0; -} - -static void -write_bytes_msb (const xdata unsigned char *buf, unsigned char len) -{ - while (len-- != 0){ - write_byte_msb (*buf++); - } -} - -#if 0 -/* - * This is incorrectly compiled by SDCC 2.4.0 - */ -static unsigned char -read_byte_msb (void) -{ - unsigned char v = 0; - - bitS_CLK = 1; - v |= bitS_IN; - bitS_CLK = 0; - - v = v << 1; - bitS_CLK = 1; - v |= bitS_IN; - bitS_CLK = 0; - - v = v << 1; - bitS_CLK = 1; - v |= bitS_IN; - bitS_CLK = 0; - - v = v << 1; - bitS_CLK = 1; - v |= bitS_IN; - bitS_CLK = 0; - - v = v << 1; - bitS_CLK = 1; - v |= bitS_IN; - bitS_CLK = 0; - - v = v << 1; - bitS_CLK = 1; - v |= bitS_IN; - bitS_CLK = 0; - - v = v << 1; - bitS_CLK = 1; - v |= bitS_IN; - bitS_CLK = 0; - - v = v << 1; - bitS_CLK = 1; - v |= bitS_IN; - bitS_CLK = 0; - - return v; -} -#else -static unsigned char -read_byte_msb (void) _naked -{ - _asm - clr a - - setb _bitS_CLK - mov c, _bitS_IN - rlc a - clr _bitS_CLK - - setb _bitS_CLK - mov c, _bitS_IN - rlc a - clr _bitS_CLK - - setb _bitS_CLK - mov c, _bitS_IN - rlc a - clr _bitS_CLK - - setb _bitS_CLK - mov c, _bitS_IN - rlc a - clr _bitS_CLK - - setb _bitS_CLK - mov c, _bitS_IN - rlc a - clr _bitS_CLK - - setb _bitS_CLK - mov c, _bitS_IN - rlc a - clr _bitS_CLK - - setb _bitS_CLK - mov c, _bitS_IN - rlc a - clr _bitS_CLK - - setb _bitS_CLK - mov c, _bitS_IN - rlc a - clr _bitS_CLK - - mov dpl,a - ret - _endasm; -} -#endif - -static void -read_bytes_msb (xdata unsigned char *buf, unsigned char len) -{ - while (len-- != 0){ - *buf++ = read_byte_msb (); - } -} - diff --git a/usrp/firmware/src/usrp2/spi.h b/usrp/firmware/src/usrp2/spi.h deleted file mode 100644 index 12bc5e544..000000000 --- a/usrp/firmware/src/usrp2/spi.h +++ /dev/null @@ -1,43 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_SPI_H -#define INCLUDED_SPI_H - -#include "usrp_spi_defs.h" - -void init_spi (void); // one time call to init - -// returns non-zero if successful, else 0 -unsigned char -spi_read (unsigned char header_hi, unsigned char header_lo, - unsigned char enables, unsigned char format, - xdata unsigned char *buf, unsigned char len); - -// returns non-zero if successful, else 0 -unsigned char -spi_write (unsigned char header_hi, unsigned char header_lo, - unsigned char enables, unsigned char format, - const xdata unsigned char *buf, unsigned char len); - - -#endif /* INCLUDED_SPI_H */ diff --git a/usrp/firmware/src/usrp2/usb_descriptors.a51 b/usrp/firmware/src/usrp2/usb_descriptors.a51 deleted file mode 100644 index a60adbef8..000000000 --- a/usrp/firmware/src/usrp2/usb_descriptors.a51 +++ /dev/null @@ -1,404 +0,0 @@ -;;; -*- asm -*- -;;; -;;; Copyright 2003 Free Software Foundation, Inc. -;;; -;;; This file is part of GNU Radio -;;; -;;; GNU Radio is free software; you can redistribute it and/or modify -;;; it under the terms of the GNU General Public License as published by -;;; the Free Software Foundation; either version 3, or (at your option) -;;; any later version. -;;; -;;; GNU Radio is distributed in the hope that it will be useful, -;;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;;; GNU General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with GNU Radio; see the file COPYING. If not, write to -;;; the Free Software Foundation, Inc., 51 Franklin Street, -;;; Boston, MA 02110-1301, USA. -;;; - -;;; USB Descriptor table for the USRP -;;; -;;; We're a high-speed only device (480 Mb/sec) with 1 configuration -;;; and 3 interfaces. -;;; -;;; interface 0: command and status (ep0 COMMAND) -;;; interface 1: Transmit path (ep2 OUT BULK) -;;; interface 2: Receive path (ep6 IN BULK) - - .module usb_descriptors - - VID_FREE = 0xfffe ; Free Software Folks - PID_USRP = 0x0002 ; USRP - - ;; We distinguish configured from unconfigured USRPs using the Device ID. - ;; If the MSB of the DID is 0, the device is unconfigured. - ;; The LSB of the DID is reserved for hardware revs. - - DID_USRP = 0x0100 ; Device ID (bcd) - - - DSCR_DEVICE = 1 ; Descriptor type: Device - DSCR_CONFIG = 2 ; Descriptor type: Configuration - DSCR_STRING = 3 ; Descriptor type: String - DSCR_INTRFC = 4 ; Descriptor type: Interface - DSCR_ENDPNT = 5 ; Descriptor type: Endpoint - DSCR_DEVQUAL = 6 ; Descriptor type: Device Qualifier - - DSCR_DEVICE_LEN = 18 - DSCR_CONFIG_LEN = 9 - DSCR_INTRFC_LEN = 9 - DSCR_ENDPNT_LEN = 7 - DSCR_DEVQUAL_LEN = 10 - - ET_CONTROL = 0 ; Endpoint type: Control - ET_ISO = 1 ; Endpoint type: Isochronous - ET_BULK = 2 ; Endpoint type: Bulk - ET_INT = 3 ; Endpoint type: Interrupt - - - ;; configuration attributes - bmSELF_POWERED = 1 << 6 - -;;; -------------------------------------------------------- -;;; external ram data -;;;-------------------------------------------------------- - - .area USBDESCSEG (XDATA) - -;;; ---------------------------------------------------------------- -;;; descriptors used when operating at high speed (480Mb/sec) -;;; ---------------------------------------------------------------- - - .even ; descriptors must be 2-byte aligned for SUDPTR{H,L} to work - - ;; The .even directive isn't really honored by the linker. Bummer! - ;; (There's no way to specify an alignment requirement for a given area, - ;; hence when they're concatenated together, even doesn't work.) - ;; - ;; We work around this by telling the linker to put USBDESCSEG - ;; at 0xE000 absolute. This means that the maximimum length of this - ;; segment is 480 bytes, leaving room for the two hash slots - ;; at 0xE1EO to 0xE1FF. - ;; - ;; As of July 7, 2004, this segment is 326 bytes long - -_high_speed_device_descr:: - .db DSCR_DEVICE_LEN - .db DSCR_DEVICE - .db <0x0200 ; Specification version (LSB) - .db >0x0200 ; Specification version (MSB) - .db 0xff ; device class (vendor specific) - .db 0xff ; device subclass (vendor specific) - .db 0xff ; device protocol (vendor specific) - .db 64 ; bMaxPacketSize0 for endpoint 0 - .db <VID_FREE ; idVendor - .db >VID_FREE ; idVendor - .db <PID_USRP ; idProduct - .db >PID_USRP ; idProduct -_usb_desc_hw_rev_binary_patch_location_0:: - .db <DID_USRP ; bcdDevice - .db >DID_USRP ; bcdDevice - .db SI_VENDOR ; iManufacturer (string index) - .db SI_PRODUCT ; iProduct (string index) - .db SI_SERIAL ; iSerial number (string index) - .db 1 ; bNumConfigurations - -;;; describes the other speed (12Mb/sec) - .even -_high_speed_devqual_descr:: - .db DSCR_DEVQUAL_LEN - .db DSCR_DEVQUAL - .db <0x0200 ; bcdUSB (LSB) - .db >0x0200 ; bcdUSB (MSB) - .db 0xff ; bDeviceClass - .db 0xff ; bDeviceSubClass - .db 0xff ; bDeviceProtocol - .db 64 ; bMaxPacketSize0 - .db 1 ; bNumConfigurations (one config at 12Mb/sec) - .db 0 ; bReserved - - .even -_high_speed_config_descr:: - .db DSCR_CONFIG_LEN - .db DSCR_CONFIG - .db <(_high_speed_config_descr_end - _high_speed_config_descr) ; LSB - .db >(_high_speed_config_descr_end - _high_speed_config_descr) ; MSB - .db 3 ; bNumInterfaces - .db 1 ; bConfigurationValue - .db 0 ; iConfiguration - .db 0x80 | bmSELF_POWERED ; bmAttributes - .db 0 ; bMaxPower - - ;; interface descriptor 0 (command & status, ep0 COMMAND) - - .db DSCR_INTRFC_LEN - .db DSCR_INTRFC - .db 0 ; bInterfaceNumber (zero based) - .db 0 ; bAlternateSetting - .db 0 ; bNumEndpoints - .db 0xff ; bInterfaceClass (vendor specific) - .db 0xff ; bInterfaceSubClass (vendor specific) - .db 0xff ; bInterfaceProtocol (vendor specific) - .db SI_COMMAND_AND_STATUS ; iInterface (description) - - ;; interface descriptor 1 (transmit path, ep2 OUT BULK) - - .db DSCR_INTRFC_LEN - .db DSCR_INTRFC - .db 1 ; bInterfaceNumber (zero based) - .db 0 ; bAlternateSetting - .db 1 ; bNumEndpoints - .db 0xff ; bInterfaceClass (vendor specific) - .db 0xff ; bInterfaceSubClass (vendor specific) - .db 0xff ; bInterfaceProtocol (vendor specific) - .db SI_TX_PATH ; iInterface (description) - - ;; interface 1's end point - - .db DSCR_ENDPNT_LEN - .db DSCR_ENDPNT - .db 0x02 ; bEndpointAddress (ep 2 OUT) - .db ET_BULK ; bmAttributes - .db <512 ; wMaxPacketSize (LSB) - .db >512 ; wMaxPacketSize (MSB) - .db 0 ; bInterval (iso only) - - ;; interface descriptor 2 (receive path, ep6 IN BULK) - - .db DSCR_INTRFC_LEN - .db DSCR_INTRFC - .db 2 ; bInterfaceNumber (zero based) - .db 0 ; bAlternateSetting - .db 1 ; bNumEndpoints - .db 0xff ; bInterfaceClass (vendor specific) - .db 0xff ; bInterfaceSubClass (vendor specific) - .db 0xff ; bInterfaceProtocol (vendor specific) - .db SI_RX_PATH ; iInterface (description) - - ;; interface 2's end point - - .db DSCR_ENDPNT_LEN - .db DSCR_ENDPNT - .db 0x86 ; bEndpointAddress (ep 6 IN) - .db ET_BULK ; bmAttributes - .db <512 ; wMaxPacketSize (LSB) - .db >512 ; wMaxPacketSize (MSB) - .db 0 ; bInterval (iso only) - -_high_speed_config_descr_end: - -;;; ---------------------------------------------------------------- -;;; descriptors used when operating at full speed (12Mb/sec) -;;; ---------------------------------------------------------------- - - .even -_full_speed_device_descr:: - .db DSCR_DEVICE_LEN - .db DSCR_DEVICE - .db <0x0200 ; Specification version (LSB) - .db >0x0200 ; Specification version (MSB) - .db 0xff ; device class (vendor specific) - .db 0xff ; device subclass (vendor specific) - .db 0xff ; device protocol (vendor specific) - .db 64 ; bMaxPacketSize0 for endpoint 0 - .db <VID_FREE ; idVendor - .db >VID_FREE ; idVendor - .db <PID_USRP ; idProduct - .db >PID_USRP ; idProduct -_usb_desc_hw_rev_binary_patch_location_1:: - .db <DID_USRP ; bcdDevice - .db >DID_USRP ; bcdDevice - .db SI_VENDOR ; iManufacturer (string index) - .db SI_PRODUCT ; iProduct (string index) - .db SI_NONE ; iSerial number (None) - .db 1 ; bNumConfigurations - - -;;; describes the other speed (480Mb/sec) - .even -_full_speed_devqual_descr:: - .db DSCR_DEVQUAL_LEN - .db DSCR_DEVQUAL - .db <0x0200 ; bcdUSB - .db >0x0200 ; bcdUSB - .db 0xff ; bDeviceClass - .db 0xff ; bDeviceSubClass - .db 0xff ; bDeviceProtocol - .db 64 ; bMaxPacketSize0 - .db 1 ; bNumConfigurations (one config at 480Mb/sec) - .db 0 ; bReserved - - .even -_full_speed_config_descr:: - .db DSCR_CONFIG_LEN - .db DSCR_CONFIG - .db <(_full_speed_config_descr_end - _full_speed_config_descr) ; LSB - .db >(_full_speed_config_descr_end - _full_speed_config_descr) ; MSB - .db 1 ; bNumInterfaces - .db 1 ; bConfigurationValue - .db 0 ; iConfiguration - .db 0x80 | bmSELF_POWERED ; bmAttributes - .db 0 ; bMaxPower - - ;; interface descriptor 0 (command & status, ep0 COMMAND) - - .db DSCR_INTRFC_LEN - .db DSCR_INTRFC - .db 0 ; bInterfaceNumber (zero based) - .db 0 ; bAlternateSetting - .db 0 ; bNumEndpoints - .db 0xff ; bInterfaceClass (vendor specific) - .db 0xff ; bInterfaceSubClass (vendor specific) - .db 0xff ; bInterfaceProtocol (vendor specific) - .db SI_COMMAND_AND_STATUS ; iInterface (description) - -_full_speed_config_descr_end: - -;;; ---------------------------------------------------------------- -;;; string descriptors -;;; ---------------------------------------------------------------- - -_nstring_descriptors:: - .db (_string_descriptors_end - _string_descriptors) / 2 - -_string_descriptors:: - .db <str0, >str0 - .db <str1, >str1 - .db <str2, >str2 - .db <str3, >str3 - .db <str4, >str4 - .db <str5, >str5 - .db <str6, >str6 -_string_descriptors_end: - - SI_NONE = 0 - ;; str0 contains the language ID's. - .even -str0: .db str0_end - str0 - .db DSCR_STRING - .db 0 - .db 0 - .db <0x0409 ; magic code for US English (LSB) - .db >0x0409 ; magic code for US English (MSB) -str0_end: - - SI_VENDOR = 1 - .even -str1: .db str1_end - str1 - .db DSCR_STRING - .db 'F, 0 ; 16-bit unicode - .db 'r, 0 - .db 'e, 0 - .db 'e, 0 - .db ' , 0 - .db 'S, 0 - .db 'o, 0 - .db 'f, 0 - .db 't, 0 - .db 'w, 0 - .db 'a, 0 - .db 'r, 0 - .db 'e, 0 - .db ' , 0 - .db 'F, 0 - .db 'o, 0 - .db 'l, 0 - .db 'k, 0 - .db 's, 0 -str1_end: - - SI_PRODUCT = 2 - .even -str2: .db str2_end - str2 - .db DSCR_STRING - .db 'U, 0 - .db 'S, 0 - .db 'R, 0 - .db 'P, 0 - .db ' , 0 - .db 'R, 0 - .db 'e, 0 - .db 'v, 0 - .db ' , 0 -_usb_desc_hw_rev_ascii_patch_location_0:: - .db '?, 0 -str2_end: - - SI_COMMAND_AND_STATUS = 3 - .even -str3: .db str3_end - str3 - .db DSCR_STRING - .db 'C, 0 - .db 'o, 0 - .db 'm, 0 - .db 'm, 0 - .db 'a, 0 - .db 'n, 0 - .db 'd, 0 - .db ' , 0 - .db '&, 0 - .db ' , 0 - .db 'S, 0 - .db 't, 0 - .db 'a, 0 - .db 't, 0 - .db 'u, 0 - .db 's, 0 -str3_end: - - SI_TX_PATH = 4 - .even -str4: .db str4_end - str4 - .db DSCR_STRING - .db 'T, 0 - .db 'r, 0 - .db 'a, 0 - .db 'n, 0 - .db 's, 0 - .db 'm, 0 - .db 'i, 0 - .db 't, 0 - .db ' , 0 - .db 'P, 0 - .db 'a, 0 - .db 't, 0 - .db 'h, 0 -str4_end: - - SI_RX_PATH = 5 - .even -str5: .db str5_end - str5 - .db DSCR_STRING - .db 'R, 0 - .db 'e, 0 - .db 'c, 0 - .db 'e, 0 - .db 'i, 0 - .db 'v, 0 - .db 'e, 0 - .db ' , 0 - .db 'P, 0 - .db 'a, 0 - .db 't, 0 - .db 'h, 0 -str5_end: - - SI_SERIAL = 6 - .even -str6: .db str6_end - str6 - .db DSCR_STRING -_usb_desc_serial_number_ascii:: - .db '3, 0 - .db '., 0 - .db '1, 0 - .db '4, 0 - .db '1, 0 - .db '5, 0 - .db '9, 0 - .db '3, 0 -str6_end: - diff --git a/usrp/firmware/src/usrp2/usrp_common.c b/usrp/firmware/src/usrp2/usrp_common.c deleted file mode 100644 index f389d9253..000000000 --- a/usrp/firmware/src/usrp2/usrp_common.c +++ /dev/null @@ -1 +0,0 @@ -#include "../common/usrp_common.c" diff --git a/usrp/firmware/src/usrp2/usrp_common.h b/usrp/firmware/src/usrp2/usrp_common.h deleted file mode 100644 index 738ba6b37..000000000 --- a/usrp/firmware/src/usrp2/usrp_common.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * USRP - Universal Software Radio Peripheral - * - * Copyright (C) 2003,2006 Free Software Foundation, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Boston, MA 02110-1301 USA - */ - -/* - * common defines and prototypes for USRP - * - * In comments below "TRM" refers to the EZ-USB FX2 Technical Reference Manual - */ - -#ifndef _USRPCOMMON_H_ -#define _USRPCOMMON_H_ - -#include <usrp_config.h> -#include <usrp_rev2_regs.h> -#include <syncdelay.h> - -/* - * From TRM page 15-105: - * - * Under certain conditions, some read and write access to the FX2 - * registers must be separated by a "synchronization delay". The - * delay is necessary only under the following conditions: - * - * - between a write to any register in the 0xE600 - 0xE6FF range - * and a write to one of the registers listed below. - * - * - between a write to one of the registers listed below and a read - * from any register in the 0xE600 - 0xE6FF range. - * - * Registers which require a synchronization delay: - * - * FIFORESET FIFOPINPOLAR - * INPKTEND EPxBCH:L - * EPxFIFOPFH:L EPxAUTOINLENH:L - * EPxFIFOCFG EPxGPIFFLGSEL - * PINFLAGSAB PINFLAGSCD - * EPxFIFOIE EPxFIFOIRQ - * GPIFIE GPIFIRQ - * UDMACRCH:L GPIFADRH:L - * GPIFTRIG EPxGPIFTRIG - * OUTPKTEND REVCTL - * GPIFTCB3 GPIFTCB2 - * GPIFTCB1 GPIFTCB0 - */ - -#define TRUE 1 -#define FALSE 0 - - -void init_usrp (void); -void init_gpif (void); - -void set_led_0 (unsigned char on); -void set_led_1 (unsigned char on); -void toggle_led_0 (void); -void toggle_led_1 (void); - -#define la_trace(v) - -#endif /* _USRPCOMMON_H_ */ diff --git a/usrp/firmware/src/usrp2/usrp_main.c b/usrp/firmware/src/usrp2/usrp_main.c deleted file mode 100644 index c7c09f8c5..000000000 --- a/usrp/firmware/src/usrp2/usrp_main.c +++ /dev/null @@ -1,380 +0,0 @@ -/* - * USRP - Universal Software Radio Peripheral - * - * Copyright (C) 2003,2004 Free Software Foundation, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Boston, MA 02110-1301 USA - */ - -#include "usrp_common.h" -#include "usrp_commands.h" -#include "fpga.h" -#include "usrp_gpif_inline.h" -#include "timer.h" -#include "i2c.h" -#include "isr.h" -#include "usb_common.h" -#include "fx2utils.h" -#include "usrp_globals.h" -#include "usrp_i2c_addr.h" -#include <string.h> -#include "spi.h" -#include "eeprom_io.h" -#include "usb_descriptors.h" - -/* - * offsets into boot eeprom for configuration values - */ -#define HW_REV_OFFSET 5 -#define SERIAL_NO_OFFSET 248 -#define SERIAL_NO_LEN 8 - - -#define bRequestType SETUPDAT[0] -#define bRequest SETUPDAT[1] -#define wValueL SETUPDAT[2] -#define wValueH SETUPDAT[3] -#define wIndexL SETUPDAT[4] -#define wIndexH SETUPDAT[5] -#define wLengthL SETUPDAT[6] -#define wLengthH SETUPDAT[7] - - -unsigned char g_tx_enable = 0; -unsigned char g_rx_enable = 0; -unsigned char g_rx_overrun = 0; -unsigned char g_tx_underrun = 0; - -/* - * the host side fpga loader code pushes an MD5 hash of the bitstream - * into hash1. - */ -#define USRP_HASH_SIZE 16 -xdata at USRP_HASH_SLOT_1_ADDR unsigned char hash1[USRP_HASH_SIZE]; - -static void -get_ep0_data (void) -{ - EP0BCL = 0; // arm EP0 for OUT xfer. This sets the busy bit - - while (EP0CS & bmEPBUSY) // wait for busy to clear - ; -} - -/* - * Handle our "Vendor Extension" commands on endpoint 0. - * If we handle this one, return non-zero. - */ -unsigned char -app_vendor_cmd (void) -{ - if (bRequestType == VRT_VENDOR_IN){ - - ///////////////////////////////// - // handle the IN requests - ///////////////////////////////// - - switch (bRequest){ - - case VRQ_GET_STATUS: - switch (wIndexL){ - - case GS_TX_UNDERRUN: - EP0BUF[0] = g_tx_underrun; - g_tx_underrun = 0; - EP0BCH = 0; - EP0BCL = 1; - break; - - case GS_RX_OVERRUN: - EP0BUF[0] = g_rx_overrun; - g_rx_overrun = 0; - EP0BCH = 0; - EP0BCL = 1; - break; - - default: - return 0; - } - break; - - case VRQ_I2C_READ: - if (!i2c_read (wValueL, EP0BUF, wLengthL)) - return 0; - - EP0BCH = 0; - EP0BCL = wLengthL; - break; - - case VRQ_SPI_READ: - if (!spi_read (wValueH, wValueL, wIndexH, wIndexL, EP0BUF, wLengthL)) - return 0; - - EP0BCH = 0; - EP0BCL = wLengthL; - break; - - default: - return 0; - } - } - - else if (bRequestType == VRT_VENDOR_OUT){ - - ///////////////////////////////// - // handle the OUT requests - ///////////////////////////////// - - switch (bRequest){ - - case VRQ_SET_LED: - switch (wIndexL){ - case 0: - set_led_0 (wValueL); - break; - - case 1: - set_led_1 (wValueL); - break; - - default: - return 0; - } - break; - - case VRQ_FPGA_LOAD: - switch (wIndexL){ // sub-command - case FL_BEGIN: - return fpga_load_begin (); - - case FL_XFER: - get_ep0_data (); - return fpga_load_xfer (EP0BUF, EP0BCL); - - case FL_END: - return fpga_load_end (); - - default: - return 0; - } - break; - - - case VRQ_FPGA_SET_RESET: - fpga_set_reset (wValueL); - break; - - case VRQ_FPGA_SET_TX_ENABLE: - fpga_set_tx_enable (wValueL); - break; - - case VRQ_FPGA_SET_RX_ENABLE: - fpga_set_rx_enable (wValueL); - break; - - case VRQ_FPGA_SET_TX_RESET: - fpga_set_tx_reset (wValueL); - break; - - case VRQ_FPGA_SET_RX_RESET: - fpga_set_rx_reset (wValueL); - break; - - case VRQ_I2C_WRITE: - get_ep0_data (); - if (!i2c_write (wValueL, EP0BUF, EP0BCL)) - return 0; - break; - - case VRQ_SPI_WRITE: - get_ep0_data (); - if (!spi_write (wValueH, wValueL, wIndexH, wIndexL, EP0BUF, EP0BCL)) - return 0; - break; - - default: - return 0; - } - - } - else - return 0; // invalid bRequestType - - return 1; -} - - - -static void -main_loop (void) -{ - setup_flowstate_common (); - - while (1){ - - if (usb_setup_packet_avail ()) - usb_handle_setup_packet (); - - - if (GPIFTRIG & bmGPIF_IDLE){ - - // OK, GPIF is idle. Let's try to give it some work. - - // First check for underruns and overruns - - if (UC_BOARD_HAS_FPGA && (USRP_PA & (bmPA_TX_UNDERRUN | bmPA_RX_OVERRUN))){ - - // record the under/over run - if (USRP_PA & bmPA_TX_UNDERRUN) - g_tx_underrun = 1; - - if (USRP_PA & bmPA_RX_OVERRUN) - g_rx_overrun = 1; - - // tell the FPGA to clear the flags - fpga_clear_flags (); - } - - // Next see if there are any "OUT" packets waiting for our attention, - // and if so, if there's room in the FPGA's FIFO for them. - - if (g_tx_enable && !(EP24FIFOFLGS & 0x02)){ // USB end point fifo is not empty... - - if (fpga_has_room_for_packet ()){ // ... and FPGA has room for packet - - GPIFTCB1 = 0x01; SYNCDELAY; - GPIFTCB0 = 0x00; SYNCDELAY; - - setup_flowstate_write (); - - SYNCDELAY; - GPIFTRIG = bmGPIF_EP2_START | bmGPIF_WRITE; // start the xfer - SYNCDELAY; - - while (!(GPIFTRIG & bmGPIF_IDLE)){ - // wait for the transaction to complete - } - } - } - - // See if there are any requests for "IN" packets, and if so - // whether the FPGA's got any packets for us. - - if (g_rx_enable && !(EP6CS & bmEPFULL)){ // USB end point fifo is not full... - - if (fpga_has_packet_avail ()){ // ... and FPGA has packet available - - GPIFTCB1 = 0x01; SYNCDELAY; - GPIFTCB0 = 0x00; SYNCDELAY; - - setup_flowstate_read (); - - SYNCDELAY; - GPIFTRIG = bmGPIF_EP6_START | bmGPIF_READ; // start the xfer - SYNCDELAY; - - while (!(GPIFTRIG & bmGPIF_IDLE)){ - // wait for the transaction to complete - } - - SYNCDELAY; - INPKTEND = 6; // tell USB we filled buffer (6 is our endpoint num) - } - } - } - } -} - - -/* - * called at 100 Hz from timer2 interrupt - * - * Toggle led 0 - */ -void -isr_tick (void) interrupt -{ - static unsigned char count = 1; - - if (--count == 0){ - count = 50; - USRP_LED_REG ^= bmLED0; - } - - clear_timer_irq (); -} - -/* - * Read h/w rev code and serial number out of boot eeprom and - * patch the usb descriptors with the values. - */ -void -patch_usb_descriptors(void) -{ - static xdata unsigned char hw_rev; - static xdata unsigned char serial_no[8]; - unsigned char i; - - eeprom_read(I2C_ADDR_BOOT, HW_REV_OFFSET, &hw_rev, 1); // LSB of device id - usb_desc_hw_rev_binary_patch_location_0[0] = hw_rev; - usb_desc_hw_rev_binary_patch_location_1[0] = hw_rev; - usb_desc_hw_rev_ascii_patch_location_0[0] = hw_rev + '0'; // FIXME if we get > 9 - - eeprom_read(I2C_ADDR_BOOT, SERIAL_NO_OFFSET, serial_no, SERIAL_NO_LEN); - - for (i = 0; i < SERIAL_NO_LEN; i++){ - unsigned char ch = serial_no[i]; - if (ch == 0xff) // make unprogrammed EEPROM default to '0' - ch = '0'; - usb_desc_serial_number_ascii[i << 1] = ch; - } -} - -void -main (void) -{ -#if 0 - g_rx_enable = 0; // FIXME (work around initialization bug) - g_tx_enable = 0; - g_rx_overrun = 0; - g_tx_underrun = 0; -#endif - - memset (hash1, 0, USRP_HASH_SIZE); // zero fpga bitstream hash. This forces reload - - init_usrp (); - init_gpif (); - - // if (UC_START_WITH_GSTATE_OUTPUT_ENABLED) - IFCONFIG |= bmGSTATE; // no conflict, start with it on - - set_led_0 (0); - set_led_1 (0); - - EA = 0; // disable all interrupts - - patch_usb_descriptors(); - - setup_autovectors (); - usb_install_handlers (); - hook_timer_tick ((unsigned short) isr_tick); - - EIEX4 = 1; // disable INT4 FIXME - EA = 1; // global interrupt enable - - fx2_renumerate (); // simulates disconnect / reconnect - - main_loop (); -} diff --git a/usrp/firmware/src/usrp2/usrp_rev2_regs.h b/usrp/firmware/src/usrp2/usrp_rev2_regs.h deleted file mode 100644 index a4f1d9896..000000000 --- a/usrp/firmware/src/usrp2/usrp_rev2_regs.h +++ /dev/null @@ -1,163 +0,0 @@ -/* - * USRP - Universal Software Radio Peripheral - * - * Copyright (C) 2003 Free Software Foundation, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Boston, MA 02110-1301 USA - */ - -/* - * These are the register definitions for the Rev 1 USRP prototype - * The Rev 1 is the version with the AD9862's and daughterboards - */ - -#ifndef _USRP_REV1_REGS_H_ -#define _USRP_REV1_REGS_H_ - -#include "fx2regs.h" - -/* - * Port A (bit addressable): - */ - -#define USRP_PA IOA // Port A -#define USRP_PA_OE OEA // Port A direction register - -#define bmPA_S_CLK bmBIT0 // SPI serial clock -#define bmPA_S_DATA_TO_PERIPH bmBIT1 // SPI SDI (peripheral rel name) -#define bmPA_S_DATA_FROM_PERIPH bmBIT2 // SPI SDO (peripheral rel name) -#define bmPA_SEN_FPGA bmBIT3 // serial enable for FPGA (active low) -#define bmPA_SEN_CODEC_A bmBIT4 // serial enable AD9862 A (active low) -#define bmPA_SEN_CODEC_B bmBIT5 // serial enable AD9862 B (active low) -//#define bmPA_FX2_2 bmBIT6 // misc pin to FPGA (overflow) -//#define bmPA_FX2_3 bmBIT7 // misc pin to FPGA (underflow) -#define bmPA_RX_OVERRUN bmBIT6 // misc pin to FPGA (overflow) -#define bmPA_TX_UNDERRUN bmBIT7 // misc pin to FPGA (underflow) - - -sbit at 0x80+0 bitS_CLK; // 0x80 is the bit address of PORT A -sbit at 0x80+1 bitS_OUT; // out from FX2 point of view -sbit at 0x80+2 bitS_IN; // in from FX2 point of view - - -/* all outputs except S_DATA_FROM_PERIPH, FX2_2, FX2_3 */ - -#define bmPORT_A_OUTPUTS (bmPA_S_CLK \ - | bmPA_S_DATA_TO_PERIPH \ - | bmPA_SEN_FPGA \ - | bmPA_SEN_CODEC_A \ - | bmPA_SEN_CODEC_B \ - ) - -#define bmPORT_A_INITIAL (bmPA_SEN_FPGA | bmPA_SEN_CODEC_A | bmPA_SEN_CODEC_B) - - -/* Port B: GPIF FD[7:0] */ - -/* - * Port C (bit addressable): - * 5:1 FPGA configuration - */ - -#define USRP_PC IOC // Port C -#define USRP_PC_OE OEC // Port C direction register - -#define USRP_ALTERA_CONFIG USRP_PC - -#define bmPC_nRESET bmBIT0 // reset line to codecs (active low) -#define bmALTERA_DATA0 bmBIT1 -#define bmALTERA_NCONFIG bmBIT2 -#define bmALTERA_DCLK bmBIT3 -#define bmALTERA_CONF_DONE bmBIT4 -#define bmALTERA_NSTATUS bmBIT5 -#define bmPC_LED0 bmBIT6 // active low -#define bmPC_LED1 bmBIT7 // active low - -sbit at 0xA0+1 bitALTERA_DATA0; // 0xA0 is the bit address of PORT C -sbit at 0xA0+3 bitALTERA_DCLK; - - -#define bmALTERA_BITS (bmALTERA_DATA0 \ - | bmALTERA_NCONFIG \ - | bmALTERA_DCLK \ - | bmALTERA_CONF_DONE \ - | bmALTERA_NSTATUS) - -#define bmPORT_C_OUTPUTS (bmPC_nRESET \ - | bmALTERA_DATA0 \ - | bmALTERA_NCONFIG \ - | bmALTERA_DCLK \ - | bmPC_LED0 \ - | bmPC_LED1 \ - ) - -#define bmPORT_C_INITIAL (bmPC_LED0 | bmPC_LED1) - - -#define USRP_LED_REG USRP_PC -#define bmLED0 bmPC_LED0 -#define bmLED1 bmPC_LED1 - - -/* Port D: GPIF FD[15:8] */ - -/* Port E: not bit addressible */ - -#define USRP_PE IOE // Port E -#define USRP_PE_OE OEE // Port E direction register - -#define bmPE_PE0 bmBIT0 // GPIF debug output -#define bmPE_PE1 bmBIT1 // GPIF debug output -#define bmPE_PE2 bmBIT2 // GPIF debug output -#define bmPE_FPGA_CLR_STATUS bmBIT3 // misc pin to FPGA (clear status) -#define bmPE_SEN_TX_A bmBIT4 // serial enable d'board TX A (active low) -#define bmPE_SEN_RX_A bmBIT5 // serial enable d'board RX A (active low) -#define bmPE_SEN_TX_B bmBIT6 // serial enable d'board TX B (active low) -#define bmPE_SEN_RX_B bmBIT7 // serial enable d'board RX B (active low) - - -#define bmPORT_E_OUTPUTS (bmPE_FPGA_CLR_STATUS \ - | bmPE_SEN_TX_A \ - | bmPE_SEN_RX_A \ - | bmPE_SEN_TX_B \ - | bmPE_SEN_RX_B \ - ) - - -#define bmPORT_E_INITIAL (bmPE_SEN_TX_A \ - | bmPE_SEN_RX_A \ - | bmPE_SEN_TX_B \ - | bmPE_SEN_RX_B \ - ) - -/* - * FPGA output lines that are tied to FX2 RDYx inputs. - * These are readable using GPIFREADYSTAT. - */ -#define bmFPGA_HAS_SPACE bmBIT0 // usbrdy[0] has room for 512 byte packet -#define bmFPGA_PKT_AVAIL bmBIT1 // usbrdy[1] has >= 512 bytes available -// #define bmTX_UNDERRUN bmBIT2 // usbrdy[2] D/A ran out of data -// #define bmRX_OVERRUN bmBIT3 // usbrdy[3] A/D ran out of buffer - -/* - * FPGA input lines that are tied to the FX2 CTLx outputs. - * - * These are controlled by the GPIF microprogram... - */ -// WR bmBIT0 // usbctl[0] -// RD bmBIT1 // usbctl[1] -// OE bmBIT2 // usbctl[2] - -#endif /* _USRP_REV1_REGS_H_ */ diff --git a/usrp/firmware/src/usrp2/vectors.a51 b/usrp/firmware/src/usrp2/vectors.a51 deleted file mode 100644 index fa579ba8a..000000000 --- a/usrp/firmware/src/usrp2/vectors.a51 +++ /dev/null @@ -1 +0,0 @@ - .include "../common/vectors.a51" diff --git a/usrp/fpga/.gitignore b/usrp/fpga/.gitignore deleted file mode 100644 index b336cc7ce..000000000 --- a/usrp/fpga/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/Makefile -/Makefile.in diff --git a/usrp/fpga/Makefile.am b/usrp/fpga/Makefile.am deleted file mode 100644 index 901a66f0f..000000000 --- a/usrp/fpga/Makefile.am +++ /dev/null @@ -1,22 +0,0 @@ -# -# Copyright 2004,2005,2006 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -SUBDIRS = rbf diff --git a/usrp/fpga/README b/usrp/fpga/README deleted file mode 100644 index 3d1e7ad99..000000000 --- a/usrp/fpga/README +++ /dev/null @@ -1,3 +0,0 @@ -The FPGA source content that used to be here is now hosted at: - -git://ettus.sourcerepo.com/ettus/fpga.git diff --git a/usrp/fpga/rbf/.gitignore b/usrp/fpga/rbf/.gitignore deleted file mode 100644 index eb58a95f5..000000000 --- a/usrp/fpga/rbf/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -/Makefile -/Makefile.in -/usrp_fpga_rev1.rbf -/usrp_fpga_rev2.rbf diff --git a/usrp/fpga/rbf/Makefile.am b/usrp/fpga/rbf/Makefile.am deleted file mode 100644 index 7bce77d5f..000000000 --- a/usrp/fpga/rbf/Makefile.am +++ /dev/null @@ -1,22 +0,0 @@ -# -# Copyright 2005,2006,2009 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -SUBDIRS = rev2 rev4 diff --git a/usrp/fpga/rbf/rev2/.gitignore b/usrp/fpga/rbf/rev2/.gitignore deleted file mode 100644 index b336cc7ce..000000000 --- a/usrp/fpga/rbf/rev2/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/Makefile -/Makefile.in diff --git a/usrp/fpga/rbf/rev2/Makefile.am b/usrp/fpga/rbf/rev2/Makefile.am deleted file mode 100644 index 487650e18..000000000 --- a/usrp/fpga/rbf/rev2/Makefile.am +++ /dev/null @@ -1,31 +0,0 @@ -# -# Copyright 2009 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -include $(top_srcdir)/Makefile.common - -rbf2datadir = $(prefix)/share/usrp/rev2 - -dist_rbf2data_DATA = \ - std_2rxhb_2tx.rbf \ - std_4rx_0tx.rbf \ - inband_1rxhb_1tx.rbf \ - inband_2rxhb_2tx.rbf \ - multi_2rxhb_2tx.rbf diff --git a/usrp/fpga/rbf/rev2/inband_1rxhb_1tx.rbf b/usrp/fpga/rbf/rev2/inband_1rxhb_1tx.rbf Binary files differdeleted file mode 100755 index c1c9af2ce..000000000 --- a/usrp/fpga/rbf/rev2/inband_1rxhb_1tx.rbf +++ /dev/null diff --git a/usrp/fpga/rbf/rev2/inband_2rxhb_2tx.rbf b/usrp/fpga/rbf/rev2/inband_2rxhb_2tx.rbf Binary files differdeleted file mode 100755 index ca1a0f92b..000000000 --- a/usrp/fpga/rbf/rev2/inband_2rxhb_2tx.rbf +++ /dev/null diff --git a/usrp/fpga/rbf/rev2/multi_2rxhb_2tx.rbf b/usrp/fpga/rbf/rev2/multi_2rxhb_2tx.rbf Binary files differdeleted file mode 100755 index 2683d8641..000000000 --- a/usrp/fpga/rbf/rev2/multi_2rxhb_2tx.rbf +++ /dev/null diff --git a/usrp/fpga/rbf/rev2/multi_4rx_0tx.rbf b/usrp/fpga/rbf/rev2/multi_4rx_0tx.rbf Binary files differdeleted file mode 100755 index b7e4eb393..000000000 --- a/usrp/fpga/rbf/rev2/multi_4rx_0tx.rbf +++ /dev/null diff --git a/usrp/fpga/rbf/rev2/std_2rxhb_2tx.rbf b/usrp/fpga/rbf/rev2/std_2rxhb_2tx.rbf Binary files differdeleted file mode 100755 index ee3c30d66..000000000 --- a/usrp/fpga/rbf/rev2/std_2rxhb_2tx.rbf +++ /dev/null diff --git a/usrp/fpga/rbf/rev2/std_4rx_0tx.rbf b/usrp/fpga/rbf/rev2/std_4rx_0tx.rbf Binary files differdeleted file mode 100755 index 1deca9517..000000000 --- a/usrp/fpga/rbf/rev2/std_4rx_0tx.rbf +++ /dev/null diff --git a/usrp/fpga/rbf/rev4/.gitignore b/usrp/fpga/rbf/rev4/.gitignore deleted file mode 100644 index b336cc7ce..000000000 --- a/usrp/fpga/rbf/rev4/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/Makefile -/Makefile.in diff --git a/usrp/fpga/rbf/rev4/Makefile.am b/usrp/fpga/rbf/rev4/Makefile.am deleted file mode 100644 index 54de9b818..000000000 --- a/usrp/fpga/rbf/rev4/Makefile.am +++ /dev/null @@ -1,31 +0,0 @@ -# -# Copyright 2009 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -include $(top_srcdir)/Makefile.common - -rbf4datadir = $(prefix)/share/usrp/rev4 - -dist_rbf4data_DATA = \ - std_2rxhb_2tx.rbf \ - std_4rx_0tx.rbf \ - inband_1rxhb_1tx.rbf \ - inband_2rxhb_2tx.rbf \ - multi_2rxhb_2tx.rbf diff --git a/usrp/fpga/rbf/rev4/inband_1rxhb_1tx.rbf b/usrp/fpga/rbf/rev4/inband_1rxhb_1tx.rbf Binary files differdeleted file mode 100755 index c1c9af2ce..000000000 --- a/usrp/fpga/rbf/rev4/inband_1rxhb_1tx.rbf +++ /dev/null diff --git a/usrp/fpga/rbf/rev4/inband_2rxhb_2tx.rbf b/usrp/fpga/rbf/rev4/inband_2rxhb_2tx.rbf Binary files differdeleted file mode 100755 index ca1a0f92b..000000000 --- a/usrp/fpga/rbf/rev4/inband_2rxhb_2tx.rbf +++ /dev/null diff --git a/usrp/fpga/rbf/rev4/multi_2rxhb_2tx.rbf b/usrp/fpga/rbf/rev4/multi_2rxhb_2tx.rbf Binary files differdeleted file mode 100755 index 2683d8641..000000000 --- a/usrp/fpga/rbf/rev4/multi_2rxhb_2tx.rbf +++ /dev/null diff --git a/usrp/fpga/rbf/rev4/multi_4rx_0tx.rbf b/usrp/fpga/rbf/rev4/multi_4rx_0tx.rbf Binary files differdeleted file mode 100755 index b7e4eb393..000000000 --- a/usrp/fpga/rbf/rev4/multi_4rx_0tx.rbf +++ /dev/null diff --git a/usrp/fpga/rbf/rev4/std_2rxhb_2tx.rbf b/usrp/fpga/rbf/rev4/std_2rxhb_2tx.rbf Binary files differdeleted file mode 100755 index ee3c30d66..000000000 --- a/usrp/fpga/rbf/rev4/std_2rxhb_2tx.rbf +++ /dev/null diff --git a/usrp/fpga/rbf/rev4/std_4rx_0tx.rbf b/usrp/fpga/rbf/rev4/std_4rx_0tx.rbf Binary files differdeleted file mode 100755 index 1deca9517..000000000 --- a/usrp/fpga/rbf/rev4/std_4rx_0tx.rbf +++ /dev/null diff --git a/usrp/host/.gitignore b/usrp/host/.gitignore deleted file mode 100644 index a02b6ff73..000000000 --- a/usrp/host/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -/Makefile -/Makefile.in -/.la -/.lo -/.deps -/.libs -/*.la -/*.lo diff --git a/usrp/host/Makefile.am b/usrp/host/Makefile.am deleted file mode 100644 index aa94fbd6e..000000000 --- a/usrp/host/Makefile.am +++ /dev/null @@ -1,26 +0,0 @@ -# -# Copyright 2001,2007,2009 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -SUBDIRS = misc lib include apps - -if PYTHON -SUBDIRS += swig -endif diff --git a/usrp/host/apps/.gitignore b/usrp/host/apps/.gitignore deleted file mode 100644 index 16fdf27ad..000000000 --- a/usrp/host/apps/.gitignore +++ /dev/null @@ -1,27 +0,0 @@ -/Makefile -/Makefile.in -/.la -/.lo -/.deps -/.libs -/*.la -/*.lo -/*.dat -/usrper -/usrper2 -/test_input -/test_fusb -/test_usrp -/test_usrp0 -/test_usrp_standard_rx -/test_usrp_standard_tx -/test_usrp_inband_timestamps -/test_usrp_inband_registers -/test_usrp_inband_rx -/test_usrp_inband_tx -/test_usrp_basic_rx -/check_order_quickly -/usrp_cal_dc_offset -/test_usrp_inband_cs -/read_packets -/test_usrp_inband_ping diff --git a/usrp/host/apps/Makefile.am b/usrp/host/apps/Makefile.am deleted file mode 100644 index 8aa361b22..000000000 --- a/usrp/host/apps/Makefile.am +++ /dev/null @@ -1,56 +0,0 @@ -# -# Copyright 2003,2006,2008,2009 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -include $(top_srcdir)/Makefile.common - -AM_CPPFLAGS = $(USRP_INCLUDES) $(BOOST_CPPFLAGS) $(CPPUNIT_INCLUDES) \ - $(USB_INCLUDES) $(WITH_INCLUDES) - -bin_PROGRAMS = \ - usrper \ - usrp_cal_dc_offset - -noinst_PROGRAMS = \ - check_order_quickly \ - test_usrp_standard_rx \ - test_usrp_standard_tx - -noinst_HEADERS = \ - time_stuff.h - -noinst_PYTHON = \ - burn-db-eeprom \ - burn-serial-number - - -check_order_quickly_SOURCES = check_order_quickly.cc - -test_usrp_standard_rx_SOURCES = test_usrp_standard_rx.cc time_stuff.c -test_usrp_standard_rx_LDADD = $(USRP_LA) - -test_usrp_standard_tx_SOURCES = test_usrp_standard_tx.cc time_stuff.c -test_usrp_standard_tx_LDADD = $(USRP_LA) $(BOOST_LDFLAGS) $(BOOST_PROGRAM_OPTIONS_LIB) - -usrper_SOURCES = usrper.cc -usrper_LDADD = $(USRP_LA) - -usrp_cal_dc_offset_SOURCES = usrp_cal_dc_offset.cc -usrp_cal_dc_offset_LDADD = $(USRP_LA) diff --git a/usrp/host/apps/burn-db-eeprom b/usrp/host/apps/burn-db-eeprom deleted file mode 100755 index 0c908e3d5..000000000 --- a/usrp/host/apps/burn-db-eeprom +++ /dev/null @@ -1,174 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2005,2007,2009 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -from usrpm.usrp_prims import * -from optparse import OptionParser -import sys -from usrpm.usrp_dbid import * - -i2c_addr_map = { 'TX_A' : 0x54, 'RX_A' : 0x55, 'TX_B' : 0x56, 'RX_B' : 0x57 } - -daughterboards = { - # name : ((tx-dbid, tx-oe), (rx-dbid, rx-oe)) - 'basictx' : ((BASIC_TX, 0x0000), None), - 'basicrx' : (None, (BASIC_RX, 0x0000)), - 'dbsrx' : (None, (DBS_RX, 0x0000)), - 'dbsrx_clkmod' : (None, (DBS_RX_CLKMOD, 0x0000)), - 'tvrx' : (None, (TV_RX, 0x0000)), - 'tvrx2' : (None, (TV_RX_REV_2, 0x0000)), - 'tvrx3' : (None, (TV_RX_REV_3, 0x0000)), - 'tvrx_mimo' : (None, (TV_RX_MIMO, 0x0000)), - 'tvrx2_mimo' : (None, (TV_RX_REV_2_MIMO, 0x0000)), - 'tvrx3_mimo' : (None, (TV_RX_REV_3_MIMO, 0x0000)), - 'dtt754' : (None, (DTT754, 0x0000)), - 'dtt768' : (None, (DTT768, 0x0000)), - 'rfx400' : ((FLEX_400_TX, 0x0000), (FLEX_400_RX, 0x0000)), - 'rfx900' : ((FLEX_900_TX, 0x0000), (FLEX_900_RX, 0x0000)), - 'rfx1200' : ((FLEX_1200_TX, 0x0000), (FLEX_1200_RX, 0x0000)), - 'rfx1800' : ((FLEX_1800_TX, 0x0000), (FLEX_1800_RX, 0x0000)), - 'rfx2400' : ((FLEX_2400_TX, 0x0000), (FLEX_2400_RX, 0x0000)), - 'rfx400_tx' : ((FLEX_400_TX, 0x0000), None), - 'rfx900_tx' : ((FLEX_900_TX, 0x0000), None), - 'rfx1200_tx' : ((FLEX_1200_TX, 0x0000), None), - 'rfx1800_tx' : ((FLEX_1800_TX, 0x0000), None), - 'rfx2400_tx' : ((FLEX_2400_TX, 0x0000), None), - 'rfx400_rx' : (None, (FLEX_400_RX, 0x0000)), - 'rfx900_rx' : (None, (FLEX_900_RX, 0x0000)), - 'rfx1200_rx' : (None, (FLEX_1200_RX, 0x0000)), - 'rfx1800_rx' : (None, (FLEX_1800_RX, 0x0000)), - 'rfx2400_rx' : (None, (FLEX_2400_RX, 0x0000)), - 'rfx400_mimo_a' : ((FLEX_400_TX_MIMO_A, 0x0000), (FLEX_400_RX_MIMO_A, 0x0000)), - 'rfx900_mimo_a' : ((FLEX_900_TX_MIMO_A, 0x0000), (FLEX_900_RX_MIMO_A, 0x0000)), - 'rfx1200_mimo_a' : ((FLEX_1200_TX_MIMO_A, 0x0000), (FLEX_1200_RX_MIMO_A, 0x0000)), - 'rfx1800_mimo_a' : ((FLEX_1800_TX_MIMO_A, 0x0000), (FLEX_1800_RX_MIMO_A, 0x0000)), - 'rfx2400_mimo_a' : ((FLEX_2400_TX_MIMO_A, 0x0000), (FLEX_2400_RX_MIMO_A, 0x0000)), - 'rfx400_mimo_b' : ((FLEX_400_TX_MIMO_B, 0x0000), (FLEX_400_RX_MIMO_B, 0x0000)), - 'rfx900_mimo_b' : ((FLEX_900_TX_MIMO_B, 0x0000), (FLEX_900_RX_MIMO_B, 0x0000)), - 'rfx1200_mimo_b' : ((FLEX_1200_TX_MIMO_B, 0x0000), (FLEX_1200_RX_MIMO_B, 0x0000)), - 'rfx1800_mimo_b' : ((FLEX_1800_TX_MIMO_B, 0x0000), (FLEX_1800_RX_MIMO_B, 0x0000)), - 'rfx2200_mimo_b' : ((FLEX_2200_TX_MIMO_B, 0x0000), (FLEX_2200_RX_MIMO_B, 0x0000)), - 'rfx2400_mimo_b' : ((FLEX_2400_TX_MIMO_B, 0x0000), (FLEX_2400_RX_MIMO_B, 0x0000)), - 'lftx' : ((LF_TX, 0x0000), None), - 'lfrx' : (None, (LF_RX, 0x0000)), - 'wbx_lo' : ((WBX_LO_TX, 0x0000), (WBX_LO_RX, 0x0000)), - 'wbx_ng' : ((WBX_NG_TX, 0x0000), (WBX_NG_RX, 0x0000)), - 'xcvr2450' : ((XCVR2450_TX, 0x0000), (XCVR2450_RX, 0x0000)), - 'bitshark_rx' : (None, (BITSHARK_RX, 0x0000)), - 'experimental_tx' : ((EXPERIMENTAL_TX, 0x0000), None), - 'experimental_rx' : (None, (EXPERIMENTAL_RX, 0x0000)), - } - -def open_cmd_interface(which_board = 0): - if not usrp_load_standard_bits (which_board, 0): - raise RuntimeError, "usrp_load_standard_bits" - dev = usrp_find_device (which_board) - if not dev: - raise RuntimeError, "usrp_find_device" - u = usrp_open_cmd_interface (dev) - if not u: - raise RuntimeError, "usrp_open_cmd_interface" - return u - -def write_dboard_eeprom(u, i2c_addr, dbid, oe): - eeprom = 0x20 * [0] - eeprom[0] = 0xDB # magic value - eeprom[1] = dbid & 0xff - eeprom[2] = (dbid >> 8) & 0xff - eeprom[3] = oe & 0xff - eeprom[4] = (oe >> 8) & 0xff - eeprom[0x1f] = 0xff & (-reduce(lambda x, y: x+y, eeprom)) # checksum - s = ''.join (map (chr, eeprom)) - ok = usrp_eeprom_write (u, i2c_addr, 0, s) - return ok - - -def init_eeprom(u, slot_name, force, dbid, oe): - i2c_addr = i2c_addr_map[slot_name] - e = usrp_eeprom_read (u, i2c_addr, 0, 0x20) - if not e: - print "%s: no d'board, skipped" % (slot_name,) - return True - - if not force and (sum (map (ord, e)) & 0xff) == 0 and ord (e[0]) == 0xDB: - print "%s: already initialized, skipped" % (slot_name,) - return True - - if not write_dboard_eeprom (u, i2c_addr, dbid, oe): - print "%s: failed to write d'board EEPROM" % (slot_name,) - return False - - print "%s: OK" % (slot_name,) - return True - - -def init_daughterboard(u, side, type, force): - ok = True - dbinfo = daughterboards[type] - if dbinfo[0] is not None: # burn tx slot - ok &= init_eeprom(u, 'TX_' + side, force, dbinfo[0][0], dbinfo[0][1]) - if dbinfo[1] is not None: # burn rx slot - ok &= init_eeprom(u, 'RX_' + side, force, dbinfo[1][0], dbinfo[1][1]) - return ok - - -def main(): - dbs = daughterboards.keys() - dbs.sort() - usage = """\ -usage: %prog [options] -You must specify a type with -t or --type, -and at least one side using -A and/or -B.""" - - parser = OptionParser(usage=usage) - parser.add_option ("-t", "--type", type="choice", help="choose type from %r" % (dbs,), - choices=dbs, default=None) - parser.add_option ("-A", "--burn-a", action="store_true", default=False, - help="burn eeprom(s) on side A") - parser.add_option ("-B", "--burn-b", action="store_true", default=False, - help="burn eeprom(s) on side B") - parser.add_option ("-f", "--force", action="store_true", default=False, - help="force init of already initialized eeproms") - (options, args) = parser.parse_args () - - which=[] - if options.burn_a: - which.append('A') - if options.burn_b: - which.append('B') - - if len(args) != 0 or len(which) == 0 or options.type is None: - parser.print_help() - sys.exit (1) - - u = open_cmd_interface (0) - ok = True - for w in which: - ok &= init_daughterboard (u, w, options.type, options.force) - - if ok: - sys.exit (0) - else: - sys.exit (1) - -if __name__ == "__main__": - main () - diff --git a/usrp/host/apps/burn-serial-number b/usrp/host/apps/burn-serial-number deleted file mode 100755 index f9a2a86a5..000000000 --- a/usrp/host/apps/burn-serial-number +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2006,2007 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -from usrpm.usrp_prims import * -from optparse import OptionParser -import sys -import time - - -def open_cmd_interface(which_board = 0): - if not usrp_load_standard_bits (which_board, 0): - raise RuntimeError, "usrp_load_standard_bits" - dev = usrp_find_device (which_board) - if not dev: - raise RuntimeError, "usrp_find_device" - u = usrp_open_cmd_interface (dev) - if not u: - raise RuntimeError, "usrp_open_cmd_interface" - return u - - -def write_serial_number_eeprom(u, serial_number): - if not str(serial_number): - raise TypeError - - i2c_addr = 0x50 # usrp boot rom - serial_number_offset = 248 # offset to serial number - serial_number_len = 8 # length of serial number - - lsn = len(serial_number) - if lsn > serial_number_len: - serial_number = serial_number[0:serial_number_len] - if lsn < serial_number_len: - serial_number = serial_number + (serial_number_len - lsn) * ' ' - - ok = usrp_eeprom_write (u, i2c_addr, serial_number_offset, serial_number) - return ok - - -def main(): - - default_serial_number = hex(int(time.time()))[2:] - parser = OptionParser() - parser.add_option ("-s", "--serial-number", default=default_serial_number, - help="set serial number [default=%default]") - (options, args) = parser.parse_args () - - if len(args) != 0: - parser.print_help() - sys.exit(1) - - u = open_cmd_interface (0) - ok = write_serial_number_eeprom(u, options.serial_number) - - if ok: - sys.exit(0) - else: - sys.exit(1) - -if __name__ == "__main__": - main () diff --git a/usrp/host/apps/check_order b/usrp/host/apps/check_order deleted file mode 100755 index 56e192710..000000000 --- a/usrp/host/apps/check_order +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env python -# -*- Python -*- - -import sys -import fileinput - -skip_count = 4096 -lineno = 0 -last_error = 0 - -for line in fileinput.input (): - lineno += 1 - if lineno < skip_count: - continue - (offset, dec_val, hex_val) = line.split () - if lineno == skip_count: - expected_val = int (dec_val) - int_dec_val = int (dec_val) - int_hex_val = int (hex_val, 16) - if int_dec_val != expected_val: - print "line %6d, delta %4d, expected %6d, got %6d" % (lineno, - lineno - last_error, - expected_val, - int_dec_val) - last_error = lineno - elif ((int_hex_val >> 12) & 0xf) != (int_hex_val & 0xf): - print "line %6d, delta %4d, invalid high bits %04x" % (lineno, - lineno - last_error, - int_hex_val) - last_error = lineno - - # expected_val = (expected_val + 1) & 0xffff - expected_val = (expected_val + 1) & 0x0fff - - - - - - diff --git a/usrp/host/apps/check_order_quickly.cc b/usrp/host/apps/check_order_quickly.cc deleted file mode 100644 index 4fa30c7d9..000000000 --- a/usrp/host/apps/check_order_quickly.cc +++ /dev/null @@ -1,62 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <stdio.h> - -static bool -check (int v, int counter, int offset) -{ - if ((v & 0x0fff) != counter){ - fprintf (stdout, "%08x: expected 0x%04x, got 0x%04x\n", offset, counter, v & 0x0fff); - return false; - } - - if (((v >> 12) & 0xf) != (v & 0xf)){ - fprintf (stdout, "%08x: bad high bits 0x%04x\n", offset, v); - return false; - } - - return true; -} - -int -main (int argc, char **argv) -{ - static const int BUFSIZE = 64 * 1024; - unsigned short buf[BUFSIZE]; - - int n; - int i; - int counter = 0; - int offset = 0; - bool ok = true; - - while ((n = fread (buf, sizeof (short), BUFSIZE, stdin)) != 0){ - for (i = 0; i < n; i++){ - ok &= check (buf[i], counter, offset); - counter = (counter + 1) & 0x0fff; - offset++; - } - } - - return ok ? 0 : 1; -} diff --git a/usrp/host/apps/dump_12bit_shorts b/usrp/host/apps/dump_12bit_shorts deleted file mode 100755 index a896f2dd3..000000000 --- a/usrp/host/apps/dump_12bit_shorts +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env python -# -*- Python -*- - -import sys, errno - -counter = 0 - -try: - while 1: - x = sys.stdin.read (2) - if not x: - break - - v = (ord(x[1]) << 8) | ord(x[0]) - sys.stdout.write ("0x%08x %6d 0x%04x\n" % (counter, v & 0x0fff, v)) - counter += 1 -except IOError, e: - if e.errno == errno.EPIPE: - sys.exit (0) - - - - diff --git a/usrp/host/apps/dump_shorts b/usrp/host/apps/dump_shorts deleted file mode 100755 index 6104ea062..000000000 --- a/usrp/host/apps/dump_shorts +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env python -# -*- Python -*- - -import sys, errno - -counter = 0 - -try: - while 1: - x = sys.stdin.read (2) - if not x: - break - - v = (ord(x[1]) << 8) | ord(x[0]) - sys.stdout.write ("0x%08x %6d 0x%04x\n" % (counter, v, v)) - counter += 1 -except IOError, e: - if e.errno == errno.EPIPE: - sys.exit (0) - - - - diff --git a/usrp/host/apps/run b/usrp/host/apps/run deleted file mode 100755 index 5b13336c7..000000000 --- a/usrp/host/apps/run +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -./test_usrp_standard_rx -D 8 -o rx.bin -./dump_12bit_shorts <rx.bin | head -100000 >rx.ascii -./check_order rx.ascii -#./dump_12bit_shorts <rx.bin | ./check_order diff --git a/usrp/host/apps/run2 b/usrp/host/apps/run2 deleted file mode 100755 index 5fcf154cb..000000000 --- a/usrp/host/apps/run2 +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -./test_usrp_standard_rx -D 8 -o rx.bin -./check_order_quickly <rx.bin diff --git a/usrp/host/apps/run_input b/usrp/host/apps/run_input deleted file mode 100755 index b8afae6f3..000000000 --- a/usrp/host/apps/run_input +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -./test_usrp_standard_rx -D 8 -o rx.bin "$@" -./dump_shorts <rx.bin | head -50000 >rx.ascii - diff --git a/usrp/host/apps/test_usrp_standard_rx.cc b/usrp/host/apps/test_usrp_standard_rx.cc deleted file mode 100644 index 4098decda..000000000 --- a/usrp/host/apps/test_usrp_standard_rx.cc +++ /dev/null @@ -1,273 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003,2006,2008,2009 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <unistd.h> -#include <getopt.h> -#include <assert.h> -#include <math.h> -#include "time_stuff.h" -#include <usrp/usrp_standard.h> -#include <usrp/usrp_bytesex.h> -#include "fpga_regs_common.h" -#include "fpga_regs_standard.h" - -#ifdef HAVE_SCHED_H -#include <sched.h> -#endif - -char *prog_name; - -static bool test_input (usrp_standard_rx_sptr urx, int max_bytes, FILE *fp); - -static void -set_progname (char *path) -{ - char *p = strrchr (path, '/'); - if (p != 0) - prog_name = p+1; - else - prog_name = path; -} - -static void -usage () -{ - fprintf (stderr, "usage: %s [-f] [-v] [-l] [-c] [-D <decim>] [-F freq] [-o output_file]\n", prog_name); - fprintf (stderr, " [-f] loop forever\n"); - fprintf (stderr, " [-M] how many Megabytes to transfer (default 128)\n"); - fprintf (stderr, " [-v] verbose\n"); - fprintf (stderr, " [-l] digital loopback in FPGA\n"); - fprintf (stderr, " [-c] counting in FPGA\n"); - fprintf (stderr, " [-8] 8-bit samples across USB\n"); - fprintf (stderr, " [-B <fusb_block_size>] set fast usb block_size\n"); - fprintf (stderr, " [-N <fusb_nblocks>] set fast usb nblocks\n"); - fprintf (stderr, " [-R] set real time scheduling: SCHED_FIFO; pri = midpoint\n"); - - exit (1); -} - -static void -die (const char *msg) -{ - fprintf (stderr, "die: %s: %s\n", prog_name, msg); - exit (1); -} - -int -main (int argc, char **argv) -{ - bool verbose_p = false; - bool loopback_p = false; - bool counting_p = false; - bool width_8_p = false; - int max_bytes = 128 * (1L << 20); - int ch; - char *output_filename = 0; - int which_board = 0; - int decim = 8; // 32 MB/sec - double center_freq = 0; - int fusb_block_size = 0; - int fusb_nblocks = 0; - bool realtime_p = false; - - - set_progname (argv[0]); - - while ((ch = getopt (argc, argv, "fvlco:D:F:M:8B:N:R")) != EOF){ - switch (ch){ - case 'f': - max_bytes = 0; - break; - - case 'v': - verbose_p = true; - break; - - case 'l': - loopback_p = true; - break; - - case 'c': - counting_p = true; - break; - - case '8': - width_8_p = true; - break; - - case 'o': - output_filename = optarg; - break; - - case 'D': - decim = strtol (optarg, 0, 0); - break; - - case 'F': - center_freq = strtod (optarg, 0); - break; - - case 'M': - max_bytes = strtol (optarg, 0, 0) * (1L << 20); - if (max_bytes < 0) max_bytes = 0; - break; - - case 'B': - fusb_block_size = strtol (optarg, 0, 0); - break; - - case 'N': - fusb_nblocks = strtol (optarg, 0, 0); - break; - - case 'R': - realtime_p = true; - break; - - default: - usage (); - } - } - -#ifdef HAVE_SCHED_SETSCHEDULER - if (realtime_p){ - int policy = SCHED_FIFO; - int pri = (sched_get_priority_max (policy) - sched_get_priority_min (policy)) / 2; - int pid = 0; // this process - - struct sched_param param; - memset(¶m, 0, sizeof(param)); - param.sched_priority = pri; - int result = sched_setscheduler(pid, policy, ¶m); - if (result != 0){ - perror ("sched_setscheduler: failed to set real time priority"); - } - else - printf("SCHED_FIFO enabled with priority = %d\n", pri); - } -#endif - - FILE *fp = 0; - - if (output_filename){ - fp = fopen (output_filename, "wb"); - if (fp == 0) - perror (output_filename); - } - - int mode = 0; - if (loopback_p) - mode |= usrp_standard_rx::FPGA_MODE_LOOPBACK; - if (counting_p) - mode |= usrp_standard_rx::FPGA_MODE_COUNTING; - - - usrp_standard_rx_sptr urx = - usrp_standard_rx::make (which_board, decim, 1, -1, mode, - fusb_block_size, fusb_nblocks); - - if (urx == 0) - die ("usrp_standard_rx::make"); - - if (!urx->set_rx_freq (0, center_freq)) - die ("urx->set_rx_freq"); - - if (width_8_p){ - int width = 8; - int shift = 8; - bool want_q = true; - if (!urx->set_format(usrp_standard_rx::make_format(width, shift, want_q))) - die("urx->set_format"); - } - - urx->start(); // start data xfers - - test_input (urx, max_bytes, fp); - - if (fp) - fclose (fp); - - return 0; -} - - -static bool -test_input (usrp_standard_rx_sptr urx, int max_bytes, FILE *fp) -{ - int fd = -1; - static const int BUFSIZE = urx->block_size(); - static const int N = BUFSIZE/sizeof (short); - short buf[N]; - int nbytes = 0; - - double start_wall_time = get_elapsed_time (); - double start_cpu_time = get_cpu_usage (); - - if (fp) - fd = fileno (fp); - - bool overrun; - int noverruns = 0; - - for (nbytes = 0; max_bytes == 0 || nbytes < max_bytes; nbytes += BUFSIZE){ - - unsigned int ret = urx->read (buf, sizeof (buf), &overrun); - if (ret != sizeof (buf)){ - fprintf (stderr, "test_input: error, ret = %d\n", ret); - } - - if (overrun){ - printf ("rx_overrun\n"); - noverruns++; - } - - if (fd != -1){ - - for (unsigned int i = 0; i < sizeof (buf) / sizeof (short); i++) - buf[i] = usrp_to_host_short (buf[i]); - - if (write (fd, buf, sizeof (buf)) == -1){ - perror ("write"); - fd = -1; - } - } - } - - double stop_wall_time = get_elapsed_time (); - double stop_cpu_time = get_cpu_usage (); - - double delta_wall = stop_wall_time - start_wall_time; - double delta_cpu = stop_cpu_time - start_cpu_time; - - printf ("xfered %.3g bytes in %.3g seconds. %.4g bytes/sec. cpu time = %.4g\n", - (double) max_bytes, delta_wall, max_bytes / delta_wall, delta_cpu); - printf ("noverruns = %d\n", noverruns); - - return true; -} diff --git a/usrp/host/apps/test_usrp_standard_tx.cc b/usrp/host/apps/test_usrp_standard_tx.cc deleted file mode 100644 index cc9f9edfc..000000000 --- a/usrp/host/apps/test_usrp_standard_tx.cc +++ /dev/null @@ -1,314 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003,2004,2008,2009 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <iostream> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <unistd.h> -#include <getopt.h> -#include <assert.h> -#include <math.h> -#include "time_stuff.h" -#include <usrp/usrp_standard.h> -#include <usrp/usrp_bytesex.h> -#include <boost/program_options.hpp> - -enum { - GR_SIN_WAVE, - GR_CONST_WAVE -}; - -namespace po = boost::program_options; - -char *prog_name; - -usrp_subdev_spec -str_to_subdev(std::string spec_str) -{ - usrp_subdev_spec spec; - if(spec_str == "A" || spec_str == "A:0" || spec_str == "0:0") { - spec.side = 0; - spec.subdev = 0; - } - else if(spec_str == "A:1" || spec_str == "0:1") { - spec.side = 0; - spec.subdev = 1; - } - else if(spec_str == "B" || spec_str == "B:0" || spec_str == "1:0") { - spec.side = 1; - spec.subdev = 0; - } - else if(spec_str == "B:1" || spec_str == "1:1") { - spec.side = 1; - spec.subdev = 1; - } - else { - throw std::range_error("Incorrect subdevice specifications.\n"); - } - - return spec; -} - - -static void -set_progname (char *path) -{ - char *p = strrchr (path, '/'); - if (p != 0) - prog_name = p+1; - else - prog_name = path; -} - -static void -die (const char *msg) -{ - fprintf (stderr, "die: %s: %s\n", prog_name, msg); - exit (1); -} - - -static bool -test_output (usrp_standard_tx_sptr utx, long long max_bytes, double ampl, int waveform) -{ - const int BUFSIZE = utx->block_size(); - const int N = BUFSIZE/sizeof (short); - - short buf[N]; - long long nbytes = 0; - - // ---------------------------------------------------------------- - // one time initialization of the pattern we're going to transmit - - const int PERIOD = 65; // any value is valid - const int PATLEN = 2 * PERIOD; - short pattern[PATLEN]; - - for (int i = 0; i < PERIOD; i++){ - if (waveform == GR_CONST_WAVE){ - pattern[2*i+0] = host_to_usrp_short((short) ampl); - pattern[2*i+1] = host_to_usrp_short((short) 0); - } - else { - pattern[2*i+0] = host_to_usrp_short((short) (ampl * cos(2*M_PI * i / PERIOD))); - pattern[2*i+1] = host_to_usrp_short((short) (ampl * sin(2*M_PI * i / PERIOD))); - } - } - - // ---------------------------------------------------------------- - - double start_wall_time = get_elapsed_time (); - double start_cpu_time = get_cpu_usage (); - - bool underrun; - int nunderruns = 0; - int pi = 0; - - for (nbytes = 0; max_bytes == 0 || nbytes < max_bytes; nbytes += BUFSIZE){ - - for (int i = 0; i < N; i++){ - buf[i] = pattern[pi]; - pi++; - if (pi >= PATLEN) - pi = 0; - } - - int ret = utx->write (buf, sizeof (buf), &underrun); - if ((unsigned) ret != sizeof (buf)){ - fprintf (stderr, "test_output: error, ret = %d\n", ret); - } - - if (underrun){ - nunderruns++; - printf ("tx_underrun\n"); - //printf ("tx_underrun %9d %6d\n", nbytes, nbytes/BUFSIZE); - } - } - - utx->wait_for_completion (); - - double stop_wall_time = get_elapsed_time (); - double stop_cpu_time = get_cpu_usage (); - - double delta_wall = stop_wall_time - start_wall_time; - double delta_cpu = stop_cpu_time - start_cpu_time; - - printf ("xfered %.3g bytes in %.3g seconds. %.4g bytes/sec. cpu time = %.3g\n", - (double) max_bytes, delta_wall, max_bytes / delta_wall, delta_cpu); - - printf ("%d underruns\n", nunderruns); - - return true; -} - -int -main (int argc, char **argv) -{ - int which = 0; // specify which USRP board - usrp_subdev_spec spec(0,0); // specify the d'board side - int interp = 16; // set the interpolation rate - double rf_freq = -1; // set the frequency - float amp = 10000; // set the amplitude of the output - float gain = -1; // set the d'board PGA gain - int waveform; - int fusb_block_size = 0; - int fusb_nblocks = 0; - bool realtime_p = false; - double nsamples = 32e6; - - set_progname (argv[0]); - - po::options_description cmdconfig("Program options"); - cmdconfig.add_options() - ("help,h", "produce help message") - ("which,W", po::value<int>(&which), "select which USRP board") - ("tx-subdev-spec,T", po::value<std::string>(), "select USRP Tx side A or B") - ("rf-freq,f", po::value<double>(), "set RF center frequency to FREQ") - ("interp,i", po::value<int>(&interp), "set fgpa interpolation rate to INTERP") - - ("sine", "generate a complex sinusoid [default]") - ("const", "generate a constant output") - - //("waveform-freq,w", po::value<double>(&wfreq), "set waveform frequency to FREQ") - ("amplitude,a", po::value<float>(&), "set amplitude") - ("gain,g", po::value<float>(&gain), "set output gain to GAIN [default=MAX]") - //("offset,o", po::value<float>(&offset), "set waveform offset to OFFSET") - ("nsamples,N", po::value<double>(&nsamples), "number of samples to send [default=32M]") - ; - - po::variables_map vm; - po::store(po::command_line_parser(argc, argv). - options(cmdconfig).run(), vm); - po::notify(vm); - - if (vm.count("help")) { - std::cout << cmdconfig << "\n"; - return 1; - } - - if(vm.count("tx-subdev-spec")) { - std::string s = vm["tx-subdev-spec"].as<std::string>(); - spec = str_to_subdev(s); - } - - if(vm.count("sine")) { - waveform = GR_SIN_WAVE; - } - else if(vm.count("const")) { - waveform = GR_CONST_WAVE; - } - else { - waveform = GR_SIN_WAVE; - } - - printf("which: %d\n", which); - printf("interp: %d\n", interp); - printf("rf_freq: %g\n", rf_freq); - printf("amp: %f\n", amp); - printf("nsamples: %g\n", nsamples); - - - if (realtime_p){ - // FIXME - } - - usrp_standard_tx_sptr utx; - - utx = usrp_standard_tx::make (which, - interp, - 1, // nchan - -1, // mux - fusb_block_size, - fusb_nblocks); - - if (utx == 0) - die ("usrp_standard_tx::make"); - - // FIXME - - db_base_sptr subdev = utx->selected_subdev(spec); - printf("Subdevice name is %s\n", subdev->name().c_str()); - printf("Subdevice freq range: (%g, %g)\n", - subdev->freq_min(), subdev->freq_max()); - - unsigned int mux = utx->determine_tx_mux_value(spec); - printf("mux: %#08x\n", mux); - utx->set_mux(mux); - - if(gain == -1) - gain = subdev->gain_max(); - subdev->set_gain(gain); - - float input_rate = utx->dac_rate() / utx->interp_rate(); - printf("baseband rate: %g\n", input_rate); - - usrp_tune_result r; - - if (rf_freq < 0) - rf_freq = (subdev->freq_min() + subdev->freq_max()) * 0.5; - double target_freq = rf_freq; - bool ok = utx->tune(subdev->which(), subdev, target_freq, &r); - - if(!ok) { - throw std::runtime_error("Could not set frequency."); - } - - subdev->set_enable(true); - - printf("target_freq: %f\n", target_freq); - printf("ok: %s\n", ok ? "true" : "false"); - printf("r.baseband_freq: %f\n", r.baseband_freq); - printf("r.dxc_freq: %f\n", r.dxc_freq); - printf("r.residual_freq: %f\n", r.residual_freq); - printf("r.inverted: %d\n", r.inverted); - - - fflush (stdout); - fflush (stderr); - - utx->start(); // start data xfers - - test_output (utx, (long long) nsamples, amp, waveform); - - return 0; -} - - -#if 0 - case 'B': - fusb_block_size = strtol (optarg, 0, 0); - break; - - case 'N': - fusb_nblocks = strtol (optarg, 0, 0); - break; - - case 'R': - realtime_p = true; - break; - -#endif diff --git a/usrp/host/apps/time_stuff.c b/usrp/host/apps/time_stuff.c deleted file mode 100644 index 89a4a3815..000000000 --- a/usrp/host/apps/time_stuff.c +++ /dev/null @@ -1,68 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "time_stuff.h" - -#include <sys/time.h> -#ifdef HAVE_SYS_RESOURCE_H -#include <sys/resource.h> -#endif -#include <unistd.h> - -static double -timeval_to_secs (struct timeval *tv) -{ - return (double) tv->tv_sec + (double) tv->tv_usec * 1e-6; -} - -double -get_cpu_usage (void) -{ -#ifdef HAVE_GETRUSAGE - struct rusage ru; - - if (getrusage (RUSAGE_SELF, &ru) != 0) - return 0; - - return timeval_to_secs (&ru.ru_utime) + timeval_to_secs (&ru.ru_stime); -#else - return 0; /* FIXME */ -#endif -} - -/* - * return elapsed time (wall time) in seconds - */ -double -get_elapsed_time (void) -{ - struct timeval tv; - if (gettimeofday (&tv, 0) != 0) - return 0; - - return timeval_to_secs (&tv); -} - diff --git a/usrp/host/apps/time_stuff.h b/usrp/host/apps/time_stuff.h deleted file mode 100644 index 74b79f388..000000000 --- a/usrp/host/apps/time_stuff.h +++ /dev/null @@ -1,48 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _TIME_STUFF_H_ -#define _TIME_STUFF_H_ - - - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * return USER + SYS cpu time in seconds - */ -double get_cpu_usage (void); - -/* - * return elapsed time in seconds - */ -double get_elapsed_time (void); - - -#ifdef __cplusplus -} -#endif - - -#endif /* _TIME_STUFF_H_ */ diff --git a/usrp/host/apps/usrp_cal_dc_offset.cc b/usrp/host/apps/usrp_cal_dc_offset.cc deleted file mode 100644 index 5f708d672..000000000 --- a/usrp/host/apps/usrp_cal_dc_offset.cc +++ /dev/null @@ -1,239 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005,2008,2009 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <unistd.h> -#include <getopt.h> -#include <assert.h> -#include <math.h> -#include <boost/scoped_ptr.hpp> -#include <usrp/usrp_local_sighandler.h> -#include <usrp/usrp_standard.h> -#include <usrp/usrp_bytesex.h> - -char *prog_name; - - - - -static void -run_cal(usrp_standard_rx_sptr u, int which_side, int decim, bool verbose_p) -{ - static const int BUFSIZE = u->block_size(); - static const int N = BUFSIZE/sizeof (short); - short buf[N]; - bool cal_done = false; - bool overrun; - int noverruns = 0; - - static const double K = 1e-4; - long integrator[2]; - int offset[2]; - - integrator[0] = 0; - integrator[1] = 0; - offset[0] = 0; - offset[1] = 0; - - u->start(); // start data xfers - - while(!cal_done){ - int ret = u->read (buf, sizeof (buf), &overrun); - if (ret != (int) sizeof (buf)){ - fprintf (stderr, "usrp_cal_dc_offset: error, ret = %d\n", ret); - continue; - } - if (overrun){ - fprintf (stderr, "O"); - noverruns++; - } - else { - // fputc('.', stderr); - } - - static const int MAX = (1L << 30); // 1G - - for (int i = 0; i < N/2; i++){ - for (int n = 0; n < 2; n++){ - integrator[n] = integrator[n] + buf[2*i + n]; - if (integrator[n] > MAX) - integrator[n] = MAX; - else if (integrator[n] < -MAX) - integrator[n] = -MAX; - } - } - -#if 1 - for (int n = 0; n < 2; n++){ - offset[n] = (int) rint(integrator[n] * K); - if (offset[n] > 32767) - offset[n] = 32767; - else if (offset[n] < -32767) - offset[n] = -32767; - u->set_adc_offset(which_side * 2 + n, offset[n]); - } -#else - offset[0] = (int) rint(integrator[0] * K); - if (offset[0] > 32767) - offset[0] = 32767; - else if (offset[0] < -32767) - offset[0] = -32767; - u->set_adc_offset(which_side * 2 + 0, offset[0]); - u->set_adc_offset(which_side * 2 + 1, offset[0]); -#endif - - - printf ("%9ld : %6d\t\t%9ld : %6d\n", - integrator[0], offset[0], integrator[1], offset[1]); - } - - u->stop(); -} - - -static void -set_progname (char *path) -{ - char *p = strrchr (path, '/'); - if (p != 0) - prog_name = p+1; - else - prog_name = path; -} - -static void -usage () -{ - fprintf(stderr, "usage: %s [-v] [-w which_side] [-D decim] [-c ddc_freq] [-g gain]\n", prog_name); - fprintf(stderr, " [-S fusb_block_size] [-N fusb_nblocks]\n"); - exit (1); -} - -static void -die (const char *msg) -{ - fprintf (stderr, "die: %s: %s\n", prog_name, msg); - exit (1); -} - -int -main (int argc, char **argv) -{ - int ch; - int decim = 128; // 500 kS/sec - bool verbose_p = false; - int which_board = 0; - int which_side = 0; - double ddc_freq = 0; - int fusb_block_size = 1024; - int fusb_nblocks = 4; - double pga_gain = 0.0; - - set_progname(argv[0]); - - while ((ch = getopt (argc, argv, "vw:D:c:S:N:g:")) != EOF){ - switch (ch){ - - case 'w': - which_side = strtol (optarg, 0, 0); - if (which_side < 0 || which_side > 1) - usage(); - break; - - case 'D': - decim = strtol (optarg, 0, 0); - if (decim < 1) - usage(); - break; - - case 'c': - ddc_freq = strtod (optarg, 0); - break; - - case 'v': - verbose_p = true; - break; - - case 'S': - fusb_block_size = strtol(optarg, 0, 0); - break; - - case 'N': - fusb_nblocks = strtol(optarg, 0, 0); - break; - - case 'g': - pga_gain = strtod (optarg, 0); - break; - - default: - usage (); - } - } - - int nchannels = 1; - int mode = usrp_standard_rx::FPGA_MODE_NORMAL; - int mux; - - if (which_side == 0) - mux = 0x00000010; - else - mux = 0x00000032; - -#ifdef SIGINT - usrp_local_sighandler sigint (SIGINT, usrp_local_sighandler::throw_signal); -#endif -#ifdef SIGQUIT - usrp_local_sighandler sigquit (SIGQUIT, usrp_local_sighandler::throw_signal); -#endif - - usrp_standard_rx_sptr urx = - usrp_standard_rx::make(which_board, decim, - nchannels, mux, mode, - fusb_block_size, fusb_nblocks); - if (!urx) - die("usrp_standard_rx::make"); - - try { - - if (!urx->set_rx_freq(0, ddc_freq)) - die("urx->set_rx_freq"); - - urx->set_pga(2 * which_side + 0, pga_gain); - urx->set_pga(2 * which_side + 1, pga_gain); - - run_cal(urx, which_side, decim, verbose_p); - } - catch (usrp_signal &sig){ - fprintf (stderr, "usrp_cal_dc_offset: caught %s\n", sig.name().c_str()); - } - catch(...){ - fprintf (stderr, "usrp_cal_dc_offset: caught something\n"); - } -} - diff --git a/usrp/host/apps/usrper.cc b/usrp/host/apps/usrper.cc deleted file mode 100644 index 593cd7921..000000000 --- a/usrp/host/apps/usrper.cc +++ /dev/null @@ -1,356 +0,0 @@ -/* -*- c++ -*- */ -/* - * USRP - Universal Software Radio Peripheral - * - * Copyright (C) 2003,2004,2009 Free Software Foundation, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Boston, MA 02110-1301 USA - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <unistd.h> -#include <getopt.h> -#include <assert.h> -#include <errno.h> - -#include "usrp/usrp_prims.h" -#include "usrp_spi_defs.h" - -char *prog_name; - -static void -set_progname (char *path) -{ - char *p = strrchr (path, '/'); - if (p != 0) - prog_name = p+1; - else - prog_name = path; -} - -static void -usage () -{ - fprintf (stderr, "usage: \n"); - fprintf (stderr, " %s [-v] [-w <which_board>] [-x] ...\n", prog_name); - fprintf (stderr, " %s load_standard_bits\n", prog_name); - fprintf (stderr, " %s load_firmware <file.ihx>\n", prog_name); - fprintf (stderr, " %s load_fpga <file.rbf>\n", prog_name); - fprintf (stderr, " %s write_fpga_reg <reg8> <value32>\n", prog_name); - fprintf (stderr, " %s set_fpga_reset {on|off}\n", prog_name); - fprintf (stderr, " %s set_fpga_tx_enable {on|off}\n", prog_name); - fprintf (stderr, " %s set_fpga_rx_enable {on|off}\n", prog_name); - fprintf (stderr, " ----- diagnostic routines -----\n"); - fprintf (stderr, " %s led0 {on|off}\n", prog_name); - fprintf (stderr, " %s led1 {on|off}\n", prog_name); - fprintf (stderr, " %s set_hash0 <hex-string>\n", prog_name); - fprintf (stderr, " %s get_hash0\n", prog_name); - fprintf (stderr, " %s i2c_read i2c_addr len\n", prog_name); - fprintf (stderr, " %s i2c_write i2c_addr <hex-string>\n", prog_name); - fprintf (stderr, " %s 9862a_write regno value\n", prog_name); - fprintf (stderr, " %s 9862b_write regno value\n", prog_name); - fprintf (stderr, " %s 9862a_read regno\n", prog_name); - fprintf (stderr, " %s 9862b_read regno\n", prog_name); - exit (1); -} - -#if 0 -static void -die (const char *msg) -{ - fprintf (stderr, "%s (die): %s\n", prog_name, msg); - exit (1); -} -#endif - -static int -hexval (char ch) -{ - if ('0' <= ch && ch <= '9') - return ch - '0'; - - if ('a' <= ch && ch <= 'f') - return ch - 'a' + 10; - - if ('A' <= ch && ch <= 'F') - return ch - 'A' + 10; - - return -1; -} - -static unsigned char * -hex_string_to_binary (const char *string, int *lenptr) -{ - int sl = strlen (string); - if (sl & 0x01){ - fprintf (stderr, "%s: odd number of chars in <hex-string>\n", prog_name); - return 0; - } - - int len = sl / 2; - *lenptr = len; - unsigned char *buf = new unsigned char [len]; - - for (int i = 0; i < len; i++){ - int hi = hexval (string[2 * i]); - int lo = hexval (string[2 * i + 1]); - if (hi < 0 || lo < 0){ - fprintf (stderr, "%s: invalid char in <hex-string>\n", prog_name); - delete [] buf; - return 0; - } - buf[i] = (hi << 4) | lo; - } - return buf; -} - -static void -print_hex (FILE *fp, unsigned char *buf, int len) -{ - for (int i = 0; i < len; i++){ - fprintf (fp, "%02x", buf[i]); - } - fprintf (fp, "\n"); -} - -static void -chk_result (bool ok) -{ - if (!ok){ - fprintf (stderr, "%s: failed\n", prog_name); - exit (1); - } -} - -static bool -get_on_off (const char *s) -{ - if (strcmp (s, "on") == 0) - return true; - - if (strcmp (s, "off") == 0) - return false; - - usage (); // no return - return false; -} - - -int -main (int argc, char **argv) -{ - int ch; - bool verbose = false; - int which_board = 0; - bool fx2_ok_p = false; - - set_progname (argv[0]); - - while ((ch = getopt (argc, argv, "vw:x")) != EOF){ - switch (ch){ - - case 'v': - verbose = true; - break; - - case 'w': - which_board = strtol (optarg, 0, 0); - break; - - case 'x': - fx2_ok_p = true; - break; - - default: - usage (); - } - } - - int nopts = argc - optind; - - if (nopts < 1) - usage (); - - const char *cmd = argv[optind++]; - nopts--; - - usrp_one_time_init (); - - - libusb_device *udev = usrp_find_device (which_board, fx2_ok_p); - if (udev == 0){ - fprintf (stderr, "%s: failed to find usrp[%d]\n", prog_name, which_board); - exit (1); - } - - if (usrp_unconfigured_usrp_p (udev)){ - fprintf (stderr, "%s: found unconfigured usrp; needs firmware.\n", prog_name); - } - - if (usrp_fx2_p (udev)){ - fprintf (stderr, "%s: found unconfigured FX2; needs firmware.\n", prog_name); - } - - libusb_device_handle *udh = usrp_open_cmd_interface (udev); - if (udh == 0){ - fprintf (stderr, "%s: failed to open_cmd_interface\n", prog_name); - exit (1); - } - -#define CHKARGS(n) if (nopts != n) usage (); else - - if (strcmp (cmd, "led0") == 0){ - CHKARGS (1); - bool on = get_on_off (argv[optind]); - chk_result (usrp_set_led (udh, 0, on)); - } - else if (strcmp (cmd, "led1") == 0){ - CHKARGS (1); - bool on = get_on_off (argv[optind]); - chk_result (usrp_set_led (udh, 1, on)); - } - else if (strcmp (cmd, "led2") == 0){ - CHKARGS (1); - bool on = get_on_off (argv[optind]); - chk_result (usrp_set_led (udh, 2, on)); - } - else if (strcmp (cmd, "set_hash0") == 0){ - CHKARGS (1); - char *p = argv[optind]; - unsigned char buf[16]; - - memset (buf, ' ', 16); - for (int i = 0; i < 16 && *p; i++) - buf[i] = *p++; - - chk_result (usrp_set_hash (udh, 0, buf)); - } - else if (strcmp (cmd, "get_hash0") == 0){ - CHKARGS (0); - unsigned char buf[17]; - memset (buf, 0, 17); - bool r = usrp_get_hash (udh, 0, buf); - if (r) - printf ("hash: %s\n", buf); - chk_result (r); - } - else if (strcmp (cmd, "load_fpga") == 0){ - CHKARGS (1); - char *filename = argv[optind]; - chk_result (usrp_load_fpga (udh, filename, true)); - } - else if (strcmp (cmd, "load_firmware") == 0){ - CHKARGS (1); - char *filename = argv[optind]; - chk_result (usrp_load_firmware (udh, filename, true)); - } - else if (strcmp (cmd, "write_fpga_reg") == 0){ - CHKARGS (2); - chk_result (usrp_write_fpga_reg (udh, strtoul (argv[optind], 0, 0), - strtoul(argv[optind+1], 0, 0))); - } - else if (strcmp (cmd, "set_fpga_reset") == 0){ - CHKARGS (1); - chk_result (usrp_set_fpga_reset (udh, get_on_off (argv[optind]))); - } - else if (strcmp (cmd, "set_fpga_tx_enable") == 0){ - CHKARGS (1); - chk_result (usrp_set_fpga_tx_enable (udh, get_on_off (argv[optind]))); - } - else if (strcmp (cmd, "set_fpga_rx_enable") == 0){ - CHKARGS (1); - chk_result (usrp_set_fpga_rx_enable (udh, get_on_off (argv[optind]))); - } - else if (strcmp (cmd, "load_standard_bits") == 0){ - CHKARGS (0); - usrp_close_interface (udh); - udh = 0; - chk_result (usrp_load_standard_bits (which_board, true)); - } - else if (strcmp (cmd, "i2c_read") == 0){ - CHKARGS (2); - int i2c_addr = strtol (argv[optind], 0, 0); - int len = strtol (argv[optind + 1], 0, 0); - if (len < 0) - chk_result (0); - - unsigned char *buf = new unsigned char [len]; - bool result = usrp_i2c_read (udh, i2c_addr, buf, len); - if (!result){ - chk_result (0); - } - print_hex (stdout, buf, len); - } - else if (strcmp (cmd, "i2c_write") == 0){ - CHKARGS (2); - int i2c_addr = strtol (argv[optind], 0, 0); - int len = 0; - char *hex_string = argv[optind + 1]; - unsigned char *buf = hex_string_to_binary (hex_string, &len); - if (buf == 0) - chk_result (0); - - bool result = usrp_i2c_write (udh, i2c_addr, buf, len); - chk_result (result); - } - else if (strcmp (cmd, "9862a_write") == 0){ - CHKARGS (2); - int regno = strtol (argv[optind], 0, 0); - int value = strtol (argv[optind+1], 0, 0); - chk_result (usrp_9862_write (udh, 0, regno, value)); - } - else if (strcmp (cmd, "9862b_write") == 0){ - CHKARGS (2); - int regno = strtol (argv[optind], 0, 0); - int value = strtol (argv[optind+1], 0, 0); - chk_result (usrp_9862_write (udh, 1, regno, value)); - } - else if (strcmp (cmd, "9862a_read") == 0){ - CHKARGS (1); - int regno = strtol (argv[optind], 0, 0); - unsigned char value; - bool result = usrp_9862_read (udh, 0, regno, &value); - if (!result){ - chk_result (0); - } - fprintf (stdout, "reg[%d] = 0x%02x\n", regno, value); - } - else if (strcmp (cmd, "9862b_read") == 0){ - CHKARGS (1); - int regno = strtol (argv[optind], 0, 0); - unsigned char value; - bool result = usrp_9862_read (udh, 1, regno, &value); - if (!result){ - chk_result (0); - } - fprintf (stdout, "reg[%d] = 0x%02x\n", regno, value); - } - else { - usage (); - } - - if (udh){ - usrp_close_interface (udh); - udh = 0; - } - - return 0; -} diff --git a/usrp/host/include/.gitignore b/usrp/host/include/.gitignore deleted file mode 100644 index b336cc7ce..000000000 --- a/usrp/host/include/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/Makefile -/Makefile.in diff --git a/usrp/host/include/Makefile.am b/usrp/host/include/Makefile.am deleted file mode 100644 index 5de5fe58e..000000000 --- a/usrp/host/include/Makefile.am +++ /dev/null @@ -1,23 +0,0 @@ -# -# Copyright 2009 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -SUBDIRS = usrp - diff --git a/usrp/host/include/usrp/.gitignore b/usrp/host/include/usrp/.gitignore deleted file mode 100644 index 0f068a1f3..000000000 --- a/usrp/host/include/usrp/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/Makefile -/Makefile.in - -# Generated files -/libusb_types.h -/usrp_dbid.h diff --git a/usrp/host/include/usrp/Makefile.am b/usrp/host/include/usrp/Makefile.am deleted file mode 100644 index 19504313b..000000000 --- a/usrp/host/include/usrp/Makefile.am +++ /dev/null @@ -1,54 +0,0 @@ -# -# Copyright 2009,2010 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -include $(top_srcdir)/Makefile.common - -usrpincludedir = $(includedir)/usrp - -usrpinclude_HEADERS = \ - db_base.h \ - db_basic.h \ - db_bitshark_rx.h \ - db_dbs_rx.h \ - db_dtt754.h \ - db_dtt768.h \ - db_flexrf.h \ - db_flexrf_mimo.h \ - db_tv_rx.h \ - db_tv_rx_mimo.h \ - db_wbxng.h \ - db_xcvr2450.h \ - libusb_types.h \ - usrp_basic.h \ - usrp_bytesex.h \ - usrp_dbid.h \ - usrp_local_sighandler.h \ - usrp_prims.h \ - usrp_slots.h \ - usrp_standard.h \ - usrp_subdev_spec.h \ - usrp_tune_result.h - -EXTRA_DIST += \ - libusb_types.h.in - -swiginclude_HEADERS = \ - db_base.i diff --git a/usrp/host/include/usrp/db_base.h b/usrp/host/include/usrp/db_base.h deleted file mode 100644 index 35470891a..000000000 --- a/usrp/host/include/usrp/db_base.h +++ /dev/null @@ -1,119 +0,0 @@ -/* -*- c++ -*- */ -// -// Copyright 2008 Free Software Foundation, Inc. -// -// This file is part of GNU Radio -// -// GNU Radio is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either asversion 3, or (at your option) -// any later version. -// -// GNU Radio is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with GNU Radio; see the file COPYING. If not, write to -// the Free Software Foundation, Inc., 51 Franklin Street, -// Boston, MA 02110-1301, USA. -// - -#ifndef INCLUDED_DB_BASE_H -#define INCLUDED_DB_BASE_H - -#include <string> -#include <boost/shared_ptr.hpp> -#include <boost/weak_ptr.hpp> -#include <iosfwd> - -class db_base; -typedef boost::shared_ptr<db_base> db_base_sptr; - -class usrp_basic; -typedef boost::shared_ptr<usrp_basic> usrp_basic_sptr; - -struct freq_result_t -{ - bool ok; - double baseband_freq; -}; - -/******************************************************************************/ - -/*! - * \brief Abstract base class for all USRP daughterboards - * \ingroup usrp - */ -class db_base -{ - protected: - bool d_is_shutdown; - usrp_basic *d_raw_usrp; - int d_which; - double d_lo_offset; - - void _enable_refclk(bool enable); - virtual double _refclk_freq(); - virtual int _refclk_divisor(); - - usrp_basic *usrp(){ - return d_raw_usrp; - } - - public: - db_base(boost::shared_ptr<usrp_basic> usrp, int which); - virtual ~db_base(); - - int dbid(); - std::string name(); - std::string side_and_name(); - int which() { return d_which; } - - bool bypass_adc_buffers(bool bypass); - bool set_atr_mask(int v); - bool set_atr_txval(int v); - bool set_atr_rxval(int v); - bool set_atr_tx_delay(int v); - bool set_atr_rx_delay(int v); - bool set_lo_offset(double offset); - double lo_offset() { return d_lo_offset; } - - - //////////////////////////////////////////////////////// - // derived classes should override the following methods - -protected: - friend class usrp_basic; - - /*! - * Called to shutdown daughterboard. Called from dtor and usrp_basic dtor. - * - * N.B., any class that overrides shutdown MUST call shutdown in its destructor. - */ - virtual void shutdown(); - - -public: - virtual float gain_min() = 0; - virtual float gain_max() = 0; - virtual float gain_db_per_step() = 0; - virtual double freq_min() = 0; - virtual double freq_max() = 0; - virtual struct freq_result_t set_freq(double target_freq) = 0; - virtual bool set_gain(float gain) = 0; - virtual bool is_quadrature() = 0; - virtual bool i_and_q_swapped(); - virtual bool spectrum_inverted(); - virtual bool set_enable(bool on); - virtual bool set_auto_tr(bool on); - virtual bool select_rx_antenna(int which_antenna); - virtual bool select_rx_antenna(const std::string &which_antenna); - virtual bool set_bw(float bw); -}; - - -std::ostream & operator<<(std::ostream &os, db_base &x); - -#endif /* INCLUDED_DB_BASE_H */ diff --git a/usrp/host/include/usrp/db_base.i b/usrp/host/include/usrp/db_base.i deleted file mode 100644 index fdabd4f99..000000000 --- a/usrp/host/include/usrp/db_base.i +++ /dev/null @@ -1,103 +0,0 @@ -/* -*- c++ -*- */ -// -// Copyright 2008,2009 Free Software Foundation, Inc. -// -// This file is part of GNU Radio -// -// GNU Radio is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 3, or (at your option) -// any later version. -// -// GNU Radio is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with GNU Radio; see the file COPYING. If not, write to -// the Free Software Foundation, Inc., 51 Franklin Street, -// Boston, MA 02110-1301, USA. -// - - -%{ -#include <usrp/db_base.h> -%} - -%include <gr_shared_ptr.i> - -class usrp_tune_result -{ -public: - usrp_tune_result(double baseband=0, double dxc=0, - double residual=0, bool inv=0); - ~usrp_tune_result(); - - double baseband_freq; - double dxc_freq; - double residual_freq; - bool inverted; -}; - -struct freq_result_t -{ - bool ok; - double baseband_freq; -}; - -class db_base -{ - private: - db_base(boost::shared_ptr<usrp_basic> usrp, int which); - - public: - virtual ~db_base(); - - int dbid(); - std::string name(); - std::string side_and_name(); - int which() { return d_which; } - - bool bypass_adc_buffers(bool bypass); - bool set_atr_mask(int v); - bool set_atr_txval(int v); - bool set_atr_rxval(int v); - bool set_atr_tx_delay(int v); - bool set_atr_rx_delay(int v); - bool set_lo_offset(double offset); - double lo_offset() { return d_lo_offset; } - - virtual float gain_min() = 0; - virtual float gain_max() = 0; - virtual float gain_db_per_step() = 0; - virtual double freq_min() = 0; - virtual double freq_max() = 0; - virtual struct freq_result_t set_freq(double target_freq) = 0; - virtual bool set_gain(float gain) = 0; - virtual bool is_quadrature() = 0; - virtual bool i_and_q_swapped(); - virtual bool spectrum_inverted(); - virtual bool set_enable(bool on); - virtual bool set_auto_tr(bool on); - virtual bool select_rx_antenna(int which_antenna); - virtual bool select_rx_antenna(const std::string &antenna); - virtual bool set_bw(float bw); -}; - -// Create templates for db's, vectors of db's, and vector of vectors of db's -typedef boost::shared_ptr<db_base> db_base_sptr; -%template(db_base_sptr) boost::shared_ptr<db_base>; -%template(db_base_sptr_vector) std::vector<db_base_sptr>; -%template(db_base_sptr_vector_vector) std::vector<std::vector<db_base_sptr> >; - -#ifdef SWIGPYTHON -// Set better class name in Python -// Enable freq_range and gain_range from public methods of class not implemented in C++ -// And create a dummy wrapper for backwards compatability with some of the example code -%pythoncode %{ - db_base_sptr.__repr__ = lambda self: "<db_base::%s>" % (self.name(),) - db_base_sptr.freq_range = lambda self: (self.freq_min(), self.freq_max(), 1) - db_base_sptr.gain_range = lambda self: (self.gain_min(), self.gain_max(), self.gain_db_per_step()) -%} -#endif diff --git a/usrp/host/include/usrp/db_basic.h b/usrp/host/include/usrp/db_basic.h deleted file mode 100644 index 7f81733f4..000000000 --- a/usrp/host/include/usrp/db_basic.h +++ /dev/null @@ -1,99 +0,0 @@ -/* -*- c++ -*- */ -// -// Copyright 2008,2009 Free Software Foundation, Inc. -// -// This file is part of GNU Radio -// -// GNU Radio is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either asversion 3, or (at your option) -// any later version. -// -// GNU Radio is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with GNU Radio; see the file COPYING. If not, write to -// the Free Software Foundation, Inc., 51 Franklin Street, -// Boston, MA 02110-1301, USA. - -#ifndef DB_BASIC_H -#define DB_BASIC_H - -#include <usrp/db_base.h> - - -/******************************************************************************/ - - -class db_basic_tx : public db_base -{ -public: - db_basic_tx(usrp_basic_sptr usrp, int which); - ~db_basic_tx(); - - float gain_min(); - float gain_max(); - float gain_db_per_step(); - double freq_min(); - double freq_max(); - struct freq_result_t set_freq(double target_freq); - bool set_gain(float gain); - bool is_quadrature(); -}; - - -/******************************************************************************/ - - -class db_basic_rx : public db_base -{ - public: - db_basic_rx(usrp_basic_sptr usrp, int which, int subdev); - ~db_basic_rx(); - - float gain_min(); - float gain_max(); - float gain_db_per_step(); - double freq_min(); - double freq_max(); - struct freq_result_t set_freq(double target_freq); - bool set_gain(float gain); - bool is_quadrature(); - -private: - int d_subdev; -}; - - -/******************************************************************************/ - - -class db_lf_rx : public db_basic_rx -{ - public: - db_lf_rx(usrp_basic_sptr usrp, int which, int subdev); - ~db_lf_rx(); - - double freq_min(); - double freq_max(); -}; - - -/******************************************************************************/ - - -class db_lf_tx : public db_basic_tx -{ - public: - db_lf_tx(usrp_basic_sptr usrp, int which); - ~db_lf_tx(); - - double freq_min(); - double freq_max(); -}; - - -#endif diff --git a/usrp/host/include/usrp/db_bitshark_rx.h b/usrp/host/include/usrp/db_bitshark_rx.h deleted file mode 100644 index f81877d28..000000000 --- a/usrp/host/include/usrp/db_bitshark_rx.h +++ /dev/null @@ -1,56 +0,0 @@ -/* -*- c++ -*- */ -// -// Copyright 2010 Free Software Foundation, Inc. -// -// This file is part of GNU Radio -// -// GNU Radio is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either asversion 3, or (at your option) -// any later version. -// -// GNU Radio is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with GNU Radio; see the file COPYING. If not, write to -// the Free Software Foundation, Inc., 51 Franklin Street, -// Boston, MA 02110-1301, USA. - -#ifndef DB_BITSHARK_RX_H -#define DB_BITSHARK_RX_H - -#include <usrp/db_base.h> -#include <vector> -#include <stdint.h> - -class db_bitshark_rx : public db_base -{ -private: - int d_i2c_addr; - // Internal function for interfacing to the card - void _set_pga(int pga_gain); - -protected: - void shutdown(); - -public: - db_bitshark_rx(usrp_basic_sptr usrp, int which); - ~db_bitshark_rx(); - - float gain_min(); - float gain_max(); - float gain_db_per_step(); - double freq_min(); - double freq_max(); - struct freq_result_t set_freq(double freq); - bool set_gain(float gain); - bool set_bw(float bw); - bool set_clock_scheme(uint8_t clock_scheme, uint32_t ref_clock_freq); - bool is_quadrature(); - bool i_and_q_swapped(); -}; - -#endif diff --git a/usrp/host/include/usrp/db_dbs_rx.h b/usrp/host/include/usrp/db_dbs_rx.h deleted file mode 100644 index 7f869637d..000000000 --- a/usrp/host/include/usrp/db_dbs_rx.h +++ /dev/null @@ -1,83 +0,0 @@ -/* -*- c++ -*- */ -// -// Copyright 2008,2009 Free Software Foundation, Inc. -// -// This file is part of GNU Radio -// -// GNU Radio is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either asversion 3, or (at your option) -// any later version. -// -// GNU Radio is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with GNU Radio; see the file COPYING. If not, write to -// the Free Software Foundation, Inc., 51 Franklin Street, -// Boston, MA 02110-1301, USA. - -#ifndef DB_DBS_RX_H -#define DB_DBS_RX_H - -#include <usrp/db_base.h> -#include <vector> - -#if 0 -struct bw_t { - int m; - int fdac; - float div; -}; -#endif - -class db_dbs_rx : public db_base -{ -private: - int d_osc, d_cp, d_n, d_div2, d_r, d_r_int; - int d_fdac, d_m, d_dl, d_ade, d_adl, d_gc1, d_gc2, d_diag; - int d_i2c_addr; - - // Internal gain functions - void _write_reg(int regno, int v); - void _write_regs(int starting_regno, const std::vector<int> &vals); - std::vector<int> _read_status(); - void _send_reg(int regno); - void _set_m(int m); - void _set_fdac(int fdac); - void _set_dl(int dl); - void _set_gc2(int gc2); - void _set_gc1(int gc1); - void _set_pga(int pga_gain); - - // Internal frequency function - void _set_osc(int osc); - void _set_cp(int cp); - void _set_n(int n); - void _set_div2(int div2); - void _set_r(int r); - void _set_ade(int ade); - - int _refclk_divisor(); - -protected: - void shutdown(); - -public: - db_dbs_rx(usrp_basic_sptr usrp, int which); - ~db_dbs_rx(); - - float gain_min(); - float gain_max(); - float gain_db_per_step(); - double freq_min(); - double freq_max(); - struct freq_result_t set_freq(double freq); - bool set_gain(float gain); - bool is_quadrature(); - bool set_bw(float bw); -}; - -#endif diff --git a/usrp/host/include/usrp/db_dtt754.h b/usrp/host/include/usrp/db_dtt754.h deleted file mode 100644 index 4fb952824..000000000 --- a/usrp/host/include/usrp/db_dtt754.h +++ /dev/null @@ -1,57 +0,0 @@ -/* -*- c++ -*- */ -// -// Copyright 2008,2009 Free Software Foundation, Inc. -// -// This file is part of GNU Radio -// -// GNU Radio is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either asversion 3, or (at your option) -// any later version. -// -// GNU Radio is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with GNU Radio; see the file COPYING. If not, write to -// the Free Software Foundation, Inc., 51 Franklin Street, -// Boston, MA 02110-1301, USA. - -#ifndef DB_DTT754_H -#define DB_DTT754_H - -#include <usrp/db_base.h> -#include <boost/shared_ptr.hpp> - -class db_dtt754 : public db_base -{ -public: - db_dtt754(usrp_basic_sptr usrp, int which); - ~db_dtt754(); - - float gain_min(); - float gain_max(); - float gain_db_per_step(); - bool set_gain(float gain); - - double freq_min(); - double freq_max(); - struct freq_result_t set_freq(double target_freq); - - bool is_quadrature(); - bool spectrum_inverted(); - bool set_bw(float bw); - -private: - void _set_rfagc(float gain); - void _set_ifagc(float gain); - void _set_pga(float pga_gain); - - int d_i2c_addr; - float d_bw, d_freq, d_IF, d_f_ref; - bool d_inverted; -}; - -#endif diff --git a/usrp/host/include/usrp/db_dtt768.h b/usrp/host/include/usrp/db_dtt768.h deleted file mode 100644 index 78e157e79..000000000 --- a/usrp/host/include/usrp/db_dtt768.h +++ /dev/null @@ -1,57 +0,0 @@ -/* -*- c++ -*- */ -// -// Copyright 2008,2009 Free Software Foundation, Inc. -// -// This file is part of GNU Radio -// -// GNU Radio is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either asversion 3, or (at your option) -// any later version. -// -// GNU Radio is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with GNU Radio; see the file COPYING. If not, write to -// the Free Software Foundation, Inc., 51 Franklin Street, -// Boston, MA 02110-1301, USA. - -#ifndef DB_DTT768_H -#define DB_DTT768_H - -#include <usrp/db_base.h> -#include <boost/shared_ptr.hpp> - -class db_dtt768 : public db_base -{ -public: - db_dtt768(usrp_basic_sptr usrp, int which); - ~db_dtt768(); - - float gain_min(); - float gain_max(); - float gain_db_per_step(); - bool set_gain(float gain); - - double freq_min(); - double freq_max(); - struct freq_result_t set_freq(double target_freq); - - bool is_quadrature(); - bool spectrum_inverted(); - bool set_bw(float bw); - -private: - void _set_rfagc(float gain); - void _set_ifagc(float gain); - void _set_pga(float pga_gain); - - int d_i2c_addr; - float d_bw, d_freq, d_IF, d_f_ref; - bool d_inverted; -}; - -#endif diff --git a/usrp/host/include/usrp/db_flexrf.h b/usrp/host/include/usrp/db_flexrf.h deleted file mode 100644 index 70a55514e..000000000 --- a/usrp/host/include/usrp/db_flexrf.h +++ /dev/null @@ -1,394 +0,0 @@ -/* -*- c++ -*- */ -// -// Copyright 2008,2009 Free Software Foundation, Inc. -// -// This file is part of GNU Radio -// -// GNU Radio is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either asversion 3, or (at your option) -// any later version. -// -// GNU Radio is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with GNU Radio; see the file COPYING. If not, write to -// the Free Software Foundation, Inc., 51 Franklin Street, -// Boston, MA 02110-1301, USA. - -#ifndef DB_FLEXRF_H -#define DB_FLEXRF_H - -#include <usrp/db_base.h> -#include <cmath> - -//debug_using_gui = true // Must be set to True or False -#define debug_using_gui false // Must be set to True or False - -class _AD4360_common; - -class flexrf_base : public db_base -{ -public: - flexrf_base(usrp_basic_sptr usrp, int which, int _power_on=0); - ~flexrf_base(); - - struct freq_result_t set_freq(double freq); - - bool is_quadrature(); - double freq_min(); - double freq_max(); - -protected: - void _write_all(int R, int control, int N); - void _write_control(int control); - void _write_R(int R); - void _write_N(int N); - void _write_it(int v); - bool _lock_detect(); - - virtual bool _compute_regs(double freq, int &retR, int &retcontrol, - int &retN, double &retfreq); - int _compute_control_reg(); - int _refclk_divisor(); - - bool _set_pga(float pga_gain); - - int power_on() { return d_power_on; } - int power_off() { return 0; } - - bool d_first; - int d_spi_format; - int d_spi_enable; - int d_power_on; - int d_PD; - - _AD4360_common *d_common; -}; - -// ---------------------------------------------------------------- - -class flexrf_base_tx : public flexrf_base -{ -protected: - void shutdown(); - -public: - flexrf_base_tx(usrp_basic_sptr usrp, int which, int _power_on=0); - ~flexrf_base_tx(); - - // All RFX tx d'boards have fixed gain - float gain_min(); - float gain_max(); - float gain_db_per_step(); - - bool set_auto_tr(bool on); - bool set_enable(bool on); - bool set_gain(float gain); -}; - -class flexrf_base_rx : public flexrf_base -{ -protected: - void shutdown(); - -public: - flexrf_base_rx(usrp_basic_sptr usrp, int which, int _power_on=0); - ~flexrf_base_rx(); - - bool set_auto_tr(bool on); - bool select_rx_antenna(int which_antenna); - bool select_rx_antenna(const std::string &which_antenna); - bool set_gain(float gain); - -}; - -// ---------------------------------------------------------------- - - -class _AD4360_common -{ -public: - _AD4360_common(); - virtual ~_AD4360_common(); - - virtual double freq_min() = 0; - virtual double freq_max() = 0; - - bool _compute_regs(double refclk_freq, double freq, int &retR, - int &retcontrol, int &retN, double &retfreq); - int _compute_control_reg(); - virtual int _refclk_divisor(); - int _prescaler(); - - void R_DIV(int div) { d_R_DIV = div; } - -protected: - int d_R_RSV, d_BSC, d_TEST, d_LDP, d_ABP, d_N_RSV, d_PL, d_MTLD; - int d_CPG, d_CP3S, d_PDP, d_MUXOUT, d_CR, d_PC; - - // FIXME: d_PD might cause conflict from flexrf_base - int d_A_DIV, d_B_DIV, d_R_DIV, d_P, d_PD, d_CP2, d_CP1, d_DIVSEL; - int d_DIV2, d_CPGAIN, d_freq_mult; - -}; - -//---------------------------------------------------------------------- - -class _2200_common : public _AD4360_common -{ - public: - _2200_common(); - ~_2200_common() {} - - double freq_min(); - double freq_max(); -}; - -//---------------------------------------------------------------------- - -class _2400_common : public _AD4360_common -{ - public: - _2400_common(); - ~_2400_common() {} - - double freq_min(); - double freq_max(); -}; - -//---------------------------------------------------------------------- - -class _1200_common : public _AD4360_common -{ -public: - _1200_common(); - ~_1200_common() {} - - double freq_min(); - double freq_max(); -}; - -//------------------------------------------------------------------------- - -class _1800_common : public _AD4360_common -{ - public: - _1800_common(); - ~_1800_common() {} - - double freq_min(); - double freq_max(); -}; - -//------------------------------------------------------------------------- - -class _900_common : public _AD4360_common -{ -public: - _900_common(); - ~_900_common() {} - - double freq_min(); - double freq_max(); -}; - -//------------------------------------------------------------------------- - -class _400_common : public _AD4360_common -{ -public: - _400_common(); - ~_400_common() {} - - double freq_min(); - double freq_max(); -}; - -class _400_tx : public _400_common -{ -public: - _400_tx(); - ~_400_tx() {} -}; - -class _400_rx : public _400_common -{ -public: - _400_rx(); - ~_400_rx() {} -}; - -//------------------------------------------------------------ - -class db_flexrf_2200_tx : public flexrf_base_tx -{ - public: - db_flexrf_2200_tx(usrp_basic_sptr usrp, int which); - ~db_flexrf_2200_tx(); - - // Wrapper calls to d_common functions - bool _compute_regs(double freq, int &retR, int &retcontrol, - int &retN, double &retfreq); -}; - -class db_flexrf_2200_rx : public flexrf_base_rx -{ -public: - db_flexrf_2200_rx(usrp_basic_sptr usrp, int which); - ~db_flexrf_2200_rx(); - - float gain_min(); - float gain_max(); - float gain_db_per_step(); - bool i_and_q_swapped(); - - bool _compute_regs(double freq, int &retR, int &retcontrol, - int &retN, double &retfreq); -}; - -//------------------------------------------------------------ - -class db_flexrf_2400_tx : public flexrf_base_tx -{ - public: - db_flexrf_2400_tx(usrp_basic_sptr usrp, int which); - ~db_flexrf_2400_tx(); - - // Wrapper calls to d_common functions - bool _compute_regs(double freq, int &retR, int &retcontrol, - int &retN, double &retfreq); -}; - -class db_flexrf_2400_rx : public flexrf_base_rx -{ -public: - db_flexrf_2400_rx(usrp_basic_sptr usrp, int which); - ~db_flexrf_2400_rx(); - - float gain_min(); - float gain_max(); - float gain_db_per_step(); - bool i_and_q_swapped(); - - bool _compute_regs(double freq, int &retR, int &retcontrol, - int &retN, double &retfreq); -}; - -//------------------------------------------------------------ - -class db_flexrf_1200_tx : public flexrf_base_tx -{ -public: - db_flexrf_1200_tx(usrp_basic_sptr usrp, int which); - ~db_flexrf_1200_tx(); - - // Wrapper calls to d_common functions - bool _compute_regs(double freq, int &retR, int &retcontrol, - int &retN, double &retfreq); -}; - -class db_flexrf_1200_rx : public flexrf_base_rx -{ -public: - db_flexrf_1200_rx(usrp_basic_sptr usrp, int which); - ~db_flexrf_1200_rx(); - - float gain_min(); - float gain_max(); - float gain_db_per_step(); - bool i_and_q_swapped(); - - bool _compute_regs(double freq, int &retR, int &retcontrol, - int &retN, double &retfreq); -}; - -//------------------------------------------------------------ - -class db_flexrf_1800_tx : public flexrf_base_tx -{ - public: - db_flexrf_1800_tx(usrp_basic_sptr usrp, int which); - ~db_flexrf_1800_tx(); - - // Wrapper calls to d_common functions - bool _compute_regs(double freq, int &retR, int &retcontrol, - int &retN, double &retfreq); -}; - -class db_flexrf_1800_rx : public flexrf_base_rx -{ -public: - db_flexrf_1800_rx(usrp_basic_sptr usrp, int which); - ~db_flexrf_1800_rx(); - - float gain_min(); - float gain_max(); - float gain_db_per_step(); - bool i_and_q_swapped(); - - bool _compute_regs(double freq, int &retR, int &retcontrol, - int &retN, double &retfreq); -}; - -//------------------------------------------------------------ - -class db_flexrf_900_tx : public flexrf_base_tx -{ - public: - db_flexrf_900_tx(usrp_basic_sptr usrp, int which); - ~db_flexrf_900_tx(); - - // Wrapper calls to d_common functions - bool _compute_regs(double freq, int &retR, int &retcontrol, - int &retN, double &retfreq); -}; - -class db_flexrf_900_rx : public flexrf_base_rx -{ -public: - db_flexrf_900_rx(usrp_basic_sptr usrp, int which); - ~db_flexrf_900_rx(); - - float gain_min(); - float gain_max(); - float gain_db_per_step(); - bool i_and_q_swapped(); - - bool _compute_regs(double freq, int &retR, int &retcontrol, - int &retN, double &retfreq); -}; - - -//------------------------------------------------------------ - -class db_flexrf_400_tx : public flexrf_base_tx -{ - public: - db_flexrf_400_tx(usrp_basic_sptr usrp, int which); - ~db_flexrf_400_tx(); - - // Wrapper calls to d_common functions - bool _compute_regs(double freq, int &retR, int &retcontrol, - int &retN, double &retfreq); -}; - -class db_flexrf_400_rx : public flexrf_base_rx -{ -public: - db_flexrf_400_rx(usrp_basic_sptr usrp, int which); - ~db_flexrf_400_rx(); - - float gain_min(); - float gain_max(); - float gain_db_per_step(); - bool i_and_q_swapped(); - - bool _compute_regs(double freq, int &retR, int &retcontrol, - int &retN, double &retfreq); -}; - -#endif diff --git a/usrp/host/include/usrp/db_flexrf_mimo.h b/usrp/host/include/usrp/db_flexrf_mimo.h deleted file mode 100644 index 771f3b276..000000000 --- a/usrp/host/include/usrp/db_flexrf_mimo.h +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Copyright 2008,2009 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <usrp/db_flexrf.h> - -class db_flexrf_2400_tx_mimo_a : public db_flexrf_2400_tx -{ - public: - db_flexrf_2400_tx_mimo_a(usrp_basic_sptr usrp, int which); - int _refclk_divisor(); -}; - -class db_flexrf_2400_rx_mimo_a : public db_flexrf_2400_rx -{ - public: - db_flexrf_2400_rx_mimo_a(usrp_basic_sptr usrp, int which); - int _refclk_divisor(); -}; - -class db_flexrf_2400_tx_mimo_b : public db_flexrf_2400_tx -{ - public: - db_flexrf_2400_tx_mimo_b(usrp_basic_sptr usrp, int which); - int _refclk_divisor(); -}; - -class db_flexrf_2400_rx_mimo_b : public db_flexrf_2400_rx -{ - public: - db_flexrf_2400_rx_mimo_b(usrp_basic_sptr usrp, int which); - int _refclk_divisor(); -}; - - -class db_flexrf_1800_tx_mimo_a : public db_flexrf_1800_tx -{ - public: - db_flexrf_1800_tx_mimo_a(usrp_basic_sptr usrp, int which); - int _refclk_divisor(); -}; - -class db_flexrf_1800_rx_mimo_a : public db_flexrf_1800_rx -{ - public: - db_flexrf_1800_rx_mimo_a(usrp_basic_sptr usrp, int which); - int _refclk_divisor(); -}; - -class db_flexrf_1800_tx_mimo_b : public db_flexrf_1800_tx -{ - public: - db_flexrf_1800_tx_mimo_b(usrp_basic_sptr usrp, int which); - int _refclk_divisor(); -}; - -class db_flexrf_1800_rx_mimo_b : public db_flexrf_1800_rx -{ - public: - db_flexrf_1800_rx_mimo_b(usrp_basic_sptr usrp, int which); - int _refclk_divisor(); -}; - -class db_flexrf_1200_tx_mimo_a : public db_flexrf_1200_tx -{ - public: - db_flexrf_1200_tx_mimo_a(usrp_basic_sptr usrp, int which); - int _refclk_divisor(); -}; - -class db_flexrf_1200_rx_mimo_a : public db_flexrf_1200_rx -{ - public: - db_flexrf_1200_rx_mimo_a(usrp_basic_sptr usrp, int which); - int _refclk_divisor(); -}; - -class db_flexrf_1200_tx_mimo_b : public db_flexrf_1200_tx -{ - public: - db_flexrf_1200_tx_mimo_b(usrp_basic_sptr usrp, int which); - int _refclk_divisor(); -}; - -class db_flexrf_1200_rx_mimo_b : public db_flexrf_1200_rx -{ - public: - db_flexrf_1200_rx_mimo_b(usrp_basic_sptr usrp, int which); - int _refclk_divisor(); -}; - -class db_flexrf_900_tx_mimo_a : public db_flexrf_900_tx -{ - public: - db_flexrf_900_tx_mimo_a(usrp_basic_sptr usrp, int which); - int _refclk_divisor(); -}; - -class db_flexrf_900_rx_mimo_a : public db_flexrf_900_rx -{ - public: - db_flexrf_900_rx_mimo_a(usrp_basic_sptr usrp, int which); - int _refclk_divisor(); -}; - -class db_flexrf_900_tx_mimo_b : public db_flexrf_900_tx -{ - public: - db_flexrf_900_tx_mimo_b(usrp_basic_sptr usrp, int which); - int _refclk_divisor(); -}; - -class db_flexrf_900_rx_mimo_b : public db_flexrf_900_rx -{ - public: - db_flexrf_900_rx_mimo_b(usrp_basic_sptr usrp, int which); - int _refclk_divisor(); -}; - -class db_flexrf_400_tx_mimo_a : public db_flexrf_400_tx -{ - public: - db_flexrf_400_tx_mimo_a(usrp_basic_sptr usrp, int which); - int _refclk_divisor(); -}; - -class db_flexrf_400_rx_mimo_a : public db_flexrf_400_rx -{ - public: - db_flexrf_400_rx_mimo_a(usrp_basic_sptr usrp, int which); - int _refclk_divisor(); -}; - -class db_flexrf_400_tx_mimo_b : public db_flexrf_400_tx -{ - public: - db_flexrf_400_tx_mimo_b(usrp_basic_sptr usrp, int which); - int _refclk_divisor(); -}; - -class db_flexrf_400_rx_mimo_b : public db_flexrf_400_rx -{ - public: - db_flexrf_400_rx_mimo_b(usrp_basic_sptr usrp, int which); - int _refclk_divisor(); -}; diff --git a/usrp/host/include/usrp/db_tv_rx.h b/usrp/host/include/usrp/db_tv_rx.h deleted file mode 100644 index ee3ed2bf6..000000000 --- a/usrp/host/include/usrp/db_tv_rx.h +++ /dev/null @@ -1,56 +0,0 @@ -/* -*- c++ -*- */ -// -// Copyright 2008,2009 Free Software Foundation, Inc. -// -// This file is part of GNU Radio -// -// GNU Radio is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either asversion 3, or (at your option) -// any later version. -// -// GNU Radio is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with GNU Radio; see the file COPYING. If not, write to -// the Free Software Foundation, Inc., 51 Franklin Street, -// Boston, MA 02110-1301, USA. - -#ifndef DB_TV_RX_H -#define DB_TV_RX_H - -#include <usrp/db_base.h> - -class db_tv_rx : public db_base -{ -private: - void _set_rfagc(float gain); - void _set_ifagc(float gain); - void _set_pga(float pga_gain); - - int d_i2c_addr; - double d_first_IF, d_second_IF; - int d_reference_divisor; - bool d_fast_tuning; - bool d_inverted; - -public: - db_tv_rx(usrp_basic_sptr usrp, int which, - double first_IF, double second_IF); - ~db_tv_rx(); - - float gain_min(); - float gain_max(); - float gain_db_per_step(); - double freq_min(); - double freq_max(); - struct freq_result_t set_freq(double target_freq); - bool set_gain(float gain); - bool is_quadrature(); - bool spectrum_inverted(); -}; - -#endif diff --git a/usrp/host/include/usrp/db_tv_rx_mimo.h b/usrp/host/include/usrp/db_tv_rx_mimo.h deleted file mode 100644 index 0a9bb486e..000000000 --- a/usrp/host/include/usrp/db_tv_rx_mimo.h +++ /dev/null @@ -1,34 +0,0 @@ -/* -*- c++ -*- */ -// -// Copyright 2009 Free Software Foundation, Inc. -// -// This file is part of GNU Radio -// -// GNU Radio is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either asversion 3, or (at your option) -// any later version. -// -// GNU Radio is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with GNU Radio; see the file COPYING. If not, write to -// the Free Software Foundation, Inc., 51 Franklin Street, -// Boston, MA 02110-1301, USA. - -#ifndef DB_TV_RX_MIMO_H -#define DB_TV_RX_MIMO_H - -#include <usrp/db_tv_rx.h> - -class db_tv_rx_mimo : public db_tv_rx -{ - public: - db_tv_rx_mimo(usrp_basic_sptr usrp, int which,double first_IF, double second_IF); - int _refclk_divisor(); -}; - -#endif diff --git a/usrp/host/include/usrp/db_wbxng.h b/usrp/host/include/usrp/db_wbxng.h deleted file mode 100644 index 9a7829278..000000000 --- a/usrp/host/include/usrp/db_wbxng.h +++ /dev/null @@ -1,98 +0,0 @@ -/* -*- c++ -*- */ -// -// Copyright 2009 Free Software Foundation, Inc. -// -// This file is part of GNU Radio -// -// GNU Radio is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either asversion 3, or (at your option) -// any later version. -// -// GNU Radio is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with GNU Radio; see the file COPYING. If not, write to -// the Free Software Foundation, Inc., 51 Franklin Street, -// Boston, MA 02110-1301, USA. - -#ifndef INCLUDED_DB_WBXNG_H -#define INCLUDED_DB_WBXNG_H - -#include <usrp/db_base.h> -#include <cmath> - -class adf4350; - -class wbxng_base : public db_base -{ -public: - wbxng_base(usrp_basic_sptr usrp, int which); - ~wbxng_base(); - - struct freq_result_t set_freq(double freq); - - bool is_quadrature(); - double freq_min(); - double freq_max(); - -protected: - void _write_spi(std::string data); - int _refclk_divisor(); - bool _get_locked(); - bool _set_pga(float pga_gain); - - bool d_first; - int d_spi_format; - int d_spi_enable; - int d_power_on; - int d_PD; - - boost::shared_ptr<adf4350> d_common; -}; - -// ---------------------------------------------------------------- - -class db_wbxng_tx : public wbxng_base -{ -protected: - void shutdown(); - -public: - db_wbxng_tx(usrp_basic_sptr usrp, int which); - ~db_wbxng_tx(); - - float gain_min(); - float gain_max(); - float gain_db_per_step(); - - bool set_auto_tr(bool on); - bool set_enable(bool on); - bool set_gain(float gain); -}; - -class db_wbxng_rx : public wbxng_base -{ -protected: - void shutdown(); - bool _set_attn(float attn); - -public: - db_wbxng_rx(usrp_basic_sptr usrp, int which); - ~db_wbxng_rx(); - - bool set_auto_tr(bool on); - bool select_rx_antenna(int which_antenna); - bool select_rx_antenna(const std::string &which_antenna); - bool set_gain(float gain); - - float gain_min(); - float gain_max(); - float gain_db_per_step(); - bool i_and_q_swapped(); -}; - -#endif /* INCLUDED_DB_WBXNG_H */ diff --git a/usrp/host/include/usrp/db_xcvr2450.h b/usrp/host/include/usrp/db_xcvr2450.h deleted file mode 100644 index 305c60d06..000000000 --- a/usrp/host/include/usrp/db_xcvr2450.h +++ /dev/null @@ -1,92 +0,0 @@ -/* -*- c++ -*- */ -// -// Copyright 2008,2009 Free Software Foundation, Inc. -// -// This file is part of GNU Radio -// -// GNU Radio is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either asversion 3, or (at your option) -// any later version. -// -// GNU Radio is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with GNU Radio; see the file COPYING. If not, write to -// the Free Software Foundation, Inc., 51 Franklin Street, -// Boston, MA 02110-1301, USA. - -#ifndef DB_XCVR2450_H -#define DB_XCVR2450_H - -#include <usrp/db_base.h> -#include <boost/shared_ptr.hpp> - -class xcvr2450; -typedef boost::shared_ptr<xcvr2450> xcvr2450_sptr; - - -/******************************************************************************/ - - -class db_xcvr2450_base: public db_base -{ - /* - * Abstract base class for all xcvr2450 boards. - * - * Derive board specific subclasses from db_xcvr2450_base_{tx,rx} - */ -public: - db_xcvr2450_base(usrp_basic_sptr usrp, int which); - ~db_xcvr2450_base(); - struct freq_result_t set_freq(double target_freq); - bool is_quadrature(); - double freq_min(); - double freq_max(); - -protected: - xcvr2450_sptr d_xcvr; - void shutdown_common(); -}; - - -/******************************************************************************/ - - -class db_xcvr2450_tx : public db_xcvr2450_base -{ -protected: - void shutdown(); - -public: - db_xcvr2450_tx(usrp_basic_sptr usrp, int which); - ~db_xcvr2450_tx(); - - float gain_min(); - float gain_max(); - float gain_db_per_step(); - bool set_gain(float gain); - bool i_and_q_swapped(); -}; - -class db_xcvr2450_rx : public db_xcvr2450_base -{ -protected: - void shutdown(); - -public: - db_xcvr2450_rx(usrp_basic_sptr usrp, int which); - ~db_xcvr2450_rx(); - - float gain_min(); - float gain_max(); - float gain_db_per_step(); - bool set_gain(float gain); -}; - - - -#endif diff --git a/usrp/host/include/usrp/libusb_types.h.in b/usrp/host/include/usrp/libusb_types.h.in deleted file mode 100644 index cf10e33cc..000000000 --- a/usrp/host/include/usrp/libusb_types.h.in +++ /dev/null @@ -1,38 +0,0 @@ -/* -*- Mode: C++ -*- */ -/* - * Copyright 2009 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _LIBUSB_TYPES_H_ -#define _LIBUSB_TYPES_H_ - -#if @USE_LIBUSB1@ -#include <libusb-1.0/libusb.h> -struct libusb_device; -struct libusb_device_handle; -struct libusb_device_descriptor; -#else -#include <usb.h> -typedef struct usb_device libusb_device; -typedef struct usb_dev_handle libusb_device_handle; -typedef struct usb_device_descriptor libusb_device_descriptor; -#endif - -#endif /* _LIBUSB_TYPES_H_ */ diff --git a/usrp/host/include/usrp/usrp_basic.h b/usrp/host/include/usrp/usrp_basic.h deleted file mode 100644 index b76493ea4..000000000 --- a/usrp/host/include/usrp/usrp_basic.h +++ /dev/null @@ -1,993 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005,2009 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_USRP_BASIC_H -#define INCLUDED_USRP_BASIC_H - -#include <usrp/db_base.h> -#include <usrp/usrp_slots.h> -#include <usrp/usrp_subdev_spec.h> -#include <usrp/libusb_types.h> -#include <string> -#include <vector> -#include <boost/utility.hpp> - -class fusb_devhandle; -class fusb_ephandle; - -enum txrx_t { - C_RX = 0, - C_TX = 1 -}; - -/* - * ---------------------------------------------------------------------- - * Mid level interface to the Universal Software Radio Peripheral (Rev 1) - * - * These classes implement the basic functionality for talking to the - * USRP. They try to be as independent of the signal processing code - * in FPGA as possible. They implement access to the low level - * peripherals on the board, provide a common way for reading and - * writing registers in the FPGA, and provide the high speed interface - * to streaming data across the USB. - * - * It is expected that subclasses will be derived that provide - * access to the functionality to a particular FPGA configuration. - * ---------------------------------------------------------------------- - */ - - -/*! - * \brief abstract base class for usrp operations - * \ingroup usrp - */ -class usrp_basic : boost::noncopyable -{ -protected: - void shutdown_daughterboards(); - -protected: - libusb_device_handle *d_udh; - struct libusb_context *d_ctx; - int d_usb_data_rate; // bytes/sec - int d_bytes_per_poll; // how often to poll for overruns - bool d_verbose; - long d_fpga_master_clock_freq; - - static const int MAX_REGS = 128; - unsigned int d_fpga_shadows[MAX_REGS]; - - int d_dbid[2]; // daughterboard ID's (side A, side B) - - /*! - * Shared pointers to subclasses of db_base. - * - * The outer vector is of length 2 (0 = side A, 1 = side B). The - * inner vectors are of length 1, 2 or 3 depending on the number of - * subdevices implemented by the daugherboard. At this time, only - * the Basic Rx and LF Rx implement more than 1 subdevice. - */ - std::vector< std::vector<db_base_sptr> > d_db; - - // One time call, made only only from usrp_standard_*::make after shared_ptr is created. - void init_db(usrp_basic_sptr u); - - - usrp_basic (int which_board, - libusb_device_handle *open_interface (libusb_device *dev), - const std::string fpga_filename = "", - const std::string firmware_filename = ""); - - /*! - * \brief advise usrp_basic of usb data rate (bytes/sec) - * - * N.B., this doesn't tweak any hardware. Derived classes - * should call this to inform us of the data rate whenever it's - * first set or if it changes. - * - * \param usb_data_rate bytes/sec - */ - void set_usb_data_rate (int usb_data_rate); - - /*! - * \brief Write auxiliary digital to analog converter. - * - * \param slot Which Tx or Rx slot to write. - * N.B., SLOT_TX_A and SLOT_RX_A share the same AUX DAC's. - * SLOT_TX_B and SLOT_RX_B share the same AUX DAC's. - * \param which_dac [0,3] RX slots must use only 0 and 1. TX slots must use only 2 and 3. - * \param value [0,4095] - * \returns true iff successful - */ - bool _write_aux_dac (int slot, int which_dac, int value); - - /*! - * \brief Read auxiliary analog to digital converter. - * - * \param slot 2-bit slot number. E.g., SLOT_TX_A - * \param which_adc [0,1] - * \param value return 12-bit value [0,4095] - * \returns true iff successful - */ - bool _read_aux_adc (int slot, int which_adc, int *value); - - /*! - * \brief Read auxiliary analog to digital converter. - * - * \param slot 2-bit slot number. E.g., SLOT_TX_A - * \param which_adc [0,1] - * \returns value in the range [0,4095] if successful, else READ_FAILED. - */ - int _read_aux_adc (int slot, int which_adc); - - -public: - virtual ~usrp_basic (); - - - /*! - * Return a vector of vectors that contain shared pointers - * to the daughterboard instance(s) associated with the specified side. - * - * It is an error to use the returned objects after the usrp_basic - * object has been destroyed. - */ - std::vector<std::vector<db_base_sptr> > db() const { return d_db; } - - /*! - * Return a vector of size >= 1 that contains shared pointers - * to the daughterboard instance(s) associated with the specified side. - * - * \param which_side [0,1] which daughterboard - * - * It is an error to use the returned objects after the usrp_basic - * object has been destroyed. - */ - std::vector<db_base_sptr> db(int which_side); - - /*! - * \brief is the subdev_spec valid? - */ - bool is_valid(const usrp_subdev_spec &ss); - - /*! - * \brief given a subdev_spec, return the corresponding daughterboard object. - * \throws std::invalid_ argument if ss is invalid. - * - * \param ss specifies the side and subdevice - */ - db_base_sptr selected_subdev(const usrp_subdev_spec &ss); - - /*! - * \brief return frequency of master oscillator on USRP - */ - long fpga_master_clock_freq () const { return d_fpga_master_clock_freq; } - - /*! - * Tell API that the master oscillator on the USRP is operating at a non-standard - * fixed frequency. This is only needed for custom USRP hardware modified to - * operate at a different frequency from the default factory configuration. This - * function must be called prior to any other API function. - * \param master_clock USRP2 FPGA master clock frequency in Hz (10..64 MHz) - */ - void set_fpga_master_clock_freq (long master_clock) { d_fpga_master_clock_freq = master_clock; } - - /*! - * \returns usb data rate in bytes/sec - */ - int usb_data_rate () const { return d_usb_data_rate; } - - void set_verbose (bool on) { d_verbose = on; } - - //! magic value used on alternate register read interfaces - static const int READ_FAILED = -99999; - - /*! - * \brief Write EEPROM on motherboard or any daughterboard. - * \param i2c_addr I2C bus address of EEPROM - * \param eeprom_offset byte offset in EEPROM to begin writing - * \param buf the data to write - * \returns true iff sucessful - */ - bool write_eeprom (int i2c_addr, int eeprom_offset, const std::string buf); - - /*! - * \brief Read EEPROM on motherboard or any daughterboard. - * \param i2c_addr I2C bus address of EEPROM - * \param eeprom_offset byte offset in EEPROM to begin reading - * \param len number of bytes to read - * \returns the data read if successful, else a zero length string. - */ - std::string read_eeprom (int i2c_addr, int eeprom_offset, int len); - - /*! - * \brief Write to I2C peripheral - * \param i2c_addr I2C bus address (7-bits) - * \param buf the data to write - * \returns true iff successful - * Writes are limited to a maximum of of 64 bytes. - */ - bool write_i2c (int i2c_addr, const std::string buf); - - /*! - * \brief Read from I2C peripheral - * \param i2c_addr I2C bus address (7-bits) - * \param len number of bytes to read - * \returns the data read if successful, else a zero length string. - * Reads are limited to a maximum of 64 bytes. - */ - std::string read_i2c (int i2c_addr, int len); - - /*! - * \brief Set ADC offset correction - * \param which_adc which ADC[0,3]: 0 = RX_A I, 1 = RX_A Q... - * \param offset 16-bit value to subtract from raw ADC input. - */ - bool set_adc_offset (int which_adc, int offset); - - /*! - * \brief Set DAC offset correction - * \param which_dac which DAC[0,3]: 0 = TX_A I, 1 = TX_A Q... - * \param offset 10-bit offset value (ambiguous format: See AD9862 datasheet). - * \param offset_pin 1-bit value. If 0 offset applied to -ve differential pin; - * If 1 offset applied to +ve differential pin. - */ - bool set_dac_offset (int which_dac, int offset, int offset_pin); - - /*! - * \brief Control ADC input buffer - * \param which_adc which ADC[0,3] - * \param bypass if non-zero, bypass input buffer and connect input - * directly to switched cap SHA input of RxPGA. - */ - bool set_adc_buffer_bypass (int which_adc, bool bypass); - - /*! - * \brief Enable/disable automatic DC offset removal control loop in FPGA - * - * \param bits which control loops to enable - * \param mask which \p bits to pay attention to - * - * If the corresponding bit is set, enable the automatic DC - * offset correction control loop. - * - * <pre> - * The 4 low bits are significant: - * - * ADC0 = (1 << 0) - * ADC1 = (1 << 1) - * ADC2 = (1 << 2) - * ADC3 = (1 << 3) - * </pre> - * - * By default the control loop is enabled on all ADC's. - */ - bool set_dc_offset_cl_enable(int bits, int mask); - - /*! - * \brief return the usrp's serial number. - * - * \returns non-zero length string iff successful. - */ - std::string serial_number(); - - /*! - * \brief Return daughterboard ID for given side [0,1]. - * - * \param which_side [0,1] which daughterboard - * - * \return daughterboard id >= 0 if successful - * \return -1 if no daugherboard - * \return -2 if invalid EEPROM on daughterboard - */ - virtual int daughterboard_id (int which_side) const = 0; - - /*! - * \brief Clock ticks to delay rising of T/R signal - * \sa write_atr_mask, write_atr_txval, write_atr_rxval - */ - bool write_atr_tx_delay(int value); - - /*! - * \brief Clock ticks to delay falling edge of T/R signal - * \sa write_atr_mask, write_atr_txval, write_atr_rxval - */ - bool write_atr_rx_delay(int value); - - - // ================================================================ - // Routines to access and control daughterboard specific i/o - // - // Those with a common_ prefix access either the Tx or Rx side depending - // on the txrx parameter. Those without the common_ prefix are virtual - // and are overriden in usrp_basic_rx and usrp_basic_tx to access the - // the Rx or Tx sides automatically. We provide the common_ versions - // for those daughterboards such as the WBX and XCVR2450 that share - // h/w resources (such as the LO) between the Tx and Rx sides. - - // ---------------------------------------------------------------- - // BEGIN common_ daughterboard control functions - - /*! - * \brief Set Programmable Gain Amplifier(PGA) - * - * \param txrx Tx or Rx? - * \param which_amp which amp [0,3] - * \param gain_in_db gain value(linear in dB) - * - * gain is rounded to closest setting supported by hardware. - * - * \returns true iff sucessful. - * - * \sa pga_min(), pga_max(), pga_db_per_step() - */ - bool common_set_pga(txrx_t txrx, int which_amp, double gain_in_db); - - /*! - * \brief Return programmable gain amplifier gain setting in dB. - * - * \param txrx Tx or Rx? - * \param which_amp which amp [0,3] - */ - double common_pga(txrx_t txrx, int which_amp) const; - - /*! - * \brief Return minimum legal PGA gain in dB. - * \param txrx Tx or Rx? - */ - double common_pga_min(txrx_t txrx) const; - - /*! - * \brief Return maximum legal PGA gain in dB. - * \param txrx Tx or Rx? - */ - double common_pga_max(txrx_t txrx) const; - - /*! - * \brief Return hardware step size of PGA(linear in dB). - * \param txrx Tx or Rx? - */ - double common_pga_db_per_step(txrx_t txrx) const; - - /*! - * \brief Write direction register(output enables) for pins that go to daughterboard. - * - * \param txrx Tx or Rx? - * \param which_side [0,1] which size - * \param value value to write into register - * \param mask which bits of value to write into reg - * - * Each d'board has 16-bits of general purpose i/o. - * Setting the bit makes it an output from the FPGA to the d'board. - * - * This register is initialized based on a value stored in the - * d'board EEPROM. In general, you shouldn't be using this routine - * without a very good reason. Using this method incorrectly will - * kill your USRP motherboard and/or daughterboard. - */ - bool _common_write_oe(txrx_t txrx, int which_side, int value, int mask); - - /*! - * \brief Write daughterboard i/o pin value - * - * \param txrx Tx or Rx? - * \param which_side [0,1] which d'board - * \param value value to write into register - * \param mask which bits of value to write into reg - */ - bool common_write_io(txrx_t txrx, int which_side, int value, int mask); - - /*! - * \brief Read daughterboard i/o pin value - * - * \param txrx Tx or Rx? - * \param which_side [0,1] which d'board - * \param value output - */ - bool common_read_io(txrx_t txrx, int which_side, int *value); - - /*! - * \brief Read daughterboard i/o pin value - * - * \param txrx Tx or Rx? - * \param which_side [0,1] which d'board - * \returns register value if successful, else READ_FAILED - */ - int common_read_io(txrx_t txrx, int which_side); - - /*! - * \brief Write daughterboard refclk config register - * - * \param txrx Tx or Rx? - * \param which_side [0,1] which d'board - * \param value value to write into register, see below - * - * <pre> - * Control whether a reference clock is sent to the daughterboards, - * and what frequency. The refclk is sent on d'board i/o pin 0. - * - * 3 2 1 - * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 - * +-----------------------------------------------+-+------------+ - * | Reserved (Must be zero) |E| DIVISOR | - * +-----------------------------------------------+-+------------+ - * - * Bit 7 -- 1 turns on refclk, 0 allows IO use - * Bits 6:0 Divider value - * </pre> - */ - bool common_write_refclk(txrx_t txrx, int which_side, int value); - - /*! - * \brief Automatic Transmit/Receive switching - * <pre> - * - * If automatic transmit/receive (ATR) switching is enabled in the - * FR_ATR_CTL register, the presence or absence of data in the FPGA - * transmit fifo selects between two sets of values for each of the 4 - * banks of daughterboard i/o pins. - * - * Each daughterboard slot has 3 16-bit registers associated with it: - * FR_ATR_MASK_*, FR_ATR_TXVAL_* and FR_ATR_RXVAL_* - * - * FR_ATR_MASK_{0,1,2,3}: - * - * These registers determine which of the daugherboard i/o pins are - * affected by ATR switching. If a bit in the mask is set, the - * corresponding i/o bit is controlled by ATR, else it's output - * value comes from the normal i/o pin output register: - * FR_IO_{0,1,2,3}. - * - * FR_ATR_TXVAL_{0,1,2,3}: - * FR_ATR_RXVAL_{0,1,2,3}: - * - * If the Tx fifo contains data, then the bits from TXVAL that are - * selected by MASK are output. Otherwise, the bits from RXVAL that - * are selected by MASK are output. - * </pre> - */ - bool common_write_atr_mask(txrx_t txrx, int which_side, int value); - bool common_write_atr_txval(txrx_t txrx, int which_side, int value); - bool common_write_atr_rxval(txrx_t txrx, int which_side, int value); - - /*! - * \brief Write auxiliary digital to analog converter. - * - * \param txrx Tx or Rx? - * \param which_side [0,1] which d'board - * N.B., SLOT_TX_A and SLOT_RX_A share the same AUX DAC's. - * SLOT_TX_B and SLOT_RX_B share the same AUX DAC's. - * \param which_dac [2,3] TX slots must use only 2 and 3. - * \param value [0,4095] - * \returns true iff successful - */ - bool common_write_aux_dac(txrx_t txrx, int which_side, int which_dac, int value); - - /*! - * \brief Read auxiliary analog to digital converter. - * - * \param txrx Tx or Rx? - * \param which_side [0,1] which d'board - * \param which_adc [0,1] - * \param value return 12-bit value [0,4095] - * \returns true iff successful - */ - bool common_read_aux_adc(txrx_t txrx, int which_side, int which_adc, int *value); - - /*! - * \brief Read auxiliary analog to digital converter. - * - * \param txrx Tx or Rx? - * \param which_side [0,1] which d'board - * \param which_adc [0,1] - * \returns value in the range [0,4095] if successful, else READ_FAILED. - */ - int common_read_aux_adc(txrx_t txrx, int which_side, int which_adc); - - // END common_ daughterboard control functions - // ---------------------------------------------------------------- - // BEGIN virtual daughterboard control functions - - /*! - * \brief Set Programmable Gain Amplifier (PGA) - * - * \param which_amp which amp [0,3] - * \param gain_in_db gain value (linear in dB) - * - * gain is rounded to closest setting supported by hardware. - * - * \returns true iff sucessful. - * - * \sa pga_min(), pga_max(), pga_db_per_step() - */ - virtual bool set_pga (int which_amp, double gain_in_db) = 0; - - /*! - * \brief Return programmable gain amplifier gain setting in dB. - * - * \param which_amp which amp [0,3] - */ - virtual double pga (int which_amp) const = 0; - - /*! - * \brief Return minimum legal PGA gain in dB. - */ - virtual double pga_min () const = 0; - - /*! - * \brief Return maximum legal PGA gain in dB. - */ - virtual double pga_max () const = 0; - - /*! - * \brief Return hardware step size of PGA (linear in dB). - */ - virtual double pga_db_per_step () const = 0; - - /*! - * \brief Write direction register (output enables) for pins that go to daughterboard. - * - * \param which_side [0,1] which size - * \param value value to write into register - * \param mask which bits of value to write into reg - * - * Each d'board has 16-bits of general purpose i/o. - * Setting the bit makes it an output from the FPGA to the d'board. - * - * This register is initialized based on a value stored in the - * d'board EEPROM. In general, you shouldn't be using this routine - * without a very good reason. Using this method incorrectly will - * kill your USRP motherboard and/or daughterboard. - */ - virtual bool _write_oe (int which_side, int value, int mask) = 0; - - /*! - * \brief Write daughterboard i/o pin value - * - * \param which_side [0,1] which d'board - * \param value value to write into register - * \param mask which bits of value to write into reg - */ - virtual bool write_io (int which_side, int value, int mask) = 0; - - /*! - * \brief Read daughterboard i/o pin value - * - * \param which_side [0,1] which d'board - * \param value output - */ - virtual bool read_io (int which_side, int *value) = 0; - - /*! - * \brief Read daughterboard i/o pin value - * - * \param which_side [0,1] which d'board - * \returns register value if successful, else READ_FAILED - */ - virtual int read_io (int which_side) = 0; - - /*! - * \brief Write daughterboard refclk config register - * - * \param which_side [0,1] which d'board - * \param value value to write into register, see below - * - * <pre> - * Control whether a reference clock is sent to the daughterboards, - * and what frequency. The refclk is sent on d'board i/o pin 0. - * - * 3 2 1 - * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 - * +-----------------------------------------------+-+------------+ - * | Reserved (Must be zero) |E| DIVISOR | - * +-----------------------------------------------+-+------------+ - * - * Bit 7 -- 1 turns on refclk, 0 allows IO use - * Bits 6:0 Divider value - * </pre> - */ - virtual bool write_refclk(int which_side, int value) = 0; - - virtual bool write_atr_mask(int which_side, int value) = 0; - virtual bool write_atr_txval(int which_side, int value) = 0; - virtual bool write_atr_rxval(int which_side, int value) = 0; - - /*! - * \brief Write auxiliary digital to analog converter. - * - * \param which_side [0,1] which d'board - * N.B., SLOT_TX_A and SLOT_RX_A share the same AUX DAC's. - * SLOT_TX_B and SLOT_RX_B share the same AUX DAC's. - * \param which_dac [2,3] TX slots must use only 2 and 3. - * \param value [0,4095] - * \returns true iff successful - */ - virtual bool write_aux_dac (int which_side, int which_dac, int value) = 0; - - /*! - * \brief Read auxiliary analog to digital converter. - * - * \param which_side [0,1] which d'board - * \param which_adc [0,1] - * \param value return 12-bit value [0,4095] - * \returns true iff successful - */ - virtual bool read_aux_adc (int which_side, int which_adc, int *value) = 0; - - /*! - * \brief Read auxiliary analog to digital converter. - * - * \param which_side [0,1] which d'board - * \param which_adc [0,1] - * \returns value in the range [0,4095] if successful, else READ_FAILED. - */ - virtual int read_aux_adc (int which_side, int which_adc) = 0; - - /*! - * \brief returns current fusb block size - */ - virtual int block_size() const = 0; - - /*! - * \brief returns A/D or D/A converter rate in Hz - */ - virtual long converter_rate() const = 0; - - // END virtual daughterboard control functions - - // ---------------------------------------------------------------- - // Low level implementation routines. - // You probably shouldn't be using these... - // - - bool _set_led (int which_led, bool on); - - /*! - * \brief Write FPGA register. - * \param regno 7-bit register number - * \param value 32-bit value - * \returns true iff successful - */ - bool _write_fpga_reg (int regno, int value); //< 7-bit regno, 32-bit value - - /*! - * \brief Read FPGA register. - * \param regno 7-bit register number - * \param value 32-bit value - * \returns true iff successful - */ - bool _read_fpga_reg (int regno, int *value); //< 7-bit regno, 32-bit value - - /*! - * \brief Read FPGA register. - * \param regno 7-bit register number - * \returns register value if successful, else READ_FAILED - */ - int _read_fpga_reg (int regno); - - /*! - * \brief Write FPGA register with mask. - * \param regno 7-bit register number - * \param value 16-bit value - * \param mask 16-bit value - * \returns true if successful - * Only use this for registers who actually implement a mask in the verilog firmware, like FR_RX_MASTER_SLAVE - */ - bool _write_fpga_reg_masked (int regno, int value, int mask); - - /*! - * \brief Write AD9862 register. - * \param which_codec 0 or 1 - * \param regno 6-bit register number - * \param value 8-bit value - * \returns true iff successful - */ - bool _write_9862 (int which_codec, int regno, unsigned char value); - - /*! - * \brief Read AD9862 register. - * \param which_codec 0 or 1 - * \param regno 6-bit register number - * \param value 8-bit value - * \returns true iff successful - */ - bool _read_9862 (int which_codec, int regno, unsigned char *value) const; - - /*! - * \brief Read AD9862 register. - * \param which_codec 0 or 1 - * \param regno 6-bit register number - * \returns register value if successful, else READ_FAILED - */ - int _read_9862 (int which_codec, int regno) const; - - /*! - * \brief Write data to SPI bus peripheral. - * - * \param optional_header 0,1 or 2 bytes to write before buf. - * \param enables bitmask of peripherals to write. See usrp_spi_defs.h - * \param format transaction format. See usrp_spi_defs.h SPI_FMT_* - * \param buf the data to write - * \returns true iff successful - * Writes are limited to a maximum of 64 bytes. - * - * If \p format specifies that optional_header bytes are present, they are - * written to the peripheral immediately prior to writing \p buf. - */ - bool _write_spi (int optional_header, int enables, int format, std::string buf); - - /* - * \brief Read data from SPI bus peripheral. - * - * \param optional_header 0,1 or 2 bytes to write before buf. - * \param enables bitmask of peripheral to read. See usrp_spi_defs.h - * \param format transaction format. See usrp_spi_defs.h SPI_FMT_* - * \param len number of bytes to read. Must be in [0,64]. - * \returns the data read if sucessful, else a zero length string. - * - * Reads are limited to a maximum of 64 bytes. - * - * If \p format specifies that optional_header bytes are present, they - * are written to the peripheral first. Then \p len bytes are read from - * the peripheral and returned. - */ - std::string _read_spi (int optional_header, int enables, int format, int len); - - /*! - * \brief Start data transfers. - * Called in base class to derived class order. - */ - bool start (); - - /*! - * \brief Stop data transfers. - * Called in base class to derived class order. - */ - bool stop (); -}; - -/*! - * \brief class for accessing the receive side of the USRP - * \ingroup usrp - */ -class usrp_basic_rx : public usrp_basic -{ -private: - fusb_devhandle *d_devhandle; - fusb_ephandle *d_ephandle; - int d_bytes_seen; // how many bytes we've seen - bool d_first_read; - bool d_rx_enable; - -protected: - /*! - * \param which_board Which USRP board on usb (not particularly useful; use 0) - * \param fusb_block_size fast usb xfer block size. Must be a multiple of 512. - * Use zero for a reasonable default. - * \param fusb_nblocks number of fast usb URBs to allocate. Use zero for a reasonable default. - * \param fpga_filename name of the rbf file to load - * \param firmware_filename name of ihx file to load - */ - usrp_basic_rx (int which_board, - int fusb_block_size=0, - int fusb_nblocks=0, - const std::string fpga_filename = "", - const std::string firmware_filename = "" - ); // throws if trouble - - bool set_rx_enable (bool on); - bool rx_enable () const { return d_rx_enable; } - - bool disable_rx (); // conditional disable, return prev state - void restore_rx (bool on); // conditional set - - void probe_rx_slots (bool verbose); - -public: - ~usrp_basic_rx (); - - /*! - * \brief invokes constructor, returns instance or 0 if trouble - * - * \param which_board Which USRP board on usb (not particularly useful; use 0) - * \param fusb_block_size fast usb xfer block size. Must be a multiple of 512. - * Use zero for a reasonable default. - * \param fusb_nblocks number of fast usb URBs to allocate. Use zero for a reasonable default. - * \param fpga_filename name of file that contains image to load into FPGA - * \param firmware_filename name of file that contains image to load into FX2 - */ - static usrp_basic_rx *make (int which_board, - int fusb_block_size=0, - int fusb_nblocks=0, - const std::string fpga_filename = "", - const std::string firmware_filename = "" - ); - - /*! - * \brief tell the fpga the rate rx samples are coming from the A/D's - * - * div = fpga_master_clock_freq () / sample_rate - * - * sample_rate is determined by a myriad of registers - * in the 9862. That's why you have to tell us, so - * we can tell the fpga. - */ - bool set_fpga_rx_sample_rate_divisor (unsigned int div); - - /*! - * \brief read data from the D/A's via the FPGA. - * \p len must be a multiple of 512 bytes. - * - * \returns the number of bytes read, or -1 on error. - * - * If overrun is non-NULL it will be set true iff an RX overrun is detected. - */ - int read (void *buf, int len, bool *overrun); - - - //! sampling rate of A/D converter - virtual long converter_rate() const { return fpga_master_clock_freq(); } // 64M - long adc_rate() const { return converter_rate(); } - int daughterboard_id (int which_side) const { return d_dbid[which_side & 0x1]; } - - bool set_pga (int which_amp, double gain_in_db); - double pga (int which_amp) const; - double pga_min () const; - double pga_max () const; - double pga_db_per_step () const; - - bool _write_oe (int which_side, int value, int mask); - bool write_io (int which_side, int value, int mask); - bool read_io (int which_side, int *value); - int read_io (int which_side); - bool write_refclk(int which_side, int value); - bool write_atr_mask(int which_side, int value); - bool write_atr_txval(int which_side, int value); - bool write_atr_rxval(int which_side, int value); - - bool write_aux_dac (int which_side, int which_dac, int value); - bool read_aux_adc (int which_side, int which_adc, int *value); - int read_aux_adc (int which_side, int which_adc); - - int block_size() const; - - // called in base class to derived class order - bool start (); - bool stop (); -}; - -/*! - * \brief class for accessing the transmit side of the USRP - * \ingroup usrp - */ -class usrp_basic_tx : public usrp_basic -{ -private: - fusb_devhandle *d_devhandle; - fusb_ephandle *d_ephandle; - int d_bytes_seen; // how many bytes we've seen - bool d_first_write; - bool d_tx_enable; - - protected: - /*! - * \param which_board Which USRP board on usb (not particularly useful; use 0) - * \param fusb_block_size fast usb xfer block size. Must be a multiple of 512. - * Use zero for a reasonable default. - * \param fusb_nblocks number of fast usb URBs to allocate. Use zero for a reasonable default. - * \param fpga_filename name of file that contains image to load into FPGA - * \param firmware_filename name of file that contains image to load into FX2 - */ - usrp_basic_tx (int which_board, - int fusb_block_size=0, - int fusb_nblocks=0, - const std::string fpga_filename = "", - const std::string firmware_filename = "" - ); // throws if trouble - - bool set_tx_enable (bool on); - bool tx_enable () const { return d_tx_enable; } - - bool disable_tx (); // conditional disable, return prev state - void restore_tx (bool on); // conditional set - - void probe_tx_slots (bool verbose); - -public: - - ~usrp_basic_tx (); - - /*! - * \brief invokes constructor, returns instance or 0 if trouble - * - * \param which_board Which USRP board on usb (not particularly useful; use 0) - * \param fusb_block_size fast usb xfer block size. Must be a multiple of 512. - * Use zero for a reasonable default. - * \param fusb_nblocks number of fast usb URBs to allocate. Use zero for a reasonable default. - * \param fpga_filename name of file that contains image to load into FPGA - * \param firmware_filename name of file that contains image to load into FX2 - */ - static usrp_basic_tx *make (int which_board, int fusb_block_size=0, int fusb_nblocks=0, - const std::string fpga_filename = "", - const std::string firmware_filename = "" - ); - - /*! - * \brief tell the fpga the rate tx samples are going to the D/A's - * - * div = fpga_master_clock_freq () * 2 - * - * sample_rate is determined by a myriad of registers - * in the 9862. That's why you have to tell us, so - * we can tell the fpga. - */ - bool set_fpga_tx_sample_rate_divisor (unsigned int div); - - /*! - * \brief Write data to the A/D's via the FPGA. - * - * \p len must be a multiple of 512 bytes. - * \returns number of bytes written or -1 on error. - * - * if \p underrun is non-NULL, it will be set to true iff - * a transmit underrun condition is detected. - */ - int write (const void *buf, int len, bool *underrun); - - /* - * Block until all outstanding writes have completed. - * This is typically used to assist with benchmarking - */ - void wait_for_completion (); - - //! sampling rate of D/A converter - virtual long converter_rate() const { return fpga_master_clock_freq () * 2; } // 128M - long dac_rate() const { return converter_rate(); } - int daughterboard_id (int which_side) const { return d_dbid[which_side & 0x1]; } - - bool set_pga (int which_amp, double gain_in_db); - double pga (int which_amp) const; - double pga_min () const; - double pga_max () const; - double pga_db_per_step () const; - - bool _write_oe (int which_side, int value, int mask); - bool write_io (int which_side, int value, int mask); - bool read_io (int which_side, int *value); - int read_io (int which_side); - bool write_refclk(int which_side, int value); - bool write_atr_mask(int which_side, int value); - bool write_atr_txval(int which_side, int value); - bool write_atr_rxval(int which_side, int value); - - bool write_aux_dac (int which_side, int which_dac, int value); - bool read_aux_adc (int which_side, int which_adc, int *value); - int read_aux_adc (int which_side, int which_adc); - - int block_size() const; - - // called in base class to derived class order - bool start (); - bool stop (); -}; - -#endif /* INCLUDED_USRP_BASIC_H */ diff --git a/usrp/host/include/usrp/usrp_bytesex.h b/usrp/host/include/usrp/usrp_bytesex.h deleted file mode 100644 index 331db31c9..000000000 --- a/usrp/host/include/usrp/usrp_bytesex.h +++ /dev/null @@ -1,108 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ -#ifndef INCLUDED_USRP_BYTESEX_H -#define INCLUDED_USRP_BYTESEX_H - -/*! - * \brief routines for convertering between host and usrp byte order - * - * Prior to including this file, the user must include "config.h" - * which will or won't define WORDS_BIGENDIAN based on the - * result of the AC_C_BIGENDIAN autoconf test. - */ - -#ifdef HAVE_BYTESWAP_H -#include <byteswap.h> -#else - -#warning Using non-portable code (likely wrong other than ILP32). - -static inline unsigned short int -bswap_16 (unsigned short int x) -{ - return ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8)); -} - -static inline unsigned int -bswap_32 (unsigned int x) -{ - return ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) \ - | (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24)); -} -#endif - - -#ifdef WORDS_BIGENDIAN - -static inline unsigned int -host_to_usrp_u32 (unsigned int x) -{ - return bswap_32(x); -} - -static inline unsigned int -usrp_to_host_u32 (unsigned int x) -{ - return bswap_32(x); -} - -static inline short int -host_to_usrp_short (short int x) -{ - return bswap_16 (x); -} - -static inline short int -usrp_to_host_short (short int x) -{ - return bswap_16 (x); -} - -#else - -static inline unsigned int -host_to_usrp_u32 (unsigned int x) -{ - return x; -} - -static inline unsigned int -usrp_to_host_u32 (unsigned int x) -{ - return x; -} - -static inline short int -host_to_usrp_short (short int x) -{ - return x; -} - -static inline short int -usrp_to_host_short (unsigned short int x) -{ - return x; -} - -#endif - -#endif /* INCLUDED_USRP_BYTESEX_H */ diff --git a/usrp/host/include/usrp/usrp_local_sighandler.h b/usrp/host/include/usrp/usrp_local_sighandler.h deleted file mode 100644 index ee336750f..000000000 --- a/usrp/host/include/usrp/usrp_local_sighandler.h +++ /dev/null @@ -1,61 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_USRP_LOCAL_SIGHANDLER_H -#define INCLUDED_USRP_LOCAL_SIGHANDLER_H - -#include <signal.h> -#include <string> - -/*! - * \brief Representation of signal. - */ -class usrp_signal -{ - int d_signum; -public: - usrp_signal (int signum) : d_signum (signum) {} - int signal () const { return d_signum; } - std::string name () const; -}; - - -/*! - * \brief Get and set signal handler. - * - * Constructor installs new handler, destructor reinstalls - * original value. - */ -class usrp_local_sighandler { - int d_signum; -#ifdef HAVE_SIGACTION - struct sigaction d_old_action; -#endif -public: - usrp_local_sighandler (int signum, void (*new_handler)(int)); - ~usrp_local_sighandler (); - - /* throw usrp_signal (signum) */ - static void throw_signal (int signum) throw (usrp_signal); -}; - -#endif /* INCLUDED_USRP_LOCAL_SIGHANDLER_H */ diff --git a/usrp/host/include/usrp/usrp_prims.h b/usrp/host/include/usrp/usrp_prims.h deleted file mode 100644 index 4780d0004..000000000 --- a/usrp/host/include/usrp/usrp_prims.h +++ /dev/null @@ -1,307 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005,2009 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_USRP_PRIMS_H -#define INCLUDED_USRP_PRIMS_H - -#include <usrp/usrp_slots.h> -#include <usrp/libusb_types.h> -#include <string> - -struct libusb_context; - -static const int USRP_HASH_SIZE = 16; - -enum usrp_load_status_t { ULS_ERROR = 0, ULS_OK, ULS_ALREADY_LOADED }; - -/*! - * \brief initialize libusb; Behavior differs depending on libusb version - * - * libusb-0.12 - * - * Probe busses and devices. The argument is ignored and defaults to NULL. - * Safe to call more than once. - * - * libusb-1.0 - * - * If an location to a libusb_context is passed in, create and write in the new - * context. If no argument is provided, initialize libusb with the default - * (NULL) context. - * - * Generally _not_ safe to call more than once with non-NULL argument since a - * new context will be created each time. - */ - -void usrp_one_time_init (libusb_context **ctx = NULL); - -/*! - * \brief deinitialize libusb - * - * libusb-0.1: No effect - * - * libusb-1.0: Deinitialize context ctx - */ -void usrp_deinit (libusb_context *ctx); - -/* - * force a rescan of the buses and devices - */ -void usrp_rescan (); - -/*! - * \brief locate Nth (zero based) USRP device in system. - * Return pointer or 0 if not found. - * - * The following kinds of devices are considered USRPs: - * - * unconfigured USRP (no firwmare loaded) - * configured USRP (firmware loaded) - * unconfigured Cypress FX2 (only if fx2_ok_p is true) - */ -libusb_device *usrp_find_device (int nth, bool fx2_ok_p = false, libusb_context *ctx = NULL); - -bool usrp_usrp_p (libusb_device *q); //< is this a USRP -bool usrp_usrp0_p (libusb_device *q); //< is this a USRP Rev 0 -bool usrp_usrp1_p (libusb_device *q); //< is this a USRP Rev 1 -bool usrp_usrp2_p (libusb_device *q); //< is this a USRP Rev 2 -int usrp_hw_rev (libusb_device *q); //< return h/w rev code - -bool usrp_fx2_p (libusb_device *q); //< is this an unconfigured Cypress FX2 - -bool usrp_unconfigured_usrp_p (libusb_device *q); //< some kind of unconfigured USRP -bool usrp_configured_usrp_p (libusb_device *q); //< some kind of configured USRP - -/*! - * \brief given a libusb_device return an instance of the appropriate libusb_device_handle - * - * These routines claim the specified interface and select the - * correct alternate interface. (USB nomenclature is totally screwed!) - * - * If interface can't be opened, or is already claimed by some other - * process, 0 is returned. - */ -libusb_device_handle *usrp_open_cmd_interface (libusb_device *dev); -libusb_device_handle *usrp_open_rx_interface (libusb_device *dev); -libusb_device_handle *usrp_open_tx_interface (libusb_device *dev); - -/*! - * \brief close interface. - */ -bool usrp_close_interface (libusb_device_handle *udh); - -/*! - * \brief load intel hex format file into USRP/Cypress FX2 (8051). - * - * The filename extension is typically *.ihx - * - * Note that loading firmware may cause the device to renumerate. I.e., - * change its configuration, invalidating the current device handle. - */ - -usrp_load_status_t -usrp_load_firmware (libusb_device_handle *udh, const char *filename, bool force); - -/*! - * \brief load intel hex format file into USRP FX2 (8051). - * - * The filename extension is typically *.ihx - * - * Note that loading firmware may cause the device to renumerate. I.e., - * change its configuration, invalidating the current device handle. - * If the result is ULS_OK, usrp_load_firmware_nth delays 1 second - * then rescans the busses and devices. - */ -usrp_load_status_t -usrp_load_firmware_nth (int nth, const char *filename, bool force, libusb_context *ctx = NULL); - -/*! - * \brief load fpga configuration bitstream - */ -usrp_load_status_t -usrp_load_fpga (libusb_device_handle *udh, const char *filename, bool force); - -/*! - * \brief load the regular firmware and fpga bitstream in the Nth USRP. - * - * This is the normal starting point... - */ -bool usrp_load_standard_bits (int nth, bool force, - const std::string fpga_filename = "", - const std::string firmware_filename = "", - libusb_context *ctx = NULL); - -/*! - * \brief copy the given \p hash into the USRP hash slot \p which. - * The usrp implements two hash slots, 0 and 1. - */ -bool usrp_set_hash (libusb_device_handle *udh, int which, - const unsigned char hash[USRP_HASH_SIZE]); - -/*! - * \brief retrieve the \p hash from the USRP hash slot \p which. - * The usrp implements two hash slots, 0 and 1. - */ -bool usrp_get_hash (libusb_device_handle *udh, int which, - unsigned char hash[USRP_HASH_SIZE]); - -bool usrp_write_fpga_reg (libusb_device_handle *udh, int reg, int value); -bool usrp_read_fpga_reg (libusb_device_handle *udh, int reg, int *value); -bool usrp_set_fpga_reset (libusb_device_handle *udh, bool on); -bool usrp_set_fpga_tx_enable (libusb_device_handle *udh, bool on); -bool usrp_set_fpga_rx_enable (libusb_device_handle *udh, bool on); -bool usrp_set_fpga_tx_reset (libusb_device_handle *udh, bool on); -bool usrp_set_fpga_rx_reset (libusb_device_handle *udh, bool on); -bool usrp_set_led (libusb_device_handle *udh, int which, bool on); - -bool usrp_check_rx_overrun (libusb_device_handle *udh, bool *overrun_p); -bool usrp_check_tx_underrun (libusb_device_handle *udh, bool *underrun_p); - -// i2c_read and i2c_write are limited to a maximum len of 64 bytes. - -bool usrp_i2c_write (libusb_device_handle *udh, int i2c_addr, - const void *buf, int len); - -bool usrp_i2c_read (libusb_device_handle *udh, int i2c_addr, - void *buf, int len); - -// spi_read and spi_write are limited to a maximum of 64 bytes -// See usrp_spi_defs.h for more info - -bool usrp_spi_write (libusb_device_handle *udh, - int optional_header, int enables, int format, - const void *buf, int len); - -bool usrp_spi_read (libusb_device_handle *udh, - int optional_header, int enables, int format, - void *buf, int len); - - -bool usrp_9862_write (libusb_device_handle *udh, - int which_codec, // [0, 1] - int regno, // [0, 63] - int value); // [0, 255] - -bool usrp_9862_read (libusb_device_handle *udh, - int which_codec, // [0, 1] - int regno, // [0, 63] - unsigned char *value); // [0, 255] - -/*! - * \brief Write multiple 9862 regs at once. - * - * \p buf contains alternating register_number, register_value pairs. - * \p len must be even and is the length of buf in bytes. - */ -bool usrp_9862_write_many (libusb_device_handle *udh, int which_codec, - const unsigned char *buf, int len); - - -/*! - * \brief write specified regs to all 9862's in the system - */ -bool usrp_9862_write_many_all (libusb_device_handle *udh, - const unsigned char *buf, int len); - - -// Write 24LC024 / 24LC025 EEPROM on motherboard or daughterboard. -// Which EEPROM is determined by i2c_addr. See i2c_addr.h - -bool usrp_eeprom_write (libusb_device_handle *udh, int i2c_addr, - int eeprom_offset, const void *buf, int len); - - -// Read 24LC024 / 24LC025 EEPROM on motherboard or daughterboard. -// Which EEPROM is determined by i2c_addr. See i2c_addr.h - -bool usrp_eeprom_read (libusb_device_handle *udh, int i2c_addr, - int eeprom_offset, void *buf, int len); - - -// Slot specific i/o routines - -/*! - * \brief write to the specified aux dac. - * - * \p slot: which Tx or Rx slot to write. - * N.B., SLOT_TX_A and SLOT_RX_A share the same AUX DAC's - * SLOT_TX_B and SLOT_RX_B share the same AUX DAC's - * - * \p which_dac: [0,3] RX slots must use only 0 and 1. - * TX slots must use only 2 and 3. - * - * AUX DAC 3 is really the 9862 sigma delta output. - * - * \p value to write to aux dac. All dacs take straight - * binary values. Although dacs 0, 1 and 2 are 8-bit and dac 3 is 12-bit, - * the interface is in terms of 12-bit values [0,4095] - */ -bool usrp_write_aux_dac (libusb_device_handle *uhd, int slot, - int which_dac, int value); - -/*! - * \brief Read the specified aux adc - * - * \p slot: which Tx or Rx slot to read aux dac - * \p which_adc: [0,1] which of the two adcs to read - * \p *value: return value, 12-bit straight binary. - */ -bool usrp_read_aux_adc (libusb_device_handle *udh, int slot, - int which_adc, int *value); - - -/*! - * \brief usrp daughterboard id to name mapping - */ -const std::string usrp_dbid_to_string (int dbid); - - -enum usrp_dbeeprom_status_t { UDBE_OK, UDBE_BAD_SLOT, UDBE_NO_EEPROM, UDBE_INVALID_EEPROM }; - -struct usrp_dboard_eeprom { - unsigned short id; // d'board identifier code - unsigned short oe; // fpga output enables: - // If bit set, i/o pin is an output from FPGA. - short offset[2]; // ADC/DAC offset correction -}; - -/*! - * \brief Read and return parsed daughterboard eeprom - */ -usrp_dbeeprom_status_t -usrp_read_dboard_eeprom (libusb_device_handle *udh, - int slot_id, usrp_dboard_eeprom *eeprom); - -/*! - * \brief write ADC/DAC offset calibration constants to d'board eeprom - */ -bool usrp_write_dboard_offsets (libusb_device_handle *udh, int slot_id, - short offset0, short offset1); - -/*! - * \brief return a usrp's serial number. - * - * Note that this only works on a configured usrp. - * \returns non-zero length string iff successful. - */ -std::string usrp_serial_number(libusb_device_handle *udh); - -#endif /* INCLUDED_USRP_PRIMS_H */ diff --git a/usrp/host/include/usrp/usrp_slots.h b/usrp/host/include/usrp/usrp_slots.h deleted file mode 100644 index d2c50fc47..000000000 --- a/usrp/host/include/usrp/usrp_slots.h +++ /dev/null @@ -1,33 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_USRP_SLOTS_H -#define INCLUDED_USRP_SLOTS_H - -// daughterboard slot numbers used in some calls - -static const int SLOT_TX_A = 0; -static const int SLOT_RX_A = 1; -static const int SLOT_TX_B = 2; -static const int SLOT_RX_B = 3; - -#endif /* INCLUDED_USRP_SLOTS_H */ diff --git a/usrp/host/include/usrp/usrp_standard.h b/usrp/host/include/usrp/usrp_standard.h deleted file mode 100644 index a631f8b09..000000000 --- a/usrp/host/include/usrp/usrp_standard.h +++ /dev/null @@ -1,452 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004,2008,2009 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_USRP_STANDARD_H -#define INCLUDED_USRP_STANDARD_H - -#include <usrp/usrp_basic.h> -#include <boost/shared_ptr.hpp> -#include <usrp/usrp_tune_result.h> - -class usrp_standard_tx; -class usrp_standard_rx; - -typedef boost::shared_ptr<usrp_standard_tx> usrp_standard_tx_sptr; -typedef boost::shared_ptr<usrp_standard_rx> usrp_standard_rx_sptr; - -/*! - * \ingroup usrp - */ -class usrp_standard_common -{ - int d_fpga_caps; // capability register val - -protected: - usrp_standard_common(usrp_basic *parent); - -public: - /*! - *\brief does the FPGA implement the final Rx half-band filter? - * If it doesn't, the maximum decimation factor with proper gain - * is 1/2 of what it would otherwise be. - */ - bool has_rx_halfband() const; - - /*! - * \brief number of digital downconverters implemented in the FPGA - * This will be 0, 1, 2 or 4. - */ - int nddcs() const; - - /*! - *\brief does the FPGA implement the initial Tx half-band filter? - */ - bool has_tx_halfband() const; - - /*! - * \brief number of digital upconverters implemented in the FPGA - * This will be 0, 1, or 2. - */ - int nducs() const; - - /*! - * \brief Calculate the frequency to use for setting the digital up or down converter. - * - * \param target_freq is the desired RF frequency (Hz). - * \param baseband_freq is the RF frequency that corresponds to DC in the IF coming from the d'board. - * \param fs is the sampling frequency. - * \param[out] dxc_freq the frequency to program into the DDC (or DUC). - * \param[out] inverted is true if we're operating in an inverted Nyquist zone. - */ - static void calc_dxc_freq(double target_freq, double baseband_freq, double fs, - double *dxc_freq, bool *inverted); -}; - -/*! - * \brief The C++ interface the receive side of the USRP - * \ingroup usrp - * - * This is the recommended interface to USRP receive functionality - * for applications that use the USRP but not GNU Radio. - */ -class usrp_standard_rx : public usrp_basic_rx, public usrp_standard_common -{ - private: - static const int MAX_CHAN = 4; - unsigned int d_decim_rate; - int d_nchan; - int d_sw_mux; - int d_hw_mux; - double d_rx_freq[MAX_CHAN]; - - protected: - usrp_standard_rx (int which_board, - unsigned int decim_rate, - int nchan = 1, - int mux = -1, - int mode = 0, - int fusb_block_size = 0, - int fusb_nblocks = 0, - const std::string fpga_filename = "", - const std::string firmware_filename = "" - ); // throws if trouble - - bool write_hw_mux_reg (); - - public: - - enum { - FPGA_MODE_NORMAL = 0x00, - FPGA_MODE_LOOPBACK = 0x01, - FPGA_MODE_COUNTING = 0x02, - FPGA_MODE_COUNTING_32BIT = 0x04 - }; - - ~usrp_standard_rx (); - - /*! - * \brief invokes constructor, returns shared_ptr or shared_ptr equivalent of 0 if trouble - * - * \param which_board Which USRP board on usb (not particularly useful; use 0) - * \param decim_rate decimation factor - * \param nchan number of channels - * \param mux Rx mux setting, \sa set_mux - * \param mode mode - * \param fusb_block_size fast usb xfer block size. Must be a multiple of 512. - * Use zero for a reasonable default. - * \param fusb_nblocks number of fast usb URBs to allocate. Use zero for a reasonable default. - * \param fpga_filename Name of rbf file to load - * \param firmware_filename Name of ihx file to load - */ - static usrp_standard_rx_sptr make(int which_board, - unsigned int decim_rate, - int nchan = 1, - int mux = -1, - int mode = 0, - int fusb_block_size = 0, - int fusb_nblocks = 0, - const std::string fpga_filename = "", - const std::string firmware_filename = "" - ); - /*! - * \brief Set decimator rate. \p rate MUST BE EVEN and in [8, 256]. - * - * The final complex sample rate across the USB is - * adc_freq () / decim_rate () * nchannels () - */ - bool set_decim_rate (unsigned int rate); - - /*! - * \brief Set number of active channels. \p nchannels must be 1, 2 or 4. - * - * The final complex sample rate across the USB is - * adc_freq () / decim_rate () * nchannels () - */ - bool set_nchannels (int nchannels); - - /*! - * \brief Set input mux configuration. - * - * This determines which ADC (or constant zero) is connected to - * each DDC input. There are 4 DDCs. Each has two inputs. - * - * <pre> - * Mux value: - * - * 3 2 1 - * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 - * +-------+-------+-------+-------+-------+-------+-------+-------+ - * | Q3 | I3 | Q2 | I2 | Q1 | I1 | Q0 | I0 | - * +-------+-------+-------+-------+-------+-------+-------+-------+ - * - * Each 4-bit I field is either 0,1,2,3 - * Each 4-bit Q field is either 0,1,2,3 or 0xf (input is const zero) - * All Q's must be 0xf or none of them may be 0xf - * </pre> - */ - bool set_mux (int mux); - - /*! - * Determine the appropriate Rx mux value as a function of the subdevice choosen - * and the characteristics of the respective daughterboard. - */ - int determine_rx_mux_value(const usrp_subdev_spec &ss); - int determine_rx_mux_value(const usrp_subdev_spec &ss_a, const usrp_subdev_spec &ss_b); - - /*! - * \brief set the frequency of the digital down converter. - * - * \p channel must be in the range [0,3]. \p freq is the center - * frequency in Hz. \p freq may be either negative or postive. - * The frequency specified is quantized. Use rx_freq to retrieve - * the actual value used. - */ - bool set_rx_freq (int channel, double freq); - - /*! - * \brief set fpga mode - */ - bool set_fpga_mode (int mode); - - /*! - * \brief Set the digital down converter phase register. - * - * \param channel which ddc channel [0, 3] - * \param phase 32-bit integer phase value. - */ - bool set_ddc_phase(int channel, int phase); - - /*! - * \brief Specify Rx data format. - * - * \param format format specifier - * - * Rx data format control register - * - * 3 2 1 - * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 - * +-----------------------------------------+-+-+---------+-------+ - * | Reserved (Must be zero) |B|Q| WIDTH | SHIFT | - * +-----------------------------------------+-+-+---------+-------+ - * - * SHIFT specifies arithmetic right shift [0, 15] - * WIDTH specifies bit-width of I & Q samples across the USB [1, 16] (not all valid) - * Q if set deliver both I & Q, else just I - * B if set bypass half-band filter. - * - * Right now the acceptable values are: - * - * B Q WIDTH SHIFT - * 0 1 16 0 - * 0 1 8 8 - * - * More valid combos to come. - * - * Default value is 0x00000300 16-bits, 0 shift, deliver both I & Q. - */ - bool set_format(unsigned int format); - - static unsigned int make_format(int width=16, int shift=0, - bool want_q=true, bool bypass_halfband=false); - static int format_width(unsigned int format); - static int format_shift(unsigned int format); - static bool format_want_q(unsigned int format); - static bool format_bypass_halfband(unsigned int format); - - /*! - * \brief High-level "tune" method. Works for the single channel case. - * - * This method adjusts both the daughterboard LO and the DDC so that - * target_freq ends up at DC in the complex baseband samples. - * - * \param chan which DDC channel we're controlling (almost always 0). - * \param db the daughterboard we're controlling. - * \param target_freq the RF frequency we want at DC in the complex baseband. - * \param[out] result details how the hardware was configured. - * - * \returns true iff everything was successful. - */ - bool tune(int chan, db_base_sptr db, double target_freq, usrp_tune_result *result); - - - // ACCESSORS - unsigned int decim_rate () const; - double rx_freq (int channel) const; - int nchannels () const; - int mux () const; - unsigned int format () const; - - // called in base class to derived class order - bool start (); - bool stop (); -}; - -// ---------------------------------------------------------------- - -/*! - * \brief The C++ interface the transmit side of the USRP - * \ingroup usrp - * - * This is the recommended interface to USRP transmit functionality - * for applications that use the USRP but not GNU Radio. - * - * Uses digital upconverter (coarse & fine modulators) in AD9862... - */ -class usrp_standard_tx : public usrp_basic_tx, public usrp_standard_common -{ - public: - enum coarse_mod_t { - CM_NEG_FDAC_OVER_4, // -32 MHz - CM_NEG_FDAC_OVER_8, // -16 MHz - CM_OFF, - CM_POS_FDAC_OVER_8, // +16 MHz - CM_POS_FDAC_OVER_4 // +32 MHz - }; - - protected: - static const int MAX_CHAN = 2; - unsigned int d_interp_rate; - int d_nchan; - int d_sw_mux; - int d_hw_mux; - double d_tx_freq[MAX_CHAN]; - coarse_mod_t d_coarse_mod[MAX_CHAN]; - unsigned char d_tx_modulator_shadow[MAX_CHAN]; - - virtual bool set_coarse_modulator (int channel, coarse_mod_t cm); - usrp_standard_tx::coarse_mod_t coarse_modulator (int channel) const; - - protected: - usrp_standard_tx (int which_board, - unsigned int interp_rate, - int nchan = 1, - int mux = -1, - int fusb_block_size = 0, - int fusb_nblocks = 0, - const std::string fpga_filename = "", - const std::string firmware_filename = "" - ); // throws if trouble - - bool write_hw_mux_reg (); - - public: - ~usrp_standard_tx (); - - /*! - * \brief invokes constructor, returns shared_ptr or shared_ptr equivalent of 0 if trouble - * - * \param which_board Which USRP board on usb (not particularly useful; use 0) - * \param interp_rate interpolation factor - * \param nchan number of channels - * \param mux Tx mux setting, \sa set_mux - * \param fusb_block_size fast usb xfer block size. Must be a multiple of 512. - * Use zero for a reasonable default. - * \param fusb_nblocks number of fast usb URBs to allocate. Use zero for a reasonable default. - * \param fpga_filename Name of rbf file to load - * \param firmware_filename Name of ihx file to load - */ - static usrp_standard_tx_sptr make(int which_board, - unsigned int interp_rate, - int nchan = 1, - int mux = -1, - int fusb_block_size = 0, - int fusb_nblocks = 0, - const std::string fpga_filename = "", - const std::string firmware_filename = "" - ); - - /*! - * \brief Set interpolator rate. \p rate must be in [4, 512] and a multiple of 4. - * - * The final complex sample rate across the USB is - * dac_freq () / interp_rate () * nchannels () - */ - virtual bool set_interp_rate (unsigned int rate); - - /*! - * \brief Set number of active channels. \p nchannels must be 1 or 2. - * - * The final complex sample rate across the USB is - * dac_freq () / decim_rate () * nchannels () - */ - bool set_nchannels (int nchannels); - - /*! - * \brief Set output mux configuration. - * - * <pre> - * 3 2 1 - * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 - * +-------------------------------+-------+-------+-------+-------+ - * | | DAC3 | DAC2 | DAC1 | DAC0 | - * +-------------------------------+-------+-------+-------+-------+ - * - * There are two interpolators with complex inputs and outputs. - * There are four DACs. - * - * Each 4-bit DACx field specifies the source for the DAC and - * whether or not that DAC is enabled. Each subfield is coded - * like this: - * - * 3 2 1 0 - * +-+-----+ - * |E| N | - * +-+-----+ - * - * Where E is set if the DAC is enabled, and N specifies which - * interpolator output is connected to this DAC. - * - * N which interp output - * --- ------------------- - * 0 chan 0 I - * 1 chan 0 Q - * 2 chan 1 I - * 3 chan 1 Q - * </pre> - */ - bool set_mux (int mux); - - /*! - * Determine the appropriate Tx mux value as a function of the subdevice choosen - * and the characteristics of the respective daughterboard. - */ - int determine_tx_mux_value(const usrp_subdev_spec &ss); - int determine_tx_mux_value(const usrp_subdev_spec &ss_a, const usrp_subdev_spec &ss_b); - - /*! - * \brief set the frequency of the digital up converter. - * - * \p channel must be in the range [0,1]. \p freq is the center - * frequency in Hz. It must be in the range [-44M, 44M]. - * The frequency specified is quantized. Use tx_freq to retrieve - * the actual value used. - */ - virtual bool set_tx_freq (int channel, double freq); // chan: [0,1] - - // ACCESSORS - unsigned int interp_rate () const; - double tx_freq (int channel) const; - int nchannels () const; - int mux () const; - - /*! - * \brief High-level "tune" method. Works for the single channel case. - * - * This method adjusts both the daughterboard LO and the DUC so that - * DC in the complex baseband samples ends up at RF target_freq. - * - * \param chan which DUC channel we're controlling (usually == which_side). - * \param db the daughterboard we're controlling. - * \param target_freq the RF frequency we want our baseband translated to. - * \param[out] result details how the hardware was configured. - * - * \returns true iff everything was successful. - */ - bool tune(int chan, db_base_sptr db, double target_freq, usrp_tune_result *result); - - - // called in base class to derived class order - bool start (); - bool stop (); -}; - -#endif /* INCLUDED_USRP_STANDARD_H */ diff --git a/usrp/host/include/usrp/usrp_subdev_spec.h b/usrp/host/include/usrp/usrp_subdev_spec.h deleted file mode 100644 index e841ff832..000000000 --- a/usrp/host/include/usrp/usrp_subdev_spec.h +++ /dev/null @@ -1,50 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2008 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#ifndef INCLUDED_USRP_SUBDEV_SPEC_H -#define INCLUDED_USRP_SUBDEV_SPEC_H - -/*! - * \brief specify a daughterboard and subdevice on a daughterboard. - * - * In the USRP1, there are two sides, A and B. - * - * A daughterboard generally implements a single subdevice, but may in - * general implement any number of subdevices. At this time, all daughterboards - * with the exception of the Basic Rx and LF Rx implement a single subdevice. - * - * The Basic Rx and LF Rx implement 2 subdevices (soon 3). Subdevice - * 0 routes input RX-A to the DDC I input and routes a constant zero - * to the DDC Q input. Similarly, subdevice 1 routes input RX-B to - * the DDC I input and routes a constant zero to the DDC Q - * input. Subdevice 2 (when implemented) will route RX-A to the DDC I - * input and RX-B to the DDC Q input. - */ - -struct usrp_subdev_spec { - unsigned int side; // 0 -> A; 1 -> B - unsigned int subdev; // which subdevice (usually zero) - - usrp_subdev_spec(unsigned int _side = 0, unsigned int _subdev = 0) - : side(_side), subdev(_subdev) {} -}; - -#endif /* INCLUDED_USRP_SUBDEV_SPEC_H */ diff --git a/usrp/host/include/usrp/usrp_tune_result.h b/usrp/host/include/usrp/usrp_tune_result.h deleted file mode 100644 index 200541a37..000000000 --- a/usrp/host/include/usrp/usrp_tune_result.h +++ /dev/null @@ -1,44 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2008 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -#ifndef INCLUDED_USRP_TUNE_RESULT_H -#define INCLUDED_USRP_TUNE_RESULT_H - -class usrp_tune_result -{ -public: - // RF frequency that corresponds to DC in the IF - double baseband_freq; - - // frequency programmed into the DDC/DUC - double dxc_freq; - - // residual frequency (typically < 0.01 Hz) - double residual_freq; - - // is the spectrum inverted? - bool inverted; - - usrp_tune_result(double baseband=0, double dxc=0, double residual=0, bool _inverted=false) - : baseband_freq(baseband), dxc_freq(dxc), - residual_freq(residual), inverted(_inverted) {} -}; - -#endif /* INCLUDED_USRP_TUNE_RESULT_H */ diff --git a/usrp/host/lib/.gitignore b/usrp/host/lib/.gitignore deleted file mode 100644 index e0e4208db..000000000 --- a/usrp/host/lib/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -/Makefile -/Makefile.in -/.la -/.lo -/.deps -/.libs -/*.la -/*.lo -/test_fusb -/std_paths.h -/usrp_dbid.py -/usrp_dbid.h -/usrp_dbid.cc -/stamp-* diff --git a/usrp/host/lib/Makefile.am b/usrp/host/lib/Makefile.am deleted file mode 100644 index 96ab55821..000000000 --- a/usrp/host/lib/Makefile.am +++ /dev/null @@ -1,194 +0,0 @@ -# -# USRP - Universal Software Radio Peripheral -# -# Copyright (C) 2003,2004,2006,2007,2008,2009,2010 Free Software Foundation, Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Boston, MA 02110-1301 USA -# - -include $(top_srcdir)/Makefile.common - -common_INCLUDES = $(USRP_INCLUDES) $(USB_INCLUDES) - -lib_LTLIBRARIES = libusrp.la - -libusrp_la_common_LDFLAGS = $(NO_UNDEFINED) $(LTVERSIONFLAGS) $(BOOST_LDFLAGS) - -libusrp_la_common_LIBADD = \ - $(USB_LIBS) \ - $(BOOST_THREAD_LIB) \ - ../misc/libmisc.la - -# darwin fusb requires gruel (for threading) -if FUSB_TECH_darwin -AM_CPPFLAGS = $(GRUEL_INCLUDES) $(common_INCLUDES) $(BOOST_CPPFLAGS) $(WITH_INCLUDES) -libusrp_la_LIBADD = $(libusrp_la_common_LIBADD) $(GRUEL_LA) -libusrp_la_LDFLAGS = $(libusrp_la_common_LDFLAGS) -framework CoreFoundation -else -AM_CPPFLAGS = $(common_INCLUDES) $(BOOST_CPPFLAGS) $(WITH_INCLUDES) -libusrp_la_LIBADD = $(libusrp_la_common_LIBADD) -libusrp_la_LDFLAGS = $(libusrp_la_common_LDFLAGS) -endif - -EXTRA_DIST += \ - std_paths.h.in \ - usrp_dbid.dat - -BUILT_SOURCES += $(abs_top_builddir)/usrp/host/include/usrp/usrp_dbid.h - -BUILT_SOURCES += usrp_dbid.cc \ - usrp_dbid.py - -# ---------------------------------------------------------------- -# FUSB_TECH is set at configure time by way of -# usrp/config/usrp_fusb_tech.m4. -# It indicates which fast usb strategy we should be building. -# We currently implement "generic", "darwin", "win32" and "linux" - - -generic_CODE = \ - fusb_generic.cc \ - fusb_sysconfig_generic.cc \ - usrp_prims_libusb0.cc - -darwin_CODE = \ - fusb_darwin.cc \ - fusb_sysconfig_darwin.cc \ - README_OSX \ - circular_buffer.h \ - circular_linked_list.h \ - darwin_libusb.h \ - usrp_prims_libusb0.cc - - -win32_CODE = \ - fusb_win32.cc \ - fusb_sysconfig_win32.cc \ - usrp_prims_libusb0.cc - - -linux_CODE = \ - fusb_linux.cc \ - fusb_sysconfig_linux.cc \ - usrp_prims_libusb0.cc - -ra_wb_CODE = \ - fusb_ra_wb.cc \ - fusb_sysconfig_ra_wb.cc \ - usrp_prims_libusb0.cc - -libusb1_CODE = \ - fusb_libusb1.cc \ - fusb_sysconfig_libusb1.cc \ - usrp_prims_libusb1.cc - -# -# include each <foo>_CODE entry here... -# -EXTRA_libusrp_la_SOURCES = \ - $(generic_CODE) \ - $(darwin_CODE) \ - $(win32_CODE) \ - $(linux_CODE) \ - $(ra_wb_CODE) \ - $(libusb1_CODE) - -# work around automake deficiency -libusrp_la_common_SOURCES = \ - fusb.cc \ - md5.c \ - usrp_basic.cc \ - usrp_config.cc \ - usrp_dbid.cc \ - usrp_local_sighandler.cc \ - usrp_prims_common.cc \ - usrp_standard.cc \ - db_wbxng_adf4350.cc \ - db_wbxng_adf4350_regs.cc \ - db_boards.cc \ - db_base.cc \ - db_basic.cc \ - db_bitshark_rx.cc \ - db_tv_rx.cc \ - db_tv_rx_mimo.cc \ - db_flexrf.cc \ - db_flexrf_mimo.cc \ - db_dbs_rx.cc \ - db_wbxng.cc \ - db_xcvr2450.cc \ - db_dtt754.cc \ - db_dtt768.cc \ - db_util.cc - -if FUSB_TECH_generic -libusrp_la_SOURCES = $(libusrp_la_common_SOURCES) $(generic_CODE) -endif - -if FUSB_TECH_darwin -libusrp_la_SOURCES = $(libusrp_la_common_SOURCES) $(darwin_CODE) -endif - -if FUSB_TECH_win32 -libusrp_la_SOURCES = $(libusrp_la_common_SOURCES) $(win32_CODE) -endif - -if FUSB_TECH_linux -libusrp_la_SOURCES = $(libusrp_la_common_SOURCES) $(linux_CODE) -endif - -if FUSB_TECH_ra_wb -libusrp_la_SOURCES = $(libusrp_la_common_SOURCES) $(ra_wb_CODE) -endif - -if FUSB_TECH_libusb1 -libusrp_la_SOURCES = $(libusrp_la_common_SOURCES) $(libusb1_CODE) -endif - - -noinst_HEADERS = \ - ad9862.h \ - db_base_impl.h \ - db_boards.h \ - db_util.h \ - db_wbxng_adf4350.h \ - db_wbxng_adf4350_regs.h \ - fusb.h \ - fusb_darwin.h \ - fusb_generic.h \ - fusb_linux.h \ - fusb_libusb1.h \ - fusb_ra_wb.h \ - fusb_win32.h \ - md5.h \ - rate_to_regval.h \ - usrp_config.h \ - usrp_primsi.h - -if PYTHON -usrppython_PYTHON = \ - usrp_dbid.py - -noinst_PYTHON = \ - gen_usrp_dbid.py \ - check_data.py \ - dump_data.py -endif - -# common way for generating sources from templates when using -# BUILT_SOURCES, using parallel build protection. -gen_sources = $(BUILT_SOURCES) -gen_sources_deps = gen_usrp_dbid.py usrp_dbid.dat -par_gen_command = PYTHONPATH=$(top_srcdir)/usrp/src srcdir=$(srcdir) $(PYTHON) $(srcdir)/gen_usrp_dbid.py $(srcdir)/usrp_dbid.dat -include $(top_srcdir)/Makefile.par.gen diff --git a/usrp/host/lib/README_OSX b/usrp/host/lib/README_OSX deleted file mode 100644 index 37026f25a..000000000 --- a/usrp/host/lib/README_OSX +++ /dev/null @@ -1,63 +0,0 @@ -USRP Darwin Fast USB Changes -Version 0.2 of 2006-04-27 -Michael Dickens <mdickens @at@ nd .dot. edu> - -The files included in this archive are: - -circular_buffer.h -circular_linked_list.h -darwin_libusb.h -fusb_darwin.cc -fusb_darwin.h -mld_threads.h - -These files allow GNURadio code for Darwin / MaxOS X to talk to the -USRP via USB 2.0 at rates up to around 30 Mega-Bytes/sec (MBps), up -from 4-8 MBps without the changes. - -I implemented the buffering myself; there are probably GR buffers -available which would do the work but as this is "beta" software it's -a good place to start. Speed improvements are made by porting -LIBUSB's non-true async bulk read and write functions into USRP's -"fusb", and upgrading them to handle -true- async transfers. -Unfortunately, the easiest way to do this is to spawn a thread or 2 to -handle the "async" part of the transfers. This implementation uses -Darwin's pthreads to do the work for mutexes, conditions, and threads. -Previous implementations (0.1 and before) used "omni_threads" as -provided by gnuradio-core, which caused issues with compiling and -execution ... I'm glad that this is no longer the case. - -As far as I have tested, there is no way to improve the throughput to -32+ MBps without moving into Darwin's "port"s ... a kernel-level data -transport method with a user/application layer for USB-specific -functions. Unfortunately, Apple's documentation for these "port"s is -minimal; I have learned more from reading the Darwin source code -< http://darwinsource.opendarwin.org/ > than by reading Apple's -documents! This would also require -not- using LIBUSB, of which the -removal from the rest of the USRP code would be potentially tedious. - -If you run into issues either compiling or testing the USRP on -OSX, please send me a note. - -(1) Go through the bootstrap, configure, compile, and install as -usual (e.g. see < http://www.nd.edu/~mdickens/GNURadio/ > for my -usual). - -(2) from .../usrp/host/apps : run the scripts -++++++++++++++++ -./test_usrp_standard_tx -./test_usrp_standard_rx -++++++++++++++++ - -For -all- systems I've tested on thus far, both of these return -exactly 41 overruns / underruns, and -most- systems start out with a -stalled pipe. This stall comes in a usb_control function call to -LIBUSB; one would have to change the LIBUSB code to handle this issue. - -(3) from gr-build/gnuradio-examples/python/usrp : -++++++++++++++++ -./benchmark_usb.py -++++++++++++++++ - -(4) If you get to here, the try doing the FM receiver (gui or not). -If that sounds correct, then the USB is working. Yay!
\ No newline at end of file diff --git a/usrp/host/lib/ad9862.h b/usrp/host/lib/ad9862.h deleted file mode 100644 index 4375d93d8..000000000 --- a/usrp/host/lib/ad9862.h +++ /dev/null @@ -1,221 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_AD9862_H -#define INCLUDED_AD9862_H - -/* - * Analog Devices AD9862 registers and some fields - */ - -#define BEGIN_AD9862 namespace ad9862 { -#define END_AD962 } -#define DEF static const int - -BEGIN_AD9862; - -DEF REG_GENERAL = 0; -DEF REG_RX_PWR_DN = 1; -DEF RX_PWR_DN_VREF_DIFF = (1 << 7); -DEF RX_PWR_DN_VREF = (1 << 6); -DEF RX_PWR_DN_RX_DIGIGAL = (1 << 5); -DEF RX_PWR_DN_RX_B = (1 << 4); -DEF RX_PWR_DN_RX_A = (1 << 3); -DEF RX_PWR_DN_BUF_B = (1 << 2); -DEF RX_PWR_DN_BUF_A = (1 << 1); -DEF RX_PWR_DN_ALL = (1 << 0); - -DEF REG_RX_A = 2; // bypass input buffer / RxPGA -DEF REG_RX_B = 3; // pypass input buffer / RxPGA -DEF RX_X_BYPASS_INPUT_BUFFER = (1 << 7); - -DEF REG_RX_MISC = 4; -DEF RX_MISC_HS_DUTY_CYCLE = (1 << 2); -DEF RX_MISC_SHARED_REF = (1 << 1); -DEF RX_MISC_CLK_DUTY = (1 << 0); - -DEF REG_RX_IF = 5; -DEF RX_IF_THREE_STATE = (1 << 4); -DEF RX_IF_USE_CLKOUT1 = (0 << 3); -DEF RX_IF_USE_CLKOUT2 = (1 << 3); // aka Rx Retime -DEF RX_IF_2S_COMP = (1 << 2); -DEF RX_IF_INV_RX_SYNC = (1 << 1); -DEF RX_IF_MUX_OUT = (1 << 0); - -DEF REG_RX_DIGITAL = 6; -DEF RX_DIGITAL_2_CHAN = (1 << 3); -DEF RX_DIGITAL_KEEP_MINUS_VE = (1 << 2); -DEF RX_DIGITAL_HILBERT = (1 << 1); -DEF RX_DIGITAL_DECIMATE = (1 << 0); - -DEF REG_RESERVED_7 = 7; - -DEF REG_TX_PWR_DN = 8; -DEF TX_PWR_DN_ALT_TIMING_MODE = (1 << 5); -DEF TX_PWR_DN_TX_OFF_ENABLE = (1 << 4); -DEF TX_PWR_DN_TX_DIGITAL = (1 << 3); -DEF TX_PWR_DN_TX_ANALOG_B = 0x4; -DEF TX_PWR_DN_TX_ANALOG_A = 0x2; -DEF TX_PWR_DN_TX_ANALOG_BOTH = 0x7; - -DEF REG_RESERVED_9 = 9; - -DEF REG_TX_A_OFFSET_LO = 10; -DEF REG_TX_A_OFFSET_HI = 11; -DEF REG_TX_B_OFFSET_LO = 12; -DEF REG_TX_B_OFFSET_HI = 13; - -DEF REG_TX_A_GAIN = 14; // fine trim for matching -DEF REG_TX_B_GAIN = 15; // fine trim for matching -DEF TX_X_GAIN_COARSE_FULL = (3 << 6); -DEF TX_X_GAIN_COARSE_1_HALF = (1 << 6); -DEF TX_X_GAIN_COARSE_1_ELEVENTH = (0 << 6); - -DEF REG_TX_PGA = 16; // 20 dB continuous gain in 0.1 dB steps - // 0x00 = min gain (-20 dB) - // 0xff = max gain ( 0 dB) - -DEF REG_TX_MISC = 17; -DEF TX_MISC_SLAVE_ENABLE = (1 << 1); -DEF TX_MISC_TX_PGA_FAST = (1 << 0); - -DEF REG_TX_IF = 18; -DEF TX_IF_USE_CLKOUT2 = (0 << 6); -DEF TX_IF_USE_CLKOUT1 = (1 << 6); // aka Tx Retime -DEF TX_IF_I_FIRST = (0 << 5); -DEF TX_IF_Q_FIRST = (1 << 5); -DEF TX_IF_INV_TX_SYNC = (1 << 4); -DEF TX_IF_2S_COMP = (1 << 3); -DEF TX_IF_INVERSE_SAMPLE = (1 << 2); -DEF TX_IF_TWO_EDGES = (1 << 1); -DEF TX_IF_INTERLEAVED = (1 << 0); - -DEF REG_TX_DIGITAL = 19; -DEF TX_DIGITAL_2_DATA_PATHS = (1 << 4); -DEF TX_DIGITAL_KEEP_NEGATIVE = (1 << 3); -DEF TX_DIGITAL_HILBERT = (1 << 2); -DEF TX_DIGITAL_INTERPOLATE_NONE = 0x0; -DEF TX_DIGITAL_INTERPOLATE_2X = 0x1; -DEF TX_DIGITAL_INTERPOLATE_4X = 0x2; - -DEF REG_TX_MODULATOR = 20; -DEF TX_MODULATOR_NEG_FINE_TUNE = (1 << 5); -DEF TX_MODULATOR_DISABLE_NCO = (0 << 4); -DEF TX_MODULATOR_ENABLE_NCO = (1 << 4); // aka Fine Mode -DEF TX_MODULATOR_REAL_MIX_MODE = (1 << 3); -DEF TX_MODULATOR_NEG_COARSE_TUNE = (1 << 2); -DEF TX_MODULATOR_COARSE_MODULATION_NONE = 0x0; -DEF TX_MODULATOR_COARSE_MODULATION_F_OVER_4 = 0x1; -DEF TX_MODULATOR_COARSE_MODULATION_F_OVER_8 = 0x2; -DEF TX_MODULATOR_CM_MASK = 0x7; - - -DEF REG_TX_NCO_FTW_7_0 = 21; -DEF REG_TX_NCO_FTW_15_8 = 22; -DEF REG_TX_NCO_FTW_23_16= 23; - -DEF REG_DLL = 24; -DEF DLL_DISABLE_INTERNAL_XTAL_OSC = (1 << 6); // aka Input Clock Ctrl -DEF DLL_ADC_DIV2 = (1 << 5); -DEF DLL_MULT_1X = (0 << 3); -DEF DLL_MULT_2X = (1 << 3); -DEF DLL_MULT_4X = (2 << 3); -DEF DLL_PWR_DN = (1 << 2); -// undefined bit = (1 << 1); -DEF DLL_FAST = (1 << 0); - -DEF REG_CLKOUT = 25; -DEF CLKOUT2_EQ_DLL = (0 << 6); -DEF CLKOUT2_EQ_DLL_OVER_2 = (1 << 6); -DEF CLKOUT2_EQ_DLL_OVER_4 = (2 << 6); -DEF CLKOUT2_EQ_DLL_OVER_8 = (3 << 6); -DEF CLKOUT_INVERT_CLKOUT2 = (1 << 5); -DEF CLKOUT_DISABLE_CLKOUT2 = (1 << 4); -// undefined bit = (1 << 3); -// undefined bit = (1 << 2); -DEF CLKOUT_INVERT_CLKOUT1 = (1 << 1); -DEF CLKOUT_DISABLE_CLKOUT1 = (1 << 0); - -DEF REG_AUX_ADC_A2_LO = 26; -DEF REG_AUX_ADC_A2_HI = 27; -DEF REG_AUX_ADC_A1_LO = 28; -DEF REG_AUX_ADC_A1_HI = 29; -DEF REG_AUX_ADC_B2_LO = 30; -DEF REG_AUX_ADC_B2_HI = 31; -DEF REG_AUX_ADC_B1_LO = 32; -DEF REG_AUX_ADC_B1_HI = 33; - -DEF REG_AUX_ADC_CTRL = 34; -DEF AUX_ADC_CTRL_AUX_SPI = (1 << 7); -DEF AUX_ADC_CTRL_SELBNOTA = (1 << 6); -DEF AUX_ADC_CTRL_REFSEL_B = (1 << 5); -DEF AUX_ADC_CTRL_SELECT_B2 = (0 << 4); -DEF AUX_ADC_CTRL_SELECT_B1 = (1 << 4); -DEF AUX_ADC_CTRL_START_B = (1 << 3); -DEF AUX_ADC_CTRL_REFSEL_A = (1 << 2); -DEF AUX_ADC_CTRL_SELECT_A2 = (0 << 1); -DEF AUX_ADC_CTRL_SELECT_A1 = (1 << 1); -DEF AUX_ADC_CTRL_START_A = (1 << 0); - -DEF REG_AUX_ADC_CLK = 35; -DEF AUX_ADC_CLK_CLK_OVER_4 = (1 << 0); - -DEF REG_AUX_DAC_A = 36; -DEF REG_AUX_DAC_B = 37; -DEF REG_AUX_DAC_C = 38; - -DEF REG_AUX_DAC_UPDATE = 39; -DEF AUX_DAC_UPDATE_SLAVE_ENABLE = (1 << 7); -DEF AUX_DAC_UPDATE_C = (1 << 2); -DEF AUX_DAC_UPDATE_B = (1 << 1); -DEF AUX_DAC_UPDATE_A = (1 << 0); - -DEF REG_AUX_DAC_PWR_DN = 40; -DEF AUX_DAC_PWR_DN_C = (1 << 2); -DEF AUX_DAC_PWR_DN_B = (1 << 1); -DEF AUX_DAC_PWR_DN_A = (1 << 0); - -DEF REG_AUX_DAC_CTRL = 41; -DEF AUX_DAC_CTRL_INV_C = (1 << 4); -DEF AUX_DAC_CTRL_INV_B = (1 << 2); -DEF AUX_DAC_CTRL_INV_A = (1 << 0); - -DEF REG_SIGDELT_LO = 42; -DEF REG_SIGDELT_HI = 43; - -// 44 to 48 reserved - -DEF REG_ADC_LOW_PWR_LO = 49; -DEF REG_ADC_LOW_PWR_HI = 50; - -// 51 to 62 reserved - -DEF REG_CHIP_ID = 63; - - -END_AD962; - -#undef DEF -#undef BEGIN_AD9862 -#undef END_AD962 - -#endif /* INCLUDED_AD9862_H */ diff --git a/usrp/host/lib/check_data.py b/usrp/host/lib/check_data.py deleted file mode 100755 index 100f0f6dd..000000000 --- a/usrp/host/lib/check_data.py +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2003 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. - -import sys -import struct - -fin = sys.stdin - -count = 0 -expected = 0 -last_correction = 0 - -while 1: - s = fin.read(2) - if not s or len(s) != 2: - break - - v, = struct.unpack ('H', s) - iv = int(v) & 0xffff - # print "%8d %6d 0x%04x" % (count, iv, iv) - if count & 0x1: # only counting on the Q channel - if (expected & 0xffff) != iv: - print "%8d (%6d) %6d 0x%04x" % (count, count - last_correction, iv, iv) - expected = iv # reset expected sequence - last_correction = count - expected = (expected + 1) & 0xffff - - count += 1 - - - - diff --git a/usrp/host/lib/circular_buffer.h b/usrp/host/lib/circular_buffer.h deleted file mode 100644 index 48758bf87..000000000 --- a/usrp/host/lib/circular_buffer.h +++ /dev/null @@ -1,315 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006,2009,2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio. - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _CIRCULAR_BUFFER_H_ -#define _CIRCULAR_BUFFER_H_ - -#include <gruel/thread.h> -#include <iostream> -#include <stdexcept> - -#ifndef DO_DEBUG -#define DO_DEBUG 0 -#endif - -#if DO_DEBUG -#define DEBUG(X) do{X} while(0); -#else -#define DEBUG(X) do{} while(0); -#endif - -template <class T> -class circular_buffer -{ -private: -// the buffer to use - T* d_buffer; - -// the following are in Items (type T) - size_t d_bufLen_I, d_readNdx_I, d_writeNdx_I; - size_t d_n_avail_write_I, d_n_avail_read_I; - -// stuff to control access to class internals - gruel::mutex* d_internal; - gruel::condition_variable* d_readBlock; - gruel::condition_variable* d_writeBlock; - -// booleans to decide how to control reading, writing, and aborting - bool d_doWriteBlock, d_doFullRead, d_doAbort; - - void delete_mutex_cond () { - if (d_internal) { - delete d_internal; - d_internal = NULL; - } - if (d_readBlock) { - delete d_readBlock; - d_readBlock = NULL; - } - if (d_writeBlock) { - delete d_writeBlock; - d_writeBlock = NULL; - } - }; - -public: - circular_buffer (size_t bufLen_I, - bool doWriteBlock = true, bool doFullRead = false) { - if (bufLen_I == 0) - throw std::runtime_error ("circular_buffer(): " - "Number of items to buffer must be > 0.\n"); - d_bufLen_I = bufLen_I; - d_buffer = (T*) new T[d_bufLen_I]; - d_doWriteBlock = doWriteBlock; - d_doFullRead = doFullRead; - d_internal = NULL; - d_readBlock = d_writeBlock = NULL; - reset (); - DEBUG (std::cerr << "c_b(): buf len (items) = " << d_bufLen_ - << ", doWriteBlock = " << (d_doWriteBlock ? "true" : "false") - << ", doFullRead = " << (d_doFullRead ? "true" : "false") - << std::endl); - }; - - ~circular_buffer () { - delete_mutex_cond (); - delete [] d_buffer; - }; - - inline size_t n_avail_write_items () { - gruel::scoped_lock l (*d_internal); - size_t retVal = d_n_avail_write_I; - return (retVal); - }; - - inline size_t n_avail_read_items () { - gruel::scoped_lock l (*d_internal); - size_t retVal = d_n_avail_read_I; - return (retVal); - }; - - inline size_t buffer_length_items () {return (d_bufLen_I);}; - inline bool do_write_block () {return (d_doWriteBlock);}; - inline bool do_full_read () {return (d_doFullRead);}; - - void reset () { - d_doAbort = false; - bzero (d_buffer, d_bufLen_I * sizeof (T)); - d_readNdx_I = d_writeNdx_I = d_n_avail_read_I = 0; - d_n_avail_write_I = d_bufLen_I; - delete_mutex_cond (); - // create a mutex to handle contention of shared resources; - // any routine needed access to shared resources uses lock() - // before doing anything, then unlock() when finished. - d_internal = new gruel::mutex (); - // link the internal mutex to the read and write conditions; - // when wait() is called, the internal mutex will automatically - // be unlock()'ed. Upon return (from a notify_one() to the condition), - // the internal mutex will be lock()'ed. - d_readBlock = new gruel::condition_variable (); - d_writeBlock = new gruel::condition_variable (); - }; - -/* - * enqueue: add the given buffer of item-length to the queue, - * first-in-first-out (FIFO). - * - * inputs: - * buf: a pointer to the buffer holding the data - * - * bufLen_I: the buffer length in items (of the instantiated type) - * - * returns: - * -1: on overflow (write is not blocking, and data is being - * written faster than it is being read) - * 0: if nothing to do (0 length buffer) - * 1: if success - * 2: in the process of aborting, do doing nothing - * - * will throw runtime errors if inputs are improper: - * buffer pointer is NULL - * buffer length is larger than the instantiated buffer length - */ - - int enqueue (T* buf, size_t bufLen_I) { - DEBUG (std::cerr << "enqueue: buf = " << (void*) buf - << ", bufLen = " << bufLen_I - << ", #av_wr = " << d_n_avail_write_I - << ", #av_rd = " << d_n_avail_read_I << std::endl); - if (bufLen_I > d_bufLen_I) { - std::cerr << "ERROR: cannot add buffer longer (" - << bufLen_I << ") than instantiated length (" - << d_bufLen_I << ")." << std::endl; - throw std::runtime_error ("circular_buffer::enqueue()"); - } - - if (bufLen_I == 0) - return (0); - if (!buf) - throw std::runtime_error ("circular_buffer::enqueue(): " - "input buffer is NULL.\n"); - gruel::scoped_lock l (*d_internal); - if (d_doAbort) { - return (2); - } - // set the return value to 1: success; change if needed - int retval = 1; - if (bufLen_I > d_n_avail_write_I) { - if (d_doWriteBlock) { - while (bufLen_I > d_n_avail_write_I) { - DEBUG (std::cerr << "enqueue: #len > #a, waiting." << std::endl); - // wait; will automatically unlock() the internal mutex via - // the scoped lock - d_writeBlock->wait (l); - // and auto re-lock() it here. - if (d_doAbort) { - DEBUG (std::cerr << "enqueue: #len > #a, aborting." << std::endl); - return (2); - } - DEBUG (std::cerr << "enqueue: #len > #a, done waiting." << std::endl); - } - } else { - d_n_avail_read_I = d_bufLen_I - bufLen_I; - d_n_avail_write_I = bufLen_I; - DEBUG (std::cerr << "circular_buffer::enqueue: overflow" << std::endl); - retval = -1; - } - } - size_t n_now_I = d_bufLen_I - d_writeNdx_I, n_start_I = 0; - if (n_now_I > bufLen_I) - n_now_I = bufLen_I; - else if (n_now_I < bufLen_I) - n_start_I = bufLen_I - n_now_I; - bcopy (buf, &(d_buffer[d_writeNdx_I]), n_now_I * sizeof (T)); - if (n_start_I) { - bcopy (&(buf[n_now_I]), d_buffer, n_start_I * sizeof (T)); - d_writeNdx_I = n_start_I; - } else - d_writeNdx_I += n_now_I; - d_n_avail_read_I += bufLen_I; - d_n_avail_write_I -= bufLen_I; - d_readBlock->notify_one (); - return (retval); - }; - -/* - * dequeue: removes from the queue the number of items requested, or - * available, into the given buffer on a FIFO basis. - * - * inputs: - * buf: a pointer to the buffer into which to copy the data - * - * bufLen_I: pointer to the number of items to remove in items - * (of the instantiated type) - * - * returns: - * 0: if nothing to do (0 length buffer) - * 1: if success - * 2: in the process of aborting, do doing nothing - * - * will throw runtime errors if inputs are improper: - * buffer pointer is NULL - * buffer length pointer is NULL - * buffer length is larger than the instantiated buffer length - */ - - int dequeue (T* buf, size_t* bufLen_I) { - DEBUG (std::cerr << "dequeue: buf = " << ((void*) buf) - << ", *bufLen = " << (*bufLen_I) - << ", #av_wr = " << d_n_avail_write_I - << ", #av_rd = " << d_n_avail_read_I << std::endl); - if (!bufLen_I) - throw std::runtime_error ("circular_buffer::dequeue(): " - "input bufLen pointer is NULL.\n"); - if (!buf) - throw std::runtime_error ("circular_buffer::dequeue(): " - "input buffer pointer is NULL.\n"); - size_t l_bufLen_I = *bufLen_I; - if (l_bufLen_I == 0) - return (0); - if (l_bufLen_I > d_bufLen_I) { - std::cerr << "ERROR: cannot remove buffer longer (" - << l_bufLen_I << ") than instantiated length (" - << d_bufLen_I << ")." << std::endl; - throw std::runtime_error ("circular_buffer::dequeue()"); - } - - gruel::scoped_lock l (*d_internal); - if (d_doAbort) { - return (2); - } - if (d_doFullRead) { - while (d_n_avail_read_I < l_bufLen_I) { - DEBUG (std::cerr << "dequeue: #a < #len, waiting." << std::endl); - // wait; will automatically unlock() the internal mutex via - // the scoped lock - d_readBlock->wait (l); - // and re-lock() it here. - if (d_doAbort) { - DEBUG (std::cerr << "dequeue: #a < #len, aborting." << std::endl); - return (2); - } - DEBUG (std::cerr << "dequeue: #a < #len, done waiting." << std::endl); - } - } else { - while (d_n_avail_read_I == 0) { - DEBUG (std::cerr << "dequeue: #a == 0, waiting." << std::endl); - // wait; will automatically unlock() the internal mutex via - // the scoped lock - d_readBlock->wait (l); - // and re-lock() it here. - if (d_doAbort) { - DEBUG (std::cerr << "dequeue: #a == 0, aborting." << std::endl); - return (2); - } - DEBUG (std::cerr << "dequeue: #a == 0, done waiting." << std::endl); - } - } - if (l_bufLen_I > d_n_avail_read_I) - l_bufLen_I = d_n_avail_read_I; - size_t n_now_I = d_bufLen_I - d_readNdx_I, n_start_I = 0; - if (n_now_I > l_bufLen_I) - n_now_I = l_bufLen_I; - else if (n_now_I < l_bufLen_I) - n_start_I = l_bufLen_I - n_now_I; - bcopy (&(d_buffer[d_readNdx_I]), buf, n_now_I * sizeof (T)); - if (n_start_I) { - bcopy (d_buffer, &(buf[n_now_I]), n_start_I * sizeof (T)); - d_readNdx_I = n_start_I; - } else - d_readNdx_I += n_now_I; - *bufLen_I = l_bufLen_I; - d_n_avail_read_I -= l_bufLen_I; - d_n_avail_write_I += l_bufLen_I; - d_writeBlock->notify_one (); - return (1); - }; - - void abort () { - gruel::scoped_lock l (*d_internal); - d_doAbort = true; - d_writeBlock->notify_one (); - d_readBlock->notify_one (); - }; -}; - -#endif /* _CIRCULAR_BUFFER_H_ */ diff --git a/usrp/host/lib/circular_linked_list.h b/usrp/host/lib/circular_linked_list.h deleted file mode 100644 index bbed5e49b..000000000 --- a/usrp/host/lib/circular_linked_list.h +++ /dev/null @@ -1,278 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006,2009,2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio. - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _CIRCULAR_LINKED_LIST_H_ -#define _CIRCULAR_LINKED_LIST_H_ - -#include <gruel/thread.h> -#include <stdexcept> - -#define __INLINE__ inline - -#ifndef DO_DEBUG -#define DO_DEBUG 0 -#endif - -#if DO_DEBUG -#define DEBUG(X) do{X} while(0); -#else -#define DEBUG(X) do{} while(0); -#endif - -template <class T> class s_both; - -template <class T> class s_node -{ - typedef s_node<T>* s_node_ptr; - -private: - T d_object; - bool d_available; - s_node_ptr d_prev, d_next; - s_both<T>* d_both; - -public: - s_node (T l_object, - s_node_ptr l_prev = NULL, - s_node_ptr l_next = NULL) - : d_object (l_object), d_available (TRUE), d_prev (l_prev), - d_next (l_next), d_both (0) {}; - - __INLINE__ s_node (s_node_ptr l_prev, s_node_ptr l_next = NULL) { - s_node ((T) NULL, l_prev, l_next); }; - __INLINE__ s_node () { s_node (NULL, NULL, NULL); }; - __INLINE__ ~s_node () {}; - - void remove () { - d_prev->next (d_next); - d_next->prev (d_prev); - d_prev = d_next = this; - }; - - void insert_before (s_node_ptr l_next) { - if (l_next) { - s_node_ptr l_prev = l_next->prev (); - d_next = l_next; - d_prev = l_prev; - l_prev->next (this); - l_next->prev (this); - } else - d_next = d_prev = this; - }; - - void insert_after (s_node_ptr l_prev) { - if (l_prev) { - s_node_ptr l_next = l_prev->next (); - d_prev = l_prev; - d_next = l_next; - l_next->prev (this); - l_prev->next (this); - } else - d_prev = d_next = this; - }; - - __INLINE__ T object () { return (d_object); }; - __INLINE__ void object (T l_object) { d_object = l_object; }; - __INLINE__ bool available () { return (d_available); }; - __INLINE__ void set_available () { d_available = TRUE; }; - __INLINE__ void set_available (bool l_avail) { d_available = l_avail; }; - __INLINE__ void set_not_available () { d_available = FALSE; }; - __INLINE__ s_node_ptr next () { return (d_next); }; - __INLINE__ s_node_ptr prev () { return (d_prev); }; - __INLINE__ s_both<T>* both () { return (d_both); }; - __INLINE__ void next (s_node_ptr l_next) { d_next = l_next; }; - __INLINE__ void prev (s_node_ptr l_prev) { d_prev = l_prev; }; - __INLINE__ void both (s_both<T>* l_both) { d_both = l_both; }; -}; - -template <class T> class circular_linked_list { - typedef s_node<T>* s_node_ptr; - -private: - s_node_ptr d_current, d_iterate, d_available, d_inUse; - size_t d_n_nodes, d_n_used; - gruel::mutex* d_internal; - gruel::condition_variable* d_ioBlock; - -public: - circular_linked_list (size_t n_nodes) { - if (n_nodes == 0) - throw std::runtime_error ("circular_linked_list(): n_nodes == 0"); - - d_iterate = NULL; - d_n_nodes = n_nodes; - d_n_used = 0; - s_node_ptr l_prev, l_next; - d_inUse = d_current = l_next = l_prev = NULL; - - l_prev = new s_node<T> (); - l_prev->set_available (); - l_prev->next (l_prev); - l_prev->prev (l_prev); - if (n_nodes > 1) { - l_next = new s_node<T> (l_prev, l_prev); - l_next->set_available (); - l_next->next (l_prev); - l_next->prev (l_prev); - l_prev->next (l_next); - l_prev->prev (l_next); - if (n_nodes > 2) { - size_t n = n_nodes - 2; - while (n-- > 0) { - d_current = new s_node<T> (l_prev, l_next); - d_current->set_available (); - d_current->prev (l_prev); - d_current->next (l_next); - l_prev->next (d_current); - l_next->prev (d_current); - l_next = d_current; - d_current = NULL; - } - } - } - d_available = d_current = l_prev; - d_ioBlock = new gruel::condition_variable (); - d_internal = new gruel::mutex (); - }; - - ~circular_linked_list () { - iterate_start (); - s_node_ptr l_node = iterate_next (); - while (l_node) { - delete l_node; - l_node = iterate_next (); - } - delete d_ioBlock; - d_ioBlock = NULL; - delete d_internal; - d_internal = NULL; - d_available = d_inUse = d_iterate = d_current = NULL; - d_n_used = d_n_nodes = 0; - }; - - s_node_ptr find_next_available_node () { - gruel::scoped_lock l (*d_internal); -// find an available node - s_node_ptr l_node = d_available; - DEBUG (std::cerr << "w "); - while (! l_node) { - DEBUG (std::cerr << "x" << std::endl); - // the ioBlock condition will automatically unlock() d_internal - d_ioBlock->wait (l); - // and lock() is here - DEBUG (std::cerr << "y" << std::endl); - l_node = d_available; - } - DEBUG (std::cerr << "::f_n_a_n: #u = " << num_used() - << ", node = " << l_node << std::endl); -// remove this one from the current available list - if (num_available () == 1) { -// last one, just set available to NULL - d_available = NULL; - } else - d_available = l_node->next (); - l_node->remove (); -// add is to the inUse list - if (! d_inUse) - d_inUse = l_node; - else - l_node->insert_before (d_inUse); - d_n_used++; - l_node->set_not_available (); - return (l_node); - }; - - void make_node_available (s_node_ptr l_node) { - if (!l_node) return; - gruel::scoped_lock l (*d_internal); - DEBUG (std::cerr << "::m_n_a: #u = " << num_used() - << ", node = " << l_node << std::endl); -// remove this node from the inUse list - if (num_used () == 1) { -// last one, just set inUse to NULL - d_inUse = NULL; - } else - d_inUse = l_node->next (); - l_node->remove (); -// add this node to the available list - if (! d_available) - d_available = l_node; - else - l_node->insert_before (d_available); - d_n_used--; - - DEBUG (std::cerr << "s" << d_n_used); -// signal the condition when new data arrives - d_ioBlock->notify_one (); - DEBUG (std::cerr << "t "); - }; - - __INLINE__ void iterate_start () { d_iterate = d_current; }; - - s_node_ptr iterate_next () { -#if 0 -// lock the mutex for thread safety - gruel::scoped_lock l (*d_internal); -#endif - s_node_ptr l_this = NULL; - if (d_iterate) { - l_this = d_iterate; - d_iterate = d_iterate->next (); - if (d_iterate == d_current) - d_iterate = NULL; - } - return (l_this); - }; - - __INLINE__ T object () { return (d_current->d_object); }; - __INLINE__ void object (T l_object) { d_current->d_object = l_object; }; - __INLINE__ size_t num_nodes () { return (d_n_nodes); }; - __INLINE__ size_t num_used () { return (d_n_used); }; - __INLINE__ void num_used (size_t l_n_used) { d_n_used = l_n_used; }; - __INLINE__ size_t num_available () { return (d_n_nodes - d_n_used); }; - __INLINE__ void num_used_inc (void) { - if (d_n_used < d_n_nodes) ++d_n_used; - }; - __INLINE__ void num_used_dec (void) { - if (d_n_used != 0) --d_n_used; -// signal the condition that new data has arrived - d_ioBlock->notify_one (); - }; - __INLINE__ bool in_use () { return (d_n_used != 0); }; -}; - -template <class T> class s_both -{ -private: - s_node<T>* d_node; - void* d_this; -public: - __INLINE__ s_both (s_node<T>* l_node, void* l_this) - : d_node (l_node), d_this (l_this) {}; - __INLINE__ ~s_both () {}; - __INLINE__ s_node<T>* node () { return (d_node); }; - __INLINE__ void* This () { return (d_this); }; - __INLINE__ void set (s_node<T>* l_node, void* l_this) { - d_node = l_node; d_this = l_this;}; -}; - -#endif /* _CIRCULAR_LINKED_LIST_H_ */ diff --git a/usrp/host/lib/darwin_libusb.h b/usrp/host/lib/darwin_libusb.h deleted file mode 100644 index 8446f044e..000000000 --- a/usrp/host/lib/darwin_libusb.h +++ /dev/null @@ -1,227 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006,2009 Free Software Foundation, Inc. - * - * This file is part of GNU Radio. - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -/* - * The following code was taken from LIBUSB verion 0.1.10a, - * and makes the fusb_darwin codes do-able in the current GR - * programming framework. Parts and pieces were taken from - * usbi.h, darwin.c, and error.h . - * - * LIBUSB version 0.1.10a is covered by the LGPL, version 2; - * These codes are used with permission from: - * (c) 2000-2003 Johannes Erdfelt <johannes@erdfelt.com> - * (c) 2002-2005 Nathan Hjelm <hjelmn@users.sourceforge.net> - * All rights reserved. - */ - -#ifndef __DARWIN_LIBUSB_H__ -#define __DARWIN_LIBUSB_H__ - -#include <IOKit/IOCFBundle.h> -#include <IOKit/IOCFPlugIn.h> -#include <IOKit/usb/IOUSBLib.h> -#include <IOKit/IOKitLib.h> - -extern "C" { - -static const char* darwin_error_strings[] = { - "no error", - "device not opened for exclusive access", - "no connection to an IOService", - "no asyc port has been opened for interface", - "another process has device opened for exclusive access", - "pipe is stalled", - "could not establish a connection to Darin kernel", - "invalid argument", - "unknown error" -}; - -static const char * -darwin_error_str (int result) -{ - switch (result) { - case kIOReturnSuccess: - return (darwin_error_strings[0]); - case kIOReturnNotOpen: - return (darwin_error_strings[1]); - case kIOReturnNoDevice: - return (darwin_error_strings[2]); - case kIOUSBNoAsyncPortErr: - return (darwin_error_strings[3]); - case kIOReturnExclusiveAccess: - return (darwin_error_strings[4]); - case kIOUSBPipeStalled: - return (darwin_error_strings[5]); - case kIOReturnError: - return (darwin_error_strings[6]); - case kIOReturnBadArgument: - return (darwin_error_strings[7]); - default: - return (darwin_error_strings[8]); - } -} - -/* not a valid errorno outside darwin.c */ -#define LUSBDARWINSTALL (ELAST+1) - -static int -darwin_to_errno (int result) -{ - switch (result) { - case kIOReturnSuccess: - return 0; - case kIOReturnNotOpen: - return EBADF; - case kIOReturnNoDevice: - case kIOUSBNoAsyncPortErr: - return ENXIO; - case kIOReturnExclusiveAccess: - return EBUSY; - case kIOUSBPipeStalled: - return LUSBDARWINSTALL; - case kIOReturnBadArgument: - return EINVAL; - case kIOReturnError: - default: - return 1; - } -} - -typedef enum { - USB_ERROR_TYPE_NONE = 0, - USB_ERROR_TYPE_STRING, - USB_ERROR_TYPE_ERRNO, -} usb_error_type_t; - -extern char usb_error_str[1024]; -extern int usb_error_errno; -extern usb_error_type_t usb_error_type; - -#define USB_ERROR(r, x) \ - do { \ - usb_error_type = USB_ERROR_TYPE_ERRNO; \ - usb_error_errno = x; \ - return (r); \ - } while (0) - -#define USB_ERROR_STR(r, x, format, args...) \ - do { \ - usb_error_type = USB_ERROR_TYPE_STRING; \ - snprintf (usb_error_str, sizeof (usb_error_str) - 1, \ - format, ## args); \ - if (usb_debug) { \ - std::cerr << "USB error: " << usb_error_str << std::cerr; \ - } \ - return (r); \ - } while (0) - -#define USB_ERROR_STR_ORIG(x, format, args...) \ - do { \ - usb_error_type = USB_ERROR_TYPE_STRING; \ - snprintf (usb_error_str, sizeof (usb_error_str) - 1, \ - format, ## args); \ - if (usb_debug) { \ - std::cerr << "USB error: " << usb_error_str << std::endl; \ - } \ - return (x); \ - } while (0) - -#define USB_ERROR_STR_NO_RET(x, format, args...) \ - do { \ - usb_error_type = USB_ERROR_TYPE_STRING; \ - snprintf (usb_error_str, sizeof (usb_error_str) - 1, \ - format, ## args); \ - if (usb_debug) { \ - std::cerr << "USB error: " << usb_error_str << std::endl; \ - } \ - } while (0) - -/* - * simple function that figures out what pipeRef - * is associated with an endpoint - */ -static int ep_to_pipeRef (darwin_dev_handle *device, int ep) -{ - io_return_t ret; - UInt8 numep, direction, number; - UInt8 dont_care1, dont_care3; - UInt16 dont_care2; - int i; - - if (usb_debug > 3) { - std::cerr << "Converting ep address to pipeRef." << std::endl; - } - - /* retrieve the total number of endpoints on this interface */ - ret = (*(device->interface))->GetNumEndpoints(device->interface, &numep); - if ( ret ) { - if ( usb_debug > 3 ) { - std::cerr << "ep_to_pipeRef: interface is " - << device->interface << std::endl; - } - USB_ERROR_STR_ORIG ( -ret, "ep_to_pipeRef: can't get number of " - "endpoints for interface" ); - } - - /* iterate through the pipeRefs until we find the correct one */ - for (i = 1 ; i <= numep ; i++) { - ret = (*(device->interface))->GetPipeProperties - (device->interface, i, &direction, &number, - &dont_care1, &dont_care2, &dont_care3); - - if (ret != kIOReturnSuccess) { - std::cerr << "ep_to_pipeRef: an error occurred getting " - << "pipe information on pipe " << i << std::endl; - - USB_ERROR_STR_ORIG (-darwin_to_errno(ret), - "ep_to_pipeRef(GetPipeProperties): %s", - darwin_error_str(ret)); - } - - if (usb_debug > 3) { - std::cerr << "ep_to_pipeRef: Pipe " << i << ": DIR: " - << direction << " number: " << number << std::endl; - } - - /* calculate the endpoint of the pipe and check it versus - the requested endpoint */ - if ( ((direction << 7 & USB_ENDPOINT_DIR_MASK) | - (number & USB_ENDPOINT_ADDRESS_MASK)) == ep ) { - if (usb_debug > 3) { - std::cerr << "ep_to_pipeRef: pipeRef for ep address " - << ep << " found: " << i << std::endl; - } - return (i); - } - } - - if (usb_debug > 3) { - std::cerr << "ep_to_pipeRef: No pipeRef found with endpoint address " - << ep << std::endl; - } - - /* none of the found pipes match the requested endpoint */ - return (-1); -} - -} -#endif /* __DARWIN_LIBUSB_H__ */ diff --git a/usrp/host/lib/db_base.cc b/usrp/host/lib/db_base.cc deleted file mode 100644 index b4fb45c51..000000000 --- a/usrp/host/lib/db_base.cc +++ /dev/null @@ -1,256 +0,0 @@ -// -// Copyright 2008,2009 Free Software Foundation, Inc. -// -// This file is part of GNU Radio -// -// GNU Radio is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either asversion 3, or (at your option) -// any later version. -// -// GNU Radio is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with GNU Radio; see the file COPYING. If not, write to -// the Free Software Foundation, Inc., 51 Franklin Street, -// Boston, MA 02110-1301, USA. -// - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <usrp/db_base.h> -#include <db_base_impl.h> - -#if 0 -tune_result::tune_result(double baseband, double dxc, double residual, bool inv) - : ok(false), baseband_freq(baseband), dxc_freq(dxc), - residual_freq(residual), inverted(inv) -{ -} - -tune_result::~tune_result() -{ -} -#endif - - -/*****************************************************************************/ - -db_base::db_base(usrp_basic_sptr usrp, int which) - : d_is_shutdown(false), d_raw_usrp(usrp.get()), d_which(which), d_lo_offset(0.0) -{ -} - -db_base::~db_base() -{ - shutdown(); -} - -void -db_base::shutdown() -{ - if (!d_is_shutdown){ - d_is_shutdown = true; - // do whatever there is to do to shutdown - } -} - -int -db_base::dbid() -{ - return usrp()->daughterboard_id(d_which); -} - -std::string -db_base::name() -{ - return usrp_dbid_to_string(dbid()); -} - -std::string -db_base::side_and_name() -{ - if(d_which == 0) - return "A: " + name(); - else - return "B: " + name(); -} - -// Function to bypass ADC buffers. Any board which is DC-coupled -// should bypass the buffers - -bool -db_base::bypass_adc_buffers(bool bypass) -{ - //if(d_tx) { - // throw std::runtime_error("TX Board has no adc buffers\n"); - //} - - bool ok = true; - if(d_which==0) { - ok &= usrp()->set_adc_buffer_bypass(0, bypass); - ok &= usrp()->set_adc_buffer_bypass(1, bypass); - } - else { - ok &= usrp()->set_adc_buffer_bypass(2, bypass); - ok &= usrp()->set_adc_buffer_bypass(3, bypass); - } - return ok; -} - -bool -db_base::set_atr_mask(int v) -{ - // Set Auto T/R mask. - return usrp()->write_atr_mask(d_which, v); -} - -bool -db_base::set_atr_txval(int v) -{ - // Set Auto T/R register value to be used when transmitting. - return usrp()->write_atr_txval(d_which, v); -} - -bool -db_base::set_atr_rxval(int v) -{ - // Set Auto T/R register value to be used when receiving. - return usrp()->write_atr_rxval(d_which, v); -} - -bool -db_base::set_atr_tx_delay(int v) -{ - // Set Auto T/R delay (in clock ticks) from when Tx fifo gets data to - // when T/R switches. - return usrp()->write_atr_tx_delay(v); -} - -bool -db_base::set_atr_rx_delay(int v) -{ - // Set Auto T/R delay (in clock ticks) from when Tx fifo goes empty to - // when T/R switches. - return usrp()->write_atr_rx_delay(v); -} - -bool -db_base::i_and_q_swapped() -{ - // Return True if this is a quadrature device and (for RX) ADC 0 is Q - // or (for TX) DAC 0 is Q - return false; -} - -bool -db_base::spectrum_inverted() -{ - // Return True if the dboard gives an inverted spectrum - - return false; -} - -bool -db_base::set_enable(bool on) -{ - // For tx daughterboards, this controls the transmitter enable. - - return true; // default is nop -} - -bool -db_base::set_auto_tr(bool on) -{ - // Enable automatic Transmit/Receive switching (ATR). - // - // Should be overridden in subclasses that care. This will typically - // set the atr_mask, txval and rxval. - - return true; -} - -bool -db_base::set_lo_offset(double offset) -{ - // Set how much LO is offset from requested frequency - - d_lo_offset = offset; - return true; -} - -bool -db_base::select_rx_antenna(int which_antenna) -{ - // Specify which antenna port to use for reception. - // Should be overriden by daughterboards that care. - - return which_antenna == 0; -} - -bool -db_base::select_rx_antenna(const std::string &which_antenna) -{ - // Specify which antenna port to use for reception. - // Should be overriden by daughterboards that care. - - return which_antenna == ""; -} - - -// Reference Clock section -// -// Control whether a reference clock is sent to the daughterboards, -// and what frequency -// -// Bit 7 -- 1 turns on refclk, 0 allows IO use -// Bits 6:0 Divider value -// - -double -db_base::_refclk_freq() -{ - return usrp()->fpga_master_clock_freq() / _refclk_divisor(); -} - -void -db_base::_enable_refclk(bool enable) -{ - int CLOCK_OUT = 1; // Clock is on lowest bit - int REFCLK_ENABLE = 0x80; - int REFCLK_DIVISOR_MASK = 0x7f; - - if(enable) { - usrp()->_write_oe(d_which, CLOCK_OUT, CLOCK_OUT); // output enable - usrp()->write_refclk(d_which, (_refclk_divisor() & REFCLK_DIVISOR_MASK) | REFCLK_ENABLE); - } - else { - usrp()->write_refclk(d_which, 0); - } -} - -int -db_base::_refclk_divisor() -{ - // Return value to stick in REFCLK_DIVISOR register - throw std::runtime_error("_refclk_divisor() called from base class\n");; -} - -bool -db_base::set_bw(float bw) -{ - // Set baseband bandwidth (board specific) - // Should be overriden by boards that implement variable IF filtering (e.g., DBSRX) - return false; -} - -std::ostream &operator<<(std::ostream &os, db_base &x) -{ - os << x.side_and_name(); - return os; -} diff --git a/usrp/host/lib/db_base_impl.h b/usrp/host/lib/db_base_impl.h deleted file mode 100644 index 9d5ca4370..000000000 --- a/usrp/host/lib/db_base_impl.h +++ /dev/null @@ -1,33 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2008,2009 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -#ifndef INCLUDED_DB_BASE_IMPL_H -#define INCLUDED_DB_BASE_IMPL_H - -#include <usrp/db_base.h> -#include <db_util.h> -#include <usrp/usrp_basic.h> -#include <fpga_regs_standard.h> -#include <fpga_regs_common.h> -#include <usrp/usrp_prims.h> -#include <usrp_spi_defs.h> -#include <stdexcept> - -#endif /* INCLUDED_DB_BASE_IMPL_H */ diff --git a/usrp/host/lib/db_basic.cc b/usrp/host/lib/db_basic.cc deleted file mode 100644 index 1694d6a3f..000000000 --- a/usrp/host/lib/db_basic.cc +++ /dev/null @@ -1,266 +0,0 @@ -// -// Copyright 2008,2009 Free Software Foundation, Inc. -// -// This file is part of GNU Radio -// -// GNU Radio is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either asversion 3, or (at your option) -// any later version. -// -// GNU Radio is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with GNU Radio; see the file COPYING. If not, write to -// the Free Software Foundation, Inc., 51 Franklin Street, -// Boston, MA 02110-1301, USA. - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <usrp/db_basic.h> -#include <db_base_impl.h> - -db_basic_tx::db_basic_tx(boost::shared_ptr<usrp_basic> usrp, int which) - : db_base(usrp, which) -{ - // Handler for Basic Tx daughterboards. - // - // @param usrp: instance of usrp.source_c - // @param which: which side: 0 or 1 corresponding to TX_A or TX_B respectively - - set_gain((gain_min() + gain_max()) / 2); // initialize gain -} - -db_basic_tx::~db_basic_tx() -{ -} - -double -db_basic_tx::freq_min() -{ - return -90e9; -} - -double -db_basic_tx::freq_max() -{ - return 90e9; -} - -struct freq_result_t -db_basic_tx::set_freq(double target_freq) -{ - // Set the frequency. - // - // @param freq: target RF frequency in Hz - // @type freq: double - // - // @returns (ok, actual_baseband_freq) where: - // ok is True or False and indicates success or failure, - // actual_baseband_freq is the RF frequency that corresponds to DC in the IF. - - struct freq_result_t args = {false, 0}; - args.ok = true; - args.baseband_freq = 0.0; - return args; -} - -float -db_basic_tx::gain_min() -{ - return usrp()->pga_min(); -} - -float -db_basic_tx::gain_max() -{ - return usrp()->pga_max(); -} - -float -db_basic_tx::gain_db_per_step() -{ - return usrp()->pga_db_per_step(); -} - -bool -db_basic_tx::set_gain(float gain) -{ - // Set the gain. - // - // @param gain: gain in decibels - // @returns True/False - - bool ok = usrp()->set_pga(d_which * 2 + 0, gain); - ok = ok && usrp()->set_pga(d_which * 2 + 1, gain); - return ok; -} - -bool -db_basic_tx::is_quadrature() -{ - // Return True if this board requires both I & Q analog channels. - - return true; -} - - -/******************************************************************************/ - - -db_basic_rx::db_basic_rx(usrp_basic_sptr usrp, int which, int subdev) - : db_base(usrp, which) -{ - // Handler for Basic Rx daughterboards. - // - // @param usrp: instance of usrp.source_c - // @param which: which side: 0 or 1 corresponding to TX_A or TX_B respectively - // @param subdev: which analog i/o channel: 0 or 1 - // @type subdev: int - - d_subdev = subdev; - - bypass_adc_buffers(true); - - if(0) { // Doing this would give us a different default than the historical values... - set_gain(float(gain_min() + gain_max()) / 2.0); // initialize gain - } -} - -db_basic_rx::~db_basic_rx() -{ -} - -double -db_basic_rx::freq_min() -{ - return -90e9; -} - -double -db_basic_rx::freq_max() -{ - return 90e9; -} - -struct freq_result_t -db_basic_rx::set_freq(double target_freq) -{ - // Set the frequency. - // - // @param freq: target RF frequency in Hz - // @type freq: double - // - // @returns (ok, actual_baseband_freq) where: - // ok is True or False and indicates success or failure, - // actual_baseband_freq is the RF frequency that corresponds to DC in the IF. - - struct freq_result_t args = {true, 0.0}; - return args; -} - -float -db_basic_rx::gain_min() -{ - return usrp()->pga_min(); -} - -float -db_basic_rx::gain_max() -{ - return usrp()->pga_max(); -} - -float -db_basic_rx::gain_db_per_step() -{ - return usrp()->pga_db_per_step(); -} - -bool -db_basic_rx::set_gain(float gain) -{ - // Set the gain. - // - // @param gain: gain in decibels - // @returns True/False - - return usrp()->set_pga(d_which * 2 + d_subdev, gain); -} - -bool -db_basic_rx::is_quadrature() -{ - // Return True if this board requires both I & Q analog channels. - - // This bit of info is useful when setting up the USRP Rx mux register. - - return (d_subdev == 2); -} - - - -/******************************************************************************/ - - -db_lf_tx::db_lf_tx(usrp_basic_sptr usrp, int which) - : db_basic_tx(usrp, which) -{ - // Handler for Low Freq Tx daughterboards. - // - // @param usrp: instance of usrp.source_c - // @param which: which side: 0 or 1 corresponding to RX_A or RX_B respectively -} - -db_lf_tx::~db_lf_tx() -{ -} - -double -db_lf_tx::freq_min() -{ - return -32e6; -} - -double -db_lf_tx::freq_max() -{ - return 32e6; -} - -/******************************************************************************/ - - -db_lf_rx::db_lf_rx(usrp_basic_sptr usrp, int which, int subdev) - : db_basic_rx(usrp, which, subdev) -{ - // Handler for Low Freq Rx daughterboards. - // - // @param usrp: instance of usrp.source_c - // @param which: which side: 0 or 1 corresponding to RX_A or RX_B respectively - // @param subdev: which analog i/o channel: 0 or 1 - // @type subdev: int -} - -db_lf_rx::~db_lf_rx() -{ -} - -double -db_lf_rx::freq_min() -{ - return 0.0; -} - -double -db_lf_rx::freq_max() -{ - return 32e6; -} - - diff --git a/usrp/host/lib/db_bitshark_rx.cc b/usrp/host/lib/db_bitshark_rx.cc deleted file mode 100644 index 5368866d8..000000000 --- a/usrp/host/lib/db_bitshark_rx.cc +++ /dev/null @@ -1,417 +0,0 @@ -// -// Copyright 2010 Free Software Foundation, Inc. -// -// This file is part of GNU Radio -// -// GNU Radio is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either asversion 3, or (at your option) -// any later version. -// -// GNU Radio is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with GNU Radio; see the file COPYING. If not, write to -// the Free Software Foundation, Inc., 51 Franklin Street, -// Boston, MA 02110-1301, USA. - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <usrp/db_bitshark_rx.h> -#include <db_base_impl.h> -#include <cmath> -#include <cstdio> -#include <string.h> -#include <stdint.h> - -/* Note: Thie general structure of this file is based on the db_dbsrx.cc - codebase for the dbsrx daughterboard. */ - -/* The following defines specify the address map provided by the - Bitshark card. These registers are all accessed over I2C. */ -#define RF_CENTER_FREQ_REG 0x00 -#define RF_CHAN_FILTER_BW_REG 0x01 -#define RF_GAIN_REG 0x02 -#define BB_GAIN_REG 0x03 -#define ADF4350_REG 0x10 -#define SKY73202_REG 0x11 -#define CLOCK_SCHEME_REG 0x20 - -/* The following table lists the registers provided by the BURX board that - are accessible over I2C: - -------------------------------------------------------- - |RegAddr: 0x00-RF Center Freq register | - |4-bytes 0x00| - |4-byte unsigned RF center freq (in KHz)| - |RegAddr: 0x01-RF channel filter bandwidth register | - |4-bytes 0x00| - |4-byte unsigned RF channel filter bw (in KHz)| - |RegAddr: 0x02-RF gain register | - |7-bytes 0x00| - |1-byte signed RF gain (in dB)| - |RegAddr: 0x03-Baseband gain register | - |4-bytes 0x00| - |4-byte signed baseband filter gain (in dB)| - |RegAddr: 0x10-ADF4350 register | - |4-bytes 0x00| - |4-byte ADF4350 register value (actual ADF4350 reg addr embedded - within 4-byte value)| - |RegAddr: 0x11-SKY73202 register | - |5-bytes 0x00| - |1-byte reg 0 of SKY73202 | - |1-byte reg 1 of SKY73202 | - |1-byte reg 2 of SKY73202 | - |RegAddr: 0x20-Clock Scheme | - |3-bytes 0x00| - |1-byte indicating clocking scheme: - -0x00 -> BURX local TCXO off, BURX accepts ref clock from - USRP (freq of USRP's ref clock specified in bytes 2-5) - -0x01 -> BURX local TCXO on, BURX uses its local TCXO as its ref - clock, TCXO signal output for use by USRP | - |4-byte USRP ref clock freq in hz (only needed if byte 1 set to 0x00) | - - --------------------------------------------------------------------------- - - As an example, lets say the client wants to set an RF center freq of - 1000 MHz. In KHz, this translates to 1000000 (resolution is only down to - steps of 1 KHz), which is 0x000F4240 in hex. So the complete 9-byte I2C - sequence that the client should send is as follows: - byte 0: 0x00-register 0x00 is the target of the write operation - bytes 1-4: 0x00 (padding) - byte 5: 0x40 (LSB of the 1000000 KHz value, in hex) - byte 6: 0x42 - byte 7: 0x0F - byte 8: 0x00 (MSB of the 1000000 KHz value, in hex) - - If using the usrper cmd-line application on a PC, this sequence would - be sent as follows (assuming that the BURX is in slot A): - - # usrper i2c_write 0x47 000000000040420F00 - - How about another example...lets say the client wants to setup the clock - scheme to use scheme #1 where the 26 MHz TCXO on the BURX board is enabled, - and is provided to the USRP. 26 MHz (i.e. 26 million), in hex, is 0x18CBA80. - So the complete 9-byte I2C sequence that the client should send is as follows: - byte 0: 0x20-register 0x20 is the target of the write operation - bytes 1-3: 0x00 (padding) - byte 4: 0x01 (indicating that clock scheme #1 is wanted) - byte 5: 0x80 (LSB of the BURX ref clk freq) - byte 6: 0xBA - byte 7: 0x8C - byte 8: 0x01 (MSB of the BURX ref clk freq) - - To enable the BURX local ref clk, which will also make it available on the - on-board U.FL connector as a source for the USRP, a user can also use - the usrper cmd-line application on a PC. The following sequence would - be sent (assuming that the BURX is in slot A): - - # usrper i2c_write 0x47 200000000180BA8C01 - -*/ - -#define NUM_BYTES_IN_I2C_CMD 9 - -/*****************************************************************************/ - -db_bitshark_rx::db_bitshark_rx(usrp_basic_sptr _usrp, int which) - : db_base(_usrp, which) -{ - // Control Bitshark receiver USRP daughterboard. - // - // @param usrp: instance of usrp.source_c - // @param which: which side: 0, 1 corresponding to RX_A or RX_B respectively - - // turn off all outputs - usrp()->_write_oe(d_which, 0, 0xffff); - - if (which == 0) - { - d_i2c_addr = 0x47; - } - else - { - d_i2c_addr = 0x45; - } - - // initialize gain - set_gain((gain_min() + gain_max()) / 2.0); - - // by default, assume we're using the USRPs clock as the ref clk, - // so setup the clock scheme and frequency. If the user wants - // to use the Bitshark's TCXO, the clock scheme should be set - // to 1, the freq should be set to 26000000, and a top-level - // 'make' and 'make install' needs to be executed. In addition, - // a U.FL to SMA cable needs to connect J6 on the Bitshark to - // the external clk input on the USRP - set_clock_scheme(0,64000000); - - set_bw(8e6); // Default IF bandwidth to match USRP1 max host bandwidth - - bypass_adc_buffers(true); -} - -db_bitshark_rx::~db_bitshark_rx() -{ - shutdown(); -} - -/************ Private Functions **********************/ - -void -db_bitshark_rx::_set_pga(int pga_gain) -{ - assert(pga_gain>=0 && pga_gain<=20); - if(d_which == 0) - { - usrp()->set_pga (0, pga_gain); - usrp()->set_pga (1, pga_gain); - } - else - { - usrp()->set_pga (2, pga_gain); - usrp()->set_pga (3, pga_gain); - } -} - -/************ Public Functions **********************/ -void -db_bitshark_rx::shutdown() -{ - if (!d_is_shutdown) - { - d_is_shutdown = true; - } -} - -bool -db_bitshark_rx::set_bw (float bw) -{ - std::vector<int> args(NUM_BYTES_IN_I2C_CMD,0); - uint16_t rf_bw_in_khz = (uint16_t)(bw/1000.0); - char val[4]; - bool result = false; - uint8_t try_count = 0; - - memset(val,0x00,4); - if (rf_bw_in_khz < 660 || rf_bw_in_khz > 56000) - { - fprintf(stderr, "db_bitshark_rx::set_bw: bw (=%d) must be between 660 KHz and 56 MHz inclusive\n", rf_bw_in_khz); - return false; - } - //fprintf(stdout,"Setting bw: requested bw in khz is %d\r\n",rf_bw_in_khz); - memcpy(val,&rf_bw_in_khz,4); - args[0] = RF_CHAN_FILTER_BW_REG; - args[5] = val[0]; - args[6] = val[1]; - args[7] = val[2]; - args[8] = val[3]; - while ((result != true) && (try_count < 3)) - { - result=usrp()->write_i2c (d_i2c_addr, int_seq_to_str (args)); - try_count++; - } - - if (result == false) - { - fprintf(stderr, "db_bitshark_rx:set_bw: giving up after 3 tries without success\n"); - } - - return result; -} - -/* The gain referenced below is RF gain only. There are two independent - gain settings at RF: a digital step attenuator (providing 0, -6, -12, and - -18 dB of attenuation), and a second LNA (LNA2) that provides ~25 dB of - gain (roughly...it actually depends on the RF freq). So combining these - two stages can provide an overall gain range from 0 (which is mapped - to -18 dB on the step attenuator + LNA2 turned off) to 42 (which is - mapped to 0 dB on the step attenuator + LNA2 turned on). - - There could be better ways to map these, but this is sufficient for - now. */ -float -db_bitshark_rx::gain_min() -{ - return 0; -} - -float -db_bitshark_rx::gain_max() -{ - return 42; -} - -float -db_bitshark_rx::gain_db_per_step() -{ - return 6; -} - -bool -db_bitshark_rx::set_gain(float gain) -{ - // Set the gain. - // - // @param gain: RF gain in decibels, range of 0-42 - // @returns True/False - - std::vector<int> args(NUM_BYTES_IN_I2C_CMD,0); - bool result = false; - uint8_t try_count = 0; - - if (gain < gain_min() || gain > gain_max()) - { - fprintf(stderr,"db_bitshark_rx::set_gain: gain (=%f) must be between %f and %f inclusive\n", gain,gain_min(),gain_max()); - return false; - } - //fprintf(stdout,"db_bitshark_rx::set_gain: requested gain of %f\r\n",gain); - args[0] = RF_GAIN_REG; - args[5] = (int)gain; - - while ((result != true) && (try_count < 3)) - { - result=usrp()->write_i2c (d_i2c_addr, int_seq_to_str (args)); - try_count++; - } - - if (result == false) - { - fprintf(stderr, "db_bitshark_rx:set_gain: giving up after 3 tries without success\n"); - } - - return result; -} - - -bool -db_bitshark_rx::set_clock_scheme(uint8_t clock_scheme, uint32_t ref_clk_freq) -{ - // Set the clock scheme for determining how the BURX - // dboard receives its clock. Note: Ideally, the constructor for the - // BURX board could simply call this method to set how it wants the - // clock scheme configured. However, depending on the application - // using the daughterboard, the constructor may run _after_ some - // other portion of the application needs the FPGA. And if the - // the clock source for the FPGA was the BURX's 26 MHz TCXO, we're in - // a chicken-before-the-egg dilemna. So the solution is to leave - // this function here for reference in case an app wants to use it, - // and also give the user the ability to set the clock scheme through - // the usrper cmd-line application (see example at the top of this - // file). - // - // @param clock_scheme - // @param ref_clk_freq in Hz - // @returns True/False - - std::vector<int> args(NUM_BYTES_IN_I2C_CMD,0); - bool result = false; - uint8_t try_count = 0; - char val[4]; - - if (clock_scheme > 1) - { - fprintf(stderr,"db_bitshark_rx::set_clock_scheme: invalid scheme %d\n",clock_scheme); - return false; - } - //fprintf(stdout,"db_bitshark_rx::set_clock_scheme: requested clock schem of %d with freq %d Hz \n",clock_scheme,ref_clk_freq); - memcpy(val,&ref_clk_freq,4); - args[0] = CLOCK_SCHEME_REG; - args[4] = (int)clock_scheme; - args[5] = val[0]; - args[6] = val[1]; - args[7] = val[2]; - args[8] = val[3]; - - while ((result != true) && (try_count < 3)) - { - result=usrp()->write_i2c (d_i2c_addr, int_seq_to_str (args)); - try_count++; - } - - if (result == false) - { - fprintf(stderr, "db_bitshark_rx:set_clock_scheme: giving up after 3 tries without success\n"); - } - return result; -} - -double -db_bitshark_rx::freq_min() -{ - return 300e6; -} - -double -db_bitshark_rx::freq_max() -{ - return 4e9; -} - -struct freq_result_t -db_bitshark_rx::set_freq(double freq) -{ - // Set the frequency. - // - // @param freq: target RF frequency in Hz - // @type freq: double - // - // @returns (ok, actual_baseband_freq) where: - // ok is True or False and indicates success or failure, - // actual_baseband_freq is RF frequency that corresponds to DC in the IF. - - std::vector<int> args(NUM_BYTES_IN_I2C_CMD,0); - std::vector<int> bytes(2); - char val[4]; - freq_result_t act_freq = {false, 0}; - uint32_t freq_in_khz = (uint32_t)(freq/1000.0); - bool result = false; - uint8_t try_count = 0; - - memset(val,0x00,4); - if(!(freq>=freq_min() && freq<=freq_max())) - { - return act_freq; - } - - //fprintf(stdout,"db_bitshark_rx::set_freq: requested freq is %d KHz\n",freq_in_khz); - memcpy(val,&freq_in_khz,4); - args[0] = RF_CENTER_FREQ_REG; - args[5] = val[0]; - args[6] = val[1]; - args[7] = val[2]; - args[8] = val[3]; - - while ((result != true) && (try_count < 3)) - { - result=usrp()->write_i2c (d_i2c_addr, int_seq_to_str (args)); - try_count++; - } - - if (result == false) - { - fprintf(stderr, "db_bitshark_rx:set_freq: giving up after 3 tries without success\n"); - } - - act_freq.ok = result; - act_freq.baseband_freq = (double)freq; - return act_freq; -} - -bool -db_bitshark_rx::is_quadrature() -{ - // Return True if this board requires both I & Q analog channels. - return true; -} - -bool -db_bitshark_rx::i_and_q_swapped() -{ - // Returns True since our I and Q channels are swapped - return true; -} diff --git a/usrp/host/lib/db_boards.cc b/usrp/host/lib/db_boards.cc deleted file mode 100644 index 9324d58ee..000000000 --- a/usrp/host/lib/db_boards.cc +++ /dev/null @@ -1,244 +0,0 @@ -/* -*- c++ -*- */ -// -// Copyright 2008,2009 Free Software Foundation, Inc. -// -// This file is part of GNU Radio -// -// GNU Radio is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either asversion 3, or (at your option) -// any later version. -// -// GNU Radio is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with GNU Radio; see the file COPYING. If not, write to -// the Free Software Foundation, Inc., 51 Franklin Street, -// Boston, MA 02110-1301, USA. -// - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <db_boards.h> -#include <usrp/usrp_dbid.h> -#include <usrp/db_basic.h> -#include <usrp/db_tv_rx.h> -#include <usrp/db_tv_rx_mimo.h> -#include <usrp/db_dbs_rx.h> -#include <usrp/db_flexrf.h> -#include <usrp/db_flexrf_mimo.h> -#include <usrp/db_wbxng.h> -#include <usrp/db_xcvr2450.h> -#include <usrp/db_dtt754.h> -#include <usrp/db_dtt768.h> -#include <usrp/db_bitshark_rx.h> -#include <cstdio> - -std::vector<db_base_sptr> -instantiate_dbs(int dbid, usrp_basic_sptr usrp, int which_side) -{ - std::vector<db_base_sptr> db; - - switch(dbid) { - - case(USRP_DBID_BASIC_TX): - db.push_back(db_base_sptr(new db_basic_tx(usrp, which_side))); - break; - - case(USRP_DBID_BASIC_RX): - db.push_back(db_base_sptr(new db_basic_rx(usrp, which_side, 0))); - db.push_back(db_base_sptr(new db_basic_rx(usrp, which_side, 1))); - db.push_back(db_base_sptr(new db_basic_rx(usrp, which_side, 2))); - break; - - case(USRP_DBID_LF_TX): - db.push_back(db_base_sptr(new db_lf_tx(usrp, which_side))); - break; - - case(USRP_DBID_LF_RX): - db.push_back(db_base_sptr(new db_lf_rx(usrp, which_side, 0))); - db.push_back(db_base_sptr(new db_lf_rx(usrp, which_side, 1))); - db.push_back(db_base_sptr(new db_lf_rx(usrp, which_side, 2))); - break; - - case(USRP_DBID_DBS_RX): - db.push_back(db_base_sptr(new db_dbs_rx(usrp, which_side))); - break; - - case(USRP_DBID_TV_RX): - db.push_back(db_base_sptr(new db_tv_rx(usrp, which_side, 43.75e6, 5.75e6))); - break; - case(USRP_DBID_TV_RX_REV_2): - db.push_back(db_base_sptr(new db_tv_rx(usrp, which_side, 44e6, 20e6))); - break; - case(USRP_DBID_TV_RX_REV_3): - db.push_back(db_base_sptr(new db_tv_rx(usrp, which_side, 44e6, 20e6))); - break; - case(USRP_DBID_TV_RX_MIMO): - db.push_back(db_base_sptr(new db_tv_rx_mimo(usrp, which_side, 43.75e6, 5.75e6))); - break; - case(USRP_DBID_TV_RX_REV_2_MIMO): - db.push_back(db_base_sptr(new db_tv_rx_mimo(usrp, which_side, 44e6, 20e6))); - break; - case(USRP_DBID_TV_RX_REV_3_MIMO): - db.push_back(db_base_sptr(new db_tv_rx_mimo(usrp, which_side, 44e6, 20e6))); - break; - - case(USRP_DBID_FLEX_2400_TX): - db.push_back(db_base_sptr(new db_flexrf_2400_tx(usrp, which_side))); - break; - case(USRP_DBID_FLEX_2400_RX): - db.push_back(db_base_sptr(new db_flexrf_2400_rx(usrp, which_side))); - break; - case(USRP_DBID_FLEX_1200_TX): - db.push_back(db_base_sptr(new db_flexrf_1200_tx(usrp, which_side))); - break; - case(USRP_DBID_FLEX_1200_RX): - db.push_back(db_base_sptr(new db_flexrf_1200_rx(usrp, which_side))); - break; - case(USRP_DBID_FLEX_1800_TX): - db.push_back(db_base_sptr(new db_flexrf_1800_tx(usrp, which_side))); - break; - case(USRP_DBID_FLEX_1800_RX): - db.push_back(db_base_sptr(new db_flexrf_1800_rx(usrp, which_side))); - break; - case(USRP_DBID_FLEX_900_TX): - db.push_back(db_base_sptr(new db_flexrf_900_tx(usrp, which_side))); - break; - case(USRP_DBID_FLEX_900_RX): - db.push_back(db_base_sptr(new db_flexrf_900_rx(usrp, which_side))); - break; - case(USRP_DBID_FLEX_400_TX): - db.push_back(db_base_sptr(new db_flexrf_400_tx(usrp, which_side))); - break; - case(USRP_DBID_FLEX_400_RX): - db.push_back(db_base_sptr(new db_flexrf_400_rx(usrp, which_side))); - break; - case(USRP_DBID_FLEX_2400_TX_MIMO_A): - db.push_back(db_base_sptr(new db_flexrf_2400_tx_mimo_a(usrp, which_side))); - break; - case(USRP_DBID_FLEX_2400_RX_MIMO_A): - db.push_back(db_base_sptr(new db_flexrf_2400_rx_mimo_a(usrp, which_side))); - break; - case(USRP_DBID_FLEX_1800_TX_MIMO_A): - db.push_back(db_base_sptr(new db_flexrf_1800_tx_mimo_a(usrp, which_side))); - break; - case(USRP_DBID_FLEX_1800_RX_MIMO_A): - db.push_back(db_base_sptr(new db_flexrf_1800_rx_mimo_a(usrp, which_side))); - break; - case(USRP_DBID_FLEX_1200_TX_MIMO_A): - db.push_back(db_base_sptr(new db_flexrf_1200_tx_mimo_a(usrp, which_side))); - break; - case(USRP_DBID_FLEX_1200_RX_MIMO_A): - db.push_back(db_base_sptr(new db_flexrf_1200_rx_mimo_a(usrp, which_side))); - break; - case(USRP_DBID_FLEX_900_TX_MIMO_A): - db.push_back(db_base_sptr(new db_flexrf_900_tx_mimo_a(usrp, which_side))); - break; - case(USRP_DBID_FLEX_900_RX_MIMO_A): - db.push_back(db_base_sptr(new db_flexrf_900_rx_mimo_a(usrp, which_side))); - break; - case(USRP_DBID_FLEX_400_TX_MIMO_A): - db.push_back(db_base_sptr(new db_flexrf_400_tx_mimo_a(usrp, which_side))); - break; - case(USRP_DBID_FLEX_400_RX_MIMO_A): - db.push_back(db_base_sptr(new db_flexrf_400_rx_mimo_a(usrp, which_side))); - break; - case(USRP_DBID_FLEX_2400_TX_MIMO_B): - db.push_back(db_base_sptr(new db_flexrf_2400_tx_mimo_b(usrp, which_side))); - break; - case(USRP_DBID_FLEX_2400_RX_MIMO_B): - db.push_back(db_base_sptr(new db_flexrf_2400_rx_mimo_b(usrp, which_side))); - break; - case(USRP_DBID_FLEX_1800_TX_MIMO_B): - db.push_back(db_base_sptr(new db_flexrf_1800_tx_mimo_b(usrp, which_side))); - break; - case(USRP_DBID_FLEX_1800_RX_MIMO_B): - db.push_back(db_base_sptr(new db_flexrf_1800_rx_mimo_b(usrp, which_side))); - break; - case(USRP_DBID_FLEX_1200_TX_MIMO_B): - db.push_back(db_base_sptr(new db_flexrf_1200_tx_mimo_b(usrp, which_side))); - break; - case(USRP_DBID_FLEX_1200_RX_MIMO_B): - db.push_back(db_base_sptr(new db_flexrf_1200_rx_mimo_b(usrp, which_side))); - break; - case(USRP_DBID_FLEX_900_TX_MIMO_B): - db.push_back(db_base_sptr(new db_flexrf_900_tx_mimo_b(usrp, which_side))); - break; - case(USRP_DBID_FLEX_900_RX_MIMO_B): - db.push_back(db_base_sptr(new db_flexrf_900_rx_mimo_b(usrp, which_side))); - break; - case(USRP_DBID_FLEX_400_TX_MIMO_B): - db.push_back(db_base_sptr(new db_flexrf_400_tx_mimo_b(usrp, which_side))); - break; - case(USRP_DBID_FLEX_400_RX_MIMO_B): - db.push_back(db_base_sptr(new db_flexrf_400_rx_mimo_b(usrp, which_side))); - break; - - case(USRP_DBID_XCVR2450_TX): - db.push_back(db_base_sptr(new db_xcvr2450_tx(usrp, which_side))); - break; - case(USRP_DBID_XCVR2450_RX): - db.push_back(db_base_sptr(new db_xcvr2450_rx(usrp, which_side))); - break; - -#if 0 // FIXME wbx doesn't compile - case(USRP_DBID_WBX_LO_TX): - db.push_back(db_base_sptr(new db_wbx_lo_tx(usrp, which_side))); - break; - case(USRP_DBID_WBX_LO_RX): - db.push_back(db_base_sptr(new db_wbx_lo_rx(usrp, which_side))); - break; -#endif - - case(USRP_DBID_WBX_NG_TX): - db.push_back(db_base_sptr(new db_wbxng_tx(usrp, which_side))); - break; - case(USRP_DBID_WBX_NG_RX): - db.push_back(db_base_sptr(new db_wbxng_rx(usrp, which_side))); - break; - - case(USRP_DBID_DTT754): - db.push_back(db_base_sptr(new db_dtt754(usrp, which_side))); - break; - case(USRP_DBID_DTT768): - db.push_back(db_base_sptr(new db_dtt768(usrp, which_side))); - break; - - case(USRP_DBID_BITSHARK_RX): - db.push_back(db_base_sptr(new db_bitshark_rx(usrp, which_side))); - break; - - case(-1): - if (boost::dynamic_pointer_cast<usrp_basic_tx>(usrp)){ - db.push_back(db_base_sptr(new db_basic_tx(usrp, which_side))); - } - else { - db.push_back(db_base_sptr(new db_basic_rx(usrp, which_side, 0))); - db.push_back(db_base_sptr(new db_basic_rx(usrp, which_side, 1))); - } - break; - - case(-2): - default: - if (boost::dynamic_pointer_cast<usrp_basic_tx>(usrp)){ - fprintf(stderr, "\n\aWarning: Treating daughterboard with invalid EEPROM contents as if it were a \"Basic Tx.\"\n"); - fprintf(stderr, "Warning: This is almost certainly wrong... Use appropriate burn-*-eeprom utility.\n\n"); - db.push_back(db_base_sptr(new db_basic_tx(usrp, which_side))); - } - else { - fprintf(stderr, "\n\aWarning: Treating daughterboard with invalid EEPROM contents as if it were a \"Basic Rx.\"\n"); - fprintf(stderr, "Warning: This is almost certainly wrong... Use appropriate burn-*-eeprom utility.\n\n"); - db.push_back(db_base_sptr(new db_basic_rx(usrp, which_side, 0))); - db.push_back(db_base_sptr(new db_basic_rx(usrp, which_side, 1))); - } - break; - } - - return db; -} diff --git a/usrp/host/lib/db_boards.h b/usrp/host/lib/db_boards.h deleted file mode 100644 index 136091c53..000000000 --- a/usrp/host/lib/db_boards.h +++ /dev/null @@ -1,33 +0,0 @@ -/* -*- c++ -*- */ -// -// Copyright 2008 Free Software Foundation, Inc. -// -// This file is part of GNU Radio -// -// GNU Radio is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either asversion 3, or (at your option) -// any later version. -// -// GNU Radio is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with GNU Radio; see the file COPYING. If not, write to -// the Free Software Foundation, Inc., 51 Franklin Street, -// Boston, MA 02110-1301, USA. -// - -#ifndef DB_BOARDS_H -#define DB_BOARDS_H - -#include <usrp/db_base.h> -#include <usrp/usrp_basic.h> - -std::vector<db_base_sptr> instantiate_dbs(int dbid, usrp_basic_sptr usrp, int which_side); - -#endif - - diff --git a/usrp/host/lib/db_dbs_rx.cc b/usrp/host/lib/db_dbs_rx.cc deleted file mode 100644 index 7fe8c4951..000000000 --- a/usrp/host/lib/db_dbs_rx.cc +++ /dev/null @@ -1,501 +0,0 @@ -// -// Copyright 2008,2009 Free Software Foundation, Inc. -// -// This file is part of GNU Radio -// -// GNU Radio is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either asversion 3, or (at your option) -// any later version. -// -// GNU Radio is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with GNU Radio; see the file COPYING. If not, write to -// the Free Software Foundation, Inc., 51 Franklin Street, -// Boston, MA 02110-1301, USA. - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <usrp/db_dbs_rx.h> -#include <db_base_impl.h> -#include <cmath> -#include <cstdio> - - -/*****************************************************************************/ - - -db_dbs_rx::db_dbs_rx(usrp_basic_sptr _usrp, int which) - : db_base(_usrp, which) -{ - // Control DBS receiver based USRP daughterboard. - // - // @param usrp: instance of usrp.source_c - // @param which: which side: 0, 1 corresponding to RX_A or RX_B respectively - - usrp()->_write_oe(d_which, 0x0001, 0x0001); - if(which == 0) { - d_i2c_addr = 0x67; - } - else { - d_i2c_addr = 0x65; - } - - d_n = 950; - d_div2 = 0; - d_osc = 5; - d_cp = 3; - d_r = 4; - d_r_int = 1; - d_fdac = 127; - d_m = 2; - d_dl = 0; - d_ade = 0; - d_adl = 0; - d_gc1 = 0; - d_gc2 = 31; - d_diag = 0; - - _enable_refclk(true); - - set_gain((gain_min() + gain_max()) / 2.0); // initialize gain - - bypass_adc_buffers(true); -} - -db_dbs_rx::~db_dbs_rx() -{ - shutdown(); -} - -void -db_dbs_rx::shutdown() -{ - if (!d_is_shutdown){ - d_is_shutdown = true; - // do whatever there is to do to shutdown orderly - _enable_refclk(false); - } -} - -void -db_dbs_rx::_write_reg (int regno, int v) -{ - //regno is in [0,5], v is value to write to register""" - assert (0 <= regno && regno <= 5); - std::vector<int> args(2); - args[0] = regno; - args[1] = v; - usrp()->write_i2c (d_i2c_addr, int_seq_to_str (args)); -} - -void -db_dbs_rx::_write_regs (int starting_regno, const std::vector<int> &vals) -{ - // starting_regno is in [0,5], - // vals is a seq of integers to write to consecutive registers""" - - //FIXME - std::vector<int> args; - args.push_back(starting_regno); - args.insert(args.end(), vals.begin(), vals.end()); - usrp()->write_i2c (d_i2c_addr, int_seq_to_str (args)); -} - -std::vector<int> -db_dbs_rx::_read_status () -{ - //If successful, return list of two ints: [status_info, filter_DAC]""" - std::string s = usrp()->read_i2c (d_i2c_addr, 2); - if(s.size() != 2) { - std::vector<int> ret(0); - return ret; - } - return str_to_int_seq (s); -} - -void -db_dbs_rx::_send_reg(int regno) -{ - assert(0 <= regno && regno <= 5); - if(regno == 0) - _write_reg(0,(d_div2<<7) + (d_n>>8)); - if(regno == 1) - _write_reg(1,d_n & 255); - if(regno == 2) - _write_reg(2,d_osc + (d_cp<<3) + (d_r_int<<5)); - if(regno == 3) - _write_reg(3,d_fdac); - if(regno == 4) - _write_reg(4,d_m + (d_dl<<5) + (d_ade<<6) + (d_adl<<7)); - if(regno == 5) - _write_reg(5,d_gc2 + (d_diag<<5)); -} - -// BW setting -void -db_dbs_rx::_set_m(int m) -{ - assert(m>0 && m<32); - d_m = m; - _send_reg(4); -} - -void -db_dbs_rx::_set_fdac(int fdac) -{ - assert(fdac>=0 && fdac<128); - d_fdac = fdac; - _send_reg(3); -} - -bool -db_dbs_rx::set_bw (float bw) -{ - if (bw < 1e6 || bw > 33e6) { - fprintf(stderr, "db_dbs_rx::set_bw: bw (=%f) must be between 1e6 and 33e6 inclusive\n", bw); - return false; - } - - // struct bw_t ret = {0, 0, 0}; - int m_max, m_min, m_test, fdac_test; - if(bw >= 4e6) - m_max = int(std::min(31, (int)floor(_refclk_freq()/1e6))); - else if(bw >= 2e6) // Outside of Specs! - m_max = int(std::min(31, (int)floor(_refclk_freq()/.5e6))); - else // Way outside of Specs! - m_max = int(std::min(31, (int)floor(_refclk_freq()/.25e6))); - - m_min = int(ceil(_refclk_freq()/2.5e6)); - m_test = m_max; - while(m_test >= m_min) { - fdac_test = static_cast<int>(round(((bw * m_test / _refclk_freq())-4)/.145)); - if(fdac_test > 127) - m_test = m_test - 1; - else - break; - } - - if(m_test>=m_min && fdac_test>=0) { - _set_m(m_test); - _set_fdac(fdac_test); - - //ret.m = d_m; - //ret.fdac = d_fdac; - //ret.div = _refclk_freq()/d_m*(4+0.145*d_fdac); - } - else { - fprintf(stderr, "db_dbs_rx::set_bw: failed\n"); - return false; - } - - return true; -} - -// Gain setting -void -db_dbs_rx::_set_dl(int dl) -{ - assert(dl == 0 || dl == 1); - d_dl = dl; - _send_reg(4); -} - -void -db_dbs_rx::_set_gc2(int gc2) -{ - assert(gc2<32 && gc2>=0); - d_gc2 = gc2; - _send_reg(5); -} - -void -db_dbs_rx::_set_gc1(int gc1) -{ - assert(gc1>=0 && gc1<4096); - d_gc1 = gc1; - usrp()->write_aux_dac(d_which, 0, gc1); -} - -void -db_dbs_rx::_set_pga(int pga_gain) -{ - assert(pga_gain>=0 && pga_gain<=20); - if(d_which == 0) { - usrp()->set_pga (0, pga_gain); - usrp()->set_pga (1, pga_gain); - } - else { - usrp()->set_pga (2, pga_gain); - usrp()->set_pga (3, pga_gain); - } -} - -float -db_dbs_rx::gain_min() -{ - return 0; -} - -float -db_dbs_rx::gain_max() -{ - return 104; -} - -float -db_dbs_rx::gain_db_per_step() -{ - return 1; -} - -bool -db_dbs_rx::set_gain(float gain) -{ - // Set the gain. - // - // @param gain: gain in decibels - // @returns True/False - - if(!(gain>=0 && gain<105)) { - throw std::runtime_error("gain out of range\n"); - } - - int gc1=0, gc2=0, dl=0, pga=0; - - if(gain < 56) { - gc1 = int((-gain*1.85/56.0 + 2.6)*4096.0/3.3); - gain = 0; - } - else { - gc1 = 0; - gain -= 56; - } - - if(gain < 24) { - gc2 = static_cast<int>(round(31.0 * (1-gain/24.0))); - gain = 0; - } - else { - gc2 = 0; - gain -=24; - } - - if(gain >= 4.58) { - dl = 1; - gain -= 4.58; - } - - pga = gain; - _set_gc1(gc1); - _set_gc2(gc2); - _set_dl(dl); - _set_pga(pga); - - return true; -} - -// Frequency setting -void -db_dbs_rx::_set_osc(int osc) -{ - assert(osc>=0 && osc<8); - d_osc = osc; - _send_reg(2); -} - -void -db_dbs_rx::_set_cp(int cp) -{ - assert(cp>=0 && cp<4); - d_cp = cp; - _send_reg(2); -} - -void -db_dbs_rx::_set_n(int n) -{ - assert(n>256 && n<32768); - d_n = n; - _send_reg(0); - _send_reg(1); -} - -void -db_dbs_rx::_set_div2(int div2) -{ - assert(div2 == 0 || div2 == 1); - d_div2 = div2; - _send_reg(0); -} - -void -db_dbs_rx::_set_r(int r) -{ - assert(r>=0 && r<128); - d_r = r; - d_r_int = static_cast<int>(round(log10(r)/log10(2)) - 1); - _send_reg(2); -} - -// FIXME How do we handle ADE and ADL properly? -void -db_dbs_rx::_set_ade(int ade) -{ - assert(ade == 0 || ade == 1); - d_ade = ade; - _send_reg(4); -} - -double -db_dbs_rx::freq_min() -{ - return 500e6; -} - -double -db_dbs_rx::freq_max() -{ - return 2.6e9; -} - -struct freq_result_t -db_dbs_rx::set_freq(double freq) -{ - // Set the frequency. - // - // @param freq: target RF frequency in Hz - // @type freq: double - // - // @returns (ok, actual_baseband_freq) where: - // ok is True or False and indicates success or failure, - // actual_baseband_freq is RF frequency that corresponds to DC in the IF. - - freq_result_t args = {false, 0}; - - if(!(freq>=freq_min() && freq<=freq_max())) { - return args; - } - - double vcofreq; - if(freq<1150e6) { - _set_div2(0); - vcofreq = 4 * freq; - } - else { - _set_div2(1); - vcofreq = 2 * freq; - } - - _set_ade(1); - int rmin = std::max(2, (int)(_refclk_freq()/2e6)); - int rmax = std::min(128, (int)(_refclk_freq()/500e3)); - int r = 2; - int n = 0; - int best_r = 2; - int best_n = 0; - int best_delta = 10e6; - int delta; - - while(r <= rmax) { - n = static_cast<int>(round(freq/(_refclk_freq()/r))); - if(r<rmin || n<256) { - r = r * 2; - continue; - } - delta = (int)fabs(n*_refclk_freq()/r - freq); - if(delta < 75e3) { - best_r = r; - best_n = n; - break; - } - if(delta < best_delta*0.9) { - best_r = r; - best_n = n; - best_delta = delta; - } - r = r * 2; - } - _set_r(best_r); - - _set_n(static_cast<int>(round(best_n))); - - int vco; - if(vcofreq < 2433e6) - vco = 0; - else if(vcofreq < 2711e6) - vco=1; - else if(vcofreq < 3025e6) - vco=2; - else if(vcofreq < 3341e6) - vco=3; - else if(vcofreq < 3727e6) - vco=4; - else if(vcofreq < 4143e6) - vco=5; - else if(vcofreq < 4493e6) - vco=6; - else - vco=7; - - _set_osc(vco); - - // Set CP current - int adc_val = 0; - std::vector<int> bytes(2); - while(adc_val == 0 || adc_val == 7) { - bytes = _read_status(); - adc_val = bytes[0] >> 2; - if(adc_val == 0) { - if(vco <= 0) { - return args; - } - else { - vco = vco - 1; - } - } - else if(adc_val == 7) { - if(vco >= 7) { - return args; - } - else { - vco = vco + 1; - } - } - _set_osc(vco); - } - - if(adc_val == 1 || adc_val == 2) { - _set_cp(1); - } - else if(adc_val == 3 || adc_val == 4) { - _set_cp(2); - } - else { - _set_cp(3); - } - - args.ok = true; - args.baseband_freq = d_n * _refclk_freq() / d_r; - return args; -} - -int -db_dbs_rx::_refclk_divisor() -{ - //Return value to stick in REFCLK_DIVISOR register - return 16; -} - -bool -db_dbs_rx::is_quadrature() -{ - // Return True if this board requires both I & Q analog channels. - return true; -} diff --git a/usrp/host/lib/db_dtt754.cc b/usrp/host/lib/db_dtt754.cc deleted file mode 100644 index 9ced705e4..000000000 --- a/usrp/host/lib/db_dtt754.cc +++ /dev/null @@ -1,327 +0,0 @@ -/* -*- c++ -*- */ -// -// Copyright 2008,2009 Free Software Foundation, Inc. -// -// This file is part of GNU Radio -// -// GNU Radio is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either asversion 3, or (at your option) -// any later version. -// -// GNU Radio is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with GNU Radio; see the file COPYING. If not, write to -// the Free Software Foundation, Inc., 51 Franklin Street, -// Boston, MA 02110-1301, USA. - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <usrp/db_dtt754.h> -#include <db_base_impl.h> - -int -control_byte_1() -{ - int RS = 0; // 0 = 166.66kHz reference - int ATP = 7; // Disable internal AGC - return (0x80 | ATP<<3 | RS); -} - -int -control_byte_2() -{ - int STBY = 0; // powered on - int XTO = 1; // turn off xtal out, which we don't have - int ATC = 0; // not clear exactly, possibly speeds up or slows down AGC, which we are not using - - int c = 0xc2 | ATC<<5 | STBY<<4 | XTO; - return c; -} - -int -bandswitch_byte(float freq, float bw) -{ - int P5, CP, BS; - - if(bw>7.5e6) { - P5 = 1; - } - else { - P5 = 0; - } - - if(freq < 121e6) { - CP = 0; - BS = 1; - } - else if(freq < 141e6) { - CP = 1; - BS = 1; - } - else if(freq < 166e6) { - CP = 2; - BS = 1; - } - else if(freq < 182e6) { - CP = 3; - BS = 1; - } - else if(freq < 286e6) { - CP = 0; - BS = 2; - } - else if(freq < 386e6) { - CP = 1; - BS = 2; - } - else if(freq < 446e6) { - CP = 2; - BS = 2; - } - else if(freq < 466e6) { - CP = 3; - BS = 2; - } - else if(freq < 506e6) { - CP = 0; - BS = 8; - } - else if(freq < 761e6) { - CP = 1; - BS = 8; - } - else if(freq < 846e6) { - CP = 2; - BS = 8; - } - else { // limit is ~905 MHz - CP = 3; - BS = 8; - } - return (CP<<6 | P5 << 4 | BS); -} - -db_dtt754::db_dtt754(usrp_basic_sptr _usrp, int which) - : db_base(_usrp, which) -{ - /* - * Control custom DTT75403-based daughterboard. - * - * @param usrp: instance of usrp.source_c - * @param which: which side: 0 or 1 corresponding to RX_A or RX_B respectively - * @type which: int - */ - - // FIXME: DTT754 and DTT768 can probably inherit from a DTT class - - if(d_which == 0) { - d_i2c_addr = 0x60; - } - else { - d_i2c_addr = 0x62; - } - - d_bw = 7e6; - d_IF = 36e6; - - d_f_ref = 166.6666e3; - d_inverted = false; - - set_gain((gain_min() + gain_max()) / 2.0); - - bypass_adc_buffers(false); -} - -db_dtt754::~db_dtt754() -{ -} - -float -db_dtt754::gain_min() -{ - return 0; -} - -float -db_dtt754::gain_max() -{ - return 115; -} - -float -db_dtt754::gain_db_per_step() -{ - return 1; -} - -bool -db_dtt754::set_gain(float gain) -{ - assert(gain>=0 && gain<=115); - - float rfgain, ifgain, pgagain; - if(gain > 60) { - rfgain = 60; - gain = gain - 60; - } - else { - rfgain = gain; - gain = 0; - } - - if(gain > 35) { - ifgain = 35; - gain = gain - 35; - } - else { - ifgain = gain; - gain = 0; - } - pgagain = gain; - - _set_rfagc(rfgain); - _set_ifagc(ifgain); - _set_pga(pgagain); - - return true; // can't fail with the assert in place -} - -double -db_dtt754::freq_min() -{ - return 44e6; -} - -double -db_dtt754::freq_max() -{ - return 900e6; -} - -struct freq_result_t -db_dtt754::set_freq(double target_freq) -{ - /* - * @returns (ok, actual_baseband_freq) where: - * ok is True or False and indicates success or failure, - * actual_baseband_freq is the RF frequency that corresponds to DC in the IF. - */ - - freq_result_t ret = {false, 0.0}; - - if(target_freq < freq_min() || target_freq > freq_max()) { - return ret; - } - - double target_lo_freq = target_freq + d_IF; // High side mixing - - int divisor = (int)(0.5+(target_lo_freq / d_f_ref)); - double actual_lo_freq = d_f_ref*divisor; - - if((divisor & ~0x7fff) != 0) { // must be 15-bits or less - return ret; - } - - // build i2c command string - std::vector<int> buf(5); - buf[0] = (divisor >> 8) & 0xff; // DB1 - buf[1] = divisor & 0xff; // DB2 - buf[2] = control_byte_1(); - buf[3] = bandswitch_byte(actual_lo_freq, d_bw); - buf[4] = control_byte_2(); - - bool ok = usrp()->write_i2c(d_i2c_addr, int_seq_to_str (buf)); - - d_freq = actual_lo_freq - d_IF; - - ret.ok = ok; - ret.baseband_freq = actual_lo_freq; - - return ret; - -} - -bool -db_dtt754::is_quadrature() -{ - /* - * Return True if this board requires both I & Q analog channels. - * - * This bit of info is useful when setting up the USRP Rx mux register. - */ - - return false; -} - -bool -db_dtt754::spectrum_inverted() -{ - /* - * The 43.75 MHz version is inverted - */ - - return d_inverted; -} - -bool -db_dtt754::set_bw(float bw) -{ - /* - * Choose the SAW filter bandwidth, either 7MHz or 8MHz) - */ - - d_bw = bw; - set_freq(d_freq); - - return true; // FIXME: propagate set_freq result -} - -void -db_dtt754::_set_rfagc(float gain) -{ - assert(gain <= 60 && gain >= 0); - // FIXME this has a 0.5V step between gain = 60 and gain = 59. - // Why are there two cases instead of a single linear case? - float voltage; - if(gain == 60) { - voltage = 4; - } - else { - voltage = gain/60.0 * 2.25 + 1.25; - } - - int dacword = (int)(4096*voltage/1.22/3.3); // 1.22 = opamp gain - - assert(dacword>=0 && dacword<4096); - usrp()->write_aux_dac(d_which, 1, dacword); -} - -void -db_dtt754::_set_ifagc(float gain) -{ - assert(gain <= 35 && gain >= 0); - float voltage = gain/35.0 * 2.1 + 1.4; - int dacword = (int)(4096*voltage/1.22/3.3); // 1.22 = opamp gain - - assert(dacword>=0 && dacword<4096); - usrp()->write_aux_dac(d_which, 0, dacword); -} - -void -db_dtt754::_set_pga(float pga_gain) -{ - assert(pga_gain >=0 && pga_gain <=20); - if(d_which == 0) { - usrp()->set_pga (0, pga_gain); - } - else { - usrp()->set_pga (2, pga_gain); - } -} diff --git a/usrp/host/lib/db_dtt768.cc b/usrp/host/lib/db_dtt768.cc deleted file mode 100644 index 0dfe1a8f3..000000000 --- a/usrp/host/lib/db_dtt768.cc +++ /dev/null @@ -1,300 +0,0 @@ -/* -*- c++ -*- */ -// -// Copyright 2008,2009 Free Software Foundation, Inc. -// -// This file is part of GNU Radio -// -// GNU Radio is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either asversion 3, or (at your option) -// any later version. -// -// GNU Radio is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with GNU Radio; see the file COPYING. If not, write to -// the Free Software Foundation, Inc., 51 Franklin Street, -// Boston, MA 02110-1301, USA. - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <usrp/db_dtt768.h> -#include <db_base_impl.h> - -int -control_byte_4() -{ - int C = 0; // Charge Pump Current, no info on how to choose - int R = 4; // 125 kHz fref - - // int ATP = 7; // Disable internal AGC - return (0x80 | C<<5 | R); -} - -int -control_byte_5(float freq, int agcmode = 1) -{ - if(agcmode) { - if(freq < 150e6) { - return 0x3B; - } - else if(freq < 420e6) { - return 0x7E; - } - else { - return 0xB7; - } - } - else { - if(freq < 150e6) { - return 0x39; - } - else if(freq < 420e6) { - return 0x7C; - } - else { - return 0xB5; - } - } -} - -int -control_byte_6() -{ - int ATC = 0; // AGC time constant = 100ms, 1 = 3S - int IFE = 1; // IF AGC amplifier enable - int AT = 0; // AGC control, ??? - - return (ATC << 5 | IFE << 4 | AT); -} - -int -control_byte_7() -{ - int SAS = 1; // SAW Digital mode - int AGD = 1; // AGC disable - int ADS = 0; // AGC detector into ADC converter - int T = 0; // Test mode, undocumented - return (SAS << 7 | AGD << 5 | ADS << 4 | T); -} - -db_dtt768::db_dtt768(usrp_basic_sptr _usrp, int which) - : db_base(_usrp, which) -{ - /* - * Control custom DTT76803-based daughterboard. - * - * @param usrp: instance of usrp.source_c - * @param which: which side: 0 or 1 corresponding to RX_A or RX_B respectively - * @type which: int - */ - - if(d_which == 0) { - d_i2c_addr = 0x60; - } - else { - d_i2c_addr = 0x62; - } - - d_IF = 44e6; - - d_f_ref = 125e3; - d_inverted = false; - - set_gain((gain_min() + gain_max()) / 2.0); - - bypass_adc_buffers(false); -} - -db_dtt768::~db_dtt768() -{ -} - -float -db_dtt768::gain_min() -{ - return 0; -} - -float -db_dtt768::gain_max() -{ - return 115; -} - -float -db_dtt768::gain_db_per_step() -{ - return 1; -} - -bool -db_dtt768::set_gain(float gain) -{ - assert(gain>=0 && gain<=115); - - float rfgain, ifgain, pgagain; - if(gain > 60) { - rfgain = 60; - gain = gain - 60; - } - else { - rfgain = gain; - gain = 0; - } - - if(gain > 35) { - ifgain = 35; - gain = gain - 35; - } - else { - ifgain = gain; - gain = 0; - } - pgagain = gain; - - _set_rfagc(rfgain); - _set_ifagc(ifgain); - _set_pga(pgagain); - - return true; -} - -double -db_dtt768::freq_min() -{ - return 44e6; -} - -double -db_dtt768::freq_max() -{ - return 900e6; -} - -struct freq_result_t -db_dtt768::set_freq(double target_freq) -{ - /* - * @returns (ok, actual_baseband_freq) where: - * ok is True or False and indicates success or failure, - * actual_baseband_freq is the RF frequency that corresponds to DC in the IF. - */ - - freq_result_t ret = {false, 0.0}; - - if(target_freq < freq_min() || target_freq > freq_max()) { - return ret; - } - - double target_lo_freq = target_freq + d_IF; // High side mixing - - int divisor = (int)(0.5+(target_lo_freq / d_f_ref)); - double actual_lo_freq = d_f_ref*divisor; - - if((divisor & ~0x7fff) != 0) { // must be 15-bits or less - return ret; - } - - // build i2c command string - std::vector<int> buf(6); - buf[0] = (divisor >> 8) & 0xff; // DB1 - buf[1] = divisor & 0xff; // DB2 - buf[2] = control_byte_4(); - buf[3] = control_byte_5(target_freq); - buf[4] = control_byte_6(); - buf[5] = control_byte_7(); - - bool ok = usrp()->write_i2c(d_i2c_addr, int_seq_to_str (buf)); - - d_freq = actual_lo_freq - d_IF; - - ret.ok = ok; - ret.baseband_freq = actual_lo_freq; - - return ret; - -} - -bool -db_dtt768::is_quadrature() -{ - /* - * Return True if this board requires both I & Q analog channels. - * - * This bit of info is useful when setting up the USRP Rx mux register. - */ - - return false; -} - -bool -db_dtt768::spectrum_inverted() -{ - /* - * The 43.75 MHz version is inverted - */ - - return d_inverted; -} - -bool -db_dtt768::set_bw(float bw) -{ - /* - * Choose the SAW filter bandwidth, either 7MHz or 8MHz) - */ - - d_bw = bw; - set_freq(d_freq); - - return true; // FIXME: propagate set_freq result -} - -void -db_dtt768::_set_rfagc(float gain) -{ - assert(gain <= 60 && gain >= 0); - // FIXME this has a 0.5V step between gain = 60 and gain = 59. - // Why are there two cases instead of a single linear case? - float voltage; - if(gain == 60) { - voltage = 4; - } - else { - voltage = gain/60.0 * 2.25 + 1.25; - } - - int dacword = (int)(4096*voltage/1.22/3.3); // 1.22 = opamp gain - - assert(dacword>=0 && dacword<4096); - usrp()->write_aux_dac(d_which, 1, dacword); -} - -void -db_dtt768::_set_ifagc(float gain) -{ - assert(gain <= 35 && gain >= 0); - float voltage = gain/35.0 * 2.1 + 1.4; - int dacword = (int)(4096*voltage/1.22/3.3); // 1.22 = opamp gain - - assert(dacword>=0 && dacword<4096); - usrp()->write_aux_dac(d_which, 0, dacword); -} - -void -db_dtt768::_set_pga(float pga_gain) -{ - assert(pga_gain >=0 && pga_gain <=20); - if(d_which == 0) { - usrp()->set_pga (0, pga_gain); - } - else { - usrp()->set_pga (2, pga_gain); - } -} diff --git a/usrp/host/lib/db_flexrf.cc b/usrp/host/lib/db_flexrf.cc deleted file mode 100644 index ddd87012d..000000000 --- a/usrp/host/lib/db_flexrf.cc +++ /dev/null @@ -1,1247 +0,0 @@ -// -// Copyright 2008,2009 Free Software Foundation, Inc. -// -// This file is part of GNU Radio -// -// GNU Radio is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either asversion 3, or (at your option) -// any later version. -// -// GNU Radio is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with GNU Radio; see the file COPYING. If not, write to -// the Free Software Foundation, Inc., 51 Franklin Street, -// Boston, MA 02110-1301, USA. - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <usrp/db_flexrf.h> -#include <db_base_impl.h> -#ifdef HAVE_TIME_H -#include <ctime> -#endif - -// d'board i/o pin defs -// Tx and Rx have shared defs, but different i/o regs -#define AUX_RXAGC (1 << 8) -#define POWER_UP (1 << 7) // enables power supply -#define RX_TXN (1 << 6) // Tx only: T/R antenna switch for TX/RX port -#define RX2_RX1N (1 << 6) // Rx only: antenna switch between RX2 and TX/RX port -#define ENABLE (1 << 5) // enables mixer -#define AUX_SEN (1 << 4) -#define AUX_SCLK (1 << 3) -#define PLL_LOCK_DETECT (1 << 2) -#define AUX_SDO (1 << 1) -#define CLOCK_OUT (1 << 0) - -flexrf_base::flexrf_base(usrp_basic_sptr _usrp, int which, int _power_on) - : db_base(_usrp, which), d_power_on(_power_on) -{ - /* - @param usrp: instance of usrp.source_c - @param which: which side: 0 or 1 corresponding to side A or B respectively - @type which: int - */ - - d_first = true; - d_spi_format = SPI_FMT_MSB | SPI_FMT_HDR_0; - - usrp()->_write_oe(d_which, 0, 0xffff); // turn off all outputs - _enable_refclk(false); // disable refclk - - set_auto_tr(false); -} - -flexrf_base::~flexrf_base() -{ - delete d_common; -} - -void -flexrf_base::_write_all(int R, int control, int N) -{ - /* - Write R counter latch, control latch and N counter latch to VCO. - - Adds 10ms delay between writing control and N if this is first call. - This is the required power-up sequence. - - @param R: 24-bit R counter latch - @type R: int - @param control: 24-bit control latch - @type control: int - @param N: 24-bit N counter latch - @type N: int - */ - timespec t; - t.tv_sec = 0; - t.tv_nsec = 10000000; - - _write_R(R); - _write_control(control); - if(d_first) { - //time.sleep(0.010); - nanosleep(&t, NULL); - d_first = false; - } - _write_N(N); -} - -void -flexrf_base::_write_control(int control) -{ - _write_it((control & ~0x3) | 0); -} - -void -flexrf_base::_write_R(int R) -{ - _write_it((R & ~0x3) | 1); -} - -void -flexrf_base::_write_N(int N) -{ - _write_it((N & ~0x3) | 2); -} - -void -flexrf_base::_write_it(int v) -{ - char s[3]; - s[0] = (char)((v >> 16) & 0xff); - s[1] = (char)((v >> 8) & 0xff); - s[2] = (char)(v & 0xff); - std::string str(s, 3); - usrp()->_write_spi(0, d_spi_enable, d_spi_format, str); -} - -bool -flexrf_base::_lock_detect() -{ - /* - @returns: the value of the VCO/PLL lock detect bit. - @rtype: 0 or 1 - */ - if(usrp()->read_io(d_which) & PLL_LOCK_DETECT) { - return true; - } - else { // Give it a second chance - // FIXME: make portable sleep - timespec t; - t.tv_sec = 0; - t.tv_nsec = 100000000; - nanosleep(&t, NULL); - - if(usrp()->read_io(d_which) & PLL_LOCK_DETECT) { - return true; - } - else { - return false; - } - } -} - -bool -flexrf_base::_compute_regs(double freq, int &retR, int &retcontrol, - int &retN, double &retfreq) -{ - /* - Determine values of R, control, and N registers, along with actual freq. - - @param freq: target frequency in Hz - @type freq: float - @returns: (R, control, N, actual_freq) - @rtype: tuple(int, int, int, float) - - Override this in derived classes. - */ - - //raise NotImplementedError; - throw std::runtime_error("_compute_regs called from flexrf_base\n"); -} - -int -flexrf_base::_compute_control_reg() -{ - return d_common->_compute_control_reg(); -} - -int -flexrf_base::_refclk_divisor() -{ - return d_common->_refclk_divisor(); -} - -struct freq_result_t -flexrf_base::set_freq(double freq) -{ - /* - @returns (ok, actual_baseband_freq) where: - ok is True or False and indicates success or failure, - actual_baseband_freq is the RF frequency that corresponds to DC in the IF. - */ - - struct freq_result_t args = {false, 0}; - - // Offsetting the LO helps get the Tx carrier leakage out of the way. - // This also ensures that on Rx, we're not getting hosed by the - // FPGA's DC removal loop's time constant. We were seeing a - // problem when running with discontinuous transmission. - // Offsetting the LO made the problem go away. - freq += d_lo_offset; - - int R, control, N; - double actual_freq; - _compute_regs(freq, R, control, N, actual_freq); - - if(R==0) { - return args; - } - - _write_all(R, control, N); - args.ok = _lock_detect(); - args.baseband_freq = actual_freq; - return args; -} - -bool -flexrf_base::_set_pga(float pga_gain) -{ - if(d_which == 0) { - usrp()->set_pga(0, pga_gain); - usrp()->set_pga(1, pga_gain); - } - else { - usrp()->set_pga(2, pga_gain); - usrp()->set_pga(3, pga_gain); - } - return true; -} - -bool -flexrf_base::is_quadrature() -{ - /* - Return True if this board requires both I & Q analog channels. - - This bit of info is useful when setting up the USRP Rx mux register. - */ - return true; -} - -double -flexrf_base::freq_min() -{ - return d_common->freq_min(); -} - -double -flexrf_base::freq_max() -{ - return d_common->freq_max(); -} - -// ---------------------------------------------------------------- - -flexrf_base_tx::flexrf_base_tx(usrp_basic_sptr _usrp, int which, int _power_on) - : flexrf_base(_usrp, which, _power_on) -{ - /* - @param usrp: instance of usrp.sink_c - @param which: 0 or 1 corresponding to side TX_A or TX_B respectively. - */ - - if(which == 0) { - d_spi_enable = SPI_ENABLE_TX_A; - } - else { - d_spi_enable = SPI_ENABLE_TX_B; - } - - // power up the transmit side, but don't enable the mixer - usrp()->_write_oe(d_which,(POWER_UP|RX_TXN|ENABLE), 0xffff); - usrp()->write_io(d_which, (power_on()|RX_TXN), (POWER_UP|RX_TXN|ENABLE)); - set_lo_offset(4e6); - - set_gain((gain_min() + gain_max()) / 2.0); // initialize gain -} - -flexrf_base_tx::~flexrf_base_tx() -{ - shutdown(); -} - - -void -flexrf_base_tx::shutdown() -{ - // fprintf(stderr, "flexrf_base_tx::shutdown d_is_shutdown = %d\n", d_is_shutdown); - - if (!d_is_shutdown){ - d_is_shutdown = true; - // do whatever there is to do to shutdown - - // Power down and leave the T/R switch in the R position - usrp()->write_io(d_which, (power_off()|RX_TXN), (POWER_UP|RX_TXN|ENABLE)); - - // Power down VCO/PLL - d_PD = 3; - - _write_control(_compute_control_reg()); - _enable_refclk(false); // turn off refclk - set_auto_tr(false); - } -} - -bool -flexrf_base_tx::set_auto_tr(bool on) -{ - bool ok = true; - if(on) { - ok &= set_atr_mask (RX_TXN | ENABLE); - ok &= set_atr_txval(0 | ENABLE); - ok &= set_atr_rxval(RX_TXN | 0); - } - else { - ok &= set_atr_mask (0); - ok &= set_atr_txval(0); - ok &= set_atr_rxval(0); - } - return ok; -} - -bool -flexrf_base_tx::set_enable(bool on) -{ - /* - Enable transmitter if on is true - */ - - int v; - int mask = RX_TXN | ENABLE; - if(on) { - v = ENABLE; - } - else { - v = RX_TXN; - } - return usrp()->write_io(d_which, v, mask); -} - -float -flexrf_base_tx::gain_min() -{ - return usrp()->pga_max(); -} - -float -flexrf_base_tx::gain_max() -{ - return usrp()->pga_max(); -} - -float -flexrf_base_tx::gain_db_per_step() -{ - return 1; -} - -bool -flexrf_base_tx::set_gain(float gain) -{ - /* - Set the gain. - - @param gain: gain in decibels - @returns True/False - */ - return _set_pga(usrp()->pga_max()); -} - - -/**************************************************************************/ - - -flexrf_base_rx::flexrf_base_rx(usrp_basic_sptr _usrp, int which, int _power_on) - : flexrf_base(_usrp, which, _power_on) -{ - /* - @param usrp: instance of usrp.source_c - @param which: 0 or 1 corresponding to side RX_A or RX_B respectively. - */ - - if(which == 0) { - d_spi_enable = SPI_ENABLE_RX_A; - } - else { - d_spi_enable = SPI_ENABLE_RX_B; - } - - usrp()->_write_oe(d_which, (POWER_UP|RX2_RX1N|ENABLE), 0xffff); - usrp()->write_io(d_which, (power_on()|RX2_RX1N|ENABLE), - (POWER_UP|RX2_RX1N|ENABLE)); - - // set up for RX on TX/RX port - select_rx_antenna("TX/RX"); - - bypass_adc_buffers(true); - - set_lo_offset(-4e6); -} - -flexrf_base_rx::~flexrf_base_rx() -{ - shutdown(); -} - -void -flexrf_base_rx::shutdown() -{ - // fprintf(stderr, "flexrf_base_rx::shutdown d_is_shutdown = %d\n", d_is_shutdown); - - if (!d_is_shutdown){ - d_is_shutdown = true; - // do whatever there is to do to shutdown - - // Power down - usrp()->common_write_io(C_RX, d_which, power_off(), (POWER_UP|ENABLE)); - - // Power down VCO/PLL - d_PD = 3; - - - // fprintf(stderr, "flexrf_base_rx::shutdown before _write_control\n"); - _write_control(_compute_control_reg()); - - // fprintf(stderr, "flexrf_base_rx::shutdown before _enable_refclk\n"); - _enable_refclk(false); // turn off refclk - - // fprintf(stderr, "flexrf_base_rx::shutdown before set_auto_tr\n"); - set_auto_tr(false); - - // fprintf(stderr, "flexrf_base_rx::shutdown after set_auto_tr\n"); - } -} - -bool -flexrf_base_rx::set_auto_tr(bool on) -{ - bool ok = true; - if(on) { - ok &= set_atr_mask (ENABLE); - ok &= set_atr_txval( 0); - ok &= set_atr_rxval(ENABLE); - } - else { - ok &= set_atr_mask (0); - ok &= set_atr_txval(0); - ok &= set_atr_rxval(0); - } - return true; -} - -bool -flexrf_base_rx::select_rx_antenna(int which_antenna) -{ - /* - Specify which antenna port to use for reception. - @param which_antenna: either 'TX/RX' or 'RX2' - */ - - if(which_antenna == 0) { - usrp()->write_io(d_which, 0,RX2_RX1N); - } - else if(which_antenna == 1) { - usrp()->write_io(d_which, RX2_RX1N, RX2_RX1N); - } - else { - return false; - // throw std::invalid_argument("which_antenna must be either 'TX/RX' or 'RX2'\n"); - } - return true; -} - -bool -flexrf_base_rx::select_rx_antenna(const std::string &which_antenna) -{ - /* - Specify which antenna port to use for reception. - @param which_antenna: either 'TX/RX' or 'RX2' - */ - - if(which_antenna == "TX/RX") { - usrp()->write_io(d_which, 0, RX2_RX1N); - } - else if(which_antenna == "RX2") { - usrp()->write_io(d_which, RX2_RX1N, RX2_RX1N); - } - else { - // throw std::invalid_argument("which_antenna must be either 'TX/RX' or 'RX2'\n"); - return false; - } - return true; -} - -bool -flexrf_base_rx::set_gain(float gain) -{ - /* - Set the gain. - - @param gain: gain in decibels - @returns True/False - */ - - // clamp gain - gain = std::max(gain_min(), std::min(gain, gain_max())); - - float pga_gain, agc_gain; - float V_maxgain, V_mingain, V_fullscale, dac_value; - - float maxgain = gain_max() - usrp()->pga_max(); - float mingain = gain_min(); - if(gain > maxgain) { - pga_gain = gain-maxgain; - assert(pga_gain <= usrp()->pga_max()); - agc_gain = maxgain; - } - else { - pga_gain = 0; - agc_gain = gain; - } - - V_maxgain = .2; - V_mingain = 1.2; - V_fullscale = 3.3; - dac_value = (agc_gain*(V_maxgain-V_mingain)/(maxgain-mingain) + V_mingain)*4096/V_fullscale; - - assert(dac_value>=0 && dac_value<4096); - - return (usrp()->write_aux_dac(d_which, 0, int(dac_value)) - && _set_pga(int(pga_gain))); -} - -// ---------------------------------------------------------------- - - -_AD4360_common::_AD4360_common() -{ - // R-Register Common Values - d_R_RSV = 0; // bits 23,22 - d_BSC = 3; // bits 21,20 Div by 8 to be safe - d_TEST = 0; // bit 19 - d_LDP = 1; // bit 18 - d_ABP = 0; // bit 17,16 3ns - - // N-Register Common Values - d_N_RSV = 0; // bit 7 - - // Control Register Common Values - d_PD = 0; // bits 21,20 Normal operation - d_PL = 0; // bits 13,12 11mA - d_MTLD = 1; // bit 11 enabled - d_CPG = 0; // bit 10 CP setting 1 - d_CP3S = 0; // bit 9 Normal - d_PDP = 1; // bit 8 Positive - d_MUXOUT = 1; // bits 7:5 Digital Lock Detect - d_CR = 0; // bit 4 Normal - d_PC = 1; // bits 3,2 Core power 10mA -} - -_AD4360_common::~_AD4360_common() -{ -} - -bool -_AD4360_common::_compute_regs(double refclk_freq, double freq, int &retR, - int &retcontrol, int &retN, double &retfreq) -{ - /* - Determine values of R, control, and N registers, along with actual freq. - - @param freq: target frequency in Hz - @type freq: float - @returns: (R, control, N, actual_freq) - @rtype: tuple(int, int, int, float) - */ - - // Band-specific N-Register Values - //float phdet_freq = _refclk_freq()/d_R_DIV; - double phdet_freq = refclk_freq/d_R_DIV; - double desired_n = round(freq*d_freq_mult/phdet_freq); - double actual_freq = desired_n * phdet_freq; - int B = floor(desired_n/_prescaler()); - int A = desired_n - _prescaler()*B; - d_B_DIV = int(B); // bits 20:8 - d_A_DIV = int(A); // bit 6:2 - - //assert db_B_DIV >= db_A_DIV - if(d_B_DIV < d_A_DIV) { - retR = 0; - retcontrol = 0; - retN = 0; - retfreq = 0; - return false; - } - - int R = (d_R_RSV<<22) | (d_BSC<<20) | (d_TEST<<19) | - (d_LDP<<18) | (d_ABP<<16) | (d_R_DIV<<2); - - int control = _compute_control_reg(); - - int N = (d_DIVSEL<<23) | (d_DIV2<<22) | (d_CPGAIN<<21) | - (d_B_DIV<<8) | (d_N_RSV<<7) | (d_A_DIV<<2); - - retR = R; - retcontrol = control; - retN = N; - retfreq = actual_freq/d_freq_mult; - return true; -} - -int -_AD4360_common::_compute_control_reg() -{ - int control = (d_P<<22) | (d_PD<<20) | (d_CP2<<17) | (d_CP1<<14) - | (d_PL<<12) | (d_MTLD<<11) | (d_CPG<<10) | (d_CP3S<<9) | (d_PDP<<8) - | (d_MUXOUT<<5) | (d_CR<<4) | (d_PC<<2); - - return control; -} - -int -_AD4360_common::_refclk_divisor() -{ - /* - Return value to stick in REFCLK_DIVISOR register - */ - return 1; -} - -int -_AD4360_common::_prescaler() -{ - if(d_P == 0) { - return 8; - } - else if(d_P == 1) { - return 16; - } - else { - return 32; - } -} - -//---------------------------------------------------------------------- - -_2200_common::_2200_common() - : _AD4360_common() -{ - // Band-specific R-Register Values - d_R_DIV = 16; // bits 15:2 - - // Band-specific C-Register values - d_P = 1; // bits 23,22 Div by 16/17 - d_CP2 = 7; // bits 19:17 - d_CP1 = 7; // bits 16:14 - - // Band specifc N-Register Values - d_DIVSEL = 0; // bit 23 - d_DIV2 = 0; // bit 22 - d_CPGAIN = 0; // bit 21 - d_freq_mult = 1; -} - -double -_2200_common::freq_min() -{ - return 2000e6; -} - -double -_2200_common::freq_max() -{ - return 2400e6; -} - -//---------------------------------------------------------------------- - -_2400_common::_2400_common() - : _AD4360_common() -{ - // Band-specific R-Register Values - d_R_DIV = 16; // bits 15:2 - - // Band-specific C-Register values - d_P = 1; // bits 23,22 Div by 16/17 - d_CP2 = 7; // bits 19:17 - d_CP1 = 7; // bits 16:14 - - // Band specifc N-Register Values - d_DIVSEL = 0; // bit 23 - d_DIV2 = 0; // bit 22 - d_CPGAIN = 0; // bit 21 - d_freq_mult = 1; -} - -double -_2400_common::freq_min() -{ - return 2300e6; -} - -double -_2400_common::freq_max() -{ - return 2900e6; -} - -//---------------------------------------------------------------------- - -_1200_common::_1200_common() - : _AD4360_common() -{ - // Band-specific R-Register Values - d_R_DIV = 16; // bits 15:2 DIV by 16 for a 1 MHz phase detector freq - - // Band-specific C-Register values - d_P = 1; // bits 23,22 Div by 16/17 - d_CP2 = 7; // bits 19:17 1.25 mA - d_CP1 = 7; // bits 16:14 1.25 mA - - // Band specifc N-Register Values - d_DIVSEL = 0; // bit 23 - d_DIV2 = 1; // bit 22 - d_CPGAIN = 0; // bit 21 - d_freq_mult = 2; -} - -double -_1200_common::freq_min() -{ - return 1150e6; -} - -double -_1200_common::freq_max() -{ - return 1450e6; -} - -//------------------------------------------------------------------------- - -_1800_common::_1800_common() - : _AD4360_common() -{ - // Band-specific R-Register Values - d_R_DIV = 16; // bits 15:2 DIV by 16 for a 1 MHz phase detector freq - - // Band-specific C-Register values - d_P = 1; // bits 23,22 Div by 16/17 - d_CP2 = 7; // bits 19:17 1.25 mA - d_CP1 = 7; // bits 16:14 1.25 mA - - // Band specifc N-Register Values - d_DIVSEL = 0; // bit 23 - d_DIV2 = 0; // bit 22 - d_freq_mult = 1; - d_CPGAIN = 0; // bit 21 -} - -double -_1800_common::freq_min() -{ - return 1500e6; -} - -double -_1800_common::freq_max() -{ - return 2100e6; -} - -//------------------------------------------------------------------------- - -_900_common::_900_common() - : _AD4360_common() -{ - // Band-specific R-Register Values - d_R_DIV = 16; // bits 15:2 DIV by 16 for a 1 MHz phase detector freq - - // Band-specific C-Register values - d_P = 1; // bits 23,22 Div by 16/17 - d_CP2 = 7; // bits 19:17 1.25 mA - d_CP1 = 7; // bits 16:14 1.25 mA - - // Band specifc N-Register Values - d_DIVSEL = 0; // bit 23 - d_DIV2 = 1; // bit 22 - d_freq_mult = 2; - d_CPGAIN = 0; // bit 21 -} - -double -_900_common::freq_min() -{ - return 750e6; -} - -double -_900_common::freq_max() -{ - return 1050e6; -} - -//------------------------------------------------------------------------- - -_400_common::_400_common() - : _AD4360_common() -{ - // Band-specific R-Register Values - d_R_DIV = 16; // bits 15:2 - - // Band-specific C-Register values - d_P = 0; // bits 23,22 Div by 8/9 - d_CP2 = 7; // bits 19:17 1.25 mA - d_CP1 = 7; // bits 16:14 1.25 mA - - // Band specifc N-Register Values These are different for TX/RX - d_DIVSEL = 0; // bit 23 - d_freq_mult = 2; - - d_CPGAIN = 0; // bit 21 -} - -double -_400_common::freq_min() -{ - return 400e6; -} - -double -_400_common::freq_max() -{ - return 500e6; -} - -_400_tx::_400_tx() - : _400_common() -{ - d_DIV2 = 1; // bit 22 -} - -_400_rx::_400_rx() - : _400_common() -{ - d_DIV2 = 0; // bit 22 // RX side has built-in DIV2 in AD8348 -} - -//------------------------------------------------------------ - -db_flexrf_2200_tx::db_flexrf_2200_tx(usrp_basic_sptr usrp, int which) - : flexrf_base_tx(usrp, which) -{ - d_common = new _2200_common(); -} - -db_flexrf_2200_tx::~db_flexrf_2200_tx() -{ -} - -bool -db_flexrf_2200_tx::_compute_regs(double freq, int &retR, int &retcontrol, - int &retN, double &retfreq) -{ - return d_common->_compute_regs(_refclk_freq(), freq, retR, - retcontrol, retN, retfreq); -} - - - -db_flexrf_2200_rx::db_flexrf_2200_rx(usrp_basic_sptr usrp, int which) - : flexrf_base_rx(usrp, which) -{ - d_common = new _2200_common(); - set_gain((gain_min() + gain_max()) / 2.0); // initialize gain -} - -db_flexrf_2200_rx::~db_flexrf_2200_rx() -{ -} - -float -db_flexrf_2200_rx::gain_min() -{ - return usrp()->pga_min(); -} - -float -db_flexrf_2200_rx::gain_max() -{ - return usrp()->pga_max()+70; -} - -float -db_flexrf_2200_rx::gain_db_per_step() -{ - return 0.05; -} - - -bool -db_flexrf_2200_rx::i_and_q_swapped() -{ - return true; -} - -bool -db_flexrf_2200_rx::_compute_regs(double freq, int &retR, int &retcontrol, - int &retN, double &retfreq) -{ - return d_common->_compute_regs(_refclk_freq(), freq, retR, - retcontrol, retN, retfreq); -} - -//------------------------------------------------------------ - -db_flexrf_2400_tx::db_flexrf_2400_tx(usrp_basic_sptr usrp, int which) - : flexrf_base_tx(usrp, which) -{ - d_common = new _2400_common(); -} - -db_flexrf_2400_tx::~db_flexrf_2400_tx() -{ -} - -bool -db_flexrf_2400_tx::_compute_regs(double freq, int &retR, int &retcontrol, - int &retN, double &retfreq) -{ - return d_common->_compute_regs(_refclk_freq(), freq, retR, - retcontrol, retN, retfreq); -} - - - -db_flexrf_2400_rx::db_flexrf_2400_rx(usrp_basic_sptr usrp, int which) - : flexrf_base_rx(usrp, which) -{ - d_common = new _2400_common(); - set_gain((gain_min() + gain_max()) / 2.0); // initialize gain -} - -db_flexrf_2400_rx::~db_flexrf_2400_rx() -{ -} - -float -db_flexrf_2400_rx::gain_min() -{ - return usrp()->pga_min(); -} - -float -db_flexrf_2400_rx::gain_max() -{ - return usrp()->pga_max()+70; -} - -float -db_flexrf_2400_rx::gain_db_per_step() -{ - return 0.05; -} - - -bool -db_flexrf_2400_rx::i_and_q_swapped() -{ - return true; -} - -bool -db_flexrf_2400_rx::_compute_regs(double freq, int &retR, int &retcontrol, - int &retN, double &retfreq) -{ - return d_common->_compute_regs(_refclk_freq(), freq, retR, - retcontrol, retN, retfreq); -} - -//------------------------------------------------------------ - - -db_flexrf_1200_tx::db_flexrf_1200_tx(usrp_basic_sptr usrp, int which) - : flexrf_base_tx(usrp, which) -{ - d_common = new _1200_common(); -} - -db_flexrf_1200_tx::~db_flexrf_1200_tx() -{ -} - -bool -db_flexrf_1200_tx::_compute_regs(double freq, int &retR, int &retcontrol, - int &retN, double &retfreq) -{ - return d_common->_compute_regs(_refclk_freq(), freq, retR, - retcontrol, retN, retfreq); -} - - - - -db_flexrf_1200_rx::db_flexrf_1200_rx(usrp_basic_sptr usrp, int which) - : flexrf_base_rx(usrp, which) -{ - d_common = new _1200_common(); - set_gain((gain_min() + gain_max()) / 2.0); // initialize gain -} - -db_flexrf_1200_rx::~db_flexrf_1200_rx() -{ -} - -float -db_flexrf_1200_rx::gain_min() -{ - return usrp()->pga_min(); -} - -float -db_flexrf_1200_rx::gain_max() -{ - return usrp()->pga_max()+70; -} - -float -db_flexrf_1200_rx::gain_db_per_step() -{ - return 0.05; -} - -bool -db_flexrf_1200_rx::i_and_q_swapped() -{ - return true; -} - -bool -db_flexrf_1200_rx::_compute_regs(double freq, int &retR, int &retcontrol, - int &retN, double &retfreq) -{ - return d_common->_compute_regs(_refclk_freq(), freq, retR, - retcontrol, retN, retfreq); -} - - -//------------------------------------------------------------ - - -db_flexrf_1800_tx::db_flexrf_1800_tx(usrp_basic_sptr usrp, int which) - : flexrf_base_tx(usrp, which) -{ - d_common = new _1800_common(); -} - -db_flexrf_1800_tx::~db_flexrf_1800_tx() -{ -} - -bool -db_flexrf_1800_tx::_compute_regs(double freq, int &retR, int &retcontrol, - int &retN, double &retfreq) -{ - return d_common->_compute_regs(_refclk_freq(), freq, retR, - retcontrol, retN, retfreq); -} - - - -db_flexrf_1800_rx::db_flexrf_1800_rx(usrp_basic_sptr usrp, int which) - : flexrf_base_rx(usrp, which) -{ - d_common = new _1800_common(); - set_gain((gain_min() + gain_max()) / 2.0); // initialize gain -} - -db_flexrf_1800_rx::~db_flexrf_1800_rx() -{ -} - - -float -db_flexrf_1800_rx::gain_min() -{ - return usrp()->pga_min(); -} - -float -db_flexrf_1800_rx::gain_max() -{ - return usrp()->pga_max()+70; -} - -float -db_flexrf_1800_rx::gain_db_per_step() -{ - return 0.05; -} - -bool -db_flexrf_1800_rx::i_and_q_swapped() -{ - return true; -} - -bool -db_flexrf_1800_rx::_compute_regs(double freq, int &retR, int &retcontrol, - int &retN, double &retfreq) -{ - return d_common->_compute_regs(_refclk_freq(), freq, retR, - retcontrol, retN, retfreq); -} - - -//------------------------------------------------------------ - - -db_flexrf_900_tx::db_flexrf_900_tx(usrp_basic_sptr usrp, int which) - : flexrf_base_tx(usrp, which) -{ - d_common = new _900_common(); -} - -db_flexrf_900_tx::~db_flexrf_900_tx() -{ -} - -bool -db_flexrf_900_tx::_compute_regs(double freq, int &retR, int &retcontrol, - int &retN, double &retfreq) -{ - return d_common->_compute_regs(_refclk_freq(), freq, retR, - retcontrol, retN, retfreq); -} - - -db_flexrf_900_rx::db_flexrf_900_rx(usrp_basic_sptr usrp, int which) - : flexrf_base_rx(usrp, which) -{ - d_common = new _900_common(); - set_gain((gain_min() + gain_max()) / 2.0); // initialize gain -} - -db_flexrf_900_rx::~db_flexrf_900_rx() -{ -} - -float -db_flexrf_900_rx::gain_min() -{ - return usrp()->pga_min(); -} - -float -db_flexrf_900_rx::gain_max() -{ - return usrp()->pga_max()+70; -} - -float -db_flexrf_900_rx::gain_db_per_step() -{ - return 0.05; -} - -bool -db_flexrf_900_rx::i_and_q_swapped() -{ - return true; -} - -bool -db_flexrf_900_rx::_compute_regs(double freq, int &retR, int &retcontrol, - int &retN, double &retfreq) -{ - return d_common->_compute_regs(_refclk_freq(), freq, retR, - retcontrol, retN, retfreq); -} - -//------------------------------------------------------------ - - -db_flexrf_400_tx::db_flexrf_400_tx(usrp_basic_sptr usrp, int which) - : flexrf_base_tx(usrp, which, POWER_UP) -{ - d_common = new _400_tx(); -} - -db_flexrf_400_tx::~db_flexrf_400_tx() -{ -} - -bool -db_flexrf_400_tx::_compute_regs(double freq, int &retR, int &retcontrol, - int &retN, double &retfreq) -{ - return d_common->_compute_regs(_refclk_freq(), freq, retR, - retcontrol, retN, retfreq); -} - - - -db_flexrf_400_rx::db_flexrf_400_rx(usrp_basic_sptr usrp, int which) - : flexrf_base_rx(usrp, which, POWER_UP) -{ - d_common = new _400_rx(); - set_gain((gain_min() + gain_max()) / 2.0); // initialize gain -} - -db_flexrf_400_rx::~db_flexrf_400_rx() -{ -} - -float -db_flexrf_400_rx::gain_min() -{ - return usrp()->pga_min(); -} - -float -db_flexrf_400_rx::gain_max() -{ - return usrp()->pga_max()+45; -} - -float - -db_flexrf_400_rx::gain_db_per_step() -{ - return 0.035; -} - - -bool -db_flexrf_400_rx::i_and_q_swapped() -{ - return true; -} - -bool -db_flexrf_400_rx::_compute_regs(double freq, int &retR, int &retcontrol, - int &retN, double &retfreq) -{ - return d_common->_compute_regs(_refclk_freq(), freq, retR, - retcontrol, retN, retfreq); -} - diff --git a/usrp/host/lib/db_flexrf_mimo.cc b/usrp/host/lib/db_flexrf_mimo.cc deleted file mode 100644 index 29bbbd58f..000000000 --- a/usrp/host/lib/db_flexrf_mimo.cc +++ /dev/null @@ -1,280 +0,0 @@ -/* - * Copyright 2008,2009 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <usrp/db_flexrf_mimo.h> -#include <fpga_regs_standard.h> -#include <fpga_regs_common.h> -#include <usrp/usrp_prims.h> -#include <usrp_spi_defs.h> - - -db_flexrf_2400_tx_mimo_a::db_flexrf_2400_tx_mimo_a(usrp_basic_sptr usrp, int which) - : db_flexrf_2400_tx(usrp, which) -{ - _enable_refclk(true); - d_common->R_DIV(1); -} - -int -db_flexrf_2400_tx_mimo_a::_refclk_divisor() -{ - return 16; -} - -db_flexrf_2400_rx_mimo_a::db_flexrf_2400_rx_mimo_a(usrp_basic_sptr usrp, int which) - : db_flexrf_2400_rx(usrp, which) -{ - _enable_refclk(true); - d_common->R_DIV(1); -} - -int -db_flexrf_2400_rx_mimo_a::_refclk_divisor() -{ - return 16; -} - -db_flexrf_2400_tx_mimo_b::db_flexrf_2400_tx_mimo_b(usrp_basic_sptr usrp, int which) - : db_flexrf_2400_tx(usrp, which) -{ - d_common->R_DIV(16); -} - -int -db_flexrf_2400_tx_mimo_b::_refclk_divisor() -{ - return 1; -} - -db_flexrf_2400_rx_mimo_b::db_flexrf_2400_rx_mimo_b(usrp_basic_sptr usrp, int which) - : db_flexrf_2400_rx(usrp, which) -{ - d_common->R_DIV(16); -} - -int -db_flexrf_2400_rx_mimo_b::_refclk_divisor() -{ - return 1; -} - -db_flexrf_1800_tx_mimo_a::db_flexrf_1800_tx_mimo_a(usrp_basic_sptr usrp, int which) - : db_flexrf_1800_tx(usrp, which) -{ - _enable_refclk(true); - d_common->R_DIV(1); -} - -int -db_flexrf_1800_tx_mimo_a::_refclk_divisor() -{ - return 16; -} - -db_flexrf_1800_rx_mimo_a::db_flexrf_1800_rx_mimo_a(usrp_basic_sptr usrp, int which) - : db_flexrf_1800_rx(usrp, which) -{ - _enable_refclk(true); - d_common->R_DIV(1); -} - -int -db_flexrf_1800_rx_mimo_a::_refclk_divisor() -{ - return 16; -} - -db_flexrf_1800_tx_mimo_b::db_flexrf_1800_tx_mimo_b(usrp_basic_sptr usrp, int which) - : db_flexrf_1800_tx(usrp, which) -{ - d_common->R_DIV(16); -} - -int -db_flexrf_1800_tx_mimo_b::_refclk_divisor() -{ - return 1; -} - -db_flexrf_1800_rx_mimo_b::db_flexrf_1800_rx_mimo_b(usrp_basic_sptr usrp, int which) - : db_flexrf_1800_rx(usrp, which) -{ - d_common->R_DIV(16); -} - -int -db_flexrf_1800_rx_mimo_b::_refclk_divisor() -{ - return 1; -} - -db_flexrf_1200_tx_mimo_a::db_flexrf_1200_tx_mimo_a(usrp_basic_sptr usrp, int which) - : db_flexrf_1200_tx(usrp, which) -{ - _enable_refclk(true); - d_common->R_DIV(1); -} - -int -db_flexrf_1200_tx_mimo_a::_refclk_divisor() -{ - return 16; -} - -db_flexrf_1200_rx_mimo_a::db_flexrf_1200_rx_mimo_a(usrp_basic_sptr usrp, int which) - : db_flexrf_1200_rx(usrp, which) -{ - _enable_refclk(true); - d_common->R_DIV(1); -} - -int -db_flexrf_1200_rx_mimo_a::_refclk_divisor() -{ - return 16; -} - -db_flexrf_1200_tx_mimo_b::db_flexrf_1200_tx_mimo_b(usrp_basic_sptr usrp, int which) - : db_flexrf_1200_tx(usrp, which) -{ - d_common->R_DIV(16); -} - -int -db_flexrf_1200_tx_mimo_b::_refclk_divisor() -{ - return 1; -} - -db_flexrf_1200_rx_mimo_b::db_flexrf_1200_rx_mimo_b(usrp_basic_sptr usrp, int which) - : db_flexrf_1200_rx(usrp, which) -{ - d_common->R_DIV(16); -} - -int -db_flexrf_1200_rx_mimo_b::_refclk_divisor() -{ - return 1; -} - -db_flexrf_900_tx_mimo_a::db_flexrf_900_tx_mimo_a(usrp_basic_sptr usrp, int which) - : db_flexrf_900_tx(usrp, which) -{ - _enable_refclk(true); - d_common->R_DIV(1); -} - -int -db_flexrf_900_tx_mimo_a::_refclk_divisor() -{ - return 16; -} - -db_flexrf_900_rx_mimo_a::db_flexrf_900_rx_mimo_a(usrp_basic_sptr usrp, int which) - : db_flexrf_900_rx(usrp, which) -{ - _enable_refclk(true); - d_common->R_DIV(1); -} - -int -db_flexrf_900_rx_mimo_a::_refclk_divisor() -{ - return 16; -} - -db_flexrf_900_tx_mimo_b::db_flexrf_900_tx_mimo_b(usrp_basic_sptr usrp, int which) - : db_flexrf_900_tx(usrp, which) -{ - d_common->R_DIV(16); -} - -int -db_flexrf_900_tx_mimo_b::_refclk_divisor() -{ - return 1; -} - -db_flexrf_900_rx_mimo_b::db_flexrf_900_rx_mimo_b(usrp_basic_sptr usrp, int which) - : db_flexrf_900_rx(usrp, which) -{ - d_common->R_DIV(16); -} - -int db_flexrf_900_rx_mimo_b::_refclk_divisor() -{ - return 1; -} - -db_flexrf_400_tx_mimo_a::db_flexrf_400_tx_mimo_a(usrp_basic_sptr usrp, int which) - : db_flexrf_400_tx(usrp, which) -{ - _enable_refclk(true); - d_common->R_DIV(1); -} - -int -db_flexrf_400_tx_mimo_a::_refclk_divisor() -{ - return 16; -} - -db_flexrf_400_rx_mimo_a::db_flexrf_400_rx_mimo_a(usrp_basic_sptr usrp, int which) - : db_flexrf_400_rx(usrp, which) -{ - _enable_refclk(true); - d_common->R_DIV(1); -} - -int -db_flexrf_400_rx_mimo_a::_refclk_divisor() -{ - return 16; -} - -db_flexrf_400_tx_mimo_b::db_flexrf_400_tx_mimo_b(usrp_basic_sptr usrp, int which) - : db_flexrf_400_tx(usrp, which) -{ - d_common->R_DIV(16); -} - -int -db_flexrf_400_tx_mimo_b::_refclk_divisor() -{ - return 1; -} - -db_flexrf_400_rx_mimo_b::db_flexrf_400_rx_mimo_b(usrp_basic_sptr usrp, int which) - : db_flexrf_400_rx(usrp, which) -{ - d_common->R_DIV(16); -} - -int -db_flexrf_400_rx_mimo_b::_refclk_divisor() -{ - return 1; -} diff --git a/usrp/host/lib/db_tv_rx.cc b/usrp/host/lib/db_tv_rx.cc deleted file mode 100644 index 1822479e1..000000000 --- a/usrp/host/lib/db_tv_rx.cc +++ /dev/null @@ -1,278 +0,0 @@ -// -// Copyright 2008,2009 Free Software Foundation, Inc. -// -// This file is part of GNU Radio -// -// GNU Radio is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either asversion 3, or (at your option) -// any later version. -// -// GNU Radio is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with GNU Radio; see the file COPYING. If not, write to -// the Free Software Foundation, Inc., 51 Franklin Street, -// Boston, MA 02110-1301, USA. - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <usrp/db_tv_rx.h> -#include <db_base_impl.h> - -/*****************************************************************************/ - -int -control_byte_1(bool fast_tuning_p, int reference_divisor) -{ - int c = 0x88; - if(fast_tuning_p) { - c |= 0x40; - } - - if(reference_divisor == 512) { - c |= 0x3 << 1; - } - else if(reference_divisor == 640) { - c |= 0x0 << 1; - } - else if(reference_divisor == 1024) { - c |= 0x1 << 1; - } - else { - assert(0); - } - - return c; -} - -int -control_byte_2(double target_freq, bool shutdown_tx_PGA) -{ - int c; - if(target_freq < 158e6) { // VHF low - c = 0xa0; - } - else if(target_freq < 464e6) { // VHF high - c = 0x90; - } - else { // UHF - c = 0x30; - } - - if(shutdown_tx_PGA) { - c |= 0x08; - } - - return c; -} - - -/*****************************************************************************/ - - -db_tv_rx::db_tv_rx(usrp_basic_sptr usrp, int which, - double first_IF, double second_IF) - : db_base(usrp, which) -{ - // Handler for Tv Rx daughterboards. - // - // @param usrp: instance of usrp.source_c - // @param which: which side: 0, 1 corresponding to RX_A or RX_B respectively - - if(which == 0) { - d_i2c_addr = 0x60; - } - else { - d_i2c_addr = 0x61; - } - - d_first_IF = first_IF; - d_second_IF = second_IF; - d_reference_divisor = 640; - d_fast_tuning = false; - d_inverted = false; // FIXME get rid of this - - set_gain((gain_min() + gain_max()) / 2.0); // initialize gain - - bypass_adc_buffers(false); -} - -db_tv_rx::~db_tv_rx() -{ -} - -// Gain setting -void -db_tv_rx::_set_rfagc(float gain) -{ - float voltage; - - assert(gain <= 60 && gain >= 0); - // FIXME this has a 0.5V step between gain = 60 and gain = 59. - // Why are there two cases instead of a single linear case? - if(gain == 60) { - voltage = 4; - } - else { - voltage = gain/60.0 * 2.25 + 1.25; - } - int dacword = int(4096*voltage/1.22/3.3); // 1.22 = opamp gain - - assert(dacword>=0 && dacword<4096); - usrp()->write_aux_dac(d_which, 1, dacword); -} - -void -db_tv_rx::_set_ifagc(float gain) -{ - float voltage; - - assert(gain <= 35 && gain >= 0); - voltage = gain/35.0 * 2.1 + 1.4; - int dacword = int(4096*voltage/1.22/3.3); // 1.22 = opamp gain - - assert(dacword>=0 && dacword<4096); - usrp()->write_aux_dac(d_which, 0, dacword); -} - -void -db_tv_rx::_set_pga(float pga_gain) -{ - assert(pga_gain >=0 && pga_gain <=20); - if(d_which == 0) { - usrp()->set_pga(0, pga_gain); - } - else { - usrp()->set_pga (2, pga_gain); - } -} - -double -db_tv_rx::freq_min() -{ - return 50e6; -} - -double -db_tv_rx::freq_max() -{ - return 860e6; -} - -struct freq_result_t -db_tv_rx::set_freq(double target_freq) -{ - // Set the frequency. - // - // @param freq: target RF frequency in Hz - // @type freq: double - // - // @returns (ok, actual_baseband_freq) where: - // ok is True or False and indicates success or failure, - // actual_baseband_freq is RF frequency that corresponds to DC in the IF. - - freq_result_t args = {false, 0}; - - double fmin = freq_min(); - double fmax = freq_max(); - if((target_freq < fmin) || (target_freq > fmax)) { - return args; - } - - double target_lo_freq = target_freq + d_first_IF; // High side mixing - double f_ref = 4.0e6 / (double)(d_reference_divisor); // frequency steps - - int divisor = int((target_lo_freq + (f_ref * 4)) / (f_ref * 8)); - double actual_lo_freq = (f_ref * 8 * divisor); - double actual_freq = actual_lo_freq - d_first_IF; - - if((divisor & ~0x7fff) != 0) { // must be 15-bits or less - return args; - } - - // build i2c command string - std::vector<int> buf(4); - buf[0] = (divisor >> 8) & 0xff; // DB1 - buf[1] = divisor & 0xff; // DB2 - buf[2] = control_byte_1(d_fast_tuning, d_reference_divisor); - buf[3] = control_byte_2(actual_freq, true); - - args.ok = usrp()->write_i2c(d_i2c_addr, int_seq_to_str (buf)); - args.baseband_freq = actual_freq - d_second_IF; - return args; -} - -float -db_tv_rx::gain_min() -{ - return 0; -} - -float -db_tv_rx::gain_max() -{ - return 115; -} - -float -db_tv_rx::gain_db_per_step() -{ - return 1; -} - -bool -db_tv_rx::set_gain(float gain) -{ - // Set the gain. - // - // @param gain: gain in decibels - // @returns True/False - - float rfgain, ifgain, pgagain; - - assert(gain>=0 && gain<=115); - if(gain>60) { - rfgain = 60; - gain = gain - 60; - } - else { - rfgain = gain; - gain = 0; - } - - if(gain > 35) { - ifgain = 35; - gain = gain - 35; - } - else { - ifgain = gain; - gain = 0; - } - - pgagain = gain; - _set_rfagc(rfgain); - _set_ifagc(ifgain); - _set_pga(pgagain); - - return true; -} - -bool -db_tv_rx::is_quadrature() -{ - // Return True if this board requires both I & Q analog channels. - return false; -} - -bool -db_tv_rx::spectrum_inverted() -{ - // The 43.75 MHz version is inverted - return d_inverted; -} diff --git a/usrp/host/lib/db_tv_rx_mimo.cc b/usrp/host/lib/db_tv_rx_mimo.cc deleted file mode 100644 index 0964c5d8b..000000000 --- a/usrp/host/lib/db_tv_rx_mimo.cc +++ /dev/null @@ -1,39 +0,0 @@ -// -// Copyright 2008,2009 Free Software Foundation, Inc. -// -// This file is part of GNU Radio -// -// GNU Radio is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either asversion 3, or (at your option) -// any later version. -// -// GNU Radio is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with GNU Radio; see the file COPYING. If not, write to -// the Free Software Foundation, Inc., 51 Franklin Street, -// Boston, MA 02110-1301, USA. - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <usrp/db_tv_rx_mimo.h> - -db_tv_rx_mimo::db_tv_rx_mimo(usrp_basic_sptr usrp, int which, - double first_IF, double second_IF) - : db_tv_rx(usrp, which,first_IF,second_IF) -{ - _enable_refclk(true);//enable FPGA refclock output on gpio 0 -} - -int -db_tv_rx_mimo::_refclk_divisor() -{ - return 16;// 64/16=> 4 Mhz refclock -} - diff --git a/usrp/host/lib/db_util.cc b/usrp/host/lib/db_util.cc deleted file mode 100644 index 4b46383bb..000000000 --- a/usrp/host/lib/db_util.cc +++ /dev/null @@ -1,54 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2008 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif -#include <db_util.h> -#include <sstream> - -std::string -int_seq_to_str(std::vector<int> &seq) -{ - //convert a sequence of integers into a string - - std::stringstream str; - std::vector<int>::iterator i; - for(i = seq.begin(); i != seq.end(); i++) { - str << char((unsigned int)*i); - } - return str.str(); -} - -std::vector<int> -str_to_int_seq(std::string str) -{ - //convert a string to a list of integers - std::vector<int> seq; - std::vector<int>::iterator sitr; - std::string::iterator i; - for(i=str.begin(); i != str.end(); i++) { - int a = (int)(*i); - seq.push_back(a); - } - return seq; -} - diff --git a/usrp/host/lib/db_util.h b/usrp/host/lib/db_util.h deleted file mode 100644 index e07abb608..000000000 --- a/usrp/host/lib/db_util.h +++ /dev/null @@ -1,31 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2008 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#ifndef INCLUDED_DB_UTIL_H -#define INCLUDED_DB_UTIL_H - -#include <string> -#include <vector> - -std::string int_seq_to_str(std::vector<int> &seq); -std::vector<int> str_to_int_seq(std::string str); - -#endif /* INCLUDED_DB_UTIL_H */ diff --git a/usrp/host/lib/db_wbxng.cc b/usrp/host/lib/db_wbxng.cc deleted file mode 100644 index 4d17c72d1..000000000 --- a/usrp/host/lib/db_wbxng.cc +++ /dev/null @@ -1,538 +0,0 @@ -// -// Copyright 2008,2009 Free Software Foundation, Inc. -// -// This file is part of GNU Radio -// -// GNU Radio is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either asversion 3, or (at your option) -// any later version. -// -// GNU Radio is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with GNU Radio; see the file COPYING. If not, write to -// the Free Software Foundation, Inc., 51 Franklin Street, -// Boston, MA 02110-1301, USA. - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <usrp/db_wbxng.h> -#include "db_wbxng_adf4350.h" -#include <db_base_impl.h> -#include <stdio.h> -#ifdef HAVE_TIME_H -#include <ctime> -#endif - -// d'board i/o pin defs -// Tx and Rx have shared defs, but different i/o regs -#define ENABLE_5 (1 << 7) // enables 5.0V power supply -#define ENABLE_33 (1 << 6) // enables 3.3V supply -//#define RX_TXN (1 << 15) // Tx only: T/R antenna switch for TX/RX port -//#define RX2_RX1N (1 << 15) // Rx only: antenna switch between RX2 and TX/RX port -#define RX_TXN ((1 << 5)|(1 << 15)) // Tx only: T/R antenna switch for TX/RX port -#define RX2_RX1N ((1 << 5)|(1 << 15)) // Rx only: antenna switch between RX2 and TX/RX port -#define RXBB_EN (1 << 4) -#define TXMOD_EN (1 << 4) -#define PLL_CE (1 << 3) -#define PLL_PDBRF (1 << 2) -#define PLL_MUXOUT (1 << 1) -#define PLL_LOCK_DETECT (1 << 0) - -// RX Attenuator constants -#define ATTN_SHIFT 8 -#define ATTN_MASK (63 << ATTN_SHIFT) - -wbxng_base::wbxng_base(usrp_basic_sptr _usrp, int which) - : db_base(_usrp, which) -{ - /* - @param usrp: instance of usrp.source_c - @param which: which side: 0 or 1 corresponding to side A or B respectively - @type which: int - */ - - usrp()->_write_oe(d_which, 0, 0xffff); // turn off all outputs - - d_first = true; - d_spi_format = SPI_FMT_MSB | SPI_FMT_HDR_0; - - _enable_refclk(false); // disable refclk - - set_auto_tr(false); -} - -wbxng_base::~wbxng_base() -{ -} - -int -wbxng_base::_refclk_divisor() -{ - return 1; -} - -struct freq_result_t -wbxng_base::set_freq(double freq) -{ - /* - @returns (ok, actual_baseband_freq) where: - ok is True or False and indicates success or failure, - actual_baseband_freq is the RF frequency that corresponds to DC in the IF. - */ - - // clamp freq - freq_t int_freq = freq_t(std::max(freq_min(), std::min(freq, freq_max()))); - - bool ok = d_common->_set_freq(int_freq*2, _refclk_freq()); - - _write_spi(d_common->compute_register(5)); - _write_spi(d_common->compute_register(4)); - _write_spi(d_common->compute_register(3)); - /* load involved registers */ - _write_spi(d_common->compute_register(2)); - _write_spi(d_common->compute_register(1)); - _write_spi(d_common->compute_register(0)); - - double freq_result = (double) d_common->_get_freq(_refclk_freq())/2.0; - - //ok &= _get_locked(); - struct freq_result_t args = {ok, freq_result}; - - /* Wait before reading Lock Detect*/ - timespec t; - t.tv_sec = 0; - t.tv_nsec = 10000000; - nanosleep(&t, NULL); - - //fprintf(stderr,"Setting WBXNG frequency, requested %d, obtained %f, lock_detect %d\n", - // int_freq, freq_result, d_common->_get_locked()); - - // FIXME - // Offsetting the LO helps get the Tx carrier leakage out of the way. - // This also ensures that on Rx, we're not getting hosed by the - // FPGA's DC removal loop's time constant. We were seeing a - // problem when running with discontinuous transmission. - // Offsetting the LO made the problem go away. - //freq += d_lo_offset; - - return args; -} - -bool -wbxng_base::_set_pga(float pga_gain) -{ - if(d_which == 0) { - usrp()->set_pga(0, pga_gain); - usrp()->set_pga(1, pga_gain); - } - else { - usrp()->set_pga(2, pga_gain); - usrp()->set_pga(3, pga_gain); - } - return true; -} - -bool -wbxng_base::is_quadrature() -{ - /* - Return True if this board requires both I & Q analog channels. - - This bit of info is useful when setting up the USRP Rx mux register. - */ - return true; -} - -double -wbxng_base::freq_min() -{ - return (double) d_common->_get_min_freq()/2.0; -} - -double -wbxng_base::freq_max() -{ - return (double) d_common->_get_max_freq()/2.0; -} - -bool -wbxng_base::_get_locked(void) -{ - return usrp()->read_io(d_which) & PLL_LOCK_DETECT; -} - -void -wbxng_base::_write_spi(std::string data) -{ - usrp()->_write_spi(0, d_spi_enable, d_spi_format, data); -} - -// ---------------------------------------------------------------- - -db_wbxng_tx::db_wbxng_tx(usrp_basic_sptr _usrp, int which) - : wbxng_base(_usrp, which) -{ - /* - @param usrp: instance of usrp.sink_c - @param which: 0 or 1 corresponding to side TX_A or TX_B respectively. - */ - - if(which == 0) { - d_spi_enable = SPI_ENABLE_TX_A; - } - else { - d_spi_enable = SPI_ENABLE_TX_B; - } - - d_common = boost::shared_ptr<adf4350> (new adf4350()); - - /* Initialize the registers. */ - _write_spi(d_common->compute_register(5)); - _write_spi(d_common->compute_register(4)); - _write_spi(d_common->compute_register(3)); - _write_spi(d_common->compute_register(2)); - _write_spi(d_common->compute_register(1)); - _write_spi(d_common->compute_register(0)); - - // power up the transmit side, but don't enable the mixer - usrp()->_write_oe(d_which,(PLL_CE|PLL_PDBRF|RX_TXN|TXMOD_EN|ENABLE_33|ENABLE_5), (PLL_CE|PLL_PDBRF|RX_TXN|TXMOD_EN|ENABLE_33|ENABLE_5)); - usrp()->write_io(d_which, (PLL_CE|RX_TXN|ENABLE_33|ENABLE_5), (PLL_CE|PLL_PDBRF|RX_TXN|ENABLE_33|ENABLE_5)); - //set_lo_offset(4e6); - - // Disable VCO/PLL - //d_common->_enable(true); - usrp()->write_io(d_which, (PLL_PDBRF), (PLL_PDBRF)); - - set_gain(gain_min()); // initialize gain -} - -db_wbxng_tx::~db_wbxng_tx() -{ - shutdown(); -} - -void -db_wbxng_tx::shutdown() -{ - // fprintf(stderr, "db_wbxng_tx::shutdown d_is_shutdown = %d\n", d_is_shutdown); - - if (!d_is_shutdown){ - d_is_shutdown = true; - // do whatever there is to do to shutdown - - // Disable VCO/PLL - //d_common->_enable(false); - usrp()->write_io(d_which, 0, (PLL_PDBRF)); - - // Power down and leave the T/R switch in the R position - usrp()->write_io(d_which, (RX_TXN), (PLL_CE|PLL_PDBRF|RX_TXN|ENABLE_33|ENABLE_5)); - - /* - _write_control(_compute_control_reg()); - */ - _enable_refclk(false); // turn off refclk - set_auto_tr(false); - } -} - -bool -db_wbxng_tx::set_auto_tr(bool on) -{ - bool ok = true; - if(on) { - ok &= set_atr_mask (RX_TXN | TXMOD_EN); - ok &= set_atr_txval(0 | TXMOD_EN); - ok &= set_atr_rxval(RX_TXN); - } - else { - ok &= set_atr_mask (0); - ok &= set_atr_txval(0); - ok &= set_atr_rxval(0); - } - return ok; -} - -bool -db_wbxng_tx::set_enable(bool on) -{ - /* - Enable transmitter if on is true - */ - - int v; - int mask = RX_TXN | TXMOD_EN; - if(on) { - v = TXMOD_EN; - // Enable VCO/PLL - //d_common->_enable(true); - } - else { - v = RX_TXN; - // Disable VCO/PLL - //d_common->_enable(false); - } - return usrp()->write_io(d_which, v, mask); -} - -float -db_wbxng_tx::gain_min() -{ - return 0.0; -} - -float -db_wbxng_tx::gain_max() -{ - return 25.0; -} - -float -db_wbxng_tx::gain_db_per_step() -{ - return gain_max()/(1+(1.4-0.5)*4096/3.3); -} - -bool -db_wbxng_tx::set_gain(float gain) -{ - /* - Set the gain. - - @param gain: gain in decibels - @returns True/False - */ - - // clamp gain - gain = std::max(gain_min(), std::min(gain, gain_max())); - - float pga_gain, agc_gain; - float V_maxgain, V_mingain, V_fullscale, dac_value; - - float maxgain = gain_max(); - float mingain = gain_min(); - pga_gain = 0; - agc_gain = gain; - - V_maxgain = 0.5; - V_mingain = 1.4; - V_fullscale = 3.3; - dac_value = (agc_gain*(V_maxgain-V_mingain)/(maxgain-mingain) + V_mingain)*4096/V_fullscale; - - //fprintf(stderr, "TXGAIN: %f dB, Dac Code: %d, Voltage: %f\n", gain, int(dac_value), float((dac_value/4096.0)*V_fullscale)); - assert(dac_value>=0 && dac_value<4096); - - return (usrp()->write_aux_dac(d_which, 0, int(dac_value)) - && _set_pga(usrp()->pga_max())); - -} - - -/**************************************************************************/ - - -db_wbxng_rx::db_wbxng_rx(usrp_basic_sptr _usrp, int which) - : wbxng_base(_usrp, which) -{ - /* - @param usrp: instance of usrp.source_c - @param which: 0 or 1 corresponding to side RX_A or RX_B respectively. - */ - - if(which == 0) { - d_spi_enable = SPI_ENABLE_RX_A; - } - else { - d_spi_enable = SPI_ENABLE_RX_B; - } - - d_common = boost::shared_ptr<adf4350> (new adf4350()); - - /* Initialize the registers. */ - _write_spi(d_common->compute_register(5)); - _write_spi(d_common->compute_register(4)); - _write_spi(d_common->compute_register(3)); - _write_spi(d_common->compute_register(2)); - _write_spi(d_common->compute_register(1)); - _write_spi(d_common->compute_register(0)); - - usrp()->_write_oe(d_which, (PLL_CE|PLL_PDBRF|RX2_RX1N|RXBB_EN|ATTN_MASK|ENABLE_33|ENABLE_5), (PLL_CE|PLL_PDBRF|RX2_RX1N|RXBB_EN|ATTN_MASK|ENABLE_33|ENABLE_5)); - usrp()->write_io(d_which, (PLL_CE|RX2_RX1N|RXBB_EN|ENABLE_33|ENABLE_5), (PLL_CE|PLL_PDBRF|RX2_RX1N|RXBB_EN|ATTN_MASK|ENABLE_33|ENABLE_5)); - //fprintf(stderr,"Setting WBXNG RXBB on"); - - // Enable VCO/PLL - //d_common->_enable(true); - usrp()->write_io(d_which, (PLL_PDBRF), (PLL_PDBRF)); - - // set up for RX on TX/RX port - select_rx_antenna("TX/RX"); - - bypass_adc_buffers(true); - - /* - set_lo_offset(-4e6); - */ - - set_gain(gain_min()); // initialize gain -} - -db_wbxng_rx::~db_wbxng_rx() -{ - shutdown(); -} - -void -db_wbxng_rx::shutdown() -{ - // fprintf(stderr, "db_wbxng_rx::shutdown d_is_shutdown = %d\n", d_is_shutdown); - - if (!d_is_shutdown){ - d_is_shutdown = true; - // do whatever there is to do to shutdown - - // Power down VCO/PLL - //d_common->_enable(false); - usrp()->write_io(d_which, 0, (PLL_PDBRF)); - - // fprintf(stderr, "db_wbxng_rx::shutdown before _write_control\n"); - //_write_control(_compute_control_reg()); - - // fprintf(stderr, "db_wbxng_rx::shutdown before _enable_refclk\n"); - _enable_refclk(false); // turn off refclk - - // fprintf(stderr, "db_wbxng_rx::shutdown before set_auto_tr\n"); - set_auto_tr(false); - - // Power down - usrp()->write_io(d_which, 0, (PLL_CE|PLL_PDBRF|RX2_RX1N|RXBB_EN|ATTN_MASK|ENABLE_33|ENABLE_5)); - - // fprintf(stderr, "db_wbxng_rx::shutdown after set_auto_tr\n"); - } -} - -bool -db_wbxng_rx::set_auto_tr(bool on) -{ - bool ok = true; - if(on) { - ok &= set_atr_mask (RXBB_EN|RX2_RX1N); - ok &= set_atr_txval( 0|RX2_RX1N); - ok &= set_atr_rxval(RXBB_EN| 0); - } - else { - ok &= set_atr_mask (0); - ok &= set_atr_txval(0); - ok &= set_atr_rxval(0); - } - return true; -} - -bool -db_wbxng_rx::select_rx_antenna(int which_antenna) -{ - /* - Specify which antenna port to use for reception. - @param which_antenna: either 'TX/RX' or 'RX2' - */ - - if(which_antenna == 0) { - usrp()->write_io(d_which, 0,RX2_RX1N); - } - else if(which_antenna == 1) { - usrp()->write_io(d_which, RX2_RX1N, RX2_RX1N); - } - else { - return false; - } - return true; -} - -bool -db_wbxng_rx::select_rx_antenna(const std::string &which_antenna) -{ - /* - Specify which antenna port to use for reception. - @param which_antenna: either 'TX/RX' or 'RX2' - */ - - - if(which_antenna == "TX/RX") { - usrp()->write_io(d_which, 0, RX2_RX1N); - } - else if(which_antenna == "RX2") { - usrp()->write_io(d_which, RX2_RX1N, RX2_RX1N); - } - else { - return false; - } - - return true; -} - -bool -db_wbxng_rx::set_gain(float gain) -{ - /* - Set the gain. - - @param gain: gain in decibels - @returns True/False - */ - - // clamp gain - gain = std::max(gain_min(), std::min(gain, gain_max())); - - float pga_gain, agc_gain; - - float maxgain = gain_max() - usrp()->pga_max(); - if(gain > maxgain) { - pga_gain = gain-maxgain; - assert(pga_gain <= usrp()->pga_max()); - agc_gain = maxgain; - } - else { - pga_gain = 0; - agc_gain = gain; - } - - return _set_attn(maxgain-agc_gain) && _set_pga(int(pga_gain)); -} - -bool -db_wbxng_rx::_set_attn(float attn) -{ - int attn_code = int(floor(attn/0.5)); - unsigned int iobits = (~attn_code) << ATTN_SHIFT; - //fprintf(stderr, "Attenuation: %f dB, Code: %d, IO Bits %x, Mask: %x \n", attn, attn_code, iobits & ATTN_MASK, ATTN_MASK); - return usrp()->write_io(d_which, iobits, ATTN_MASK); -} - -float -db_wbxng_rx::gain_min() -{ - return usrp()->pga_min(); -} - -float -db_wbxng_rx::gain_max() -{ - return usrp()->pga_max()+30.5; -} - -float -db_wbxng_rx::gain_db_per_step() -{ - return 0.05; -} - -bool -db_wbxng_rx::i_and_q_swapped() -{ - return false; -} diff --git a/usrp/host/lib/db_wbxng_adf4350.cc b/usrp/host/lib/db_wbxng_adf4350.cc deleted file mode 100644 index f1ab63d82..000000000 --- a/usrp/host/lib/db_wbxng_adf4350.cc +++ /dev/null @@ -1,148 +0,0 @@ -// -// Copyright 2009 Free Software Foundation, Inc. -// -// This file is part of GNU Radio -// -// GNU Radio is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either asversion 3, or (at your option) -// any later version. -// -// GNU Radio is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with GNU Radio; see the file COPYING. If not, write to -// the Free Software Foundation, Inc., 51 Franklin Street, -// Boston, MA 02110-1301, USA. - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include "db_wbxng_adf4350.h" -#include <db_base_impl.h> -#include <stdio.h> - -#define FREQ_C(freq) uint64_t(freq) -#define DIV_ROUND(num, denom) (((num) + ((denom)/2))/(denom)) -#define MIN_INT_DIV uint16_t(23) /* minimum int divider, prescaler 4/5 only */ -#define MAX_RF_DIV uint8_t(16) /* max rf divider, divides rf output */ -#define MIN_VCO_FREQ FREQ_C(2.2e9) /* minimum vco freq */ -#define MAX_VCO_FREQ FREQ_C(4.4e9) /* minimum vco freq */ -#define MAX_FREQ DIV_ROUND(MAX_VCO_FREQ, 1) /* upper bound freq (rf div = 1) */ -#define MIN_FREQ DIV_ROUND(MIN_VCO_FREQ, MAX_RF_DIV) /* calculated lower bound freq */ - -#define CE_PIN (1 << 3) -#define PDB_RF_PIN (1 << 2) -#define MUX_PIN (1 << 1) -#define LD_PIN (1 << 0) - -adf4350::adf4350() -{ - d_regs = new adf4350_regs(); -} - -adf4350::~adf4350() -{ - delete d_regs; -} - -std::string -adf4350::compute_register(uint8_t addr) -{ - uint32_t data = d_regs->compute_register(addr); - - data |= addr; - - // create std::string from data here - char s[4]; - s[0] = (char)((data >> 24) & 0xff); - s[1] = (char)((data >> 16) & 0xff); - s[2] = (char)((data >> 8) & 0xff); - s[3] = (char)(data & 0xff); - return std::string(s, 4); -} - -freq_t -adf4350::_get_max_freq(void) -{ - return MAX_FREQ; -} - -freq_t -adf4350::_get_min_freq(void) -{ - return MIN_FREQ; -} - -bool -adf4350::_set_freq(freq_t freq, freq_t refclock_freq) -{ - /* Set the frequency by setting int, frac, mod, r, div */ - if (freq > MAX_FREQ || freq < MIN_FREQ) return false; - int min_int_div = 23; - d_regs->d_prescaler = 0; - if (freq > FREQ_C(3e9)) { - min_int_div = 75; - d_regs->d_prescaler = 1; - } - /* Ramp up the RF divider until the VCO is within range. */ - d_regs->d_divider_select = 0; - while (freq < MIN_VCO_FREQ){ - freq <<= 1; //double the freq - d_regs->d_divider_select++; //double the divider - } - /* Ramp up the R divider until the N divider is at least the minimum. */ - //d_regs->d_10_bit_r_counter = refclock_freq*MIN_INT_DIV/freq; - d_regs->d_10_bit_r_counter = 2; - uint64_t n_mod; - do{ - d_regs->d_10_bit_r_counter++; - n_mod = freq; - n_mod *= d_regs->d_10_bit_r_counter; - n_mod *= d_regs->d_mod; - n_mod /= refclock_freq; - /* calculate int and frac */ - d_regs->d_int = n_mod/d_regs->d_mod; - d_regs->d_frac = (n_mod - (freq_t)d_regs->d_int*d_regs->d_mod) & uint16_t(0xfff); - /* - fprintf(stderr, - "VCO %lu KHz, Int %u, Frac %u, Mod %u, R %u, Div %u\n", - freq, d_regs->d_int, d_regs->d_frac, - d_regs->d_mod, d_regs->d_10_bit_r_counter, (1 << d_regs->d_divider_select) - ); - */ - }while(d_regs->d_int < min_int_div); - /* calculate the band select so PFD is under 125 KHz */ - d_regs->d_8_bit_band_select_clock_divider_value = \ - refclock_freq/(FREQ_C(30e3)*d_regs->d_10_bit_r_counter) + 1; - /* - fprintf(stderr, "Band Selection: Div %u, Freq %lu\n", - d_regs->d_8_bit_band_select_clock_divider_value, - refclock_freq/(d_regs->d_8_bit_band_select_clock_divider_value * d_regs->d_10_bit_r_counter) + 1 - ); - */ - return true; -} - -freq_t -adf4350::_get_freq(freq_t refclock_freq) -{ - /* Calculate the freq from int, frac, mod, ref, r, div: - * freq = (int + frac/mod) * (ref/r) - * Keep precision by doing multiplies first: - * freq = (((((((int)*mod) + frac)*ref)/mod)/r)/div) - */ - uint64_t freq; - freq = d_regs->d_int; - freq *= d_regs->d_mod; - freq += d_regs->d_frac; - freq *= refclock_freq; - freq /= d_regs->d_mod; - freq /= d_regs->d_10_bit_r_counter; - freq /= (1 << d_regs->d_divider_select); - return freq; -} diff --git a/usrp/host/lib/db_wbxng_adf4350.h b/usrp/host/lib/db_wbxng_adf4350.h deleted file mode 100644 index ce8cbf4b1..000000000 --- a/usrp/host/lib/db_wbxng_adf4350.h +++ /dev/null @@ -1,47 +0,0 @@ -// -// Copyright 2009 Free Software Foundation, Inc. -// -// This file is part of GNU Radio -// -// GNU Radio is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either asversion 3, or (at your option) -// any later version. -// -// GNU Radio is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with GNU Radio; see the file COPYING. If not, write to -// the Free Software Foundation, Inc., 51 Franklin Street, -// Boston, MA 02110-1301, USA. - -#ifndef INCLUDED_ADF4350_H -#define INCLUDED_ADF4350_H - -#include "db_wbxng_adf4350_regs.h" -#include <usrp/db_base.h> -#include <stdint.h> - -typedef uint64_t freq_t; -class adf4350_regs; - -class adf4350 -{ -public: - adf4350(); - ~adf4350(); - void _update(); - std::string compute_register(uint8_t addr); - bool _set_freq(freq_t freq, freq_t refclock_freq); - freq_t _get_freq(freq_t refclock_freq); - freq_t _get_max_freq(); - freq_t _get_min_freq(); - -protected: - adf4350_regs *d_regs; -}; - -#endif /* INCLUDED_ADF4350_H */ diff --git a/usrp/host/lib/db_wbxng_adf4350_regs.cc b/usrp/host/lib/db_wbxng_adf4350_regs.cc deleted file mode 100644 index c9707c3c6..000000000 --- a/usrp/host/lib/db_wbxng_adf4350_regs.cc +++ /dev/null @@ -1,136 +0,0 @@ -// -// Copyright 2009 Free Software Foundation, Inc. -// -// This file is part of GNU Radio -// -// GNU Radio is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either asversion 3, or (at your option) -// any later version. -// -// GNU Radio is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with GNU Radio; see the file COPYING. If not, write to -// the Free Software Foundation, Inc., 51 Franklin Street, -// Boston, MA 02110-1301, USA. - -#include "db_wbxng_adf4350_regs.h" -#include "db_wbxng_adf4350.h" - -//#include "cal_div.h" - -/* reg 0 */ -/* reg 1 */ -const uint16_t adf4350_regs::s_phase = 0; -/* reg 2 */ -const uint8_t adf4350_regs::s_low_noise_and_low_spur_modes = 3; -const uint8_t adf4350_regs::s_muxout = 6; -const uint8_t adf4350_regs::s_reference_doubler = 0; -const uint8_t adf4350_regs::s_rdiv2 = 0; -const uint8_t adf4350_regs::s_double_buff = 0; -const uint8_t adf4350_regs::s_charge_pump_setting = 5; -const uint8_t adf4350_regs::s_ldf = 0; -const uint8_t adf4350_regs::s_ldp = 0; -const uint8_t adf4350_regs::s_pd_polarity = 1; -const uint8_t adf4350_regs::s_power_down = 0; -const uint8_t adf4350_regs::s_cp_three_state = 0; -const uint8_t adf4350_regs::s_counter_reset = 0; -/* reg 3 */ -const uint8_t adf4350_regs::s_csr = 0; -const uint8_t adf4350_regs::s_clk_div_mode = 0; -const uint16_t adf4350_regs::s_12_bit_clock_divider_value = 0; -/* reg 4 */ -const uint8_t adf4350_regs::s_feedback_select = 1; -const uint8_t adf4350_regs::s_vco_power_down = 0; -const uint8_t adf4350_regs::s_mtld = 0; -const uint8_t adf4350_regs::s_aux_output_select = 1; -const uint8_t adf4350_regs::s_aux_output_enable = 0; -const uint8_t adf4350_regs::s_aux_output_power = 0; -const uint8_t adf4350_regs::s_rf_output_enable = 1; -const uint8_t adf4350_regs::s_output_power = 3; -/* reg 5 */ -const uint8_t adf4350_regs::s_ld_pin_mode = 1; - -adf4350_regs::adf4350_regs(){ - - /* reg 0 */ - d_int = uint16_t(100); - d_frac = 0; - /* reg 1 */ - d_prescaler = uint8_t(0); - d_mod = uint16_t(0xfff); /* max fractional accuracy */ - /* reg 2 */ - d_10_bit_r_counter = uint16_t(2); - /* reg 3 */ - /* reg 4 */ - d_divider_select = 0; - d_8_bit_band_select_clock_divider_value = 0; - /* reg 5 */ -} - -adf4350_regs::~adf4350_regs(void){ -} - -uint32_t -adf4350_regs::_reg_shift(uint32_t data, uint32_t shift){ - return data << shift; -} - -uint32_t -adf4350_regs::compute_register(uint8_t addr){ - uint32_t data = 0; - switch (addr){ - case 0: data = ( - _reg_shift(d_int, 15) | - _reg_shift(d_frac, 3)); - break; - case 1: data = ( - _reg_shift(d_prescaler, 27) | - _reg_shift(s_phase, 15) | - _reg_shift(d_mod, 3)); - break; - case 2: data = ( - _reg_shift(s_low_noise_and_low_spur_modes, 29) | - _reg_shift(s_muxout, 26) | - _reg_shift(s_reference_doubler, 25) | - _reg_shift(s_rdiv2, 24) | - _reg_shift(d_10_bit_r_counter, 14) | - _reg_shift(s_double_buff, 13) | - _reg_shift(s_charge_pump_setting, 9) | - _reg_shift(s_ldf, 8) | - _reg_shift(s_ldp, 7) | - _reg_shift(s_pd_polarity, 6) | - _reg_shift(s_power_down, 5) | - _reg_shift(s_cp_three_state, 4) | - _reg_shift(s_counter_reset, 3)); - break; - case 3: data = ( - _reg_shift(s_csr, 18) | - _reg_shift(s_clk_div_mode, 15) | - _reg_shift(s_12_bit_clock_divider_value, 3)); - break; - case 4: data = ( - _reg_shift(s_feedback_select, 23) | - _reg_shift(d_divider_select, 20) | - _reg_shift(d_8_bit_band_select_clock_divider_value, 12) | - _reg_shift(s_vco_power_down, 11) | - _reg_shift(s_mtld, 10) | - _reg_shift(s_aux_output_select, 9) | - _reg_shift(s_aux_output_enable, 8) | - _reg_shift(s_aux_output_power, 6) | - _reg_shift(s_rf_output_enable, 5) | - _reg_shift(s_output_power, 3)); - break; - case 5: data = ( - _reg_shift(s_ld_pin_mode, 22)); - break; - default: return data; - } - /* return the data to write out to spi */ - return data; -} - diff --git a/usrp/host/lib/db_wbxng_adf4350_regs.h b/usrp/host/lib/db_wbxng_adf4350_regs.h deleted file mode 100644 index 33a548e85..000000000 --- a/usrp/host/lib/db_wbxng_adf4350_regs.h +++ /dev/null @@ -1,83 +0,0 @@ -// -// Copyright 2009 Free Software Foundation, Inc. -// -// This file is part of GNU Radio -// -// GNU Radio is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either asversion 3, or (at your option) -// any later version. -// -// GNU Radio is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with GNU Radio; see the file COPYING. If not, write to -// the Free Software Foundation, Inc., 51 Franklin Street, -// Boston, MA 02110-1301, USA. - -#ifndef ADF4350_REGS_H -#define ADF4350_REGS_H - -#include <usrp/db_base.h> -#include <stdint.h> - -class adf4350; - -class adf4350_regs -{ -public: - adf4350_regs(); - ~adf4350_regs(); - - uint32_t _reg_shift(uint32_t data, uint32_t shift); - uint32_t compute_register(uint8_t addr); - - /* reg 0 */ - uint16_t d_int; - uint16_t d_frac; - /* reg 1 */ - uint8_t d_prescaler; - static const uint16_t s_phase; - uint16_t d_mod; - /* reg 2 */ - static const uint8_t s_low_noise_and_low_spur_modes; - static const uint8_t s_muxout; - static const uint8_t s_reference_doubler; - static const uint8_t s_rdiv2; - uint16_t d_10_bit_r_counter; - static const uint8_t s_double_buff; - static const uint8_t s_charge_pump_setting; - static const uint8_t s_ldf; - static const uint8_t s_ldp; - static const uint8_t s_pd_polarity; - static const uint8_t s_power_down; - static const uint8_t s_cp_three_state; - static const uint8_t s_counter_reset; - /* reg 3 */ - static const uint8_t s_csr; - static const uint8_t s_clk_div_mode; - static const uint16_t s_12_bit_clock_divider_value; - /* reg 4 */ - static const uint8_t s_feedback_select; - uint8_t d_divider_select; - uint8_t d_8_bit_band_select_clock_divider_value; - static const uint8_t s_vco_power_down; - static const uint8_t s_mtld; - static const uint8_t s_aux_output_select; - static const uint8_t s_aux_output_enable; - static const uint8_t s_aux_output_power; - static const uint8_t s_rf_output_enable; - static const uint8_t s_output_power; - /* reg 5 */ - static const uint8_t s_ld_pin_mode; - -protected: - usrp_basic_sptr d_usrp; - int d_spi_enable; - int d_spi_format; -}; - -#endif /* ADF4350_REGS_H */ diff --git a/usrp/host/lib/db_xcvr2450.cc b/usrp/host/lib/db_xcvr2450.cc deleted file mode 100644 index ce9d1f4e8..000000000 --- a/usrp/host/lib/db_xcvr2450.cc +++ /dev/null @@ -1,795 +0,0 @@ -// -// Copyright 2008,2009 Free Software Foundation, Inc. -// -// This file is part of GNU Radio -// -// GNU Radio is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either asversion 3, or (at your option) -// any later version. -// -// GNU Radio is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with GNU Radio; see the file COPYING. If not, write to -// the Free Software Foundation, Inc., 51 Franklin Street, -// Boston, MA 02110-1301, USA. - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <usrp/db_xcvr2450.h> -#include <db_base_impl.h> -#include <cmath> -#include <boost/thread.hpp> -#include <boost/weak_ptr.hpp> -#include <cstdio> - -#if 0 -#define LO_OFFSET 4.25e6 -#else -#define LO_OFFSET 0 -#define NO_LO_OFFSET -#endif - - -/* ------------------------------------------------------------------------ - * A few comments about the XCVR2450: - * - * It is half-duplex. I.e., transmit and receive are mutually exclusive. - * There is a single LO for both the Tx and Rx sides. - * For our purposes the board is always either receiving or transmitting. - * - * Each board is uniquely identified by the *USRP hardware* instance and side - * This dictionary holds a weak reference to existing board controller so it - * can be created or retrieved as needed. - */ - - - -// TX IO Pins -#define HB_PA_OFF (1 << 15) // 5GHz PA, 1 = off, 0 = on -#define LB_PA_OFF (1 << 14) // 2.4GHz PA, 1 = off, 0 = on -#define ANTSEL_TX1_RX2 (1 << 13) // 1 = Ant 1 to TX, Ant 2 to RX -#define ANTSEL_TX2_RX1 (1 << 12) // 1 = Ant 2 to TX, Ant 1 to RX -#define TX_EN (1 << 11) // 1 = TX on, 0 = TX off -#define AD9515DIV (1 << 4) // 1 = Div by 3, 0 = Div by 2 - -#define TX_OE_MASK HB_PA_OFF|LB_PA_OFF|ANTSEL_TX1_RX2|ANTSEL_TX2_RX1|TX_EN|AD9515DIV -#define TX_SAFE_IO HB_PA_OFF|LB_PA_OFF|ANTSEL_TX1_RX2|AD9515DIV - -// RX IO Pins -#define LOCKDET (1 << 15) // This is an INPUT!!! -#define EN (1 << 14) -#define RX_EN (1 << 13) // 1 = RX on, 0 = RX off -#define RX_HP (1 << 12) -#define RX_OE_MASK EN|RX_EN|RX_HP -#define RX_SAFE_IO EN - -struct xcvr2450_key { - std::string serial_no; - int which; - - bool operator==(const xcvr2450_key &x){ - return x.serial_no ==serial_no && x.which == which; - } -}; - -class xcvr2450 -{ -private: - usrp_basic *d_raw_usrp; - int d_which; - - bool d_is_shutdown; - int d_spi_format, d_spi_enable; - - int d_mimo, d_int_div, d_frac_div, d_highband, d_five_gig; - int d_cp_current, d_ref_div, d_rssi_hbw; - int d_txlpf_bw, d_rxlpf_bw, d_rxlpf_fine, d_rxvga_ser; - int d_rssi_range, d_rssi_mode, d_rssi_mux; - int d_rx_hp_pin, d_rx_hpf, d_rx_ant; - int d_tx_ant, d_txvga_ser, d_tx_driver_lin; - int d_tx_vga_lin, d_tx_upconv_lin, d_tx_bb_gain; - int d_pabias_delay, d_pabias, rx_rf_gain, rx_bb_gain, d_txgain; - int d_rx_rf_gain, d_rx_bb_gain; - - int d_reg_standby, d_reg_int_divider, d_reg_frac_divider, d_reg_bandselpll; - int d_reg_cal, dsend_reg, d_reg_lpf, d_reg_rxrssi_ctrl, d_reg_txlin_gain; - int d_reg_pabias, d_reg_rxgain, d_reg_txgain; - - int d_ad9515_div; - - void _set_rfagc(float gain); - void _set_ifagc(float gain); - void _set_pga(float pga_gain); - -public: - usrp_basic *usrp(){ - return d_raw_usrp; - } - - xcvr2450(usrp_basic_sptr usrp, int which); - ~xcvr2450(); - void shutdown(); - - void set_reg_standby(); - - // Integer-Divider Ratio (3) - void set_reg_int_divider(); - - // Fractional-Divider Ratio (4) - void set_reg_frac_divider(); - - // Band Select and PLL (5) - void set_reg_bandselpll(); - - // Calibration (6) - void set_reg_cal(); - - // Lowpass Filter (7) - void set_reg_lpf(); - - // Rx Control/RSSI (8) - void set_reg_rxrssi_ctrl(); - - // Tx Linearity/Baseband Gain (9) - void set_reg_txlin_gain(); - - // PA Bias DAC (10) - void set_reg_pabias(); - - // Rx Gain (11) - void set_reg_rxgain(); - - // Tx Gain (12) - void set_reg_txgain(); - - // Send register write to SPI - void send_reg(int v); - - void set_gpio(); - bool lock_detect(); - bool set_rx_gain(float gain); - bool set_tx_gain(float gain); - - struct freq_result_t set_freq(double target_freq); -}; - - -/*****************************************************************************/ - - -xcvr2450::xcvr2450(usrp_basic_sptr _usrp, int which) - : d_raw_usrp(_usrp.get()), d_which(which), d_is_shutdown(false) -{ - // Handler for Tv Rx daughterboards. - // - // @param usrp: instance of usrp.source_c - // @param which: which side: 0, 1 corresponding to RX_A or RX_B respectively - - // Use MSB with no header - d_spi_format = SPI_FMT_MSB | SPI_FMT_HDR_0; - - if(which == 0) { - d_spi_enable = SPI_ENABLE_RX_A; - } - else { - d_spi_enable = SPI_ENABLE_RX_B; - } - - // Sane defaults - d_mimo = 1; // 0 = OFF, 1 = ON - d_int_div = 192; // 128 = min, 255 = max - d_frac_div = 0; // 0 = min, 65535 = max - d_highband = 0; // 0 = freq <= 5.4e9, 1 = freq > 5.4e9 - d_five_gig = 0; // 0 = freq <= 3.e9, 1 = freq > 3e9 - d_cp_current = 1; // 0 = 2mA, 1 = 4mA - d_ref_div = 1; // 1 to 7 - d_rssi_hbw = 0; // 0 = 2 MHz, 1 = 6 MHz - d_txlpf_bw = 1; // 1 = 12 MHz, 2 = 18 MHz, 3 = 24 MHz - d_rxlpf_bw = 1; // 0 = 7.5 MHz, 1 = 9.5 MHz, 2 = 14 MHz, 3 = 18 MHz - d_rxlpf_fine = 2; // 0 = 90%, 1 = 95%, 2 = 100%, 3 = 105%, 4 = 110% - d_rxvga_ser = 1; // 0 = RXVGA controlled by B7:1, 1=controlled serially - d_rssi_range = 1; // 0 = low range (datasheet typo), 1=high range (0.5V - 2.0V) - d_rssi_mode = 1; // 0 = enable follows RXHP, 1 = enabled - d_rssi_mux = 0; // 0 = RSSI, 1 = TEMP - d_rx_hp_pin = 0; // 0 = Fc set by rx_hpf, 1 = 600 KHz - d_rx_hpf = 0; // 0 = 100Hz, 1 = 30KHz - d_rx_ant = 0; // 0 = Ant. #1, 1 = Ant. #2 - d_tx_ant = 0; // 0 = Ant. #1, 1 = Ant. #2 - d_txvga_ser = 1; // 0 = TXVGA controlled by B6:1, 1=controlled serially - d_tx_driver_lin = 2; // 0=50% (worst linearity), 1=63%, 2=78%, 3=100% (best lin) - d_tx_vga_lin = 2; // 0=50% (worst linearity), 1=63%, 2=78%, 3=100% (best lin) - d_tx_upconv_lin = 2; // 0=50% (worst linearity), 1=63%, 2=78%, 3=100% (best lin) - d_tx_bb_gain = 3; // 0=maxgain-5dB, 1=max-3dB, 2=max-1.5dB, 3=max - d_pabias_delay = 15; // 0 = 0, 15 = 7uS - d_pabias = 0; // 0 = 0 uA, 63 = 315uA - d_rx_rf_gain = 0; // 0 = 0dB, 1 = 0dB, 2 = 15dB, 3 = 30dB - d_rx_bb_gain = 16; // 0 = min, 31 = max (0 - 62 dB) - - d_txgain = 63; // 0 = min, 63 = max - - // Initialize GPIO and ATR - usrp()->common_write_io(C_TX, d_which, TX_SAFE_IO, TX_OE_MASK); - usrp()->_common_write_oe(C_TX, d_which, TX_OE_MASK, 0xffff); - usrp()->common_write_atr_txval(C_TX, d_which, TX_SAFE_IO); - usrp()->common_write_atr_rxval(C_TX, d_which, TX_SAFE_IO); - usrp()->common_write_atr_mask(C_TX, d_which, TX_OE_MASK); - - usrp()->common_write_io(C_RX, d_which, RX_SAFE_IO, RX_OE_MASK); - usrp()->_common_write_oe(C_RX, d_which, RX_OE_MASK, 0xffff); - usrp()->common_write_atr_txval(C_RX, d_which, RX_SAFE_IO); - usrp()->common_write_atr_rxval(C_RX, d_which, RX_SAFE_IO); - usrp()->common_write_atr_mask(C_RX, d_which, RX_OE_MASK); - - // Initialize chipset - // TODO: perform reset sequence to ensure power up defaults - set_reg_standby(); - set_reg_bandselpll(); - set_reg_cal(); - set_reg_lpf(); - set_reg_rxrssi_ctrl(); - set_reg_txlin_gain(); - set_reg_pabias(); - set_reg_rxgain(); - set_reg_txgain(); - //FIXME: set_freq(2.45e9); -} - -xcvr2450::~xcvr2450() -{ - //printf("xcvr2450::destructor\n"); - shutdown(); -} - -void -xcvr2450::shutdown() -{ - if (!d_is_shutdown){ - d_is_shutdown = true; - usrp()->common_write_atr_txval(C_TX, d_which, TX_SAFE_IO); - usrp()->common_write_atr_rxval(C_TX, d_which, TX_SAFE_IO); - usrp()->common_write_atr_txval(C_RX, d_which, RX_SAFE_IO); - usrp()->common_write_atr_rxval(C_RX, d_which, RX_SAFE_IO); - } -} - - -void -xcvr2450::set_reg_standby() -{ - d_reg_standby = ((d_mimo<<17) | - (1<<16) | - (1<<6) | - (1<<5) | - (1<<4) | 2); - send_reg(d_reg_standby); -} - -void -xcvr2450::set_reg_int_divider() -{ - d_reg_int_divider = (((d_frac_div & 0x03)<<16) | - (d_int_div<<4) | 3); - send_reg(d_reg_int_divider); -} - -void -xcvr2450::set_reg_frac_divider() -{ - d_reg_frac_divider = ((d_frac_div & 0xfffc)<<2) | 4; - send_reg(d_reg_frac_divider); -} - -void -xcvr2450::set_reg_bandselpll() -{ - d_reg_bandselpll = ((d_mimo<<17) | - (1<<16) | - (1<<15) | - (0<<11) | - (d_highband<<10) | - (d_cp_current<<9) | - (d_ref_div<<5) | - (d_five_gig<<4) | 5); - send_reg(d_reg_bandselpll); - d_reg_bandselpll = ((d_mimo<<17) | - (1<<16) | - (1<<15) | - (1<<11) | - (d_highband<<10) | - (d_cp_current<<9) | - (d_ref_div<<5) | - (d_five_gig<<4) | 5); - send_reg(d_reg_bandselpll); -} - -void -xcvr2450::set_reg_cal() -{ - // FIXME do calibration - d_reg_cal = (1<<14)|6; - send_reg(d_reg_cal); -} - -void -xcvr2450::set_reg_lpf() -{ - d_reg_lpf = ( - (d_rssi_hbw<<15) | - (d_txlpf_bw<<9) | - (d_rxlpf_bw<<7) | - (d_rxlpf_fine<<4) | 7); - send_reg(d_reg_lpf); -} - -void -xcvr2450::set_reg_rxrssi_ctrl() -{ - d_reg_rxrssi_ctrl = ((d_rxvga_ser<<16) | - (d_rssi_range<<15) | - (d_rssi_mode<<14) | - (d_rssi_mux<<12) | - (1<<9) | - (d_rx_hpf<<6) | - (1<<4) | 8); - send_reg(d_reg_rxrssi_ctrl); -} - -void -xcvr2450::set_reg_txlin_gain() -{ - d_reg_txlin_gain = ((d_txvga_ser<<14) | - (d_tx_driver_lin<<12) | - (d_tx_vga_lin<<10) | - (d_tx_upconv_lin<<6) | - (d_tx_bb_gain<<4) | 9); - send_reg(d_reg_txlin_gain); -} - -void -xcvr2450::set_reg_pabias() -{ - d_reg_pabias = ( - (d_pabias_delay<<10) | - (d_pabias<<4) | 10); - send_reg(d_reg_pabias); -} - -void -xcvr2450::set_reg_rxgain() -{ - d_reg_rxgain = ( - (d_rx_rf_gain<<9) | - (d_rx_bb_gain<<4) | 11); - send_reg(d_reg_rxgain); -} - -void -xcvr2450::set_reg_txgain() -{ - d_reg_txgain = (d_txgain<<4) | 12; - send_reg(d_reg_txgain); -} - -void -xcvr2450::send_reg(int v) -{ - // Send 24 bits, it keeps last 18 clocked in - char c[3]; - c[0] = (char)((v >> 16) & 0xff); - c[1] = (char)((v >> 8) & 0xff); - c[2] = (char)((v & 0xff)); - std::string s(c, 3); - - usrp()->_write_spi(0, d_spi_enable, d_spi_format, s); - //printf("xcvr2450: Setting reg %d to %X\n", (v&15), v); -} - -// ---------------------------------------------------------------- - -void -xcvr2450::set_gpio() -{ - // We calculate four values: - // - // io_rx_while_rx: what to drive onto io_rx_* when receiving - // io_rx_while_tx: what to drive onto io_rx_* when transmitting - // io_tx_while_rx: what to drive onto io_tx_* when receiving - // io_tx_while_tx: what to drive onto io_tx_* when transmitting - // - // B1-B7 is ignored as gain is set serially for now. - - int rx_hp, tx_antsel, rx_antsel, tx_pa_sel; - if(d_rx_hp_pin) - rx_hp = RX_HP; - else - rx_hp = 0; - - if(d_tx_ant) - tx_antsel = ANTSEL_TX2_RX1; - else - tx_antsel = ANTSEL_TX1_RX2; - - if(d_rx_ant) - rx_antsel = ANTSEL_TX2_RX1; - else - rx_antsel = ANTSEL_TX1_RX2; - - if(d_five_gig) - tx_pa_sel = LB_PA_OFF; - else - tx_pa_sel = HB_PA_OFF; - - // Reset GPIO and ATR - // FIXME: dont set io, oe, atr mask once basic code stops overriding our settings - usrp()->common_write_io(C_TX, d_which, TX_SAFE_IO, TX_OE_MASK); - usrp()->_common_write_oe(C_TX, d_which, TX_OE_MASK, 0xffff); - usrp()->common_write_atr_txval(C_TX, d_which, tx_pa_sel|tx_antsel|TX_EN|AD9515DIV); - usrp()->common_write_atr_rxval(C_TX, d_which, HB_PA_OFF|LB_PA_OFF|rx_antsel|AD9515DIV); - usrp()->common_write_atr_mask(C_TX, d_which, TX_OE_MASK); - - usrp()->common_write_io(C_RX, d_which, RX_SAFE_IO, RX_OE_MASK); - usrp()->_common_write_oe(C_RX, d_which, RX_OE_MASK, 0xffff); - usrp()->common_write_atr_txval(C_RX, d_which, EN|rx_hp); - usrp()->common_write_atr_rxval(C_RX, d_which, EN|rx_hp|RX_EN); - usrp()->common_write_atr_mask(C_RX, d_which, RX_OE_MASK); - - //printf("GPIO: RXRX=%04X RXTX=%04X TXRX=%04X TXTX=%04X\n", - // io_rx_while_rx, io_rx_while_tx, io_tx_while_rx, io_tx_while_tx); -} - - -struct freq_result_t -xcvr2450::set_freq(double target_freq) -{ - struct freq_result_t args = {false, 0}; - - double scaler; - - if(target_freq > 3e9) { - d_five_gig = 1; - d_ad9515_div = 3; - scaler = 4.0/5.0; - } - else { - d_five_gig = 0; - d_ad9515_div = 3; - scaler = 4.0/3.0; - } - - if(target_freq > 5.408e9) { - d_highband = 1; - } - else { - d_highband = 0; - } - - double vco_freq = target_freq*scaler; - double sys_clk = usrp()->fpga_master_clock_freq(); // Usually 64e6 - double ref_clk = sys_clk / d_ad9515_div; - - double phdet_freq = ref_clk/d_ref_div; - double div = vco_freq/phdet_freq; - d_int_div = int(floor(div)); - d_frac_div = int((div-d_int_div)*65536.0); - // double actual_freq = phdet_freq*(d_int_div+(d_frac_div/65536.0))/scaler; - - //printf("RF=%f VCO=%f R=%d PHD=%f DIV=%3.5f I=%3d F=%5d ACT=%f\n", - // target_freq, vco_freq, d_ref_div, phdet_freq, - // div, d_int_div, d_frac_div, actual_freq); - - set_gpio(); - set_reg_int_divider(); - set_reg_frac_divider(); - set_reg_bandselpll(); - - args.ok = lock_detect(); -#ifdef NO_LO_OFFSET - args.baseband_freq = target_freq; -#else - args.baseband_freq = actual_freq; -#endif - - if(!args.ok){ - printf("Fail %f\n", target_freq); - } - return args; -} - -bool -xcvr2450::lock_detect() -{ - /* - @returns: the value of the VCO/PLL lock detect bit. - @rtype: 0 or 1 - */ - if(usrp()->common_read_io(C_RX, d_which) & LOCKDET) { - return true; - } - else { // Give it a second chance - if(usrp()->common_read_io(C_RX, d_which) & LOCKDET) - return true; - else - return false; - } -} - -bool -xcvr2450::set_rx_gain(float gain) -{ - if(gain < 0.0) - gain = 0.0; - if(gain > 92.0) - gain = 92.0; - - // Split the gain between RF and baseband - // This is experimental, not prescribed - if(gain < 31.0) { - d_rx_rf_gain = 0; // 0 dB RF gain - rx_bb_gain = int(gain/2.0); - } - - if(gain >= 30.0 and gain < 60.5) { - d_rx_rf_gain = 2; // 15 dB RF gain - d_rx_bb_gain = int((gain-15.0)/2.0); - } - - if(gain >= 60.5) { - d_rx_rf_gain = 3; // 30.5 dB RF gain - d_rx_bb_gain = int((gain-30.5)/2.0); - } - - set_reg_rxgain(); - - return true; -} - -bool -xcvr2450::set_tx_gain(float gain) -{ - if(gain < 0.0) { - gain = 0.0; - } - if(gain > 30.0) { - gain = 30.0; - } - - d_txgain = int((gain/30.0)*63); - set_reg_txgain(); - - return true; -} - - -/*****************************************************************************/ - - -struct xcvr2450_table_entry { - xcvr2450_key key; - boost::weak_ptr<xcvr2450> value; - - xcvr2450_table_entry(const xcvr2450_key &_key, boost::weak_ptr<xcvr2450> _value) - : key(_key), value(_value) {} -}; - -typedef std::vector<xcvr2450_table_entry> xcvr2450_table; - -static boost::mutex s_table_mutex; -static xcvr2450_table s_table; - -static xcvr2450_sptr -_get_or_make_xcvr2450(usrp_basic_sptr usrp, int which) -{ - xcvr2450_key key = {usrp->serial_number(), which}; - - boost::mutex::scoped_lock guard(s_table_mutex); - - for (xcvr2450_table::iterator p = s_table.begin(); p != s_table.end();){ - if (p->value.expired()) // weak pointer is now dead - p = s_table.erase(p); // erase it - else { - if (key == p->key){ // found it - return xcvr2450_sptr(p->value); - } - else - ++p; // keep looking - } - } - - // We don't have the xcvr2450 we're looking for - - // create a new one and stick it in the table. - xcvr2450_sptr r(new xcvr2450(usrp, which)); - xcvr2450_table_entry t(key, r); - s_table.push_back(t); - - return r; -} - - -/*****************************************************************************/ - - -db_xcvr2450_base::db_xcvr2450_base(usrp_basic_sptr usrp, int which) - : db_base(usrp, which) -{ - /* - * Abstract base class for all xcvr2450 boards. - * - * Derive board specific subclasses from db_xcvr2450_base_{tx,rx} - * - * @param usrp: instance of usrp.source_c - * @param which: which side: 0 or 1 corresponding to side A or B respectively - * @type which: int - */ - - d_xcvr = _get_or_make_xcvr2450(usrp, which); -} - -db_xcvr2450_base::~db_xcvr2450_base() -{ -} - -void -db_xcvr2450_base::shutdown_common() -{ - // If the usrp_basic in the xcvr2450 is the same as the usrp_basic - // in the daughterboard, shutdown the xcvr now (when only one of Tx - // and Rx is open, this is always true). - - if (d_xcvr->usrp() == usrp()){ - //std::cerr << "db_xcvr2450_base::shutdown_common: same -> shutting down\n"; - d_xcvr->shutdown(); - } - else { - //std::cerr << "db_xcvr2450_base::shutdown_common: different -> ignoring\n"; - } -} - -struct freq_result_t -db_xcvr2450_base::set_freq(double target_freq) -{ - /* - * @returns (ok, actual_baseband_freq) where: - * ok is True or False and indicates success or failure, - * actual_baseband_freq is the RF frequency that corresponds to DC in the IF. - */ - return d_xcvr->set_freq(target_freq+d_lo_offset); -} - -bool -db_xcvr2450_base::is_quadrature() -{ - /* - * Return True if this board requires both I & Q analog channels. - * - * This bit of info is useful when setting up the USRP Rx mux register. - */ - return true; -} - -double -db_xcvr2450_base::freq_min() -{ - return 2.4e9; -} - -double -db_xcvr2450_base::freq_max() -{ - return 6.0e9; -} - - -/******************************************************************************/ - - -db_xcvr2450_tx::db_xcvr2450_tx(usrp_basic_sptr usrp, int which) - : db_xcvr2450_base(usrp, which) -{ - set_lo_offset(LO_OFFSET); - //printf("db_xcvr2450_tx::db_xcvr2450_tx\n"); -} - -db_xcvr2450_tx::~db_xcvr2450_tx() -{ - shutdown(); -} - -void -db_xcvr2450_tx::shutdown() -{ - if (!d_is_shutdown){ - d_is_shutdown = true; - shutdown_common(); - } -} - -float -db_xcvr2450_tx::gain_min() -{ - return 0; -} - -float -db_xcvr2450_tx::gain_max() -{ - return 30; -} - -float -db_xcvr2450_tx::gain_db_per_step() -{ - return (30.0/63.0); -} - -bool -db_xcvr2450_tx::set_gain(float gain) -{ - return d_xcvr->set_tx_gain(gain); -} - -bool -db_xcvr2450_tx::i_and_q_swapped() -{ - return true; -} - - -/******************************************************************************/ - - -db_xcvr2450_rx::db_xcvr2450_rx(usrp_basic_sptr usrp, int which) - : db_xcvr2450_base(usrp, which) -{ - /* - * @param usrp: instance of usrp.source_c - * @param which: 0 or 1 corresponding to side RX_A or RX_B respectively. - */ - set_lo_offset(LO_OFFSET); - //printf("db_xcvr2450_rx:d_xcvr_2450_rx\n"); -} - -db_xcvr2450_rx::~db_xcvr2450_rx() -{ - shutdown(); -} - -void -db_xcvr2450_rx::shutdown() -{ - if (!d_is_shutdown){ - d_is_shutdown = true; - shutdown_common(); - } -} - -float -db_xcvr2450_rx::gain_min() -{ - return 0.0; -} - -float -db_xcvr2450_rx::gain_max() -{ - return 92.0; -} - -float -db_xcvr2450_rx::gain_db_per_step() -{ - return 1; -} - -bool -db_xcvr2450_rx::set_gain(float gain) -{ - return d_xcvr->set_rx_gain(gain); -} diff --git a/usrp/host/lib/dump_data.py b/usrp/host/lib/dump_data.py deleted file mode 100755 index 034586d8a..000000000 --- a/usrp/host/lib/dump_data.py +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2003 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. - -import sys -import struct - -fin = sys.stdin - -count = 0 - -while 1: - s = fin.read(2) - if not s or len(s) != 2: - break - - v, = struct.unpack ('H', s) - iv = int(v) & 0xffff - print "%8d %6d 0x%04x" % (count, iv, iv) - count += 1 - - - diff --git a/usrp/host/lib/fusb.cc b/usrp/host/lib/fusb.cc deleted file mode 100644 index 2a597b67c..000000000 --- a/usrp/host/lib/fusb.cc +++ /dev/null @@ -1,59 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003,2009 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <fusb.h> - -// ------------------------------------------------------------------------ -// device handle -// ------------------------------------------------------------------------ - -fusb_devhandle::fusb_devhandle (libusb_device_handle *udh) - : d_udh (udh) -{ - // that's it -}; - -fusb_devhandle::~fusb_devhandle () -{ - // nop -} - -// ------------------------------------------------------------------------ -// end point handle -// ------------------------------------------------------------------------ - -fusb_ephandle::fusb_ephandle (int endpoint, bool input_p, - int block_size, int nblocks) - : d_endpoint (endpoint), d_input_p (input_p), - d_block_size (block_size), d_nblocks (nblocks), d_started (false) -{ - // that't it -} - -fusb_ephandle::~fusb_ephandle () -{ - // nop -} diff --git a/usrp/host/lib/fusb.h b/usrp/host/lib/fusb.h deleted file mode 100644 index 538ae1ae0..000000000 --- a/usrp/host/lib/fusb.h +++ /dev/null @@ -1,138 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005,2009 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _FUSB_H_ -#define _FUSB_H_ - -#include <usrp/libusb_types.h> - -struct libusb_context; -class fusb_ephandle; - -/*! - * \brief abstract usb device handle - */ -class fusb_devhandle { -private: - // NOT IMPLEMENTED - fusb_devhandle (const fusb_devhandle &rhs); // no copy constructor - fusb_devhandle &operator= (const fusb_devhandle &rhs); // no assignment operator - -protected: - libusb_device_handle *d_udh; - -public: - // CREATORS - fusb_devhandle (libusb_device_handle *udh); - virtual ~fusb_devhandle (); - - // MANIPULATORS - - /*! - * \brief return an ephandle of the correct subtype - */ - virtual fusb_ephandle *make_ephandle (int endpoint, bool input_p, - int block_size = 0, int nblocks = 0) = 0; - - // ACCESSORS - libusb_device_handle *get_usb_dev_handle () const { return d_udh; } -}; - - -/*! - * \brief abstract usb end point handle - */ -class fusb_ephandle { -private: - // NOT IMPLEMENTED - fusb_ephandle (const fusb_ephandle &rhs); // no copy constructor - fusb_ephandle &operator= (const fusb_ephandle &rhs); // no assignment operator - -protected: - int d_endpoint; - bool d_input_p; - int d_block_size; - int d_nblocks; - bool d_started; - -public: - fusb_ephandle (int endpoint, bool input_p, - int block_size = 0, int nblocks = 0); - virtual ~fusb_ephandle (); - - virtual bool start () = 0; //!< begin streaming i/o - virtual bool stop () = 0; //!< stop streaming i/o - - /*! - * \returns \p nbytes if write was successfully enqueued, else -1. - * Will block if no free buffers available. - */ - virtual int write (const void *buffer, int nbytes) = 0; - - /*! - * \returns number of bytes read or -1 if error. - * number of bytes read will be <= nbytes. - * Will block if no input available. - */ - virtual int read (void *buffer, int nbytes) = 0; - - /* - * block until all outstanding writes have completed - */ - virtual void wait_for_completion () = 0; - - /*! - * \brief returns current block size. - */ - int block_size () { return d_block_size; }; -}; - - -/*! - * \brief factory for creating concrete instances of the appropriate subtype. - */ -class fusb_sysconfig { -public: - /*! - * \brief returns fusb_devhandle or throws if trouble - */ - static fusb_devhandle *make_devhandle (libusb_device_handle *udh, - libusb_context *ctx = 0); - - /*! - * \brief Returns max block size in bytes (hard limit). - */ - static int max_block_size (); - - /*! - * \brief Returns default block size in bytes. - */ - static int default_block_size (); - - /*! - * \brief Returns the default buffer size in bytes. - */ - static int default_buffer_size (); - -}; - -#endif /* _FUSB_H_ */ diff --git a/usrp/host/lib/fusb_darwin.cc b/usrp/host/lib/fusb_darwin.cc deleted file mode 100644 index d2966c115..000000000 --- a/usrp/host/lib/fusb_darwin.cc +++ /dev/null @@ -1,582 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006,2009,2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio. - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#define DO_DEBUG 0 - -#include <usb.h> -#include "fusb.h" -#include "fusb_darwin.h" -#include "darwin_libusb.h" -#include <iostream> - -static const int USB_TIMEOUT = 100; // in milliseconds -static const UInt8 NUM_QUEUE_ITEMS = 20; - -fusb_devhandle_darwin::fusb_devhandle_darwin (usb_dev_handle* udh) - : fusb_devhandle (udh) -{ - // that's it -} - -fusb_devhandle_darwin::~fusb_devhandle_darwin () -{ - // nop -} - -fusb_ephandle* -fusb_devhandle_darwin::make_ephandle (int endpoint, bool input_p, - int block_size, int nblocks) -{ - return new fusb_ephandle_darwin (this, endpoint, input_p, - block_size, nblocks); -} - -// ---------------------------------------------------------------- - -fusb_ephandle_darwin::fusb_ephandle_darwin (fusb_devhandle_darwin* dh, - int endpoint, bool input_p, - int block_size, int nblocks) - : fusb_ephandle (endpoint, input_p, block_size, nblocks), - d_devhandle (dh), d_pipeRef (0), d_transferType (0), - d_interfaceRef (0), d_interface (0), d_queue (0), - d_buffer (0), d_bufLenBytes (0) -{ - d_bufLenBytes = fusb_sysconfig::max_block_size(); - -// create circular buffer - d_buffer = new circular_buffer<char> (NUM_QUEUE_ITEMS * d_bufLenBytes, - !d_input_p, d_input_p); - -// create the queue - d_queue = new circular_linked_list <s_buffer_ptr> (NUM_QUEUE_ITEMS); - d_queue->iterate_start (); - s_node_ptr l_node = d_queue->iterate_next (); - while (l_node) { - l_node->both (new s_both<s_buffer_ptr> (l_node, this)); - s_buffer_ptr l_buf = new s_buffer (d_bufLenBytes); - l_node->object (l_buf); - l_node = d_queue->iterate_next (); - l_buf = NULL; - } - - d_readRunning = new gruel::mutex (); - d_runThreadRunning = new gruel::mutex (); - d_runBlock = new gruel::condition_variable (); - d_readBlock = new gruel::condition_variable (); - d_runBlock_mutex = new gruel::mutex (); - d_readBlock_mutex = new gruel::mutex (); -} - -fusb_ephandle_darwin::~fusb_ephandle_darwin () -{ - stop (); - - d_queue->iterate_start (); - s_node_ptr l_node = d_queue->iterate_next (); - while (l_node) { - s_both_ptr l_both = l_node->both (); - delete l_both; - l_both = NULL; - l_node->both (NULL); - s_buffer_ptr l_buf = l_node->object (); - delete l_buf; - l_buf = NULL; - l_node->object (NULL); - l_node = d_queue->iterate_next (); - } - delete d_queue; - d_queue = NULL; - delete d_buffer; - d_buffer = NULL; - delete d_readRunning; - d_readRunning = NULL; - delete d_runThreadRunning; - d_runThreadRunning = NULL; - delete d_runBlock_mutex; - d_runBlock_mutex = NULL; - delete d_readBlock_mutex; - d_readBlock_mutex = NULL; - delete d_runBlock; - d_runBlock = NULL; - delete d_readBlock; - d_readBlock = NULL; -} - -bool -fusb_ephandle_darwin::start () -{ - UInt8 direction, number, interval; - UInt16 maxPacketSize; - -// reset circular buffer - d_buffer->reset (); - -// reset the queue - d_queue->num_used (0); - d_queue->iterate_start (); - s_node_ptr l_node = d_queue->iterate_next (); - while (l_node) { - l_node->both()->set (l_node, this); - l_node->object()->reset (); - l_node->set_available (); - l_node = d_queue->iterate_next (); - } - - d_pipeRef = d_transferType = 0; - - usb_dev_handle* dev = d_devhandle->get_usb_dev_handle (); - if (! dev) - USB_ERROR_STR (false, -ENXIO, "fusb_ephandle_darwin::start: " - "null device"); - - darwin_dev_handle* device = (darwin_dev_handle*) dev->impl_info; - if (! device) - USB_ERROR_STR (false, -ENOENT, "fusb_ephandle_darwin::start: " - "device not initialized"); - - if (usb_debug) { - std::cerr << "fusb_ephandle_darwin::start: dev = " << - (void*) dev << ", device = " << (void*) device << std::endl; - } - - d_interfaceRef = device->interface; - if (! d_interfaceRef) - USB_ERROR_STR (false, -EACCES, "fusb_ephandle_darwin::start: " - "interface used without being claimed"); - d_interface = *d_interfaceRef; - -// get read or write pipe info (depends on "d_input_p") - - if (usb_debug > 3) { - std::cerr << "fusb_ephandle_darwin::start d_endpoint = " << d_endpoint - << ", d_input_p = " << (d_input_p ? "TRUE" : "FALSE") << std::endl; - } - - int l_endpoint = (d_input_p ? USB_ENDPOINT_IN : USB_ENDPOINT_OUT); - int pipeRef = ep_to_pipeRef (device, d_endpoint | l_endpoint); - if (pipeRef < 0) - USB_ERROR_STR (false, -EINVAL, "fusb_ephandle_darwin::start " - " invalid pipeRef.\n"); - - d_pipeRef = pipeRef; - d_interface->GetPipeProperties (d_interfaceRef, - d_pipeRef, - &direction, - &number, - &d_transferType, - &maxPacketSize, - &interval); - if (usb_debug == 3) { - std::cerr << "fusb_ephandle_darwin::start: " << (d_input_p ? "read" : "write") - << ": ep = " << d_endpoint << ", pipeRef = " << d_pipeRef << "interface = " - << d_interface << ", interfaceRef = " << d_interfaceRef - << ", if_direction = " << direction << ", if_# = " << number - << ", if_interval = " << interval << ", if_maxPacketSize = " - << maxPacketSize << std::endl; - } - - // set global start boolean - d_started = true; - - // lock the runBlock mutex, before creating the run thread. - // this guarantees that we can control execution between these 2 threads - gruel::scoped_lock l (*d_runBlock_mutex); - - // create the run thread, which allows OSX to process I/O separately - d_runThread = new gruel::thread (run_thread, this); - - // wait until the run thread (and possibky read thread) are -really- - // going; this will unlock the mutex before waiting for a signal () - d_runBlock->wait (l); - - if (usb_debug) { - std::cerr << "fusb_ephandle_darwin::start: " << (d_input_p ? "read" : "write") - << " started." << std::endl; - } - - return (true); -} - -void -fusb_ephandle_darwin::run_thread (void* arg) -{ - fusb_ephandle_darwin* This = static_cast<fusb_ephandle_darwin*>(arg); - - // lock the run thread running mutex; if ::stop() is called, it will - // first abort() the pipe then wait for the run thread to finish, - // via a lock() on this mutex - gruel::mutex* l_runThreadRunning = This->d_runThreadRunning; - gruel::scoped_lock l0 (*l_runThreadRunning); - - gruel::mutex* l_readRunning = This->d_readRunning; - gruel::condition_variable* l_readBlock = This->d_readBlock; - gruel::mutex* l_readBlock_mutex = This->d_readBlock_mutex; - - bool l_input_p = This->d_input_p; - - if (usb_debug) { - std::cerr << "fusb_ephandle_darwin::run_thread: starting for " - << (l_input_p ? "read" : "write") << "." << std::endl; - } - - usb_interface_t** l_interfaceRef = This->d_interfaceRef; - usb_interface_t* l_interface = This->d_interface; - CFRunLoopSourceRef l_cfSource; - -// create async run loop - l_interface->CreateInterfaceAsyncEventSource (l_interfaceRef, &l_cfSource); - CFRunLoopAddSource (CFRunLoopGetCurrent (), l_cfSource, - kCFRunLoopDefaultMode); -// get run loop reference, to allow other threads to stop - This->d_CFRunLoopRef = CFRunLoopGetCurrent (); - - gruel::thread* l_rwThread = NULL; - - if (l_input_p) { - // lock the readBlock mutex, before creating the read thread. - // this guarantees that we can control execution between these 2 threads - gruel::scoped_lock l1 (*l_readBlock_mutex); - // create the read thread, which just issues all of the starting - // async read commands, then returns - l_rwThread = new gruel::thread (read_thread, arg); - // wait until the the read thread is -really- going; this will - // unlock the read block mutex before waiting for a signal () - l_readBlock->wait (l1); - } - - { - // now signal the run condition to release and finish ::start(). - - // lock the runBlock mutex first; this will force waiting until the - // ->wait() command is issued in ::start() - gruel::mutex* l_run_block_mutex = This->d_runBlock_mutex; - gruel::scoped_lock l2 (*l_run_block_mutex); - - // now that the lock is in place, signal the parent thread that - // things are running - This->d_runBlock->notify_one (); - } - - // run the loop - CFRunLoopRun (); - - if (l_input_p) { - // wait for read_thread () to finish, if needed - gruel::scoped_lock l3 (*l_readRunning); - } - - // remove run loop stuff - CFRunLoopRemoveSource (CFRunLoopGetCurrent (), - l_cfSource, kCFRunLoopDefaultMode); - - if (usb_debug) { - std::cerr << "fusb_ephandle_darwin::run_thread: finished for " - << (l_input_p ? "read" : "write") << "." << std::endl; - } -} - -void -fusb_ephandle_darwin::read_thread (void* arg) -{ - if (usb_debug) { - std::cerr << "fusb_ephandle_darwin::read_thread: starting." << std::endl; - } - - fusb_ephandle_darwin* This = static_cast<fusb_ephandle_darwin*>(arg); - - // before doing anything else, lock the read running mutex. this - // mutex does flow control between this thread and the run_thread - gruel::mutex* l_readRunning = This->d_readRunning; - gruel::scoped_lock l0 (*l_readRunning); - - // signal the read condition from run_thread() to continue - - // lock the readBlock mutex first; this will force waiting until the - // ->wait() command is issued in ::run_thread() - gruel::condition_variable* l_readBlock = This->d_readBlock; - gruel::mutex* l_read_block_mutex = This->d_readBlock_mutex; - - { - gruel::scoped_lock l1 (*l_read_block_mutex); - - // now that the lock is in place, signal the parent thread that - // things are running here - l_readBlock->notify_one (); - } - - // queue up all of the available read requests - s_queue_ptr l_queue = This->d_queue; - l_queue->iterate_start (); - s_node_ptr l_node = l_queue->iterate_next (); - while (l_node) { - This->read_issue (l_node->both ()); - l_node = l_queue->iterate_next (); - } - - if (usb_debug) { - std::cerr << "fusb_ephandle_darwin::read_thread: finished." << std::endl; - } -} - -void -fusb_ephandle_darwin::read_issue (s_both_ptr l_both) -{ - if ((! l_both) || (! d_started)) { - if (usb_debug > 4) { - std::cerr << "fusb_ephandle_darwin::read_issue: Doing nothing; " - << "l_both is " << (void*) l_both << "; started is " - << (d_started ? "TRUE" : "FALSE") << std::endl; - } - return; - } - -// set the node and buffer from the input "both" - s_node_ptr l_node = l_both->node (); - s_buffer_ptr l_buf = l_node->object (); - void* v_buffer = (void*) l_buf->buffer (); - -// read up to d_bufLenBytes - size_t bufLen = d_bufLenBytes; - l_buf->n_used (bufLen); - -// setup system call result - io_return_t result = kIOReturnSuccess; - - if (d_transferType == kUSBInterrupt) -/* This is an interrupt pipe. We can't specify a timeout. */ - result = d_interface->ReadPipeAsync - (d_interfaceRef, d_pipeRef, v_buffer, bufLen, - (IOAsyncCallback1) read_completed, (void*) l_both); - else - result = d_interface->ReadPipeAsyncTO - (d_interfaceRef, d_pipeRef, v_buffer, bufLen, 0, USB_TIMEOUT, - (IOAsyncCallback1) read_completed, (void*) l_both); - - if (result != kIOReturnSuccess) - USB_ERROR_STR_NO_RET (- darwin_to_errno (result), - "fusb_ephandle_darwin::read_issue " - "(ReadPipeAsync%s): %s", - d_transferType == kUSBInterrupt ? "" : "TO", - darwin_error_str (result)); - else if (usb_debug > 4) { - std::cerr << "fusb_ephandle_darwin::read_issue: Queued " << (void*) l_both - << " (" << bufLen << " Bytes)" << std::endl; - } -} - -void -fusb_ephandle_darwin::read_completed (void* refCon, - io_return_t result, - void* io_size) -{ - size_t l_size = (size_t) io_size; - s_both_ptr l_both = static_cast<s_both_ptr>(refCon); - fusb_ephandle_darwin* This = static_cast<fusb_ephandle_darwin*>(l_both->This ()); - s_node_ptr l_node = l_both->node (); - circular_buffer<char>* l_buffer = This->d_buffer; - s_buffer_ptr l_buf = l_node->object (); - size_t l_i_size = l_buf->n_used (); - - if (This->d_started && (l_i_size != l_size)) { - std::cerr << "fusb_ephandle_darwin::read_completed: Expected " << l_i_size - << " bytes; read " << l_size << "." << std::endl; - } else if (usb_debug > 4) { - std::cerr << "fusb_ephandle_darwin::read_completed: Read " << (void*) l_both - << " (" << l_size << " bytes)" << std::endl; - } - -// add this read to the transfer buffer, and check for overflow -// -> data is being enqueued faster than it can be dequeued - if (l_buffer->enqueue (l_buf->buffer (), l_size) == -1) { -// print out that there's an overflow - fputs ("uO", stderr); - fflush (stderr); - } - -// set buffer's # data to 0 - l_buf->n_used (0); - -// issue another read for this "both" - This->read_issue (l_both); -} - -int -fusb_ephandle_darwin::read (void* buffer, int nbytes) -{ - size_t l_nbytes = (size_t) nbytes; - d_buffer->dequeue ((char*) buffer, &l_nbytes); - - if (usb_debug > 4) { - std::cerr << "fusb_ephandle_darwin::read: request for " << nbytes - << " bytes, " << l_nbytes << " bytes retrieved." << std::endl; - } - - return ((int) l_nbytes); -} - -int -fusb_ephandle_darwin::write (const void* buffer, int nbytes) -{ - size_t l_nbytes = (size_t) nbytes; - - if (! d_started) { - if (usb_debug) { - std::cerr << "fusb_ephandle_darwin::write: Not yet started." << std::endl; - } - return (0); - } - - while (l_nbytes != 0) { -// find out how much data to copy; limited to "d_bufLenBytes" per node - size_t t_nbytes = (l_nbytes > d_bufLenBytes) ? d_bufLenBytes : l_nbytes; - -// get next available node to write into; -// blocks internally if none available - s_node_ptr l_node = d_queue->find_next_available_node (); - -// copy the input into the node's buffer - s_buffer_ptr l_buf = l_node->object (); - l_buf->buffer ((char*) buffer, t_nbytes); - void* v_buffer = (void*) l_buf->buffer (); - -// setup callback parameter & system call return - s_both_ptr l_both = l_node->both (); - io_return_t result = kIOReturnSuccess; - - if (d_transferType == kUSBInterrupt) -/* This is an interrupt pipe ... can't specify a timeout. */ - result = d_interface->WritePipeAsync - (d_interfaceRef, d_pipeRef, v_buffer, t_nbytes, - (IOAsyncCallback1) write_completed, (void*) l_both); - else - result = d_interface->WritePipeAsyncTO - (d_interfaceRef, d_pipeRef, v_buffer, t_nbytes, 0, USB_TIMEOUT, - (IOAsyncCallback1) write_completed, (void*) l_both); - - if (result != kIOReturnSuccess) - USB_ERROR_STR (-1, - darwin_to_errno (result), - "fusb_ephandle_darwin::write_thread " - "(WritePipeAsync%s): %s", - d_transferType == kUSBInterrupt ? "" : "TO", - darwin_error_str (result)); - else if (usb_debug > 4) { - std::cerr << "fusb_ephandle_darwin::write_thread: Queued " << (void*) l_both - << " (" << t_nbytes << " Bytes)" << std::endl; - } - l_nbytes -= t_nbytes; - } - - return (nbytes); -} - -void -fusb_ephandle_darwin::write_completed (void* refCon, - io_return_t result, - void* io_size) -{ - s_both_ptr l_both = static_cast<s_both_ptr>(refCon); - fusb_ephandle_darwin* This = static_cast<fusb_ephandle_darwin*>(l_both->This ()); - size_t l_size = (size_t) io_size; - s_node_ptr l_node = l_both->node (); - s_queue_ptr l_queue = This->d_queue; - s_buffer_ptr l_buf = l_node->object (); - size_t l_i_size = l_buf->n_used (); - - if (This->d_started && (l_i_size != l_size)) { - std::cerr << "fusb_ephandle_darwin::write_completed: Expected " << l_i_size - << " bytes written; wrote " << l_size << "." << std::endl; - } else if (usb_debug > 4) { - std::cerr << "fusb_ephandle_darwin::write_completed: Wrote " << (void*) l_both - << " (" << l_size << " Bytes)" << std::endl; - } - -// set buffer's # data to 0 - l_buf->n_used (0); -// make the node available for reuse - l_queue->make_node_available (l_node); -} - -void -fusb_ephandle_darwin::abort () -{ - if (usb_debug) { - std::cerr << "fusb_ephandle_darwin::abort: starting." << std::endl; - } - - io_return_t result = d_interface->AbortPipe (d_interfaceRef, d_pipeRef); - - if (result != kIOReturnSuccess) - USB_ERROR_STR_NO_RET (- darwin_to_errno (result), - "fusb_ephandle_darwin::abort " - "(AbortPipe): %s", darwin_error_str (result)); - if (usb_debug) { - std::cerr << "fusb_ephandle_darwin::abort: finished." << std::endl; - } -} - -bool -fusb_ephandle_darwin::stop () -{ - if (! d_started) - return (true); - - if (usb_debug) { - std::cerr << "fusb_ephandle_darwin::stop: stopping " - << (d_input_p ? "read" : "write") << "." << std::endl; - } - - d_started = false; - -// abort any pending IO transfers - abort (); - -// wait for write transfer to finish - wait_for_completion (); - -// tell IO buffer to abort any waiting conditions - d_buffer->abort (); - -// stop the run loop - CFRunLoopStop (d_CFRunLoopRef); - -// wait for the runThread to stop - gruel::scoped_lock l (*d_runThreadRunning); - - if (usb_debug) { - std::cerr << "fusb_ephandle_darwin::stop: " << (d_input_p ? "read" : "write") - << " stopped." << std::endl; - } - - return (true); -} - -void -fusb_ephandle_darwin::wait_for_completion () -{ - if (d_queue) - while (d_queue->in_use ()) - usleep (1000); -} diff --git a/usrp/host/lib/fusb_darwin.h b/usrp/host/lib/fusb_darwin.h deleted file mode 100644 index 4d18177be..000000000 --- a/usrp/host/lib/fusb_darwin.h +++ /dev/null @@ -1,218 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006,2009,2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio. - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _FUSB_DARWIN_H_ -#define _FUSB_DARWIN_H_ - -#include <usb.h> -#include "fusb.h" -#include <IOKit/IOCFBundle.h> -#include <IOKit/IOCFPlugIn.h> -#include <IOKit/usb/IOUSBLib.h> -#include <IOKit/IOKitLib.h> -#include "circular_linked_list.h" -#include "circular_buffer.h" - -// for MacOS X 10.4.[0-3] -#define usb_interface_t IOUSBInterfaceInterface220 -#define InterfaceInterfaceID kIOUSBInterfaceInterfaceID220 -#define InterfaceVersion 220 - -// for MacOS X 10.3.[0-9] and 10.4.[0-3] -#define usb_device_t IOUSBDeviceInterface197 -#define DeviceInterfaceID kIOUSBDeviceInterfaceID197 -#define DeviceVersion 197 - -extern "C" { -typedef struct usb_dev_handle { - int fd; - - struct usb_bus *bus; - struct usb_device *device; - - int config; - int interface; - int altsetting; - - /* Added by RMT so implementations can store other per-open-device data */ - void *impl_info; -} usb_dev_handle; - -/* Darwin/OS X impl does not use fd field, instead it uses this */ -typedef struct darwin_dev_handle { - usb_device_t** device; - usb_interface_t** interface; - int open; -} darwin_dev_handle; - -typedef IOReturn io_return_t; -typedef IOCFPlugInInterface *io_cf_plugin_ref_t; - -static int ep_to_pipeRef (darwin_dev_handle* device, int ep); -extern int usb_debug; -} - -class s_buffer -{ -private: - char* d_buffer; - size_t d_n_used, d_n_alloc; - -public: - inline s_buffer (size_t n_alloc = 0) { - d_n_used = 0; - d_n_alloc = n_alloc; - if (n_alloc) { - d_buffer = (char*) new char [n_alloc]; - } else { - d_buffer = 0; - } - }; - inline ~s_buffer () { - if (d_n_alloc) { - delete [] d_buffer; - } - }; - inline size_t n_used () { return (d_n_used); }; - inline void n_used (size_t bufLen) { - d_n_used = (bufLen > d_n_alloc) ? d_n_alloc : bufLen; }; - inline size_t n_alloc () { return (d_n_alloc); }; - void buffer (char* l_buffer, size_t bufLen) { - if (bufLen > d_n_alloc) { - std::cerr << "s_buffer::set: Copying only allocated bytes." << std::endl; - bufLen = d_n_alloc; - } - if (!l_buffer) { - std::cerr << "s_buffer::set: NULL buffer." << std::endl; - return; - } - bcopy (l_buffer, d_buffer, bufLen); - d_n_used = bufLen; - }; - inline char* buffer () { return (d_buffer); }; - inline void reset () { - bzero (d_buffer, d_n_alloc); - d_n_used = 0; - }; -}; - -typedef s_buffer* s_buffer_ptr; -typedef s_node<s_buffer_ptr>* s_node_ptr; -typedef circular_linked_list<s_buffer_ptr>* s_queue_ptr; -typedef s_both<s_buffer_ptr>* s_both_ptr; - -/*! - * \brief darwin implementation of fusb_devhandle - * - * This is currently identical to the generic implementation - * and is intended as a starting point for whatever magic is - * required to make usb fly. - */ -class fusb_devhandle_darwin : public fusb_devhandle -{ -public: - // CREATORS - fusb_devhandle_darwin (usb_dev_handle* udh); - virtual ~fusb_devhandle_darwin (); - - // MANIPULATORS - virtual fusb_ephandle* make_ephandle (int endpoint, bool input_p, - int block_size = 0, int nblocks = 0); -}; - -/*! - * \brief darwin implementation of fusb_ephandle - * - * This is currently identical to the generic implementation - * and is intended as a starting point for whatever magic is - * required to make usb fly. - */ -class fusb_ephandle_darwin : public fusb_ephandle -{ -private: - fusb_devhandle_darwin* d_devhandle; - gruel::thread* d_runThread; - gruel::mutex* d_runThreadRunning; - - CFRunLoopRef d_CFRunLoopRef; - - static void write_completed (void* ret_io_size, - io_return_t result, - void* io_size); - static void read_completed (void* ret_io_size, - io_return_t result, - void* io_size); - static void run_thread (void* arg); - static void read_thread (void* arg); - - void read_issue (s_both_ptr l_both); - -public: - // variables, for now - UInt8 d_pipeRef, d_transferType; - usb_interface_t** d_interfaceRef; - usb_interface_t* d_interface; - s_queue_ptr d_queue; - circular_buffer<char>* d_buffer; - size_t d_bufLenBytes; - gruel::mutex* d_readRunning; - gruel::mutex* d_runBlock_mutex; - gruel::mutex* d_readBlock_mutex; - gruel::condition_variable* d_runBlock; - gruel::condition_variable* d_readBlock; - -// CREATORS - - fusb_ephandle_darwin (fusb_devhandle_darwin *dh, int endpoint, bool input_p, - int block_size = 0, int nblocks = 0); - virtual ~fusb_ephandle_darwin (); - -// MANIPULATORS - - virtual bool start (); //!< begin streaming i/o - virtual bool stop (); //!< stop streaming i/o - - /*! - * \returns \p nbytes if write was successfully enqueued, else -1. - * Will block if no free buffers available. - */ - virtual int write (const void* buffer, int nbytes); - - /*! - * \returns number of bytes read or -1 if error. - * number of bytes read will be <= nbytes. - * Will block if no input available. - */ - virtual int read (void* buffer, int nbytes); - - /* - * abort any pending IO transfers - */ - void abort (); - - /* - * block until all outstanding writes have completed - */ - virtual void wait_for_completion (); -}; - -#endif /* _FUSB_DARWIN_H_ */ diff --git a/usrp/host/lib/fusb_generic.cc b/usrp/host/lib/fusb_generic.cc deleted file mode 100644 index 0958716d9..000000000 --- a/usrp/host/lib/fusb_generic.cc +++ /dev/null @@ -1,108 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <fusb_generic.h> -#include <usb.h> - - -static const int USB_TIMEOUT = 1000; // in milliseconds - - -fusb_devhandle_generic::fusb_devhandle_generic (usb_dev_handle *udh) - : fusb_devhandle (udh) -{ - // that's it -} - -fusb_devhandle_generic::~fusb_devhandle_generic () -{ - // nop -} - -fusb_ephandle * -fusb_devhandle_generic::make_ephandle (int endpoint, bool input_p, - int block_size, int nblocks) -{ - return new fusb_ephandle_generic (this, endpoint, input_p, - block_size, nblocks); -} - -// ---------------------------------------------------------------- - -fusb_ephandle_generic::fusb_ephandle_generic (fusb_devhandle_generic *dh, - int endpoint, bool input_p, - int block_size, int nblocks) - : fusb_ephandle (endpoint, input_p, block_size, nblocks), - d_devhandle (dh) -{ - // that's it -} - -fusb_ephandle_generic::~fusb_ephandle_generic () -{ - // nop -} - -bool -fusb_ephandle_generic::start () -{ - d_started = true; - return true; -} - -bool -fusb_ephandle_generic::stop () -{ - d_started = false; - return true; -} - -int -fusb_ephandle_generic::write (const void *buffer, int nbytes) -{ - if (!d_started) // doesn't matter here, but keeps semantics constant - return -1; - - if (d_input_p) - return -1; - - return usb_bulk_write (d_devhandle->get_usb_dev_handle (), - d_endpoint, (char *) buffer, nbytes, USB_TIMEOUT); -} - -int -fusb_ephandle_generic::read (void *buffer, int nbytes) -{ - if (!d_started) // doesn't matter here, but keeps semantics constant - return -1; - - if (!d_input_p) - return -1; - - return usb_bulk_read (d_devhandle->get_usb_dev_handle (), - d_endpoint|USB_ENDPOINT_IN, (char *) buffer, nbytes, - USB_TIMEOUT); -} diff --git a/usrp/host/lib/fusb_generic.h b/usrp/host/lib/fusb_generic.h deleted file mode 100644 index b9aef2737..000000000 --- a/usrp/host/lib/fusb_generic.h +++ /dev/null @@ -1,83 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _FUSB_GENERIC_H_ -#define _FUSB_GENERIC_H_ - -#include <fusb.h> - -/*! - * \brief generic implementation of fusb_devhandle using only libusb - */ -class fusb_devhandle_generic : public fusb_devhandle -{ -public: - // CREATORS - fusb_devhandle_generic (usb_dev_handle *udh); - virtual ~fusb_devhandle_generic (); - - // MANIPULATORS - virtual fusb_ephandle *make_ephandle (int endpoint, bool input_p, - int block_size = 0, int nblocks = 0); -}; - - -/*! - * \brief generic implementation of fusb_ephandle using only libusb - */ -class fusb_ephandle_generic : public fusb_ephandle -{ -private: - fusb_devhandle_generic *d_devhandle; - -public: - // CREATORS - fusb_ephandle_generic (fusb_devhandle_generic *dh, int endpoint, bool input_p, - int block_size = 0, int nblocks = 0); - virtual ~fusb_ephandle_generic (); - - // MANIPULATORS - - virtual bool start (); //!< begin streaming i/o - virtual bool stop (); //!< stop streaming i/o - - /*! - * \returns \p nbytes if write was successfully enqueued, else -1. - * Will block if no free buffers available. - */ - virtual int write (const void *buffer, int nbytes); - - /*! - * \returns number of bytes read or -1 if error. - * number of bytes read will be <= nbytes. - * Will block if no input available. - */ - virtual int read (void *buffer, int nbytes); - - /* - * block until all outstanding writes have completed - */ - virtual void wait_for_completion () { }; -}; - -#endif /* _FUSB_GENERIC_H_ */ - diff --git a/usrp/host/lib/fusb_libusb1.cc b/usrp/host/lib/fusb_libusb1.cc deleted file mode 100644 index 770708451..000000000 --- a/usrp/host/lib/fusb_libusb1.cc +++ /dev/null @@ -1,702 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003,2009 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <fusb_libusb1.h> -#include <fusb.h> -#include <libusb-1.0/libusb.h> -#include <stdexcept> -#include <cstdio> -#include <assert.h> -#include <string.h> -#include <algorithm> -#include <errno.h> -#include <string.h> - -#define MINIMIZE_TX_BUFFERING true - -static const int MAX_BLOCK_SIZE = fusb_sysconfig::max_block_size(); -static const int DEFAULT_BLOCK_SIZE = MAX_BLOCK_SIZE; -static const int DEFAULT_BUFFER_SIZE = 4 * (1L << 20); // 4 MB endpoint -static const int LIBUSB_TIMEOUT = 0; // no timeout - -inline static fusb_ephandle_libusb1 * -lut_get_ephandle (libusb_transfer *lut) -{ - return (fusb_ephandle_libusb1 *) lut->user_data; -} - -// ------------------------------------------------------------------------ -// libusb_transfer allocation, deallocation, and callback -// ------------------------------------------------------------------------ - -static void -free_lut (libusb_transfer *lut) -{ - - // if this was an input transfer, free the buffer - if (lut->endpoint & 0x80) - delete [] ((unsigned char *) lut->buffer); - - libusb_free_transfer(lut); - -} - -/* - * The callback means the libusb_transfer is completed whether sent, cancelled, - * or failed. Move the libusb_transfer from the pending list to the - * completed list. If the cancel is from the destructor then free the - * transfer instead; normally this won't happen since all endpoints should be - * destroyed first leaving the pending list empty. - */ - -static void -generic_callback(struct libusb_transfer *lut) -{ - - // Fish out devhandle from endpoint - fusb_devhandle_libusb1* dev_handle = - lut_get_ephandle(lut)->get_fusb_devhandle_libusb1(); - - dev_handle->pending_remove(lut); - - if (lut->status == LIBUSB_TRANSFER_CANCELLED && dev_handle->_teardown() == 1) - { - free_lut (lut); - return; - } - - lut_get_ephandle(lut)->completed_list_add(lut); - -} - -static libusb_transfer* -alloc_lut (fusb_ephandle_libusb1 *self, int buffer_length, int endpoint, - bool input_p, unsigned char *write_buffer, - fusb_devhandle_libusb1 *dh) -{ - - struct libusb_transfer* lut = libusb_alloc_transfer(0); - - endpoint = (endpoint & 0x7f) | (input_p ? 0x80 : 0); - - if (input_p) - write_buffer = new unsigned char [buffer_length]; - - // We need the base class libusb_device_handle - libusb_device_handle *dev_handle = dh->get_usb_dev_handle(); - - // Load the libusb_transfer for bulk transfer - libusb_fill_bulk_transfer (lut, // transfer - dev_handle, // dev_handle - endpoint, // endpoint - write_buffer, // buffer - buffer_length, // length - generic_callback, // callback - self, // user_data - LIBUSB_TIMEOUT); // timeout - - return lut; -} - -// ------------------------------------------------------------------------ -// device handle -// ------------------------------------------------------------------------ - -fusb_devhandle_libusb1::fusb_devhandle_libusb1 (libusb_device_handle *udh, - libusb_context *ctx) - : fusb_devhandle (udh), d_ctx (ctx), d_teardown (false) -{ - // that's it -} - -fusb_devhandle_libusb1::~fusb_devhandle_libusb1 () -{ - d_teardown = true; - - std::list<libusb_transfer*>::reverse_iterator it; - - // After cancellation the libusb_transfer is still active so delay freeing - // transfer until callback occurs. In most cases the pending list should - // already be empty by the time this destructor is called. - - for (it = d_pending_rqsts.rbegin (); it != d_pending_rqsts.rend (); it++) { - _cancel_lut (*it); - } - - // Wait for pending list to empty - _wait_for_completion (); - -} - -fusb_ephandle* -fusb_devhandle_libusb1::make_ephandle (int endpoint, bool input_p, - int block_size, int nblocks) -{ - return new fusb_ephandle_libusb1 (this, endpoint, input_p, - block_size, nblocks); -} - -/* - * devhandle list manipulators - */ - -void -fusb_devhandle_libusb1::pending_add (libusb_transfer *lut) -{ - d_pending_rqsts.push_back (lut); -} - - -/* - * Attempt to cancel all transations associated with eph - */ - -void -fusb_devhandle_libusb1::_cancel_pending_rqsts (fusb_ephandle_libusb1 *eph) -{ - std::list<libusb_transfer*>::reverse_iterator it; - - for (it = d_pending_rqsts.rbegin (); it != d_pending_rqsts.rend (); it++){ - if (lut_get_ephandle (*it) == eph) - _cancel_lut (*it); - } -} - -/* - * Pull from the pending list - */ - -libusb_transfer * -fusb_devhandle_libusb1::pending_get () -{ - if (d_pending_rqsts.empty ()) - return 0; - - libusb_transfer *lut = d_pending_rqsts.front (); - d_pending_rqsts.pop_front (); - return lut; -} - -/* - * Match libusb_tranfer with the pending list and erase - * Return true if found, false otherwise - */ - -bool -fusb_devhandle_libusb1::pending_remove (libusb_transfer *lut) -{ - std::list<libusb_transfer*>::iterator result; - result = find (d_pending_rqsts.begin (), d_pending_rqsts.end (), lut); - - if (result == d_pending_rqsts.end ()) { - fprintf (stderr, "fusb::pending_remove: failed to find lut in pending_rqsts: %p\n", lut); - - return false; - } - d_pending_rqsts.erase (result); - return true; -} - -/* - * Submit the libusb_transfer to libusb - * iff successful, the transfer will be placed on the devhandle pending list. - */ - -bool -fusb_devhandle_libusb1::_submit_lut (libusb_transfer *lut) -{ - - int ret = libusb_submit_transfer (lut); - if (ret < 0) { - fprintf(stderr, "fusb::_submit_lut %d", ret); - return false; - } - - pending_add(lut); - return true; - -} - -/* - * Attempt to cancel any pending libusb_transfer transactions. - * Return true in the absence of errors, which does not mean that the transfer - * is cancelled. Cancellation can be checked after the callback is fired off - * by libusb. - */ - -bool -fusb_devhandle_libusb1::_cancel_lut (libusb_transfer *lut) -{ - - int ret = libusb_cancel_transfer (lut); - if (ret < 0) { - fprintf (stderr, "fusb::_cancel_lut"); - return false; - } - return true; - -} - -/* - * Reimplementing _reap for context use and compatibiliy with libusb-0.12. - * - * Returns false on timeout or error, true if an event was handled - * - * If ok_to_block_p is false then handle already pending events and return - * immediately. - * - * If ok_to_block_p is true then call libusb_handle_events_timeout with default - * timeout value of 2 seconds, which waits and returns on event arrival or - * timeout. - */ - -bool -fusb_devhandle_libusb1::_reap (bool ok_to_block_p) -{ - int ret; - struct timeval tv; - - // Save pending size - int pnd_size = d_pending_rqsts.size(); - - if (ok_to_block_p) { - tv.tv_sec = 2; - tv.tv_usec = 0; - } - else { - tv.tv_sec = 0; - tv.tv_usec = 0; - } - - if ((ret = libusb_handle_events_timeout(d_ctx, &tv)) < 0) { - fprintf (stderr, "fusb::_reap libusb_handle_events() %i\n", ret); - return false; - } - - // Check that a pending transfer was removed - if (pnd_size > d_pending_rqsts.size()) - return true; - else { - return false; - } -} - -void -fusb_devhandle_libusb1::_wait_for_completion () -{ - - while (!d_pending_rqsts.empty ()) - if (!_reap(true)) - break; - -} - -// ------------------------------------------------------------------------ -// endpoint handle -// ------------------------------------------------------------------------ - -fusb_ephandle_libusb1::fusb_ephandle_libusb1 (fusb_devhandle_libusb1 *dh, - int endpoint, bool input_p, - int block_size, int nblocks) - : fusb_ephandle (endpoint, input_p, block_size, nblocks), - d_devhandle (dh), - d_write_work_in_progress (0), d_write_buffer (0), - d_read_work_in_progress (0), d_read_buffer (0), d_read_buffer_end (0) -{ - - if (d_block_size < 0 || d_block_size > MAX_BLOCK_SIZE) - throw std::out_of_range ("fusb_ephandle_libusb1: block_size"); - - if (d_nblocks < 0) - throw std::out_of_range ("fusb_ephandle_libusb1: nblocks"); - - if (d_block_size == 0) - d_block_size = DEFAULT_BLOCK_SIZE; - - if (d_nblocks == 0) - d_nblocks = std::max (1, DEFAULT_BUFFER_SIZE / d_block_size); - - if (!d_input_p) - if (!MINIMIZE_TX_BUFFERING) - d_write_buffer = new unsigned char [d_block_size]; - - if (0) - fprintf(stderr, "fusb_ephandle_libusb1::ctor: d_block_size = %d d_nblocks = %d\n", - d_block_size, d_nblocks); - - // allocate libusb_transfers - for (int i = 0; i < d_nblocks; i++) - d_free_list.push_back (alloc_lut (this, d_block_size, d_endpoint, - d_input_p, d_write_buffer, d_devhandle)); -} - -fusb_ephandle_libusb1::~fusb_ephandle_libusb1 () -{ - - stop (); - - libusb_transfer *lut; - - while ((lut = free_list_get ()) != 0) - free_lut (lut); - - while ((lut = completed_list_get ()) != 0) - free_lut (lut); - - if (d_write_work_in_progress) - free_lut (d_write_work_in_progress); - - delete [] d_write_buffer; - - if (d_read_work_in_progress) - free_lut (d_read_work_in_progress); - -} - -bool -fusb_ephandle_libusb1::start () -{ - if (d_started) - return true; - - d_started = true; - - if (d_input_p) { - libusb_transfer *lut; - - int nerrors = 0; - while ((lut = free_list_get ()) !=0 && nerrors < d_nblocks) { - if (!submit_lut (lut)) - nerrors++; - } - } - - return true; - -} - -/* - * Cancel all transfers in progress or pending and return to initial state - */ - -bool -fusb_ephandle_libusb1::stop () -{ - - if (!d_started) - return true; - - if (d_write_work_in_progress){ - free_list_add (d_write_work_in_progress); - d_write_work_in_progress = 0; - } - - if (d_read_work_in_progress){ - free_list_add (d_read_work_in_progress); - d_read_work_in_progress = 0; - d_read_buffer = 0; - d_read_buffer_end = 0; - } - - d_devhandle->_cancel_pending_rqsts (this); - d_devhandle->_reap (false); - - while (1) { - libusb_transfer *lut; - while ((lut = completed_list_get ()) != 0) - free_list_add (lut); - - if (d_free_list.size () == (unsigned) d_nblocks) - break; - - if (!d_devhandle->_reap(true)) - break; - } - - d_started = false; - - return true; -} - -// ------------------------------------------------------------------------ -// routines for writing -// ------------------------------------------------------------------------ - -#if (MINIMIZE_TX_BUFFERING) - -int -fusb_ephandle_libusb1::write (const void *buffer, int nbytes) -{ - if (!d_started) // doesn't matter here, but keeps semantics constant - return -1; - - if (d_input_p) - return -1; - - assert(nbytes % 512 == 0); - - unsigned char *src = (unsigned char *) buffer; - - int n = 0; - while (n < nbytes){ - - struct libusb_transfer *lut = get_write_work_in_progress(); - if (!lut) - return -1; - assert(lut->actual_length == 0); - int m = std::min(nbytes - n, MAX_BLOCK_SIZE); - lut->buffer = src; - lut->length = m; - - n += m; - src += m; - - if (!submit_lut(lut)) - return -1; - - d_write_work_in_progress = 0; - } - - return n; -} - -#else - -int -fusb_ephandle_libusb1::write (const void *buffer, int nbytes) -{ - if (!d_started) - return -1; - - if (d_input_p) - return -1; - - unsigned char *src = (unsigned char *) buffer; - - int n = 0; - while (n < nbytes){ - - libusb_transfer *lut = get_write_work_in_progress (); - if (!lut) - return -1; - unsigned char *dst = (unsigned char *) lut->buffer; - int m = std::min (nbytes - n, lut->length - lut->actual_length); - - memcpy (&dst[lut->actual_length], &src[n], m); - lut->actual_length += m; - n += m; - - if (lut->actual_length == lut->length){ - if (!submit_lut (lut)) - return -1; - d_write_work_in_progress = 0; - } - } - - return n; -} - -#endif - -struct libusb_transfer * -fusb_ephandle_libusb1::get_write_work_in_progress () -{ - if (d_write_work_in_progress) - return d_write_work_in_progress; - - while (1) { - - reap_complete_writes (); - - struct libusb_transfer *lut = free_list_get (); - - if (lut != 0){ - assert (lut->actual_length == 0); - d_write_work_in_progress = lut; - return lut; - } - - if (!d_devhandle->_reap (true)) - return 0; - } -} - -void -fusb_ephandle_libusb1::reap_complete_writes () -{ - // take a look at the completed list and xfer to free list after - // checking for errors. - - libusb_transfer *lut; - - while ((lut = completed_list_get ()) != 0) { - - // Check for any errors or short writes that were reporetd in the transfer. - // libusb1 sets status, actual_length. - - if (lut->status != LIBUSB_TRANSFER_COMPLETED) { - fprintf (stderr, "fusb: (status %d) \n", lut->status ); - } - else if (lut->actual_length != lut->length){ - fprintf (stderr, "fusb: short write xfer: %d != %d\n", - lut->actual_length, lut->length); - } - - free_list_add (lut); - } -} - -void -fusb_ephandle_libusb1::wait_for_completion () -{ - d_devhandle->_wait_for_completion (); -} - -// ------------------------------------------------------------------------ -// routines for reading -// ------------------------------------------------------------------------ - -int -fusb_ephandle_libusb1::read (void *buffer, int nbytes) -{ - if (!d_started) // doesn't matter here, but keeps semantics constant - return -1; - - if (!d_input_p) - return -1; - - unsigned char *dst = (unsigned char *) buffer; - - int n = 0; - while (n < nbytes) { - - if (d_read_buffer >= d_read_buffer_end) - if (!reload_read_buffer ()) - return -1; - - int m = std::min (nbytes - n, (int) (d_read_buffer_end - d_read_buffer)); - - memcpy (&dst[n], d_read_buffer, m); - d_read_buffer += m; - n += m; - } - - return n; - -} - -bool -fusb_ephandle_libusb1::reload_read_buffer () -{ - assert (d_read_buffer >= d_read_buffer_end); - - libusb_transfer *lut; - - if (d_read_work_in_progress) { - lut = d_read_work_in_progress; - d_read_work_in_progress = 0; - d_read_buffer = 0; - d_read_buffer_end = 0; - lut->actual_length = 0; - if (!submit_lut (lut)) - return false; - } - - while (1) { - - while ((lut = completed_list_get ()) == 0 ) - if (!d_devhandle->_reap(true)) - return false; - - if (lut->status != LIBUSB_TRANSFER_COMPLETED) { - fprintf (stderr, "fust: (rd status %d) %s\n", lut->status, - strerror (-lut->status)); - lut->actual_length = 0; - free_list_add (lut); - return false; - } - - d_read_work_in_progress = lut; - d_read_buffer = (unsigned char *) lut->buffer; - d_read_buffer_end = d_read_buffer + lut->actual_length; - - return true; - } -} - - -/* - * ephandle list manipulation - */ - - -void -fusb_ephandle_libusb1::free_list_add (libusb_transfer *lut) -{ - assert (lut_get_ephandle (lut) == this); - lut->actual_length = 0; - d_free_list.push_back (lut); -} - -libusb_transfer * -fusb_ephandle_libusb1::free_list_get () -{ - if (d_free_list.empty ()) - return 0; - - libusb_transfer *lut = d_free_list.front (); - d_free_list.pop_front (); - return lut; -} - -void -fusb_ephandle_libusb1::completed_list_add (libusb_transfer *lut) -{ - assert (lut_get_ephandle (lut) == this); - d_completed_list.push_back (lut); -} - -libusb_transfer * -fusb_ephandle_libusb1::completed_list_get () -{ - if (d_completed_list.empty ()) - return 0; - - libusb_transfer *lut = d_completed_list.front (); - d_completed_list.pop_front (); - return lut; -} - -bool -fusb_ephandle_libusb1::submit_lut (libusb_transfer *lut) -{ - if (!d_devhandle->_submit_lut (lut)) { - fprintf (stderr, "_submit_lut failed\n"); - free_list_add (lut); - return false; - } - return true; -} diff --git a/usrp/host/lib/fusb_libusb1.h b/usrp/host/lib/fusb_libusb1.h deleted file mode 100644 index c0e3736bd..000000000 --- a/usrp/host/lib/fusb_libusb1.h +++ /dev/null @@ -1,131 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003,2009 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _FUSB_LIBUSB1_H_ -#define _FUSB_LIBUSB1_H_ - -#include <fusb.h> -#include <list> - -struct libusb_transfer; -struct libusb_context; - -class fusb_ephandle_libusb1; - -/*! - * \brief libusb1 implementation of fusb_devhandle - */ -class fusb_devhandle_libusb1 : public fusb_devhandle -{ -private: - std::list<libusb_transfer*> d_pending_rqsts; - libusb_context *d_ctx; - - void pending_add (struct libusb_transfer *lut); - struct libusb_transfer * pending_get (); - - bool d_teardown; - -public: - // CREATORS - fusb_devhandle_libusb1 (libusb_device_handle *udh, libusb_context *ctx); - virtual ~fusb_devhandle_libusb1 (); - - // MANIPULATORS - virtual fusb_ephandle *make_ephandle (int endpoint, bool input_p, - int block_size = 0, int nblocks = 0); - // internal use only - bool _submit_lut (libusb_transfer *); - bool _cancel_lut (libusb_transfer *); - void _cancel_pending_rqsts (fusb_ephandle_libusb1 *eph); - bool _reap (bool ok_to_block_p); - void _wait_for_completion (); - - // accessors to work from callback context - bool pending_remove (struct libusb_transfer *lut); - inline bool _teardown() { return d_teardown; } - -}; - - -/*! - * \brief libusb1 implementation of fusb_ephandle - */ -class fusb_ephandle_libusb1 : public fusb_ephandle -{ -private: - fusb_devhandle_libusb1 *d_devhandle; - std::list<libusb_transfer*> d_free_list; - std::list<libusb_transfer*> d_completed_list; - libusb_transfer *d_write_work_in_progress; - unsigned char *d_write_buffer; - libusb_transfer *d_read_work_in_progress; - unsigned char *d_read_buffer; - unsigned char *d_read_buffer_end; - - libusb_transfer *get_write_work_in_progress (); - void reap_complete_writes (); - bool reload_read_buffer (); - bool submit_lut (libusb_transfer *lut); - -public: - // CREATORS - fusb_ephandle_libusb1 (fusb_devhandle_libusb1 *dh, int endpoint, bool input_p, - int block_size = 0, int nblocks = 0); - virtual ~fusb_ephandle_libusb1 (); - - // MANIPULATORS - - virtual bool start (); //!< begin streaming i/o - virtual bool stop (); //!< stop streaming i/o - - /*! - * \returns \p nbytes if write was successfully enqueued, else -1. - * Will block if no free buffers available. - */ - virtual int write (const void *buffer, int nbytes); - - /*! - * \returns number of bytes read or -1 if error. - * number of bytes read will be <= nbytes. - * Will block if no input available. - */ - virtual int read (void *buffer, int nbytes); - - /* - * block until all outstanding writes have completed - */ - virtual void wait_for_completion (); - - void free_list_add (struct libusb_transfer *lut); - void completed_list_add (struct libusb_transfer *lut); - struct libusb_transfer *free_list_get (); - struct libusb_transfer *completed_list_get (); - - // accessor to work from callback context - fusb_devhandle_libusb1* get_fusb_devhandle_libusb1 () const { - return d_devhandle; - } -}; - -#endif /* _FUSB_LINUX1_H_ */ - diff --git a/usrp/host/lib/fusb_linux.cc b/usrp/host/lib/fusb_linux.cc deleted file mode 100644 index 6c484569f..000000000 --- a/usrp/host/lib/fusb_linux.cc +++ /dev/null @@ -1,692 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <fusb_linux.h> -#include <usb.h> // libusb header -#include <stdexcept> -#ifdef HAVE_LINUX_COMPILER_H -#include <linux/compiler.h> -#endif -#include <linux/usbdevice_fs.h> // interface to kernel portion of user mode usb driver -#include <sys/ioctl.h> -#include <assert.h> -#include <string.h> -#include <algorithm> -#include <errno.h> -#include <string.h> -#include <cstdio> - -#define MINIMIZE_TX_BUFFERING 1 // must be defined to 0 or 1 - - -static const int MAX_BLOCK_SIZE = fusb_sysconfig::max_block_size(); // hard limit -static const int DEFAULT_BLOCK_SIZE = MAX_BLOCK_SIZE; -static const int DEFAULT_BUFFER_SIZE = 4 * (1L << 20); // 4 MB / endpoint - - -// Totally evil and fragile extraction of file descriptor from -// guts of libusb. They don't install usbi.h, which is what we'd need -// to do this nicely. -// -// FIXME if everything breaks someday in the future, look here... - -static int -fd_from_usb_dev_handle (usb_dev_handle *udh) -{ - return *((int *) udh); -} - -inline static void -urb_set_ephandle (usbdevfs_urb *urb, fusb_ephandle_linux *handle) -{ - urb->usercontext = handle; -} - -inline static fusb_ephandle_linux * -urb_get_ephandle (usbdevfs_urb *urb) -{ - return (fusb_ephandle_linux *) urb->usercontext; -} - -// ------------------------------------------------------------------------ -// USB request block (urb) allocation -// ------------------------------------------------------------------------ - -static usbdevfs_urb * -alloc_urb (fusb_ephandle_linux *self, int buffer_length, int endpoint, - bool input_p, unsigned char *write_buffer) -{ - usbdevfs_urb *urb = new usbdevfs_urb; - memset (urb, 0, sizeof (*urb)); - - urb->buffer_length = buffer_length; - - // We allocate dedicated memory only for input buffers. - // For output buffers we reuse the same buffer (the kernel - // copies the data at submital time) - - if (input_p) - urb->buffer = new unsigned char [buffer_length]; - else - urb->buffer = write_buffer; - - // init common values - - urb->type = USBDEVFS_URB_TYPE_BULK; - urb->endpoint = (endpoint & 0x7f) | (input_p ? 0x80 : 0); - - // USBDEVFS_URB_QUEUE_BULK goes away in linux 2.5, but is needed if - // we are using a 2.4 usb-uhci host controller driver. This is - // unlikely since we're almost always going to be plugged into a - // high speed host controller (ehci) -#if 0 && defined (USBDEVFS_URB_QUEUE_BULK) - urb->flags = USBDEVFS_URB_QUEUE_BULK; -#endif - - urb->signr = 0; - urb_set_ephandle (urb, self); - - return urb; -} - -static void -free_urb (usbdevfs_urb *urb) -{ - // if this was an input urb, free the buffer - if (urb->endpoint & 0x80) - delete [] ((unsigned char *) urb->buffer); - - delete urb; -} - -// ------------------------------------------------------------------------ -// device handle -// ------------------------------------------------------------------------ - -fusb_devhandle_linux::fusb_devhandle_linux (usb_dev_handle *udh) - : fusb_devhandle (udh) -{ - // that's all -} - -fusb_devhandle_linux::~fusb_devhandle_linux () -{ - // if there are any pending requests, cancel them and free the urbs. - - std::list<usbdevfs_urb*>::reverse_iterator it; - - for (it = d_pending_rqsts.rbegin (); it != d_pending_rqsts.rend (); it++){ - _cancel_urb (*it); - free_urb (*it); - } -} - -fusb_ephandle * -fusb_devhandle_linux::make_ephandle (int endpoint, bool input_p, - int block_size, int nblocks) -{ - return new fusb_ephandle_linux (this, endpoint, input_p, - block_size, nblocks); -} - - -// Attempt to cancel all transactions associated with eph. - -void -fusb_devhandle_linux::_cancel_pending_rqsts (fusb_ephandle_linux *eph) -{ - std::list<usbdevfs_urb*>::reverse_iterator it; - - for (it = d_pending_rqsts.rbegin (); it != d_pending_rqsts.rend (); it++){ - if (urb_get_ephandle (*it) == eph) - _cancel_urb (*it); - } -} - -void -fusb_devhandle_linux::pending_add (usbdevfs_urb *urb) -{ - d_pending_rqsts.push_back (urb); -} - -usbdevfs_urb * -fusb_devhandle_linux::pending_get () -{ - if (d_pending_rqsts.empty ()) - return 0; - - usbdevfs_urb *urb = d_pending_rqsts.front (); - d_pending_rqsts.pop_front (); - return urb; -} - -bool -fusb_devhandle_linux::pending_remove (usbdevfs_urb *urb) -{ - std::list<usbdevfs_urb*>::iterator result = find (d_pending_rqsts.begin (), - d_pending_rqsts.end (), - urb); - if (result == d_pending_rqsts.end ()){ - fprintf (stderr, "fusb::pending_remove: failed to find urb in pending_rqsts: %p\n", urb); - return false; - } - d_pending_rqsts.erase (result); - return true; -} - -/* - * Submit the urb to the kernel. - * iff successful, the urb will be placed on the devhandle's pending list. - */ -bool -fusb_devhandle_linux::_submit_urb (usbdevfs_urb *urb) -{ - int ret; - - ret = ioctl (fd_from_usb_dev_handle (d_udh), USBDEVFS_SUBMITURB, urb); - if (ret < 0){ - perror ("fusb::_submit_urb"); - return false; - } - - pending_add (urb); - return true; -} - -/* - * Attempt to cancel the in pending or in-progress urb transaction. - * Return true iff transaction was sucessfully cancelled. - * - * Failure to cancel should not be considered a problem. This frequently - * occurs if the transaction has already completed in the kernel but hasn't - * yet been reaped by the user mode code. - * - * urbs which were cancelled have their status field set to -ENOENT when - * they are reaped. - */ -bool -fusb_devhandle_linux::_cancel_urb (usbdevfs_urb *urb) -{ - int ret = ioctl (fd_from_usb_dev_handle (d_udh), USBDEVFS_DISCARDURB, urb); - if (ret < 0){ - // perror ("fusb::_cancel_urb"); - return false; - } - return true; -} - -/* - * Check with the kernel and see if any of our outstanding requests - * have completed. For each completed transaction, remove it from the - * devhandle's pending list and append it to the completed list for - * the corresponding endpoint. - * - * If any transactions are reaped return true. - * - * If ok_to_block_p is true, then this will block until at least one - * transaction completes or an unrecoverable error occurs. - */ -bool -fusb_devhandle_linux::_reap (bool ok_to_block_p) -{ - int ret; - int nreaped = 0; - usbdevfs_urb *urb = 0; - - int fd = fd_from_usb_dev_handle (d_udh); - - // try to reap as many as possible without blocking... - - while ((ret = ioctl (fd, USBDEVFS_REAPURBNDELAY, &urb)) == 0){ - if (urb->status != 0 && urb->status != -ENOENT){ - fprintf (stderr, "_reap: usb->status = %d, actual_length = %5d\n", - urb->status, urb->actual_length); - } - pending_remove (urb); - urb_get_ephandle (urb)->completed_list_add (urb); - nreaped++; - } - - if (nreaped > 0) // if we got any, return w/o blocking - return true; - - if (!ok_to_block_p) - return false; - - ret = ioctl (fd, USBDEVFS_REAPURB, &urb); - if (ret < 0){ - perror ("fusb::_reap"); - return false; - } - - pending_remove (urb); - urb_get_ephandle (urb)->completed_list_add (urb); - return true; -} - -void -fusb_devhandle_linux::_wait_for_completion () -{ - while (!d_pending_rqsts.empty ()) - if (!_reap(true)) - break; -} -// ------------------------------------------------------------------------ -// end point handle -// ------------------------------------------------------------------------ - -fusb_ephandle_linux::fusb_ephandle_linux (fusb_devhandle_linux *devhandle, - int endpoint, - bool input_p, - int block_size, int nblocks) - : fusb_ephandle (endpoint, input_p, block_size, nblocks), - d_devhandle (devhandle), - d_write_work_in_progress (0), d_write_buffer (0), - d_read_work_in_progress (0), d_read_buffer (0), d_read_buffer_end (0) -{ - - if (d_block_size < 0 || d_block_size > MAX_BLOCK_SIZE) - throw std::out_of_range ("fusb_ephandle_linux: block_size"); - - if (d_nblocks < 0) - throw std::out_of_range ("fusb_ephandle_linux: nblocks"); - - if (d_block_size == 0) - d_block_size = DEFAULT_BLOCK_SIZE; - - if (d_nblocks == 0) - d_nblocks = std::max (1, DEFAULT_BUFFER_SIZE / d_block_size); - - if (!d_input_p) - if (!MINIMIZE_TX_BUFFERING) - d_write_buffer = new unsigned char [d_block_size]; - - if (0) - fprintf(stderr, "fusb_ephandle_linux::ctor: d_block_size = %d d_nblocks = %d\n", - d_block_size, d_nblocks); - - // allocate urbs - - for (int i = 0; i < d_nblocks; i++) - d_free_list.push_back (alloc_urb (this, d_block_size, d_endpoint, - d_input_p, d_write_buffer)); -} - -fusb_ephandle_linux::~fusb_ephandle_linux () -{ - stop (); - - usbdevfs_urb *urb; - - while ((urb = free_list_get ()) != 0) - free_urb (urb); - - while ((urb = completed_list_get ()) != 0) - free_urb (urb); - - if (d_write_work_in_progress) - free_urb (d_write_work_in_progress); - - delete [] d_write_buffer; - - if (d_read_work_in_progress) - free_urb (d_read_work_in_progress); -} - -// ---------------------------------------------------------------- - -bool -fusb_ephandle_linux::start () -{ - if (d_started) - return true; // already running - - d_started = true; - - if (d_input_p){ // fire off all the reads - usbdevfs_urb *urb; - - int nerrors = 0; - while ((urb = free_list_get ()) != 0 && nerrors < d_nblocks){ - if (!submit_urb (urb)) - nerrors++; - } - } - - return true; -} - -// -// kill all i/o in progress. -// kill any completed but unprocessed transactions. -// -bool -fusb_ephandle_linux::stop () -{ - if (!d_started) - return true; - - if (d_write_work_in_progress){ - free_list_add (d_write_work_in_progress); - d_write_work_in_progress = 0; - } - - if (d_read_work_in_progress){ - free_list_add (d_read_work_in_progress); - d_read_work_in_progress = 0; - d_read_buffer = 0; - d_read_buffer_end = 0; - } - - d_devhandle->_cancel_pending_rqsts (this); - d_devhandle->_reap (false); - - while (1){ - usbdevfs_urb *urb; - while ((urb = completed_list_get ()) != 0) - free_list_add (urb); - - if (d_free_list.size () == (unsigned) d_nblocks) - break; - - if (!d_devhandle->_reap(true)) - break; - } - - d_started = false; - return true; -} - -// ---------------------------------------------------------------- -// routines for writing -// ---------------------------------------------------------------- - -#if (MINIMIZE_TX_BUFFERING) - -int -fusb_ephandle_linux::write(const void *buffer, int nbytes) -{ - if (!d_started) - return -1; - - if (d_input_p) - return -1; - - assert(nbytes % 512 == 0); - - unsigned char *src = (unsigned char *) buffer; - - int n = 0; - while (n < nbytes){ - - usbdevfs_urb *urb = get_write_work_in_progress(); - if (!urb) - return -1; - assert(urb->actual_length == 0); - int m = std::min(nbytes - n, MAX_BLOCK_SIZE); - urb->buffer = src; - urb->buffer_length = m; - - n += m; - src += m; - - if (!submit_urb(urb)) - return -1; - - d_write_work_in_progress = 0; - } - - return n; -} - -#else - -int -fusb_ephandle_linux::write (const void *buffer, int nbytes) -{ - if (!d_started) - return -1; - - if (d_input_p) - return -1; - - unsigned char *src = (unsigned char *) buffer; - - int n = 0; - while (n < nbytes){ - - usbdevfs_urb *urb = get_write_work_in_progress (); - if (!urb) - return -1; - unsigned char *dst = (unsigned char *) urb->buffer; - int m = std::min (nbytes - n, urb->buffer_length - urb->actual_length); - - memcpy (&dst[urb->actual_length], &src[n], m); - urb->actual_length += m; - n += m; - - if (urb->actual_length == urb->buffer_length){ - if (!submit_urb (urb)) - return -1; - d_write_work_in_progress = 0; - } - } - - return n; -} - -#endif - -usbdevfs_urb * -fusb_ephandle_linux::get_write_work_in_progress () -{ - // if we've already got some work in progress, return it - - if (d_write_work_in_progress) - return d_write_work_in_progress; - - while (1){ - - reap_complete_writes (); - - usbdevfs_urb *urb = free_list_get (); - - if (urb != 0){ - assert (urb->actual_length == 0); - d_write_work_in_progress = urb; - return urb; - } - - // The free list is empty. Tell the device handle to reap. - // Anything it reaps for us will end up on our completed list. - - if (!d_devhandle->_reap (true)) - return 0; - } -} - -void -fusb_ephandle_linux::reap_complete_writes () -{ - // take a look at the completed_list and xfer to free list after - // checking for errors. - - usbdevfs_urb *urb; - - while ((urb = completed_list_get ()) != 0){ - - // Check for any errors or short writes that were reported in the urb. - // The kernel sets status, actual_length and error_count. - // error_count is only used for ISO xfers. - // status is 0 if successful, else is an errno kind of thing - - if (urb->status != 0){ - fprintf (stderr, "fusb: (status %d) %s\n", urb->status, strerror (-urb->status)); - } - else if (urb->actual_length != urb->buffer_length){ - fprintf (stderr, "fusb: short write xfer: %d != %d\n", - urb->actual_length, urb->buffer_length); - } - - free_list_add (urb); - } -} - -void -fusb_ephandle_linux::wait_for_completion () -{ - d_devhandle->_wait_for_completion (); -} - -// ---------------------------------------------------------------- -// routines for reading -// ---------------------------------------------------------------- - -int -fusb_ephandle_linux::read (void *buffer, int nbytes) -{ - if (!d_started) - return -1; - - if (!d_input_p) - return -1; - - unsigned char *dst = (unsigned char *) buffer; - - int n = 0; - while (n < nbytes){ - - if (d_read_buffer >= d_read_buffer_end) - if (!reload_read_buffer ()) - return -1; - - int m = std::min (nbytes - n, (int) (d_read_buffer_end - d_read_buffer)); - - memcpy (&dst[n], d_read_buffer, m); - d_read_buffer += m; - n += m; - } - - return n; -} - -bool -fusb_ephandle_linux::reload_read_buffer () -{ - assert (d_read_buffer >= d_read_buffer_end); - - usbdevfs_urb *urb; - - if (d_read_work_in_progress){ - // We're done with this urb. Fire off a read to refill it. - urb = d_read_work_in_progress; - d_read_work_in_progress = 0; - d_read_buffer = 0; - d_read_buffer_end = 0; - urb->actual_length = 0; - if (!submit_urb (urb)) - return false; - } - - while (1){ - - while ((urb = completed_list_get ()) == 0) - if (!d_devhandle->_reap (true)) - return false; - - // check result of completed read - - if (urb->status != 0){ - // We've got a problem. Report it and fail. - fprintf (stderr, "fusb: (rd status %d) %s\n", urb->status, strerror (-urb->status)); - urb->actual_length = 0; - free_list_add (urb); - return false; - } - - // we've got a happy urb, full of data... - - d_read_work_in_progress = urb; - d_read_buffer = (unsigned char *) urb->buffer; - d_read_buffer_end = d_read_buffer + urb->actual_length; - - return true; - } -} - -// ---------------------------------------------------------------- - -void -fusb_ephandle_linux::free_list_add (usbdevfs_urb *urb) -{ - assert (urb_get_ephandle (urb) == this); - urb->actual_length = 0; - d_free_list.push_back (urb); -} - -usbdevfs_urb * -fusb_ephandle_linux::free_list_get () -{ - if (d_free_list.empty ()) - return 0; - - usbdevfs_urb *urb = d_free_list.front (); - d_free_list.pop_front (); - return urb; -} - -void -fusb_ephandle_linux::completed_list_add (usbdevfs_urb *urb) -{ - assert (urb_get_ephandle (urb) == this); - d_completed_list.push_back (urb); -} - -usbdevfs_urb * -fusb_ephandle_linux::completed_list_get () -{ - if (d_completed_list.empty ()) - return 0; - - usbdevfs_urb *urb = d_completed_list.front (); - d_completed_list.pop_front (); - return urb; -} - -/* - * Submit the urb. If successful the urb ends up on the devhandle's - * pending list, otherwise, it's back on our free list. - */ -bool -fusb_ephandle_linux::submit_urb (usbdevfs_urb *urb) -{ - if (!d_devhandle->_submit_urb (urb)){ // FIXME record the problem somewhere - fprintf (stderr, "_submit_urb failed\n"); - free_list_add (urb); - return false; - } - return true; -} diff --git a/usrp/host/lib/fusb_linux.h b/usrp/host/lib/fusb_linux.h deleted file mode 100644 index 107e1af70..000000000 --- a/usrp/host/lib/fusb_linux.h +++ /dev/null @@ -1,116 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -// Fast USB interface - -#ifndef _FUSB_LINUX_H_ -#define _FUSB_LINUX_H_ - -#include <fusb.h> -#include <list> - -struct usbdevfs_urb; -class fusb_ephandle_linux; - -/*! - * \brief linux specific implementation of fusb_devhandle using usbdevice_fs - */ -class fusb_devhandle_linux : public fusb_devhandle { -private: - std::list<usbdevfs_urb*> d_pending_rqsts; - - void pending_add (usbdevfs_urb *urb); - bool pending_remove (usbdevfs_urb *urb); - usbdevfs_urb * pending_get (); - - -public: - // CREATORS - fusb_devhandle_linux (usb_dev_handle *udh); - virtual ~fusb_devhandle_linux (); - - // MANIPULATORS - virtual fusb_ephandle *make_ephandle (int endpoint, bool input_p, - int block_size = 0, int nblocks = 0); - - // internal use only - bool _submit_urb (usbdevfs_urb *urb); - bool _cancel_urb (usbdevfs_urb *urb); - void _cancel_pending_rqsts (fusb_ephandle_linux *eph); - bool _reap (bool ok_to_block_p); - void _wait_for_completion (); -}; - -/*! - * \brief linux specific implementation of fusb_ephandle using usbdevice_fs - */ - -class fusb_ephandle_linux : public fusb_ephandle { -private: - fusb_devhandle_linux *d_devhandle; - std::list<usbdevfs_urb*> d_free_list; - std::list<usbdevfs_urb*> d_completed_list; - usbdevfs_urb *d_write_work_in_progress; - unsigned char *d_write_buffer; - usbdevfs_urb *d_read_work_in_progress; - unsigned char *d_read_buffer; - unsigned char *d_read_buffer_end; - - usbdevfs_urb *get_write_work_in_progress (); - void reap_complete_writes (); - bool reload_read_buffer (); - bool submit_urb (usbdevfs_urb *urb); - -public: - fusb_ephandle_linux (fusb_devhandle_linux *dh, int endpoint, bool input_p, - int block_size = 0, int nblocks = 0); - virtual ~fusb_ephandle_linux (); - - virtual bool start (); //!< begin streaming i/o - virtual bool stop (); //!< stop streaming i/o - - /*! - * \returns \p nbytes if write was successfully enqueued, else -1. - * Will block if no free buffers available. - */ - virtual int write (const void *buffer, int nbytes); - - /*! - * \returns number of bytes read or -1 if error. - * number of bytes read will be <= nbytes. - * Will block if no input available. - */ - virtual int read (void *buffer, int nbytes); - - /* - * block until all outstanding writes have completed - */ - virtual void wait_for_completion (); - - // internal use only - void free_list_add (usbdevfs_urb *urb); - void completed_list_add (usbdevfs_urb *urb); - usbdevfs_urb *free_list_get (); // pop and return head of list or 0 - usbdevfs_urb *completed_list_get (); // pop and return head of list or 0 -}; - -#endif /* _FUSB_LINUX_H_ */ diff --git a/usrp/host/lib/fusb_ra_wb.cc b/usrp/host/lib/fusb_ra_wb.cc deleted file mode 100644 index 699a34b39..000000000 --- a/usrp/host/lib/fusb_ra_wb.cc +++ /dev/null @@ -1,258 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003,2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <fusb_ra_wb.h> -#include <usb.h> - -#include <stdio.h> -#include <errno.h> -#include <string.h> - -#include <sys/event.h> -#include <dev/usb/usb.h> - -static const int USB_TIMEOUT = 1000; // in milliseconds - -// the following comment and function is from fusb_linux.cc -#if 0 -// Totally evil and fragile extraction of file descriptor from -// guts of libusb. They don't install usbi.h, which is what we'd need -// to do this nicely. -// -// FIXME if everything breaks someday in the future, look here... - -static int -fd_from_usb_dev_handle (usb_dev_handle *udh) -{ - return *((int *) udh); -} -#endif - -// the control endpoint doesn't actually do us any good so here is a -// new "fragile extraction" -static int -ep_fd_from_usb_dev_handle (usb_dev_handle *udh, int endpoint) -{ - struct usb_dev_handle_kludge2 { // see also usrp_prims.cc - int fd; - struct usb_bus *bus; - struct usb_device *device; - int config; - int interface; - int altsetting; - void *impl_info; - }; - struct bsd_usb_dev_handle_info_kludge { - int ep_fd[USB_MAX_ENDPOINTS]; - }; - struct bsd_usb_dev_handle_info_kludge *info - = (struct bsd_usb_dev_handle_info_kludge *) - ((struct usb_dev_handle_kludge2 *)udh)->impl_info; - return info->ep_fd[UE_GET_ADDR(endpoint)]; -} - - -fusb_devhandle_ra_wb::fusb_devhandle_ra_wb (usb_dev_handle *udh) - : fusb_devhandle (udh) -{ - // that's it -} - -fusb_devhandle_ra_wb::~fusb_devhandle_ra_wb () -{ - // nop -} - -fusb_ephandle * -fusb_devhandle_ra_wb::make_ephandle (int endpoint, bool input_p, - int block_size, int nblocks) -{ - return new fusb_ephandle_ra_wb (this, endpoint, input_p, - block_size, nblocks); -} - -// ---------------------------------------------------------------- - -fusb_ephandle_ra_wb::fusb_ephandle_ra_wb (fusb_devhandle_ra_wb *dh, - int endpoint, bool input_p, - int block_size, int nblocks) - : fusb_ephandle (endpoint, input_p, block_size, nblocks), - d_devhandle (dh), d_ra_wb_on (false) -{ - // that's it -} - -fusb_ephandle_ra_wb::~fusb_ephandle_ra_wb () -{ - // nop -} - -bool -fusb_ephandle_ra_wb::start () -{ - d_started = true; - - char buf = '\0'; - int fd; - - // this is to cause libusb to open the endpoint - if (!d_input_p) { - write(&buf, 0); - fd = ep_fd_from_usb_dev_handle (d_devhandle->get_usb_dev_handle(), - d_endpoint); - } - else { - read(&buf, 0); - fd = ep_fd_from_usb_dev_handle (d_devhandle->get_usb_dev_handle(), - d_endpoint|USB_ENDPOINT_IN); - } - - // enable read ahead/write behind - int ret; - struct usb_bulk_ra_wb_opt opts; - int enable = 1; - - opts.ra_wb_buffer_size = d_block_size*d_nblocks; - opts.ra_wb_request_size = d_block_size; -// fprintf (stderr, "setting buffer size to %d, request size to %d\n", -// opts.ra_wb_buffer_size, opts.ra_wb_request_size); - if (!d_input_p) { - ret = ioctl (fd, USB_SET_BULK_WB_OPT, &opts); - if (ret < 0) - fprintf (stderr, "USB_SET_BULK_WB_OPT: %s\n", strerror(errno)); - else { - ret = ioctl (fd, USB_SET_BULK_WB, &enable); - if (ret < 0) - fprintf (stderr, "USB_SET_BULK_WB: %s\n", strerror(errno)); - else - d_ra_wb_on = true; - } - } - else { - ret = ioctl (fd, USB_SET_BULK_RA_OPT, &opts); - if (ret < 0) - fprintf (stderr, "USB_SET_BULK_RA_OPT: %s\n", strerror(errno)); - else { - ret = ioctl (fd, USB_SET_BULK_RA, &enable); - if (ret < 0) - fprintf (stderr, "USB_SET_BULK_RA: %s\n", strerror(errno)); - else - d_ra_wb_on = true; - } - } - - return true; -} - -bool -fusb_ephandle_ra_wb::stop () -{ - int fd; - int ret; - int enable = 0; - if (d_ra_wb_on) { - if (!d_input_p) { - fd = ep_fd_from_usb_dev_handle (d_devhandle->get_usb_dev_handle(), - d_endpoint); - ret = ioctl (fd, USB_SET_BULK_WB, &enable); - if (ret < 0) - fprintf (stderr, "USB_SET_BULK_WB: %s\n", strerror(errno)); - else - d_ra_wb_on = false; - } - else { - fd = ep_fd_from_usb_dev_handle (d_devhandle->get_usb_dev_handle(), - d_endpoint|USB_ENDPOINT_IN); - ret = ioctl (fd, USB_SET_BULK_RA, &enable); - if (ret < 0) - fprintf (stderr, "USB_SET_BULK_RA: %s\n", strerror(errno)); - else - d_ra_wb_on = false; - } - } - - d_started = false; - return true; -} - -int -fusb_ephandle_ra_wb::write (const void *buffer, int nbytes) -{ - if (!d_started) - return -1; - - if (d_input_p) - return -1; - - return usb_bulk_write (d_devhandle->get_usb_dev_handle (), - d_endpoint, (char *) buffer, nbytes, USB_TIMEOUT); -} - -int -fusb_ephandle_ra_wb::read (void *buffer, int nbytes) -{ - if (!d_started) - return -1; - - if (!d_input_p) - return -1; - - return usb_bulk_read (d_devhandle->get_usb_dev_handle (), - d_endpoint|USB_ENDPOINT_IN, (char *) buffer, nbytes, - USB_TIMEOUT); -} - -void -fusb_ephandle_ra_wb::wait_for_completion () -{ - // as the driver is implemented this only makes sense for write - if (d_ra_wb_on && !d_input_p) { - int fd = ep_fd_from_usb_dev_handle (d_devhandle->get_usb_dev_handle(), - d_endpoint); - int kq = kqueue(); - if (kq < 0) - return; - struct kevent evt; - int nevents; - EV_SET (&evt, fd, EVFILT_WRITE, EV_ADD | EV_ENABLE, 0, 0, 0/*NULL*/); - nevents = kevent (kq, &evt, 1, &evt, 1, NULL); - if (nevents < 1) { - close(kq); - return; - } - while (!(evt.flags & EV_ERROR) && evt.data < (d_block_size*d_nblocks)) { - // it's a busy loop, but that's all I can do at the moment - nevents = kevent (kq, NULL, 0, &evt, 1, NULL); - // let's see if this improves the test_usrp_standard_tx throughput & - // "CPU usage" by looping less frequently - struct timeval timeout; - timeout.tv_sec = 0; - timeout.tv_usec = 1000; // 1 ms - select (0, NULL, NULL, NULL, &timeout); - } - close (kq); - } -} diff --git a/usrp/host/lib/fusb_ra_wb.h b/usrp/host/lib/fusb_ra_wb.h deleted file mode 100644 index 233976abe..000000000 --- a/usrp/host/lib/fusb_ra_wb.h +++ /dev/null @@ -1,84 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003,2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _FUSB_RA_WB_H_ -#define _FUSB_RA_WB_H_ - -#include <fusb.h> - -/*! - * \brief generic implementation of fusb_devhandle using only libusb - */ -class fusb_devhandle_ra_wb : public fusb_devhandle -{ -public: - // CREATORS - fusb_devhandle_ra_wb (usb_dev_handle *udh); - virtual ~fusb_devhandle_ra_wb (); - - // MANIPULATORS - virtual fusb_ephandle *make_ephandle (int endpoint, bool input_p, - int block_size = 0, int nblocks = 0); -}; - - -/*! - * \brief generic implementation of fusb_ephandle using only libusb - */ -class fusb_ephandle_ra_wb : public fusb_ephandle -{ -private: - fusb_devhandle_ra_wb *d_devhandle; - bool d_ra_wb_on; - -public: - // CREATORS - fusb_ephandle_ra_wb (fusb_devhandle_ra_wb *dh, int endpoint, bool input_p, - int block_size = 0, int nblocks = 0); - virtual ~fusb_ephandle_ra_wb (); - - // MANIPULATORS - - virtual bool start (); //!< begin streaming i/o - virtual bool stop (); //!< stop streaming i/o - - /*! - * \returns \p nbytes if write was successfully enqueued, else -1. - * Will block if no free buffers available. - */ - virtual int write (const void *buffer, int nbytes); - - /*! - * \returns number of bytes read or -1 if error. - * number of bytes read will be <= nbytes. - * Will block if no input available. - */ - virtual int read (void *buffer, int nbytes); - - /* - * block until all outstanding writes have completed - */ - virtual void wait_for_completion (); -}; - -#endif /* _FUSB_RA_WB_H_ */ - diff --git a/usrp/host/lib/fusb_sysconfig_darwin.cc b/usrp/host/lib/fusb_sysconfig_darwin.cc deleted file mode 100644 index 68dd64815..000000000 --- a/usrp/host/lib/fusb_sysconfig_darwin.cc +++ /dev/null @@ -1,49 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003,2009 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <fusb.h> -#include <fusb_darwin.h> - -static const int MAX_BLOCK_SIZE = 32 * 1024; // hard limit -static const int FUSB_BUFFER_SIZE = 2 * (1L << 20); // 2 MB - -fusb_devhandle * -fusb_sysconfig::make_devhandle (usb_dev_handle *udh, libusb_context *ctx) -{ - return new fusb_devhandle_darwin (udh); -} - -int fusb_sysconfig::max_block_size () -{ - return MAX_BLOCK_SIZE; -} - -int fusb_sysconfig::default_block_size () -{ - return fusb_sysconfig::max_block_size (); -} - -int fusb_sysconfig::default_buffer_size () -{ - return FUSB_BUFFER_SIZE; -} - diff --git a/usrp/host/lib/fusb_sysconfig_generic.cc b/usrp/host/lib/fusb_sysconfig_generic.cc deleted file mode 100644 index e0986510c..000000000 --- a/usrp/host/lib/fusb_sysconfig_generic.cc +++ /dev/null @@ -1,48 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003,2009 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <fusb.h> -#include <fusb_generic.h> - -static const int MAX_BLOCK_SIZE = 16 * 1024; // hard limit -static const int FUSB_BUFFER_SIZE = 2 * (1L << 20); // 2 MB - -fusb_devhandle * -fusb_sysconfig::make_devhandle (usb_dev_handle *udh, libusb_context *ctx) -{ - return new fusb_devhandle_generic (udh); -} - -int fusb_sysconfig::max_block_size () -{ - return MAX_BLOCK_SIZE; -} - -int fusb_sysconfig::default_block_size () -{ - return fusb_sysconfig::max_block_size (); -} - -int fusb_sysconfig::default_buffer_size () -{ - return FUSB_BUFFER_SIZE; -} diff --git a/usrp/host/lib/fusb_sysconfig_libusb1.cc b/usrp/host/lib/fusb_sysconfig_libusb1.cc deleted file mode 100644 index 46daf561a..000000000 --- a/usrp/host/lib/fusb_sysconfig_libusb1.cc +++ /dev/null @@ -1,51 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003,2009 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <fusb.h> -#include <fusb_libusb1.h> - -static const int MAX_BLOCK_SIZE = 16 * 1024; // hard limit -static const int DEFAULT_BLOCK_SIZE = 4 * 1024; -static const int FUSB_BUFFER_SIZE = 1 * (1L << 20); // 1 MB - -struct libusb_context; - -fusb_devhandle * -fusb_sysconfig::make_devhandle (libusb_device_handle *udh, libusb_context *ctx) -{ - return new fusb_devhandle_libusb1 (udh, ctx); -} - -int fusb_sysconfig::max_block_size () -{ - return MAX_BLOCK_SIZE; -} - -int fusb_sysconfig::default_block_size () -{ - return DEFAULT_BLOCK_SIZE; -} - -int fusb_sysconfig::default_buffer_size () -{ - return FUSB_BUFFER_SIZE; -} diff --git a/usrp/host/lib/fusb_sysconfig_linux.cc b/usrp/host/lib/fusb_sysconfig_linux.cc deleted file mode 100644 index e33b90ba4..000000000 --- a/usrp/host/lib/fusb_sysconfig_linux.cc +++ /dev/null @@ -1,49 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003,2009 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <fusb.h> -#include <fusb_linux.h> - -static const int MAX_BLOCK_SIZE = 16 * 1024; // hard limit -static const int DEFAULT_BLOCK_SIZE = 4 * 1024; // fewer kernel memory problems -static const int FUSB_BUFFER_SIZE = 1 * (1L << 20); // 1MB - -fusb_devhandle * -fusb_sysconfig::make_devhandle (usb_dev_handle *udh, libusb_context *ctx) -{ - return new fusb_devhandle_linux (udh); -} - -int fusb_sysconfig::max_block_size () -{ - return MAX_BLOCK_SIZE; -} - -int fusb_sysconfig::default_block_size () -{ - return DEFAULT_BLOCK_SIZE; -} - -int fusb_sysconfig::default_buffer_size () -{ - return FUSB_BUFFER_SIZE; -} diff --git a/usrp/host/lib/fusb_sysconfig_ra_wb.cc b/usrp/host/lib/fusb_sysconfig_ra_wb.cc deleted file mode 100644 index c527e3099..000000000 --- a/usrp/host/lib/fusb_sysconfig_ra_wb.cc +++ /dev/null @@ -1,52 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003,2006,2009 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <fusb.h> -#include <fusb_ra_wb.h> - -//static const int MAX_BLOCK_SIZE = 16 * 1024; // hard limit -// there's no hard limit, even before making any changes to the driver -// 64k is empirically a pretty good number -static const int MAX_BLOCK_SIZE = 64 * 1024; -// there is a limit of 1 MB in the driver for the buffer size -static const int FUSB_BUFFER_SIZE = 256 * (1L << 10); // 256 kB - -fusb_devhandle * -fusb_sysconfig::make_devhandle (usb_dev_handle *udh, libusb_context *ctx) -{ - return new fusb_devhandle_ra_wb (udh); -} - -int fusb_sysconfig::max_block_size () -{ - return MAX_BLOCK_SIZE; -} - -int fusb_sysconfig::default_block_size () -{ - return fusb_sysconfig::max_block_size (); -} - -int fusb_sysconfig::default_buffer_size () -{ - return FUSB_BUFFER_SIZE; -} diff --git a/usrp/host/lib/fusb_sysconfig_win32.cc b/usrp/host/lib/fusb_sysconfig_win32.cc deleted file mode 100644 index fb4be8829..000000000 --- a/usrp/host/lib/fusb_sysconfig_win32.cc +++ /dev/null @@ -1,48 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003,2005,2009 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <fusb.h> -#include <fusb_win32.h> - -static const int MAX_BLOCK_SIZE = 64 * 1024; // Windows kernel hard limit -static const int FUSB_BUFFER_SIZE = 2 * (1L << 20); // 2 MB - -fusb_devhandle * -fusb_sysconfig::make_devhandle (usb_dev_handle *udh, libusb_context *ctx) -{ - return new fusb_devhandle_win32 (udh); -} - -int fusb_sysconfig::max_block_size () -{ - return MAX_BLOCK_SIZE; -} - -int fusb_sysconfig::default_block_size () -{ - return fusb_sysconfig::max_block_size (); -} - -int fusb_sysconfig::default_buffer_size () -{ - return FUSB_BUFFER_SIZE; -} diff --git a/usrp/host/lib/fusb_win32.cc b/usrp/host/lib/fusb_win32.cc deleted file mode 100644 index 8c218534b..000000000 --- a/usrp/host/lib/fusb_win32.cc +++ /dev/null @@ -1,267 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003,2005 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <fusb_win32.h> -#include <usb.h> -#include <assert.h> -#include <stdexcept> -#include <string.h> -#include <cstdio> - -static const int MAX_BLOCK_SIZE = fusb_sysconfig::max_block_size(); -static const int DEFAULT_BLOCK_SIZE = MAX_BLOCK_SIZE; -static const int DEFAULT_BUFFER_SIZE = 16 * (1L << 20); // 16 MB / endpoint - - -static const int USB_TIMEOUT = 1000; // in milliseconds - - -fusb_devhandle_win32::fusb_devhandle_win32 (usb_dev_handle *udh) - : fusb_devhandle (udh) -{ - // that's it -} - -fusb_devhandle_win32::~fusb_devhandle_win32 () -{ - // nop -} - -fusb_ephandle * -fusb_devhandle_win32::make_ephandle (int endpoint, bool input_p, - int block_size, int nblocks) -{ - return new fusb_ephandle_win32 (this, endpoint, input_p, - block_size, nblocks); -} - -// ---------------------------------------------------------------- - -fusb_ephandle_win32::fusb_ephandle_win32 (fusb_devhandle_win32 *dh, - int endpoint, bool input_p, - int block_size, int nblocks) - : fusb_ephandle (endpoint, input_p, block_size, nblocks), - d_devhandle (dh), d_input_leftover(0),d_output_short(0) -{ - if (d_block_size < 0 || d_block_size > MAX_BLOCK_SIZE) - throw std::out_of_range ("fusb_ephandle_win32: block_size"); - - if (d_nblocks < 0) - throw std::out_of_range ("fusb_ephandle_win32: nblocks"); - - if (d_block_size == 0) - d_block_size = DEFAULT_BLOCK_SIZE; - - if (d_nblocks == 0) - d_nblocks = std::max (1, DEFAULT_BUFFER_SIZE / d_block_size); - - d_buffer = new char [d_block_size*d_nblocks]; - d_context = new void * [d_nblocks]; - - // allocate contexts - - usb_dev_handle *dev = dh->get_usb_dev_handle (); - int i; - - if (d_input_p) - endpoint |= USB_ENDPOINT_IN; - - for (i=0; i<d_nblocks; i++) - usb_bulk_setup_async(dev, &d_context[i], endpoint); -} - -fusb_ephandle_win32::~fusb_ephandle_win32 () -{ - int i; - - stop (); - - for (i=0; i<d_nblocks; i++) - usb_free_async(&d_context[i]); - - delete [] d_buffer; - delete [] d_context; -} - -bool -fusb_ephandle_win32::start () -{ - if (d_started) - return true; // already running - - d_started = true; - - d_curr = d_nblocks-1; - d_outstanding_write = 0; - d_input_leftover =0; - d_output_short = 0; - - if (d_input_p){ // fire off all the reads - int i; - - for (i=0; i<d_nblocks; i++) { - usb_submit_async(d_context[i], (char * ) d_buffer+i*d_block_size, - d_block_size); - } - } - - return true; -} - -bool -fusb_ephandle_win32::stop () -{ - if (!d_started) - return true; - - if (!d_input_p) - wait_for_completion (); - - d_started = false; - return true; -} - -int -fusb_ephandle_win32::write (const void *buffer, int nbytes) -{ - int retval=0; - char *buf; - - if (!d_started) // doesn't matter here, but keeps semantics constant - return -1; - - if (d_input_p) - return -1; - - int bytes_to_write = nbytes; - int a=0; - - if (d_output_short != 0) { - - buf = &d_buffer[d_curr*d_block_size + d_block_size - d_output_short]; - a = std::min(nbytes, d_output_short); - memcpy(buf, buffer, a); - bytes_to_write -= a; - d_output_short -= a; - - if (d_output_short == 0) - usb_submit_async(d_context[d_curr], - &d_buffer[d_curr*d_block_size], d_block_size); - } - - while (bytes_to_write > 0) { - d_curr = (d_curr+1)%d_nblocks; - buf = &d_buffer[d_curr*d_block_size]; - - if (d_outstanding_write != d_nblocks) { - d_outstanding_write++; - } else { - retval = usb_reap_async(d_context[d_curr], USB_TIMEOUT); - if (retval < 0) { - fprintf(stderr, "%s: usb_reap_async: %s\n", - __FUNCTION__, usb_strerror()); - return retval; - } - } - - int ncopy = std::min(bytes_to_write, d_block_size); - memcpy(buf, (void *) &(((char*)buffer)[a]), ncopy); - bytes_to_write -= ncopy; - a += ncopy; - - d_output_short = d_block_size - ncopy; - if (d_output_short == 0) - usb_submit_async(d_context[d_curr], buf, d_block_size); - } - - return retval < 0 ? retval : nbytes; -} - -int -fusb_ephandle_win32::read (void *buffer, int nbytes) -{ - int retval=0; - char *buf; - - if (!d_started) // doesn't matter here, but keeps semantics constant - return -1; - - if (!d_input_p) - return -1; - - int bytes_to_read = nbytes; - - int a=0; - if (d_input_leftover != 0) { - - buf = &d_buffer[d_curr*d_block_size + d_block_size - d_input_leftover]; - a = std::min(nbytes, d_input_leftover); - memcpy(buffer, buf, a); - bytes_to_read -= a; - d_input_leftover -= a; - - if (d_input_leftover == 0) - usb_submit_async(d_context[d_curr], - &d_buffer[d_curr*d_block_size], d_block_size); - } - - while (bytes_to_read > 0) { - - d_curr = (d_curr+1)%d_nblocks; - buf = &d_buffer[d_curr*d_block_size]; - - retval = usb_reap_async(d_context[d_curr], USB_TIMEOUT); - if (retval < 0) - fprintf(stderr, "%s: usb_reap_async: %s\n", - __FUNCTION__, usb_strerror()); - - int ncopy = std::min(bytes_to_read, d_block_size); - memcpy((void *) &(((char*)buffer)[a]), buf, ncopy); - bytes_to_read -= ncopy; - a += ncopy; - - d_input_leftover = d_block_size - ncopy; - if (d_input_leftover == 0) - usb_submit_async(d_context[d_curr], buf, d_block_size); - } - - return retval < 0 ? retval : nbytes; -} - -void -fusb_ephandle_win32::wait_for_completion () -{ - int i; - - for (i=0; i<d_outstanding_write; i++) { - int context_num; - - context_num = (d_curr+d_outstanding_write+i+1)%d_nblocks; - usb_reap_async(d_context[context_num], USB_TIMEOUT); - } - - d_outstanding_write = 0; -} diff --git a/usrp/host/lib/fusb_win32.h b/usrp/host/lib/fusb_win32.h deleted file mode 100644 index 3ad2132f4..000000000 --- a/usrp/host/lib/fusb_win32.h +++ /dev/null @@ -1,90 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _FUSB_WIN32_H_ -#define _FUSB_WIN32_H_ - -#include <fusb.h> - -/*! - * \brief win32 implementation of fusb_devhandle using libusb-win32 - */ -class fusb_devhandle_win32 : public fusb_devhandle -{ -public: - // CREATORS - fusb_devhandle_win32 (usb_dev_handle *udh); - virtual ~fusb_devhandle_win32 (); - - // MANIPULATORS - virtual fusb_ephandle *make_ephandle (int endpoint, bool input_p, - int block_size = 0, int nblocks = 0); -}; - - -/*! - * \brief win32 implementation of fusb_ephandle using libusb-win32 - */ -class fusb_ephandle_win32 : public fusb_ephandle -{ -private: - fusb_devhandle_win32 *d_devhandle; - - unsigned d_curr; - unsigned d_outstanding_write; - int d_output_short; - int d_input_leftover; - void ** d_context; - char * d_buffer; - -public: - // CREATORS - fusb_ephandle_win32 (fusb_devhandle_win32 *dh, int endpoint, bool input_p, - int block_size = 0, int nblocks = 0); - virtual ~fusb_ephandle_win32 (); - - // MANIPULATORS - - virtual bool start (); //!< begin streaming i/o - virtual bool stop (); //!< stop streaming i/o - - /*! - * \returns \p nbytes if write was successfully enqueued, else -1. - * Will block if no free buffers available. - */ - virtual int write (const void *buffer, int nbytes); - - /*! - * \returns number of bytes read or -1 if error. - * number of bytes read will be <= nbytes. - * Will block if no input available. - */ - virtual int read (void *buffer, int nbytes); - - /* - * block until all outstanding writes have completed - */ - virtual void wait_for_completion (); -}; - -#endif /* _FUSB_WIN32_H_ */ - diff --git a/usrp/host/lib/gen-ratios b/usrp/host/lib/gen-ratios deleted file mode 100755 index 2250090d7..000000000 --- a/usrp/host/lib/gen-ratios +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env python -# -*- python -*- - -def how_good (x): - pof2 = [1,2,4,8,16] - if x in pof2: - return 0 - if x in map (lambda x: x+1, pof2): - return -10 - if x in map (lambda x: x-1, pof2): - return -5 - return -2 - - -def better (v1, v2): - return abs ((v1 & 0xf) - ((v1 >> 4) & 0xf)) < abs ((v2 & 0xf) - ((v2 >> 4) & 0xf)) - - -def foo (): - result = {} - for i in range (1,17): - for j in range (1,17): - i_goodness = how_good (i) - j_goodness = how_good (j) - goodness = i_goodness + j_goodness - v = ((i - 1) << 4) | (j - 1) - - key = i * j - prev = result.get (key, None) - # print "i=%3d j=%3d key=%3d good=%3d v=0x%02x prev=%s" % (i, j, key, goodness, v, prev) - - if not prev: - result[key] = (goodness, v) - elif goodness > prev[0]: - result[key] = (goodness, v) - elif goodness == prev[0] and better(v, prev[1]): - result[key] = (goodness, v) - - r = result.items () - r.sort () - for k, d in r: - print "(%3d, 0x%02x)" % (k, d[1]) - - - -foo () - - diff --git a/usrp/host/lib/gen_usrp_dbid.py b/usrp/host/lib/gen_usrp_dbid.py deleted file mode 100755 index c7d3770c1..000000000 --- a/usrp/host/lib/gen_usrp_dbid.py +++ /dev/null @@ -1,137 +0,0 @@ -#!/usr/bin/env python - -import sys -import os -import os.path -import re -from optparse import OptionParser - -def write_header(f, comment_char): - f.write(comment_char); f.write('\n') - f.write(comment_char); f.write(' Machine generated by gen_usrp_dbid.py from usrp_dbid.dat\n') - f.write(comment_char); f.write(' Do not edit by hand. All edits will be overwritten.\n') - f.write(comment_char); f.write('\n') - f.write('\n') - -def gen_dbid_py(r): - f = open('usrp_dbid.py', 'w') - comment_char = '#' - write_header(f, comment_char) - f.write(comment_char); f.write('\n') - f.write(comment_char); f.write(" USRP Daughterboard ID's\n") - f.write(comment_char); f.write('\n') - f.write('\n') - for x in r: - f.write('%-16s = %s\n' % (x[1], x[2])) - -def gen_dbid_h(r): - f = open('../include/usrp/usrp_dbid.h', 'w') - comment_char = '//' - write_header(f, comment_char) - f.write(comment_char); f.write('\n') - f.write(comment_char); f.write(" USRP Daughterboard ID's\n") - f.write(comment_char); f.write('\n') - f.write('\n') - f.write('#ifndef INCLUDED_USRP_DBID_H\n') - f.write('#define INCLUDED_USRP_DBID_H\n') - f.write('\n') - for x in r: - f.write('#define %-25s %s\n' % ('USRP_DBID_' + x[1], x[2])) - f.write('\n') - f.write('#endif /* INCLUDED_USRP_DBID_H */\n') - -def gen_dbid_cc(r): - f = open('usrp_dbid.cc', 'w') - write_header(f, '//') - head = '''/* - * Copyright 2005 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <usrp/usrp_prims.h> -#include <usrp/usrp_dbid.h> -#include <stdio.h> - -#define NELEM(x) sizeof(x)/sizeof(x[0]) - -static struct { - unsigned short dbid; - const char *name; -} dbid_map[] = { -''' - - tail = '''}; - -const std::string -usrp_dbid_to_string (int dbid) -{ - if (dbid == -1) - return "<none>"; - - if (dbid == -2) - return "<invalid EEPROM contents>"; - - for (unsigned i = 0; i < NELEM (dbid_map); i++) - if (dbid == dbid_map[i].dbid) - return dbid_map[i].name; - - char tmp[64]; - snprintf (tmp, sizeof (tmp), "Unknown (0x%04x)", dbid); - return tmp; -} -''' - f.write(head) - for x in r: - f.write(' { %-27s "%s" },\n' % ( - 'USRP_DBID_' + x[1] + ',', x[0])) - f.write(tail) - -def gen_all(src_filename): - src_file = open(src_filename, 'r') - r = [] - for line in src_file: - line = line.strip() - line = re.sub(r'\s*#.*$','', line) - if len(line) == 0: - continue - mo = re.match('"([^"]+)"\s*(0x[0-9a-fA-F]+)', line) - if mo: - str_name = mo.group(1) - id_name = str_name.upper().replace(' ', '_') - id_val = mo.group(2) - r.append((str_name, id_name, id_val)) - #sys.stdout.write('%-16s\t%-16s\t%s\n' % ('"'+str_name+'"', id_name, id_val)) - - gen_dbid_h(r) - gen_dbid_py(r) - gen_dbid_cc(r) - - -def main(): - usage = "usage: %prog [options] usrp_dbid.dat" - parser = OptionParser(usage=usage) - (options, args) = parser.parse_args() - if len(args) != 1: - parser.print_help() - sys.exit(1) - - gen_all(args[0]) - -if __name__ == '__main__': - main() diff --git a/usrp/host/lib/limbo/db_wbx.cc b/usrp/host/lib/limbo/db_wbx.cc deleted file mode 100644 index 9f1d72939..000000000 --- a/usrp/host/lib/limbo/db_wbx.cc +++ /dev/null @@ -1,953 +0,0 @@ -/* -*- c++ -*- */ -// -// Copyright 2008 Free Software Foundation, Inc. -// -// This file is part of GNU Radio -// -// GNU Radio is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either asversion 3, or (at your option) -// any later version. -// -// GNU Radio is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with GNU Radio; see the file COPYING. If not, write to -// the Free Software Foundation, Inc., 51 Franklin Street, -// Boston, MA 02110-1301, USA. - -#include <db_wbx.h> -#include <fpga_regs_standard.h> -#include <fpga_regs_common.h> -#include <usrp_prims.h> -#include <usrp_spi_defs.h> -#include <stdexcept> -#include <cmath> - -// d'board i/o pin defs - -// TX IO Pins -#define TX_POWER (1 << 0) // TX Side Power -#define RX_TXN (1 << 1) // T/R antenna switch for TX/RX port -#define TX_ENB_MIX (1 << 2) // Enable IQ mixer -#define TX_ENB_VGA (1 << 3) - -// RX IO Pins -#define RX2_RX1N (1 << 0) // antenna switch between RX2 and TX/RX port -#define RXENABLE (1 << 1) // enables mixer -#define PLL_LOCK_DETECT (1 << 2) // Muxout pin from PLL -- MUST BE INPUT -#define MReset (1 << 3) // NB6L239 Master Reset, asserted low -#define SELA0 (1 << 4) // NB6L239 SelA0 -#define SELA1 (1 << 5) // NB6L239 SelA1 -#define SELB0 (1 << 6) // NB6L239 SelB0 -#define SELB1 (1 << 7) // NB6L239 SelB1 -#define PLL_ENABLE (1 << 8) // CE Pin on PLL -#define AUX_SCLK (1 << 9) // ALT SPI SCLK -#define AUX_SDO (1 << 10) // ALT SPI SDO -#define AUX_SEN (1 << 11) // ALT SPI SEN - - -wbx_base::wbx_base(usrp_basic_sptr usrp, int which) - : db_base(usrp, which) -{ - /* - * @param usrp: instance of usrp.source_c - * @param which: which side: 0 or 1 corresponding to side A or B respectively - * @type which: int - */ - - d_first = true; - d_spi_format = SPI_FMT_MSB | SPI_FMT_HDR_0; - - // FIXME -- the write reg functions don't work with 0xffff for masks - _rx_write_oe(int(PLL_ENABLE|MReset|SELA0|SELA1|SELB0|SELB1|RX2_RX1N|RXENABLE), 0x7fff); - _rx_write_io((PLL_ENABLE|MReset|0|RXENABLE), (PLL_ENABLE|MReset|RX2_RX1N|RXENABLE)); - - _tx_write_oe((TX_POWER|RX_TXN|TX_ENB_MIX|TX_ENB_VGA), 0x7fff); - _tx_write_io((0|RX_TXN), (TX_POWER|RX_TXN|TX_ENB_MIX|TX_ENB_VGA)); // TX off, TR switch set to RX - - if(d_which == 0) { - d_spi_enable = SPI_ENABLE_RX_A; - } - else { - d_spi_enable = SPI_ENABLE_RX_B; - } - - set_auto_tr(false); - -} - -wbx_base::~wbx_base() -{ - shutdown(); -} - - -void -wbx_base::shutdown() -{ - if (!d_is_shutdown){ - d_is_shutdown = true; - // do whatever there is to do to shutdown - - write_io(d_which, d_power_off, POWER_UP); // turn off power to board - _write_oe(d_which, 0, 0xffff); // turn off all outputs - set_auto_tr(false); // disable auto transmit - } -} - -bool -wbx_base::_lock_detect() -{ - /* - * @returns: the value of the VCO/PLL lock detect bit. - * @rtype: 0 or 1 - */ - - if(_rx_read_io() & PLL_LOCK_DETECT) { - return true; - } - else { // Give it a second chance - if(_rx_read_io() & PLL_LOCK_DETECT) { - return true; - } - else { - return false; - } - } -} - -bool -wbx_base::_tx_write_oe(int value, int mask) -{ - int reg = (d_which == 0 ? FR_OE_0 : FR_OE_2); - return d_usrp->_write_fpga_reg(reg, ((mask & 0xffff) << 16) | (value & 0xffff)); -} - -bool -wbx_base::_rx_write_oe(int value, int mask) -{ - int reg = (d_which == 0 ? FR_OE_1 : FR_OE_3); - return d_usrp->_write_fpga_reg(reg, ((mask & 0xffff) << 16) | (value & 0xffff)); -} - -bool -wbx_base::_tx_write_io(int value, int mask) -{ - int reg = (d_which == 0 ? FR_IO_0 : FR_IO_2); - return d_usrp->_write_fpga_reg(reg, ((mask & 0xffff) << 16) | (value & 0xffff)); -} - -bool -wbx_base::_rx_write_io(int value, int mask) -{ - int reg = (d_which == 0 ? FR_IO_1 : FR_IO_3); - return d_usrp->_write_fpga_reg(reg, ((mask & 0xffff) << 16) | (value & 0xffff)); -} - -bool -wbx_base::_rx_read_io() -{ - int reg = (d_which == 0 ? FR_RB_IO_RX_A_IO_TX_A : FR_RB_IO_RX_B_IO_TX_B); - int t = d_usrp->_read_fpga_reg(reg); - return (t >> 16) & 0xffff; -} - -bool -wbx_base::_tx_read_io() -{ - int reg = (d_which == 0 ? FR_RB_IO_RX_A_IO_TX_A : FR_RB_IO_RX_B_IO_TX_B); - int t = d_usrp->_read_fpga_reg(reg); - return (t & 0xffff); -} - -bool -wbx_base::_compute_regs(double freq) -{ - /* - * Determine values of registers, along with actual freq. - * - * @param freq: target frequency in Hz - * @type freq: double - * @returns: (R, N, func, init, actual_freq) - * @rtype: tuple(int, int, int, int, double) - * - * Override this in derived classes. - */ - throw std::runtime_error("_compute_regs called from base class\n"); -} - -double -wbx_base::_refclk_freq() -{ - return (double)(d_usrp->fpga_master_clock_freq())/_refclk_divisor(); -} - -int -wbx_base::_refclk_divisor() -{ - /* - * Return value to stick in REFCLK_DIVISOR register - */ - return 1; -} - -struct freq_result_t -wbx_base::set_freq(double freq) -{ - /* - * @returns (ok, actual_baseband_freq) where: - * ok is True or False and indicates success or failure, - * actual_baseband_freq is the RF frequency that corresponds to DC in the IF. - */ - throw std::runtime_error("set_freq called from base class\n"); -} - -float -wbx_base::gain_min() -{ - throw std::runtime_error("gain_min called from base class\n"); -} - -float -wbx_base::gain_max() -{ - throw std::runtime_error("gain_max called from base class\n"); -} - -float -wbx_base::gain_db_per_step() -{ - throw std::runtime_error("gain_db_per_step called from base class\n"); -} - -bool -wbx_base::set_gain(float gain) -{ - /* - * Set the gain. - * - * @param gain: gain in decibels - * @returns True/False - */ - throw std::runtime_error("set_gain called from base class\n"); -} - -bool -wbx_base::_set_pga(float pga_gain) -{ - bool ok; - if(d_which == 0) { - ok = d_usrp->set_pga(0, pga_gain); - ok |= d_usrp->set_pga(1, pga_gain); - } - else { - ok = d_usrp->set_pga(2, pga_gain); - ok |= d_usrp->set_pga(3, pga_gain); - } - return ok; -} - -bool -wbx_base::is_quadrature() -{ - /* - * Return True if this board requires both I & Q analog channels. - * - * This bit of info is useful when setting up the USRP Rx mux register. - */ - return true; -} - - -/****************************************************************************/ - - -wbx_base_tx::wbx_base_tx(usrp_basic_sptr usrp, int which) - : wbx_base(usrp, which) -{ - /* - * @param usrp: instance of usrp.sink_c - * @param which: 0 or 1 corresponding to side TX_A or TX_B respectively. - */ - - // power up the transmit side, NO -- but set antenna to receive - d_usrp->write_io(d_which, (TX_POWER), (TX_POWER|RX_TXN)); - d_lo_offset = 0e6; - - // Gain is not set by the PGA, but the PGA must be set at max gain in the TX - _set_pga(d_usrp->pga_max()); -} - -wbx_base_tx::~wbx_base_tx() -{ - // Power down and leave the T/R switch in the R position - d_usrp->write_io(d_which, (RX_TXN), (TX_POWER|RX_TXN|TX_ENB_MIX|TX_ENB_VGA)); -} - -void -wbx_base_tx::set_auto_tr(bool on) -{ - if(on) { - set_atr_mask (RX_TXN); - set_atr_txval(0); - set_atr_rxval(RX_TXN); - } - else { - set_atr_mask (0); - set_atr_txval(0); - set_atr_rxval(0); - } -} - -void -wbx_base_tx::set_enable(bool on) -{ - /* - * Enable transmitter if on is True - */ - - int mask = RX_TXN|TX_ENB_MIX|TX_ENB_VGA; - //printf("HERE!!!!\n"); - if(on) { - d_usrp->write_io(d_which, TX_ENB_MIX|TX_ENB_VGA, mask); - } - else { - d_usrp->write_io(d_which, RX_TXN, mask); - } -} - -void -wbx_base_tx::set_lo_offset(double offset) -{ - /* - * Set amount by which LO is offset from requested tuning frequency. - * - * @param offset: offset in Hz - */ - - d_lo_offset = offset; -} - -double -wbx_base_tx::lo_offset() -{ - /* - * Get amount by which LO is offset from requested tuning frequency. - * - * @returns Offset in Hz - */ - - return d_lo_offset; -} - - -/****************************************************************************/ - - -wbx_base_rx::wbx_base_rx(usrp_basic_sptr usrp, int which) - : wbx_base(usrp, which) -{ - /* - * @param usrp: instance of usrp.source_c - * @param which: 0 or 1 corresponding to side RX_A or RX_B respectively. - */ - - // set up for RX on TX/RX port - select_rx_antenna("TX/RX"); - - bypass_adc_buffers(true); - - d_lo_offset = 0.0; -} - -wbx_base_rx::~wbx_base_rx() -{ - // Power down - d_usrp->write_io(d_which, 0, (RXENABLE)); -} - -void -wbx_base_rx::set_auto_tr(bool on) -{ - if(on) { - // FIXME: where does ENABLE come from? - //set_atr_mask (ENABLE); - set_atr_txval( 0); - //set_atr_rxval(ENABLE); - } - else { - set_atr_mask (0); - set_atr_txval(0); - set_atr_rxval(0); - } -} - -void -wbx_base_rx::select_rx_antenna(int which_antenna) -{ - /* - * Specify which antenna port to use for reception. - * @param which_antenna: either 'TX/RX' or 'RX2' - */ - - if(which_antenna == 0) { - d_usrp->write_io(d_which, 0, RX2_RX1N); - } - else if(which_antenna == 1) { - d_usrp->write_io(d_which, RX2_RX1N, RX2_RX1N); - } - else { - throw std::invalid_argument("which_antenna must be either 'TX/RX' or 'RX2'\n"); - } -} - -void -wbx_base_rx::select_rx_antenna(const std::string &which_antenna) -{ - if(which_antenna == "TX/RX") { - select_rx_antenna(0); - } - else if(which_antenna == "RX2") { - select_rx_antenna(1); - } - else { - throw std::invalid_argument("which_antenna must be either 'TX/RX' or 'RX2'\n"); - } -} - -bool -wbx_base_rx::set_gain(float gain) -{ - /* - * Set the gain. - * - * @param gain: gain in decibels - * @returns True/False - */ - - float pga_gain, agc_gain; - float maxgain = gain_max() - d_usrp->pga_max(); - float mingain = gain_min(); - if(gain > maxgain) { - pga_gain = gain-maxgain; - assert(pga_gain <= d_usrp->pga_max()); - agc_gain = maxgain; - } - else { - pga_gain = 0; - agc_gain = gain; - } - - float V_maxgain = .2; - float V_mingain = 1.2; - float V_fullscale = 3.3; - float dac_value = (agc_gain*(V_maxgain-V_mingain)/(maxgain-mingain) + V_mingain)*4096/V_fullscale; - - assert(dac_value>=0 && dac_value<4096); - - return d_usrp->write_aux_dac(d_which, 0, (int)(dac_value)) && _set_pga((int)(pga_gain)); -} - -void -wbx_base_rx::set_lo_offset(double offset) -{ - /* - * Set amount by which LO is offset from requested tuning frequency. - * - * @param offset: offset in Hz - */ - d_lo_offset = offset; -} - -double -wbx_base_rx::lo_offset() -{ - /* - * Get amount by which LO is offset from requested tuning frequency. - * - * @returns Offset in Hz - */ - return d_lo_offset; -} - -bool -wbx_base_rx::i_and_q_swapped() -{ - /* - * Return True if this is a quadrature device and ADC 0 is Q. - */ - return false; -} - - -/****************************************************************************/ - -_ADF410X_common::_ADF410X_common() -{ - // R-Register Common Values - d_R_RSV = 0; // bits 23,22,21 - d_LDP = 1; // bit 20 Lock detect in 5 cycles - d_TEST = 0; // bit 19,18 Normal - d_ABP = 0; // bit 17,16 2.9ns - - // N-Register Common Values - d_N_RSV = 0; // 23,22 - d_CP_GAIN = 0; // 21 - - // Function Register Common Values - d_P = 0; // bits 23,22 0 = 8/9, 1 = 16/17, 2 = 32/33, 3 = 64/65 - d_PD2 = 0; // bit 21 Normal operation - d_CP2 = 4; // bits 20,19,18 CP Gain = 5mA - d_CP1 = 4; // bits 17,16,15 CP Gain = 5mA - d_TC = 0; // bits 14-11 PFD Timeout - d_FL = 0; // bit 10,9 Fastlock Disabled - d_CP3S = 0; // bit 8 CP Enabled - d_PDP = 0; // bit 7 Phase detector polarity, Positive=1 - d_MUXOUT = 1; // bits 6:4 Digital Lock Detect - d_PD1 = 0; // bit 3 Normal operation - d_CR = 0; // bit 2 Normal operation -} - -_ADF410X_common::~_ADF410X_common() -{ -} - -bool -_ADF410X_common::_compute_regs(double freq, int &retR, int &retcontrol, - int &retN, double &retfreq) -{ - /* - * Determine values of R, control, and N registers, along with actual freq. - * - * @param freq: target frequency in Hz - * @type freq: double - * @returns: (R, N, control, actual_freq) - * @rtype: tuple(int, int, int, double) - */ - - // Band-specific N-Register Values - double phdet_freq = _refclk_freq()/d_R_DIV; - printf("phdet_freq = %f\n", phdet_freq); - - double desired_n = round(freq*d_freq_mult/phdet_freq); - printf("desired_n %f\n", desired_n); - - double actual_freq = desired_n * phdet_freq; - printf("actual freq %f\n", actual_freq); - - double B = floor(desired_n/_prescaler()); - double A = desired_n - _prescaler()*B; - printf("A %f B %f\n", A, B); - - d_B_DIV = int(B); // bits 20:8; - d_A_DIV = int(A); // bit 6:2; - - if(d_B_DIV < d_A_DIV) { - retR = 0; - retN = 0; - retcontrol = 0; - retfreq = 0; - return false; - } - - retR = (d_R_RSV<<21) | (d_LDP<<20) | (d_TEST<<18) | - (d_ABP<<16) | (d_R_DIV<<2); - - retN = (d_N_RSV<<22) | (d_CP_GAIN<<21) | (d_B_DIV<<8) | (d_A_DIV<<2); - - retcontrol = (d_P<<22) | (d_PD2<<21) | (d_CP2<<18) | (d_CP1<<15) | - (d_TC<<11) | (d_FL<<9) | (d_CP3S<<8) | (d_PDP<<7) | - (d_MUXOUT<<4) | (d_PD1<<3) | (d_CR<<2); - - retfreq = actual_freq/d_freq_mult; - - return true; -} - -void -_ADF410X_common::_write_all(int R, int N, int control) -{ - /* - * Write all PLL registers: - * R counter latch, - * N counter latch, - * Function latch, - * Initialization latch - * - * Adds 10ms delay between writing control and N if this is first call. - * This is the required power-up sequence. - * - * @param R: 24-bit R counter latch - * @type R: int - * @param N: 24-bit N counter latch - * @type N: int - * @param control: 24-bit control latch - * @type control: int - */ - static bool first = true; - - timespec t; - t.tv_sec = 0; - t.tv_nsec = 10000000; - - _write_R(R); - _write_func(control); - _write_init(control); - if(first) { - //time.sleep(0.010); - nanosleep(&t, NULL); - first = false; - } - _write_N(N); -} - -void -_ADF410X_common::_write_R(int R) -{ - _write_it((R & ~0x3) | 0); -} - -void -_ADF410X_common::_write_N(int N) -{ - _write_it((N & ~0x3) | 1); -} - -void -_ADF410X_common::_write_func(int func) -{ - _write_it((func & ~0x3) | 2); -} - -void -_ADF410X_common::_write_init(int init) -{ - _write_it((init & ~0x3) | 3); -} - -void -_ADF410X_common::_write_it(int v) -{ - char c[3]; - c[0] = (char)((v >> 16) & 0xff); - c[1] = (char)((v >> 8) & 0xff); - c[2] = (char)((v & 0xff)); - std::string s(c, 3); - //d_usrp->_write_spi(0, d_spi_enable, d_spi_format, s); - usrp()->_write_spi(0, d_spi_enable, d_spi_format, s); -} - -int -_ADF410X_common::_prescaler() -{ - if(d_P == 0) { - return 8; - } - else if(d_P == 1) { - return 16; - } - else if(d_P == 2) { - return 32; - } - else if(d_P == 3) { - return 64; - } - else { - throw std::invalid_argument("Prescaler out of range\n"); - } -} - -double -_ADF410X_common::_refclk_freq() -{ - throw std::runtime_error("_refclk_freq called from base class."); -} - -bool -_ADF410X_common::_rx_write_io(int value, int mask) -{ - throw std::runtime_error("_rx_write_io called from base class."); -} - -bool -_ADF410X_common::_lock_detect() -{ - throw std::runtime_error("_lock_detect called from base class."); -} - -usrp_basic* -_ADF410X_common::usrp() -{ - throw std::runtime_error("usrp() called from base class."); -} - - -/****************************************************************************/ - - -_lo_common::_lo_common() - : _ADF410X_common() -{ - // Band-specific R-Register Values - d_R_DIV = 4; // bits 15:2 - - // Band-specific C-Register values - d_P = 0; // bits 23,22 0 = Div by 8/9 - d_CP2 = 4; // bits 19:17 - d_CP1 = 4; // bits 16:14 - - // Band specifc N-Register Values - d_DIVSEL = 0; // bit 23 - d_DIV2 = 0; // bit 22 - d_CPGAIN = 0; // bit 21 - d_freq_mult = 1; - - d_div = 1; - d_aux_div = 2; - d_main_div = 0; -} - -_lo_common::~_lo_common() -{ -} - -double -_lo_common::freq_min() -{ - return 50e6; -} - -double -_lo_common::freq_max() -{ - return 1000e6; -} - -void -_lo_common::set_divider(int main_or_aux, int divisor) -{ - if(main_or_aux == 0) { - if((divisor != 1) || (divisor != 2) || (divisor != 4) || (divisor != 8)) { - throw std::invalid_argument("Main Divider Must be 1, 2, 4, or 8\n"); - } - d_main_div = (int)(log10(divisor)/log10(2.0)); - } - else if(main_or_aux == 1) { - if((divisor != 2) || (divisor != 4) || (divisor != 8) || (divisor != 16)) { - throw std::invalid_argument("Aux Divider Must be 2, 4, 8 or 16\n"); - } - d_main_div = (int)(log10(divisor/2.0)/log10(2.0)); - } - else { - throw std::invalid_argument("main_or_aux must be 'main' or 'aux'\n"); - } - - int vala = d_main_div*SELA0; - int valb = d_aux_div*SELB0; - int mask = SELA0|SELA1|SELB0|SELB1; - - _rx_write_io((vala | valb), mask); -} - -void -_lo_common::set_divider(const std::string &main_or_aux, int divisor) -{ - if(main_or_aux == "main") { - set_divider(0, divisor); - } - else if(main_or_aux == "aux") { - set_divider(1, divisor); - } - else { - throw std::invalid_argument("main_or_aux must be 'main' or 'aux'\n"); - } -} - -struct freq_result_t -_lo_common::set_freq(double freq) -{ - struct freq_result_t ret; - - if(freq < 20e6 or freq > 1200e6) { - throw std::invalid_argument("Requested frequency out of range\n"); - } - - int div = 1; - double lo_freq = freq * 2; - while((lo_freq < 1e9) && (div < 8)) { - div = div * 2; - lo_freq = lo_freq * 2; - } - - printf("For RF freq of %f, we set DIV=%d and LO Freq=%f\n", freq, div, lo_freq); - - set_divider("main", div); - set_divider("aux", div*2); - - int R, N, control; - double actual_freq; - _compute_regs(lo_freq, R, N, control, actual_freq); - - printf("R %d N %d control %d actual freq %f\n", R, N, control, actual_freq); - if(R==0) { - ret.ok = false; - ret.baseband_freq = 0.0; - return ret; - } - _write_all(R, N, control); - - ret.ok = _lock_detect(); - ret.baseband_freq = actual_freq/div/2; - return ret; -} - - -/****************************************************************************/ - - -db_wbx_lo_tx::db_wbx_lo_tx(usrp_basic_sptr usrp, int which) - : _lo_common(), - wbx_base_tx(usrp, which) -{ -} - -db_wbx_lo_tx::~db_wbx_lo_tx() -{ -} - -float -db_wbx_lo_tx::gain_min() -{ - return -56.0; -} - -float -db_wbx_lo_tx::gain_max() -{ - return 0.0; -} - -float -db_wbx_lo_tx::gain_db_per_step() -{ - return 0.1; -} - -bool -db_wbx_lo_tx::set_gain(float gain) -{ - /* - * Set the gain. - * - * @param gain: gain in decibels - * @returns True/False - */ - - float txvga_gain; - float maxgain = gain_max(); - float mingain = gain_min(); - if(gain > maxgain) { - txvga_gain = maxgain; - } - else if(gain < mingain) { - txvga_gain = mingain; - } - else { - txvga_gain = gain; - } - - float V_maxgain = 1.4; - float V_mingain = 0.1; - float V_fullscale = 3.3; - float dac_value = ((txvga_gain-mingain)*(V_maxgain-V_mingain)/ - (maxgain-mingain) + V_mingain)*4096/V_fullscale; - - assert(dac_value>=0 && dac_value<4096); - printf("DAC value %f\n", dac_value); - - return d_usrp->write_aux_dac(d_which, 1, (int)(dac_value)); -} - -double -db_wbx_lo_tx::_refclk_freq() -{ - return wbx_base::_refclk_freq(); -} - -bool -db_wbx_lo_tx::_rx_write_io(int value, int mask) -{ - return wbx_base::_rx_write_io(value, mask); -} - -bool -db_wbx_lo_tx::_lock_detect() -{ - return wbx_base::_lock_detect(); -} - -usrp_basic* -db_wbx_lo_tx::usrp() -{ - return d_usrp; -} - - -/****************************************************************************/ - - -db_wbx_lo_rx::db_wbx_lo_rx(usrp_basic_sptr usrp, int which) - : _lo_common(), - wbx_base_rx(usrp, which) -{ -} - -db_wbx_lo_rx::~db_wbx_lo_rx() -{ -} - -float -db_wbx_lo_rx::gain_min() -{ - return d_usrp->pga_min(); -} - -float -db_wbx_lo_rx::gain_max() -{ - return d_usrp->pga_max() + 45; -} - -float -db_wbx_lo_rx::gain_db_per_step() -{ - return 0.05; -} - -double -db_wbx_lo_rx::_refclk_freq() -{ - return wbx_base::_refclk_freq(); -} - -bool -db_wbx_lo_rx::_rx_write_io(int value, int mask) -{ - return wbx_base::_rx_write_io(value, mask); -} - -bool -db_wbx_lo_rx::_lock_detect() -{ - return wbx_base::_lock_detect(); -} - -usrp_basic* -db_wbx_lo_rx::usrp() -{ - return d_usrp; -} diff --git a/usrp/host/lib/limbo/db_wbx.h b/usrp/host/lib/limbo/db_wbx.h deleted file mode 100644 index 3202d368c..000000000 --- a/usrp/host/lib/limbo/db_wbx.h +++ /dev/null @@ -1,221 +0,0 @@ -/* -*- c++ -*- */ -// -// Copyright 2008 Free Software Foundation, Inc. -// -// This file is part of GNU Radio -// -// GNU Radio is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either asversion 3, or (at your option) -// any later version. -// -// GNU Radio is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with GNU Radio; see the file COPYING. If not, write to -// the Free Software Foundation, Inc., 51 Franklin Street, -// Boston, MA 02110-1301, USA. - -#ifndef DB_WBX_H -#define DB_WBX_H - -#include <db_base.h> -#include <boost/shared_ptr.hpp> - - -/* - A few comments about the WBX boards: - They are half-duplex. I.e., transmit and receive are mutually exclusive. - There is a single LO for both the Tx and Rx sides. - The the shared control signals are hung off of the Rx side. - The shared io controls are duplexed onto the Rx side pins. - The wbx_high d'board always needs to be in 'auto_tr_mode' -*/ - - -class wbx_base : public db_base -{ -protected: - void shutdown(); - - /* - * Abstract base class for all wbx boards. - * - * Derive board specific subclasses from db_wbx_base_{tx,rx} - */ - -public: - wbx_base(usrp_basic_sptr usrp, int which); - ~wbx_base(); - - struct freq_result_t set_freq(double freq); - float gain_min(); - float gain_max(); - float gain_db_per_step(); - bool set_gain(float gain); - bool is_quadrature(); - - -protected: - virtual bool _lock_detect(); - - // FIXME: After testing, replace these with usrp_basic::common_write_io/oe - bool _tx_write_oe(int value, int mask); - bool _rx_write_oe(int value, int mask); - bool _tx_write_io(int value, int mask); - bool _rx_write_io(int value, int mask); - virtual bool _rx_read_io(); - bool _tx_read_io(); - bool _compute_regs(double freq); - virtual double _refclk_freq(); - int _refclk_divisor(); - - bool _set_pga(float pga_gain); - - bool d_first; - int d_spi_format; - int d_spi_enable; - double d_lo_offset; -}; - - -/****************************************************************************/ - - -class wbx_base_tx : public wbx_base -{ -public: - wbx_base_tx(usrp_basic_sptr usrp, int which); - ~wbx_base_tx(); - - bool set_auto_tr(bool on); - bool set_enable(bool on); -}; - - -/****************************************************************************/ - - -class wbx_base_rx : public wbx_base -{ -public: - wbx_base_rx(usrp_basic_sptr usrp, int which); - ~wbx_base_rx(); - - bool set_auto_tr(bool on); - bool select_rx_antenna(int which_antenna); - bool select_rx_antenna(const std::string &which_antenna); - bool set_gain(float gain); - bool i_and_q_swapped(); -}; - - -/****************************************************************************/ - - -class _ADF410X_common -{ -public: - _ADF410X_common(); - virtual ~_ADF410X_common(); - - bool _compute_regs(double freq, int &retR, int &retcontrol, - int &retN, double &retfreq); - void _write_all(int R, int N, int control); - void _write_R(int R); - void _write_N(int N); - void _write_func(int func); - void _write_init(int init); - int _prescaler(); - virtual void _write_it(int v); - virtual double _refclk_freq(); - virtual bool _rx_write_io(int value, int mask); - virtual bool _lock_detect(); - -protected: - virtual usrp_basic* usrp(); - - int d_R_RSV, d_LDP, d_TEST, d_ABP; - int d_N_RSV, d_CP_GAIN; - int d_P, d_PD2, d_CP2, d_CP1, d_TC, d_FL; - int d_CP3S, d_PDP, d_MUXOUT, d_PD1, d_CR; - int d_R_DIV, d_A_DIV, d_B_DIV; - int d_freq_mult; - - int d_spi_format; - int d_spi_enable; -}; - - -/****************************************************************************/ - - -class _lo_common : public _ADF410X_common -{ -public: - _lo_common(); - ~_lo_common(); - - double freq_min(); - double freq_max(); - - void set_divider(int main_or_aux, int divisor); - void set_divider(const std::string &main_or_aux, int divisor); - - struct freq_result_t set_freq(double freq); - -protected: - int d_R_DIV, d_P, d_CP2, d_CP1; - int d_DIVSEL, d_DIV2, d_CPGAIN; - int d_div, d_aux_div, d_main_div; -}; - - -/****************************************************************************/ - - -class db_wbx_lo_tx : public _lo_common, public wbx_base_tx -{ -public: - db_wbx_lo_tx(usrp_basic_sptr usrp, int which); - ~db_wbx_lo_tx(); - - float gain_min(); - float gain_max(); - float gain_db_per_step(); - bool set_gain(float gain); - - double _refclk_freq(); - bool _rx_write_io(int value, int mask); - bool _lock_detect(); - -protected: - usrp_basic* usrp(); -}; - - -/****************************************************************************/ - - -class db_wbx_lo_rx : public _lo_common, public wbx_base_rx -{ -public: - db_wbx_lo_rx(usrp_basic_sptr usrp, int which); - ~db_wbx_lo_rx(); - - float gain_min(); - float gain_max(); - float gain_db_per_step(); - - double _refclk_freq(); - bool _rx_write_io(int value, int mask); - bool _lock_detect(); - -protected: - usrp_basic* usrp(); -}; - -#endif diff --git a/usrp/host/lib/md5.c b/usrp/host/lib/md5.c deleted file mode 100644 index b15ab390f..000000000 --- a/usrp/host/lib/md5.c +++ /dev/null @@ -1,452 +0,0 @@ -/* md5.c - Functions to compute MD5 message digest of files or memory blocks - according to the definition of MD5 in RFC 1321 from April 1992. - Copyright (C) 1995, 1996, 2001, 2003 Free Software Foundation, Inc. - NOTE: The canonical source of this file is maintained with the GNU C - Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 3, or (at your option) any - later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Boston, MA 02110-1301, USA. */ - -/* Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995. */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include "md5.h" - -#include <sys/types.h> - -#include <stdlib.h> -#include <string.h> - -// #include "unlocked-io.h" - -#ifdef _LIBC -# include <endian.h> -# if __BYTE_ORDER == __BIG_ENDIAN -# define WORDS_BIGENDIAN 1 -# endif -/* We need to keep the namespace clean so define the MD5 function - protected using leading __ . */ -# define md5_init_ctx __md5_init_ctx -# define md5_process_block __md5_process_block -# define md5_process_bytes __md5_process_bytes -# define md5_finish_ctx __md5_finish_ctx -# define md5_read_ctx __md5_read_ctx -# define md5_stream __md5_stream -# define md5_buffer __md5_buffer -#endif - -#ifdef WORDS_BIGENDIAN -# define SWAP(n) \ - (((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24)) -#else -# define SWAP(n) (n) -#endif - -#define BLOCKSIZE 4096 -/* Ensure that BLOCKSIZE is a multiple of 64. */ -#if BLOCKSIZE % 64 != 0 -/* FIXME-someday (soon?): use #error instead of this kludge. */ -"invalid BLOCKSIZE" -#endif - -/* This array contains the bytes used to pad the buffer to the next - 64-byte boundary. (RFC 1321, 3.1: Step 1) */ -static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ }; - - -/* Initialize structure containing state of computation. - (RFC 1321, 3.3: Step 3) */ -void -md5_init_ctx (struct md5_ctx *ctx) -{ - ctx->A = 0x67452301; - ctx->B = 0xefcdab89; - ctx->C = 0x98badcfe; - ctx->D = 0x10325476; - - ctx->total[0] = ctx->total[1] = 0; - ctx->buflen = 0; -} - -/* Put result from CTX in first 16 bytes following RESBUF. The result - must be in little endian byte order. - - IMPORTANT: On some systems it is required that RESBUF is correctly - aligned for a 32 bits value. */ -void * -md5_read_ctx (const struct md5_ctx *ctx, void *resbuf) -{ - ((md5_uint32 *) resbuf)[0] = SWAP (ctx->A); - ((md5_uint32 *) resbuf)[1] = SWAP (ctx->B); - ((md5_uint32 *) resbuf)[2] = SWAP (ctx->C); - ((md5_uint32 *) resbuf)[3] = SWAP (ctx->D); - - return resbuf; -} - -/* Process the remaining bytes in the internal buffer and the usual - prolog according to the standard and write the result to RESBUF. - - IMPORTANT: On some systems it is required that RESBUF is correctly - aligned for a 32 bits value. */ -void * -md5_finish_ctx (struct md5_ctx *ctx, void *resbuf) -{ - /* Take yet unprocessed bytes into account. */ - md5_uint32 bytes = ctx->buflen; - size_t pad; - - /* Now count remaining bytes. */ - ctx->total[0] += bytes; - if (ctx->total[0] < bytes) - ++ctx->total[1]; - - pad = bytes >= 56 ? 64 + 56 - bytes : 56 - bytes; - memcpy (&ctx->buffer[bytes], fillbuf, pad); - - /* Put the 64-bit file length in *bits* at the end of the buffer. */ - *(md5_uint32 *) &ctx->buffer[bytes + pad] = SWAP (ctx->total[0] << 3); - *(md5_uint32 *) &ctx->buffer[bytes + pad + 4] = SWAP ((ctx->total[1] << 3) | - (ctx->total[0] >> 29)); - - /* Process last bytes. */ - md5_process_block (ctx->buffer, bytes + pad + 8, ctx); - - return md5_read_ctx (ctx, resbuf); -} - -/* Compute MD5 message digest for bytes read from STREAM. The - resulting message digest number will be written into the 16 bytes - beginning at RESBLOCK. */ -int -md5_stream (FILE *stream, void *resblock) -{ - struct md5_ctx ctx; - char buffer[BLOCKSIZE + 72]; - size_t sum; - - /* Initialize the computation context. */ - md5_init_ctx (&ctx); - - /* Iterate over full file contents. */ - while (1) - { - /* We read the file in blocks of BLOCKSIZE bytes. One call of the - computation function processes the whole buffer so that with the - next round of the loop another block can be read. */ - size_t n; - sum = 0; - - /* Read block. Take care for partial reads. */ - while (1) - { - n = fread (buffer + sum, 1, BLOCKSIZE - sum, stream); - - sum += n; - - if (sum == BLOCKSIZE) - break; - - if (n == 0) - { - /* Check for the error flag IFF N == 0, so that we don't - exit the loop after a partial read due to e.g., EAGAIN - or EWOULDBLOCK. */ - if (ferror (stream)) - return 1; - goto process_partial_block; - } - - /* We've read at least one byte, so ignore errors. But always - check for EOF, since feof may be true even though N > 0. - Otherwise, we could end up calling fread after EOF. */ - if (feof (stream)) - goto process_partial_block; - } - - /* Process buffer with BLOCKSIZE bytes. Note that - BLOCKSIZE % 64 == 0 - */ - md5_process_block (buffer, BLOCKSIZE, &ctx); - } - - process_partial_block:; - - /* Process any remaining bytes. */ - if (sum > 0) - md5_process_bytes (buffer, sum, &ctx); - - /* Construct result in desired memory. */ - md5_finish_ctx (&ctx, resblock); - return 0; -} - -/* Compute MD5 message digest for LEN bytes beginning at BUFFER. The - result is always in little endian byte order, so that a byte-wise - output yields to the wanted ASCII representation of the message - digest. */ -void * -md5_buffer (const char *buffer, size_t len, void *resblock) -{ - struct md5_ctx ctx; - - /* Initialize the computation context. */ - md5_init_ctx (&ctx); - - /* Process whole buffer but last len % 64 bytes. */ - md5_process_bytes (buffer, len, &ctx); - - /* Put result in desired memory area. */ - return md5_finish_ctx (&ctx, resblock); -} - - -void -md5_process_bytes (const void *buffer, size_t len, struct md5_ctx *ctx) -{ - /* When we already have some bits in our internal buffer concatenate - both inputs first. */ - if (ctx->buflen != 0) - { - size_t left_over = ctx->buflen; - size_t add = 128 - left_over > len ? len : 128 - left_over; - - memcpy (&ctx->buffer[left_over], buffer, add); - ctx->buflen += add; - - if (ctx->buflen > 64) - { - md5_process_block (ctx->buffer, ctx->buflen & ~63, ctx); - - ctx->buflen &= 63; - /* The regions in the following copy operation cannot overlap. */ - memcpy (ctx->buffer, &ctx->buffer[(left_over + add) & ~63], - ctx->buflen); - } - - buffer = (const char *) buffer + add; - len -= add; - } - - /* Process available complete blocks. */ - if (len >= 64) - { -#if !_STRING_ARCH_unaligned -/* To check alignment gcc has an appropriate operator. Other - compilers don't. */ -# if __GNUC__ >= 2 -# define UNALIGNED_P(p) (((md5_uintptr) p) % __alignof__ (md5_uint32) != 0) -# else -# define UNALIGNED_P(p) (((md5_uintptr) p) % sizeof (md5_uint32) != 0) -# endif - if (UNALIGNED_P (buffer)) - while (len > 64) - { - md5_process_block (memcpy (ctx->buffer, buffer, 64), 64, ctx); - buffer = (const char *) buffer + 64; - len -= 64; - } - else -#endif - { - md5_process_block (buffer, len & ~63, ctx); - buffer = (const char *) buffer + (len & ~63); - len &= 63; - } - } - - /* Move remaining bytes in internal buffer. */ - if (len > 0) - { - size_t left_over = ctx->buflen; - - memcpy (&ctx->buffer[left_over], buffer, len); - left_over += len; - if (left_over >= 64) - { - md5_process_block (ctx->buffer, 64, ctx); - left_over -= 64; - memcpy (ctx->buffer, &ctx->buffer[64], left_over); - } - ctx->buflen = left_over; - } -} - - -/* These are the four functions used in the four steps of the MD5 algorithm - and defined in the RFC 1321. The first function is a little bit optimized - (as found in Colin Plumbs public domain implementation). */ -/* #define FF(b, c, d) ((b & c) | (~b & d)) */ -#define FF(b, c, d) (d ^ (b & (c ^ d))) -#define FG(b, c, d) FF (d, b, c) -#define FH(b, c, d) (b ^ c ^ d) -#define FI(b, c, d) (c ^ (b | ~d)) - -/* Process LEN bytes of BUFFER, accumulating context into CTX. - It is assumed that LEN % 64 == 0. */ - -void -md5_process_block (const void *buffer, size_t len, struct md5_ctx *ctx) -{ - md5_uint32 correct_words[16]; - const md5_uint32 *words = buffer; - size_t nwords = len / sizeof (md5_uint32); - const md5_uint32 *endp = words + nwords; - md5_uint32 A = ctx->A; - md5_uint32 B = ctx->B; - md5_uint32 C = ctx->C; - md5_uint32 D = ctx->D; - - /* First increment the byte count. RFC 1321 specifies the possible - length of the file up to 2^64 bits. Here we only compute the - number of bytes. Do a double word increment. */ - ctx->total[0] += len; - if (ctx->total[0] < len) - ++ctx->total[1]; - - /* Process all bytes in the buffer with 64 bytes in each round of - the loop. */ - while (words < endp) - { - md5_uint32 *cwp = correct_words; - md5_uint32 A_save = A; - md5_uint32 B_save = B; - md5_uint32 C_save = C; - md5_uint32 D_save = D; - - /* First round: using the given function, the context and a constant - the next context is computed. Because the algorithms processing - unit is a 32-bit word and it is determined to work on words in - little endian byte order we perhaps have to change the byte order - before the computation. To reduce the work for the next steps - we store the swapped words in the array CORRECT_WORDS. */ - -#define OP(a, b, c, d, s, T) \ - do \ - { \ - a += FF (b, c, d) + (*cwp++ = SWAP (*words)) + T; \ - ++words; \ - a = rol (a, s); \ - a += b; \ - } \ - while (0) - - /* Before we start, one word to the strange constants. - They are defined in RFC 1321 as - - T[i] = (int) (4294967296.0 * fabs (sin (i))), i=1..64, or - perl -e 'foreach(1..64){printf "0x%08x\n", int (4294967296 * abs (sin $_))}' - */ - - /* Round 1. */ - OP (A, B, C, D, 7, 0xd76aa478); - OP (D, A, B, C, 12, 0xe8c7b756); - OP (C, D, A, B, 17, 0x242070db); - OP (B, C, D, A, 22, 0xc1bdceee); - OP (A, B, C, D, 7, 0xf57c0faf); - OP (D, A, B, C, 12, 0x4787c62a); - OP (C, D, A, B, 17, 0xa8304613); - OP (B, C, D, A, 22, 0xfd469501); - OP (A, B, C, D, 7, 0x698098d8); - OP (D, A, B, C, 12, 0x8b44f7af); - OP (C, D, A, B, 17, 0xffff5bb1); - OP (B, C, D, A, 22, 0x895cd7be); - OP (A, B, C, D, 7, 0x6b901122); - OP (D, A, B, C, 12, 0xfd987193); - OP (C, D, A, B, 17, 0xa679438e); - OP (B, C, D, A, 22, 0x49b40821); - - /* For the second to fourth round we have the possibly swapped words - in CORRECT_WORDS. Redefine the macro to take an additional first - argument specifying the function to use. */ -#undef OP -#define OP(f, a, b, c, d, k, s, T) \ - do \ - { \ - a += f (b, c, d) + correct_words[k] + T; \ - a = rol (a, s); \ - a += b; \ - } \ - while (0) - - /* Round 2. */ - OP (FG, A, B, C, D, 1, 5, 0xf61e2562); - OP (FG, D, A, B, C, 6, 9, 0xc040b340); - OP (FG, C, D, A, B, 11, 14, 0x265e5a51); - OP (FG, B, C, D, A, 0, 20, 0xe9b6c7aa); - OP (FG, A, B, C, D, 5, 5, 0xd62f105d); - OP (FG, D, A, B, C, 10, 9, 0x02441453); - OP (FG, C, D, A, B, 15, 14, 0xd8a1e681); - OP (FG, B, C, D, A, 4, 20, 0xe7d3fbc8); - OP (FG, A, B, C, D, 9, 5, 0x21e1cde6); - OP (FG, D, A, B, C, 14, 9, 0xc33707d6); - OP (FG, C, D, A, B, 3, 14, 0xf4d50d87); - OP (FG, B, C, D, A, 8, 20, 0x455a14ed); - OP (FG, A, B, C, D, 13, 5, 0xa9e3e905); - OP (FG, D, A, B, C, 2, 9, 0xfcefa3f8); - OP (FG, C, D, A, B, 7, 14, 0x676f02d9); - OP (FG, B, C, D, A, 12, 20, 0x8d2a4c8a); - - /* Round 3. */ - OP (FH, A, B, C, D, 5, 4, 0xfffa3942); - OP (FH, D, A, B, C, 8, 11, 0x8771f681); - OP (FH, C, D, A, B, 11, 16, 0x6d9d6122); - OP (FH, B, C, D, A, 14, 23, 0xfde5380c); - OP (FH, A, B, C, D, 1, 4, 0xa4beea44); - OP (FH, D, A, B, C, 4, 11, 0x4bdecfa9); - OP (FH, C, D, A, B, 7, 16, 0xf6bb4b60); - OP (FH, B, C, D, A, 10, 23, 0xbebfbc70); - OP (FH, A, B, C, D, 13, 4, 0x289b7ec6); - OP (FH, D, A, B, C, 0, 11, 0xeaa127fa); - OP (FH, C, D, A, B, 3, 16, 0xd4ef3085); - OP (FH, B, C, D, A, 6, 23, 0x04881d05); - OP (FH, A, B, C, D, 9, 4, 0xd9d4d039); - OP (FH, D, A, B, C, 12, 11, 0xe6db99e5); - OP (FH, C, D, A, B, 15, 16, 0x1fa27cf8); - OP (FH, B, C, D, A, 2, 23, 0xc4ac5665); - - /* Round 4. */ - OP (FI, A, B, C, D, 0, 6, 0xf4292244); - OP (FI, D, A, B, C, 7, 10, 0x432aff97); - OP (FI, C, D, A, B, 14, 15, 0xab9423a7); - OP (FI, B, C, D, A, 5, 21, 0xfc93a039); - OP (FI, A, B, C, D, 12, 6, 0x655b59c3); - OP (FI, D, A, B, C, 3, 10, 0x8f0ccc92); - OP (FI, C, D, A, B, 10, 15, 0xffeff47d); - OP (FI, B, C, D, A, 1, 21, 0x85845dd1); - OP (FI, A, B, C, D, 8, 6, 0x6fa87e4f); - OP (FI, D, A, B, C, 15, 10, 0xfe2ce6e0); - OP (FI, C, D, A, B, 6, 15, 0xa3014314); - OP (FI, B, C, D, A, 13, 21, 0x4e0811a1); - OP (FI, A, B, C, D, 4, 6, 0xf7537e82); - OP (FI, D, A, B, C, 11, 10, 0xbd3af235); - OP (FI, C, D, A, B, 2, 15, 0x2ad7d2bb); - OP (FI, B, C, D, A, 9, 21, 0xeb86d391); - - /* Add the starting values of the context. */ - A += A_save; - B += B_save; - C += C_save; - D += D_save; - } - - /* Put checksum in context given as argument. */ - ctx->A = A; - ctx->B = B; - ctx->C = C; - ctx->D = D; -} diff --git a/usrp/host/lib/md5.h b/usrp/host/lib/md5.h deleted file mode 100644 index 4a4e790c1..000000000 --- a/usrp/host/lib/md5.h +++ /dev/null @@ -1,129 +0,0 @@ -/* md5.h - Declaration of functions and data types used for MD5 sum - computing library functions. - Copyright (C) 1995, 1996, 1999, 2000, 2003 Free Software Foundation, Inc. - NOTE: The canonical source of this file is maintained with the GNU C - Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 3, or (at your option) any - later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Boston, MA 02110-1301, USA. */ - -#ifndef _MD5_H -#define _MD5_H 1 - -#include <stdio.h> -#include <limits.h> - -/* The following contortions are an attempt to use the C preprocessor - to determine an unsigned integral type that is 32 bits wide. An - alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but - doing that would require that the configure script compile and *run* - the resulting executable. Locally running cross-compiled executables - is usually not possible. */ - -#ifdef _LIBC -# include <stdint.h> -typedef uint32_t md5_uint32; -typedef uintptr_t md5_uintptr; -#else -# define UINT_MAX_32_BITS 4294967295U - -# if UINT_MAX == UINT_MAX_32_BITS - typedef unsigned int md5_uint32; -# else -# if USHRT_MAX == UINT_MAX_32_BITS - typedef unsigned short md5_uint32; -# else -# if ULONG_MAX == UINT_MAX_32_BITS - typedef unsigned long md5_uint32; -# else - /* The following line is intended to evoke an error. - Using #error is not portable enough. */ - "Cannot determine unsigned 32-bit data type." -# endif -# endif -# endif -/* We have to make a guess about the integer type equivalent in size - to pointers which should always be correct. */ -typedef unsigned long int md5_uintptr; -#endif - -/* Structure to save state of computation between the single steps. */ -struct md5_ctx -{ - md5_uint32 A; - md5_uint32 B; - md5_uint32 C; - md5_uint32 D; - - md5_uint32 total[2]; - md5_uint32 buflen; - char buffer[128]; -}; - -/* - * The following three functions are build up the low level used in - * the functions `md5_stream' and `md5_buffer'. - */ - -/* Initialize structure containing state of computation. - (RFC 1321, 3.3: Step 3) */ -extern void md5_init_ctx (struct md5_ctx *ctx); - -/* Starting with the result of former calls of this function (or the - initialization function update the context for the next LEN bytes - starting at BUFFER. - It is necessary that LEN is a multiple of 64!!! */ -extern void md5_process_block (const void *buffer, size_t len, - struct md5_ctx *ctx); - -/* Starting with the result of former calls of this function (or the - initialization function update the context for the next LEN bytes - starting at BUFFER. - It is NOT required that LEN is a multiple of 64. */ -extern void md5_process_bytes (const void *buffer, size_t len, - struct md5_ctx *ctx); - -/* Process the remaining bytes in the buffer and put result from CTX - in first 16 bytes following RESBUF. The result is always in little - endian byte order, so that a byte-wise output yields to the wanted - ASCII representation of the message digest. - - IMPORTANT: On some systems it is required that RESBUF be correctly - aligned for a 32 bits value. */ -extern void *md5_finish_ctx (struct md5_ctx *ctx, void *resbuf); - - -/* Put result from CTX in first 16 bytes following RESBUF. The result is - always in little endian byte order, so that a byte-wise output yields - to the wanted ASCII representation of the message digest. - - IMPORTANT: On some systems it is required that RESBUF is correctly - aligned for a 32 bits value. */ -extern void *md5_read_ctx (const struct md5_ctx *ctx, void *resbuf); - - -/* Compute MD5 message digest for bytes read from STREAM. The - resulting message digest number will be written into the 16 bytes - beginning at RESBLOCK. */ -extern int md5_stream (FILE *stream, void *resblock); - -/* Compute MD5 message digest for LEN bytes beginning at BUFFER. The - result is always in little endian byte order, so that a byte-wise - output yields to the wanted ASCII representation of the message - digest. */ -extern void *md5_buffer (const char *buffer, size_t len, void *resblock); - -#define rol(x,n) ( ((x) << (n)) | ((x) >> (32-(n))) ) - -#endif diff --git a/usrp/host/lib/rate_to_regval.h b/usrp/host/lib/rate_to_regval.h deleted file mode 100644 index 1ffdc0f69..000000000 --- a/usrp/host/lib/rate_to_regval.h +++ /dev/null @@ -1,97 +0,0 @@ - { 1, 0x00 }, - { 2, 0x01 }, - { 3, 0x02 }, - { 4, 0x11 }, - { 5, 0x04 }, - { 6, 0x05 }, - { 7, 0x06 }, - { 8, 0x13 }, - { 9, 0x08 }, - { 10, 0x09 }, - { 11, 0x0a }, - { 12, 0x15 }, - { 13, 0x0c }, - { 14, 0x0d }, - { 15, 0x0e }, - { 16, 0x33 }, - { 18, 0x18 }, - { 20, 0x19 }, - { 21, 0x26 }, - { 22, 0x1a }, - { 24, 0x35 }, - { 25, 0x44 }, - { 26, 0x1c }, - { 27, 0x28 }, - { 28, 0x1d }, - { 30, 0x1e }, - { 32, 0x37 }, - { 33, 0x2a }, - { 35, 0x46 }, - { 36, 0x55 }, - { 39, 0x2c }, - { 40, 0x39 }, - { 42, 0x56 }, - { 44, 0x3a }, - { 45, 0x2e }, - { 48, 0x57 }, - { 49, 0x66 }, - { 50, 0x49 }, - { 52, 0x3c }, - { 54, 0x58 }, - { 55, 0x4a }, - { 56, 0x3d }, - { 60, 0x59 }, - { 63, 0x68 }, - { 64, 0x77 }, - { 65, 0x4c }, - { 66, 0x5a }, - { 70, 0x69 }, - { 72, 0x5b }, - { 75, 0x4e }, - { 77, 0x6a }, - { 78, 0x5c }, - { 80, 0x79 }, - { 81, 0x88 }, - { 84, 0x5d }, - { 88, 0x7a }, - { 90, 0x5e }, - { 91, 0x6c }, - { 96, 0x7b }, - { 98, 0x6d }, - { 99, 0x8a }, - { 100, 0x99 }, - { 104, 0x7c }, - { 105, 0x6e }, - { 108, 0x8b }, - { 110, 0x9a }, - { 112, 0x7d }, - { 117, 0x8c }, - { 120, 0x9b }, - { 121, 0xaa }, - { 126, 0x8d }, - { 128, 0x7f }, - { 130, 0x9c }, - { 132, 0xab }, - { 135, 0x8e }, - { 140, 0x9d }, - { 143, 0xac }, - { 144, 0xbb }, - { 150, 0x9e }, - { 154, 0xad }, - { 156, 0xbc }, - { 160, 0x9f }, - { 165, 0xae }, - { 168, 0xbd }, - { 169, 0xcc }, - { 176, 0xaf }, - { 180, 0xbe }, - { 182, 0xcd }, - { 192, 0xbf }, - { 195, 0xce }, - { 196, 0xdd }, - { 208, 0xcf }, - { 210, 0xde }, - { 224, 0xdf }, - { 225, 0xee }, - { 240, 0xef }, - { 256, 0xff } diff --git a/usrp/host/lib/std_paths.h.in b/usrp/host/lib/std_paths.h.in deleted file mode 100644 index e09499e0b..000000000 --- a/usrp/host/lib/std_paths.h.in +++ /dev/null @@ -1,27 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -static const char *std_paths[] = { - "@prefix@/share/usrp", - "/usr/local/share/usrp", - 0 -}; diff --git a/usrp/host/lib/usrp_basic.cc b/usrp/host/lib/usrp_basic.cc deleted file mode 100644 index 5b2f7ff71..000000000 --- a/usrp/host/lib/usrp_basic.cc +++ /dev/null @@ -1,1538 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003,2004,2008,2009 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "usrp/usrp_basic.h" -#include "usrp/usrp_prims.h" -#include "usrp_interfaces.h" -#include "fpga_regs_common.h" -#include "fpga_regs_standard.h" -#include "fusb.h" -#include "db_boards.h" -#include <stdexcept> -#include <assert.h> -#include <math.h> -#include <ad9862.h> -#include <string.h> -#include <cstdio> - -using namespace ad9862; - -#define NELEM(x) (sizeof (x) / sizeof (x[0])) - -// These set the buffer size used for each end point using the fast -// usb interface. The kernel ends up locking down this much memory. - -static const int FUSB_BUFFER_SIZE = fusb_sysconfig::default_buffer_size(); -static const int FUSB_BLOCK_SIZE = fusb_sysconfig::max_block_size(); -static const int FUSB_NBLOCKS = FUSB_BUFFER_SIZE / FUSB_BLOCK_SIZE; - - -static const double POLLING_INTERVAL = 0.1; // seconds - -//////////////////////////////////////////////////////////////// - -static libusb_device_handle * -open_rx_interface (libusb_device *dev) -{ - libusb_device_handle *udh = usrp_open_rx_interface (dev); - if (udh == 0){ - fprintf (stderr, "usrp_basic_rx: can't open rx interface\n"); - } - return udh; -} - -static libusb_device_handle * -open_tx_interface (libusb_device *dev) -{ - libusb_device_handle *udh = usrp_open_tx_interface (dev); - if (udh == 0){ - fprintf (stderr, "usrp_basic_tx: can't open tx interface\n"); - } - return udh; -} - -////////////////////////////////////////////////////////////////// -// -// usrp_basic -// -//////////////////////////////////////////////////////////////// - -// Given: -// CLKIN = 64 MHz -// CLKSEL pin = high -// -// These settings give us: -// CLKOUT1 = CLKIN = 64 MHz -// CLKOUT2 = CLKIN = 64 MHz -// ADC is clocked at 64 MHz -// DAC is clocked at 128 MHz - -static unsigned char common_regs[] = { - REG_GENERAL, 0, - REG_DLL, (DLL_DISABLE_INTERNAL_XTAL_OSC - | DLL_MULT_2X - | DLL_FAST), - REG_CLKOUT, CLKOUT2_EQ_DLL_OVER_2, - REG_AUX_ADC_CLK, AUX_ADC_CLK_CLK_OVER_4 -}; - -usrp_basic::usrp_basic (int which_board, - libusb_device_handle * - open_interface (libusb_device *dev), - const std::string fpga_filename, - const std::string firmware_filename) - : d_udh (0), d_ctx (0), - d_usb_data_rate (16000000), // SWAG, see below - d_bytes_per_poll ((int) (POLLING_INTERVAL * d_usb_data_rate)), - d_verbose (false), d_fpga_master_clock_freq(64000000), d_db(2) -{ - /* - * SWAG: Scientific Wild Ass Guess. - * - * d_usb_data_rate is used only to determine how often to poll for over- and - * under-runs. We defualt it to 1/2 of our best case. Classes derived from - * usrp_basic (e.g., usrp_standard_tx and usrp_standard_rx) call - * set_usb_data_rate() to tell us the actual rate. This doesn't change our - * throughput, that's determined by the signal processing code in the FPGA - * (which we know nothing about), and the system limits determined by libusb, - * fusb_*, and the underlying drivers. - */ - memset (d_fpga_shadows, 0, sizeof (d_fpga_shadows)); - - usrp_one_time_init (&d_ctx); - - if (!usrp_load_standard_bits (which_board, false, fpga_filename, - firmware_filename, d_ctx)) - throw std::runtime_error ("usrp_basic/usrp_load_standard_bits"); - - libusb_device *dev = usrp_find_device (which_board, false, d_ctx); - if (dev == 0){ - fprintf (stderr, "usrp_basic: can't find usrp[%d]\n", which_board); - throw std::runtime_error ("usrp_basic/usrp_find_device"); - } - - if (!(usrp_usrp_p(dev) && usrp_hw_rev(dev) >= 1)){ - fprintf (stderr, "usrp_basic: sorry, this code only works with USRP revs >= 1\n"); - throw std::runtime_error ("usrp_basic/bad_rev"); - } - - if ((d_udh = open_interface (dev)) == 0) - throw std::runtime_error ("usrp_basic/open_interface"); - - // initialize registers that are common to rx and tx - - if (!usrp_9862_write_many_all (d_udh, common_regs, sizeof (common_regs))) { - fprintf (stderr, "usrp_basic: failed to init common AD9862 regs\n"); - throw std::runtime_error ("usrp_basic/init_9862"); - } - - _write_fpga_reg (FR_MODE, 0); // ensure we're in normal mode - _write_fpga_reg (FR_DEBUG_EN, 0); // disable debug outputs - -} - -usrp_basic::~usrp_basic () -{ - d_db.resize(0); // forget db shared ptrs - - if (d_udh) - usrp_close_interface (d_udh); - - usrp_deinit (d_ctx); -} - -void -usrp_basic::shutdown_daughterboards() -{ - // nuke d'boards before we close down USB in ~usrp_basic - // shutdown() will do any board shutdown while the USRP can still - // be talked to - for(size_t i = 0; i < d_db.size(); i++) - for(size_t j = 0; j < d_db[i].size(); j++) - d_db[i][j]->shutdown(); -} - -void -usrp_basic::init_db(usrp_basic_sptr u) -{ - if (u.get() != this) - throw std::invalid_argument("u is not this"); - - d_db[0] = instantiate_dbs(d_dbid[0], u, 0); - d_db[1] = instantiate_dbs(d_dbid[1], u, 1); -} - -std::vector<db_base_sptr> -usrp_basic::db(int which_side) -{ - which_side &= 0x1; // clamp it to avoid any reporting any errors - return d_db[which_side]; -} - -bool -usrp_basic::is_valid(const usrp_subdev_spec &ss) -{ - if (ss.side < 0 || ss.side > 1) - return false; - - if (ss.subdev < 0 || ss.subdev >= d_db[ss.side].size()) - return false; - - return true; -} - -db_base_sptr -usrp_basic::selected_subdev(const usrp_subdev_spec &ss) -{ - if (!is_valid(ss)) - throw std::invalid_argument("invalid subdev_spec"); - - return d_db[ss.side][ss.subdev]; -} - -bool -usrp_basic::start () -{ - return true; // nop -} - -bool -usrp_basic::stop () -{ - return true; // nop -} - -void -usrp_basic::set_usb_data_rate (int usb_data_rate) -{ - d_usb_data_rate = usb_data_rate; - d_bytes_per_poll = (int) (usb_data_rate * POLLING_INTERVAL); -} - -bool -usrp_basic::_write_aux_dac (int slot, int which_dac, int value) -{ - return usrp_write_aux_dac (d_udh, slot, which_dac, value); -} - -bool -usrp_basic::_read_aux_adc (int slot, int which_adc, int *value) -{ - return usrp_read_aux_adc (d_udh, slot, which_adc, value); -} - -int -usrp_basic::_read_aux_adc (int slot, int which_adc) -{ - int value; - if (!_read_aux_adc (slot, which_adc, &value)) - return READ_FAILED; - - return value; -} - -bool -usrp_basic::write_eeprom (int i2c_addr, int eeprom_offset, const std::string buf) -{ - return usrp_eeprom_write (d_udh, i2c_addr, eeprom_offset, buf.data (), buf.size ()); -} - -std::string -usrp_basic::read_eeprom (int i2c_addr, int eeprom_offset, int len) -{ - if (len <= 0) - return ""; - - char buf[len]; - - if (!usrp_eeprom_read (d_udh, i2c_addr, eeprom_offset, buf, len)) - return ""; - - return std::string (buf, len); -} - -bool -usrp_basic::write_i2c (int i2c_addr, const std::string buf) -{ - return usrp_i2c_write (d_udh, i2c_addr, buf.data (), buf.size ()); -} - -std::string -usrp_basic::read_i2c (int i2c_addr, int len) -{ - if (len <= 0) - return ""; - - char buf[len]; - - if (!usrp_i2c_read (d_udh, i2c_addr, buf, len)) - return ""; - - return std::string (buf, len); -} - -std::string -usrp_basic::serial_number() -{ - return usrp_serial_number(d_udh); -} - -// ---------------------------------------------------------------- - -bool -usrp_basic::set_adc_offset (int which_adc, int offset) -{ - if (which_adc < 0 || which_adc > 3) - return false; - - return _write_fpga_reg (FR_ADC_OFFSET_0 + which_adc, offset); -} - -bool -usrp_basic::set_dac_offset (int which_dac, int offset, int offset_pin) -{ - if (which_dac < 0 || which_dac > 3) - return false; - - int which_codec = which_dac >> 1; - int tx_a = (which_dac & 0x1) == 0; - int lo = ((offset & 0x3) << 6) | (offset_pin & 0x1); - int hi = (offset >> 2); - bool ok; - - if (tx_a){ - ok = _write_9862 (which_codec, REG_TX_A_OFFSET_LO, lo); - ok &= _write_9862 (which_codec, REG_TX_A_OFFSET_HI, hi); - } - else { - ok = _write_9862 (which_codec, REG_TX_B_OFFSET_LO, lo); - ok &= _write_9862 (which_codec, REG_TX_B_OFFSET_HI, hi); - } - return ok; -} - -bool -usrp_basic::set_adc_buffer_bypass (int which_adc, bool bypass) -{ - if (which_adc < 0 || which_adc > 3) - return false; - - int codec = which_adc >> 1; - int reg = (which_adc & 1) == 0 ? REG_RX_A : REG_RX_B; - - unsigned char cur_rx; - unsigned char cur_pwr_dn; - - // If the input buffer is bypassed, we need to power it down too. - - bool ok = _read_9862 (codec, reg, &cur_rx); - ok &= _read_9862 (codec, REG_RX_PWR_DN, &cur_pwr_dn); - if (!ok) - return false; - - if (bypass){ - cur_rx |= RX_X_BYPASS_INPUT_BUFFER; - cur_pwr_dn |= ((which_adc & 1) == 0) ? RX_PWR_DN_BUF_A : RX_PWR_DN_BUF_B; - } - else { - cur_rx &= ~RX_X_BYPASS_INPUT_BUFFER; - cur_pwr_dn &= ~(((which_adc & 1) == 0) ? RX_PWR_DN_BUF_A : RX_PWR_DN_BUF_B); - } - - ok &= _write_9862 (codec, reg, cur_rx); - ok &= _write_9862 (codec, REG_RX_PWR_DN, cur_pwr_dn); - return ok; -} - -bool -usrp_basic::set_dc_offset_cl_enable(int bits, int mask) -{ - return _write_fpga_reg(FR_DC_OFFSET_CL_EN, - (d_fpga_shadows[FR_DC_OFFSET_CL_EN] & ~mask) | (bits & mask)); -} - -// ---------------------------------------------------------------- - -bool -usrp_basic::_write_fpga_reg (int regno, int value) -{ - if (d_verbose){ - fprintf (stdout, "_write_fpga_reg(%3d, 0x%08x)\n", regno, value); - fflush (stdout); - } - - if (regno >= 0 && regno < MAX_REGS) - d_fpga_shadows[regno] = value; - - return usrp_write_fpga_reg (d_udh, regno, value); -} - -bool -usrp_basic::_write_fpga_reg_masked (int regno, int value, int mask) -{ - //Only use this for registers who actually use a mask in the verilog firmware, like FR_RX_MASTER_SLAVE - //value is a 16 bits value and mask is a 16 bits mask - if (d_verbose){ - fprintf (stdout, "_write_fpga_reg_masked(%3d, 0x%04x,0x%04x)\n", regno, value, mask); - fflush (stdout); - } - - if (regno >= 0 && regno < MAX_REGS) - d_fpga_shadows[regno] = value; - - return usrp_write_fpga_reg (d_udh, regno, (value & 0xffff) | ((mask & 0xffff)<<16)); -} - - -bool -usrp_basic::_read_fpga_reg (int regno, int *value) -{ - return usrp_read_fpga_reg (d_udh, regno, value); -} - -int -usrp_basic::_read_fpga_reg (int regno) -{ - int value; - if (!_read_fpga_reg (regno, &value)) - return READ_FAILED; - return value; -} - -bool -usrp_basic::_write_9862 (int which_codec, int regno, unsigned char value) -{ - if (0 && d_verbose){ - // FIXME really want to enable logging in usrp_prims:usrp_9862_write - fprintf(stdout, "_write_9862(codec = %d, regno = %2d, val = 0x%02x)\n", which_codec, regno, value); - fflush(stdout); - } - - return usrp_9862_write (d_udh, which_codec, regno, value); -} - - -bool -usrp_basic::_read_9862 (int which_codec, int regno, unsigned char *value) const -{ - return usrp_9862_read (d_udh, which_codec, regno, value); -} - -int -usrp_basic::_read_9862 (int which_codec, int regno) const -{ - unsigned char value; - if (!_read_9862 (which_codec, regno, &value)) - return READ_FAILED; - return value; -} - -bool -usrp_basic::_write_spi (int optional_header, int enables, int format, std::string buf) -{ - return usrp_spi_write (d_udh, optional_header, enables, format, - buf.data(), buf.size()); -} - -std::string -usrp_basic::_read_spi (int optional_header, int enables, int format, int len) -{ - if (len <= 0) - return ""; - - char buf[len]; - - if (!usrp_spi_read (d_udh, optional_header, enables, format, buf, len)) - return ""; - - return std::string (buf, len); -} - - -bool -usrp_basic::_set_led (int which_led, bool on) -{ - return usrp_set_led (d_udh, which_led, on); -} - -bool -usrp_basic::write_atr_tx_delay(int value) -{ - return _write_fpga_reg(FR_ATR_TX_DELAY, value); -} - -bool -usrp_basic::write_atr_rx_delay(int value) -{ - return _write_fpga_reg(FR_ATR_RX_DELAY, value); -} - -/* - * ---------------------------------------------------------------- - * Routines to access and control daughterboard specific i/o - * ---------------------------------------------------------------- - */ -static int -slot_id_to_oe_reg (int slot_id) -{ - static int reg[4] = { FR_OE_0, FR_OE_1, FR_OE_2, FR_OE_3 }; - assert (0 <= slot_id && slot_id < 4); - return reg[slot_id]; -} - -static int -slot_id_to_io_reg (int slot_id) -{ - static int reg[4] = { FR_IO_0, FR_IO_1, FR_IO_2, FR_IO_3 }; - assert (0 <= slot_id && slot_id < 4); - return reg[slot_id]; -} - -static int -slot_id_to_refclk_reg(int slot_id) -{ - static int reg[4] = { FR_TX_A_REFCLK, FR_RX_A_REFCLK, FR_TX_B_REFCLK, FR_RX_B_REFCLK }; - assert (0 <= slot_id && slot_id < 4); - return reg[slot_id]; -} - -static int -slot_id_to_atr_mask_reg(int slot_id) -{ - static int reg[4] = { FR_ATR_MASK_0, FR_ATR_MASK_1, FR_ATR_MASK_2, FR_ATR_MASK_3 }; - assert (0 <= slot_id && slot_id < 4); - return reg[slot_id]; -} - -static int -slot_id_to_atr_txval_reg(int slot_id) -{ - static int reg[4] = { FR_ATR_TXVAL_0, FR_ATR_TXVAL_1, FR_ATR_TXVAL_2, FR_ATR_TXVAL_3 }; - assert (0 <= slot_id && slot_id < 4); - return reg[slot_id]; -} - -static int -slot_id_to_atr_rxval_reg(int slot_id) -{ - static int reg[4] = { FR_ATR_RXVAL_0, FR_ATR_RXVAL_1, FR_ATR_RXVAL_2, FR_ATR_RXVAL_3 }; - assert (0 <= slot_id && slot_id < 4); - return reg[slot_id]; -} - -static int -to_slot(txrx_t txrx, int which_side) -{ - // TX_A = 0 - // RX_A = 1 - // TX_B = 2 - // RX_B = 3 - return ((which_side & 0x1) << 1) | ((txrx & 0x1) == C_RX); -} - -bool -usrp_basic::common_set_pga(txrx_t txrx, int which_amp, double gain) -{ - if (which_amp < 0 || which_amp > 3) - return false; - - gain = std::min(common_pga_max(txrx), - std::max(common_pga_min(txrx), gain)); - - int codec = which_amp >> 1; - int int_gain = (int) rint((gain - common_pga_min(txrx)) / common_pga_db_per_step(txrx)); - - if (txrx == C_TX){ // 0 and 1 are same, as are 2 and 3 - return _write_9862(codec, REG_TX_PGA, int_gain); - } - else { - int reg = (which_amp & 1) == 0 ? REG_RX_A : REG_RX_B; - - // read current value to get input buffer bypass flag. - unsigned char cur_rx; - if (!_read_9862(codec, reg, &cur_rx)) - return false; - - cur_rx = (cur_rx & RX_X_BYPASS_INPUT_BUFFER) | (int_gain & 0x7f); - return _write_9862(codec, reg, cur_rx); - } -} - -double -usrp_basic::common_pga(txrx_t txrx, int which_amp) const -{ - if (which_amp < 0 || which_amp > 3) - return READ_FAILED; - - if (txrx == C_TX){ - int codec = which_amp >> 1; - unsigned char v; - bool ok = _read_9862 (codec, REG_TX_PGA, &v); - if (!ok) - return READ_FAILED; - - return (pga_db_per_step() * v) + pga_min(); - } - else { - int codec = which_amp >> 1; - int reg = (which_amp & 1) == 0 ? REG_RX_A : REG_RX_B; - unsigned char v; - bool ok = _read_9862 (codec, reg, &v); - if (!ok) - return READ_FAILED; - - return (pga_db_per_step() * (v & 0x1f)) + pga_min(); - } -} - -double -usrp_basic::common_pga_min(txrx_t txrx) const -{ - if (txrx == C_TX) - return -20.0; - else - return 0.0; -} - -double -usrp_basic::common_pga_max(txrx_t txrx) const -{ - if (txrx == C_TX) - return 0.0; - else - return 20.0; -} - -double -usrp_basic::common_pga_db_per_step(txrx_t txrx) const -{ - if (txrx == C_TX) - return 20.0 / 255; - else - return 20.0 / 20; -} - -bool -usrp_basic::_common_write_oe(txrx_t txrx, int which_side, int value, int mask) -{ - if (! (0 <= which_side && which_side <= 1)) - return false; - - return _write_fpga_reg(slot_id_to_oe_reg(to_slot(txrx, which_side)), - (mask << 16) | (value & 0xffff)); -} - -bool -usrp_basic::common_write_io(txrx_t txrx, int which_side, int value, int mask) -{ - if (! (0 <= which_side && which_side <= 1)) - return false; - - return _write_fpga_reg(slot_id_to_io_reg(to_slot(txrx, which_side)), - (mask << 16) | (value & 0xffff)); -} - -bool -usrp_basic::common_read_io(txrx_t txrx, int which_side, int *value) -{ - if (! (0 <= which_side && which_side <= 1)) - return false; - - int t; - int reg = which_side + 1; // FIXME, *very* magic number (fix in serial_io.v) - bool ok = _read_fpga_reg(reg, &t); - if (!ok) - return false; - - if (txrx == C_TX){ - *value = t & 0xffff; // FIXME, more magic - return true; - } - else { - *value = (t >> 16) & 0xffff; // FIXME, more magic - return true; - } -} - -int -usrp_basic::common_read_io(txrx_t txrx, int which_side) -{ - int value; - if (!common_read_io(txrx, which_side, &value)) - return READ_FAILED; - return value; -} - -bool -usrp_basic::common_write_refclk(txrx_t txrx, int which_side, int value) -{ - if (! (0 <= which_side && which_side <= 1)) - return false; - - return _write_fpga_reg(slot_id_to_refclk_reg(to_slot(txrx, which_side)), - value); -} - -bool -usrp_basic::common_write_atr_mask(txrx_t txrx, int which_side, int value) -{ - if (! (0 <= which_side && which_side <= 1)) - return false; - - return _write_fpga_reg(slot_id_to_atr_mask_reg(to_slot(txrx, which_side)), - value); -} - -bool -usrp_basic::common_write_atr_txval(txrx_t txrx, int which_side, int value) -{ - if (! (0 <= which_side && which_side <= 1)) - return false; - - return _write_fpga_reg(slot_id_to_atr_txval_reg(to_slot(txrx, which_side)), - value); -} - -bool -usrp_basic::common_write_atr_rxval(txrx_t txrx, int which_side, int value) -{ - if (! (0 <= which_side && which_side <= 1)) - return false; - - return _write_fpga_reg(slot_id_to_atr_rxval_reg(to_slot(txrx, which_side)), - value); -} - -bool -usrp_basic::common_write_aux_dac(txrx_t txrx, int which_side, int which_dac, int value) -{ - return _write_aux_dac(to_slot(txrx, which_side), which_dac, value); -} - -bool -usrp_basic::common_read_aux_adc(txrx_t txrx, int which_side, int which_adc, int *value) -{ - return _read_aux_adc(to_slot(txrx, which_side), which_adc, value); -} - -int -usrp_basic::common_read_aux_adc(txrx_t txrx, int which_side, int which_adc) -{ - return _read_aux_adc(to_slot(txrx, which_side), which_adc); -} - - -//////////////////////////////////////////////////////////////// -// -// usrp_basic_rx -// -//////////////////////////////////////////////////////////////// - -static unsigned char rx_init_regs[] = { - REG_RX_PWR_DN, 0, - REG_RX_A, 0, // minimum gain = 0x00 (max gain = 0x14) - REG_RX_B, 0, // minimum gain = 0x00 (max gain = 0x14) - REG_RX_MISC, (RX_MISC_HS_DUTY_CYCLE | RX_MISC_CLK_DUTY), - REG_RX_IF, (RX_IF_USE_CLKOUT1 - | RX_IF_2S_COMP), - REG_RX_DIGITAL, (RX_DIGITAL_2_CHAN) -}; - - -usrp_basic_rx::usrp_basic_rx (int which_board, int fusb_block_size, int fusb_nblocks, - const std::string fpga_filename, - const std::string firmware_filename - ) - : usrp_basic (which_board, open_rx_interface, fpga_filename, firmware_filename), - d_devhandle (0), d_ephandle (0), - d_bytes_seen (0), d_first_read (true), - d_rx_enable (false) -{ - // initialize rx specific registers - - if (!usrp_9862_write_many_all (d_udh, rx_init_regs, sizeof (rx_init_regs))){ - fprintf (stderr, "usrp_basic_rx: failed to init AD9862 RX regs\n"); - throw std::runtime_error ("usrp_basic_rx/init_9862"); - } - - if (0){ - // FIXME power down 2nd codec rx path - usrp_9862_write (d_udh, 1, REG_RX_PWR_DN, 0x1); // power down everything - } - - // Reset the rx path and leave it disabled. - set_rx_enable (false); - usrp_set_fpga_rx_reset (d_udh, true); - usrp_set_fpga_rx_reset (d_udh, false); - - set_fpga_rx_sample_rate_divisor (2); // usually correct - - set_dc_offset_cl_enable(0xf, 0xf); // enable DC offset removal control loops - - probe_rx_slots (false); - - //d_db[0] = instantiate_dbs(d_dbid[0], this, 0); - //d_db[1] = instantiate_dbs(d_dbid[1], this, 1); - - // check fusb buffering parameters - - if (fusb_block_size < 0 || fusb_block_size > FUSB_BLOCK_SIZE) - throw std::out_of_range ("usrp_basic_rx: invalid fusb_block_size"); - - if (fusb_nblocks < 0) - throw std::out_of_range ("usrp_basic_rx: invalid fusb_nblocks"); - - if (fusb_block_size == 0) - fusb_block_size = fusb_sysconfig::default_block_size(); - - if (fusb_nblocks == 0) - fusb_nblocks = std::max (1, FUSB_BUFFER_SIZE / fusb_block_size); - - d_devhandle = fusb_sysconfig::make_devhandle (d_udh, d_ctx); - d_ephandle = d_devhandle->make_ephandle (USRP_RX_ENDPOINT, true, - fusb_block_size, fusb_nblocks); - - write_atr_mask(0, 0); // zero Rx A Auto Transmit/Receive regs - write_atr_txval(0, 0); - write_atr_rxval(0, 0); - write_atr_mask(1, 0); // zero Rx B Auto Transmit/Receive regs - write_atr_txval(1, 0); - write_atr_rxval(1, 0); -} - -static unsigned char rx_fini_regs[] = { - REG_RX_PWR_DN, 0x1 // power down everything -}; - -usrp_basic_rx::~usrp_basic_rx () -{ - if (!set_rx_enable (false)){ - fprintf (stderr, "usrp_basic_rx: set_fpga_rx_enable failed\n"); - } - - d_ephandle->stop (); - delete d_ephandle; - delete d_devhandle; - - if (!usrp_9862_write_many_all (d_udh, rx_fini_regs, sizeof (rx_fini_regs))){ - fprintf (stderr, "usrp_basic_rx: failed to fini AD9862 RX regs\n"); - } - - shutdown_daughterboards(); -} - - -bool -usrp_basic_rx::start () -{ - if (!usrp_basic::start ()) // invoke parent's method - return false; - - // fire off reads before asserting rx_enable - - if (!d_ephandle->start ()){ - fprintf (stderr, "usrp_basic_rx: failed to start end point streaming"); - return false; - } - - if (!set_rx_enable (true)){ - fprintf (stderr, "usrp_basic_rx: set_rx_enable failed\n"); - return false; - } - - return true; -} - -bool -usrp_basic_rx::stop () -{ - bool ok = usrp_basic::stop(); - - if (!set_rx_enable(false)){ - fprintf (stderr, "usrp_basic_rx: set_rx_enable(false) failed\n"); - ok = false; - } - - if (!d_ephandle->stop()){ - fprintf (stderr, "usrp_basic_rx: failed to stop end point streaming"); - ok = false; - } - - return ok; -} - -usrp_basic_rx * -usrp_basic_rx::make (int which_board, int fusb_block_size, int fusb_nblocks, - const std::string fpga_filename, - const std::string firmware_filename) -{ - usrp_basic_rx *u = 0; - - try { - u = new usrp_basic_rx (which_board, fusb_block_size, fusb_nblocks, - fpga_filename, firmware_filename); - return u; - } - catch (...){ - delete u; - return 0; - } - - return u; -} - -bool -usrp_basic_rx::set_fpga_rx_sample_rate_divisor (unsigned int div) -{ - return _write_fpga_reg (FR_RX_SAMPLE_RATE_DIV, div - 1); -} - - -/* - * \brief read data from the D/A's via the FPGA. - * \p len must be a multiple of 512 bytes. - * - * \returns the number of bytes read, or -1 on error. - * - * If overrun is non-NULL it will be set true iff an RX overrun is detected. - */ -int -usrp_basic_rx::read (void *buf, int len, bool *overrun) -{ - int r; - - if (overrun) - *overrun = false; - - if (len < 0 || (len % 512) != 0){ - fprintf (stderr, "usrp_basic_rx::read: invalid length = %d\n", len); - return -1; - } - - r = d_ephandle->read (buf, len); - if (r > 0) - d_bytes_seen += r; - - /* - * In many cases, the FPGA reports an rx overrun right after we - * enable the Rx path. If this is our first read, check for the - * overrun to clear the condition, then ignore the result. - */ - if (0 && d_first_read){ // FIXME - d_first_read = false; - bool bogus_overrun; - usrp_check_rx_overrun (d_udh, &bogus_overrun); - } - - if (overrun != 0 && d_bytes_seen >= d_bytes_per_poll){ - d_bytes_seen = 0; - if (!usrp_check_rx_overrun (d_udh, overrun)){ - fprintf (stderr, "usrp_basic_rx: usrp_check_rx_overrun failed\n"); - } - } - - return r; -} - -bool -usrp_basic_rx::set_rx_enable (bool on) -{ - d_rx_enable = on; - return usrp_set_fpga_rx_enable (d_udh, on); -} - -// conditional disable, return prev state -bool -usrp_basic_rx::disable_rx () -{ - bool enabled = rx_enable (); - if (enabled) - set_rx_enable (false); - return enabled; -} - -// conditional set -void -usrp_basic_rx::restore_rx (bool on) -{ - if (on != rx_enable ()) - set_rx_enable (on); -} - -void -usrp_basic_rx::probe_rx_slots (bool verbose) -{ - struct usrp_dboard_eeprom eeprom; - static int slot_id_map[2] = { SLOT_RX_A, SLOT_RX_B }; - static const char *slot_name[2] = { "RX d'board A", "RX d'board B" }; - - for (int i = 0; i < 2; i++){ - int slot_id = slot_id_map [i]; - const char *msg = 0; - usrp_dbeeprom_status_t s = usrp_read_dboard_eeprom (d_udh, slot_id, &eeprom); - - switch (s){ - case UDBE_OK: - d_dbid[i] = eeprom.id; - msg = usrp_dbid_to_string (eeprom.id).c_str (); - set_adc_offset (2*i+0, eeprom.offset[0]); - set_adc_offset (2*i+1, eeprom.offset[1]); - _write_fpga_reg (slot_id_to_oe_reg(slot_id), (0xffff << 16) | eeprom.oe); - _write_fpga_reg (slot_id_to_io_reg(slot_id), (0xffff << 16) | 0x0000); - break; - - case UDBE_NO_EEPROM: - d_dbid[i] = -1; - msg = "<none>"; - _write_fpga_reg (slot_id_to_oe_reg(slot_id), (0xffff << 16) | 0x0000); - _write_fpga_reg (slot_id_to_io_reg(slot_id), (0xffff << 16) | 0x0000); - break; - - case UDBE_INVALID_EEPROM: - d_dbid[i] = -2; - msg = "Invalid EEPROM contents"; - _write_fpga_reg (slot_id_to_oe_reg(slot_id), (0xffff << 16) | 0x0000); - _write_fpga_reg (slot_id_to_io_reg(slot_id), (0xffff << 16) | 0x0000); - break; - - case UDBE_BAD_SLOT: - default: - assert (0); - } - - if (verbose){ - fflush (stdout); - fprintf (stderr, "%s: %s\n", slot_name[i], msg); - } - } -} - -bool -usrp_basic_rx::set_pga (int which_amp, double gain) -{ - return common_set_pga(C_RX, which_amp, gain); -} - -double -usrp_basic_rx::pga(int which_amp) const -{ - return common_pga(C_RX, which_amp); -} - -double -usrp_basic_rx::pga_min() const -{ - return common_pga_min(C_RX); -} - -double -usrp_basic_rx::pga_max() const -{ - return common_pga_max(C_RX); -} - -double -usrp_basic_rx::pga_db_per_step() const -{ - return common_pga_db_per_step(C_RX); -} - -bool -usrp_basic_rx::_write_oe (int which_side, int value, int mask) -{ - return _common_write_oe(C_RX, which_side, value, mask); -} - -bool -usrp_basic_rx::write_io (int which_side, int value, int mask) -{ - return common_write_io(C_RX, which_side, value, mask); -} - -bool -usrp_basic_rx::read_io (int which_side, int *value) -{ - return common_read_io(C_RX, which_side, value); -} - -int -usrp_basic_rx::read_io (int which_side) -{ - return common_read_io(C_RX, which_side); -} - -bool -usrp_basic_rx::write_refclk(int which_side, int value) -{ - return common_write_refclk(C_RX, which_side, value); -} - -bool -usrp_basic_rx::write_atr_mask(int which_side, int value) -{ - return common_write_atr_mask(C_RX, which_side, value); -} - -bool -usrp_basic_rx::write_atr_txval(int which_side, int value) -{ - return common_write_atr_txval(C_RX, which_side, value); -} - -bool -usrp_basic_rx::write_atr_rxval(int which_side, int value) -{ - return common_write_atr_rxval(C_RX, which_side, value); -} - -bool -usrp_basic_rx::write_aux_dac (int which_side, int which_dac, int value) -{ - return common_write_aux_dac(C_RX, which_side, which_dac, value); -} - -bool -usrp_basic_rx::read_aux_adc (int which_side, int which_adc, int *value) -{ - return common_read_aux_adc(C_RX, which_side, which_adc, value); -} - -int -usrp_basic_rx::read_aux_adc (int which_side, int which_adc) -{ - return common_read_aux_adc(C_RX, which_side, which_adc); -} - -int -usrp_basic_rx::block_size () const { return d_ephandle->block_size(); } - -//////////////////////////////////////////////////////////////// -// -// usrp_basic_tx -// -//////////////////////////////////////////////////////////////// - - -// -// DAC input rate 64 MHz interleaved for a total input rate of 128 MHz -// DAC input is latched on rising edge of CLKOUT2 -// NCO is disabled -// interpolate 2x -// coarse modulator disabled -// - -static unsigned char tx_init_regs[] = { - REG_TX_PWR_DN, 0, - REG_TX_A_OFFSET_LO, 0, - REG_TX_A_OFFSET_HI, 0, - REG_TX_B_OFFSET_LO, 0, - REG_TX_B_OFFSET_HI, 0, - REG_TX_A_GAIN, (TX_X_GAIN_COARSE_FULL | 0), - REG_TX_B_GAIN, (TX_X_GAIN_COARSE_FULL | 0), - REG_TX_PGA, 0xff, // maximum gain (0 dB) - REG_TX_MISC, 0, - REG_TX_IF, (TX_IF_USE_CLKOUT1 - | TX_IF_I_FIRST - | TX_IF_INV_TX_SYNC - | TX_IF_2S_COMP - | TX_IF_INTERLEAVED), - REG_TX_DIGITAL, (TX_DIGITAL_2_DATA_PATHS - | TX_DIGITAL_INTERPOLATE_4X), - REG_TX_MODULATOR, (TX_MODULATOR_DISABLE_NCO - | TX_MODULATOR_COARSE_MODULATION_NONE), - REG_TX_NCO_FTW_7_0, 0, - REG_TX_NCO_FTW_15_8, 0, - REG_TX_NCO_FTW_23_16, 0 -}; - -usrp_basic_tx::usrp_basic_tx (int which_board, int fusb_block_size, int fusb_nblocks, - const std::string fpga_filename, - const std::string firmware_filename) - : usrp_basic (which_board, open_tx_interface, fpga_filename, firmware_filename), - d_devhandle (0), d_ephandle (0), - d_bytes_seen (0), d_first_write (true), - d_tx_enable (false) -{ - if (!usrp_9862_write_many_all (d_udh, tx_init_regs, sizeof (tx_init_regs))){ - fprintf (stderr, "usrp_basic_tx: failed to init AD9862 TX regs\n"); - throw std::runtime_error ("usrp_basic_tx/init_9862"); - } - - if (0){ - // FIXME power down 2nd codec tx path - usrp_9862_write (d_udh, 1, REG_TX_PWR_DN, - (TX_PWR_DN_TX_DIGITAL - | TX_PWR_DN_TX_ANALOG_BOTH)); - } - - // Reset the tx path and leave it disabled. - set_tx_enable (false); - usrp_set_fpga_tx_reset (d_udh, true); - usrp_set_fpga_tx_reset (d_udh, false); - - set_fpga_tx_sample_rate_divisor (4); // we're using interp x4 - - probe_tx_slots (false); - - //d_db[0] = instantiate_dbs(d_dbid[0], this, 0); - //d_db[1] = instantiate_dbs(d_dbid[1], this, 1); - - // check fusb buffering parameters - - if (fusb_block_size < 0 || fusb_block_size > FUSB_BLOCK_SIZE) - throw std::out_of_range ("usrp_basic_rx: invalid fusb_block_size"); - - if (fusb_nblocks < 0) - throw std::out_of_range ("usrp_basic_rx: invalid fusb_nblocks"); - - if (fusb_block_size == 0) - fusb_block_size = FUSB_BLOCK_SIZE; - - if (fusb_nblocks == 0) - fusb_nblocks = std::max (1, FUSB_BUFFER_SIZE / fusb_block_size); - - d_devhandle = fusb_sysconfig::make_devhandle (d_udh, d_ctx); - d_ephandle = d_devhandle->make_ephandle (USRP_TX_ENDPOINT, false, - fusb_block_size, fusb_nblocks); - - write_atr_mask(0, 0); // zero Tx A Auto Transmit/Receive regs - write_atr_txval(0, 0); - write_atr_rxval(0, 0); - write_atr_mask(1, 0); // zero Tx B Auto Transmit/Receive regs - write_atr_txval(1, 0); - write_atr_rxval(1, 0); -} - - -static unsigned char tx_fini_regs[] = { - REG_TX_PWR_DN, (TX_PWR_DN_TX_DIGITAL - | TX_PWR_DN_TX_ANALOG_BOTH), - REG_TX_MODULATOR, (TX_MODULATOR_DISABLE_NCO - | TX_MODULATOR_COARSE_MODULATION_NONE) -}; - -usrp_basic_tx::~usrp_basic_tx () -{ - d_ephandle->stop (); - delete d_ephandle; - delete d_devhandle; - - if (!usrp_9862_write_many_all (d_udh, tx_fini_regs, sizeof (tx_fini_regs))){ - fprintf (stderr, "usrp_basic_tx: failed to fini AD9862 TX regs\n"); - } - - shutdown_daughterboards(); -} - -bool -usrp_basic_tx::start () -{ - if (!usrp_basic::start ()) - return false; - - if (!set_tx_enable (true)){ - fprintf (stderr, "usrp_basic_tx: set_tx_enable failed\n"); - return false; - } - - if (!d_ephandle->start ()){ - fprintf (stderr, "usrp_basic_tx: failed to start end point streaming"); - return false; - } - - return true; -} - -bool -usrp_basic_tx::stop () -{ - bool ok = usrp_basic::stop (); - - if (!d_ephandle->stop ()){ - fprintf (stderr, "usrp_basic_tx: failed to stop end point streaming"); - ok = false; - } - - if (!set_tx_enable (false)){ - fprintf (stderr, "usrp_basic_tx: set_tx_enable(false) failed\n"); - ok = false; - } - - return ok; -} - -usrp_basic_tx * -usrp_basic_tx::make (int which_board, int fusb_block_size, int fusb_nblocks, - const std::string fpga_filename, - const std::string firmware_filename) -{ - usrp_basic_tx *u = 0; - - try { - u = new usrp_basic_tx (which_board, fusb_block_size, fusb_nblocks, - fpga_filename, firmware_filename); - return u; - } - catch (...){ - delete u; - return 0; - } - - return u; -} - -bool -usrp_basic_tx::set_fpga_tx_sample_rate_divisor (unsigned int div) -{ - return _write_fpga_reg (FR_TX_SAMPLE_RATE_DIV, div - 1); -} - -/*! - * \brief Write data to the A/D's via the FPGA. - * - * \p len must be a multiple of 512 bytes. - * \returns number of bytes written or -1 on error. - * - * if \p underrun is non-NULL, it will be set to true iff - * a transmit underrun condition is detected. - */ -int -usrp_basic_tx::write (const void *buf, int len, bool *underrun) -{ - int r; - - if (underrun) - *underrun = false; - - if (len < 0 || (len % 512) != 0){ - fprintf (stderr, "usrp_basic_tx::write: invalid length = %d\n", len); - return -1; - } - - r = d_ephandle->write (buf, len); - if (r > 0) - d_bytes_seen += r; - - /* - * In many cases, the FPGA reports an tx underrun right after we - * enable the Tx path. If this is our first write, check for the - * underrun to clear the condition, then ignore the result. - */ - if (d_first_write && d_bytes_seen >= 4 * FUSB_BLOCK_SIZE){ - d_first_write = false; - bool bogus_underrun; - usrp_check_tx_underrun (d_udh, &bogus_underrun); - } - - if (underrun != 0 && d_bytes_seen >= d_bytes_per_poll){ - d_bytes_seen = 0; - if (!usrp_check_tx_underrun (d_udh, underrun)){ - fprintf (stderr, "usrp_basic_tx: usrp_check_tx_underrun failed\n"); - } - } - - return r; -} - -void -usrp_basic_tx::wait_for_completion () -{ - d_ephandle->wait_for_completion (); -} - -bool -usrp_basic_tx::set_tx_enable (bool on) -{ - d_tx_enable = on; - // fprintf (stderr, "set_tx_enable %d\n", on); - return usrp_set_fpga_tx_enable (d_udh, on); -} - -// conditional disable, return prev state -bool -usrp_basic_tx::disable_tx () -{ - bool enabled = tx_enable (); - if (enabled) - set_tx_enable (false); - return enabled; -} - -// conditional set -void -usrp_basic_tx::restore_tx (bool on) -{ - if (on != tx_enable ()) - set_tx_enable (on); -} - -void -usrp_basic_tx::probe_tx_slots (bool verbose) -{ - struct usrp_dboard_eeprom eeprom; - static int slot_id_map[2] = { SLOT_TX_A, SLOT_TX_B }; - static const char *slot_name[2] = { "TX d'board A", "TX d'board B" }; - - for (int i = 0; i < 2; i++){ - int slot_id = slot_id_map [i]; - const char *msg = 0; - usrp_dbeeprom_status_t s = usrp_read_dboard_eeprom (d_udh, slot_id, &eeprom); - - switch (s){ - case UDBE_OK: - d_dbid[i] = eeprom.id; - msg = usrp_dbid_to_string (eeprom.id).c_str (); - // FIXME, figure out interpretation of dc offset for TX d'boards - // offset = (eeprom.offset[1] << 16) | (eeprom.offset[0] & 0xffff); - _write_fpga_reg (slot_id_to_oe_reg(slot_id), (0xffff << 16) | eeprom.oe); - _write_fpga_reg (slot_id_to_io_reg(slot_id), (0xffff << 16) | 0x0000); - break; - - case UDBE_NO_EEPROM: - d_dbid[i] = -1; - msg = "<none>"; - _write_fpga_reg (slot_id_to_oe_reg(slot_id), (0xffff << 16) | 0x0000); - _write_fpga_reg (slot_id_to_io_reg(slot_id), (0xffff << 16) | 0x0000); - break; - - case UDBE_INVALID_EEPROM: - d_dbid[i] = -2; - msg = "Invalid EEPROM contents"; - _write_fpga_reg (slot_id_to_oe_reg(slot_id), (0xffff << 16) | 0x0000); - _write_fpga_reg (slot_id_to_io_reg(slot_id), (0xffff << 16) | 0x0000); - break; - - case UDBE_BAD_SLOT: - default: - assert (0); - } - - if (verbose){ - fflush (stdout); - fprintf (stderr, "%s: %s\n", slot_name[i], msg); - } - } -} - -bool -usrp_basic_tx::set_pga (int which_amp, double gain) -{ - return common_set_pga(C_TX, which_amp, gain); -} - -double -usrp_basic_tx::pga (int which_amp) const -{ - return common_pga(C_TX, which_amp); -} - -double -usrp_basic_tx::pga_min() const -{ - return common_pga_min(C_TX); -} - -double -usrp_basic_tx::pga_max() const -{ - return common_pga_max(C_TX); -} - -double -usrp_basic_tx::pga_db_per_step() const -{ - return common_pga_db_per_step(C_TX); -} - -bool -usrp_basic_tx::_write_oe (int which_side, int value, int mask) -{ - return _common_write_oe(C_TX, which_side, value, mask); -} - -bool -usrp_basic_tx::write_io (int which_side, int value, int mask) -{ - return common_write_io(C_TX, which_side, value, mask); -} - -bool -usrp_basic_tx::read_io (int which_side, int *value) -{ - return common_read_io(C_TX, which_side, value); -} - -int -usrp_basic_tx::read_io (int which_side) -{ - return common_read_io(C_TX, which_side); -} - -bool -usrp_basic_tx::write_refclk(int which_side, int value) -{ - return common_write_refclk(C_TX, which_side, value); -} - -bool -usrp_basic_tx::write_atr_mask(int which_side, int value) -{ - return common_write_atr_mask(C_TX, which_side, value); -} - -bool -usrp_basic_tx::write_atr_txval(int which_side, int value) -{ - return common_write_atr_txval(C_TX, which_side, value); -} - -bool -usrp_basic_tx::write_atr_rxval(int which_side, int value) -{ - return common_write_atr_rxval(C_TX, which_side, value); -} - -bool -usrp_basic_tx::write_aux_dac (int which_side, int which_dac, int value) -{ - return common_write_aux_dac(C_TX, which_side, which_dac, value); -} - -bool -usrp_basic_tx::read_aux_adc (int which_side, int which_adc, int *value) -{ - return common_read_aux_adc(C_TX, which_side, which_adc, value); -} - -int -usrp_basic_tx::read_aux_adc (int which_side, int which_adc) -{ - return common_read_aux_adc(C_TX, which_side, which_adc); -} - -int -usrp_basic_tx::block_size () const { return d_ephandle->block_size(); } - diff --git a/usrp/host/lib/usrp_config.cc b/usrp/host/lib/usrp_config.cc deleted file mode 100644 index fcf207f68..000000000 --- a/usrp/host/lib/usrp_config.cc +++ /dev/null @@ -1,35 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include "usrp_config.h" - -int -usrp_rx_config_stream_count (unsigned int usrp_rx_config) -{ - return 1; -} - -int -usrp_tx_config_stream_count (unsigned int usrp_tx_config) -{ - return 1; -} diff --git a/usrp/host/lib/usrp_config.h b/usrp/host/lib/usrp_config.h deleted file mode 100644 index ee5cb63bd..000000000 --- a/usrp/host/lib/usrp_config.h +++ /dev/null @@ -1,67 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _USRP_CONFIG_H_ -#define _USRP_CONFIG_H_ - -/* - * ---------------------------------------------------------------- - * USRP Rx configurations. - * - * For now this is a placeholder, but will eventually specify the - * mapping from A/D outputs to DDC inputs (I & Q). - * - * What's implemented today is a single DDC that has its I input - * connected to ADC0 and its Q input connected to ADC1 - * ---------------------------------------------------------------- - */ - -#define USRP_RX_CONFIG_DEFAULT 0 - -/*! - * given a usrp_rx_config word, return the number of I & Q streams that - * are interleaved on the USB. - */ - -int usrp_rx_config_stream_count (unsigned int usrp_rx_config); - -/* - * USRP Tx configurations. - * - * For now this is a placeholder, but will eventually specify the - * mapping from DUC outputs to D/A inputs. - * - * What's implemented today is a single DUC that has its I output - * connected to DAC0 and its Q output connected to DAC1 - */ - -#define USRP_TX_CONFIG_DEFAULT 0 - -/*! - * given a usrp_tx_config word, return the number of I & Q streams that - * are interleaved on the USB. - */ - -int usrp_tx_config_stream_count (unsigned int usrp_tx_config); - - -#endif /* _USRP_CONFIG_H_ */ diff --git a/usrp/host/lib/usrp_dbid.dat b/usrp/host/lib/usrp_dbid.dat deleted file mode 100644 index 2548d737e..000000000 --- a/usrp/host/lib/usrp_dbid.dat +++ /dev/null @@ -1,93 +0,0 @@ -# -# Copyright 2005,2009 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# - -# This file is used to generate usrp_dbid.h, usrp_dbid.cc and usrp_dbid.py - -"Basic Tx" 0x0000 -"Basic Rx" 0x0001 -"DBS Rx" 0x0002 -"TV Rx" 0x0003 - -"Flex 400 Rx" 0x0004 -"Flex 900 Rx" 0x0005 -"Flex 1200 Rx" 0x0006 -"Flex 2400 Rx" 0x0007 - -"Flex 400 Tx" 0x0008 -"Flex 900 Tx" 0x0009 -"Flex 1200 Tx" 0x000a -"Flex 2400 Tx" 0x000b - -"TV Rx Rev 2" 0x000c -"DBS Rx ClkMod" 0x000d - -"LF Tx" 0x000e -"LF Rx" 0x000f - -"Flex 400 Rx MIMO A" 0x0014 -"Flex 900 Rx MIMO A" 0x0015 -"Flex 1200 Rx MIMO A" 0x0016 -"Flex 2400 Rx MIMO A" 0x0017 - -"Flex 400 Tx MIMO A" 0x0018 -"Flex 900 Tx MIMO A" 0x0019 -"Flex 1200 Tx MIMO A" 0x001a -"Flex 2400 Tx MIMO A" 0x001b - -"Flex 400 Rx MIMO B" 0x0024 -"Flex 900 Rx MIMO B" 0x0025 -"Flex 1200 Rx MIMO B" 0x0026 -"Flex 2400 Rx MIMO B" 0x0027 - -"Flex 400 Tx MIMO B" 0x0028 -"Flex 900 Tx MIMO B" 0x0029 -"Flex 1200 Tx MIMO B" 0x002a -"Flex 2400 Tx MIMO B" 0x002b - -"Flex 2200 Rx MIMO B" 0x002c -"Flex 2200 Tx MIMO B" 0x002d - -"Flex 1800 Rx" 0x0030 -"Flex 1800 Tx" 0x0031 -"Flex 1800 Rx MIMO A" 0x0032 -"Flex 1800 Tx MIMO A" 0x0033 -"Flex 1800 Rx MIMO B" 0x0034 -"Flex 1800 Tx MIMO B" 0x0035 - -"TV Rx Rev 3" 0x0040 -"DTT754" 0x0041 -"DTT768" 0x0042 -"TV Rx MIMO" 0x0043 -"TV Rx Rev 2 MIMO" 0x0044 -"TV Rx Rev 3 MIMO" 0x0045 - -"WBX LO TX" 0x0050 -"WBX LO RX" 0x0051 - -"WBX NG TX" 0x0052 -"WBX NG RX" 0x0053 - -"XCVR2450 Tx" 0x0060 -"XCVR2450 Rx" 0x0061 - -"Bitshark Rx" 0x0070 - -"Experimental Tx" 0xfffe -"Experimental Rx" 0xffff diff --git a/usrp/host/lib/usrp_local_sighandler.cc b/usrp/host/lib/usrp_local_sighandler.cc deleted file mode 100644 index 59013972e..000000000 --- a/usrp/host/lib/usrp_local_sighandler.cc +++ /dev/null @@ -1,191 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004,2009 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -/* - * This is actually the same as gr_local_signhandler, but with a different name. - * We don't have a common library to put this in, so... - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <usrp/usrp_local_sighandler.h> -#include <stdexcept> -#include <stdio.h> -#include <string.h> - -usrp_local_sighandler::usrp_local_sighandler (int signum, - void (*new_handler)(int)) - : d_signum (signum) -{ -#ifdef HAVE_SIGACTION - struct sigaction new_action; - memset (&new_action, 0, sizeof (new_action)); - - new_action.sa_handler = new_handler; - sigemptyset (&new_action.sa_mask); - new_action.sa_flags = 0; - - if (sigaction (d_signum, &new_action, &d_old_action) < 0){ - perror ("sigaction (install new)"); - throw std::runtime_error ("sigaction"); - } -#endif -} - -usrp_local_sighandler::~usrp_local_sighandler () -{ -#ifdef HAVE_SIGACTION - if (sigaction (d_signum, &d_old_action, 0) < 0){ - perror ("sigaction (restore old)"); - throw std::runtime_error ("sigaction"); - } -#endif -} - -void -usrp_local_sighandler::throw_signal(int signum) throw(usrp_signal) -{ - throw usrp_signal (signum); -} - -/* - * Semi-hideous way to may a signal number into a signal name - */ - -#define SIGNAME(x) case x: return #x - -std::string -usrp_signal::name () const -{ - char tmp[128]; - - switch (signal ()){ -#ifdef SIGHUP - SIGNAME (SIGHUP); -#endif -#ifdef SIGINT - SIGNAME (SIGINT); -#endif -#ifdef SIGQUIT - SIGNAME (SIGQUIT); -#endif -#ifdef SIGILL - SIGNAME (SIGILL); -#endif -#ifdef SIGTRAP - SIGNAME (SIGTRAP); -#endif -#ifdef SIGABRT - SIGNAME (SIGABRT); -#endif -#ifdef SIGBUS - SIGNAME (SIGBUS); -#endif -#ifdef SIGFPE - SIGNAME (SIGFPE); -#endif -#ifdef SIGKILL - SIGNAME (SIGKILL); -#endif -#ifdef SIGUSR1 - SIGNAME (SIGUSR1); -#endif -#ifdef SIGSEGV - SIGNAME (SIGSEGV); -#endif -#ifdef SIGUSR2 - SIGNAME (SIGUSR2); -#endif -#ifdef SIGPIPE - SIGNAME (SIGPIPE); -#endif -#ifdef SIGALRM - SIGNAME (SIGALRM); -#endif -#ifdef SIGTERM - SIGNAME (SIGTERM); -#endif -#ifdef SIGSTKFLT - SIGNAME (SIGSTKFLT); -#endif -#ifdef SIGCHLD - SIGNAME (SIGCHLD); -#endif -#ifdef SIGCONT - SIGNAME (SIGCONT); -#endif -#ifdef SIGSTOP - SIGNAME (SIGSTOP); -#endif -#ifdef SIGTSTP - SIGNAME (SIGTSTP); -#endif -#ifdef SIGTTIN - SIGNAME (SIGTTIN); -#endif -#ifdef SIGTTOU - SIGNAME (SIGTTOU); -#endif -#ifdef SIGURG - SIGNAME (SIGURG); -#endif -#ifdef SIGXCPU - SIGNAME (SIGXCPU); -#endif -#ifdef SIGXFSZ - SIGNAME (SIGXFSZ); -#endif -#ifdef SIGVTALRM - SIGNAME (SIGVTALRM); -#endif -#ifdef SIGPROF - SIGNAME (SIGPROF); -#endif -#ifdef SIGWINCH - SIGNAME (SIGWINCH); -#endif -#ifdef SIGIO - SIGNAME (SIGIO); -#endif -#ifdef SIGPWR - SIGNAME (SIGPWR); -#endif -#ifdef SIGSYS - SIGNAME (SIGSYS); -#endif - default: -#if defined (HAVE_SNPRINTF) -#if defined (SIGRTMIN) && defined (SIGRTMAX) - if (signal () >= SIGRTMIN && signal () <= SIGRTMAX){ - snprintf (tmp, sizeof (tmp), "SIGRTMIN + %d", signal ()); - return tmp; - } -#endif - snprintf (tmp, sizeof (tmp), "SIGNAL %d", signal ()); - return tmp; -#else - return "Unknown signal"; -#endif - } -} diff --git a/usrp/host/lib/usrp_prims_common.cc b/usrp/host/lib/usrp_prims_common.cc deleted file mode 100644 index 20a55653c..000000000 --- a/usrp/host/lib/usrp_prims_common.cc +++ /dev/null @@ -1,1241 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003,2004,2006,2009 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "usrp_primsi.h" -#include "usrp_commands.h" -#include "usrp_ids.h" -#include "usrp_i2c_addr.h" -#include "fpga_regs_common.h" -#include "fpga_regs_standard.h" -#include <errno.h> -#include <stdio.h> -#include <unistd.h> -#include <stdlib.h> -#include <string.h> -#include <ctype.h> -#include <time.h> // FIXME should check with autoconf (nanosleep) -#include <algorithm> -#include <ad9862.h> -#include <assert.h> -#include "std_paths.h" - -extern "C" { -#include "md5.h" -}; - -#define VERBOSE 0 - -using namespace ad9862; - -static const int FIRMWARE_HASH_SLOT = 0; -static const int FPGA_HASH_SLOT = 1; - -static const int hash_slot_addr[2] = { - USRP_HASH_SLOT_0_ADDR, - USRP_HASH_SLOT_1_ADDR -}; - -static const char *default_firmware_filename = "std.ihx"; -static const char *default_fpga_filename = "std_2rxhb_2tx.rbf"; - -static char * -find_file (const char *filename, int hw_rev) -{ - const char **sp = std_paths; - static char path[1000]; - char *s; - - s = getenv("USRP_PATH"); - if (s) { - snprintf (path, sizeof (path), "%s/rev%d/%s", s, hw_rev, filename); - if (access (path, R_OK) == 0) - return path; - } - - while (*sp){ - snprintf (path, sizeof (path), "%s/rev%d/%s", *sp, hw_rev, filename); - if (access (path, R_OK) == 0) - return path; - sp++; - } - return 0; -} - -static const char * -get_proto_filename(const std::string user_filename, const char *env_var, const char *def) -{ - if (user_filename.length() != 0) - return user_filename.c_str(); - - char *s = getenv(env_var); - if (s && *s) - return s; - - return def; -} - - -static void power_down_9862s (libusb_device_handle *udh); - - -// ---------------------------------------------------------------- - -/* - * q must be a real USRP, not an FX2. Return its hardware rev number. - */ - -int -usrp_hw_rev (libusb_device *q) -{ - libusb_device_descriptor desc = _get_usb_device_descriptor(q); - return desc.bcdDevice & 0x00FF; -} - -/* - * q must be a real USRP, not an FX2. Return true if it's configured. - */ -static bool -_usrp_configured_p (libusb_device *q) -{ - libusb_device_descriptor desc = _get_usb_device_descriptor(q); - return (desc.bcdDevice & 0xFF00) != 0; -} - -bool -usrp_usrp_p (libusb_device *q) -{ - libusb_device_descriptor desc = _get_usb_device_descriptor(q); - return (desc.idVendor == USB_VID_FSF - && desc.idProduct == USB_PID_FSF_USRP); -} - -bool -usrp_fx2_p (libusb_device *q) -{ - libusb_device_descriptor desc = _get_usb_device_descriptor(q); - return (desc.idVendor == USB_VID_CYPRESS - && desc.idProduct == USB_PID_CYPRESS_FX2); -} - -bool -usrp_usrp0_p (libusb_device *q) -{ - return usrp_usrp_p (q) && usrp_hw_rev (q) == 0; -} - -bool -usrp_usrp1_p (libusb_device *q) -{ - return usrp_usrp_p (q) && usrp_hw_rev (q) == 1; -} - -bool -usrp_usrp2_p (libusb_device *q) -{ - return usrp_usrp_p (q) && usrp_hw_rev (q) == 2; -} - - -bool -usrp_unconfigured_usrp_p (libusb_device *q) -{ - return usrp_usrp_p (q) && !_usrp_configured_p (q); -} - -bool -usrp_configured_usrp_p (libusb_device *q) -{ - return usrp_usrp_p (q) && _usrp_configured_p (q); -} - - -// ---------------------------------------------------------------- - - -libusb_device_handle * -usrp_open_cmd_interface (libusb_device *dev) -{ - return usrp_open_interface (dev, USRP_CMD_INTERFACE, USRP_CMD_ALTINTERFACE); -} - -libusb_device_handle * -usrp_open_rx_interface (libusb_device *dev) -{ - return usrp_open_interface (dev, USRP_RX_INTERFACE, USRP_RX_ALTINTERFACE); -} - -libusb_device_handle * -usrp_open_tx_interface (libusb_device *dev) -{ - return usrp_open_interface (dev, USRP_TX_INTERFACE, USRP_TX_ALTINTERFACE); -} - - -// ---------------------------------------------------------------- -// write internal ram using Cypress vendor extension - -static bool -write_internal_ram (libusb_device_handle *udh, unsigned char *buf, - int start_addr, size_t len) -{ - int addr; - int n; - int a; - int quanta = MAX_EP0_PKTSIZE; - - for (addr = start_addr; addr < start_addr + (int) len; addr += quanta){ - n = len + start_addr - addr; - if (n > quanta) - n = quanta; - - a = _usb_control_transfer (udh, 0x40, 0xA0, addr, 0, - (unsigned char*)(buf + (addr - start_addr)), n, 1000); - - if (a < 0){ - fprintf(stderr,"write_internal_ram failed\n"); - return false; - } - } - return true; -} - - -// ---------------------------------------------------------------- -// whack the CPUCS register using the upload RAM vendor extension - -static bool -reset_cpu (libusb_device_handle *udh, bool reset_p) -{ - unsigned char v; - - if (reset_p) - v = 1; // hold processor in reset - else - v = 0; // release reset - - return write_internal_ram (udh, &v, 0xE600, 1); -} - -// ---------------------------------------------------------------- -// Load intel format file into cypress FX2 (8051) - -static bool -_usrp_load_firmware (libusb_device_handle *udh, const char *filename, - unsigned char hash[USRP_HASH_SIZE]) -{ - FILE *f = fopen (filename, "ra"); - if (f == 0){ - perror (filename); - return false; - } - - if (!reset_cpu (udh, true)) // hold CPU in reset while loading firmware - goto fail; - - - char s[1024]; - int length; - int addr; - int type; - unsigned char data[256]; - unsigned char checksum, a; - unsigned int b; - int i; - - while (!feof(f)){ - fgets(s, sizeof (s), f); /* we should not use more than 263 bytes normally */ - if(s[0]!=':'){ - fprintf(stderr,"%s: invalid line: \"%s\"\n", filename, s); - goto fail; - } - sscanf(s+1, "%02x", &length); - sscanf(s+3, "%04x", &addr); - sscanf(s+7, "%02x", &type); - - if(type==0){ - - a=length+(addr &0xff)+(addr>>8)+type; - for(i=0;i<length;i++){ - sscanf (s+9+i*2,"%02x", &b); - data[i]=b; - a=a+data[i]; - } - - sscanf (s+9+length*2,"%02x", &b); - checksum=b; - if (((a+checksum)&0xff)!=0x00){ - fprintf (stderr, " ** Checksum failed: got 0x%02x versus 0x%02x\n", (-a)&0xff, checksum); - goto fail; - } - if (!write_internal_ram (udh, data, addr, length)) - goto fail; - } - else if (type == 0x01){ // EOF - break; - } - else if (type == 0x02){ - fprintf (stderr, "Extended address: whatever I do with it?\n"); - fprintf (stderr, "%s: invalid line: \"%s\"\n", filename, s); - goto fail; - } - } - - // we jam the hash value into the FX2 memory before letting - // the cpu out of reset. When it comes out of reset it - // may renumerate which will invalidate udh. - - if (!usrp_set_hash (udh, FIRMWARE_HASH_SLOT, hash)) - fprintf (stderr, "usrp: failed to write firmware hash slot\n"); - - if (!reset_cpu (udh, false)) // take CPU out of reset - goto fail; - - fclose (f); - return true; - - fail: - fclose (f); - return false; -} - -// ---------------------------------------------------------------- -// load fpga - -static bool -_usrp_load_fpga (libusb_device_handle *udh, const char *filename, - unsigned char hash[USRP_HASH_SIZE]) -{ - bool ok = true; - - FILE *fp = fopen (filename, "rb"); - if (fp == 0){ - perror (filename); - return false; - } - - unsigned char buf[MAX_EP0_PKTSIZE]; // 64 is max size of EP0 packet on FX2 - int n; - - usrp_set_led (udh, 1, 1); // led 1 on - - - // reset FPGA (and on rev1 both AD9862's, thus killing clock) - usrp_set_fpga_reset (udh, 1); // hold fpga in reset - - if (write_cmd (udh, VRQ_FPGA_LOAD, 0, FL_BEGIN, 0, 0) != 0) - goto fail; - - while ((n = fread (buf, 1, sizeof (buf), fp)) > 0){ - if (write_cmd (udh, VRQ_FPGA_LOAD, 0, FL_XFER, buf, n) != n) - goto fail; - } - - if (write_cmd (udh, VRQ_FPGA_LOAD, 0, FL_END, 0, 0) != 0) - goto fail; - - fclose (fp); - - if (!usrp_set_hash (udh, FPGA_HASH_SLOT, hash)) - fprintf (stderr, "usrp: failed to write fpga hash slot\n"); - - // On the rev1 USRP, the {tx,rx}_{enable,reset} bits are - // controlled over the serial bus, and hence aren't observed until - // we've got a good fpga bitstream loaded. - - usrp_set_fpga_reset (udh, 0); // fpga out of master reset - - // now these commands will work - - ok &= usrp_set_fpga_tx_enable (udh, 0); - ok &= usrp_set_fpga_rx_enable (udh, 0); - - ok &= usrp_set_fpga_tx_reset (udh, 1); // reset tx and rx paths - ok &= usrp_set_fpga_rx_reset (udh, 1); - ok &= usrp_set_fpga_tx_reset (udh, 0); // reset tx and rx paths - ok &= usrp_set_fpga_rx_reset (udh, 0); - - if (!ok) - fprintf (stderr, "usrp: failed to reset tx and/or rx path\n"); - - // Manually reset all regs except master control to zero. - // FIXME may want to remove this when we rework FPGA reset strategy. - // In the mean while, this gets us reproducible behavior. - for (int i = 0; i < FR_USER_0; i++){ - if (i == FR_MASTER_CTRL) - continue; - usrp_write_fpga_reg(udh, i, 0); - } - - power_down_9862s (udh); // on the rev1, power these down! - usrp_set_led (udh, 1, 0); // led 1 off - - return true; - - fail: - power_down_9862s (udh); // on the rev1, power these down! - fclose (fp); - return false; -} - -// ---------------------------------------------------------------- - -bool -usrp_set_led (libusb_device_handle *udh, int which, bool on) -{ - int r = write_cmd (udh, VRQ_SET_LED, on, which, 0, 0); - - return r == 0; -} - -bool -usrp_set_hash (libusb_device_handle *udh, int which, - const unsigned char hash[USRP_HASH_SIZE]) -{ - which &= 1; - - // we use the Cypress firmware down load command to jam it in. - int r = _usb_control_transfer (udh, 0x40, 0xa0, hash_slot_addr[which], 0, - (unsigned char *) hash, USRP_HASH_SIZE, 1000); - - if (r < 0) - fprintf (stderr, "usrp: failed to set hash\n"); - - return r == USRP_HASH_SIZE; -} - -bool -usrp_get_hash (libusb_device_handle *udh, int which, - unsigned char hash[USRP_HASH_SIZE]) -{ - which &= 1; - - // we use the Cypress firmware upload command to fetch it. - int r = _usb_control_transfer (udh, 0xc0, 0xa0, hash_slot_addr[which], 0, - (unsigned char *) hash, USRP_HASH_SIZE, 1000); - - if (r < 0) - fprintf (stderr, "usrp: failed to get hash\n"); - - return r == USRP_HASH_SIZE; -} - - - -static bool -usrp_set_switch (libusb_device_handle *udh, int cmd_byte, bool on) -{ - return write_cmd (udh, cmd_byte, on, 0, 0, 0) == 0; -} - -static bool -usrp1_fpga_write (libusb_device_handle *udh, - int regno, int value) -{ - // on the rev1 usrp, we use the generic spi_write interface - - unsigned char buf[4]; - - buf[0] = (value >> 24) & 0xff; // MSB first - buf[1] = (value >> 16) & 0xff; - buf[2] = (value >> 8) & 0xff; - buf[3] = (value >> 0) & 0xff; - - return usrp_spi_write (udh, 0x00 | (regno & 0x7f), - SPI_ENABLE_FPGA, - SPI_FMT_MSB | SPI_FMT_HDR_1, - buf, sizeof (buf)); -} - -static bool -usrp1_fpga_read (libusb_device_handle *udh, - int regno, int *value) -{ - *value = 0; - unsigned char buf[4]; - - bool ok = usrp_spi_read (udh, 0x80 | (regno & 0x7f), - SPI_ENABLE_FPGA, - SPI_FMT_MSB | SPI_FMT_HDR_1, - buf, sizeof (buf)); - - if (ok) - *value = (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3]; - - return ok; -} - -bool -usrp_write_fpga_reg (libusb_device_handle *udh, int reg, int value) -{ - switch (usrp_hw_rev (_get_usb_device (udh))){ - case 0: // not supported ;) - abort(); - - default: - return usrp1_fpga_write (udh, reg, value); - } -} - -bool -usrp_read_fpga_reg (libusb_device_handle *udh, int reg, int *value) -{ - switch (usrp_hw_rev (_get_usb_device (udh))){ - case 0: // not supported ;) - abort(); - - default: - return usrp1_fpga_read (udh, reg, value); - } -} - -bool -usrp_set_fpga_reset (libusb_device_handle *udh, bool on) -{ - return usrp_set_switch (udh, VRQ_FPGA_SET_RESET, on); -} - -bool -usrp_set_fpga_tx_enable (libusb_device_handle *udh, bool on) -{ - return usrp_set_switch (udh, VRQ_FPGA_SET_TX_ENABLE, on); -} - -bool -usrp_set_fpga_rx_enable (libusb_device_handle *udh, bool on) -{ - return usrp_set_switch (udh, VRQ_FPGA_SET_RX_ENABLE, on); -} - -bool -usrp_set_fpga_tx_reset (libusb_device_handle *udh, bool on) -{ - return usrp_set_switch (udh, VRQ_FPGA_SET_TX_RESET, on); -} - -bool -usrp_set_fpga_rx_reset (libusb_device_handle *udh, bool on) -{ - return usrp_set_switch (udh, VRQ_FPGA_SET_RX_RESET, on); -} - - -// ---------------------------------------------------------------- -// conditional load stuff - -static bool -compute_hash (const char *filename, unsigned char hash[USRP_HASH_SIZE]) -{ - assert (USRP_HASH_SIZE == 16); - memset (hash, 0, USRP_HASH_SIZE); - - FILE *fp = fopen (filename, "rb"); - if (fp == 0){ - perror (filename); - return false; - } - int r = md5_stream (fp, hash); - fclose (fp); - - return r == 0; -} - -static usrp_load_status_t -usrp_conditionally_load_something (libusb_device_handle *udh, - const char *filename, - bool force, - int slot, - bool loader (libusb_device_handle *, - const char *, - unsigned char [USRP_HASH_SIZE])) -{ - unsigned char file_hash[USRP_HASH_SIZE]; - unsigned char usrp_hash[USRP_HASH_SIZE]; - - if (access (filename, R_OK) != 0){ - perror (filename); - return ULS_ERROR; - } - - if (!compute_hash (filename, file_hash)) - return ULS_ERROR; - - if (!force - && usrp_get_hash (udh, slot, usrp_hash) - && memcmp (file_hash, usrp_hash, USRP_HASH_SIZE) == 0) - return ULS_ALREADY_LOADED; - - bool r = loader (udh, filename, file_hash); - - if (!r) - return ULS_ERROR; - - return ULS_OK; -} - -usrp_load_status_t -usrp_load_firmware (libusb_device_handle *udh, - const char *filename, - bool force) -{ - return usrp_conditionally_load_something (udh, filename, force, - FIRMWARE_HASH_SLOT, - _usrp_load_firmware); -} - -usrp_load_status_t -usrp_load_fpga (libusb_device_handle *udh, - const char *filename, - bool force) -{ - return usrp_conditionally_load_something (udh, filename, force, - FPGA_HASH_SLOT, - _usrp_load_fpga); -} - -static libusb_device_handle * -open_nth_cmd_interface (int nth, libusb_context *ctx) -{ - - libusb_device *udev = usrp_find_device (nth, false, ctx); - if (udev == 0){ - fprintf (stderr, "usrp: failed to find usrp[%d]\n", nth); - return 0; - } - - libusb_device_handle *udh; - - udh = usrp_open_cmd_interface (udev); - if (udh == 0){ - // FIXME this could be because somebody else has it open. - // We should delay and retry... - fprintf (stderr, "open_nth_cmd_interface: open_cmd_interface failed\n"); - return 0; - } - - return udh; -} - -static bool -our_nanosleep (const struct timespec *delay) -{ - struct timespec new_delay = *delay; - struct timespec remainder; - - while (1){ - int r = nanosleep (&new_delay, &remainder); - if (r == 0) - return true; - if (errno == EINTR) - new_delay = remainder; - else { - perror ("nanosleep"); - return false; - } - } -} - -static bool -mdelay (int millisecs) -{ - struct timespec ts; - ts.tv_sec = millisecs / 1000; - ts.tv_nsec = (millisecs - (1000 * ts.tv_sec)) * 1000000; - return our_nanosleep (&ts); -} - - -usrp_load_status_t -usrp_load_firmware_nth (int nth, const char *filename, bool force, libusb_context *ctx) -{ - libusb_device_handle *udh = open_nth_cmd_interface (nth, ctx); - if (udh == 0) - return ULS_ERROR; - - usrp_load_status_t s = usrp_load_firmware (udh, filename, force); - usrp_close_interface (udh); - - switch (s){ - - case ULS_ALREADY_LOADED: // nothing changed... - return ULS_ALREADY_LOADED; - break; - - case ULS_OK: - // we loaded firmware successfully. - - // It's highly likely that the board will renumerate (simulate a - // disconnect/reconnect sequence), invalidating our current - // handle. - - // FIXME. Turn this into a loop that rescans until we refind ourselves - - struct timespec t; // delay for 2 second - t.tv_sec = 2; - t.tv_nsec = 0; - our_nanosleep (&t); - - usrp_rescan (); - - return ULS_OK; - - default: - case ULS_ERROR: // some kind of problem - return ULS_ERROR; - } -} - -static void -load_status_msg (usrp_load_status_t s, const char *type, const char *filename) -{ - char *e = getenv("USRP_VERBOSE"); - bool verbose = e != 0; - - switch (s){ - case ULS_ERROR: - fprintf (stderr, "usrp: failed to load %s %s.\n", type, filename); - break; - - case ULS_ALREADY_LOADED: - if (verbose) - fprintf (stderr, "usrp: %s %s already loaded.\n", type, filename); - break; - - case ULS_OK: - if (verbose) - fprintf (stderr, "usrp: %s %s loaded successfully.\n", type, filename); - break; - } -} - -bool -usrp_load_standard_bits (int nth, bool force, - const std::string fpga_filename, - const std::string firmware_filename, - libusb_context *ctx) -{ - usrp_load_status_t s; - const char *filename; - const char *proto_filename; - int hw_rev; - - // first, figure out what hardware rev we're dealing with - { - libusb_device *udev = usrp_find_device (nth, false, ctx); - if (udev == 0){ - fprintf (stderr, "usrp: failed to find usrp[%d]\n", nth); - return false; - } - hw_rev = usrp_hw_rev (udev); - } - - // start by loading the firmware - - proto_filename = get_proto_filename(firmware_filename, "USRP_FIRMWARE", - default_firmware_filename); - filename = find_file(proto_filename, hw_rev); - if (filename == 0){ - fprintf (stderr, "Can't find firmware: %s\n", proto_filename); - return false; - } - s = usrp_load_firmware_nth (nth, filename, force, ctx); - load_status_msg (s, "firmware", filename); - - if (s == ULS_ERROR) - return false; - - // if we actually loaded firmware, we must reload fpga ... - if (s == ULS_OK) - force = true; - - // now move on to the fpga configuration bitstream - - proto_filename = get_proto_filename(fpga_filename, "USRP_FPGA", - default_fpga_filename); - filename = find_file (proto_filename, hw_rev); - if (filename == 0){ - fprintf (stderr, "Can't find fpga bitstream: %s\n", proto_filename); - return false; - } - libusb_device_handle *udh = open_nth_cmd_interface (nth, ctx); - if (udh == 0) - return false; - - s = usrp_load_fpga (udh, filename, force); - usrp_close_interface (udh); - load_status_msg (s, "fpga bitstream", filename); - - if (s == ULS_ERROR) - return false; - - return true; -} - - -bool -_usrp_get_status (libusb_device_handle *udh, int which, bool *trouble) -{ - unsigned char status; - *trouble = true; - - if (write_cmd (udh, VRQ_GET_STATUS, 0, which, - &status, sizeof (status)) != sizeof (status)) - return false; - - *trouble = status; - return true; -} - -bool -usrp_check_rx_overrun (libusb_device_handle *udh, bool *overrun_p) -{ - return _usrp_get_status (udh, GS_RX_OVERRUN, overrun_p); -} - -bool -usrp_check_tx_underrun (libusb_device_handle *udh, bool *underrun_p) -{ - return _usrp_get_status (udh, GS_TX_UNDERRUN, underrun_p); -} - - -bool -usrp_i2c_write (libusb_device_handle *udh, int i2c_addr, - const void *buf, int len) -{ - if (len < 1 || len > MAX_EP0_PKTSIZE) - return false; - - return write_cmd (udh, VRQ_I2C_WRITE, i2c_addr, 0, - (unsigned char *) buf, len) == len; -} - - -bool -usrp_i2c_read (libusb_device_handle *udh, int i2c_addr, - void *buf, int len) -{ - if (len < 1 || len > MAX_EP0_PKTSIZE) - return false; - - return write_cmd (udh, VRQ_I2C_READ, i2c_addr, 0, - (unsigned char *) buf, len) == len; -} - -bool -usrp_spi_write (libusb_device_handle *udh, - int optional_header, int enables, int format, - const void *buf, int len) -{ - if (len < 0 || len > MAX_EP0_PKTSIZE) - return false; - - return write_cmd (udh, VRQ_SPI_WRITE, - optional_header, - ((enables & 0xff) << 8) | (format & 0xff), - (unsigned char *) buf, len) == len; -} - - -bool -usrp_spi_read (libusb_device_handle *udh, - int optional_header, int enables, int format, - void *buf, int len) -{ - if (len < 0 || len > MAX_EP0_PKTSIZE) - return false; - - return write_cmd (udh, VRQ_SPI_READ, - optional_header, - ((enables & 0xff) << 8) | (format & 0xff), - (unsigned char *) buf, len) == len; -} - -bool -usrp_9862_write (libusb_device_handle *udh, int which_codec, - int regno, int value) -{ - if (0) - fprintf (stderr, "usrp_9862_write which = %d, reg = %2d, val = %3d (0x%02x)\n", - which_codec, regno, value, value); - - unsigned char buf[1]; - - buf[0] = value; - - return usrp_spi_write (udh, 0x00 | (regno & 0x3f), - which_codec == 0 ? SPI_ENABLE_CODEC_A : SPI_ENABLE_CODEC_B, - SPI_FMT_MSB | SPI_FMT_HDR_1, - buf, 1); -} - -bool -usrp_9862_read (libusb_device_handle *udh, int which_codec, - int regno, unsigned char *value) -{ - return usrp_spi_read (udh, 0x80 | (regno & 0x3f), - which_codec == 0 ? SPI_ENABLE_CODEC_A : SPI_ENABLE_CODEC_B, - SPI_FMT_MSB | SPI_FMT_HDR_1, - value, 1); -} - -bool -usrp_9862_write_many (libusb_device_handle *udh, - int which_codec, - const unsigned char *buf, - int len) -{ - if (len & 0x1) - return false; // must be even - - bool result = true; - - while (len > 0){ - result &= usrp_9862_write (udh, which_codec, buf[0], buf[1]); - len -= 2; - buf += 2; - } - - return result; -} - - -bool -usrp_9862_write_many_all (libusb_device_handle *udh, - const unsigned char *buf, int len) -{ - // FIXME handle 2/2 and 4/4 versions - - bool result; - result = usrp_9862_write_many (udh, 0, buf, len); - result &= usrp_9862_write_many (udh, 1, buf, len); - return result; -} - -static void -power_down_9862s (libusb_device_handle *udh) -{ - static const unsigned char regs[] = { - REG_RX_PWR_DN, 0x01, // everything - REG_TX_PWR_DN, 0x0f, // pwr dn digital and analog_both - REG_TX_MODULATOR, 0x00 // coarse & fine modulators disabled - }; - - switch (usrp_hw_rev (_get_usb_device (udh))){ - case 0: - break; - - default: - usrp_9862_write_many_all (udh, regs, sizeof (regs)); - break; - } -} - - -static const int EEPROM_PAGESIZE = 16; - -bool -usrp_eeprom_write (libusb_device_handle *udh, int i2c_addr, - int eeprom_offset, const void *buf, int len) -{ - unsigned char cmd[2]; - const unsigned char *p = (unsigned char *) buf; - - // The simplest thing that could possibly work: - // all writes are single byte writes. - // - // We could speed this up using the page write feature, - // but we write so infrequently, why bother... - - while (len-- > 0){ - cmd[0] = eeprom_offset++; - cmd[1] = *p++; - bool r = usrp_i2c_write (udh, i2c_addr, cmd, sizeof (cmd)); - mdelay (10); // delay 10ms worst case write time - if (!r) - return false; - } - - return true; -} - -bool -usrp_eeprom_read (libusb_device_handle *udh, int i2c_addr, - int eeprom_offset, void *buf, int len) -{ - unsigned char *p = (unsigned char *) buf; - - // We setup a random read by first doing a "zero byte write". - // Writes carry an address. Reads use an implicit address. - - unsigned char cmd[1]; - cmd[0] = eeprom_offset; - if (!usrp_i2c_write (udh, i2c_addr, cmd, sizeof (cmd))) - return false; - - while (len > 0){ - int n = std::min (len, MAX_EP0_PKTSIZE); - if (!usrp_i2c_read (udh, i2c_addr, p, n)) - return false; - len -= n; - p += n; - } - return true; -} - -// ---------------------------------------------------------------- - -static bool -slot_to_codec (int slot, int *which_codec) -{ - *which_codec = 0; - - switch (slot){ - case SLOT_TX_A: - case SLOT_RX_A: - *which_codec = 0; - break; - - case SLOT_TX_B: - case SLOT_RX_B: - *which_codec = 1; - break; - - default: - fprintf (stderr, "usrp_prims:slot_to_codec: invalid slot = %d\n", slot); - return false; - } - return true; -} - -static bool -tx_slot_p (int slot) -{ - switch (slot){ - case SLOT_TX_A: - case SLOT_TX_B: - return true; - - default: - return false; - } -} - -bool -usrp_write_aux_dac (libusb_device_handle *udh, int slot, - int which_dac, int value) -{ - int which_codec; - - if (!slot_to_codec (slot, &which_codec)) - return false; - - if (!(0 <= which_dac && which_dac < 4)){ - fprintf (stderr, "usrp_write_aux_dac: invalid dac = %d\n", which_dac); - return false; - } - - value &= 0x0fff; // mask to 12-bits - - if (which_dac == 3){ - // dac 3 is really 12-bits. Use value as is. - bool r = true; - r &= usrp_9862_write (udh, which_codec, 43, (value >> 4)); // most sig - r &= usrp_9862_write (udh, which_codec, 42, (value & 0xf) << 4); // least sig - return r; - } - else { - // dac 0, 1, and 2 are really 8 bits. - value = value >> 4; // shift value appropriately - return usrp_9862_write (udh, which_codec, 36 + which_dac, value); - } -} - - -bool -usrp_read_aux_adc (libusb_device_handle *udh, int slot, - int which_adc, int *value) -{ - *value = 0; - int which_codec; - - if (!slot_to_codec (slot, &which_codec)) - return false; - - if (!(0 <= which_codec && which_codec < 2)){ - fprintf (stderr, "usrp_read_aux_adc: invalid adc = %d\n", which_adc); - return false; - } - - unsigned char aux_adc_control = - AUX_ADC_CTRL_REFSEL_A // on chip reference - | AUX_ADC_CTRL_REFSEL_B; // on chip reference - - int rd_reg = 26; // base address of two regs to read for result - - // program the ADC mux bits - if (tx_slot_p (slot)) - aux_adc_control |= AUX_ADC_CTRL_SELECT_A2 | AUX_ADC_CTRL_SELECT_B2; - else { - rd_reg += 2; - aux_adc_control |= AUX_ADC_CTRL_SELECT_A1 | AUX_ADC_CTRL_SELECT_B1; - } - - // I'm not sure if we can set the mux and issue a start conversion - // in the same cycle, so let's do them one at a time. - - usrp_9862_write (udh, which_codec, 34, aux_adc_control); - - if (which_adc == 0) - aux_adc_control |= AUX_ADC_CTRL_START_A; - else { - rd_reg += 4; - aux_adc_control |= AUX_ADC_CTRL_START_B; - } - - // start the conversion - usrp_9862_write (udh, which_codec, 34, aux_adc_control); - - // read the 10-bit result back - unsigned char v_lo = 0; - unsigned char v_hi = 0; - bool r = usrp_9862_read (udh, which_codec, rd_reg, &v_lo); - r &= usrp_9862_read (udh, which_codec, rd_reg + 1, &v_hi); - - if (r) - *value = ((v_hi << 2) | ((v_lo >> 6) & 0x3)) << 2; // format as 12-bit - - return r; -} - -// ---------------------------------------------------------------- - -static int slot_to_i2c_addr (int slot) -{ - switch (slot){ - case SLOT_TX_A: return I2C_ADDR_TX_A; - case SLOT_RX_A: return I2C_ADDR_RX_A; - case SLOT_TX_B: return I2C_ADDR_TX_B; - case SLOT_RX_B: return I2C_ADDR_RX_B; - default: return -1; - } -} - -static void -set_chksum (unsigned char *buf) -{ - int sum = 0; - unsigned int i; - for (i = 0; i < DB_EEPROM_CLEN - 1; i++) - sum += buf[i]; - buf[i] = -sum; -} - -static usrp_dbeeprom_status_t -read_dboard_eeprom (libusb_device_handle *udh, - int slot_id, unsigned char *buf) -{ - int i2c_addr = slot_to_i2c_addr (slot_id); - if (i2c_addr == -1) - return UDBE_BAD_SLOT; - - if (!usrp_eeprom_read (udh, i2c_addr, 0, buf, DB_EEPROM_CLEN)) - return UDBE_NO_EEPROM; - - if (buf[DB_EEPROM_MAGIC] != DB_EEPROM_MAGIC_VALUE) - return UDBE_INVALID_EEPROM; - - int sum = 0; - for (unsigned int i = 0; i < DB_EEPROM_CLEN; i++) - sum += buf[i]; - - if ((sum & 0xff) != 0) - return UDBE_INVALID_EEPROM; - - return UDBE_OK; -} - -usrp_dbeeprom_status_t -usrp_read_dboard_eeprom (libusb_device_handle *udh, - int slot_id, usrp_dboard_eeprom *eeprom) -{ - unsigned char buf[DB_EEPROM_CLEN]; - - memset (eeprom, 0, sizeof (*eeprom)); - - usrp_dbeeprom_status_t s = read_dboard_eeprom (udh, slot_id, buf); - if (s != UDBE_OK) - return s; - - eeprom->id = (buf[DB_EEPROM_ID_MSB] << 8) | buf[DB_EEPROM_ID_LSB]; - eeprom->oe = (buf[DB_EEPROM_OE_MSB] << 8) | buf[DB_EEPROM_OE_LSB]; - eeprom->offset[0] = (buf[DB_EEPROM_OFFSET_0_MSB] << 8) | buf[DB_EEPROM_OFFSET_0_LSB]; - eeprom->offset[1] = (buf[DB_EEPROM_OFFSET_1_MSB] << 8) | buf[DB_EEPROM_OFFSET_1_LSB]; - - return UDBE_OK; -} - -bool -usrp_write_dboard_offsets (libusb_device_handle *udh, int slot_id, - short offset0, short offset1) -{ - unsigned char buf[DB_EEPROM_CLEN]; - - usrp_dbeeprom_status_t s = read_dboard_eeprom (udh, slot_id, buf); - if (s != UDBE_OK) - return false; - - buf[DB_EEPROM_OFFSET_0_LSB] = (offset0 >> 0) & 0xff; - buf[DB_EEPROM_OFFSET_0_MSB] = (offset0 >> 8) & 0xff; - buf[DB_EEPROM_OFFSET_1_LSB] = (offset1 >> 0) & 0xff; - buf[DB_EEPROM_OFFSET_1_MSB] = (offset1 >> 8) & 0xff; - set_chksum (buf); - - return usrp_eeprom_write (udh, slot_to_i2c_addr (slot_id), - 0, buf, sizeof (buf)); -} - -// ---------------------------------------------------------------- - -std::string -usrp_serial_number(libusb_device_handle *udh) -{ - libusb_device_descriptor desc = - _get_usb_device_descriptor (_get_usb_device (udh)); - - unsigned char iserial = desc.iSerialNumber; - if (iserial == 0) - return ""; - - unsigned char buf[1024]; - if (_get_usb_string_descriptor (udh, iserial, buf, sizeof(buf)) < 0) - return ""; - - return (char*) buf; -} - - - - diff --git a/usrp/host/lib/usrp_prims_libusb0.cc b/usrp/host/lib/usrp_prims_libusb0.cc deleted file mode 100644 index 4fbfabea9..000000000 --- a/usrp/host/lib/usrp_prims_libusb0.cc +++ /dev/null @@ -1,230 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003,2004,2006,2009 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "usrp_primsi.h" -#include "usrp_commands.h" -#include <usb.h> -#include <errno.h> -#include <stdio.h> -#include <unistd.h> -#include <stdlib.h> -#include <string.h> -#include <ctype.h> -#include <ad9862.h> -#include <assert.h> - -extern "C" { -#include "md5.h" -}; - -using namespace ad9862; - -/* - * libusb 0.12 / 1.0 compatibility - */ - -struct usb_device * -_get_usb_device (struct usb_dev_handle *udh) -{ - return usb_device (udh); -} - -struct usb_device_descriptor -_get_usb_device_descriptor (struct usb_device *q) -{ - return q->descriptor; -} - -int -_get_usb_string_descriptor (struct usb_dev_handle *udh, int index, - unsigned char* data, int length) -{ - int ret; - ret = usb_get_string_simple (udh, index, (char*) data, length); - - if (ret < 0) { - fprintf (stderr, "usrp: usb_get_string_descriptor failed: %s\n", - usb_strerror()); - } - - return ret; -} - -int -_usb_control_transfer (struct usb_dev_handle *udh, int request_type, - int request, int value, int index, - unsigned char *data, int length, unsigned int timeout) -{ - int ret; - - ret = usb_control_msg (udh, request_type,request, value, index, - (char*) data, length, (int) timeout); - if (ret < 0) - fprintf (stderr, "usrp: usb_control_msg failed: %s\n", usb_strerror()); - - return ret; -} - - -// ---------------------------------------------------------------- - - -void -usrp_one_time_init (libusb_context **ctx) -{ - static bool first = true; - - if (first) { - first = false; - usb_init (); // usb library init - usb_find_busses (); - usb_find_devices (); - } -} - -void -usrp_deinit (libusb_context *ctx) -{ - // nop -} - -void -usrp_rescan () -{ - usb_find_busses (); - usb_find_devices (); -} - - -// ---------------------------------------------------------------- - - -struct usb_device * -usrp_find_device (int nth, bool fx2_ok_p, libusb_context *ctx) -{ - struct usb_bus *p; - struct usb_device *q; - int n_found = 0; - - usrp_one_time_init (); - - p = usb_get_busses(); - while (p != NULL){ - q = p->devices; - while (q != NULL){ - if (usrp_usrp_p (q) || (fx2_ok_p && usrp_fx2_p (q))){ - if (n_found == nth) // return this one - return q; - n_found++; // keep looking - } - q = q->next; - } - p = p->next; - } - return 0; // not found -} - -struct usb_dev_handle * -usrp_open_interface (struct usb_device *dev, int interface, int altinterface) -{ - struct usb_dev_handle *udh = usb_open (dev); - if (udh == 0) - return 0; - - if (dev != usb_device (udh)){ - fprintf (stderr, "%s:%d: internal error!\n", __FILE__, __LINE__); - abort (); - } - -#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) - // There's no get get_configuration function, and with some of the newer kernels - // setting the configuration, even if to the same value, hoses any other processes - // that have it open. Hence we opt to not set it at all (We've only - // got a single configuration anyway). This may hose the win32 stuff... - - // Appears to be required for libusb-win32 and Cygwin -- dew 09/20/06 - if (usb_set_configuration (udh, 1) < 0){ - /* - * Ignore this error. - * - * Seems that something changed in drivers/usb/core/devio.c:proc_setconfig such that - * it returns -EBUSY if _any_ of the interfaces of a device are open. - * We've only got a single configuration, so setting it doesn't even seem - * like it should be required. - */ - } -#endif - - if (usb_claim_interface (udh, interface) < 0){ - fprintf (stderr, "%s:usb_claim_interface: failed interface %d\n", __FUNCTION__,interface); - fprintf (stderr, "%s\n", usb_strerror()); - usb_close (udh); - return 0; - } - - if (usb_set_altinterface (udh, altinterface) < 0){ - fprintf (stderr, "%s:usb_set_alt_interface: failed\n", __FUNCTION__); - fprintf (stderr, "%s\n", usb_strerror()); - usb_release_interface (udh, interface); - usb_close (udh); - return 0; - } - - return udh; -} - -bool -usrp_close_interface (struct usb_dev_handle *udh) -{ - // we're assuming that closing an interface automatically releases it. - return usb_close (udh) == 0; -} - - -// ---------------------------------------------------------------- -// write vendor extension command to USRP - - -int -write_cmd (struct usb_dev_handle *udh, - int request, int value, int index, - unsigned char *bytes, int len) -{ - int requesttype = (request & 0x80) ? VRT_VENDOR_IN : VRT_VENDOR_OUT; - - int r = usb_control_msg (udh, requesttype, request, value, index, - (char *) bytes, len, 1000); - if (r < 0){ - // we get EPIPE if the firmware stalls the endpoint. - if (errno != EPIPE) { - fprintf (stderr, "usb_control_msg failed: %s\n", usb_strerror ()); - fprintf (stderr, "write_cmd failed\n"); - } - } - - return r; -} - diff --git a/usrp/host/lib/usrp_prims_libusb1.cc b/usrp/host/lib/usrp_prims_libusb1.cc deleted file mode 100644 index 5dfe416e1..000000000 --- a/usrp/host/lib/usrp_prims_libusb1.cc +++ /dev/null @@ -1,276 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003,2004,2006,2009 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "usrp_primsi.h" -#include "usrp_commands.h" -#include <libusb-1.0/libusb.h> -#include <errno.h> -#include <stdio.h> -#include <unistd.h> -#include <stdlib.h> -#include <string.h> -#include <ctype.h> -#include <ad9862.h> -#include <assert.h> - -extern "C" { -#include "md5.h" -}; - -using namespace ad9862; - -static const int LIBUSB1_DEBUG = 0; - -/* - * libusb 0.12 / 1.0 compatibility - */ - -static const char * -_get_usb_error_str (int usb_err) -{ - switch (usb_err) { - case LIBUSB_SUCCESS: - return "Success (no error)"; - case LIBUSB_ERROR_IO: - return "Input/output error"; - case LIBUSB_ERROR_INVALID_PARAM: - return "Invalid parameter"; - case LIBUSB_ERROR_ACCESS: - return "Access denied (insufficient permissions)"; - case LIBUSB_ERROR_NO_DEVICE: - return "No such device (it may have been disconnected)"; - case LIBUSB_ERROR_NOT_FOUND: - return "Entity not found"; - case LIBUSB_ERROR_BUSY: - return "Resource busy"; - case LIBUSB_ERROR_TIMEOUT: - return "Operation timed out"; - case LIBUSB_ERROR_OVERFLOW: - return "Overflow"; - case LIBUSB_ERROR_PIPE: - return "Pipe error"; - case LIBUSB_ERROR_INTERRUPTED: - return "System call interrupted (perhaps due to signal)"; - case LIBUSB_ERROR_NO_MEM: - return "Insufficient memory"; - case LIBUSB_ERROR_NOT_SUPPORTED: - return "Operation not supported or unimplemented on this platform"; - case LIBUSB_ERROR_OTHER: - return "Unknown error"; - } - - return "Unknown error"; -} - -struct libusb_device * -_get_usb_device (struct libusb_device_handle *udh) -{ - return libusb_get_device (udh); -} - -struct libusb_device_descriptor -_get_usb_device_descriptor(struct libusb_device *q) -{ - int ret; - struct libusb_device_descriptor desc; - - ret = libusb_get_device_descriptor(q, &desc); - - if (ret < 0) { - fprintf (stderr, "usrp: libusb_get_device_descriptor failed: %s\n", - _get_usb_error_str(ret)); - } - return desc; -} - -int -_get_usb_string_descriptor (struct libusb_device_handle *udh, int index, - unsigned char* data, int length) -{ - int ret; - ret = libusb_get_string_descriptor_ascii (udh, (uint8_t) index, data, length); - - if (ret < 0) { - fprintf (stderr, "usrp: libusb_get_string_descriptor_ascii failed: %s\n", - _get_usb_error_str(ret)); - } - return ret; -} - -int -_usb_control_transfer (struct libusb_device_handle *udh, int request_type, - int request, int value, int index, - unsigned char *data, int length, unsigned int timeout) -{ - int ret; - ret = libusb_control_transfer (udh, request_type, request, value, index, - data, length, timeout); - if (ret < 0) { - fprintf (stderr, "usrp: libusb_control_transfer failed: %s\n", - _get_usb_error_str(ret)); - } - return ret; -} - - -// ---------------------------------------------------------------- - - -void -usrp_one_time_init (libusb_context **ctx) -{ - int ret; - - if ((ret = libusb_init (ctx)) < 0) - fprintf (stderr, "usrp: libusb_init failed: %s\n", _get_usb_error_str(ret)); - - // Enable debug verbosity if requested. This will only work if the debug - // option is compiled into libusb and may produce a generous amount of output - // on stdout. If debug output is not compiled into libusb, this call does - // nothing. - if (LIBUSB1_DEBUG) - libusb_set_debug(*ctx, 3); -} - -void -usrp_deinit (struct libusb_context *ctx) -{ - // Each object _should_ be running in its own context. If running in default - // context then leave the instance open as it may be shared. - if (ctx != NULL) - libusb_exit (ctx); -} - -void -usrp_rescan () -{ - // nop -} - -struct libusb_device * -usrp_find_device (int nth, bool fx2_ok_p, libusb_context *ctx) -{ - libusb_device **list; - - struct libusb_device *q; - int n_found = 0; - - // Make sure not operating on default context. There are cases where operating - // with a single global (NULL) context may be preferable, so this check can be - // skipped if you know what you're doing. - assert (ctx != NULL); - - size_t cnt = libusb_get_device_list(ctx, &list); - size_t i = 0; - - if (cnt < 0) - fprintf(stderr, "usrp: libusb_get_device_list failed: %s\n", - _get_usb_error_str(cnt)); - - for (i = 0; i < cnt; i++) { - q = list[i]; - if (usrp_usrp_p (q) || (fx2_ok_p && usrp_fx2_p (q))) { - if (n_found == nth) // return this one - return q; - n_found++; // keep looking - } - } - - // The list needs to be freed. Right now just release it if nothing is found. - libusb_free_device_list(list, 1); - - return 0; // not found -} - -struct libusb_device_handle * -usrp_open_interface (libusb_device *dev, int interface, int altinterface) -{ - libusb_device_handle *udh; - int ret; - - if (libusb_open (dev, &udh) < 0) - return 0; - - if (dev != libusb_get_device (udh)){ - fprintf (stderr, "%s:%d: internal error!\n", __FILE__, __LINE__); - abort (); - } - - if ((ret = libusb_claim_interface (udh, interface)) < 0) { - fprintf (stderr, "%s:usb_claim_interface: failed interface %d\n", - __FUNCTION__, interface); - fprintf (stderr, "%s\n", _get_usb_error_str(ret)); - libusb_close (udh); - return 0; - } - - if ((ret = libusb_set_interface_alt_setting (udh, interface, - altinterface)) < 0) { - fprintf (stderr, "%s:usb_set_alt_interface: failed\n", __FUNCTION__); - fprintf (stderr, "%s\n", _get_usb_error_str(ret)); - libusb_release_interface (udh, interface); - libusb_close (udh); - return 0; - } - - return udh; -} - -bool -usrp_close_interface (libusb_device_handle *udh) -{ - // returns void - libusb_close(udh); - return 0; -} - - -// ---------------------------------------------------------------- -// write vendor extension command to USRP - - -int -write_cmd (struct libusb_device_handle *udh, - int request, int value, int index, - unsigned char *bytes, int len) -{ - int requesttype = (request & 0x80) ? VRT_VENDOR_IN : VRT_VENDOR_OUT; - - int ret = libusb_control_transfer(udh, requesttype, request, value, index, - bytes, len, 1000); - - if (ret < 0) { - // we get EPIPE if the firmware stalls the endpoint. - if (ret != LIBUSB_ERROR_PIPE) { - fprintf (stderr, "usrp: libusb_control_transfer failed: %s\n", - _get_usb_error_str(ret)); - fprintf (stderr, "usrp: write_cmd failed\n"); - } - } - - return ret; -} - diff --git a/usrp/host/lib/usrp_primsi.h b/usrp/host/lib/usrp_primsi.h deleted file mode 100644 index b1cf7263a..000000000 --- a/usrp/host/lib/usrp_primsi.h +++ /dev/null @@ -1,59 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003,2009 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -/* - * Internal usrp_prims header file - */ - -#ifndef _USRP_PRIMSI_H_ -#define _USRP_PRIMSI_H_ - -#include "usrp/usrp_prims.h" - -/* - * Internal functions - */ - -libusb_device_handle * -usrp_open_interface(libusb_device *dev, int interface, int altinterface); - -int write_cmd (libusb_device_handle *udh, int request, int value, int index, - unsigned char *bytes, int len); - -/* - * Compatibility functions - */ - -libusb_device *_get_usb_device (libusb_device_handle *udh); - -libusb_device_descriptor _get_usb_device_descriptor (libusb_device *q); - -int _get_usb_string_descriptor (libusb_device_handle *udh, int index, - unsigned char* data, int length); - -int _usb_control_transfer (libusb_device_handle *udh, int request_type, - int request, int value, int index, - unsigned char *data, int length, - unsigned int timeout); - -#endif /* _USRP_PRIMSI_H_ */ - diff --git a/usrp/host/lib/usrp_standard.cc b/usrp/host/lib/usrp_standard.cc deleted file mode 100644 index fe5afabdb..000000000 --- a/usrp/host/lib/usrp_standard.cc +++ /dev/null @@ -1,1175 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004,2008,2009 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <usrp/usrp_standard.h> - -#include "usrp/usrp_prims.h" -#include "fpga_regs_common.h" -#include "fpga_regs_standard.h" -#include <stdexcept> -#include <assert.h> -#include <math.h> -#include <ad9862.h> -#include <cstdio> - - -static const int OLD_CAPS_VAL = 0xaa55ff77; -static const int DEFAULT_CAPS_VAL = ((2 << bmFR_RB_CAPS_NDUC_SHIFT) - | (2 << bmFR_RB_CAPS_NDDC_SHIFT) - | bmFR_RB_CAPS_RX_HAS_HALFBAND); - -// #define USE_FPGA_TX_CORDIC - - -using namespace ad9862; - -#define NELEM(x) (sizeof (x) / sizeof (x[0])) - - -void -usrp_standard_common::calc_dxc_freq(double target_freq, double baseband_freq, double fs, - double *dxc_freq, bool *inverted) -{ - /* - Calculate the frequency to use for setting the digital up or down converter. - - @param target_freq: desired RF frequency (Hz) - @param baseband_freq: the RF frequency that corresponds to DC in the IF. - @param fs: converter sample rate - - @returns: 2-tuple (ddc_freq, inverted) where ddc_freq is the value - for the ddc and inverted is True if we're operating in an inverted - Nyquist zone. - */ - -#if 0 - printf("calc_dxc_freq:\n"); - printf(" target = %f\n", target_freq); - printf(" baseband = %f\n", baseband_freq); - printf(" fs = %f\n", fs); -#endif - - double delta = target_freq - baseband_freq; - - if(delta >= 0) { - while(delta > fs) { - delta -= fs; - } - if(delta <= fs/2) { // non-inverted region - *dxc_freq = -delta; - *inverted = false; - } - else { // inverted region - *dxc_freq = delta - fs; - *inverted = true; - } - } - else { - while(delta < -fs) { - delta += fs; - } - if(delta >= -fs/2) { - *dxc_freq = -delta; // non-inverted region - *inverted = false; - } - else { // inverted region - *dxc_freq = delta + fs; - *inverted = true; - } - } - -#if 0 - printf(" dxc_freq = %f\n", *dxc_freq); - printf(" inverted = %s\n", *inverted ? "true" : "false"); -#endif -} - - -/* - * Real lambda expressions would be _so_ much easier... - */ -class dxc_control { -public: - virtual bool is_tx() = 0; - virtual bool set_dxc_freq(double dxc_freq) = 0; - virtual double dxc_freq() = 0; -}; - -class ddc_control : public dxc_control { - usrp_standard_rx *d_u; - int d_chan; - -public: - ddc_control(usrp_standard_rx *u, int chan) - : d_u(u), d_chan(chan) {} - - bool is_tx(){ return false; } - bool set_dxc_freq(double dxc_freq){ return d_u->set_rx_freq(d_chan, dxc_freq); } - double dxc_freq(){ return d_u->rx_freq(d_chan); } -}; - -class duc_control : public dxc_control { - usrp_standard_tx *d_u; - int d_chan; - -public: - duc_control(usrp_standard_tx *u, int chan) - : d_u(u), d_chan(chan) {} - - bool is_tx(){ return true; } - bool set_dxc_freq(double dxc_freq){ return d_u->set_tx_freq(d_chan, dxc_freq); } - double dxc_freq() { return d_u->tx_freq(d_chan); } -}; - - -/*! - * \brief Tune such that target_frequency ends up at DC in the complex baseband - * - * \param db the daughterboard to use - * \param target_freq the center frequency we want at baseband (DC) - * \param fs the sample rate - * \param dxc DDC or DUC access and control object - * \param[out] result details of what we did - * - * \returns true iff operation was successful - * - * Tuning is a two step process. First we ask the front-end to - * tune as close to the desired frequency as it can. Then we use - * the result of that operation and our target_frequency to - * determine the value for the digital down converter. - */ -static bool -tune_a_helper(db_base_sptr db, double target_freq, double fs, - dxc_control &dxc, usrp_tune_result *result) -{ - bool inverted = false; - double dxc_freq; - double actual_dxc_freq; - - // Ask the d'board to tune as closely as it can to target_freq -#if 0 - bool ok = db->set_freq(target_freq, &result->baseband_freq); -#else - bool ok; - { - freq_result_t fr = db->set_freq(target_freq); - ok = fr.ok; - result->baseband_freq = fr.baseband_freq; - } -#endif - - // Calculate the DDC setting that will downconvert the baseband from the - // daughterboard to our target frequency. - usrp_standard_common::calc_dxc_freq(target_freq, result->baseband_freq, fs, - &dxc_freq, &inverted); - - // If the spectrum is inverted, and the daughterboard doesn't do - // quadrature downconversion, we can fix the inversion by flipping the - // sign of the dxc_freq... (This only happens using the basic_rx board) - - if(db->spectrum_inverted()) - inverted = !inverted; - - if(inverted && !db->is_quadrature()){ - dxc_freq = -dxc_freq; - inverted = !inverted; - } - - if (dxc.is_tx() && !db->i_and_q_swapped()) // down conversion versus up conversion - dxc_freq = -dxc_freq; - - ok &= dxc.set_dxc_freq(dxc_freq); - actual_dxc_freq = dxc.dxc_freq(); - - result->dxc_freq = dxc_freq; - result->residual_freq = dxc_freq - actual_dxc_freq; - result->inverted = inverted; - return ok; -} - - -static unsigned int -compute_freq_control_word_fpga (double master_freq, double target_freq, - double *actual_freq, bool verbose) -{ - static const int NBITS = 14; - - int v = (int) rint (target_freq / master_freq * pow (2.0, 32.0)); - - if (0) - v = (v >> (32 - NBITS)) << (32 - NBITS); // keep only top NBITS - - *actual_freq = v * master_freq / pow (2.0, 32.0); - - if (verbose) - fprintf (stderr, - "compute_freq_control_word_fpga: target = %g actual = %g delta = %g\n", - target_freq, *actual_freq, *actual_freq - target_freq); - - return (unsigned int) v; -} - -// The 9862 uses an unsigned 24-bit frequency tuning word and -// a separate register to control the sign. - -static unsigned int -compute_freq_control_word_9862 (double master_freq, double target_freq, - double *actual_freq, bool verbose) -{ - double sign = 1.0; - - if (target_freq < 0) - sign = -1.0; - - int v = (int) rint (fabs (target_freq) / master_freq * pow (2.0, 24.0)); - *actual_freq = v * master_freq / pow (2.0, 24.0) * sign; - - if (verbose) - fprintf (stderr, - "compute_freq_control_word_9862: target = %g actual = %g delta = %g v = %8d\n", - target_freq, *actual_freq, *actual_freq - target_freq, v); - - return (unsigned int) v; -} - -// ---------------------------------------------------------------- - -usrp_standard_common::usrp_standard_common(usrp_basic *parent) -{ - // read new FPGA capability register - if (!parent->_read_fpga_reg(FR_RB_CAPS, &d_fpga_caps)){ - fprintf (stderr, "usrp_standard_common: failed to read FPGA cap register.\n"); - throw std::runtime_error ("usrp_standard_common::ctor"); - } - // If we don't have the cap register, set the value to what it would - // have had if we did have one ;) - if (d_fpga_caps == OLD_CAPS_VAL) - d_fpga_caps = DEFAULT_CAPS_VAL; - - if (0){ - fprintf(stdout, "has_rx_halfband = %d\n", has_rx_halfband()); - fprintf(stdout, "nddcs = %d\n", nddcs()); - fprintf(stdout, "has_tx_halfband = %d\n", has_tx_halfband()); - fprintf(stdout, "nducs = %d\n", nducs()); - } -} - -bool -usrp_standard_common::has_rx_halfband() const -{ - return (d_fpga_caps & bmFR_RB_CAPS_RX_HAS_HALFBAND) ? true : false; -} - -int -usrp_standard_common::nddcs() const -{ - return (d_fpga_caps & bmFR_RB_CAPS_NDDC_MASK) >> bmFR_RB_CAPS_NDDC_SHIFT; -} - -bool -usrp_standard_common::has_tx_halfband() const -{ - return (d_fpga_caps & bmFR_RB_CAPS_TX_HAS_HALFBAND) ? true : false; -} - -int -usrp_standard_common::nducs() const -{ - return (d_fpga_caps & bmFR_RB_CAPS_NDUC_MASK) >> bmFR_RB_CAPS_NDUC_SHIFT; -} - -// ---------------------------------------------------------------- - -static int -real_rx_mux_value (int mux, int nchan) -{ - if (mux != -1) - return mux; - - return 0x32103210; -} - -usrp_standard_rx::usrp_standard_rx (int which_board, - unsigned int decim_rate, - int nchan, int mux, int mode, - int fusb_block_size, int fusb_nblocks, - const std::string fpga_filename, - const std::string firmware_filename - ) - : usrp_basic_rx (which_board, fusb_block_size, fusb_nblocks, - fpga_filename, firmware_filename), - usrp_standard_common(this), - d_nchan (1), d_sw_mux (0x0), d_hw_mux (0x0) -{ - if (!set_format(make_format())){ - fprintf (stderr, "usrp_standard_rx: set_format failed\n"); - throw std::runtime_error ("usrp_standard_rx::ctor"); - } - if (!set_nchannels (nchan)){ - fprintf (stderr, "usrp_standard_rx: set_nchannels failed\n"); - throw std::runtime_error ("usrp_standard_rx::ctor"); - } - if (!set_decim_rate (decim_rate)){ - fprintf (stderr, "usrp_standard_rx: set_decim_rate failed\n"); - throw std::runtime_error ("usrp_standard_rx::ctor"); - } - if (!set_mux (real_rx_mux_value (mux, nchan))){ - fprintf (stderr, "usrp_standard_rx: set_mux failed\n"); - throw std::runtime_error ("usrp_standard_rx::ctor"); - } - if (!set_fpga_mode (mode)){ - fprintf (stderr, "usrp_standard_rx: set_fpga_mode failed\n"); - throw std::runtime_error ("usrp_standard_rx::ctor"); - } - - for (int i = 0; i < MAX_CHAN; i++){ - set_rx_freq(i, 0); - set_ddc_phase(i, 0); - } -} - -usrp_standard_rx::~usrp_standard_rx () -{ - // fprintf(stderr, "\nusrp_standard_rx: dtor\n"); -} - -bool -usrp_standard_rx::start () -{ - if (!usrp_basic_rx::start ()) - return false; - - // add our code here - - return true; -} - -bool -usrp_standard_rx::stop () -{ - bool ok = usrp_basic_rx::stop (); - - // add our code here - - return ok; -} - -usrp_standard_rx_sptr -usrp_standard_rx::make (int which_board, - unsigned int decim_rate, - int nchan, int mux, int mode, - int fusb_block_size, int fusb_nblocks, - const std::string fpga_filename, - const std::string firmware_filename - ) -{ - try { - usrp_standard_rx_sptr u = - usrp_standard_rx_sptr(new usrp_standard_rx(which_board, decim_rate, - nchan, mux, mode, - fusb_block_size, fusb_nblocks, - fpga_filename, firmware_filename)); - u->init_db(u); - return u; - } - catch (...){ - return usrp_standard_rx_sptr(); - } -} - -bool -usrp_standard_rx::set_decim_rate(unsigned int rate) -{ - if (has_rx_halfband()){ - if ((rate & 0x1) || rate < 4 || rate > 256){ - fprintf (stderr, "usrp_standard_rx::set_decim_rate: rate must be EVEN and in [4, 256]\n"); - return false; - } - } - else { - if (rate < 4 || rate > 128){ - fprintf (stderr, "usrp_standard_rx::set_decim_rate: rate must be in [4, 128]\n"); - return false; - } - } - - d_decim_rate = rate; - set_usb_data_rate ((adc_rate () / rate * nchannels ()) - * (2 * sizeof (short))); - - bool s = disable_rx (); - int v = has_rx_halfband() ? d_decim_rate/2 - 1 : d_decim_rate - 1; - bool ok = _write_fpga_reg (FR_DECIM_RATE, v); - restore_rx (s); - return ok; -} - -bool usrp_standard_rx::set_nchannels (int nchan) -{ - if (!(nchan == 1 || nchan == 2 || nchan == 4)) - return false; - - if (nchan > nddcs()) - return false; - - d_nchan = nchan; - - return write_hw_mux_reg (); -} - - -// map software mux value to hw mux value -// -// Software mux value: -// -// 3 2 1 -// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 -// +-------+-------+-------+-------+-------+-------+-------+-------+ -// | Q3 | I3 | Q2 | I2 | Q1 | I1 | Q0 | I0 | -// +-------+-------+-------+-------+-------+-------+-------+-------+ -// -// Each 4-bit I field is either 0,1,2,3 -// Each 4-bit Q field is either 0,1,2,3 or 0xf (input is const zero) -// All Q's must be 0xf or none of them may be 0xf -// -// -// Hardware mux value: -// -// 3 2 1 -// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 -// +-----------------------+-------+-------+-------+-------+-+-----+ -// | must be zero | Q3| I3| Q2| I2| Q1| I1| Q0| I0|Z| NCH | -// +-----------------------+-------+-------+-------+-------+-+-----+ - - -static bool -map_sw_mux_to_hw_mux (int sw_mux, int *hw_mux_ptr) -{ - // confirm that all I's are either 0,1,2,3 - - for (int i = 0; i < 8; i += 2){ - int t = (sw_mux >> (4 * i)) & 0xf; - if (!(0 <= t && t <= 3)) - return false; - } - - // confirm that all Q's are either 0,1,2,3 or 0xf - - for (int i = 1; i < 8; i += 2){ - int t = (sw_mux >> (4 * i)) & 0xf; - if (!(t == 0xf || (0 <= t && t <= 3))) - return false; - } - - // confirm that all Q inputs are 0xf (const zero input), - // or none of them are 0xf - - int q_and = 1; - int q_or = 0; - - for (int i = 0; i < 4; i++){ - int qx_is_0xf = ((sw_mux >> (8 * i + 4)) & 0xf) == 0xf; - q_and &= qx_is_0xf; - q_or |= qx_is_0xf; - } - - if (q_and || !q_or){ // OK - int hw_mux_value = 0; - - for (int i = 0; i < 8; i++){ - int t = (sw_mux >> (4 * i)) & 0x3; - hw_mux_value |= t << (2 * i + 4); - } - - if (q_and) - hw_mux_value |= 0x8; // all Q's zero - - *hw_mux_ptr = hw_mux_value; - return true; - } - else - return false; -} - -bool -usrp_standard_rx::set_mux (int mux) -{ - if (!map_sw_mux_to_hw_mux (mux, &d_hw_mux)) - return false; - - // fprintf (stderr, "sw_mux = 0x%08x hw_mux = 0x%08x\n", mux, d_hw_mux); - - d_sw_mux = mux; - return write_hw_mux_reg (); -} - -bool -usrp_standard_rx::write_hw_mux_reg () -{ - bool s = disable_rx (); - bool ok = _write_fpga_reg (FR_RX_MUX, d_hw_mux | d_nchan); - restore_rx (s); - return ok; -} - -int -usrp_standard_rx::determine_rx_mux_value(const usrp_subdev_spec &ss) -{ - /* - Determine appropriate Rx mux value as a function of the subdevice choosen and the - characteristics of the respective daughterboard. - - @param u: instance of USRP source - @param subdev_spec: return value from subdev option parser. - @type subdev_spec: (side, subdev), where side is 0 or 1 and subdev is 0 or 1 - @returns: the Rx mux value - - Figure out which A/D's to connect to the DDC. - - Each daughterboard consists of 1 or 2 subdevices. (At this time, - all but the Basic Rx have a single subdevice. The Basic Rx - has two independent channels, treated as separate subdevices). - subdevice 0 of a daughterboard may use 1 or 2 A/D's. We determine this - by checking the is_quadrature() method. If subdevice 0 uses only a single - A/D, it's possible that the daughterboard has a second subdevice, subdevice 1, - and it uses the second A/D. - - If the card uses only a single A/D, we wire a zero into the DDC Q input. - - (side, 0) says connect only the A/D's used by subdevice 0 to the DDC. - (side, 1) says connect only the A/D's used by subdevice 1 to the DDC. - */ - - struct truth_table_element - { - int d_side; - int d_uses; - bool d_swap_iq; - unsigned int d_mux_val; - - truth_table_element(int side, unsigned int uses, bool swap_iq, unsigned int mux_val=0) - : d_side(side), d_uses(uses), d_swap_iq(swap_iq), d_mux_val(mux_val){} - - bool operator==(const truth_table_element &in) - { - return (d_side == in.d_side && d_uses == in.d_uses && d_swap_iq == in.d_swap_iq); - } - - unsigned int mux_val() { return d_mux_val; } - }; - - - if (!is_valid(ss)) - throw std::invalid_argument("subdev_spec"); - - - // This is a tuple of length 1 or 2 containing the subdevice - // classes for the selected side. - std::vector<db_base_sptr> db = this->db(ss.side); - - unsigned int uses; - - // compute bitmasks of used A/D's - - if(db[ss.subdev]->is_quadrature()) - uses = 0x3; // uses A/D 0 and 1 - else if (ss.subdev == 0) - uses = 0x1; // uses A/D 0 only - else if(ss.subdev == 1) - uses = 0x2; // uses A/D 1 only - else - uses = 0x0; // uses no A/D (doesn't exist) - - if(uses == 0){ - throw std::runtime_error("Determine RX Mux Error"); - } - - bool swap_iq = db[ss.subdev]->i_and_q_swapped(); - - truth_table_element truth_table[8] = { - // (side, uses, swap_iq) : mux_val - truth_table_element(0, 0x1, false, 0xf0f0f0f0), - truth_table_element(0, 0x2, false, 0xf0f0f0f1), - truth_table_element(0, 0x3, false, 0x00000010), - truth_table_element(0, 0x3, true, 0x00000001), - truth_table_element(1, 0x1, false, 0xf0f0f0f2), - truth_table_element(1, 0x2, false, 0xf0f0f0f3), - truth_table_element(1, 0x3, false, 0x00000032), - truth_table_element(1, 0x3, true, 0x00000023) - }; - size_t nelements = sizeof(truth_table)/sizeof(truth_table[0]); - - truth_table_element target(ss.side, uses, swap_iq, 0); - - size_t i; - for(i = 0; i < nelements; i++){ - if (truth_table[i] == target) - return truth_table[i].mux_val(); - } - throw std::runtime_error("internal error"); -} - -int -usrp_standard_rx::determine_rx_mux_value(const usrp_subdev_spec &ss_a, const usrp_subdev_spec &ss_b) -{ - std::vector<db_base_sptr> db_a = this->db(ss_a.side); - std::vector<db_base_sptr> db_b = this->db(ss_b.side); - if (db_a[ss_a.subdev]->is_quadrature() != db_b[ss_b.subdev]->is_quadrature()){ - throw std::runtime_error("Cannot compute dual mux when mixing quadrature and non-quadrature subdevices"); - } - int mux_a = determine_rx_mux_value(ss_a); - int mux_b = determine_rx_mux_value(ss_b); - //move the lower byte of the mux b into the second byte of the mux a - return ((mux_b & 0xff) << 8) | (mux_a & 0xffff00ff); -} - -bool -usrp_standard_rx::set_rx_freq (int channel, double freq) -{ - if (channel < 0 || channel > MAX_CHAN) - return false; - - unsigned int v = - compute_freq_control_word_fpga (adc_rate(), - freq, &d_rx_freq[channel], - d_verbose); - - return _write_fpga_reg (FR_RX_FREQ_0 + channel, v); -} - -unsigned int -usrp_standard_rx::decim_rate () const { return d_decim_rate; } - -int -usrp_standard_rx::nchannels () const { return d_nchan; } - -int -usrp_standard_rx::mux () const { return d_sw_mux; } - -double -usrp_standard_rx::rx_freq (int channel) const -{ - if (channel < 0 || channel >= MAX_CHAN) - return 0; - - return d_rx_freq[channel]; -} - -bool -usrp_standard_rx::set_fpga_mode (int mode) -{ - return _write_fpga_reg (FR_MODE, mode); -} - -bool -usrp_standard_rx::set_ddc_phase(int channel, int phase) -{ - if (channel < 0 || channel >= MAX_CHAN) - return false; - - return _write_fpga_reg(FR_RX_PHASE_0 + channel, phase); -} - - -// To avoid quiet failures, check for things that our code cares about. - -static bool -rx_format_is_valid(unsigned int format) -{ - int width = usrp_standard_rx::format_width(format); - int want_q = usrp_standard_rx::format_want_q(format); - - if (!(width == 8 || width == 16)) // FIXME add other widths when valid - return false; - - if (!want_q) // FIXME remove check when the rest of the code can handle I only - return false; - - return true; -} - -bool -usrp_standard_rx::set_format(unsigned int format) -{ - if (!rx_format_is_valid(format)) - return false; - - return _write_fpga_reg(FR_RX_FORMAT, format); -} - -unsigned int -usrp_standard_rx::format() const -{ - return d_fpga_shadows[FR_RX_FORMAT]; -} - -// ---------------------------------------------------------------- - -unsigned int -usrp_standard_rx::make_format(int width, int shift, bool want_q, bool bypass_halfband) -{ - unsigned int format = - (((width << bmFR_RX_FORMAT_WIDTH_SHIFT) & bmFR_RX_FORMAT_WIDTH_MASK) - | ((shift << bmFR_RX_FORMAT_SHIFT_SHIFT) & bmFR_RX_FORMAT_SHIFT_MASK)); - - if (want_q) - format |= bmFR_RX_FORMAT_WANT_Q; - if (bypass_halfband) - format |= bmFR_RX_FORMAT_BYPASS_HB; - - return format; -} - -int -usrp_standard_rx::format_width(unsigned int format) -{ - return (format & bmFR_RX_FORMAT_WIDTH_MASK) >> bmFR_RX_FORMAT_WIDTH_SHIFT; -} - -int -usrp_standard_rx::format_shift(unsigned int format) -{ - return (format & bmFR_RX_FORMAT_SHIFT_MASK) >> bmFR_RX_FORMAT_SHIFT_SHIFT; -} - -bool -usrp_standard_rx::format_want_q(unsigned int format) -{ - return (format & bmFR_RX_FORMAT_WANT_Q) != 0; -} - -bool -usrp_standard_rx::format_bypass_halfband(unsigned int format) -{ - return (format & bmFR_RX_FORMAT_BYPASS_HB) != 0; -} - -bool -usrp_standard_rx::tune(int chan, db_base_sptr db, double target_freq, usrp_tune_result *result) -{ - ddc_control dxc(this, chan); - return tune_a_helper(db, target_freq, converter_rate(), dxc, result); -} - - -////////////////////////////////////////////////////////////////// - - -// tx data is timed to CLKOUT1 (64 MHz) -// interpolate 4x -// fine modulator enabled - - -static unsigned char tx_regs_use_nco[] = { - REG_TX_IF, (TX_IF_USE_CLKOUT1 - | TX_IF_I_FIRST - | TX_IF_2S_COMP - | TX_IF_INTERLEAVED), - REG_TX_DIGITAL, (TX_DIGITAL_2_DATA_PATHS - | TX_DIGITAL_INTERPOLATE_4X) -}; - - -static int -real_tx_mux_value (int mux, int nchan) -{ - if (mux != -1) - return mux; - - switch (nchan){ - case 1: - return 0x0098; - case 2: - return 0xba98; - default: - assert (0); - } -} - -usrp_standard_tx::usrp_standard_tx (int which_board, - unsigned int interp_rate, - int nchan, int mux, - int fusb_block_size, int fusb_nblocks, - const std::string fpga_filename, - const std::string firmware_filename - ) - : usrp_basic_tx (which_board, fusb_block_size, fusb_nblocks, fpga_filename, firmware_filename), - usrp_standard_common(this), - d_sw_mux (0x8), d_hw_mux (0x81) -{ - if (!usrp_9862_write_many_all (d_udh, tx_regs_use_nco, sizeof (tx_regs_use_nco))){ - fprintf (stderr, "usrp_standard_tx: failed to init AD9862 TX regs\n"); - throw std::runtime_error ("usrp_standard_tx::ctor"); - } - if (!set_nchannels (nchan)){ - fprintf (stderr, "usrp_standard_tx: set_nchannels failed\n"); - throw std::runtime_error ("usrp_standard_tx::ctor"); - } - if (!set_interp_rate (interp_rate)){ - fprintf (stderr, "usrp_standard_tx: set_interp_rate failed\n"); - throw std::runtime_error ("usrp_standard_tx::ctor"); - } - if (!set_mux (real_tx_mux_value (mux, nchan))){ - fprintf (stderr, "usrp_standard_tx: set_mux failed\n"); - throw std::runtime_error ("usrp_standard_tx::ctor"); - } - - for (int i = 0; i < MAX_CHAN; i++){ - d_tx_modulator_shadow[i] = (TX_MODULATOR_DISABLE_NCO - | TX_MODULATOR_COARSE_MODULATION_NONE); - d_coarse_mod[i] = CM_OFF; - set_tx_freq (i, 0); - } -} - -usrp_standard_tx::~usrp_standard_tx () -{ - // fprintf(stderr, "\nusrp_standard_tx: dtor\n"); -} - -bool -usrp_standard_tx::start () -{ - if (!usrp_basic_tx::start ()) - return false; - - // add our code here - - return true; -} - -bool -usrp_standard_tx::stop () -{ - bool ok = usrp_basic_tx::stop (); - - // add our code here - - return ok; -} - -usrp_standard_tx_sptr -usrp_standard_tx::make (int which_board, - unsigned int interp_rate, - int nchan, int mux, - int fusb_block_size, int fusb_nblocks, - const std::string fpga_filename, - const std::string firmware_filename - ) -{ - try { - usrp_standard_tx_sptr u = - usrp_standard_tx_sptr(new usrp_standard_tx(which_board, interp_rate, nchan, mux, - fusb_block_size, fusb_nblocks, - fpga_filename, firmware_filename)); - u->init_db(u); - return u; - } - catch (...){ - return usrp_standard_tx_sptr(); - } -} - -bool -usrp_standard_tx::set_interp_rate (unsigned int rate) -{ - // fprintf (stderr, "usrp_standard_tx::set_interp_rate\n"); - - if ((rate & 0x3) || rate < 4 || rate > 512){ - fprintf (stderr, "usrp_standard_tx::set_interp_rate: rate must be in [4, 512] and a multiple of 4.\n"); - return false; - } - - d_interp_rate = rate; - set_usb_data_rate ((dac_rate () / rate * nchannels ()) - * (2 * sizeof (short))); - - // We're using the interp by 4 feature of the 9862 so that we can - // use its fine modulator. Thus, we reduce the FPGA's interpolation rate - // by a factor of 4. - - bool s = disable_tx (); - bool ok = _write_fpga_reg (FR_INTERP_RATE, d_interp_rate/4 - 1); - restore_tx (s); - return ok; -} - -bool -usrp_standard_tx::set_nchannels (int nchan) -{ - if (!(nchan == 1 || nchan == 2)) - return false; - - if (nchan > nducs()) - return false; - - d_nchan = nchan; - return write_hw_mux_reg (); -} - -bool -usrp_standard_tx::set_mux (int mux) -{ - d_sw_mux = mux; - d_hw_mux = mux << 4; - return write_hw_mux_reg (); -} - -bool -usrp_standard_tx::write_hw_mux_reg () -{ - bool s = disable_tx (); - bool ok = _write_fpga_reg (FR_TX_MUX, d_hw_mux | d_nchan); - restore_tx (s); - return ok; -} - -int -usrp_standard_tx::determine_tx_mux_value(const usrp_subdev_spec &ss) -{ - /* - Determine appropriate Tx mux value as a function of the subdevice choosen. - - @param u: instance of USRP source - @param subdev_spec: return value from subdev option parser. - @type subdev_spec: (side, subdev), where side is 0 or 1 and subdev is 0 - @returns: the Rx mux value - - This is simpler than the rx case. Either you want to talk - to side A or side B. If you want to talk to both sides at once, - determine the value manually. - */ - - if (!is_valid(ss)) - throw std::invalid_argument("subdev_spec"); - - std::vector<db_base_sptr> db = this->db(ss.side); - - if(db[ss.subdev]->i_and_q_swapped()) { - unsigned int mask[2] = {0x0089, 0x8900}; - return mask[ss.side]; - } - else { - unsigned int mask[2] = {0x0098, 0x9800}; - return mask[ss.side]; - } -} - -int -usrp_standard_tx::determine_tx_mux_value(const usrp_subdev_spec &ss_a, const usrp_subdev_spec &ss_b) -{ - if (ss_a.side == ss_b.side && ss_a.subdev == ss_b.subdev){ - throw std::runtime_error("Cannot compute dual mux, repeated subdevice"); - } - int mux_a = determine_tx_mux_value(ss_a); - //Get the mux b: - // DAC0 becomes DAC2 - // DAC1 becomes DAC3 - unsigned int mask[2] = {0x0022, 0x2200}; - int mux_b = determine_tx_mux_value(ss_b) + mask[ss_b.side]; - return mux_b | mux_a; -} - -#ifdef USE_FPGA_TX_CORDIC - -bool -usrp_standard_tx::set_tx_freq (int channel, double freq) -{ - if (channel < 0 || channel >= MAX_CHAN) - return false; - - // This assumes we're running the 4x on-chip interpolator. - - unsigned int v = - compute_freq_control_word_fpga (dac_rate () / 4, - freq, &d_tx_freq[channel], - d_verbose); - - return _write_fpga_reg (FR_TX_FREQ_0 + channel, v); -} - - -#else - -bool -usrp_standard_tx::set_tx_freq (int channel, double freq) -{ - if (channel < 0 || channel >= MAX_CHAN) - return false; - - // split freq into fine and coarse components - - coarse_mod_t cm; - double coarse; - - double coarse_freq_1 = dac_rate () / 8; // First coarse frequency - double coarse_freq_2 = dac_rate () / 4; // Second coarse frequency - double coarse_limit_1 = coarse_freq_1 / 2; // Midpoint of [0 , freq1] range - double coarse_limit_2 = (coarse_freq_1 + coarse_freq_2) / 2; // Midpoint of [freq1 , freq2] range - double high_limit = (double)44e6/128e6*dac_rate (); // Highest meaningful frequency - - if (freq < -high_limit) // too low - return false; - else if (freq < -coarse_limit_2){ // For 64MHz: [-44, -24) - cm = CM_NEG_FDAC_OVER_4; - coarse = -coarse_freq_2; - } - else if (freq < -coarse_limit_1){ // For 64MHz: [-24, -8) - cm = CM_NEG_FDAC_OVER_8; - coarse = -coarse_freq_1; - } - else if (freq < coarse_limit_1){ // For 64MHz: [-8, 8) - cm = CM_OFF; - coarse = 0; - } - else if (freq < coarse_limit_2){ // For 64MHz: [8, 24) - cm = CM_POS_FDAC_OVER_8; - coarse = coarse_freq_1; - } - else if (freq <= high_limit){ // For 64MHz: [24, 44] - cm = CM_POS_FDAC_OVER_4; - coarse = coarse_freq_2; - } - else // too high - return false; - - - set_coarse_modulator (channel, cm); // set bits in d_tx_modulator_shadow - - double fine = freq - coarse; - - - // Compute fine tuning word... - // This assumes we're running the 4x on-chip interpolator. - // (This is required to use the fine modulator.) - - unsigned int v = - compute_freq_control_word_9862 (dac_rate () / 4, - fine, &d_tx_freq[channel], d_verbose); - - d_tx_freq[channel] += coarse; // adjust actual - - unsigned char high, mid, low; - - high = (v >> 16) & 0xff; - mid = (v >> 8) & 0xff; - low = (v >> 0) & 0xff; - - bool ok = true; - - // write the fine tuning word - ok &= _write_9862 (channel, REG_TX_NCO_FTW_23_16, high); - ok &= _write_9862 (channel, REG_TX_NCO_FTW_15_8, mid); - ok &= _write_9862 (channel, REG_TX_NCO_FTW_7_0, low); - - - d_tx_modulator_shadow[channel] |= TX_MODULATOR_ENABLE_NCO; - - if (fine < 0) - d_tx_modulator_shadow[channel] |= TX_MODULATOR_NEG_FINE_TUNE; - else - d_tx_modulator_shadow[channel] &= ~TX_MODULATOR_NEG_FINE_TUNE; - - ok &=_write_9862 (channel, REG_TX_MODULATOR, d_tx_modulator_shadow[channel]); - - return ok; -} -#endif - -bool -usrp_standard_tx::set_coarse_modulator (int channel, coarse_mod_t cm) -{ - if (channel < 0 || channel >= MAX_CHAN) - return false; - - switch (cm){ - case CM_NEG_FDAC_OVER_4: - d_tx_modulator_shadow[channel] &= ~TX_MODULATOR_CM_MASK; - d_tx_modulator_shadow[channel] |= TX_MODULATOR_COARSE_MODULATION_F_OVER_4; - d_tx_modulator_shadow[channel] |= TX_MODULATOR_NEG_COARSE_TUNE; - break; - - case CM_NEG_FDAC_OVER_8: - d_tx_modulator_shadow[channel] &= ~TX_MODULATOR_CM_MASK; - d_tx_modulator_shadow[channel] |= TX_MODULATOR_COARSE_MODULATION_F_OVER_8; - d_tx_modulator_shadow[channel] |= TX_MODULATOR_NEG_COARSE_TUNE; - break; - - case CM_OFF: - d_tx_modulator_shadow[channel] &= ~TX_MODULATOR_CM_MASK; - break; - - case CM_POS_FDAC_OVER_8: - d_tx_modulator_shadow[channel] &= ~TX_MODULATOR_CM_MASK; - d_tx_modulator_shadow[channel] |= TX_MODULATOR_COARSE_MODULATION_F_OVER_8; - break; - - case CM_POS_FDAC_OVER_4: - d_tx_modulator_shadow[channel] &= ~TX_MODULATOR_CM_MASK; - d_tx_modulator_shadow[channel] |= TX_MODULATOR_COARSE_MODULATION_F_OVER_4; - break; - - default: - return false; - } - - d_coarse_mod[channel] = cm; - return true; -} - -unsigned int -usrp_standard_tx::interp_rate () const { return d_interp_rate; } - -int -usrp_standard_tx::nchannels () const { return d_nchan; } - -int -usrp_standard_tx::mux () const { return d_sw_mux; } - -double -usrp_standard_tx::tx_freq (int channel) const -{ - if (channel < 0 || channel >= MAX_CHAN) - return 0; - - return d_tx_freq[channel]; -} - -usrp_standard_tx::coarse_mod_t -usrp_standard_tx::coarse_modulator (int channel) const -{ - if (channel < 0 || channel >= MAX_CHAN) - return CM_OFF; - - return d_coarse_mod[channel]; -} - -bool -usrp_standard_tx::tune(int chan, db_base_sptr db, double target_freq, usrp_tune_result *result) -{ - duc_control dxc(this, chan); - return tune_a_helper(db, target_freq, converter_rate(), dxc, result); -} diff --git a/usrp/host/misc/.gitignore b/usrp/host/misc/.gitignore deleted file mode 100644 index a02b6ff73..000000000 --- a/usrp/host/misc/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -/Makefile -/Makefile.in -/.la -/.lo -/.deps -/.libs -/*.la -/*.lo diff --git a/usrp/host/misc/Makefile.am b/usrp/host/misc/Makefile.am deleted file mode 100644 index d238311e3..000000000 --- a/usrp/host/misc/Makefile.am +++ /dev/null @@ -1,31 +0,0 @@ -# -# Copyright 2003,2004,2010 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -include $(top_srcdir)/Makefile.common - -EXTRA_DIST += \ - getopt.c getopt.h \ - gettimeofday.c \ - usleep.c - -noinst_LTLIBRARIES = libmisc.la - -libmisc_la_SOURCES = bug_work_around_8.cc diff --git a/usrp/host/misc/bug_work_around_8.cc b/usrp/host/misc/bug_work_around_8.cc deleted file mode 100644 index 41943247f..000000000 --- a/usrp/host/misc/bug_work_around_8.cc +++ /dev/null @@ -1,2 +0,0 @@ -// if libmisc has no sources, it doesn't get built correctly -int gr_bug_work_around_8; diff --git a/usrp/host/misc/getopt.c b/usrp/host/misc/getopt.c deleted file mode 100644 index 34eeaa6a4..000000000 --- a/usrp/host/misc/getopt.c +++ /dev/null @@ -1,734 +0,0 @@ -/* Getopt for GNU. - NOTE: getopt is now part of the C library, so if you don't know what - "Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu - before changing it! - - Copyright (C) 1987, 88, 89, 90, 91, 92, 1993 - Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 3, or (at your option) any - later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -/* NOTE!!! AIX requires this to be the first thing in the file. - Do not put ANYTHING before it! */ -#if !defined (__GNUC__) && defined (_AIX) - #pragma alloca -#endif - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef __GNUC__ -#define alloca __builtin_alloca -#else /* not __GNUC__ */ -#if defined (HAVE_ALLOCA_H) || (defined(sparc) && (defined(sun) || (!defined(USG) && !defined(SVR4) && !defined(__svr4__)))) -#include <alloca.h> -#else -#ifndef _AIX -char *alloca (); -#endif -#endif /* alloca.h */ -#endif /* not __GNUC__ */ - -#if !__STDC__ && !defined(const) && IN_GCC -#define const -#endif - -/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>. */ -#ifndef _NO_PROTO -#define _NO_PROTO -#endif - -#include <stdio.h> -#include <string.h> - -/* Comment out all this code if we are using the GNU C Library, and are not - actually compiling the library itself. This code is part of the GNU C - Library, but also included in many other GNU distributions. Compiling - and linking in this code is a waste when using the GNU C library - (especially if it is a shared library). Rather than having every GNU - program understand `configure --with-gnu-libc' and omit the object files, - it is simpler to just do this in the source for each such file. */ - -#if defined (_LIBC) || !defined (__GNU_LIBRARY__) - - -/* This needs to come after some library #include - to get __GNU_LIBRARY__ defined. */ -#ifdef __GNU_LIBRARY__ -#undef alloca -/* Don't include stdlib.h for non-GNU C libraries because some of them - contain conflicting prototypes for getopt. */ -#include <stdlib.h> -#else /* Not GNU C library. */ -#define __alloca alloca -#endif /* GNU C library. */ - -/* If GETOPT_COMPAT is defined, `+' as well as `--' can introduce a - long-named option. Because this is not POSIX.2 compliant, it is - being phased out. */ -/* #define GETOPT_COMPAT */ - -/* This version of `getopt' appears to the caller like standard Unix `getopt' - but it behaves differently for the user, since it allows the user - to intersperse the options with the other arguments. - - As `getopt' works, it permutes the elements of ARGV so that, - when it is done, all the options precede everything else. Thus - all application programs are extended to handle flexible argument order. - - Setting the environment variable POSIXLY_CORRECT disables permutation. - Then the behavior is completely standard. - - GNU application programs can use a third alternative mode in which - they can distinguish the relative order of options and other arguments. */ - -#include "getopt.h" - -/* For communication from `getopt' to the caller. - When `getopt' finds an option that takes an argument, - the argument value is returned here. - Also, when `ordering' is RETURN_IN_ORDER, - each non-option ARGV-element is returned here. */ - -char *optarg = 0; - -/* Index in ARGV of the next element to be scanned. - This is used for communication to and from the caller - and for communication between successive calls to `getopt'. - - On entry to `getopt', zero means this is the first call; initialize. - - When `getopt' returns EOF, this is the index of the first of the - non-option elements that the caller should itself scan. - - Otherwise, `optind' communicates from one call to the next - how much of ARGV has been scanned so far. */ - -/* XXX 1003.2 says this must be 1 before any call. */ -int optind = 0; - -/* The next char to be scanned in the option-element - in which the last option character we returned was found. - This allows us to pick up the scan where we left off. - - If this is zero, or a null string, it means resume the scan - by advancing to the next ARGV-element. */ - -static char *nextchar; - -/* Callers store zero here to inhibit the error message - for unrecognized options. */ - -int opterr = 1; - -/* Set to an option character which was unrecognized. - This must be initialized on some systems to avoid linking in the - system's own getopt implementation. */ - -int optopt = '?'; - -/* Describe how to deal with options that follow non-option ARGV-elements. - - If the caller did not specify anything, - the default is REQUIRE_ORDER if the environment variable - POSIXLY_CORRECT is defined, PERMUTE otherwise. - - REQUIRE_ORDER means don't recognize them as options; - stop option processing when the first non-option is seen. - This is what Unix does. - This mode of operation is selected by either setting the environment - variable POSIXLY_CORRECT, or using `+' as the first character - of the list of option characters. - - PERMUTE is the default. We permute the contents of ARGV as we scan, - so that eventually all the non-options are at the end. This allows options - to be given in any order, even with programs that were not written to - expect this. - - RETURN_IN_ORDER is an option available to programs that were written - to expect options and other ARGV-elements in any order and that care about - the ordering of the two. We describe each non-option ARGV-element - as if it were the argument of an option with character code 1. - Using `-' as the first character of the list of option characters - selects this mode of operation. - - The special argument `--' forces an end of option-scanning regardless - of the value of `ordering'. In the case of RETURN_IN_ORDER, only - `--' can cause `getopt' to return EOF with `optind' != ARGC. */ - -static enum -{ - REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER -} ordering; - -#ifdef __GNU_LIBRARY__ -/* We want to avoid inclusion of string.h with non-GNU libraries - because there are many ways it can cause trouble. - On some systems, it contains special magic macros that don't work - in GCC. */ -#include <string.h> -#define my_index strchr -#define my_bcopy(src, dst, n) memcpy ((dst), (src), (n)) -#else - -/* Avoid depending on library functions or files - whose names are inconsistent. */ - -char *getenv (); - -static char * -my_index (str, chr) - const char *str; - int chr; -{ - while (*str) - { - if (*str == chr) - return (char *) str; - str++; - } - return 0; -} - -static void -my_bcopy (from, to, size) - const char *from; - char *to; - int size; -{ - int i; - for (i = 0; i < size; i++) - to[i] = from[i]; -} -#endif /* GNU C library. */ - -/* Handle permutation of arguments. */ - -/* Describe the part of ARGV that contains non-options that have - been skipped. `first_nonopt' is the index in ARGV of the first of them; - `last_nonopt' is the index after the last of them. */ - -static int first_nonopt; -static int last_nonopt; - -/* Exchange two adjacent subsequences of ARGV. - One subsequence is elements [first_nonopt,last_nonopt) - which contains all the non-options that have been skipped so far. - The other is elements [last_nonopt,optind), which contains all - the options processed since those non-options were skipped. - - `first_nonopt' and `last_nonopt' are relocated so that they describe - the new indices of the non-options in ARGV after they are moved. */ - -static void -exchange (argv) - char **argv; -{ - int nonopts_size = (last_nonopt - first_nonopt) * sizeof (char *); - char **temp = (char **) __alloca (nonopts_size); - - /* Interchange the two blocks of data in ARGV. */ - - my_bcopy ((char *) &argv[first_nonopt], (char *) temp, nonopts_size); - my_bcopy ((char *) &argv[last_nonopt], (char *) &argv[first_nonopt], - (optind - last_nonopt) * sizeof (char *)); - my_bcopy ((char *) temp, - (char *) &argv[first_nonopt + optind - last_nonopt], - nonopts_size); - - /* Update records for the slots the non-options now occupy. */ - - first_nonopt += (optind - last_nonopt); - last_nonopt = optind; -} - -/* Scan elements of ARGV (whose length is ARGC) for option characters - given in OPTSTRING. - - If an element of ARGV starts with '-', and is not exactly "-" or "--", - then it is an option element. The characters of this element - (aside from the initial '-') are option characters. If `getopt' - is called repeatedly, it returns successively each of the option characters - from each of the option elements. - - If `getopt' finds another option character, it returns that character, - updating `optind' and `nextchar' so that the next call to `getopt' can - resume the scan with the following option character or ARGV-element. - - If there are no more option characters, `getopt' returns `EOF'. - Then `optind' is the index in ARGV of the first ARGV-element - that is not an option. (The ARGV-elements have been permuted - so that those that are not options now come last.) - - OPTSTRING is a string containing the legitimate option characters. - If an option character is seen that is not listed in OPTSTRING, - return '?' after printing an error message. If you set `opterr' to - zero, the error message is suppressed but we still return '?'. - - If a char in OPTSTRING is followed by a colon, that means it wants an arg, - so the following text in the same ARGV-element, or the text of the following - ARGV-element, is returned in `optarg'. Two colons mean an option that - wants an optional arg; if there is text in the current ARGV-element, - it is returned in `optarg', otherwise `optarg' is set to zero. - - If OPTSTRING starts with `-' or `+', it requests different methods of - handling the non-option ARGV-elements. - See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. - - Long-named options begin with `--' instead of `-'. - Their names may be abbreviated as long as the abbreviation is unique - or is an exact match for some defined option. If they have an - argument, it follows the option name in the same ARGV-element, separated - from the option name by a `=', or else the in next ARGV-element. - When `getopt' finds a long-named option, it returns 0 if that option's - `flag' field is nonzero, the value of the option's `val' field - if the `flag' field is zero. - - The elements of ARGV aren't really const, because we permute them. - But we pretend they're const in the prototype to be compatible - with other systems. - - LONGOPTS is a vector of `struct option' terminated by an - element containing a name which is zero. - - LONGIND returns the index in LONGOPT of the long-named option found. - It is only valid when a long-named option has been found by the most - recent call. - - If LONG_ONLY is nonzero, '-' as well as '--' can introduce - long-named options. */ - -int -_getopt_internal (argc, argv, optstring, longopts, longind, long_only) - int argc; - char *const *argv; - const char *optstring; - const struct option *longopts; - int *longind; - int long_only; -{ - int option_index; - - optarg = 0; - - /* Initialize the internal data when the first call is made. - Start processing options with ARGV-element 1 (since ARGV-element 0 - is the program name); the sequence of previously skipped - non-option ARGV-elements is empty. */ - - if (optind == 0) - { - first_nonopt = last_nonopt = optind = 1; - - nextchar = NULL; - - /* Determine how to handle the ordering of options and nonoptions. */ - - if (optstring[0] == '-') - { - ordering = RETURN_IN_ORDER; - ++optstring; - } - else if (optstring[0] == '+') - { - ordering = REQUIRE_ORDER; - ++optstring; - } - else if (getenv ("POSIXLY_CORRECT") != NULL) - ordering = REQUIRE_ORDER; - else - ordering = PERMUTE; - } - - if (nextchar == NULL || *nextchar == '\0') - { - if (ordering == PERMUTE) - { - /* If we have just processed some options following some non-options, - exchange them so that the options come first. */ - - if (first_nonopt != last_nonopt && last_nonopt != optind) - exchange ((char **) argv); - else if (last_nonopt != optind) - first_nonopt = optind; - - /* Now skip any additional non-options - and extend the range of non-options previously skipped. */ - - while (optind < argc - && (argv[optind][0] != '-' || argv[optind][1] == '\0') -#ifdef GETOPT_COMPAT - && (longopts == NULL - || argv[optind][0] != '+' || argv[optind][1] == '\0') -#endif /* GETOPT_COMPAT */ - ) - optind++; - last_nonopt = optind; - } - - /* Special ARGV-element `--' means premature end of options. - Skip it like a null option, - then exchange with previous non-options as if it were an option, - then skip everything else like a non-option. */ - - if (optind != argc && !strcmp (argv[optind], "--")) - { - optind++; - - if (first_nonopt != last_nonopt && last_nonopt != optind) - exchange ((char **) argv); - else if (first_nonopt == last_nonopt) - first_nonopt = optind; - last_nonopt = argc; - - optind = argc; - } - - /* If we have done all the ARGV-elements, stop the scan - and back over any non-options that we skipped and permuted. */ - - if (optind == argc) - { - /* Set the next-arg-index to point at the non-options - that we previously skipped, so the caller will digest them. */ - if (first_nonopt != last_nonopt) - optind = first_nonopt; - return EOF; - } - - /* If we have come to a non-option and did not permute it, - either stop the scan or describe it to the caller and pass it by. */ - - if ((argv[optind][0] != '-' || argv[optind][1] == '\0') -#ifdef GETOPT_COMPAT - && (longopts == NULL - || argv[optind][0] != '+' || argv[optind][1] == '\0') -#endif /* GETOPT_COMPAT */ - ) - { - if (ordering == REQUIRE_ORDER) - return EOF; - optarg = argv[optind++]; - return 1; - } - - /* We have found another option-ARGV-element. - Start decoding its characters. */ - - nextchar = (argv[optind] + 1 - + (longopts != NULL && argv[optind][1] == '-')); - } - - if (longopts != NULL - && ((argv[optind][0] == '-' - && (argv[optind][1] == '-' || long_only)) -#ifdef GETOPT_COMPAT - || argv[optind][0] == '+' -#endif /* GETOPT_COMPAT */ - )) - { - const struct option *p; - char *s = nextchar; - int exact = 0; - int ambig = 0; - const struct option *pfound = NULL; - int indfound; - - while (*s && *s != '=') - s++; - - /* Test all options for either exact match or abbreviated matches. */ - for (p = longopts, option_index = 0; p->name; - p++, option_index++) - if (!strncmp (p->name, nextchar, s - nextchar)) - { - if (s - nextchar == strlen (p->name)) - { - /* Exact match found. */ - pfound = p; - indfound = option_index; - exact = 1; - break; - } - else if (pfound == NULL) - { - /* First nonexact match found. */ - pfound = p; - indfound = option_index; - } - else - /* Second nonexact match found. */ - ambig = 1; - } - - if (ambig && !exact) - { - if (opterr) - fprintf (stderr, "%s: option `%s' is ambiguous\n", - argv[0], argv[optind]); - nextchar += strlen (nextchar); - optind++; - return '?'; - } - - if (pfound != NULL) - { - option_index = indfound; - optind++; - if (*s) - { - /* Don't test has_arg with >, because some C compilers don't - allow it to be used on enums. */ - if (pfound->has_arg) - optarg = s + 1; - else - { - if (opterr) - { - if (argv[optind - 1][1] == '-') - /* --option */ - fprintf (stderr, - "%s: option `--%s' doesn't allow an argument\n", - argv[0], pfound->name); - else - /* +option or -option */ - fprintf (stderr, - "%s: option `%c%s' doesn't allow an argument\n", - argv[0], argv[optind - 1][0], pfound->name); - } - nextchar += strlen (nextchar); - return '?'; - } - } - else if (pfound->has_arg == 1) - { - if (optind < argc) - optarg = argv[optind++]; - else - { - if (opterr) - fprintf (stderr, "%s: option `%s' requires an argument\n", - argv[0], argv[optind - 1]); - nextchar += strlen (nextchar); - return optstring[0] == ':' ? ':' : '?'; - } - } - nextchar += strlen (nextchar); - if (longind != NULL) - *longind = option_index; - if (pfound->flag) - { - *(pfound->flag) = pfound->val; - return 0; - } - return pfound->val; - } - /* Can't find it as a long option. If this is not getopt_long_only, - or the option starts with '--' or is not a valid short - option, then it's an error. - Otherwise interpret it as a short option. */ - if (!long_only || argv[optind][1] == '-' -#ifdef GETOPT_COMPAT - || argv[optind][0] == '+' -#endif /* GETOPT_COMPAT */ - || my_index (optstring, *nextchar) == NULL) - { - if (opterr) - { - if (argv[optind][1] == '-') - /* --option */ - fprintf (stderr, "%s: unrecognized option `--%s'\n", - argv[0], nextchar); - else - /* +option or -option */ - fprintf (stderr, "%s: unrecognized option `%c%s'\n", - argv[0], argv[optind][0], nextchar); - } - nextchar = (char *) ""; - optind++; - return '?'; - } - } - - /* Look at and handle the next option-character. */ - - { - char c = *nextchar++; - char *temp = my_index (optstring, c); - - /* Increment `optind' when we start to process its last character. */ - if (*nextchar == '\0') - ++optind; - - if (temp == NULL || c == ':') - { - if (opterr) - { -#if 0 - if (c < 040 || c >= 0177) - fprintf (stderr, "%s: unrecognized option, character code 0%o\n", - argv[0], c); - else - fprintf (stderr, "%s: unrecognized option `-%c'\n", argv[0], c); -#else - /* 1003.2 specifies the format of this message. */ - fprintf (stderr, "%s: illegal option -- %c\n", argv[0], c); -#endif - } - optopt = c; - return '?'; - } - if (temp[1] == ':') - { - if (temp[2] == ':') - { - /* This is an option that accepts an argument optionally. */ - if (*nextchar != '\0') - { - optarg = nextchar; - optind++; - } - else - optarg = 0; - nextchar = NULL; - } - else - { - /* This is an option that requires an argument. */ - if (*nextchar != '\0') - { - optarg = nextchar; - /* If we end this ARGV-element by taking the rest as an arg, - we must advance to the next element now. */ - optind++; - } - else if (optind == argc) - { - if (opterr) - { -#if 0 - fprintf (stderr, "%s: option `-%c' requires an argument\n", - argv[0], c); -#else - /* 1003.2 specifies the format of this message. */ - fprintf (stderr, "%s: option requires an argument -- %c\n", - argv[0], c); -#endif - } - optopt = c; - if (optstring[0] == ':') - c = ':'; - else - c = '?'; - } - else - /* We already incremented `optind' once; - increment it again when taking next ARGV-elt as argument. */ - optarg = argv[optind++]; - nextchar = NULL; - } - } - return c; - } -} - -#ifdef GETOPT -int -getopt (argc, argv, optstring) - int argc; - char *const *argv; - const char *optstring; -{ - return _getopt_internal (argc, argv, optstring, - (const struct option *) 0, - (int *) 0, - 0); -} -#endif - -#endif /* _LIBC or not __GNU_LIBRARY__. */ - -#ifdef TEST - -/* Compile with -DTEST to make an executable for use in testing - the above definition of `getopt'. */ - -int -main (argc, argv) - int argc; - char **argv; -{ - int c; - int digit_optind = 0; - - while (1) - { - int this_option_optind = optind ? optind : 1; - - c = getopt (argc, argv, "abc:d:0123456789"); - if (c == EOF) - break; - - switch (c) - { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - if (digit_optind != 0 && digit_optind != this_option_optind) - printf ("digits occur in two different argv-elements.\n"); - digit_optind = this_option_optind; - printf ("option %c\n", c); - break; - - case 'a': - printf ("option a\n"); - break; - - case 'b': - printf ("option b\n"); - break; - - case 'c': - printf ("option c with value `%s'\n", optarg); - break; - - case '?': - break; - - default: - printf ("?? getopt returned character code 0%o ??\n", c); - } - } - - if (optind < argc) - { - printf ("non-option ARGV-elements: "); - while (optind < argc) - printf ("%s ", argv[optind++]); - printf ("\n"); - } - - exit (0); -} - -#endif /* TEST */ diff --git a/usrp/host/misc/getopt.h b/usrp/host/misc/getopt.h deleted file mode 100644 index 067908147..000000000 --- a/usrp/host/misc/getopt.h +++ /dev/null @@ -1,129 +0,0 @@ -/* Declarations for getopt. - Copyright (C) 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 3, or (at your option) any - later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#ifndef _GETOPT_H -#define _GETOPT_H 1 - -#ifdef __cplusplus -extern "C" { -#endif - -/* For communication from `getopt' to the caller. - When `getopt' finds an option that takes an argument, - the argument value is returned here. - Also, when `ordering' is RETURN_IN_ORDER, - each non-option ARGV-element is returned here. */ - -extern char *optarg; - -/* Index in ARGV of the next element to be scanned. - This is used for communication to and from the caller - and for communication between successive calls to `getopt'. - - On entry to `getopt', zero means this is the first call; initialize. - - When `getopt' returns EOF, this is the index of the first of the - non-option elements that the caller should itself scan. - - Otherwise, `optind' communicates from one call to the next - how much of ARGV has been scanned so far. */ - -extern int optind; - -/* Callers store zero here to inhibit the error message `getopt' prints - for unrecognized options. */ - -extern int opterr; - -/* Set to an option character which was unrecognized. */ - -extern int optopt; - -/* Describe the long-named options requested by the application. - The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector - of `struct option' terminated by an element containing a name which is - zero. - - The field `has_arg' is: - no_argument (or 0) if the option does not take an argument, - required_argument (or 1) if the option requires an argument, - optional_argument (or 2) if the option takes an optional argument. - - If the field `flag' is not NULL, it points to a variable that is set - to the value given in the field `val' when the option is found, but - left unchanged if the option is not found. - - To have a long-named option do something other than set an `int' to - a compiled-in constant, such as set a value from `optarg', set the - option's `flag' field to zero and its `val' field to a nonzero - value (the equivalent single-letter option character, if there is - one). For long options that have a zero `flag' field, `getopt' - returns the contents of the `val' field. */ - -struct option -{ -#if __STDC__ - const char *name; -#else - char *name; -#endif - /* has_arg can't be an enum because some compilers complain about - type mismatches in all the code that assumes it is an int. */ - int has_arg; - int *flag; - int val; -}; - -/* Names for the values of the `has_arg' field of `struct option'. */ - -#define no_argument 0 -#define required_argument 1 -#define optional_argument 2 - -#if __STDC__ -#if defined(__GNU_LIBRARY__) -/* Many other libraries have conflicting prototypes for getopt, with - differences in the consts, in stdlib.h. To avoid compilation - errors, only prototype getopt for the GNU C library. */ -extern int getopt (int argc, char *const *argv, const char *shortopts); -#else /* not __GNU_LIBRARY__ */ -extern int getopt (); -#endif /* not __GNU_LIBRARY__ */ -extern int getopt_long (int argc, char *const *argv, const char *shortopts, - const struct option *longopts, int *longind); -extern int getopt_long_only (int argc, char *const *argv, - const char *shortopts, - const struct option *longopts, int *longind); - -/* Internal only. Users should not call this directly. */ -extern int _getopt_internal (int argc, char *const *argv, - const char *shortopts, - const struct option *longopts, int *longind, - int long_only); -#else /* not __STDC__ */ -extern int getopt (); -extern int getopt_long (); -extern int getopt_long_only (); - -extern int _getopt_internal (); -#endif /* not __STDC__ */ - -#ifdef __cplusplus -} -#endif - -#endif /* _GETOPT_H */ diff --git a/usrp/host/misc/gettimeofday.c b/usrp/host/misc/gettimeofday.c deleted file mode 100644 index 098793ac9..000000000 --- a/usrp/host/misc/gettimeofday.c +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2003 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <config.h> - -#ifdef HAVE_WINDOWS_H -#include <windows.h> -#endif -#ifdef HAVE_WINBASE_H -# include <winbase.h> -#endif - -#ifdef HAVE_SYS_TIME_H -#include <sys/time.h> -#endif - -/* - * broken implementation for WIN32. - * FIXME: usec precision - */ -int gettimeofday(struct timeval *tv, struct timezone *tz) -{ - if (tv) { - time_t tm; - - time(&tm); - tv->tv_sec = tm; - tv->tv_usec = 0; - } - return 0; -} - diff --git a/usrp/host/misc/mkstemp.c b/usrp/host/misc/mkstemp.c deleted file mode 100644 index 8abacb984..000000000 --- a/usrp/host/misc/mkstemp.c +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. - This file is derived from the one in the GNU C Library. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Boston, MA 02110-1301, USA. */ - -#include <config.h> - -/* Disable the definition of mkstemp to rpl_mkstemp (from config.h) in this - file. Otherwise, we'd get conflicting prototypes for rpl_mkstemp on - most systems. */ -#undef mkstemp - -#include <stdio.h> -#include <stdlib.h> - -#ifndef __GT_FILE -# define __GT_FILE 0 -#endif - -int __gen_tempname (); - -/* Generate a unique temporary file name from TEMPLATE. - The last six characters of TEMPLATE must be "XXXXXX"; - they are replaced with a string that makes the filename unique. - Then open the file and return a fd. */ -int -rpl_mkstemp (char *template) -{ - return __gen_tempname (template, __GT_FILE); -} diff --git a/usrp/host/misc/tempname.c b/usrp/host/misc/tempname.c deleted file mode 100644 index 2611126cf..000000000 --- a/usrp/host/misc/tempname.c +++ /dev/null @@ -1,352 +0,0 @@ -/* tempname.c - generate the name of a temporary file. - - Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Boston, MA 02110-1301, USA. */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include <sys/types.h> -#include <assert.h> - -#include <errno.h> -#ifndef __set_errno -# define __set_errno(Val) errno = (Val) -#endif - -#include <stdio.h> -#ifndef P_tmpdir -# define P_tmpdir "/tmp" -#endif -#ifndef TMP_MAX -# define TMP_MAX 238328 -#endif -#ifndef __GT_FILE -# define __GT_FILE 0 -# define __GT_BIGFILE 1 -# define __GT_DIR 2 -# define __GT_NOCREATE 3 -#endif - -#include <stddef.h> -#include <stdlib.h> -#include <string.h> - -#if HAVE_FCNTL_H || _LIBC -# include <fcntl.h> -#endif - -#if HAVE_SYS_TIME_H || _LIBC -# include <sys/time.h> -#endif - -#if HAVE_STDINT_H || _LIBC -# include <stdint.h> -#endif -#if HAVE_INTTYPES_H -# include <inttypes.h> -#endif - -#if HAVE_UNISTD_H || _LIBC -# include <unistd.h> -#endif - -#include <sys/stat.h> -#if STAT_MACROS_BROKEN -# undef S_ISDIR -#endif -#if !defined S_ISDIR && defined S_IFDIR -# define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) -#endif -#if !S_IRUSR && S_IREAD -# define S_IRUSR S_IREAD -#endif -#if !S_IRUSR -# define S_IRUSR 00400 -#endif -#if !S_IWUSR && S_IWRITE -# define S_IWUSR S_IWRITE -#endif -#if !S_IWUSR -# define S_IWUSR 00200 -#endif -#if !S_IXUSR && S_IEXEC -# define S_IXUSR S_IEXEC -#endif -#if !S_IXUSR -# define S_IXUSR 00100 -#endif - -#if _LIBC -# define struct_stat64 struct stat64 -#else -# define struct_stat64 struct stat -# define __getpid getpid -# define __gettimeofday gettimeofday -#ifdef MKDIR_TAKES_ONE_ARG -# define __mkdir(pathname,mode) mkdir((pathname)) -#else -# define __mkdir mkdir -#endif -# define __open open -# define __open64 open -#ifdef HAVE_LSTAT -# define __lxstat64(version, path, buf) lstat (path, buf) -#else -# define __lxstat64(version, path, buf) stat (path, buf) -#endif -# define __xstat64(version, path, buf) stat (path, buf) -#endif - -#if ! (HAVE___SECURE_GETENV || _LIBC) -# define __secure_getenv getenv -#endif - -#ifdef _LIBC -# include <hp-timing.h> -# if HP_TIMING_AVAIL -# define RANDOM_BITS(Var) \ - if (__builtin_expect (value == UINT64_C (0), 0)) \ - { \ - /* If this is the first time this function is used initialize \ - the variable we accumulate the value in to some somewhat \ - random value. If we'd not do this programs at startup time \ - might have a reduced set of possible names, at least on slow \ - machines. */ \ - struct timeval tv; \ - __gettimeofday (&tv, NULL); \ - value = ((uint64_t) tv.tv_usec << 16) ^ tv.tv_sec; \ - } \ - HP_TIMING_NOW (Var) -# endif -#endif - -/* Use the widest available unsigned type if uint64_t is not - available. The algorithm below extracts a number less than 62**6 - (approximately 2**35.725) from uint64_t, so ancient hosts where - uintmax_t is only 32 bits lose about 3.725 bits of randomness, - which is better than not having mkstemp at all. */ -#if !defined UINT64_MAX && !defined uint64_t -# define uint64_t uintmax_t -#endif - -/* Return nonzero if DIR is an existent directory. */ -static int -direxists (const char *dir) -{ - struct_stat64 buf; - return __xstat64 (_STAT_VER, dir, &buf) == 0 && S_ISDIR (buf.st_mode); -} - -/* Path search algorithm, for tmpnam, tmpfile, etc. If DIR is - non-null and exists, uses it; otherwise uses the first of $TMPDIR, - P_tmpdir, /tmp that exists. Copies into TMPL a template suitable - for use with mk[s]temp. Will fail (-1) if DIR is non-null and - doesn't exist, none of the searched dirs exists, or there's not - enough space in TMPL. */ -int -__path_search (char *tmpl, size_t tmpl_len, const char *dir, const char *pfx, - int try_tmpdir) -{ - const char *d; - size_t dlen, plen; - - if (!pfx || !pfx[0]) - { - pfx = "file"; - plen = 4; - } - else - { - plen = strlen (pfx); - if (plen > 5) - plen = 5; - } - - if (try_tmpdir) - { - d = __secure_getenv ("TMPDIR"); - if (d != NULL && direxists (d)) - dir = d; - else if (dir != NULL && direxists (dir)) - /* nothing */ ; - else - dir = NULL; - } - if (dir == NULL) - { - if (direxists (P_tmpdir)) - dir = P_tmpdir; - else if (strcmp (P_tmpdir, "/tmp") != 0 && direxists ("/tmp")) - dir = "/tmp"; - else - { - __set_errno (ENOENT); - return -1; - } - } - - dlen = strlen (dir); - while (dlen > 1 && dir[dlen - 1] == '/') - dlen--; /* remove trailing slashes */ - - /* check we have room for "${dir}/${pfx}XXXXXX\0" */ - if (tmpl_len < dlen + 1 + plen + 6 + 1) - { - __set_errno (EINVAL); - return -1; - } - - sprintf (tmpl, "%.*s/%.*sXXXXXX", (int) dlen, dir, (int) plen, pfx); - return 0; -} - -/* These are the characters used in temporary filenames. */ -static const char letters[] = -"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; - -/* Generate a temporary file name based on TMPL. TMPL must match the - rules for mk[s]temp (i.e. end in "XXXXXX"). The name constructed - does not exist at the time of the call to __gen_tempname. TMPL is - overwritten with the result. - - KIND may be one of: - __GT_NOCREATE: simply verify that the name does not exist - at the time of the call. - __GT_FILE: create the file using open(O_CREAT|O_EXCL) - and return a read-write fd. The file is mode 0600. - __GT_BIGFILE: same as __GT_FILE but use open64(). - __GT_DIR: create a directory, which will be mode 0700. - - We use a clever algorithm to get hard-to-predict names. */ -int -__gen_tempname (char *tmpl, int kind) -{ - int len; - char *XXXXXX; - static uint64_t value; - uint64_t random_time_bits; - unsigned int count; - int fd = -1; - int save_errno = errno; - struct_stat64 st; - - /* A lower bound on the number of temporary files to attempt to - generate. The maximum total number of temporary file names that - can exist for a given template is 62**6. It should never be - necessary to try all these combinations. Instead if a reasonable - number of names is tried (we define reasonable as 62**3) fail to - give the system administrator the chance to remove the problems. */ - unsigned int attempts_min = 62 * 62 * 62; - - /* The number of times to attempt to generate a temporary file. To - conform to POSIX, this must be no smaller than TMP_MAX. */ - unsigned int attempts = attempts_min < TMP_MAX ? TMP_MAX : attempts_min; - - len = strlen (tmpl); - if (len < 6 || strcmp (&tmpl[len - 6], "XXXXXX")) - { - __set_errno (EINVAL); - return -1; - } - - /* This is where the Xs start. */ - XXXXXX = &tmpl[len - 6]; - - /* Get some more or less random data. */ -#ifdef RANDOM_BITS - RANDOM_BITS (random_time_bits); -#else -# if HAVE_GETTIMEOFDAY || _LIBC - { - struct timeval tv; - __gettimeofday (&tv, NULL); - random_time_bits = ((uint64_t) tv.tv_usec << 16) ^ tv.tv_sec; - } -# else - random_time_bits = time (NULL); -# endif -#endif - value += random_time_bits ^ __getpid (); - - for (count = 0; count < attempts; value += 7777, ++count) - { - uint64_t v = value; - - /* Fill in the random bits. */ - XXXXXX[0] = letters[v % 62]; - v /= 62; - XXXXXX[1] = letters[v % 62]; - v /= 62; - XXXXXX[2] = letters[v % 62]; - v /= 62; - XXXXXX[3] = letters[v % 62]; - v /= 62; - XXXXXX[4] = letters[v % 62]; - v /= 62; - XXXXXX[5] = letters[v % 62]; - - switch (kind) - { - case __GT_FILE: - fd = __open (tmpl, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR); - break; - - case __GT_BIGFILE: - fd = __open64 (tmpl, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR); - break; - - case __GT_DIR: - fd = __mkdir (tmpl, S_IRUSR | S_IWUSR | S_IXUSR); - break; - - case __GT_NOCREATE: - /* This case is backward from the other three. __gen_tempname - succeeds if __xstat fails because the name does not exist. - Note the continue to bypass the common logic at the bottom - of the loop. */ - if (__lxstat64 (_STAT_VER, tmpl, &st) < 0) - { - if (errno == ENOENT) - { - __set_errno (save_errno); - return 0; - } - else - /* Give up now. */ - return -1; - } - continue; - - default: - assert (! "invalid KIND in __gen_tempname"); - } - - if (fd >= 0) - { - __set_errno (save_errno); - return fd; - } - else if (errno != EEXIST) - return -1; - } - - /* We got out of the loop because we ran out of combinations to try. */ - __set_errno (EEXIST); - return -1; -} diff --git a/usrp/host/misc/usleep.c b/usrp/host/misc/usleep.c deleted file mode 100644 index b1d7dad47..000000000 --- a/usrp/host/misc/usleep.c +++ /dev/null @@ -1,67 +0,0 @@ -/* Copyright (C) 1992 Free Software Foundation, Inc. -This file is part of the GNU C Library. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 3 of the -License, or (at your option) any later version. - -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -#include <config.h> - -#ifndef HAVE_USLEEP - -#include <sys/types.h> -#include <sys/time.h> - -#ifdef HAVE_SYS_SELECT_H -# include <sys/select.h> -#endif - -#ifdef HAVE_WINDOWS_H -#include <windows.h> -#endif -#ifdef HAVE_WINBASE_H -# include <winbase.h> -#endif - -#ifdef apollo -# include <apollo/base.h> -# include <apollo/time.h> - static time_$clock_t DomainTime100mS = - { - 0, 100000/4 - }; - static status_$t DomainStatus; -#endif - -/* Sleep USECONDS microseconds, or until a previously set timer goes off. */ -int -usleep (unsigned long useconds) -{ -#ifdef apollo - /* The usleep function does not work under the SYS5.3 environment. - Use the Domain/OS time_$wait call instead. */ - time_$wait (time_$relative, DomainTime100mS, &DomainStatus); -#elif defined(HAVE_SSLEEP) /* Win32 */ - Sleep( useconds/1000 ); -#else - struct timeval delay; - - delay.tv_sec = 0; - delay.tv_usec = useconds; - select (0, 0, 0, 0, &delay); -#endif - return 0; -} - -#endif /* !HAVE_USLEEP */ diff --git a/usrp/host/swig/.gitignore b/usrp/host/swig/.gitignore deleted file mode 100644 index 9897dac41..000000000 --- a/usrp/host/swig/.gitignore +++ /dev/null @@ -1,16 +0,0 @@ -/Makefile -/Makefile.in -/.la -/.lo -/.deps -/.libs -/*.la -/*.lo -/usrp_prims.cc -/usrp_prims.py -/usrp_prims.scm -/prims.cc -/prims.py -/gnuradio -/guile -/python diff --git a/usrp/host/swig/Makefile.am b/usrp/host/swig/Makefile.am deleted file mode 100644 index 5baeff4cb..000000000 --- a/usrp/host/swig/Makefile.am +++ /dev/null @@ -1,56 +0,0 @@ -# -# Copyright 2001,2003,2004,2006,2007,2008,2009,2010 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -include $(top_srcdir)/Makefile.common -include $(top_srcdir)/Makefile.swig - -AM_CPPFLAGS = \ - $(USRP_INCLUDES) \ - -I$(srcdir) \ - $(PYTHON_CPPFLAGS) \ - $(USB_INCLUDES) \ - $(WITH_INCLUDES) - -################################# -# SWIG interface and library - -TOP_SWIG_IFILES = \ - usrp_prims.i - -# Install so that they end up available as: -# import usrpm.usrp_prims -# This ends up at: -# ${prefix}/lib/python${python_version}/site-packages/usrpm -usrp_prims_pythondir_category = \ - usrpm - -# additional arguments to the SWIG command -usrp_prims_swig_args = \ - $(USRP_INCLUDES) - -# additional libraries for linking with the SWIG-generated library -usrp_prims_la_swig_libadd = \ - $(USRP_LA) - -# additional Python files to be installed along with the SWIG-generated one -usrp_prims_python = \ - __init__.py \ - usrp_fpga_regs.py diff --git a/usrp/host/swig/Makefile.swig.gen b/usrp/host/swig/Makefile.swig.gen deleted file mode 100644 index b772e97da..000000000 --- a/usrp/host/swig/Makefile.swig.gen +++ /dev/null @@ -1,145 +0,0 @@ -# -*- Makefile -*- -# -# Copyright 2009 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -# Makefile.swig.gen for usrp_prims.i - -## Default install locations for these files: -## -## Default location for the Python directory is: -## ${prefix}/lib/python${python_version}/site-packages/[category]/usrp_prims -## Default location for the Python exec directory is: -## ${exec_prefix}/lib/python${python_version}/site-packages/[category]/usrp_prims -## -## The following can be overloaded to change the install location, but -## this has to be done in the including Makefile.am -before- -## Makefile.swig is included. - -usrp_prims_pythondir_category ?= gnuradio/usrp_prims -usrp_prims_pylibdir_category ?= $(usrp_prims_pythondir_category) -usrp_prims_pythondir = $(pythondir)/$(usrp_prims_pythondir_category) -usrp_prims_pylibdir = $(pyexecdir)/$(usrp_prims_pylibdir_category) - -# The .so libraries for the guile modules get installed whereever guile -# is installed, usually /usr/lib/guile/gnuradio/ -# FIXME: determince whether these should be installed with gnuradio. -usrp_prims_scmlibdir = $(libdir) - -# The scm files for the guile modules get installed where ever guile -# is installed, usually /usr/share/guile/site/usrp_prims -# FIXME: determince whether these should be installed with gnuradio. -usrp_prims_scmdir = $(guiledir) - -## SWIG headers are always installed into the same directory. - -usrp_prims_swigincludedir = $(swigincludedir) - -## This is a template file for a "generated" Makefile addition (in -## this case, "Makefile.swig.gen"). By including the top-level -## Makefile.swig, this file will be used to generate the SWIG -## dependencies. Assign the variable TOP_SWIG_FILES to be the list of -## SWIG .i files to generated wrappings for; there can be more than 1 -## so long as the names are unique (no sorting is done on the -## TOP_SWIG_FILES list). This file explicitly assumes that a SWIG .i -## file will generate .cc, .py, and possibly .h files -- meaning that -## all of these files will have the same base name (that provided for -## the SWIG .i file). -## -## This code is setup to ensure parallel MAKE ("-j" or "-jN") does the -## right thing. For more info, see < -## http://sources.redhat.com/automake/automake.html#Multiple-Outputs > - -## Other cleaned files: dependency files generated by SWIG or this Makefile - -MOSTLYCLEANFILES += $(DEPDIR)/*.S* - -## Various SWIG variables. These can be overloaded in the including -## Makefile.am by setting the variable value there, then including -## Makefile.swig . - -usrp_prims_swiginclude_HEADERS = \ - usrp_prims.i \ - $(usrp_prims_swiginclude_headers) - -if PYTHON -usrp_prims_pylib_LTLIBRARIES = \ - _usrp_prims.la - -_usrp_prims_la_SOURCES = \ - python/usrp_prims.cc \ - $(usrp_prims_la_swig_sources) - -usrp_prims_python_PYTHON = \ - usrp_prims.py \ - $(usrp_prims_python) - -_usrp_prims_la_LIBADD = \ - $(STD_SWIG_LA_LIB_ADD) \ - $(usrp_prims_la_swig_libadd) - -_usrp_prims_la_LDFLAGS = \ - $(STD_SWIG_LA_LD_FLAGS) \ - $(usrp_prims_la_swig_ldflags) - -_usrp_prims_la_CXXFLAGS = \ - $(STD_SWIG_CXX_FLAGS) \ - -I$(top_builddir) \ - $(usrp_prims_la_swig_cxxflags) - -python/usrp_prims.cc: usrp_prims.py -usrp_prims.py: usrp_prims.i - -# Include the python dependencies for this file --include python/usrp_prims.d - -endif # end of if python - -if GUILE - -usrp_prims_scmlib_LTLIBRARIES = \ - libguile-gnuradio-usrp_prims.la -libguile_gnuradio_usrp_prims_la_SOURCES = \ - guile/usrp_prims.cc \ - $(usrp_prims_la_swig_sources) -nobase_usrp_prims_scm_DATA = \ - gnuradio/usrp_prims.scm \ - gnuradio/usrp_prims-primitive.scm -libguile_gnuradio_usrp_prims_la_LIBADD = \ - $(STD_SWIG_LA_LIB_ADD) \ - $(usrp_prims_la_swig_libadd) -libguile_gnuradio_usrp_prims_la_LDFLAGS = \ - $(STD_SWIG_LA_LD_FLAGS) \ - $(usrp_prims_la_swig_ldflags) -libguile_gnuradio_usrp_prims_la_CXXFLAGS = \ - $(STD_SWIG_CXX_FLAGS) \ - -I$(top_builddir) \ - $(usrp_prims_la_swig_cxxflags) - -guile/usrp_prims.cc: gnuradio/usrp_prims.scm -gnuradio/usrp_prims.scm: usrp_prims.i -gnuradio/usrp_prims-primitive.scm: gnuradio/usrp_prims.scm - -# Include the guile dependencies for this file --include guile/usrp_prims.d - -endif # end of GUILE - - diff --git a/usrp/host/swig/__init__.py b/usrp/host/swig/__init__.py deleted file mode 100644 index a4917cf64..000000000 --- a/usrp/host/swig/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# make this a package diff --git a/usrp/host/swig/usrp_fpga_regs.py b/usrp/host/swig/usrp_fpga_regs.py deleted file mode 100644 index b116d7b7a..000000000 --- a/usrp/host/swig/usrp_fpga_regs.py +++ /dev/null @@ -1,30 +0,0 @@ -# -# Copyright 2005 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -from usrpm import usrp_prims - -# Copy everything that starts with FR_ or bmFR_ from the usrp_prims -# name space into our name space. This is effectively a python binding for -# the contents of firmware/include/fpga_regs_common.h and fpga_regs_standard.h - -for name in dir(usrp_prims): - if name.startswith("FR_") or name.startswith("bmFR_"): - globals()[name] = usrp_prims.__dict__[name] diff --git a/usrp/host/swig/usrp_prims.i b/usrp/host/swig/usrp_prims.i deleted file mode 100644 index a58f8aacf..000000000 --- a/usrp/host/swig/usrp_prims.i +++ /dev/null @@ -1,265 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003,2004,2009 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -/* - * Low level primitives for directly messing with USRP hardware. - * - * If you're trying to use the USRP, you'll probably want to take a - * look at the usrp_standard_rx and usrp_standard_tx classes. They - * hide a bunch of low level details and provide high performance - * streaming i/o. - * - * This interface is built on top of libusb, which allegedly works under - * Linux, *BSD and Mac OS/X. http://libusb.sourceforge.net - */ - -%include <stl.i> // pick up string stuff - - -%{ -#include <usrp/usrp_prims.h> -#include <stddef.h> // ptrdiff_t -%} - - -enum usrp_load_status_t { ULS_ERROR = 0, ULS_OK, ULS_ALREADY_LOADED }; - - -/*! - * \brief initialize libusb; probe busses and devices. - * Safe to call more than once. - */ -void usrp_one_time_init (libusb_context **ctx = NULL); - -void usrp_rescan (); - -/*! - * \brief locate Nth (zero based) USRP device in system. - * Return pointer or 0 if not found. - * - * The following kinds of devices are considered USRPs: - * - * unconfigured USRP (no firwmare loaded) - * configured USRP (firmware loaded) - * unconfigured Cypress FX2 (only if fx2_ok_p is true) - */ -libusb_device *usrp_find_device (int nth, bool fx2_ok_p = false, libusb_context *ctx = NULL); - -bool usrp_usrp_p (libusb_device *q); //< is this a USRP -bool usrp_usrp0_p (libusb_device *q); //< is this a USRP Rev 0 -bool usrp_usrp1_p (libusb_device *q); //< is this a USRP Rev 1 -bool usrp_usrp2_p (libusb_device *q); //< is this a USRP Rev 2 -int usrp_hw_rev (libusb_device *q); //< return h/w rev code -bool usrp_fx2_p (libusb_device *q); //< is this an unconfigured Cypress FX2 - -bool usrp_unconfigured_usrp_p (libusb_device *q); //< some kind of unconfigured USRP -bool usrp_configured_usrp_p (libusb_device *q); //< some kind of configured USRP - -/*! - * \brief given a libusb_device return an instance of the appropriate libusb_device_handle - * - * These routines claim the specified interface and select the - * correct alternate interface. (USB nomenclature is totally screwed!) - * - * If interface can't be opened, or is already claimed by some other - * process, 0 is returned. - */ -libusb_device_handle *usrp_open_cmd_interface (libusb_device *dev); -libusb_device_handle *usrp_open_rx_interface (libusb_device *dev); -libusb_device_handle *usrp_open_tx_interface (libusb_device *dev); - -/*! - * \brief close interface. - */ -bool usrp_close_interface (libusb_device_handle *udh); - -/*! - * \brief load intel hex format file into USRP/Cypress FX2 (8051). - * - * The filename extension is typically *.ihx - * - * Note that loading firmware may cause the device to renumerate. I.e., - * change its configuration, invalidating the current device handle. - */ - -usrp_load_status_t -usrp_load_firmware (libusb_device_handle *udh, const char *filename, bool force); - -/*! - * \brief load intel hex format file into USRP FX2 (8051). - * - * The filename extension is typically *.ihx - * - * Note that loading firmware may cause the device to renumerate. I.e., - * change its configuration, invalidating the current device handle. - * If the result is ULS_OK, usrp_load_firmware_nth delays 1 second - * then rescans the busses and devices. - */ -usrp_load_status_t -usrp_load_firmware_nth (int nth, const char *filename, bool force, libusb_context *ctx = NULL); - -/*! - * \brief load fpga configuration bitstream - */ -usrp_load_status_t -usrp_load_fpga (libusb_device_handle *udh, const char *filename, bool force); - -/*! - * \brief load the regular firmware and fpga bitstream in the Nth USRP. - * - * This is the normal starting point... - */ -bool usrp_load_standard_bits (int nth, bool force); - - -%include <fpga_regs_common.h> -%include <fpga_regs_standard.h> - - -bool usrp_write_fpga_reg (libusb_device_handle *udh, int reg, int value); - -%inline %{ - -int -usrp_read_fpga_reg (libusb_device_handle *udh, int reg) -{ - int value; - bool ok = usrp_read_fpga_reg (udh, reg, &value); - if (ok) - return value; - else - return -999; -} - -%} - -bool usrp_set_fpga_reset (libusb_device_handle *udh, bool on); -bool usrp_set_fpga_tx_enable (libusb_device_handle *udh, bool on); -bool usrp_set_fpga_rx_enable (libusb_device_handle *udh, bool on); -bool usrp_set_fpga_tx_reset (libusb_device_handle *udh, bool on); -bool usrp_set_fpga_rx_reset (libusb_device_handle *udh, bool on); -bool usrp_set_led (libusb_device_handle *udh, int which, bool on); - -bool usrp_check_rx_overrun (libusb_device_handle *udh, bool *overrun_p); -bool usrp_check_tx_underrun (libusb_device_handle *udh, bool *underrun_p); - -// i2c_read and i2c_write are limited to a maximum len of 64 bytes. - -bool usrp_i2c_write (libusb_device_handle *udh, int i2c_addr, - void *buf, int len); - -bool usrp_i2c_read (libusb_device_handle *udh, int i2c_addr, - void *buf, int len); - -// spi_read and spi_write are limited to a maximum of 64 bytes -// See usrp_spi_defs.h for more info - -bool usrp_spi_write (libusb_device_handle *udh, - int optional_header, int enables, int format, - unsigned char *buf, int len); - -bool usrp_spi_read (libusb_device_handle *udh, - int optional_header, int enables, int format, - unsigned char *buf, int len); - - -bool usrp_9862_write (libusb_device_handle *udh, - int which_codec, // [0, 1] - int regno, // [0, 63] - int value); // [0, 255] - -%inline %{ - -int -usrp_9862_read (libusb_device_handle *udh, int which_codec, int reg) -{ - unsigned char value; - bool ok = usrp_9862_read (udh, which_codec, reg, &value); - if (ok) - return value; - else - return -999; -} - -%} - -%inline %{ - -bool -usrp_eeprom_write (libusb_device_handle *udh, int i2c_addr, - int eeprom_offset, const std::string buf) -{ - return usrp_eeprom_write (udh, i2c_addr, eeprom_offset, - buf.data (), buf.size ()); -} - -std::string -usrp_eeprom_read (libusb_device_handle *udh, int i2c_addr, - int eeprom_offset, int len) -{ - if (len <= 0) - return ""; - - char buf[len]; - - if (!usrp_eeprom_read (udh, i2c_addr, eeprom_offset, buf, len)) - return ""; - - return std::string (buf, len); -} - -%} - -bool usrp_write_aux_dac (libusb_device_handle *uhd, int slot, - int which_dac, int value); - -%inline %{ - -int usrp_read_aux_adc (libusb_device_handle *udh, int slot, int which_adc) -{ - int value; - bool ok = usrp_read_aux_adc (udh, slot, which_adc, &value); - if (ok) - return value; - else - return -999; -} - -%} - -/*! - * \brief return a usrp's serial number. - * - * Note that this only works on a configured usrp. - * \returns non-zero length string iff successful. - */ -std::string usrp_serial_number(libusb_device_handle *udh); - -/*! - * \brief usrp daughterboard id to name mapping - */ -const std::string usrp_dbid_to_string (int dbid); - -%inline %{ -#include "../../firmware/include/fpga_regs_common.h" -#include "../../firmware/include/fpga_regs_standard.h" -%} diff --git a/usrp/host/swig/util.py b/usrp/host/swig/util.py deleted file mode 100644 index 089bcaaac..000000000 --- a/usrp/host/swig/util.py +++ /dev/null @@ -1,95 +0,0 @@ -# utilities - -from usrp_prims import * - -def setup (which_board = 0): - if not usrp_load_standard_bits (which_board, False): - raise RuntimeError, "usrp_load_standard_bits" - dev = usrp_find_device (which_board) - if not dev: - raise RuntimeError, "usrp_find_device" - u = usrp_open_cmd_interface (dev) - if not u: - raise RuntimeError, "usrp_open_cmd_interface" - - # FIXME setup high speed paths, Aux ADC Clock, ... - - # usrp_9862_write (u, 0, 35, 0x1) # aux ADC clock = CLK/4 - # usrp_9862_write (u, 1, 35, 0x1) - - return u - -def write_slot_oe (u, slot, value, mask): - assert 0 <= slot and slot < 4 - return usrp_write_fpga_reg (u, slot + FR_OE_0, - ((mask & 0xffff) << 16) | (value & 0xffff)) - -def write_slot_io (u, slot, value, mask): - assert 0 <= slot and slot < 4 - return usrp_write_fpga_reg (u, slot + FR_IO_0, - ((mask & 0xffff) << 16) | (value & 0xffff)) - - -# ---------------------------------------------------------------- - - -def ramp_aux_dac (u, which_codec, which_dac): - if not (which_codec == 0 or which_codec == 1): - raise AssertionError - if not (which_dac >= 0 and which_dac < 4): - raise AssertionError - try: - if which_dac == 3: # sigma delta output - sigma_delta_loop (u, which_codec) - else: - aux_dac_loop (u, which_codec, which_dac) - except KeyboardInterrupt: - return - -def sigma_delta_loop (u, which_codec): - counter = 0 - while True: - usrp_9862_write (u, which_codec, 43, counter >> 4) - usrp_9862_write (u, which_codec, 42, (counter & 0xf) << 4) - # counter += 1 FIXME - counter += 4 - if counter > 0xfff: - counter = 0 - -def aux_dac_loop (u, which_codec, which_dac): - reg = 36 + which_dac # Aux DAC A,B,C - counter = 0 - while True: - usrp_9862_write (u, which_codec, reg, counter) - counter += 1 - if counter > 0xff: - counter = 0 - - -def read_aux_adc_loop (u, slot, which_adc): - while True: - v = usrp_read_aux_adc (u, slot, which_adc) - print "%3d %5.3f" % (v, v * 3.3 / 1024) - -def ramp_io_port (u, slot): - counter = 0 - try: - while True: - write_slot_io (u, slot, counter, 0xffff) - counter += 1 - if counter > 0xffff: - counter = 0 - except KeyboardInterrupt: - return - -def walk_io_port (u, slot): - bit = 1 - try: - while True: - write_slot_io (u, slot, bit, 0xffff) - bit = (bit << 1) & 0xffff - if bit == 0: - bit = 1 - except KeyboardInterrupt: - return - diff --git a/usrp/usrp.inf b/usrp/usrp.inf deleted file mode 100644 index b612d1e37..000000000 --- a/usrp/usrp.inf +++ /dev/null @@ -1,91 +0,0 @@ -[Version] -Signature = "$Chicago$" -provider = %manufacturer% -DriverVer = 03/09/2005,0.1.10.1 -CatalogFile = usrp.cat - -Class = LibUsbDevices -ClassGUID = {EB781AAF-9C70-4523-A5DF-642A87ECA567} - -[ClassInstall] -AddReg=ClassInstall.AddReg - -[ClassInstall32] -AddReg=ClassInstall.AddReg - -[ClassInstall.AddReg] -HKR,,,,"LibUSB-Win32 Devices" -HKR,,Icon,,"-20" - -[Manufacturer] -%manufacturer%=Devices - -;-------------------------------------------------------------------------- -; Files -;-------------------------------------------------------------------------- - -[SourceDisksNames] -1 = "Libusb-Win32 Driver Installation Disk",, - -[SourceDisksFiles] -libusb0.sys = 1,, -libusb0.dll = 1,, - -[DestinationDirs] -LIBUSB.Files.Sys = 10,System32\Drivers -LIBUSB.Files.Dll = 10,System32 - -[LIBUSB.Files.Sys] -libusb0.sys - -[LIBUSB.Files.Dll] -libusb0.dll - -;-------------------------------------------------------------------------- -; Device driver -;-------------------------------------------------------------------------- - -[LIBUSB_DEV] -CopyFiles = LIBUSB.Files.Sys, LIBUSB.Files.Dll -AddReg = LIBUSB_DEV.AddReg - -[LIBUSB_DEV.NT] -CopyFiles = LIBUSB.Files.Sys, LIBUSB.Files.Dll - -[LIBUSB_DEV.HW] -DelReg = LIBUSB_DEV.DelReg.HW - -[LIBUSB_DEV.NT.HW] -DelReg = LIBUSB_DEV.DelReg.HW - -[LIBUSB_DEV.NT.Services] -AddService = libusb0, 0x00000002, LIBUSB.AddService - -[LIBUSB_DEV.AddReg] -HKR,,DevLoader,,*ntkern -HKR,,NTMPDriver,,libusb0.sys - -[LIBUSB_DEV.DelReg.HW] -HKR,,"LowerFilters" - -;-------------------------------------------------------------------------- -; Services -;-------------------------------------------------------------------------- - -[LIBUSB.AddService] -DisplayName = "LibUsb-Win32 - Kernel Driver 03/09/2005, 0.1.10.1" -ServiceType = 1 -StartType = 3 -ErrorControl = 0 -ServiceBinary = %12%\libusb0.sys - -;-------------------------------------------------------------------------- -; Devices -;-------------------------------------------------------------------------- - -[Devices] -"USRP filter"=LIBUSB_DEV, USB\VID_fffe&PID_0002 - -[Strings] -manufacturer = "GNU Radio folks" - diff --git a/usrp/usrp.iss.in b/usrp/usrp.iss.in deleted file mode 100644 index e1257d82f..000000000 --- a/usrp/usrp.iss.in +++ /dev/null @@ -1,69 +0,0 @@ -; -; Copyright 2003 Free Software Foundation, Inc. -; -; This file is part of GNU Radio -; -; GNU Radio is free software; you can redistribute it and/or modify -; it under the terms of the GNU General Public License as published by -; the Free Software Foundation; either version 3, or (at your option) -; any later version. -; -; GNU Radio is distributed in the hope that it will be useful, -; but WITHOUT ANY WARRANTY; without even the implied warranty of -; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -; GNU General Public License for more details. -; -; You should have received a copy of the GNU General Public License -; along with GNU Radio; see the file COPYING. If not, write to -; the Free Software Foundation, Inc., 51 Franklin Street, -; Boston, MA 02110-1301, USA. -; - -; Requirements: Inno Setup (http://www.jrsoftware.org/isdl.php) -; -; To compile this script do the following: -; - copy libusb's driver (libusb0.sys, libusb0.dll) to this folder -; - copy the USRP filter .inf file to this folder -; - copy the USRP .exe and .dll files to this folder -; - open this scipt with Inno Setup -; - compile and run - -[Setup] -AppName=USRP -AppVerName=USRP @VERSION@ -AppPublisher=GNU Radio folks -AppPublisherURL=http://www.gnu.org/software/gnuradio/ -AppVersion=@VERSION@ -DefaultDirName={pf}\Usrp -DefaultGroupName=Usrp -Compression=lzma -SolidCompression=yes -; Win98 or higher -MinVersion=4,5 -PrivilegesRequired=admin -LicenseFile="COPYING_GPL.txt" - -[Files] -; copy the file to the App folder -Source: "*.sys"; DestDir: "{app}\driver" -;Source: "*.cat"; DestDir: "{app}\driver" -Source: "*.dll"; DestDir: "{app}\driver" -Source: "usrp.inf"; DestDir: "{app}\driver" - -; also copy the DLL to the system folders so that rundll32.exe will find it -Source: "*.dll"; DestDir: "{win}\system32"; FLags: replacesameversion restartreplace - -Source: "COPYING_GPL.txt"; DestDir: "{app}" -Source: "README.txt"; DestDir: "{app}"; Flags: isreadme - -Source: "*.exe"; DestDir: "{app}" -Source: "*.ihx"; DestDir: "{app}\rev2" -Source: "*.rbf"; DestDir: "{app}\rev2" - -[Icons] -Name: "{group}\Uninstall TestDrivers"; Filename: "{uninstallexe}" - -[Run] -; invoke libusb's DLL to install the .inf file -Filename: "rundll32"; Parameters: "libusb0.dll,usb_install_driver_np_rundll {app}\driver\usrp.inf"; StatusMsg: "Installing driver (this may take a few seconds) ..." - diff --git a/usrp/usrp.pc.in b/usrp/usrp.pc.in deleted file mode 100644 index 3c30de622..000000000 --- a/usrp/usrp.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: usrp -Description: USRP Client Side C++ interface -Requires: @LIBUSB_PKG_CONFIG_NAME@ -Version: @LIBVER@ -Libs: -L${libdir} -lusrp -Cflags: -I${includedir} |