1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-06-26 15:03:14 +00:00

Added optional support for Sparkfun SiGe GN3S USB GPS RF sampler:

- Added a pre-compiled custom GN3S firmware.
- Added a fully-compliant GNU Radio source block for GN3S USB dongle. It can be used also from GNU Radio companion and from Python applications.
- Added a new GN3S_Signal_Source block. It is possible to disable the GN3S signal source compilation. See README.

git-svn-id: https://svn.code.sf.net/p/gnss-sdr/code/trunk@217 64b25241-fba3-4117-9849-534c7e92360d
This commit is contained in:
Javier Arribas 2012-07-30 15:46:07 +00:00
parent 721004b838
commit b849b20a8c
137 changed files with 45120 additions and 4 deletions

27
README
View File

@ -91,6 +91,31 @@ $ sudo apt-get install subversion
$ svn co http://gnss-sdr.svn.sourceforge.net/svnroot/gnss-sdr gnss-sdr $ svn co http://gnss-sdr.svn.sourceforge.net/svnroot/gnss-sdr gnss-sdr
* Build SparkFun SiGe GN3S V2 Custom firmware and driver (OPTIONAL)
- Go to GR-GN3S root directory, compile and install the driver:
(read the gnss-sdr/trunk/drivers/gr-gn3s/README for more information)
$ cd gnss-sdr/trunk/drivers/gr-gn3s
$ cd build
$ cmake ../
$ make
$ sudo make install
$ sudo ldconfig
Set the envirnoment variable GN3S_DRIVER=1 in order to enable the GN3S_Signal_Source in GNSS-SDR (OPTIONAL)
export GN3S_DRIVER=1
In order to gain access to USB ports, gnss-sdr should be used as root.
In addition, the driver requires access to the GN3S firmware binary file.
It should be available in the same path where the application is called.
GNSS-SDR comes with a pre-compiled custom GN3S firmware available at gnss-sdr/firmware/GN3S_v2/bin/gn3s_firmware.ihx.
Please copy this file to the application path. The GNSS-SDR default path is gnss-sdr/trunk/install
(in order to disable the GN3S_Signal_Source compilation, you should remove the GN3S_DRIVER variable and build again GNSS-SDR)
* Build GNSS-SDR * Build GNSS-SDR
- Go to GNSS-SDR's root directory and compile the program: - Go to GNSS-SDR's root directory and compile the program:
@ -113,7 +138,7 @@ NOTE: Currently the GCC toolchain is broken. We are working towards the use of L
* If you have still not installed Apple's Developer Tools Xcode, do it now from http://developer.apple.com/technologies/tools/ (it's free) * If you have still not installed Apple's Developer Tools Xcode, do it now from http://developer.apple.com/technologies/tools/ (it's free)
* Install Macports from http://www.macports.org/install.php We recommend to install directly the ÒdmgÓ disk images for Snow Leopart. GNSS-SDR has not been tested with Leopard or Tiger. * Install Macports from http://www.macports.org/install.php We recommend to install directly the <EFBFBD>dmg<EFBFBD> disk images for Snow Leopart. GNSS-SDR has not been tested with Leopard or Tiger.
* Install some tools: * Install some tools:

View File

@ -0,0 +1,436 @@
; Default configuration file
; You can define your own receiver and invoke it by doing
; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf
;
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
GNSS-SDR.internal_fs_hz=2000000
;######### CONTROL_THREAD CONFIG ############
ControlThread.wait_for_flowgraph=false
;######### SIGNAL_SOURCE CONFIG ############
;#implementation: Use [File_Signal_Source] or [UHD_Signal_Source] or [GN3S_Signal_Source] (experimental)
;#Notes for GN3S source:
; - The front-end sampling frequency is fixed to 8.1838 MSPS (8183800 Hz).
; - The baseband signal is shifted to an IF of 38400 Hz. It should be corrected with the signal conditioner block
SignalSource.implementation=GN3S_Signal_Source
;#filename: path to file with the captured GNSS signal samples to be processed
;SignalSource.filename=../data/my_capture.dat
;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version.
SignalSource.item_type=gr_complex
;#sampling_frequency: Original Signal sampling frequency in [Hz]
SignalSource.sampling_frequency=8183800
;#freq: RF front-end center frequency in [Hz]
SignalSource.freq=1575420000
;#gain: Front-end Gain in [dB]
SignalSource.gain=60
;#subdevice: UHD subdevice specification (for USRP1 use A:0 or B:0)
SignalSource.subdevice=B:0
;#samples: Number of samples to be processed. Notice that 0 indicates the entire file.
SignalSource.samples=0
;#repeat: Repeat the processing file. Disable this option in this version
SignalSource.repeat=false
;#dump: Dump the Signal source data to a file. Disable this option in this version
SignalSource.dump=false
SignalSource.dump_filename=../data/signal_source.dat
;#enable_throttle_control: Enabling this option tells the signal source to keep the delay between samples in post processing.
; it helps to not overload the CPU, but the processing time will be longer.
SignalSource.enable_throttle_control=false
;######### SIGNAL_CONDITIONER CONFIG ############
;## It holds blocks to change data type, filter and resample input data.
;#implementation: Use [Pass_Through] or [Signal_Conditioner]
;#[Pass_Through] disables this block and the [DataTypeAdapter], [InputFilter] and [Resampler] blocks
;#[Signal_Conditioner] enables this block. Then you have to configure [DataTypeAdapter], [InputFilter] and [Resampler] blocks
SignalConditioner.implementation=Signal_Conditioner
;SignalConditioner.implementation=Pass_Through
;######### DATA_TYPE_ADAPTER CONFIG ############
;## Changes the type of input data. Please disable it in this version.
;#implementation: [Pass_Through] disables this block
DataTypeAdapter.implementation=Pass_Through
;######### INPUT_FILTER CONFIG ############
;## Filter the input data. Can be combined with frequency translation for IF signals
;#implementation: Use [Pass_Through] or [Fir_Filter] or [Freq_Xlating_Fir_Filter]
;#[Pass_Through] disables this block
;#[Fir_Filter] enables a FIR Filter
;#[Freq_Xlating_Fir_Filter] enables FIR filter and a composite frequency translation that shifts IF down to zero Hz.
;InputFilter.implementation=Fir_Filter
InputFilter.implementation=Freq_Xlating_Fir_Filter
;InputFilter.implementation=Pass_Through
;#dump: Dump the filtered data to a file.
InputFilter.dump=false
;#dump_filename: Log path and filename.
InputFilter.dump_filename=../data/input_filter.dat
;#The following options are used in the filter design of Fir_Filter and Freq_Xlating_Fir_Filter implementation.
;#These options are based on parameters of gnuradio's function: gr_remez.
;#These function calculates the optimal (in the Chebyshev/minimax sense) FIR filter inpulse reponse given a set of band edges, the desired reponse on those bands, and the weight given to the error in those bands.
;#input_item_type: Type and resolution for input signal samples. Use only gr_complex in this version.
InputFilter.input_item_type=gr_complex
;#outut_item_type: Type and resolution for output filtered signal samples. Use only gr_complex in this version.
InputFilter.output_item_type=gr_complex
;#taps_item_type: Type and resolution for the taps of the filter. Use only float in this version.
InputFilter.taps_item_type=float
;#number_of_taps: Number of taps in the filter. Increasing this parameter increases the processing time
InputFilter.number_of_taps=5
;#number_of _bands: Number of frequency bands in the filter.
InputFilter.number_of_bands=2
;#bands: frequency at the band edges [ b1 e1 b2 e2 b3 e3 ...].
;#Frequency is in the range [0, 1], with 1 being the Nyquist frequency (Fs/2)
;#The number of band_begin and band_end elements must match the number of bands
InputFilter.band1_begin=0.0
InputFilter.band1_end=0.45
InputFilter.band2_begin=0.55
InputFilter.band2_end=1.0
;#ampl: desired amplitude at the band edges [ a(b1) a(e1) a(b2) a(e2) ...].
;#The number of ampl_begin and ampl_end elements must match the number of bands
InputFilter.ampl1_begin=1.0
InputFilter.ampl1_end=1.0
InputFilter.ampl2_begin=0.0
InputFilter.ampl2_end=0.0
;#band_error: weighting applied to each band (usually 1).
;#The number of band_error elements must match the number of bands
InputFilter.band1_error=1.0
InputFilter.band2_error=1.0
;#filter_type: one of "bandpass", "hilbert" or "differentiator"
InputFilter.filter_type=bandpass
;#grid_density: determines how accurately the filter will be constructed.
;The minimum value is 16; higher values are slower to compute the filter.
InputFilter.grid_density=16
;#The following options are used only in Freq_Xlating_Fir_Filter implementation.
;#InputFilter.IF is the intermediate frequency (in Hz) shifted down to zero Hz
InputFilter.sampling_frequency=8183800
InputFilter.IF=38400
;######### RESAMPLER CONFIG ############
;## Resamples the input data.
;#implementation: Use [Pass_Through] or [Direct_Resampler]
;#[Pass_Through] disables this block
;#[Direct_Resampler] enables a resampler that implements a nearest neigbourhood interpolation
Resampler.implementation=Direct_Resampler
;Resampler.implementation=Pass_Through
;#dump: Dump the resamplered data to a file.
Resampler.dump=false
;#dump_filename: Log path and filename.
Resampler.dump_filename=../data/resampler.dat
;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version.
Resampler.item_type=gr_complex
;#sample_freq_in: the sample frequency of the input signal
Resampler.sample_freq_in=8183800
;#sample_freq_out: the desired sample frequency of the output signal
Resampler.sample_freq_out=2000000
;######### CHANNELS GLOBAL CONFIG ############
;#count: Number of available satellite channels.
Channels.count=4
;#in_acquisition: Number of channels simultaneously acquiring
Channels.in_acquisition=1
;######### CHANNEL 0 CONFIG ############
;#system: GPS, GLONASS, GALILEO, SBAS or COMPASS
;#if the option is disabled by default is assigned GPS
Channel0.system=GPS
;#signal:
;# "1C" GPS L1 C/A
;# "1P" GPS L1 P
;# "1W" GPS L1 Z-tracking and similar (AS on)
;# "1Y" GPS L1 Y
;# "1M" GPS L1 M
;# "1N" GPS L1 codeless
;# "2C" GPS L2 C/A
;# "2D" GPS L2 L1(C/A)+(P2-P1) semi-codeless
;# "2S" GPS L2 L2C (M)
;# "2L" GPS L2 L2C (L)
;# "2X" GPS L2 L2C (M+L)
;# "2P" GPS L2 P
;# "2W" GPS L2 Z-tracking and similar (AS on)
;# "2Y" GPS L2 Y
;# "2M" GPS GPS L2 M
;# "2N" GPS L2 codeless
;# "5I" GPS L5 I
;# "5Q" GPS L5 Q
;# "5X" GPS L5 I+Q
;# "1C" GLONASS G1 C/A
;# "1P" GLONASS G1 P
;# "2C" GLONASS G2 C/A (Glonass M)
;# "2P" GLONASS G2 P
;# "1A" GALILEO E1 A (PRS)
;# "1B" GALILEO E1 B (I/NAV OS/CS/SoL)
;# "1C" GALILEO E1 C (no data)
;# "1X" GALILEO E1 B+C
;# "1Z" GALILEO E1 A+B+C
;# "5I" GALILEO E5a I (F/NAV OS)
;# "5Q" GALILEO E5a Q (no data)
;# "5X" GALILEO E5a I+Q
;# "7I" GALILEO E5b I
;# "7Q" GALILEO E5b Q
;# "7X" GALILEO E5b I+Q
;# "8I" GALILEO E5 I
;# "8Q" GALILEO E5 Q
;# "8X" GALILEO E5 I+Q
;# "6A" GALILEO E6 A
;# "6B" GALILEO E6 B
;# "6C" GALILEO E6 C
;# "6X" GALILEO E6 B+C
;# "6Z" GALILEO E6 A+B+C
;# "1C" SBAS L1 C/A
;# "5I" SBAS L5 I
;# "5Q" SBAS L5 Q
;# "5X" SBAS L5 I+Q
;# "2I" COMPASS E2 I
;# "2Q" COMPASS E2 Q
;# "2X" COMPASS E2 IQ
;# "7I" COMPASS E5b I
;# "7Q" COMPASS E5b Q
;# "7X" COMPASS E5b IQ
;# "6I" COMPASS E6 I
;# "6Q" COMPASS E6 Q
;# "6X" COMPASS E6 IQ
;#if the option is disabled by default is assigned "1C" GPS L1 C/A
Channel0.signal=1C
;#satellite: Satellite PRN ID for this channel. Disable this option to random search
Channel0.satellite=15
Channel0.repeat_satellite=false
;######### CHANNEL 1 CONFIG ############
Channel1.system=GPS
Channel1.signal=1C
Channel1.satellite=18
Channel1.repeat_satellite=false
;######### CHANNEL 2 CONFIG ############
Channel2.system=GPS
Channel2.signal=1C
Channel2.satellite=16
Channel2.repeat_satellite=false
;######### CHANNEL 3 CONFIG ############
Channel3.system=GPS
Channel3.signal=1C
Channel3.satellite=21
Channel3.repeat_satellite=false
;######### CHANNEL 4 CONFIG ############
Channel4.system=GPS
Channel4.signal=1C
Channel4.satellite=3
Channel4.repeat_satellite=false
;######### CHANNEL 5 CONFIG ############
Channel5.system=GPS
Channel5.signal=1C
;Channel5.satellite=21
;Channel5.repeat_satellite=false
;######### ACQUISITION GLOBAL CONFIG ############
;#dump: Enable or disable the acquisition internal data file logging [true] or [false]
Acquisition.dump=false
;#filename: Log path and filename
Acquisition.dump_filename=./acq_dump.dat
;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version.
Acquisition.item_type=gr_complex
;#if: Signal intermediate frequency in [Hz]
Acquisition.if=0
;#sampled_ms: Signal block duration for the acquisition signal detection [ms]
Acquisition.sampled_ms=1
;######### ACQUISITION CHANNELS CONFIG ######
;######### ACQUISITION CH 0 CONFIG ############
;#implementation: Acquisition algorithm selection for this channel: [GPS_L1_CA_PCPS_Acquisition]
Acquisition0.implementation=GPS_L1_CA_PCPS_Acquisition
;#threshold: Acquisition threshold
Acquisition0.threshold=70
;#doppler_max: Maximum expected Doppler shift [Hz]
Acquisition0.doppler_max=10000
;#doppler_max: Doppler step in the grid search [Hz]
Acquisition0.doppler_step=250
;#repeat_satellite: Use only jointly with the satellte PRN ID option.
;######### ACQUISITION CH 1 CONFIG ############
Acquisition1.implementation=GPS_L1_CA_PCPS_Acquisition
Acquisition1.threshold=70
Acquisition1.doppler_max=10000
Acquisition1.doppler_step=250
;######### ACQUISITION CH 2 CONFIG ############
Acquisition2.implementation=GPS_L1_CA_PCPS_Acquisition
Acquisition2.threshold=70
Acquisition2.doppler_max=10000
Acquisition2.doppler_step=250
;######### ACQUISITION CH 3 CONFIG ############
Acquisition3.implementation=GPS_L1_CA_PCPS_Acquisition
Acquisition3.threshold=70
Acquisition3.doppler_max=10000
Acquisition3.doppler_step=250
;######### ACQUISITION CH 4 CONFIG ############
Acquisition4.implementation=GPS_L1_CA_PCPS_Acquisition
Acquisition4.threshold=70
Acquisition4.doppler_max=10000
Acquisition4.doppler_step=250
;######### ACQUISITION CH 5 CONFIG ############
Acquisition5.implementation=GPS_L1_CA_PCPS_Acquisition
Acquisition5.threshold=70
Acquisition5.doppler_max=10000
Acquisition5.doppler_step=250
;######### ACQUISITION CH 6 CONFIG ############
Acquisition6.implementation=GPS_L1_CA_PCPS_Acquisition
Acquisition6.threshold=70
Acquisition6.doppler_max=10000
Acquisition6.doppler_step=250
;######### ACQUISITION CH 7 CONFIG ############
Acquisition7.implementation=GPS_L1_CA_PCPS_Acquisition
Acquisition7.threshold=70
Acquisition7.doppler_max=10000
Acquisition7.doppler_step=250
;######### ACQUISITION CH 8 CONFIG ############
Acquisition8.implementation=GPS_L1_CA_PCPS_Acquisition
Acquisition8.threshold=70
Acquisition8.doppler_max=10000
Acquisition8.doppler_step=250
;######### TRACKING GLOBAL CONFIG ############
;#implementation: Selected tracking algorithm: [GPS_L1_CA_DLL_PLL_Tracking] or [GPS_L1_CA_DLL_FLL_PLL_Tracking]
Tracking.implementation=GPS_L1_CA_DLL_PLL_Tracking
;#item_type: Type and resolution for each of the signal samples. Use only [gr_complex] in this version.
Tracking.item_type=gr_complex
;#sampling_frequency: Signal Intermediate Frequency in [Hz]
Tracking.if=0
;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false]
Tracking.dump=true
;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number.
Tracking.dump_filename=./tracking_ch_
;#pll_bw_hz: PLL loop filter bandwidth [Hz]
Tracking.pll_bw_hz=50.0;
;#dll_bw_hz: DLL loop filter bandwidth [Hz]
Tracking.dll_bw_hz=4.0;
;#fll_bw_hz: FLL loop filter bandwidth [Hz]
Tracking.fll_bw_hz=10.0;
;#order: PLL/DLL loop filter order [2] or [3]
Tracking.order=3;
;#early_late_space_chips: correlator early-late space [chips]. Use [0.5]
Tracking.early_late_space_chips=0.5;
;######### TELEMETRY DECODER CONFIG ############
;#implementation: Use [GPS_L1_CA_Telemetry_Decoder] for GPS L1 C/A.
TelemetryDecoder.implementation=GPS_L1_CA_Telemetry_Decoder
TelemetryDecoder.dump=false
;######### OBSERVABLES CONFIG ############
;#implementation: Use [GPS_L1_CA_Observables] for GPS L1 C/A.
Observables.implementation=GPS_L1_CA_Observables
;#dump: Enable or disable the Observables internal binary data file logging [true] or [false]
Observables.dump=false
;#dump_filename: Log path and filename.
Observables.dump_filename=./observables.dat
;######### PVT CONFIG ############
;#implementation: Position Velocity and Time (PVT) implementation algorithm: Use [GPS_L1_CA_PVT] in this version.
PVT.implementation=GPS_L1_CA_PVT
;#averaging_depth: Number of PVT observations in the moving average algorithm
PVT.averaging_depth=100
;#flag_average: Enables the PVT averaging between output intervals (arithmetic mean) [true] or [false]
PVT.flag_averaging=true
;#output_rate_ms: Period between two PVT outputs. Notice that the minimum period is equal to the tracking integration time (for GPS CA L1 is 1ms) [ms]
PVT.output_rate_ms=100;
;#display_rate_ms: Position console print (std::out) interval [ms]. Notice that output_rate_ms<=display_rate_ms.
PVT.display_rate_ms=500;
;#dump: Enable or disable the PVT internal binary data file logging [true] or [false]
PVT.dump=false
;#dump_filename: Log path and filename without extension. Notice that PVT will add ".dat" to the binary dump and ".kml" to GoogleEarth dump.
PVT.dump_filename=./PVT
;######### OUTPUT_FILTER CONFIG ############
;# Receiver output filter: Leave this block disabled in this version
OutputFilter.implementation=Null_Sink_Output_Filter
OutputFilter.filename=data/gnss-sdr.dat
OutputFilter.item_type=gr_complex

View File

@ -0,0 +1,138 @@
# Copyright 2011 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.
########################################################################
# Project setup
########################################################################
cmake_minimum_required(VERSION 2.6)
project(gr-gn3s CXX C)
enable_testing()
#select the release build type by default to get optimization flags
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
message(STATUS "Build type not specified: defaulting to release.")
endif(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "")
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)
########################################################################
# Compiler specific setup
########################################################################
if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
#http://gcc.gnu.org/wiki/Visibility
add_definitions(-fvisibility=hidden)
endif()
########################################################################
# Find boost
########################################################################
if(UNIX AND EXISTS "/usr/lib64")
list(APPEND BOOST_LIBRARYDIR "/usr/lib64") #fedora 64-bit fix
endif(UNIX AND EXISTS "/usr/lib64")
set(Boost_ADDITIONAL_VERSIONS
"1.35.0" "1.35" "1.36.0" "1.36" "1.37.0" "1.37" "1.38.0" "1.38" "1.39.0" "1.39"
"1.40.0" "1.40" "1.41.0" "1.41" "1.42.0" "1.42" "1.43.0" "1.43" "1.44.0" "1.44"
"1.45.0" "1.45" "1.46.0" "1.46" "1.47.0" "1.47" "1.48.0" "1.48" "1.49.0" "1.49"
"1.50.0" "1.50" "1.51.0" "1.51" "1.52.0" "1.52" "1.53.0" "1.53" "1.54.0" "1.54"
"1.55.0" "1.55" "1.56.0" "1.56" "1.57.0" "1.57" "1.58.0" "1.58" "1.59.0" "1.59"
"1.60.0" "1.60" "1.61.0" "1.61" "1.62.0" "1.62" "1.63.0" "1.63" "1.64.0" "1.64"
"1.65.0" "1.65" "1.66.0" "1.66" "1.67.0" "1.67" "1.68.0" "1.68" "1.69.0" "1.69"
)
find_package(Boost "1.35")
if(NOT Boost_FOUND)
message(FATAL_ERROR "Boost required to compile gn3s")
endif()
########################################################################
# Install directories
########################################################################
include(GrPlatform) #define LIB_SUFFIX
set(GR_RUNTIME_DIR bin)
set(GR_LIBRARY_DIR lib${LIB_SUFFIX})
set(GR_INCLUDE_DIR include)
set(GR_DATA_DIR share)
set(GR_PKG_DATA_DIR ${GR_DATA_DIR}/${CMAKE_PROJECT_NAME})
set(GR_DOC_DIR ${GR_DATA_DIR}/doc)
set(GR_PKG_DOC_DIR ${GR_DOC_DIR}/${CMAKE_PROJECT_NAME})
set(GR_CONF_DIR etc)
set(GR_PKG_CONF_DIR ${GR_CONF_DIR}/${CMAKE_PROJECT_NAME}/conf.d)
set(GR_LIBEXEC_DIR libexec)
set(GR_PKG_LIBEXEC_DIR ${GR_LIBEXEC_DIR}/${CMAKE_PROJECT_NAME})
set(GRC_BLOCKS_DIR ${GR_PKG_DATA_DIR}/grc/blocks)
########################################################################
# Find gnuradio build dependencies
########################################################################
find_package(Gruel)
find_package(GnuradioCore)
if(NOT GRUEL_FOUND)
message(FATAL_ERROR "Gruel required to compile gn3s")
endif()
if(NOT GNURADIO_CORE_FOUND)
message(FATAL_ERROR "GnuRadio Core required to compile gn3s")
endif()
########################################################################
# Setup the include and linker paths
########################################################################
include_directories(
${CMAKE_SOURCE_DIR}/include
${Boost_INCLUDE_DIRS}
${GRUEL_INCLUDE_DIRS}
${GNURADIO_CORE_INCLUDE_DIRS}
)
link_directories(
${Boost_LIBRARY_DIRS}
${GRUEL_LIBRARY_DIRS}
${GNURADIO_CORE_LIBRARY_DIRS}
)
# Set component parameters
set(GR_GN3S_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include CACHE INTERNAL "" FORCE)
set(GR_GN3S_SWIG_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/swig CACHE INTERNAL "" FORCE)
########################################################################
# Create uninstall target
########################################################################
configure_file(
${CMAKE_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
@ONLY)
add_custom_target(uninstall
${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
)
########################################################################
# Add subdirectories
########################################################################
add_subdirectory(include)
add_subdirectory(lib)
add_subdirectory(swig)
add_subdirectory(python)
add_subdirectory(grc)
#add_subdirectory(apps)
#add_subdirectory(docs)

62
drivers/gr-gn3s/README Normal file
View File

@ -0,0 +1,62 @@
HOW TO BUILD GR-GN3S
----------------------
Source maintainer:
Javier Arribas
jarribas@cttc.es
This document describes how to build the Sparkfun SiGe GN3S V2 GPS Sampler GNU Radio Source USB 2.0 driver.
More information on the device can be found in http://www.sparkfun.com/products/8238
The driver core is based on Gregory W. Hecker driver available in http://github.com/gps-sdr/gps-sdr.
GR-GN3S contains a GNU Radio fully compliant gr-block signal source intended to be used either with GNSS-SDR as a signal source or as
standalone signal source block instantiated from a GNU Radio flowgraph from C++ or using Python (Also includes a gnuradio-companion interface).
It is based on the GNU Radio How-to-make-a-block cmake source v 3.6
Installation in Ubuntu 10.04, 10.10, 11.04 and 11.10
-----------------------------------------------------
1- Install CMake through your OS's package manager or by some other means.
2- Install GNU Radio:
- Downloading, building and installing GNU Radio and all its dependencies is not a simple task. We recommend to use Marcus Leech's build-gnuradio script, which automatically does all the work for you. In a terminal, do:
$ wget http://www.sbrac.org/files/build-gnuradio
$ chmod a+x build-gnuradio
$ ./build-gnuradio
This can take a while (up to two hours to complete, depending on your system), and installs the latest versions of UHD and GNU Radio in your system, including all their dependencies. In case you do not want to use the script and prefer to build and install GNU Radio manually from source, follow instructions in http://gnuradio.org/redmine/projects/gnuradio/wiki/BuildGuide
3- Install Subversion
$ sudo apt-get install subversion
4- Check out the latest version of GNSS-SDR
$ svn co http://gnss-sdr.svn.sourceforge.net/svnroot/gnss-sdr gnss-sdr
5- Build GR-GN3S
- Go to GR-GN3S root directory and compile the driver:
$ cd gnss-sdr/trunk/drivers/gr-gn3s
$ cd build
$ cmake ../
$ make
6- If everything went fine, install the driver as root
$ sudo make install
$ sudo ldconfig
7- Open gnuradio-companion and check the gn3s_source module under the GN3S tab.
In order to gain access to USB ports, gnuradio-companion should be used as root.
In addition, the driver requires access to the GN3S firmware binary file.
It should be available in the same path where the application is called.
GNSS-SDR comes with a pre-compiled custom GN3S firmware available at gnss-sdr/firmware/GN3S_v2/bin/gn3s_firmware.ihx.
Please copy this file to the application path.

View File

@ -0,0 +1,138 @@
# CMAKE_PARSE_ARGUMENTS(<prefix> <options> <one_value_keywords> <multi_value_keywords> args...)
#
# CMAKE_PARSE_ARGUMENTS() is intended to be used in macros or functions for
# parsing the arguments given to that macro or function.
# It processes the arguments and defines a set of variables which hold the
# values of the respective options.
#
# The <options> argument contains all options for the respective macro,
# i.e. keywords which can be used when calling the macro without any value
# following, like e.g. the OPTIONAL keyword of the install() command.
#
# The <one_value_keywords> argument contains all keywords for this macro
# which are followed by one value, like e.g. DESTINATION keyword of the
# install() command.
#
# The <multi_value_keywords> argument contains all keywords for this macro
# which can be followed by more than one value, like e.g. the TARGETS or
# FILES keywords of the install() command.
#
# When done, CMAKE_PARSE_ARGUMENTS() will have defined for each of the
# keywords listed in <options>, <one_value_keywords> and
# <multi_value_keywords> a variable composed of the given <prefix>
# followed by "_" and the name of the respective keyword.
# These variables will then hold the respective value from the argument list.
# For the <options> keywords this will be TRUE or FALSE.
#
# All remaining arguments are collected in a variable
# <prefix>_UNPARSED_ARGUMENTS, this can be checked afterwards to see whether
# your macro was called with unrecognized parameters.
#
# As an example here a my_install() macro, which takes similar arguments as the
# real install() command:
#
# function(MY_INSTALL)
# set(options OPTIONAL FAST)
# set(oneValueArgs DESTINATION RENAME)
# set(multiValueArgs TARGETS CONFIGURATIONS)
# cmake_parse_arguments(MY_INSTALL "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
# ...
#
# Assume my_install() has been called like this:
# my_install(TARGETS foo bar DESTINATION bin OPTIONAL blub)
#
# After the cmake_parse_arguments() call the macro will have set the following
# variables:
# MY_INSTALL_OPTIONAL = TRUE
# MY_INSTALL_FAST = FALSE (this option was not used when calling my_install()
# MY_INSTALL_DESTINATION = "bin"
# MY_INSTALL_RENAME = "" (was not used)
# MY_INSTALL_TARGETS = "foo;bar"
# MY_INSTALL_CONFIGURATIONS = "" (was not used)
# MY_INSTALL_UNPARSED_ARGUMENTS = "blub" (no value expected after "OPTIONAL"
#
# You can the continue and process these variables.
#
# Keywords terminate lists of values, e.g. if directly after a one_value_keyword
# another recognized keyword follows, this is interpreted as the beginning of
# the new option.
# E.g. my_install(TARGETS foo DESTINATION OPTIONAL) would result in
# MY_INSTALL_DESTINATION set to "OPTIONAL", but MY_INSTALL_DESTINATION would
# be empty and MY_INSTALL_OPTIONAL would be set to TRUE therefor.
#=============================================================================
# Copyright 2010 Alexander Neundorf <neundorf@kde.org>
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
if(__CMAKE_PARSE_ARGUMENTS_INCLUDED)
return()
endif()
set(__CMAKE_PARSE_ARGUMENTS_INCLUDED TRUE)
function(CMAKE_PARSE_ARGUMENTS prefix _optionNames _singleArgNames _multiArgNames)
# first set all result variables to empty/FALSE
foreach(arg_name ${_singleArgNames} ${_multiArgNames})
set(${prefix}_${arg_name})
endforeach(arg_name)
foreach(option ${_optionNames})
set(${prefix}_${option} FALSE)
endforeach(option)
set(${prefix}_UNPARSED_ARGUMENTS)
set(insideValues FALSE)
set(currentArgName)
# now iterate over all arguments and fill the result variables
foreach(currentArg ${ARGN})
list(FIND _optionNames "${currentArg}" optionIndex) # ... then this marks the end of the arguments belonging to this keyword
list(FIND _singleArgNames "${currentArg}" singleArgIndex) # ... then this marks the end of the arguments belonging to this keyword
list(FIND _multiArgNames "${currentArg}" multiArgIndex) # ... then this marks the end of the arguments belonging to this keyword
if(${optionIndex} EQUAL -1 AND ${singleArgIndex} EQUAL -1 AND ${multiArgIndex} EQUAL -1)
if(insideValues)
if("${insideValues}" STREQUAL "SINGLE")
set(${prefix}_${currentArgName} ${currentArg})
set(insideValues FALSE)
elseif("${insideValues}" STREQUAL "MULTI")
list(APPEND ${prefix}_${currentArgName} ${currentArg})
endif()
else(insideValues)
list(APPEND ${prefix}_UNPARSED_ARGUMENTS ${currentArg})
endif(insideValues)
else()
if(NOT ${optionIndex} EQUAL -1)
set(${prefix}_${currentArg} TRUE)
set(insideValues FALSE)
elseif(NOT ${singleArgIndex} EQUAL -1)
set(currentArgName ${currentArg})
set(${prefix}_${currentArgName})
set(insideValues "SINGLE")
elseif(NOT ${multiArgIndex} EQUAL -1)
set(currentArgName ${currentArg})
set(${prefix}_${currentArgName})
set(insideValues "MULTI")
endif()
endif()
endforeach(currentArg)
# propagate the result variables to the caller:
foreach(arg_name ${_singleArgNames} ${_multiArgNames} ${_optionNames})
set(${prefix}_${arg_name} ${${prefix}_${arg_name}} PARENT_SCOPE)
endforeach(arg_name)
set(${prefix}_UNPARSED_ARGUMENTS ${${prefix}_UNPARSED_ARGUMENTS} PARENT_SCOPE)
endfunction(CMAKE_PARSE_ARGUMENTS _options _singleArgs _multiArgs)

View File

@ -0,0 +1,26 @@
INCLUDE(FindPkgConfig)
PKG_CHECK_MODULES(PC_GNURADIO_CORE gnuradio-core)
FIND_PATH(
GNURADIO_CORE_INCLUDE_DIRS
NAMES gr_random.h
HINTS $ENV{GNURADIO_CORE_DIR}/include/gnuradio
${PC_GNURADIO_CORE_INCLUDEDIR}
PATHS /usr/local/include/gnuradio
/usr/include/gnuradio
)
FIND_LIBRARY(
GNURADIO_CORE_LIBRARIES
NAMES gnuradio-core
HINTS $ENV{GNURADIO_CORE_DIR}/lib
${PC_GNURADIO_CORE_LIBDIR}
PATHS /usr/local/lib
/usr/local/lib64
/usr/lib
/usr/lib64
)
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GNURADIO_CORE DEFAULT_MSG GNURADIO_CORE_LIBRARIES GNURADIO_CORE_INCLUDE_DIRS)
MARK_AS_ADVANCED(GNURADIO_CORE_LIBRARIES GNURADIO_CORE_INCLUDE_DIRS)

View File

@ -0,0 +1,26 @@
INCLUDE(FindPkgConfig)
PKG_CHECK_MODULES(PC_GRUEL gruel)
FIND_PATH(
GRUEL_INCLUDE_DIRS
NAMES gruel/attributes.h
HINTS $ENV{GRUEL_DIR}/include
${PC_GRUEL_INCLUDEDIR}
PATHS /usr/local/include
/usr/include
)
FIND_LIBRARY(
GRUEL_LIBRARIES
NAMES gruel
HINTS $ENV{GRUEL_DIR}/lib
${PC_GRUEL_LIBDIR}
PATHS /usr/local/lib
/usr/local/lib64
/usr/lib
/usr/lib64
)
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GRUEL DEFAULT_MSG GRUEL_LIBRARIES GRUEL_INCLUDE_DIRS)
MARK_AS_ADVANCED(GRUEL_LIBRARIES GRUEL_INCLUDE_DIRS)

View File

@ -0,0 +1,210 @@
# Copyright 2010-2011 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.
if(DEFINED __INCLUDED_GR_MISC_UTILS_CMAKE)
return()
endif()
set(__INCLUDED_GR_MISC_UTILS_CMAKE TRUE)
########################################################################
# Set global variable macro.
# Used for subdirectories to export settings.
# Example: include and library paths.
########################################################################
function(GR_SET_GLOBAL var)
set(${var} ${ARGN} CACHE INTERNAL "" FORCE)
endfunction(GR_SET_GLOBAL)
########################################################################
# Set the pre-processor definition if the condition is true.
# - def the pre-processor definition to set and condition name
########################################################################
function(GR_ADD_COND_DEF def)
if(${def})
add_definitions(-D${def})
endif(${def})
endfunction(GR_ADD_COND_DEF)
########################################################################
# Check for a header and conditionally set a compile define.
# - hdr the relative path to the header file
# - def the pre-processor definition to set
########################################################################
function(GR_CHECK_HDR_N_DEF hdr def)
include(CheckIncludeFileCXX)
CHECK_INCLUDE_FILE_CXX(${hdr} ${def})
GR_ADD_COND_DEF(${def})
endfunction(GR_CHECK_HDR_N_DEF)
########################################################################
# Include subdirectory macro.
# Sets the CMake directory variables,
# includes the subdirectory CMakeLists.txt,
# resets the CMake directory variables.
#
# This macro includes subdirectories rather than adding them
# so that the subdirectory can affect variables in the level above.
# This provides a work-around for the lack of convenience libraries.
# This way a subdirectory can append to the list of library sources.
########################################################################
macro(GR_INCLUDE_SUBDIRECTORY subdir)
#insert the current directories on the front of the list
list(INSERT _cmake_source_dirs 0 ${CMAKE_CURRENT_SOURCE_DIR})
list(INSERT _cmake_binary_dirs 0 ${CMAKE_CURRENT_BINARY_DIR})
#set the current directories to the names of the subdirs
set(CMAKE_CURRENT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/${subdir})
set(CMAKE_CURRENT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${subdir})
#include the subdirectory CMakeLists to run it
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
include(${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt)
#reset the value of the current directories
list(GET _cmake_source_dirs 0 CMAKE_CURRENT_SOURCE_DIR)
list(GET _cmake_binary_dirs 0 CMAKE_CURRENT_BINARY_DIR)
#pop the subdir names of the front of the list
list(REMOVE_AT _cmake_source_dirs 0)
list(REMOVE_AT _cmake_binary_dirs 0)
endmacro(GR_INCLUDE_SUBDIRECTORY)
########################################################################
# Check if a compiler flag works and conditionally set a compile define.
# - flag the compiler flag to check for
# - have the variable to set with result
########################################################################
macro(GR_ADD_CXX_COMPILER_FLAG_IF_AVAILABLE flag have)
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG(${flag} ${have})
if(${have})
add_definitions(${flag})
endif(${have})
endmacro(GR_ADD_CXX_COMPILER_FLAG_IF_AVAILABLE)
########################################################################
# Generates the .la libtool file
# This appears to generate libtool files that cannot be used by auto*.
# Usage GR_LIBTOOL(TARGET [target] DESTINATION [dest])
# Notice: there is not COMPONENT option, these will not get distributed.
########################################################################
function(GR_LIBTOOL)
if(NOT DEFINED GENERATE_LIBTOOL)
set(GENERATE_LIBTOOL OFF) #disabled by default
endif()
if(GENERATE_LIBTOOL)
include(CMakeParseArgumentsCopy)
CMAKE_PARSE_ARGUMENTS(GR_LIBTOOL "" "TARGET;DESTINATION" "" ${ARGN})
find_program(LIBTOOL libtool)
if(LIBTOOL)
include(CMakeMacroLibtoolFile)
CREATE_LIBTOOL_FILE(${GR_LIBTOOL_TARGET} /${GR_LIBTOOL_DESTINATION})
endif(LIBTOOL)
endif(GENERATE_LIBTOOL)
endfunction(GR_LIBTOOL)
########################################################################
# Do standard things to the library target
# - set target properties
# - make install rules
# Also handle gnuradio custom naming conventions w/ extras mode.
########################################################################
function(GR_LIBRARY_FOO target)
#parse the arguments for component names
include(CMakeParseArgumentsCopy)
CMAKE_PARSE_ARGUMENTS(GR_LIBRARY "" "RUNTIME_COMPONENT;DEVEL_COMPONENT" "" ${ARGN})
#set additional target properties
set_target_properties(${target} PROPERTIES SOVERSION ${LIBVER})
#install the generated files like so...
install(TARGETS ${target}
LIBRARY DESTINATION ${GR_LIBRARY_DIR} COMPONENT ${GR_LIBRARY_RUNTIME_COMPONENT} # .so/.dylib file
ARCHIVE DESTINATION ${GR_LIBRARY_DIR} COMPONENT ${GR_LIBRARY_DEVEL_COMPONENT} # .lib file
RUNTIME DESTINATION ${GR_RUNTIME_DIR} COMPONENT ${GR_LIBRARY_RUNTIME_COMPONENT} # .dll file
)
#extras mode enabled automatically on linux
if(NOT DEFINED LIBRARY_EXTRAS)
set(LIBRARY_EXTRAS ${LINUX})
endif()
#special extras mode to enable alternative naming conventions
if(LIBRARY_EXTRAS)
#create .la file before changing props
GR_LIBTOOL(TARGET ${target} DESTINATION ${GR_LIBRARY_DIR})
#give the library a special name with ultra-zero soversion
set_target_properties(${target} PROPERTIES LIBRARY_OUTPUT_NAME ${target}-${LIBVER} SOVERSION "0.0.0")
set(target_name lib${target}-${LIBVER}.so.0.0.0)
#custom command to generate symlinks
add_custom_command(
TARGET ${target}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E create_symlink ${target_name} ${CMAKE_CURRENT_BINARY_DIR}/lib${target}.so
COMMAND ${CMAKE_COMMAND} -E create_symlink ${target_name} ${CMAKE_CURRENT_BINARY_DIR}/lib${target}-${LIBVER}.so.0
COMMAND ${CMAKE_COMMAND} -E touch ${target_name} #so the symlinks point to something valid so cmake 2.6 will install
)
#and install the extra symlinks
install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/lib${target}.so
${CMAKE_CURRENT_BINARY_DIR}/lib${target}-${LIBVER}.so.0
DESTINATION ${GR_LIBRARY_DIR} COMPONENT ${GR_LIBRARY_RUNTIME_COMPONENT}
)
endif(LIBRARY_EXTRAS)
endfunction(GR_LIBRARY_FOO)
########################################################################
# Create a dummy custom command that depends on other targets.
# Usage:
# GR_GEN_TARGET_DEPS(unique_name target_deps <target1> <target2> ...)
# ADD_CUSTOM_COMMAND(<the usual args> ${target_deps})
#
# Custom command cant depend on targets, but can depend on executables,
# and executables can depend on targets. So this is the process:
########################################################################
function(GR_GEN_TARGET_DEPS name var)
file(
WRITE ${CMAKE_CURRENT_BINARY_DIR}/${name}.cpp.in
"int main(void){return 0;}\n"
)
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_CURRENT_BINARY_DIR}/${name}.cpp.in
${CMAKE_CURRENT_BINARY_DIR}/${name}.cpp
)
add_executable(${name} ${CMAKE_CURRENT_BINARY_DIR}/${name}.cpp)
if(ARGN)
add_dependencies(${name} ${ARGN})
endif(ARGN)
if(CMAKE_CROSSCOMPILING)
set(${var} "DEPENDS;${name}" PARENT_SCOPE) #cant call command when cross
else()
set(${var} "DEPENDS;${name};COMMAND;${name}" PARENT_SCOPE)
endif()
endfunction(GR_GEN_TARGET_DEPS)

View File

@ -0,0 +1,46 @@
# Copyright 2011 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.
if(DEFINED __INCLUDED_GR_PLATFORM_CMAKE)
return()
endif()
set(__INCLUDED_GR_PLATFORM_CMAKE TRUE)
########################################################################
# Setup additional defines for OS types
########################################################################
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(LINUX TRUE)
endif()
if(LINUX AND EXISTS "/etc/debian_version")
set(DEBIAN TRUE)
endif()
if(LINUX AND EXISTS "/etc/redhat-release")
set(REDHAT TRUE)
endif()
########################################################################
# when the library suffix should be 64 (applies to redhat linux family)
########################################################################
if(NOT DEFINED LIB_SUFFIX AND REDHAT AND CMAKE_SYSTEM_PROCESSOR MATCHES "64$")
set(LIB_SUFFIX 64)
endif()
set(LIB_SUFFIX ${LIB_SUFFIX} CACHE STRING "lib directory suffix")

View File

@ -0,0 +1,227 @@
# Copyright 2010-2011 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.
if(DEFINED __INCLUDED_GR_PYTHON_CMAKE)
return()
endif()
set(__INCLUDED_GR_PYTHON_CMAKE TRUE)
########################################################################
# Setup the python interpreter:
# This allows the user to specify a specific interpreter,
# or finds the interpreter via the built-in cmake module.
########################################################################
#this allows the user to override PYTHON_EXECUTABLE
if(PYTHON_EXECUTABLE)
set(PYTHONINTERP_FOUND TRUE)
#otherwise if not set, try to automatically find it
else(PYTHON_EXECUTABLE)
#use the built-in find script
find_package(PythonInterp)
#and if that fails use the find program routine
if(NOT PYTHONINTERP_FOUND)
find_program(PYTHON_EXECUTABLE NAMES python python2.7 python2.6 python2.5)
if(PYTHON_EXECUTABLE)
set(PYTHONINTERP_FOUND TRUE)
endif(PYTHON_EXECUTABLE)
endif(NOT PYTHONINTERP_FOUND)
endif(PYTHON_EXECUTABLE)
#make the path to the executable appear in the cmake gui
set(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE} CACHE FILEPATH "python interpreter")
#make sure we can use -B with python (introduced in 2.6)
if(PYTHON_EXECUTABLE)
execute_process(
COMMAND ${PYTHON_EXECUTABLE} -B -c ""
OUTPUT_QUIET ERROR_QUIET
RESULT_VARIABLE PYTHON_HAS_DASH_B_RESULT
)
if(PYTHON_HAS_DASH_B_RESULT EQUAL 0)
set(PYTHON_DASH_B "-B")
endif()
endif(PYTHON_EXECUTABLE)
########################################################################
# Check for the existence of a python module:
# - desc a string description of the check
# - mod the name of the module to import
# - cmd an additional command to run
# - have the result variable to set
########################################################################
macro(GR_PYTHON_CHECK_MODULE desc mod cmd have)
message(STATUS "")
message(STATUS "Python checking for ${desc}")
execute_process(
COMMAND ${PYTHON_EXECUTABLE} -c "
#########################################
try: import ${mod}
except: exit(-1)
try: assert ${cmd}
except: exit(-1)
#########################################"
RESULT_VARIABLE ${have}
)
if(${have} EQUAL 0)
message(STATUS "Python checking for ${desc} - found")
set(${have} TRUE)
else(${have} EQUAL 0)
message(STATUS "Python checking for ${desc} - not found")
set(${have} FALSE)
endif(${have} EQUAL 0)
endmacro(GR_PYTHON_CHECK_MODULE)
########################################################################
# Sets the python installation directory GR_PYTHON_DIR
########################################################################
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "
from distutils import sysconfig
print sysconfig.get_python_lib(plat_specific=True, prefix='')
" OUTPUT_VARIABLE GR_PYTHON_DIR OUTPUT_STRIP_TRAILING_WHITESPACE
)
file(TO_CMAKE_PATH ${GR_PYTHON_DIR} GR_PYTHON_DIR)
########################################################################
# Create an always-built target with a unique name
# Usage: GR_UNIQUE_TARGET(<description> <dependencies list>)
########################################################################
function(GR_UNIQUE_TARGET desc)
file(RELATIVE_PATH reldir ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR})
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import re, hashlib
unique = hashlib.md5('${reldir}${ARGN}').hexdigest()[:5]
print(re.sub('\\W', '_', '${desc} ${reldir} ' + unique))"
OUTPUT_VARIABLE _target OUTPUT_STRIP_TRAILING_WHITESPACE)
add_custom_target(${_target} ALL DEPENDS ${ARGN})
endfunction(GR_UNIQUE_TARGET)
########################################################################
# Install python sources (also builds and installs byte-compiled python)
########################################################################
function(GR_PYTHON_INSTALL)
include(CMakeParseArgumentsCopy)
CMAKE_PARSE_ARGUMENTS(GR_PYTHON_INSTALL "" "DESTINATION;COMPONENT" "FILES;PROGRAMS" ${ARGN})
####################################################################
if(GR_PYTHON_INSTALL_FILES)
####################################################################
install(${ARGN}) #installs regular python files
#create a list of all generated files
unset(pysrcfiles)
unset(pycfiles)
unset(pyofiles)
foreach(pyfile ${GR_PYTHON_INSTALL_FILES})
get_filename_component(pyfile ${pyfile} ABSOLUTE)
list(APPEND pysrcfiles ${pyfile})
#determine if this file is in the source or binary directory
file(RELATIVE_PATH source_rel_path ${CMAKE_CURRENT_SOURCE_DIR} ${pyfile})
string(LENGTH "${source_rel_path}" source_rel_path_len)
file(RELATIVE_PATH binary_rel_path ${CMAKE_CURRENT_BINARY_DIR} ${pyfile})
string(LENGTH "${binary_rel_path}" binary_rel_path_len)
#and set the generated path appropriately
if(${source_rel_path_len} GREATER ${binary_rel_path_len})
set(pygenfile ${CMAKE_CURRENT_BINARY_DIR}/${binary_rel_path})
else()
set(pygenfile ${CMAKE_CURRENT_BINARY_DIR}/${source_rel_path})
endif()
list(APPEND pycfiles ${pygenfile}c)
list(APPEND pyofiles ${pygenfile}o)
#ensure generation path exists
get_filename_component(pygen_path ${pygenfile} PATH)
file(MAKE_DIRECTORY ${pygen_path})
endforeach(pyfile)
#the command to generate the pyc files
add_custom_command(
DEPENDS ${pysrcfiles} OUTPUT ${pycfiles}
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_BINARY_DIR}/python_compile_helper.py ${pysrcfiles} ${pycfiles}
)
#the command to generate the pyo files
add_custom_command(
DEPENDS ${pysrcfiles} OUTPUT ${pyofiles}
COMMAND ${PYTHON_EXECUTABLE} -O ${CMAKE_BINARY_DIR}/python_compile_helper.py ${pysrcfiles} ${pyofiles}
)
#create install rule and add generated files to target list
set(python_install_gen_targets ${pycfiles} ${pyofiles})
install(FILES ${python_install_gen_targets}
DESTINATION ${GR_PYTHON_INSTALL_DESTINATION}
COMPONENT ${GR_PYTHON_INSTALL_COMPONENT}
)
####################################################################
elseif(GR_PYTHON_INSTALL_PROGRAMS)
####################################################################
file(TO_NATIVE_PATH ${PYTHON_EXECUTABLE} pyexe_native)
foreach(pyfile ${GR_PYTHON_INSTALL_PROGRAMS})
get_filename_component(pyfile_name ${pyfile} NAME)
get_filename_component(pyfile ${pyfile} ABSOLUTE)
string(REPLACE "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" pyexefile "${pyfile}.exe")
list(APPEND python_install_gen_targets ${pyexefile})
get_filename_component(pyexefile_path ${pyexefile} PATH)
file(MAKE_DIRECTORY ${pyexefile_path})
add_custom_command(
OUTPUT ${pyexefile} DEPENDS ${pyfile}
COMMAND ${PYTHON_EXECUTABLE} -c
\"open('${pyexefile}', 'w').write('\#!${pyexe_native}\\n'+open('${pyfile}').read())\"
COMMENT "Shebangin ${pyfile_name}"
)
#on windows, python files need an extension to execute
get_filename_component(pyfile_ext ${pyfile} EXT)
if(WIN32 AND NOT pyfile_ext)
set(pyfile_name "${pyfile_name}.py")
endif()
install(PROGRAMS ${pyexefile} RENAME ${pyfile_name}
DESTINATION ${GR_PYTHON_INSTALL_DESTINATION}
COMPONENT ${GR_PYTHON_INSTALL_COMPONENT}
)
endforeach(pyfile)
endif()
GR_UNIQUE_TARGET("pygen" ${python_install_gen_targets})
endfunction(GR_PYTHON_INSTALL)
########################################################################
# Write the python helper script that generates byte code files
########################################################################
file(WRITE ${CMAKE_BINARY_DIR}/python_compile_helper.py "
import sys, py_compile
files = sys.argv[1:]
srcs, gens = files[:len(files)/2], files[len(files)/2:]
for src, gen in zip(srcs, gens):
py_compile.compile(file=src, cfile=gen, doraise=True)
")

View File

@ -0,0 +1,229 @@
# Copyright 2010-2011 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.
if(DEFINED __INCLUDED_GR_SWIG_CMAKE)
return()
endif()
set(__INCLUDED_GR_SWIG_CMAKE TRUE)
include(GrPython)
########################################################################
# Builds a swig documentation file to be generated into python docstrings
# Usage: GR_SWIG_MAKE_DOCS(output_file input_path input_path....)
#
# Set the following variable to specify extra dependent targets:
# - GR_SWIG_DOCS_SOURCE_DEPS
# - GR_SWIG_DOCS_TARGET_DEPS
########################################################################
function(GR_SWIG_MAKE_DOCS output_file)
find_package(Doxygen)
if(DOXYGEN_FOUND)
#setup the input files variable list, quote formated
set(input_files)
unset(INPUT_PATHS)
foreach(input_path ${ARGN})
if (IS_DIRECTORY ${input_path}) #when input path is a directory
file(GLOB input_path_h_files ${input_path}/*.h)
else() #otherwise its just a file, no glob
set(input_path_h_files ${input_path})
endif()
list(APPEND input_files ${input_path_h_files})
set(INPUT_PATHS "${INPUT_PATHS} \"${input_path}\"")
endforeach(input_path)
#determine the output directory
get_filename_component(name ${output_file} NAME_WE)
get_filename_component(OUTPUT_DIRECTORY ${output_file} PATH)
set(OUTPUT_DIRECTORY ${OUTPUT_DIRECTORY}/${name}_swig_docs)
make_directory(${OUTPUT_DIRECTORY})
#generate the Doxyfile used by doxygen
configure_file(
${CMAKE_SOURCE_DIR}/docs/doxygen/Doxyfile.swig_doc.in
${OUTPUT_DIRECTORY}/Doxyfile
@ONLY)
#Create a dummy custom command that depends on other targets
include(GrMiscUtils)
GR_GEN_TARGET_DEPS(_${name}_tag tag_deps ${GR_SWIG_DOCS_TARGET_DEPS})
#call doxygen on the Doxyfile + input headers
add_custom_command(
OUTPUT ${OUTPUT_DIRECTORY}/xml/index.xml
DEPENDS ${input_files} ${GR_SWIG_DOCS_SOURCE_DEPS} ${tag_deps}
COMMAND ${DOXYGEN_EXECUTABLE} ${OUTPUT_DIRECTORY}/Doxyfile
COMMENT "Generating doxygen xml for ${name} docs"
)
#call the swig_doc script on the xml files
add_custom_command(
OUTPUT ${output_file}
DEPENDS ${input_files} ${OUTPUT_DIRECTORY}/xml/index.xml
COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
${CMAKE_SOURCE_DIR}/docs/doxygen/swig_doc.py
${OUTPUT_DIRECTORY}/xml
${output_file}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/docs/doxygen
)
else(DOXYGEN_FOUND)
file(WRITE ${output_file} "\n") #no doxygen -> empty file
endif(DOXYGEN_FOUND)
endfunction(GR_SWIG_MAKE_DOCS)
########################################################################
# Build a swig target for the common gnuradio use case. Usage:
# GR_SWIG_MAKE(target ifile ifile ifile...)
#
# Set the following variables before calling:
# - GR_SWIG_FLAGS
# - GR_SWIG_INCLUDE_DIRS
# - GR_SWIG_LIBRARIES
# - GR_SWIG_SOURCE_DEPS
# - GR_SWIG_TARGET_DEPS
# - GR_SWIG_DOC_FILE
# - GR_SWIG_DOC_DIRS
########################################################################
macro(GR_SWIG_MAKE name)
set(ifiles ${ARGN})
#do swig doc generation if specified
if (GR_SWIG_DOC_FILE)
set(GR_SWIG_DOCS_SOURCE_DEPS ${GR_SWIG_SOURCE_DEPS})
set(GR_SWIG_DOCS_TAREGT_DEPS ${GR_SWIG_TARGET_DEPS})
GR_SWIG_MAKE_DOCS(${GR_SWIG_DOC_FILE} ${GR_SWIG_DOC_DIRS})
list(APPEND GR_SWIG_SOURCE_DEPS ${GR_SWIG_DOC_FILE})
endif()
#append additional include directories
find_package(PythonLibs)
list(APPEND GR_SWIG_INCLUDE_DIRS ${PYTHON_INCLUDE_PATH}) #deprecated name (now dirs)
list(APPEND GR_SWIG_INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS})
list(APPEND GR_SWIG_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR})
list(APPEND GR_SWIG_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR})
#determine include dependencies for swig file
execute_process(
COMMAND ${PYTHON_EXECUTABLE}
${CMAKE_BINARY_DIR}/get_swig_deps.py
"${ifiles}" "${GR_SWIG_INCLUDE_DIRS}"
OUTPUT_STRIP_TRAILING_WHITESPACE
OUTPUT_VARIABLE SWIG_MODULE_${name}_EXTRA_DEPS
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
#Create a dummy custom command that depends on other targets
include(GrMiscUtils)
GR_GEN_TARGET_DEPS(_${name}_swig_tag tag_deps ${GR_SWIG_TARGET_DEPS})
set(tag_file ${CMAKE_CURRENT_BINARY_DIR}/${name}.tag)
add_custom_command(
OUTPUT ${tag_file}
DEPENDS ${GR_SWIG_SOURCE_DEPS} ${tag_deps}
COMMAND ${CMAKE_COMMAND} -E touch ${tag_file}
)
#append the specified include directories
include_directories(${GR_SWIG_INCLUDE_DIRS})
list(APPEND SWIG_MODULE_${name}_EXTRA_DEPS ${tag_file})
#setup the swig flags with flags and include directories
set(CMAKE_SWIG_FLAGS -fvirtual -modern -keyword -w511 -module ${name} ${GR_SWIG_FLAGS})
foreach(dir ${GR_SWIG_INCLUDE_DIRS})
list(APPEND CMAKE_SWIG_FLAGS "-I${dir}")
endforeach(dir)
#set the C++ property on the swig .i file so it builds
set_source_files_properties(${ifiles} PROPERTIES CPLUSPLUS ON)
#setup the actual swig library target to be built
include(UseSWIG)
SWIG_ADD_MODULE(${name} python ${ifiles})
SWIG_LINK_LIBRARIES(${name} ${PYTHON_LIBRARIES} ${GR_SWIG_LIBRARIES})
endmacro(GR_SWIG_MAKE)
########################################################################
# Install swig targets generated by GR_SWIG_MAKE. Usage:
# GR_SWIG_INSTALL(
# TARGETS target target target...
# [DESTINATION destination]
# [COMPONENT component]
# )
########################################################################
macro(GR_SWIG_INSTALL)
include(CMakeParseArgumentsCopy)
CMAKE_PARSE_ARGUMENTS(GR_SWIG_INSTALL "" "DESTINATION;COMPONENT" "TARGETS" ${ARGN})
foreach(name ${GR_SWIG_INSTALL_TARGETS})
install(TARGETS ${SWIG_MODULE_${name}_REAL_NAME}
DESTINATION ${GR_SWIG_INSTALL_DESTINATION}
COMPONENT ${GR_SWIG_INSTALL_COMPONENT}
)
include(GrPython)
GR_PYTHON_INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${name}.py
DESTINATION ${GR_SWIG_INSTALL_DESTINATION}
COMPONENT ${GR_SWIG_INSTALL_COMPONENT}
)
GR_LIBTOOL(
TARGET ${SWIG_MODULE_${name}_REAL_NAME}
DESTINATION ${GR_SWIG_INSTALL_DESTINATION}
)
endforeach(name)
endmacro(GR_SWIG_INSTALL)
########################################################################
# Generate a python file that can determine swig dependencies.
# Used by the make macro above to determine extra dependencies.
# When you build C++, CMake figures out the header dependencies.
# This code essentially performs that logic for swig includes.
########################################################################
file(WRITE ${CMAKE_BINARY_DIR}/get_swig_deps.py "
import os, sys, re
include_matcher = re.compile('[#|%]include\\s*[<|\"](.*)[>|\"]')
include_dirs = sys.argv[2].split(';')
def get_swig_incs(file_path):
file_contents = open(file_path, 'r').read()
return include_matcher.findall(file_contents, re.MULTILINE)
def get_swig_deps(file_path, level):
deps = [file_path]
if level == 0: return deps
for inc_file in get_swig_incs(file_path):
for inc_dir in include_dirs:
inc_path = os.path.join(inc_dir, inc_file)
if not os.path.exists(inc_path): continue
deps.extend(get_swig_deps(inc_path, level-1))
return deps
if __name__ == '__main__':
ifiles = sys.argv[1].split(';')
deps = sum([get_swig_deps(ifile, 3) for ifile in ifiles], [])
#sys.stderr.write(';'.join(set(deps)) + '\\n\\n')
print(';'.join(set(deps)))
")

View File

@ -0,0 +1,133 @@
# Copyright 2010-2011 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.
if(DEFINED __INCLUDED_GR_TEST_CMAKE)
return()
endif()
set(__INCLUDED_GR_TEST_CMAKE TRUE)
########################################################################
# Add a unit test and setup the environment for a unit test.
# Takes the same arguments as the ADD_TEST function.
#
# Before calling set the following variables:
# GR_TEST_TARGET_DEPS - built targets for the library path
# GR_TEST_LIBRARY_DIRS - directories for the library path
# GR_TEST_PYTHON_DIRS - directories for the python path
########################################################################
function(GR_ADD_TEST test_name)
if(WIN32)
#Ensure that the build exe also appears in the PATH.
list(APPEND GR_TEST_TARGET_DEPS ${ARGN})
#In the land of windows, all libraries must be in the PATH.
#Since the dependent libraries are not yet installed,
#we must manually set them in the PATH to run tests.
#The following appends the path of a target dependency.
foreach(target ${GR_TEST_TARGET_DEPS})
get_target_property(location ${target} LOCATION)
if(location)
get_filename_component(path ${location} PATH)
string(REGEX REPLACE "\\$\\(.*\\)" ${CMAKE_BUILD_TYPE} path ${path})
list(APPEND GR_TEST_LIBRARY_DIRS ${path})
endif(location)
endforeach(target)
#SWIG generates the python library files into a subdirectory.
#Therefore, we must append this subdirectory into PYTHONPATH.
#Only do this for the python directories matching the following:
foreach(pydir ${GR_TEST_PYTHON_DIRS})
get_filename_component(name ${pydir} NAME)
if(name MATCHES "^(swig|lib|src)$")
list(APPEND GR_TEST_PYTHON_DIRS ${pydir}/${CMAKE_BUILD_TYPE})
endif()
endforeach(pydir)
endif(WIN32)
file(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR} srcdir)
file(TO_NATIVE_PATH "${GR_TEST_LIBRARY_DIRS}" libpath) #ok to use on dir list?
file(TO_NATIVE_PATH "${GR_TEST_PYTHON_DIRS}" pypath) #ok to use on dir list?
set(environs "GR_DONT_LOAD_PREFS=1" "srcdir=${srcdir}")
#http://www.cmake.org/pipermail/cmake/2009-May/029464.html
#Replaced this add test + set environs code with the shell script generation.
#Its nicer to be able to manually run the shell script to diagnose problems.
#ADD_TEST(${ARGV})
#SET_TESTS_PROPERTIES(${test_name} PROPERTIES ENVIRONMENT "${environs}")
if(UNIX)
set(binpath "${CMAKE_CURRENT_BINARY_DIR}:$PATH")
#set both LD and DYLD paths to cover multiple UNIX OS library paths
list(APPEND libpath "$LD_LIBRARY_PATH" "$DYLD_LIBRARY_PATH")
list(APPEND pypath "$PYTHONPATH")
#replace list separator with the path separator
string(REPLACE ";" ":" libpath "${libpath}")
string(REPLACE ";" ":" pypath "${pypath}")
list(APPEND environs "PATH=${binpath}" "LD_LIBRARY_PATH=${libpath}" "DYLD_LIBRARY_PATH=${libpath}" "PYTHONPATH=${pypath}")
#generate a bat file that sets the environment and runs the test
find_program(SHELL sh)
set(sh_file ${CMAKE_CURRENT_BINARY_DIR}/${test_name}_test.sh)
file(WRITE ${sh_file} "#!${SHELL}\n")
#each line sets an environment variable
foreach(environ ${environs})
file(APPEND ${sh_file} "export ${environ}\n")
endforeach(environ)
#load the command to run with its arguments
foreach(arg ${ARGN})
file(APPEND ${sh_file} "${arg} ")
endforeach(arg)
file(APPEND ${sh_file} "\n")
#make the shell file executable
execute_process(COMMAND chmod +x ${sh_file})
add_test(${test_name} ${SHELL} ${sh_file})
endif(UNIX)
if(WIN32)
list(APPEND libpath ${DLL_PATHS} "%PATH%")
list(APPEND pypath "%PYTHONPATH%")
#replace list separator with the path separator (escaped)
string(REPLACE ";" "\\;" libpath "${libpath}")
string(REPLACE ";" "\\;" pypath "${pypath}")
list(APPEND environs "PATH=${libpath}" "PYTHONPATH=${pypath}")
#generate a bat file that sets the environment and runs the test
set(bat_file ${CMAKE_CURRENT_BINARY_DIR}/${test_name}_test.bat)
file(WRITE ${bat_file} "@echo off\n")
#each line sets an environment variable
foreach(environ ${environs})
file(APPEND ${bat_file} "SET ${environ}\n")
endforeach(environ)
#load the command to run with its arguments
foreach(arg ${ARGN})
file(APPEND ${bat_file} "${arg} ")
endforeach(arg)
file(APPEND ${bat_file} "\n")
add_test(${test_name} ${bat_file})
endif(WIN32)
endfunction(GR_ADD_TEST)

View File

@ -0,0 +1,32 @@
# http://www.vtk.org/Wiki/CMake_FAQ#Can_I_do_.22make_uninstall.22_with_CMake.3F
IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
MESSAGE(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
ENDIF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
STRING(REGEX REPLACE "\n" ";" files "${files}")
FOREACH(file ${files})
MESSAGE(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
IF(EXISTS "$ENV{DESTDIR}${file}")
EXEC_PROGRAM(
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
OUTPUT_VARIABLE rm_out
RETURN_VALUE rm_retval
)
IF(NOT "${rm_retval}" STREQUAL 0)
MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
ENDIF(NOT "${rm_retval}" STREQUAL 0)
ELSEIF(IS_SYMLINK "$ENV{DESTDIR}${file}")
EXEC_PROGRAM(
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
OUTPUT_VARIABLE rm_out
RETURN_VALUE rm_retval
)
IF(NOT "${rm_retval}" STREQUAL 0)
MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
ENDIF(NOT "${rm_retval}" STREQUAL 0)
ELSE(EXISTS "$ENV{DESTDIR}${file}")
MESSAGE(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
ENDIF(EXISTS "$ENV{DESTDIR}${file}")
ENDFOREACH(file)

View File

@ -0,0 +1,35 @@
# Copyright 2011 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.
########################################################################
# Setup dependencies
########################################################################
find_package(Doxygen)
########################################################################
# Begin conditional configuration
########################################################################
if(ENABLE_DOXYGEN)
########################################################################
# Add subdirectories
########################################################################
add_subdirectory(doxygen)
endif(ENABLE_DOXYGEN)

View File

@ -0,0 +1,52 @@
# Copyright 2011 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.
########################################################################
# Create the doxygen configuration file
########################################################################
file(TO_NATIVE_PATH ${CMAKE_SOURCE_DIR} top_srcdir)
file(TO_NATIVE_PATH ${CMAKE_BINARY_DIR} top_builddir)
file(TO_NATIVE_PATH ${CMAKE_SOURCE_DIR} abs_top_srcdir)
file(TO_NATIVE_PATH ${CMAKE_BINARY_DIR} abs_top_builddir)
set(HAVE_DOT ${DOXYGEN_DOT_FOUND})
set(enable_html_docs YES)
set(enable_latex_docs NO)
set(enable_xml_docs YES)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in
${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
@ONLY)
set(BUILT_DIRS ${CMAKE_CURRENT_BINARY_DIR}/xml ${CMAKE_CURRENT_BINARY_DIR}/html)
########################################################################
# Make and install doxygen docs
########################################################################
add_custom_command(
OUTPUT ${BUILT_DIRS}
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating documentation with doxygen"
)
add_custom_target(doxygen_target ALL DEPENDS ${BUILT_DIRS})
install(DIRECTORY ${BUILT_DIRS} DESTINATION ${GR_PKG_DOC_DIR})

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,82 @@
#
# 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 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.
#
"""
Python interface to contents of doxygen xml documentation.
Example use:
See the contents of the example folder for the C++ and
doxygen-generated xml used in this example.
>>> # Parse the doxygen docs.
>>> import os
>>> this_dir = os.path.dirname(globals()['__file__'])
>>> xml_path = this_dir + "/example/xml/"
>>> di = DoxyIndex(xml_path)
Get a list of all top-level objects.
>>> print([mem.name() for mem in di.members()])
[u'Aadvark', u'aadvarky_enough', u'main']
Get all functions.
>>> print([mem.name() for mem in di.in_category(DoxyFunction)])
[u'aadvarky_enough', u'main']
Check if an object is present.
>>> di.has_member(u'Aadvark')
True
>>> di.has_member(u'Fish')
False
Get an item by name and check its properties.
>>> aad = di.get_member(u'Aadvark')
>>> print(aad.brief_description)
Models the mammal Aadvark.
>>> print(aad.detailed_description)
Sadly the model is incomplete and cannot capture all aspects of an aadvark yet.
<BLANKLINE>
This line is uninformative and is only to test line breaks in the comments.
>>> [mem.name() for mem in aad.members()]
[u'aadvarkness', u'print', u'Aadvark', u'get_aadvarkness']
>>> aad.get_member(u'print').brief_description
u'Outputs the vital aadvark statistics.'
"""
from doxyindex import DoxyIndex, DoxyFunction, DoxyParam, DoxyClass, DoxyFile, DoxyNamespace, DoxyGroup, DoxyFriend, DoxyOther
def _test():
import os
this_dir = os.path.dirname(globals()['__file__'])
xml_path = this_dir + "/example/xml/"
di = DoxyIndex(xml_path)
# Get the Aadvark class
aad = di.get_member('Aadvark')
aad.brief_description
import doctest
return doctest.testmod()
if __name__ == "__main__":
_test()

View File

@ -0,0 +1,219 @@
#
# 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 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.
#
"""
A base class is created.
Classes based upon this are used to make more user-friendly interfaces
to the doxygen xml docs than the generated classes provide.
"""
import os
import pdb
from xml.parsers.expat import ExpatError
from generated import compound
class Base(object):
class Duplicate(StandardError):
pass
class NoSuchMember(StandardError):
pass
class ParsingError(StandardError):
pass
def __init__(self, parse_data, top=None):
self._parsed = False
self._error = False
self._parse_data = parse_data
self._members = []
self._dict_members = {}
self._in_category = {}
self._data = {}
if top is not None:
self._xml_path = top._xml_path
# Set up holder of references
else:
top = self
self._refs = {}
self._xml_path = parse_data
self.top = top
@classmethod
def from_refid(cls, refid, top=None):
""" Instantiate class from a refid rather than parsing object. """
# First check to see if its already been instantiated.
if top is not None and refid in top._refs:
return top._refs[refid]
# Otherwise create a new instance and set refid.
inst = cls(None, top=top)
inst.refid = refid
inst.add_ref(inst)
return inst
@classmethod
def from_parse_data(cls, parse_data, top=None):
refid = getattr(parse_data, 'refid', None)
if refid is not None and top is not None and refid in top._refs:
return top._refs[refid]
inst = cls(parse_data, top=top)
if refid is not None:
inst.refid = refid
inst.add_ref(inst)
return inst
def add_ref(self, obj):
if hasattr(obj, 'refid'):
self.top._refs[obj.refid] = obj
mem_classes = []
def get_cls(self, mem):
for cls in self.mem_classes:
if cls.can_parse(mem):
return cls
raise StandardError(("Did not find a class for object '%s'." \
% (mem.get_name())))
def convert_mem(self, mem):
try:
cls = self.get_cls(mem)
converted = cls.from_parse_data(mem, self.top)
if converted is None:
raise StandardError('No class matched this object.')
self.add_ref(converted)
return converted
except StandardError, e:
print e
@classmethod
def includes(cls, inst):
return isinstance(inst, cls)
@classmethod
def can_parse(cls, obj):
return False
def _parse(self):
self._parsed = True
def _get_dict_members(self, cat=None):
"""
For given category a dictionary is returned mapping member names to
members of that category. For names that are duplicated the name is
mapped to None.
"""
self.confirm_no_error()
if cat not in self._dict_members:
new_dict = {}
for mem in self.in_category(cat):
if mem.name() not in new_dict:
new_dict[mem.name()] = mem
else:
new_dict[mem.name()] = self.Duplicate
self._dict_members[cat] = new_dict
return self._dict_members[cat]
def in_category(self, cat):
self.confirm_no_error()
if cat is None:
return self._members
if cat not in self._in_category:
self._in_category[cat] = [mem for mem in self._members
if cat.includes(mem)]
return self._in_category[cat]
def get_member(self, name, cat=None):
self.confirm_no_error()
# Check if it's in a namespace or class.
bits = name.split('::')
first = bits[0]
rest = '::'.join(bits[1:])
member = self._get_dict_members(cat).get(first, self.NoSuchMember)
# Raise any errors that are returned.
if member in set([self.NoSuchMember, self.Duplicate]):
raise member()
if rest:
return member.get_member(rest, cat=cat)
return member
def has_member(self, name, cat=None):
try:
mem = self.get_member(name, cat=cat)
return True
except self.NoSuchMember:
return False
def data(self):
self.confirm_no_error()
return self._data
def members(self):
self.confirm_no_error()
return self._members
def process_memberdefs(self):
mdtss = []
for sec in self._retrieved_data.compounddef.sectiondef:
mdtss += sec.memberdef
# At the moment we lose all information associated with sections.
# Sometimes a memberdef is in several sectiondef.
# We make sure we don't get duplicates here.
uniques = set([])
for mem in mdtss:
converted = self.convert_mem(mem)
pair = (mem.name, mem.__class__)
if pair not in uniques:
uniques.add(pair)
self._members.append(converted)
def retrieve_data(self):
filename = os.path.join(self._xml_path, self.refid + '.xml')
try:
self._retrieved_data = compound.parse(filename)
except ExpatError:
print('Error in xml in file %s' % filename)
self._error = True
self._retrieved_data = None
def check_parsed(self):
if not self._parsed:
self._parse()
def confirm_no_error(self):
self.check_parsed()
if self._error:
raise self.ParsingError()
def error(self):
self.check_parsed()
return self._error
def name(self):
# first see if we can do it without processing.
if self._parse_data is not None:
return self._parse_data.name
self.check_parsed()
return self._retrieved_data.compounddef.name

View File

@ -0,0 +1,237 @@
#
# 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 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.
#
"""
Classes providing more user-friendly interfaces to the doxygen xml
docs than the generated classes provide.
"""
import os
from generated import index
from base import Base
from text import description
class DoxyIndex(Base):
"""
Parses a doxygen xml directory.
"""
__module__ = "gnuradio.utils.doxyxml"
def _parse(self):
if self._parsed:
return
super(DoxyIndex, self)._parse()
self._root = index.parse(os.path.join(self._xml_path, 'index.xml'))
for mem in self._root.compound:
converted = self.convert_mem(mem)
# For files we want the contents to be accessible directly
# from the parent rather than having to go through the file
# object.
if self.get_cls(mem) == DoxyFile:
if mem.name.endswith('.h'):
self._members += converted.members()
self._members.append(converted)
else:
self._members.append(converted)
def generate_swig_doc_i(self):
"""
%feature("docstring") gr_make_align_on_samplenumbers_ss::align_state "
Wraps the C++: gr_align_on_samplenumbers_ss::align_state";
"""
pass
class DoxyCompMem(Base):
kind = None
def __init__(self, *args, **kwargs):
super(DoxyCompMem, self).__init__(*args, **kwargs)
@classmethod
def can_parse(cls, obj):
return obj.kind == cls.kind
def set_descriptions(self, parse_data):
bd = description(getattr(parse_data, 'briefdescription', None))
dd = description(getattr(parse_data, 'detaileddescription', None))
self._data['brief_description'] = bd
self._data['detailed_description'] = dd
class DoxyCompound(DoxyCompMem):
pass
class DoxyMember(DoxyCompMem):
pass
class DoxyFunction(DoxyMember):
__module__ = "gnuradio.utils.doxyxml"
kind = 'function'
def _parse(self):
if self._parsed:
return
super(DoxyFunction, self)._parse()
self.set_descriptions(self._parse_data)
self._data['params'] = []
prms = self._parse_data.param
for prm in prms:
self._data['params'].append(DoxyParam(prm))
brief_description = property(lambda self: self.data()['brief_description'])
detailed_description = property(lambda self: self.data()['detailed_description'])
params = property(lambda self: self.data()['params'])
Base.mem_classes.append(DoxyFunction)
class DoxyParam(DoxyMember):
__module__ = "gnuradio.utils.doxyxml"
def _parse(self):
if self._parsed:
return
super(DoxyParam, self)._parse()
self.set_descriptions(self._parse_data)
self._data['declname'] = self._parse_data.declname
brief_description = property(lambda self: self.data()['brief_description'])
detailed_description = property(lambda self: self.data()['detailed_description'])
declname = property(lambda self: self.data()['declname'])
class DoxyClass(DoxyCompound):
__module__ = "gnuradio.utils.doxyxml"
kind = 'class'
def _parse(self):
if self._parsed:
return
super(DoxyClass, self)._parse()
self.retrieve_data()
if self._error:
return
self.set_descriptions(self._retrieved_data.compounddef)
# Sectiondef.kind tells about whether private or public.
# We just ignore this for now.
self.process_memberdefs()
brief_description = property(lambda self: self.data()['brief_description'])
detailed_description = property(lambda self: self.data()['detailed_description'])
Base.mem_classes.append(DoxyClass)
class DoxyFile(DoxyCompound):
__module__ = "gnuradio.utils.doxyxml"
kind = 'file'
def _parse(self):
if self._parsed:
return
super(DoxyFile, self)._parse()
self.retrieve_data()
self.set_descriptions(self._retrieved_data.compounddef)
if self._error:
return
self.process_memberdefs()
brief_description = property(lambda self: self.data()['brief_description'])
detailed_description = property(lambda self: self.data()['detailed_description'])
Base.mem_classes.append(DoxyFile)
class DoxyNamespace(DoxyCompound):
__module__ = "gnuradio.utils.doxyxml"
kind = 'namespace'
Base.mem_classes.append(DoxyNamespace)
class DoxyGroup(DoxyCompound):
__module__ = "gnuradio.utils.doxyxml"
kind = 'group'
def _parse(self):
if self._parsed:
return
super(DoxyGroup, self)._parse()
self.retrieve_data()
if self._error:
return
cdef = self._retrieved_data.compounddef
self._data['title'] = description(cdef.title)
# Process inner groups
grps = cdef.innergroup
for grp in grps:
converted = DoxyGroup.from_refid(grp.refid, top=self.top)
self._members.append(converted)
# Process inner classes
klasses = cdef.innerclass
for kls in klasses:
converted = DoxyClass.from_refid(kls.refid, top=self.top)
self._members.append(converted)
# Process normal members
self.process_memberdefs()
title = property(lambda self: self.data()['title'])
Base.mem_classes.append(DoxyGroup)
class DoxyFriend(DoxyMember):
__module__ = "gnuradio.utils.doxyxml"
kind = 'friend'
Base.mem_classes.append(DoxyFriend)
class DoxyOther(Base):
__module__ = "gnuradio.utils.doxyxml"
kinds = set(['variable', 'struct', 'union', 'define', 'typedef', 'enum', 'dir', 'page'])
@classmethod
def can_parse(cls, obj):
return obj.kind in cls.kinds
Base.mem_classes.append(DoxyOther)

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,50 @@
/* -*- 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 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 <iostream>
#include "aadvark.h"
void Aadvark::print() {
std::cout << "aadvark is " << aadvarkness << "/10 aadvarky" << std::endl;
}
Aadvark::Aadvark(int aaness): aadvarkness(aaness) {}
bool aadvarky_enough(Aadvark aad) {
if (aad.get_aadvarkness() > 6)
return true;
else
return false;
}
int Aadvark::get_aadvarkness() {
return aadvarkness;
}
int main() {
Aadvark arold = Aadvark(6);
arold.print();
if (aadvarky_enough(arold))
std::cout << "He is aadvarky enough" << std::endl;
else
std::cout << "He is not aadvarky enough" << std::endl;
}

View File

@ -0,0 +1,44 @@
/* -*- 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 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 <iostream>
/*!
* \brief Models the mammal Aadvark.
*
* Sadly the model is incomplete and cannot capture all aspects of an aadvark yet.
*
* This line is uninformative and is only to test line breaks in the comments.
*/
class Aadvark {
public:
//! \brief Outputs the vital aadvark statistics.
void print();
//! \param aaness The aadvarkness of an aadvark is a measure of how aadvarky it is.
Aadvark(int aaness);
int get_aadvarkness();
private:
int aadvarkness;
};
bool aadvarky_enough(Aadvark aad);
int main();

View File

@ -0,0 +1,88 @@
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.6.3">
<compounddef id="aadvark_8cc" kind="file">
<compoundname>aadvark.cc</compoundname>
<includes local="no">iostream</includes>
<includes refid="aadvark_8cc" local="yes">aadvark.h</includes>
<includedby refid="aadvark_8cc" local="yes">aadvark.cc</includedby>
<incdepgraph>
<node id="0">
<label>aadvark.cc</label>
<link refid="aadvark.cc"/>
<childnode refid="1" relation="include">
</childnode>
</node>
<node id="1">
<label>iostream</label>
</node>
</incdepgraph>
<sectiondef kind="func">
<memberdef kind="function" id="aadvark_8cc_1acb52858524210ec6dddc3e16d1e52946" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type>bool</type>
<definition>bool aadvarky_enough</definition>
<argsstring>(Aadvark aad)</argsstring>
<name>aadvarky_enough</name>
<param>
<type><ref refid="classAadvark" kindref="compound">Aadvark</ref></type>
<declname>aad</declname>
</param>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="/home/ben/gnuradio/gnuradio-core/src/python/gnuradio/utils/doxyxml/example/aadvark.cc" line="10" bodyfile="/home/ben/gnuradio/gnuradio-core/src/python/gnuradio/utils/doxyxml/example/aadvark.cc" bodystart="10" bodyend="15"/>
</memberdef>
<memberdef kind="function" id="aadvark_8cc_1ae66f6b31b5ad750f1fe042a706a4e3d4" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type>int</type>
<definition>int main</definition>
<argsstring>()</argsstring>
<name>main</name>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="/home/ben/gnuradio/gnuradio-core/src/python/gnuradio/utils/doxyxml/example/aadvark.cc" line="21" bodyfile="/home/ben/gnuradio/gnuradio-core/src/python/gnuradio/utils/doxyxml/example/aadvark.cc" bodystart="21" bodyend="28"/>
</memberdef>
</sectiondef>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<programlisting>
<codeline lineno="1"><highlight class="preprocessor">#include<sp/>&lt;iostream&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;aadvark.h&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3"><highlight class="normal"></highlight></codeline>
<codeline lineno="4"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classAadvark_1abd061aa5f998002e72080a34f512a059" kindref="member" tooltip="Outputs the vital aadvark statistics.">Aadvark::print</ref>()<sp/>{</highlight></codeline>
<codeline lineno="5"><highlight class="normal"><sp/><sp/>std::cout<sp/>&lt;&lt;<sp/></highlight><highlight class="stringliteral">&quot;aadvark<sp/>is<sp/>&quot;</highlight><highlight class="normal"><sp/>&lt;&lt;<sp/>aadvarkness<sp/>&lt;&lt;<sp/></highlight><highlight class="stringliteral">&quot;/10<sp/>aadvarky&quot;</highlight><highlight class="normal"><sp/>&lt;&lt;<sp/>std::endl;</highlight></codeline>
<codeline lineno="6"><highlight class="normal">}</highlight></codeline>
<codeline lineno="7"><highlight class="normal"></highlight></codeline>
<codeline lineno="8"><highlight class="normal"><ref refid="classAadvark_1adf1a4b97a641411a74a04ab312484462" kindref="member">Aadvark::Aadvark</ref>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>aaness):<sp/>aadvarkness(aaness)<sp/>{}</highlight></codeline>
<codeline lineno="9"><highlight class="normal"></highlight></codeline>
<codeline lineno="10"><highlight class="normal"></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"><sp/>aadvarky_enough(<ref refid="classAadvark" kindref="compound" tooltip="Models the mammal Aadvark.">Aadvark</ref><sp/>aad)<sp/>{</highlight></codeline>
<codeline lineno="11"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(aad.get_aadvarkness()<sp/>&gt;<sp/>6)</highlight></codeline>
<codeline lineno="12"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">true</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="13"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="14"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">false</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="15"><highlight class="normal">}</highlight></codeline>
<codeline lineno="16"><highlight class="normal"></highlight></codeline>
<codeline lineno="17"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>Aadvark::get_aadvarkness()<sp/>{</highlight></codeline>
<codeline lineno="18"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>aadvarkness;</highlight></codeline>
<codeline lineno="19"><highlight class="normal">}</highlight></codeline>
<codeline lineno="20"><highlight class="normal"></highlight></codeline>
<codeline lineno="21"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>main()<sp/>{</highlight></codeline>
<codeline lineno="22"><highlight class="normal"><sp/><sp/><ref refid="classAadvark" kindref="compound" tooltip="Models the mammal Aadvark.">Aadvark</ref><sp/>arold<sp/>=<sp/><ref refid="classAadvark" kindref="compound" tooltip="Models the mammal Aadvark.">Aadvark</ref>(6);</highlight></codeline>
<codeline lineno="23"><highlight class="normal"><sp/><sp/>arold.<ref refid="classAadvark_1abd061aa5f998002e72080a34f512a059" kindref="member" tooltip="Outputs the vital aadvark statistics.">print</ref>();</highlight></codeline>
<codeline lineno="24"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(aadvarky_enough(arold))</highlight></codeline>
<codeline lineno="25"><highlight class="normal"><sp/><sp/><sp/><sp/>std::cout<sp/>&lt;&lt;<sp/></highlight><highlight class="stringliteral">&quot;He<sp/>is<sp/>aadvarky<sp/>enough&quot;</highlight><highlight class="normal"><sp/>&lt;&lt;<sp/>std::endl;</highlight></codeline>
<codeline lineno="26"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="27"><highlight class="normal"><sp/><sp/><sp/><sp/>std::cout<sp/>&lt;&lt;<sp/></highlight><highlight class="stringliteral">&quot;He<sp/>is<sp/>not<sp/>aadvarky<sp/>enough&quot;</highlight><highlight class="normal"><sp/>&lt;&lt;<sp/>std::endl;</highlight></codeline>
<codeline lineno="28"><highlight class="normal">}</highlight></codeline>
<codeline lineno="29"><highlight class="normal"></highlight></codeline>
</programlisting>
<location file="/home/ben/gnuradio/gnuradio-core/src/python/gnuradio/utils/doxyxml/example/aadvark.cc"/>
</compounddef>
</doxygen>

View File

@ -0,0 +1,72 @@
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.6.3">
<compounddef id="aadvark_8h" kind="file">
<compoundname>aadvark.h</compoundname>
<includes local="no">iostream</includes>
<incdepgraph>
<node id="3">
<label>aadvark.h</label>
<link refid="aadvark.h"/>
<childnode refid="4" relation="include">
</childnode>
</node>
<node id="4">
<label>iostream</label>
</node>
</incdepgraph>
<innerclass refid="classAadvark" prot="public">Aadvark</innerclass>
<sectiondef kind="func">
<memberdef kind="function" id="aadvark_8h_1acb52858524210ec6dddc3e16d1e52946" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type>bool</type>
<definition>bool aadvarky_enough</definition>
<argsstring>(Aadvark aad)</argsstring>
<name>aadvarky_enough</name>
<param>
<type><ref refid="classAadvark" kindref="compound">Aadvark</ref></type>
<declname>aad</declname>
</param>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="/home/ben/gnuradio/gnuradio-core/src/python/gnuradio/utils/doxyxml/example/aadvark.h" line="21" bodyfile="/home/ben/gnuradio/gnuradio-core/src/python/gnuradio/utils/doxyxml/example/aadvark.cc" bodystart="10" bodyend="15"/>
</memberdef>
<memberdef kind="function" id="aadvark_8h_1ae66f6b31b5ad750f1fe042a706a4e3d4" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type>int</type>
<definition>int main</definition>
<argsstring>()</argsstring>
<name>main</name>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="/home/ben/gnuradio/gnuradio-core/src/python/gnuradio/utils/doxyxml/example/aadvark.h" line="23" bodyfile="/home/ben/gnuradio/gnuradio-core/src/python/gnuradio/utils/doxyxml/example/aadvark.cc" bodystart="21" bodyend="28"/>
</memberdef>
</sectiondef>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<programlisting>
<codeline lineno="1"><highlight class="preprocessor">#include<sp/>&lt;iostream&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2"><highlight class="normal"></highlight></codeline>
<codeline lineno="10" refid="classAadvark" refkind="compound"><highlight class="keyword">class<sp/></highlight><highlight class="normal"><ref refid="classAadvark" kindref="compound" tooltip="Models the mammal Aadvark.">Aadvark</ref><sp/>{</highlight></codeline>
<codeline lineno="11"><highlight class="normal"></highlight><highlight class="keyword">public</highlight><highlight class="normal">:</highlight></codeline>
<codeline lineno="13"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classAadvark_1abd061aa5f998002e72080a34f512a059" kindref="member" tooltip="Outputs the vital aadvark statistics.">print</ref>();</highlight></codeline>
<codeline lineno="15"><highlight class="normal"><sp/><sp/><ref refid="classAadvark_1adf1a4b97a641411a74a04ab312484462" kindref="member">Aadvark</ref>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>aaness);</highlight></codeline>
<codeline lineno="16"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>get_aadvarkness();</highlight></codeline>
<codeline lineno="17"><highlight class="normal"></highlight><highlight class="keyword">private</highlight><highlight class="normal">:</highlight></codeline>
<codeline lineno="18"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>aadvarkness;</highlight></codeline>
<codeline lineno="19"><highlight class="normal">};</highlight></codeline>
<codeline lineno="20"><highlight class="normal"></highlight></codeline>
<codeline lineno="21"><highlight class="normal"></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"><sp/>aadvarky_enough(<ref refid="classAadvark" kindref="compound" tooltip="Models the mammal Aadvark.">Aadvark</ref><sp/>aad);</highlight></codeline>
<codeline lineno="22"><highlight class="normal"></highlight></codeline>
<codeline lineno="23"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>main();</highlight></codeline>
</programlisting>
<location file="/home/ben/gnuradio/gnuradio-core/src/python/gnuradio/utils/doxyxml/example/aadvark.h"/>
</compounddef>
</doxygen>

View File

@ -0,0 +1,86 @@
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.6.3">
<compounddef id="classAadvark" kind="class" prot="public">
<compoundname>Aadvark</compoundname>
<includes refid="aadvark_8h" local="no">aadvark.h</includes>
<sectiondef kind="private-attrib">
<memberdef kind="variable" id="classAadvark_1ab79eb58d7bb9d5ddfa5d6f783836cab9" prot="private" static="no" mutable="no">
<type>int</type>
<definition>int Aadvark::aadvarkness</definition>
<argsstring></argsstring>
<name>aadvarkness</name>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="/home/ben/gnuradio/gnuradio-core/src/python/gnuradio/utils/doxyxml/example/aadvark.h" line="18" bodyfile="/home/ben/gnuradio/gnuradio-core/src/python/gnuradio/utils/doxyxml/example/aadvark.h" bodystart="18" bodyend="-1"/>
</memberdef>
</sectiondef>
<sectiondef kind="public-func">
<memberdef kind="function" id="classAadvark_1abd061aa5f998002e72080a34f512a059" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type>void</type>
<definition>void Aadvark::print</definition>
<argsstring>()</argsstring>
<name>print</name>
<briefdescription>
<para>Outputs the vital aadvark statistics. </para> </briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="/home/ben/gnuradio/gnuradio-core/src/python/gnuradio/utils/doxyxml/example/aadvark.h" line="13" bodyfile="/home/ben/gnuradio/gnuradio-core/src/python/gnuradio/utils/doxyxml/example/aadvark.cc" bodystart="4" bodyend="6"/>
</memberdef>
<memberdef kind="function" id="classAadvark_1adf1a4b97a641411a74a04ab312484462" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type></type>
<definition>Aadvark::Aadvark</definition>
<argsstring>(int aaness)</argsstring>
<name>Aadvark</name>
<param>
<type>int</type>
<declname>aaness</declname>
</param>
<briefdescription>
</briefdescription>
<detaileddescription>
<para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>aaness</parametername>
</parameternamelist>
<parameterdescription>
<para>The aadvarkness of an aadvark is a measure of how aadvarky it is. </para></parameterdescription>
</parameteritem>
</parameterlist>
</para> </detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="/home/ben/gnuradio/gnuradio-core/src/python/gnuradio/utils/doxyxml/example/aadvark.h" line="15" bodyfile="/home/ben/gnuradio/gnuradio-core/src/python/gnuradio/utils/doxyxml/example/aadvark.cc" bodystart="8" bodyend="8"/>
</memberdef>
<memberdef kind="function" id="classAadvark_1affd2ada0a85807efcbe26615a848f53e" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type>int</type>
<definition>int Aadvark::get_aadvarkness</definition>
<argsstring>()</argsstring>
<name>get_aadvarkness</name>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="/home/ben/gnuradio/gnuradio-core/src/python/gnuradio/utils/doxyxml/example/aadvark.h" line="16" bodyfile="/home/ben/gnuradio/gnuradio-core/src/python/gnuradio/utils/doxyxml/example/aadvark.cc" bodystart="17" bodyend="19"/>
</memberdef>
</sectiondef>
<briefdescription>
<para>Models the mammal <ref refid="classAadvark" kindref="compound">Aadvark</ref>. </para> </briefdescription>
<detaileddescription>
<para>Sadly the model is incomplete and cannot capture all aspects of an aadvark yet.</para><para>This line is uninformative and is only to test line breaks in the comments. </para> </detaileddescription>
<location file="/home/ben/gnuradio/gnuradio-core/src/python/gnuradio/utils/doxyxml/example/aadvark.h" line="10" bodyfile="/home/ben/gnuradio/gnuradio-core/src/python/gnuradio/utils/doxyxml/example/aadvark.h" bodystart="10" bodyend="19"/>
<listofallmembers>
<member refid="classAadvark_1adf1a4b97a641411a74a04ab312484462" prot="public" virt="non-virtual"><scope>Aadvark</scope><name>Aadvark</name></member>
<member refid="classAadvark_1ab79eb58d7bb9d5ddfa5d6f783836cab9" prot="private" virt="non-virtual"><scope>Aadvark</scope><name>aadvarkness</name></member>
<member refid="classAadvark_1affd2ada0a85807efcbe26615a848f53e" prot="public" virt="non-virtual"><scope>Aadvark</scope><name>get_aadvarkness</name></member>
<member refid="classAadvark_1abd061aa5f998002e72080a34f512a059" prot="public" virt="non-virtual"><scope>Aadvark</scope><name>print</name></member>
</listofallmembers>
</compounddef>
</doxygen>

View File

@ -0,0 +1,15 @@
<!-- XSLT script to combine the generated output into a single file.
If you have xsltproc you could use:
xsltproc combine.xslt index.xml >all.xml
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" version="1.0" indent="yes" standalone="yes" />
<xsl:template match="/">
<doxygen version="{doxygenindex/@version}">
<!-- Load all doxgen generated xml files -->
<xsl:for-each select="doxygenindex/compound">
<xsl:copy-of select="document( concat( @refid, '.xml' ) )/doxygen/*" />
</xsl:for-each>
</doxygen>
</xsl:template>
</xsl:stylesheet>

View File

@ -0,0 +1,814 @@
<?xml version='1.0' encoding='utf-8' ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="doxygen" type="DoxygenType"/>
<!-- Complex types -->
<xsd:complexType name="DoxygenType">
<xsd:sequence maxOccurs="unbounded">
<xsd:element name="compounddef" type="compounddefType" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="version" type="DoxVersionNumber" use="required" />
</xsd:complexType>
<xsd:complexType name="compounddefType">
<xsd:sequence>
<xsd:element name="compoundname" type="xsd:string"/>
<xsd:element name="title" type="xsd:string" minOccurs="0" />
<xsd:element name="basecompoundref" type="compoundRefType" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="derivedcompoundref" type="compoundRefType" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="includes" type="incType" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="includedby" type="incType" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="incdepgraph" type="graphType" minOccurs="0" />
<xsd:element name="invincdepgraph" type="graphType" minOccurs="0" />
<xsd:element name="innerdir" type="refType" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="innerfile" type="refType" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="innerclass" type="refType" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="innernamespace" type="refType" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="innerpage" type="refType" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="innergroup" type="refType" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="templateparamlist" type="templateparamlistType" minOccurs="0" />
<xsd:element name="sectiondef" type="sectiondefType" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="briefdescription" type="descriptionType" minOccurs="0" />
<xsd:element name="detaileddescription" type="descriptionType" minOccurs="0" />
<xsd:element name="inheritancegraph" type="graphType" minOccurs="0" />
<xsd:element name="collaborationgraph" type="graphType" minOccurs="0" />
<xsd:element name="programlisting" type="listingType" minOccurs="0" />
<xsd:element name="location" type="locationType" minOccurs="0" />
<xsd:element name="listofallmembers" type="listofallmembersType" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="id" type="xsd:string" />
<xsd:attribute name="kind" type="DoxCompoundKind" />
<xsd:attribute name="prot" type="DoxProtectionKind" />
</xsd:complexType>
<xsd:complexType name="listofallmembersType">
<xsd:sequence>
<xsd:element name="member" type="memberRefType" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="memberRefType">
<xsd:sequence>
<xsd:element name="scope" />
<xsd:element name="name" />
</xsd:sequence>
<xsd:attribute name="refid" type="xsd:string" />
<xsd:attribute name="prot" type="DoxProtectionKind" />
<xsd:attribute name="virt" type="DoxVirtualKind" />
<xsd:attribute name="ambiguityscope" type="xsd:string" />
</xsd:complexType>
<xsd:complexType name="compoundRefType" mixed="true">
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="refid" type="xsd:string" use="optional" />
<xsd:attribute name="prot" type="DoxProtectionKind" />
<xsd:attribute name="virt" type="DoxVirtualKind" />
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
<xsd:complexType name="reimplementType" mixed="true">
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="refid" type="xsd:string" />
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
<xsd:complexType name="incType" mixed="true">
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="refid" type="xsd:string" />
<xsd:attribute name="local" type="DoxBool" />
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
<xsd:complexType name="refType" mixed="true">
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="refid" type="xsd:string" />
<xsd:attribute name="prot" type="DoxProtectionKind" use="optional"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
<xsd:complexType name="refTextType" mixed="true">
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="refid" type="xsd:string" />
<xsd:attribute name="kindref" type="DoxRefKind" />
<xsd:attribute name="external" type="xsd:string" use="optional"/>
<xsd:attribute name="tooltip" type="xsd:string" use="optional"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
<xsd:complexType name="sectiondefType">
<xsd:sequence>
<xsd:element name="header" type="xsd:string" minOccurs="0" />
<xsd:element name="description" type="descriptionType" minOccurs="0" />
<xsd:element name="memberdef" type="memberdefType" maxOccurs="unbounded" />
</xsd:sequence>
<xsd:attribute name="kind" type="DoxSectionKind" />
</xsd:complexType>
<xsd:complexType name="memberdefType">
<xsd:sequence>
<xsd:element name="templateparamlist" type="templateparamlistType" minOccurs="0" />
<xsd:element name="type" type="linkedTextType" minOccurs="0" />
<xsd:element name="definition" minOccurs="0" />
<xsd:element name="argsstring" minOccurs="0" />
<xsd:element name="name" />
<xsd:element name="read" minOccurs="0" />
<xsd:element name="write" minOccurs="0" />
<xsd:element name="bitfield" minOccurs="0" />
<xsd:element name="reimplements" type="reimplementType" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="reimplementedby" type="reimplementType" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="param" type="paramType" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="enumvalue" type="enumvalueType" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="initializer" type="linkedTextType" minOccurs="0" />
<xsd:element name="exceptions" type="linkedTextType" minOccurs="0" />
<xsd:element name="briefdescription" type="descriptionType" minOccurs="0" />
<xsd:element name="detaileddescription" type="descriptionType" minOccurs="0" />
<xsd:element name="inbodydescription" type="descriptionType" minOccurs="0" />
<xsd:element name="location" type="locationType" />
<xsd:element name="references" type="referenceType" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="referencedby" type="referenceType" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
<xsd:attribute name="kind" type="DoxMemberKind" />
<xsd:attribute name="id" type="xsd:string" />
<xsd:attribute name="prot" type="DoxProtectionKind" />
<xsd:attribute name="static" type="DoxBool" />
<xsd:attribute name="const" type="DoxBool" />
<xsd:attribute name="explicit" type="DoxBool" />
<xsd:attribute name="inline" type="DoxBool" />
<xsd:attribute name="virt" type="DoxVirtualKind" />
<xsd:attribute name="volatile" type="DoxBool" />
<xsd:attribute name="mutable" type="DoxBool" />
<!-- Qt property -->
<xsd:attribute name="readable" type="DoxBool" use="optional"/>
<xsd:attribute name="writable" type="DoxBool" use="optional"/>
<!-- C++/CLI variable -->
<xsd:attribute name="initonly" type="DoxBool" use="optional"/>
<!-- C++/CLI and C# property -->
<xsd:attribute name="settable" type="DoxBool" use="optional"/>
<xsd:attribute name="gettable" type="DoxBool" use="optional"/>
<!-- C++/CLI function -->
<xsd:attribute name="final" type="DoxBool" use="optional"/>
<xsd:attribute name="sealed" type="DoxBool" use="optional"/>
<xsd:attribute name="new" type="DoxBool" use="optional"/>
<!-- C++/CLI event -->
<xsd:attribute name="add" type="DoxBool" use="optional"/>
<xsd:attribute name="remove" type="DoxBool" use="optional"/>
<xsd:attribute name="raise" type="DoxBool" use="optional"/>
<!-- Objective-C 2.0 protocol method -->
<xsd:attribute name="optional" type="DoxBool" use="optional"/>
<xsd:attribute name="required" type="DoxBool" use="optional"/>
<!-- Objective-C 2.0 property accessor -->
<xsd:attribute name="accessor" type="DoxAccessor" use="optional"/>
</xsd:complexType>
<xsd:complexType name="descriptionType" mixed="true">
<xsd:sequence>
<xsd:element name="title" type="xsd:string" minOccurs="0"/>
<xsd:element name="para" type="docParaType" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="sect1" type="docSect1Type" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="internal" type="docInternalType" minOccurs="0" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="enumvalueType" mixed="true">
<xsd:sequence>
<xsd:element name="name" />
<xsd:element name="initializer" type="linkedTextType" minOccurs="0" />
<xsd:element name="briefdescription" type="descriptionType" minOccurs="0" />
<xsd:element name="detaileddescription" type="descriptionType" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="id" type="xsd:string" />
<xsd:attribute name="prot" type="DoxProtectionKind" />
</xsd:complexType>
<xsd:complexType name="templateparamlistType">
<xsd:sequence>
<xsd:element name="param" type="paramType" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="paramType">
<xsd:sequence>
<xsd:element name="type" type="linkedTextType" minOccurs="0" />
<xsd:element name="declname" minOccurs="0" />
<xsd:element name="defname" minOccurs="0" />
<xsd:element name="array" minOccurs="0" />
<xsd:element name="defval" type="linkedTextType" minOccurs="0" />
<xsd:element name="briefdescription" type="descriptionType" minOccurs="0" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="linkedTextType" mixed="true">
<xsd:sequence>
<xsd:element name="ref" type="refTextType" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="graphType">
<xsd:sequence>
<xsd:element name="node" type="nodeType" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="nodeType">
<xsd:sequence>
<xsd:element name="label" />
<xsd:element name="link" type="linkType" minOccurs="0" />
<xsd:element name="childnode" type="childnodeType" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
<xsd:attribute name="id" type="xsd:string" />
</xsd:complexType>
<xsd:complexType name="childnodeType">
<xsd:sequence>
<xsd:element name="edgelabel" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="refid" type="xsd:string" />
<xsd:attribute name="relation" type="DoxGraphRelation" />
</xsd:complexType>
<xsd:complexType name="linkType">
<xsd:attribute name="refid" type="xsd:string" />
<xsd:attribute name="external" type="xsd:string" use="optional"/>
</xsd:complexType>
<xsd:complexType name="listingType">
<xsd:sequence>
<xsd:element name="codeline" type="codelineType" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="codelineType">
<xsd:sequence>
<xsd:element name="highlight" type="highlightType" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
<xsd:attribute name="lineno" type="xsd:integer" />
<xsd:attribute name="refid" type="xsd:string" />
<xsd:attribute name="refkind" type="DoxRefKind" />
<xsd:attribute name="external" type="DoxBool" />
</xsd:complexType>
<xsd:complexType name="highlightType" mixed="true">
<xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:element name="sp" />
<xsd:element name="ref" type="refTextType" />
</xsd:choice>
<xsd:attribute name="class" type="DoxHighlightClass" />
</xsd:complexType>
<xsd:complexType name="referenceType" mixed="true">
<xsd:attribute name="refid" type="xsd:string" />
<xsd:attribute name="compoundref" type="xsd:string" use="optional" />
<xsd:attribute name="startline" type="xsd:integer" />
<xsd:attribute name="endline" type="xsd:integer" />
</xsd:complexType>
<xsd:complexType name="locationType">
<xsd:attribute name="file" type="xsd:string" />
<xsd:attribute name="line" type="xsd:integer" />
<xsd:attribute name="bodyfile" type="xsd:string" />
<xsd:attribute name="bodystart" type="xsd:integer" />
<xsd:attribute name="bodyend" type="xsd:integer" />
</xsd:complexType>
<xsd:complexType name="docSect1Type" mixed="true">
<xsd:sequence>
<xsd:element name="title" type="xsd:string" />
<xsd:element name="para" type="docParaType" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="sect2" type="docSect2Type" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="internal" type="docInternalS1Type" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="id" type="xsd:string" />
</xsd:complexType>
<xsd:complexType name="docSect2Type" mixed="true">
<xsd:sequence>
<xsd:element name="title" type="xsd:string" />
<xsd:element name="para" type="docParaType" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="sect3" type="docSect3Type" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="internal" type="docInternalS2Type" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="id" type="xsd:string" />
</xsd:complexType>
<xsd:complexType name="docSect3Type" mixed="true">
<xsd:sequence>
<xsd:element name="title" type="xsd:string" />
<xsd:element name="para" type="docParaType" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="sect4" type="docSect4Type" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="internal" type="docInternalS3Type" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="id" type="xsd:string" />
</xsd:complexType>
<xsd:complexType name="docSect4Type" mixed="true">
<xsd:sequence>
<xsd:element name="title" type="xsd:string" />
<xsd:element name="para" type="docParaType" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="internal" type="docInternalS4Type" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="id" type="xsd:string" />
</xsd:complexType>
<xsd:complexType name="docInternalType" mixed="true">
<xsd:sequence>
<xsd:element name="para" type="docParaType" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="sect1" type="docSect1Type" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="docInternalS1Type" mixed="true">
<xsd:sequence>
<xsd:element name="para" type="docParaType" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="sect2" type="docSect2Type" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="docInternalS2Type" mixed="true">
<xsd:sequence>
<xsd:element name="para" type="docParaType" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="sect3" type="docSect3Type" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="docInternalS3Type" mixed="true">
<xsd:sequence>
<xsd:element name="para" type="docParaType" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="sect3" type="docSect4Type" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="docInternalS4Type" mixed="true">
<xsd:sequence>
<xsd:element name="para" type="docParaType" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
<xsd:group name="docTitleCmdGroup">
<xsd:choice>
<xsd:element name="ulink" type="docURLLink" />
<xsd:element name="bold" type="docMarkupType" />
<xsd:element name="emphasis" type="docMarkupType" />
<xsd:element name="computeroutput" type="docMarkupType" />
<xsd:element name="subscript" type="docMarkupType" />
<xsd:element name="superscript" type="docMarkupType" />
<xsd:element name="center" type="docMarkupType" />
<xsd:element name="small" type="docMarkupType" />
<xsd:element name="htmlonly" type="xsd:string" />
<xsd:element name="latexonly" type="xsd:string" />
<xsd:element name="dot" type="xsd:string" />
<xsd:element name="anchor" type="docAnchorType" />
<xsd:element name="formula" type="docFormulaType" />
<xsd:element name="ref" type="docRefTextType" />
<xsd:element name="copy" type="docEmptyType" />
<xsd:element name="trademark" type="docEmptyType" />
<xsd:element name="registered" type="docEmptyType" />
<xsd:element name="lsquo" type="docEmptyType" />
<xsd:element name="rsquo" type="docEmptyType" />
<xsd:element name="ldquo" type="docEmptyType" />
<xsd:element name="rdquo" type="docEmptyType" />
<xsd:element name="ndash" type="docEmptyType" />
<xsd:element name="mdash" type="docEmptyType" />
<xsd:element name="umlaut" type="docCharType" />
<xsd:element name="acute" type="docCharType" />
<xsd:element name="grave" type="docCharType" />
<xsd:element name="circ" type="docCharType" />
<xsd:element name="slash" type="docCharType" />
<xsd:element name="tilde" type="docCharType" />
<xsd:element name="cedil" type="docCharType" />
<xsd:element name="ring" type="docCharType" />
<xsd:element name="szlig" type="docEmptyType" />
<xsd:element name="nonbreakablespace" type="docEmptyType" />
</xsd:choice>
</xsd:group>
<xsd:complexType name="docTitleType" mixed="true">
<xsd:group ref="docTitleCmdGroup" minOccurs="0" maxOccurs="unbounded" />
</xsd:complexType>
<xsd:group name="docCmdGroup">
<xsd:choice>
<xsd:group ref="docTitleCmdGroup"/>
<xsd:element name="linebreak" type="docEmptyType" />
<xsd:element name="hruler" type="docEmptyType" />
<xsd:element name="preformatted" type="docMarkupType" />
<xsd:element name="programlisting" type="listingType" />
<xsd:element name="verbatim" type="xsd:string" />
<xsd:element name="indexentry" type="docIndexEntryType" />
<xsd:element name="orderedlist" type="docListType" />
<xsd:element name="itemizedlist" type="docListType" />
<xsd:element name="simplesect" type="docSimpleSectType" />
<xsd:element name="title" type="docTitleType" />
<xsd:element name="variablelist" type="docVariableListType" />
<xsd:element name="table" type="docTableType" />
<xsd:element name="heading" type="docHeadingType" />
<xsd:element name="image" type="docImageType" />
<xsd:element name="dotfile" type="docDotFileType" />
<xsd:element name="toclist" type="docTocListType" />
<xsd:element name="language" type="docLanguageType" />
<xsd:element name="parameterlist" type="docParamListType" />
<xsd:element name="xrefsect" type="docXRefSectType" />
<xsd:element name="copydoc" type="docCopyType" />
</xsd:choice>
</xsd:group>
<xsd:complexType name="docParaType" mixed="true">
<xsd:group ref="docCmdGroup" minOccurs="0" maxOccurs="unbounded" />
</xsd:complexType>
<xsd:complexType name="docMarkupType" mixed="true">
<xsd:group ref="docCmdGroup" minOccurs="0" maxOccurs="unbounded" />
</xsd:complexType>
<xsd:complexType name="docURLLink" mixed="true">
<xsd:group ref="docTitleCmdGroup" minOccurs="0" maxOccurs="unbounded" />
<xsd:attribute name="url" type="xsd:string" />
</xsd:complexType>
<xsd:complexType name="docAnchorType" mixed="true">
<xsd:attribute name="id" type="xsd:string" />
</xsd:complexType>
<xsd:complexType name="docFormulaType" mixed="true">
<xsd:attribute name="id" type="xsd:string" />
</xsd:complexType>
<xsd:complexType name="docIndexEntryType">
<xsd:sequence>
<xsd:element name="primaryie" type="xsd:string" />
<xsd:element name="secondaryie" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="docListType">
<xsd:sequence>
<xsd:element name="listitem" type="docListItemType" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="docListItemType">
<xsd:sequence>
<xsd:element name="para" type="docParaType" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="docSimpleSectType">
<xsd:sequence>
<xsd:element name="title" type="docTitleType" minOccurs="0" />
<xsd:sequence minOccurs="0" maxOccurs="unbounded">
<xsd:element name="para" type="docParaType" minOccurs="1" maxOccurs="unbounded" />
<xsd:element name="simplesectsep" type="docEmptyType" minOccurs="0"/>
</xsd:sequence>
</xsd:sequence>
<xsd:attribute name="kind" type="DoxSimpleSectKind" />
</xsd:complexType>
<xsd:complexType name="docVarListEntryType">
<xsd:sequence>
<xsd:element name="term" type="docTitleType" />
</xsd:sequence>
</xsd:complexType>
<xsd:group name="docVariableListGroup">
<xsd:sequence>
<xsd:element name="varlistentry" type="docVarListEntryType" />
<xsd:element name="listitem" type="docListItemType" />
</xsd:sequence>
</xsd:group>
<xsd:complexType name="docVariableListType">
<xsd:sequence>
<xsd:group ref="docVariableListGroup" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="docRefTextType" mixed="true">
<xsd:group ref="docTitleCmdGroup" minOccurs="0" maxOccurs="unbounded" />
<xsd:attribute name="refid" type="xsd:string" />
<xsd:attribute name="kindref" type="DoxRefKind" />
<xsd:attribute name="external" type="xsd:string" />
</xsd:complexType>
<xsd:complexType name="docTableType">
<xsd:sequence>
<xsd:element name="row" type="docRowType" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="caption" type="docCaptionType" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="rows" type="xsd:integer" />
<xsd:attribute name="cols" type="xsd:integer" />
</xsd:complexType>
<xsd:complexType name="docRowType">
<xsd:sequence>
<xsd:element name="entry" type="docEntryType" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="docEntryType">
<xsd:sequence>
<xsd:element name="para" type="docParaType" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
<xsd:attribute name="thead" type="DoxBool" />
</xsd:complexType>
<xsd:complexType name="docCaptionType" mixed="true">
<xsd:group ref="docTitleCmdGroup" minOccurs="0" maxOccurs="unbounded" />
</xsd:complexType>
<xsd:complexType name="docHeadingType" mixed="true">
<xsd:group ref="docTitleCmdGroup" minOccurs="0" maxOccurs="unbounded" />
<xsd:attribute name="level" type="xsd:integer" /> <!-- todo: range 1-6 -->
</xsd:complexType>
<xsd:complexType name="docImageType" mixed="true">
<xsd:group ref="docTitleCmdGroup" minOccurs="0" maxOccurs="unbounded" />
<xsd:attribute name="type" type="DoxImageKind" />
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="width" type="xsd:string" />
<xsd:attribute name="height" type="xsd:string" />
</xsd:complexType>
<xsd:complexType name="docDotFileType" mixed="true">
<xsd:group ref="docTitleCmdGroup" minOccurs="0" maxOccurs="unbounded" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
<xsd:complexType name="docTocItemType" mixed="true">
<xsd:group ref="docTitleCmdGroup" minOccurs="0" maxOccurs="unbounded" />
<xsd:attribute name="id" type="xsd:string" />
</xsd:complexType>
<xsd:complexType name="docTocListType">
<xsd:sequence>
<xsd:element name="tocitem" type="docTocItemType" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="docLanguageType">
<xsd:sequence>
<xsd:element name="para" type="docParaType" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
<xsd:attribute name="langid" type="xsd:string" />
</xsd:complexType>
<xsd:complexType name="docParamListType">
<xsd:sequence>
<xsd:element name="parameteritem" type="docParamListItem" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
<xsd:attribute name="kind" type="DoxParamListKind" />
</xsd:complexType>
<xsd:complexType name="docParamListItem">
<xsd:sequence>
<xsd:element name="parameternamelist" type="docParamNameList" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="parameterdescription" type="descriptionType" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="docParamNameList">
<xsd:sequence>
<xsd:element name="parametername" type="docParamName" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="docParamName" mixed="true">
<xsd:sequence>
<xsd:element name="ref" type="refTextType" minOccurs="0" maxOccurs="1" />
</xsd:sequence>
<xsd:attribute name="direction" type="DoxParamDir" use="optional" />
</xsd:complexType>
<xsd:complexType name="docXRefSectType">
<xsd:sequence>
<xsd:element name="xreftitle" type="xsd:string" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="xrefdescription" type="descriptionType" />
</xsd:sequence>
<xsd:attribute name="id" type="xsd:string" />
</xsd:complexType>
<xsd:complexType name="docCopyType">
<xsd:sequence>
<xsd:element name="para" type="docParaType" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="sect1" type="docSect1Type" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="internal" type="docInternalType" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="link" type="xsd:string" />
</xsd:complexType>
<xsd:complexType name="docCharType">
<xsd:attribute name="char" type="DoxCharRange"/>
</xsd:complexType>
<xsd:complexType name="docEmptyType"/>
<!-- Simple types -->
<xsd:simpleType name="DoxBool">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="yes" />
<xsd:enumeration value="no" />
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="DoxGraphRelation">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="include" />
<xsd:enumeration value="usage" />
<xsd:enumeration value="template-instance" />
<xsd:enumeration value="public-inheritance" />
<xsd:enumeration value="protected-inheritance" />
<xsd:enumeration value="private-inheritance" />
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="DoxRefKind">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="compound" />
<xsd:enumeration value="member" />
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="DoxMemberKind">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="define" />
<xsd:enumeration value="property" />
<xsd:enumeration value="event" />
<xsd:enumeration value="variable" />
<xsd:enumeration value="typedef" />
<xsd:enumeration value="enum" />
<xsd:enumeration value="function" />
<xsd:enumeration value="signal" />
<xsd:enumeration value="prototype" />
<xsd:enumeration value="friend" />
<xsd:enumeration value="dcop" />
<xsd:enumeration value="slot" />
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="DoxProtectionKind">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="public" />
<xsd:enumeration value="protected" />
<xsd:enumeration value="private" />
<xsd:enumeration value="package" />
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="DoxVirtualKind">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="non-virtual" />
<xsd:enumeration value="virtual" />
<xsd:enumeration value="pure-virtual" />
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="DoxCompoundKind">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="class" />
<xsd:enumeration value="struct" />
<xsd:enumeration value="union" />
<xsd:enumeration value="interface" />
<xsd:enumeration value="protocol" />
<xsd:enumeration value="category" />
<xsd:enumeration value="exception" />
<xsd:enumeration value="file" />
<xsd:enumeration value="namespace" />
<xsd:enumeration value="group" />
<xsd:enumeration value="page" />
<xsd:enumeration value="example" />
<xsd:enumeration value="dir" />
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="DoxSectionKind">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="user-defined" />
<xsd:enumeration value="public-type" />
<xsd:enumeration value="public-func" />
<xsd:enumeration value="public-attrib" />
<xsd:enumeration value="public-slot" />
<xsd:enumeration value="signal" />
<xsd:enumeration value="dcop-func" />
<xsd:enumeration value="property" />
<xsd:enumeration value="event" />
<xsd:enumeration value="public-static-func" />
<xsd:enumeration value="public-static-attrib" />
<xsd:enumeration value="protected-type" />
<xsd:enumeration value="protected-func" />
<xsd:enumeration value="protected-attrib" />
<xsd:enumeration value="protected-slot" />
<xsd:enumeration value="protected-static-func" />
<xsd:enumeration value="protected-static-attrib" />
<xsd:enumeration value="package-type" />
<xsd:enumeration value="package-func" />
<xsd:enumeration value="package-attrib" />
<xsd:enumeration value="package-static-func" />
<xsd:enumeration value="package-static-attrib" />
<xsd:enumeration value="private-type" />
<xsd:enumeration value="private-func" />
<xsd:enumeration value="private-attrib" />
<xsd:enumeration value="private-slot" />
<xsd:enumeration value="private-static-func" />
<xsd:enumeration value="private-static-attrib" />
<xsd:enumeration value="friend" />
<xsd:enumeration value="related" />
<xsd:enumeration value="define" />
<xsd:enumeration value="prototype" />
<xsd:enumeration value="typedef" />
<xsd:enumeration value="enum" />
<xsd:enumeration value="func" />
<xsd:enumeration value="var" />
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="DoxHighlightClass">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="comment" />
<xsd:enumeration value="normal" />
<xsd:enumeration value="preprocessor" />
<xsd:enumeration value="keyword" />
<xsd:enumeration value="keywordtype" />
<xsd:enumeration value="keywordflow" />
<xsd:enumeration value="stringliteral" />
<xsd:enumeration value="charliteral" />
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="DoxSimpleSectKind">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="see" />
<xsd:enumeration value="return" />
<xsd:enumeration value="author" />
<xsd:enumeration value="authors" />
<xsd:enumeration value="version" />
<xsd:enumeration value="since" />
<xsd:enumeration value="date" />
<xsd:enumeration value="note" />
<xsd:enumeration value="warning" />
<xsd:enumeration value="pre" />
<xsd:enumeration value="post" />
<xsd:enumeration value="invariant" />
<xsd:enumeration value="remark" />
<xsd:enumeration value="attention" />
<xsd:enumeration value="par" />
<xsd:enumeration value="rcs" />
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="DoxVersionNumber">
<xsd:restriction base="xsd:string">
<xsd:pattern value="\d+\.\d+.*" />
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="DoxImageKind">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="html" />
<xsd:enumeration value="latex" />
<xsd:enumeration value="rtf" />
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="DoxParamListKind">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="param" />
<xsd:enumeration value="retval" />
<xsd:enumeration value="exception" />
<xsd:enumeration value="templateparam" />
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="DoxCharRange">
<xsd:restriction base="xsd:string">
<xsd:pattern value="[aeiouncAEIOUNC]" />
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="DoxParamDir">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="in"/>
<xsd:enumeration value="out"/>
<xsd:enumeration value="inout"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="DoxAccessor">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="retain"/>
<xsd:enumeration value="copy"/>
<xsd:enumeration value="assign"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>

View File

@ -0,0 +1,17 @@
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygenindex xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="index.xsd" version="1.6.3">
<compound refid="classAadvark" kind="class"><name>Aadvark</name>
<member refid="classAadvark_1ab79eb58d7bb9d5ddfa5d6f783836cab9" kind="variable"><name>aadvarkness</name></member>
<member refid="classAadvark_1abd061aa5f998002e72080a34f512a059" kind="function"><name>print</name></member>
<member refid="classAadvark_1adf1a4b97a641411a74a04ab312484462" kind="function"><name>Aadvark</name></member>
<member refid="classAadvark_1affd2ada0a85807efcbe26615a848f53e" kind="function"><name>get_aadvarkness</name></member>
</compound>
<compound refid="aadvark_8cc" kind="file"><name>aadvark.cc</name>
<member refid="aadvark_8cc_1acb52858524210ec6dddc3e16d1e52946" kind="function"><name>aadvarky_enough</name></member>
<member refid="aadvark_8cc_1ae66f6b31b5ad750f1fe042a706a4e3d4" kind="function"><name>main</name></member>
</compound>
<compound refid="aadvark_8h" kind="file"><name>aadvark.h</name>
<member refid="aadvark_8h_1acb52858524210ec6dddc3e16d1e52946" kind="function"><name>aadvarky_enough</name></member>
<member refid="aadvark_8h_1ae66f6b31b5ad750f1fe042a706a4e3d4" kind="function"><name>main</name></member>
</compound>
</doxygenindex>

View File

@ -0,0 +1,66 @@
<?xml version='1.0' encoding='utf-8' ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="doxygenindex" type="DoxygenType"/>
<xsd:complexType name="DoxygenType">
<xsd:sequence>
<xsd:element name="compound" type="CompoundType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="version" type="xsd:string" use="required"/>
</xsd:complexType>
<xsd:complexType name="CompoundType">
<xsd:sequence>
<xsd:element name="name" type="xsd:string"/>
<xsd:element name="member" type="MemberType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="refid" type="xsd:string" use="required"/>
<xsd:attribute name="kind" type="CompoundKind" use="required"/>
</xsd:complexType>
<xsd:complexType name="MemberType">
<xsd:sequence>
<xsd:element name="name" type="xsd:string"/>
</xsd:sequence>
<xsd:attribute name="refid" type="xsd:string" use="required"/>
<xsd:attribute name="kind" type="MemberKind" use="required"/>
</xsd:complexType>
<xsd:simpleType name="CompoundKind">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="class"/>
<xsd:enumeration value="struct"/>
<xsd:enumeration value="union"/>
<xsd:enumeration value="interface"/>
<xsd:enumeration value="protocol"/>
<xsd:enumeration value="category"/>
<xsd:enumeration value="exception"/>
<xsd:enumeration value="file"/>
<xsd:enumeration value="namespace"/>
<xsd:enumeration value="group"/>
<xsd:enumeration value="page"/>
<xsd:enumeration value="example"/>
<xsd:enumeration value="dir"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="MemberKind">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="define"/>
<xsd:enumeration value="property"/>
<xsd:enumeration value="event"/>
<xsd:enumeration value="variable"/>
<xsd:enumeration value="typedef"/>
<xsd:enumeration value="enum"/>
<xsd:enumeration value="enumvalue"/>
<xsd:enumeration value="function"/>
<xsd:enumeration value="signal"/>
<xsd:enumeration value="prototype"/>
<xsd:enumeration value="friend"/>
<xsd:enumeration value="dcop"/>
<xsd:enumeration value="slot"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>

View File

@ -0,0 +1,7 @@
"""
Contains generated files produced by generateDS.py.
These do the real work of parsing the doxygen xml files but the
resultant classes are not very friendly to navigate so the rest of the
doxyxml module processes them further.
"""

View File

@ -0,0 +1,503 @@
#!/usr/bin/env python
"""
Generated Mon Feb 9 19:08:05 2009 by generateDS.py.
"""
from string import lower as str_lower
from xml.dom import minidom
from xml.dom import Node
import sys
import compoundsuper as supermod
from compoundsuper import MixedContainer
class DoxygenTypeSub(supermod.DoxygenType):
def __init__(self, version=None, compounddef=None):
supermod.DoxygenType.__init__(self, version, compounddef)
def find(self, details):
return self.compounddef.find(details)
supermod.DoxygenType.subclass = DoxygenTypeSub
# end class DoxygenTypeSub
class compounddefTypeSub(supermod.compounddefType):
def __init__(self, kind=None, prot=None, id=None, compoundname='', title='', basecompoundref=None, derivedcompoundref=None, includes=None, includedby=None, incdepgraph=None, invincdepgraph=None, innerdir=None, innerfile=None, innerclass=None, innernamespace=None, innerpage=None, innergroup=None, templateparamlist=None, sectiondef=None, briefdescription=None, detaileddescription=None, inheritancegraph=None, collaborationgraph=None, programlisting=None, location=None, listofallmembers=None):
supermod.compounddefType.__init__(self, kind, prot, id, compoundname, title, basecompoundref, derivedcompoundref, includes, includedby, incdepgraph, invincdepgraph, innerdir, innerfile, innerclass, innernamespace, innerpage, innergroup, templateparamlist, sectiondef, briefdescription, detaileddescription, inheritancegraph, collaborationgraph, programlisting, location, listofallmembers)
def find(self, details):
if self.id == details.refid:
return self
for sectiondef in self.sectiondef:
result = sectiondef.find(details)
if result:
return result
supermod.compounddefType.subclass = compounddefTypeSub
# end class compounddefTypeSub
class listofallmembersTypeSub(supermod.listofallmembersType):
def __init__(self, member=None):
supermod.listofallmembersType.__init__(self, member)
supermod.listofallmembersType.subclass = listofallmembersTypeSub
# end class listofallmembersTypeSub
class memberRefTypeSub(supermod.memberRefType):
def __init__(self, virt=None, prot=None, refid=None, ambiguityscope=None, scope='', name=''):
supermod.memberRefType.__init__(self, virt, prot, refid, ambiguityscope, scope, name)
supermod.memberRefType.subclass = memberRefTypeSub
# end class memberRefTypeSub
class compoundRefTypeSub(supermod.compoundRefType):
def __init__(self, virt=None, prot=None, refid=None, valueOf_='', mixedclass_=None, content_=None):
supermod.compoundRefType.__init__(self, mixedclass_, content_)
supermod.compoundRefType.subclass = compoundRefTypeSub
# end class compoundRefTypeSub
class reimplementTypeSub(supermod.reimplementType):
def __init__(self, refid=None, valueOf_='', mixedclass_=None, content_=None):
supermod.reimplementType.__init__(self, mixedclass_, content_)
supermod.reimplementType.subclass = reimplementTypeSub
# end class reimplementTypeSub
class incTypeSub(supermod.incType):
def __init__(self, local=None, refid=None, valueOf_='', mixedclass_=None, content_=None):
supermod.incType.__init__(self, mixedclass_, content_)
supermod.incType.subclass = incTypeSub
# end class incTypeSub
class refTypeSub(supermod.refType):
def __init__(self, prot=None, refid=None, valueOf_='', mixedclass_=None, content_=None):
supermod.refType.__init__(self, mixedclass_, content_)
supermod.refType.subclass = refTypeSub
# end class refTypeSub
class refTextTypeSub(supermod.refTextType):
def __init__(self, refid=None, kindref=None, external=None, valueOf_='', mixedclass_=None, content_=None):
supermod.refTextType.__init__(self, mixedclass_, content_)
supermod.refTextType.subclass = refTextTypeSub
# end class refTextTypeSub
class sectiondefTypeSub(supermod.sectiondefType):
def __init__(self, kind=None, header='', description=None, memberdef=None):
supermod.sectiondefType.__init__(self, kind, header, description, memberdef)
def find(self, details):
for memberdef in self.memberdef:
if memberdef.id == details.refid:
return memberdef
return None
supermod.sectiondefType.subclass = sectiondefTypeSub
# end class sectiondefTypeSub
class memberdefTypeSub(supermod.memberdefType):
def __init__(self, initonly=None, kind=None, volatile=None, const=None, raise_=None, virt=None, readable=None, prot=None, explicit=None, new=None, final=None, writable=None, add=None, static=None, remove=None, sealed=None, mutable=None, gettable=None, inline=None, settable=None, id=None, templateparamlist=None, type_=None, definition='', argsstring='', name='', read='', write='', bitfield='', reimplements=None, reimplementedby=None, param=None, enumvalue=None, initializer=None, exceptions=None, briefdescription=None, detaileddescription=None, inbodydescription=None, location=None, references=None, referencedby=None):
supermod.memberdefType.__init__(self, initonly, kind, volatile, const, raise_, virt, readable, prot, explicit, new, final, writable, add, static, remove, sealed, mutable, gettable, inline, settable, id, templateparamlist, type_, definition, argsstring, name, read, write, bitfield, reimplements, reimplementedby, param, enumvalue, initializer, exceptions, briefdescription, detaileddescription, inbodydescription, location, references, referencedby)
supermod.memberdefType.subclass = memberdefTypeSub
# end class memberdefTypeSub
class descriptionTypeSub(supermod.descriptionType):
def __init__(self, title='', para=None, sect1=None, internal=None, mixedclass_=None, content_=None):
supermod.descriptionType.__init__(self, mixedclass_, content_)
supermod.descriptionType.subclass = descriptionTypeSub
# end class descriptionTypeSub
class enumvalueTypeSub(supermod.enumvalueType):
def __init__(self, prot=None, id=None, name='', initializer=None, briefdescription=None, detaileddescription=None, mixedclass_=None, content_=None):
supermod.enumvalueType.__init__(self, mixedclass_, content_)
supermod.enumvalueType.subclass = enumvalueTypeSub
# end class enumvalueTypeSub
class templateparamlistTypeSub(supermod.templateparamlistType):
def __init__(self, param=None):
supermod.templateparamlistType.__init__(self, param)
supermod.templateparamlistType.subclass = templateparamlistTypeSub
# end class templateparamlistTypeSub
class paramTypeSub(supermod.paramType):
def __init__(self, type_=None, declname='', defname='', array='', defval=None, briefdescription=None):
supermod.paramType.__init__(self, type_, declname, defname, array, defval, briefdescription)
supermod.paramType.subclass = paramTypeSub
# end class paramTypeSub
class linkedTextTypeSub(supermod.linkedTextType):
def __init__(self, ref=None, mixedclass_=None, content_=None):
supermod.linkedTextType.__init__(self, mixedclass_, content_)
supermod.linkedTextType.subclass = linkedTextTypeSub
# end class linkedTextTypeSub
class graphTypeSub(supermod.graphType):
def __init__(self, node=None):
supermod.graphType.__init__(self, node)
supermod.graphType.subclass = graphTypeSub
# end class graphTypeSub
class nodeTypeSub(supermod.nodeType):
def __init__(self, id=None, label='', link=None, childnode=None):
supermod.nodeType.__init__(self, id, label, link, childnode)
supermod.nodeType.subclass = nodeTypeSub
# end class nodeTypeSub
class childnodeTypeSub(supermod.childnodeType):
def __init__(self, relation=None, refid=None, edgelabel=None):
supermod.childnodeType.__init__(self, relation, refid, edgelabel)
supermod.childnodeType.subclass = childnodeTypeSub
# end class childnodeTypeSub
class linkTypeSub(supermod.linkType):
def __init__(self, refid=None, external=None, valueOf_=''):
supermod.linkType.__init__(self, refid, external)
supermod.linkType.subclass = linkTypeSub
# end class linkTypeSub
class listingTypeSub(supermod.listingType):
def __init__(self, codeline=None):
supermod.listingType.__init__(self, codeline)
supermod.listingType.subclass = listingTypeSub
# end class listingTypeSub
class codelineTypeSub(supermod.codelineType):
def __init__(self, external=None, lineno=None, refkind=None, refid=None, highlight=None):
supermod.codelineType.__init__(self, external, lineno, refkind, refid, highlight)
supermod.codelineType.subclass = codelineTypeSub
# end class codelineTypeSub
class highlightTypeSub(supermod.highlightType):
def __init__(self, class_=None, sp=None, ref=None, mixedclass_=None, content_=None):
supermod.highlightType.__init__(self, mixedclass_, content_)
supermod.highlightType.subclass = highlightTypeSub
# end class highlightTypeSub
class referenceTypeSub(supermod.referenceType):
def __init__(self, endline=None, startline=None, refid=None, compoundref=None, valueOf_='', mixedclass_=None, content_=None):
supermod.referenceType.__init__(self, mixedclass_, content_)
supermod.referenceType.subclass = referenceTypeSub
# end class referenceTypeSub
class locationTypeSub(supermod.locationType):
def __init__(self, bodystart=None, line=None, bodyend=None, bodyfile=None, file=None, valueOf_=''):
supermod.locationType.__init__(self, bodystart, line, bodyend, bodyfile, file)
supermod.locationType.subclass = locationTypeSub
# end class locationTypeSub
class docSect1TypeSub(supermod.docSect1Type):
def __init__(self, id=None, title='', para=None, sect2=None, internal=None, mixedclass_=None, content_=None):
supermod.docSect1Type.__init__(self, mixedclass_, content_)
supermod.docSect1Type.subclass = docSect1TypeSub
# end class docSect1TypeSub
class docSect2TypeSub(supermod.docSect2Type):
def __init__(self, id=None, title='', para=None, sect3=None, internal=None, mixedclass_=None, content_=None):
supermod.docSect2Type.__init__(self, mixedclass_, content_)
supermod.docSect2Type.subclass = docSect2TypeSub
# end class docSect2TypeSub
class docSect3TypeSub(supermod.docSect3Type):
def __init__(self, id=None, title='', para=None, sect4=None, internal=None, mixedclass_=None, content_=None):
supermod.docSect3Type.__init__(self, mixedclass_, content_)
supermod.docSect3Type.subclass = docSect3TypeSub
# end class docSect3TypeSub
class docSect4TypeSub(supermod.docSect4Type):
def __init__(self, id=None, title='', para=None, internal=None, mixedclass_=None, content_=None):
supermod.docSect4Type.__init__(self, mixedclass_, content_)
supermod.docSect4Type.subclass = docSect4TypeSub
# end class docSect4TypeSub
class docInternalTypeSub(supermod.docInternalType):
def __init__(self, para=None, sect1=None, mixedclass_=None, content_=None):
supermod.docInternalType.__init__(self, mixedclass_, content_)
supermod.docInternalType.subclass = docInternalTypeSub
# end class docInternalTypeSub
class docInternalS1TypeSub(supermod.docInternalS1Type):
def __init__(self, para=None, sect2=None, mixedclass_=None, content_=None):
supermod.docInternalS1Type.__init__(self, mixedclass_, content_)
supermod.docInternalS1Type.subclass = docInternalS1TypeSub
# end class docInternalS1TypeSub
class docInternalS2TypeSub(supermod.docInternalS2Type):
def __init__(self, para=None, sect3=None, mixedclass_=None, content_=None):
supermod.docInternalS2Type.__init__(self, mixedclass_, content_)
supermod.docInternalS2Type.subclass = docInternalS2TypeSub
# end class docInternalS2TypeSub
class docInternalS3TypeSub(supermod.docInternalS3Type):
def __init__(self, para=None, sect3=None, mixedclass_=None, content_=None):
supermod.docInternalS3Type.__init__(self, mixedclass_, content_)
supermod.docInternalS3Type.subclass = docInternalS3TypeSub
# end class docInternalS3TypeSub
class docInternalS4TypeSub(supermod.docInternalS4Type):
def __init__(self, para=None, mixedclass_=None, content_=None):
supermod.docInternalS4Type.__init__(self, mixedclass_, content_)
supermod.docInternalS4Type.subclass = docInternalS4TypeSub
# end class docInternalS4TypeSub
class docURLLinkSub(supermod.docURLLink):
def __init__(self, url=None, valueOf_='', mixedclass_=None, content_=None):
supermod.docURLLink.__init__(self, mixedclass_, content_)
supermod.docURLLink.subclass = docURLLinkSub
# end class docURLLinkSub
class docAnchorTypeSub(supermod.docAnchorType):
def __init__(self, id=None, valueOf_='', mixedclass_=None, content_=None):
supermod.docAnchorType.__init__(self, mixedclass_, content_)
supermod.docAnchorType.subclass = docAnchorTypeSub
# end class docAnchorTypeSub
class docFormulaTypeSub(supermod.docFormulaType):
def __init__(self, id=None, valueOf_='', mixedclass_=None, content_=None):
supermod.docFormulaType.__init__(self, mixedclass_, content_)
supermod.docFormulaType.subclass = docFormulaTypeSub
# end class docFormulaTypeSub
class docIndexEntryTypeSub(supermod.docIndexEntryType):
def __init__(self, primaryie='', secondaryie=''):
supermod.docIndexEntryType.__init__(self, primaryie, secondaryie)
supermod.docIndexEntryType.subclass = docIndexEntryTypeSub
# end class docIndexEntryTypeSub
class docListTypeSub(supermod.docListType):
def __init__(self, listitem=None):
supermod.docListType.__init__(self, listitem)
supermod.docListType.subclass = docListTypeSub
# end class docListTypeSub
class docListItemTypeSub(supermod.docListItemType):
def __init__(self, para=None):
supermod.docListItemType.__init__(self, para)
supermod.docListItemType.subclass = docListItemTypeSub
# end class docListItemTypeSub
class docSimpleSectTypeSub(supermod.docSimpleSectType):
def __init__(self, kind=None, title=None, para=None):
supermod.docSimpleSectType.__init__(self, kind, title, para)
supermod.docSimpleSectType.subclass = docSimpleSectTypeSub
# end class docSimpleSectTypeSub
class docVarListEntryTypeSub(supermod.docVarListEntryType):
def __init__(self, term=None):
supermod.docVarListEntryType.__init__(self, term)
supermod.docVarListEntryType.subclass = docVarListEntryTypeSub
# end class docVarListEntryTypeSub
class docRefTextTypeSub(supermod.docRefTextType):
def __init__(self, refid=None, kindref=None, external=None, valueOf_='', mixedclass_=None, content_=None):
supermod.docRefTextType.__init__(self, mixedclass_, content_)
supermod.docRefTextType.subclass = docRefTextTypeSub
# end class docRefTextTypeSub
class docTableTypeSub(supermod.docTableType):
def __init__(self, rows=None, cols=None, row=None, caption=None):
supermod.docTableType.__init__(self, rows, cols, row, caption)
supermod.docTableType.subclass = docTableTypeSub
# end class docTableTypeSub
class docRowTypeSub(supermod.docRowType):
def __init__(self, entry=None):
supermod.docRowType.__init__(self, entry)
supermod.docRowType.subclass = docRowTypeSub
# end class docRowTypeSub
class docEntryTypeSub(supermod.docEntryType):
def __init__(self, thead=None, para=None):
supermod.docEntryType.__init__(self, thead, para)
supermod.docEntryType.subclass = docEntryTypeSub
# end class docEntryTypeSub
class docHeadingTypeSub(supermod.docHeadingType):
def __init__(self, level=None, valueOf_='', mixedclass_=None, content_=None):
supermod.docHeadingType.__init__(self, mixedclass_, content_)
supermod.docHeadingType.subclass = docHeadingTypeSub
# end class docHeadingTypeSub
class docImageTypeSub(supermod.docImageType):
def __init__(self, width=None, type_=None, name=None, height=None, valueOf_='', mixedclass_=None, content_=None):
supermod.docImageType.__init__(self, mixedclass_, content_)
supermod.docImageType.subclass = docImageTypeSub
# end class docImageTypeSub
class docDotFileTypeSub(supermod.docDotFileType):
def __init__(self, name=None, valueOf_='', mixedclass_=None, content_=None):
supermod.docDotFileType.__init__(self, mixedclass_, content_)
supermod.docDotFileType.subclass = docDotFileTypeSub
# end class docDotFileTypeSub
class docTocItemTypeSub(supermod.docTocItemType):
def __init__(self, id=None, valueOf_='', mixedclass_=None, content_=None):
supermod.docTocItemType.__init__(self, mixedclass_, content_)
supermod.docTocItemType.subclass = docTocItemTypeSub
# end class docTocItemTypeSub
class docTocListTypeSub(supermod.docTocListType):
def __init__(self, tocitem=None):
supermod.docTocListType.__init__(self, tocitem)
supermod.docTocListType.subclass = docTocListTypeSub
# end class docTocListTypeSub
class docLanguageTypeSub(supermod.docLanguageType):
def __init__(self, langid=None, para=None):
supermod.docLanguageType.__init__(self, langid, para)
supermod.docLanguageType.subclass = docLanguageTypeSub
# end class docLanguageTypeSub
class docParamListTypeSub(supermod.docParamListType):
def __init__(self, kind=None, parameteritem=None):
supermod.docParamListType.__init__(self, kind, parameteritem)
supermod.docParamListType.subclass = docParamListTypeSub
# end class docParamListTypeSub
class docParamListItemSub(supermod.docParamListItem):
def __init__(self, parameternamelist=None, parameterdescription=None):
supermod.docParamListItem.__init__(self, parameternamelist, parameterdescription)
supermod.docParamListItem.subclass = docParamListItemSub
# end class docParamListItemSub
class docParamNameListSub(supermod.docParamNameList):
def __init__(self, parametername=None):
supermod.docParamNameList.__init__(self, parametername)
supermod.docParamNameList.subclass = docParamNameListSub
# end class docParamNameListSub
class docParamNameSub(supermod.docParamName):
def __init__(self, direction=None, ref=None, mixedclass_=None, content_=None):
supermod.docParamName.__init__(self, mixedclass_, content_)
supermod.docParamName.subclass = docParamNameSub
# end class docParamNameSub
class docXRefSectTypeSub(supermod.docXRefSectType):
def __init__(self, id=None, xreftitle=None, xrefdescription=None):
supermod.docXRefSectType.__init__(self, id, xreftitle, xrefdescription)
supermod.docXRefSectType.subclass = docXRefSectTypeSub
# end class docXRefSectTypeSub
class docCopyTypeSub(supermod.docCopyType):
def __init__(self, link=None, para=None, sect1=None, internal=None):
supermod.docCopyType.__init__(self, link, para, sect1, internal)
supermod.docCopyType.subclass = docCopyTypeSub
# end class docCopyTypeSub
class docCharTypeSub(supermod.docCharType):
def __init__(self, char=None, valueOf_=''):
supermod.docCharType.__init__(self, char)
supermod.docCharType.subclass = docCharTypeSub
# end class docCharTypeSub
class docParaTypeSub(supermod.docParaType):
def __init__(self, char=None, valueOf_=''):
supermod.docParaType.__init__(self, char)
self.parameterlist = []
self.simplesects = []
self.content = []
def buildChildren(self, child_, nodeName_):
supermod.docParaType.buildChildren(self, child_, nodeName_)
if child_.nodeType == Node.TEXT_NODE:
obj_ = self.mixedclass_(MixedContainer.CategoryText,
MixedContainer.TypeNone, '', child_.nodeValue)
self.content.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and \
nodeName_ == "ref":
obj_ = supermod.docRefTextType.factory()
obj_.build(child_)
self.content.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and \
nodeName_ == 'parameterlist':
obj_ = supermod.docParamListType.factory()
obj_.build(child_)
self.parameterlist.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and \
nodeName_ == 'simplesect':
obj_ = supermod.docSimpleSectType.factory()
obj_.build(child_)
self.simplesects.append(obj_)
supermod.docParaType.subclass = docParaTypeSub
# end class docParaTypeSub
def parse(inFilename):
doc = minidom.parse(inFilename)
rootNode = doc.documentElement
rootObj = supermod.DoxygenType.factory()
rootObj.build(rootNode)
return rootObj

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,77 @@
#!/usr/bin/env python
"""
Generated Mon Feb 9 19:08:05 2009 by generateDS.py.
"""
from xml.dom import minidom
import os
import sys
import compound
import indexsuper as supermod
class DoxygenTypeSub(supermod.DoxygenType):
def __init__(self, version=None, compound=None):
supermod.DoxygenType.__init__(self, version, compound)
def find_compounds_and_members(self, details):
"""
Returns a list of all compounds and their members which match details
"""
results = []
for compound in self.compound:
members = compound.find_members(details)
if members:
results.append([compound, members])
else:
if details.match(compound):
results.append([compound, []])
return results
supermod.DoxygenType.subclass = DoxygenTypeSub
# end class DoxygenTypeSub
class CompoundTypeSub(supermod.CompoundType):
def __init__(self, kind=None, refid=None, name='', member=None):
supermod.CompoundType.__init__(self, kind, refid, name, member)
def find_members(self, details):
"""
Returns a list of all members which match details
"""
results = []
for member in self.member:
if details.match(member):
results.append(member)
return results
supermod.CompoundType.subclass = CompoundTypeSub
# end class CompoundTypeSub
class MemberTypeSub(supermod.MemberType):
def __init__(self, kind=None, refid=None, name=''):
supermod.MemberType.__init__(self, kind, refid, name)
supermod.MemberType.subclass = MemberTypeSub
# end class MemberTypeSub
def parse(inFilename):
doc = minidom.parse(inFilename)
rootNode = doc.documentElement
rootObj = supermod.DoxygenType.factory()
rootObj.build(rootNode)
return rootObj

View File

@ -0,0 +1,523 @@
#!/usr/bin/env python
#
# Generated Thu Jun 11 18:43:54 2009 by generateDS.py.
#
import sys
import getopt
from string import lower as str_lower
from xml.dom import minidom
from xml.dom import Node
#
# User methods
#
# Calls to the methods in these classes are generated by generateDS.py.
# You can replace these methods by re-implementing the following class
# in a module named generatedssuper.py.
try:
from generatedssuper import GeneratedsSuper
except ImportError, exp:
class GeneratedsSuper:
def format_string(self, input_data, input_name=''):
return input_data
def format_integer(self, input_data, input_name=''):
return '%d' % input_data
def format_float(self, input_data, input_name=''):
return '%f' % input_data
def format_double(self, input_data, input_name=''):
return '%e' % input_data
def format_boolean(self, input_data, input_name=''):
return '%s' % input_data
#
# If you have installed IPython you can uncomment and use the following.
# IPython is available from http://ipython.scipy.org/.
#
## from IPython.Shell import IPShellEmbed
## args = ''
## ipshell = IPShellEmbed(args,
## banner = 'Dropping into IPython',
## exit_msg = 'Leaving Interpreter, back to program.')
# Then use the following line where and when you want to drop into the
# IPython shell:
# ipshell('<some message> -- Entering ipshell.\nHit Ctrl-D to exit')
#
# Globals
#
ExternalEncoding = 'ascii'
#
# Support/utility functions.
#
def showIndent(outfile, level):
for idx in range(level):
outfile.write(' ')
def quote_xml(inStr):
s1 = (isinstance(inStr, basestring) and inStr or
'%s' % inStr)
s1 = s1.replace('&', '&amp;')
s1 = s1.replace('<', '&lt;')
s1 = s1.replace('>', '&gt;')
return s1
def quote_attrib(inStr):
s1 = (isinstance(inStr, basestring) and inStr or
'%s' % inStr)
s1 = s1.replace('&', '&amp;')
s1 = s1.replace('<', '&lt;')
s1 = s1.replace('>', '&gt;')
if '"' in s1:
if "'" in s1:
s1 = '"%s"' % s1.replace('"', "&quot;")
else:
s1 = "'%s'" % s1
else:
s1 = '"%s"' % s1
return s1
def quote_python(inStr):
s1 = inStr
if s1.find("'") == -1:
if s1.find('\n') == -1:
return "'%s'" % s1
else:
return "'''%s'''" % s1
else:
if s1.find('"') != -1:
s1 = s1.replace('"', '\\"')
if s1.find('\n') == -1:
return '"%s"' % s1
else:
return '"""%s"""' % s1
class MixedContainer:
# Constants for category:
CategoryNone = 0
CategoryText = 1
CategorySimple = 2
CategoryComplex = 3
# Constants for content_type:
TypeNone = 0
TypeText = 1
TypeString = 2
TypeInteger = 3
TypeFloat = 4
TypeDecimal = 5
TypeDouble = 6
TypeBoolean = 7
def __init__(self, category, content_type, name, value):
self.category = category
self.content_type = content_type
self.name = name
self.value = value
def getCategory(self):
return self.category
def getContenttype(self, content_type):
return self.content_type
def getValue(self):
return self.value
def getName(self):
return self.name
def export(self, outfile, level, name, namespace):
if self.category == MixedContainer.CategoryText:
outfile.write(self.value)
elif self.category == MixedContainer.CategorySimple:
self.exportSimple(outfile, level, name)
else: # category == MixedContainer.CategoryComplex
self.value.export(outfile, level, namespace,name)
def exportSimple(self, outfile, level, name):
if self.content_type == MixedContainer.TypeString:
outfile.write('<%s>%s</%s>' % (self.name, self.value, self.name))
elif self.content_type == MixedContainer.TypeInteger or \
self.content_type == MixedContainer.TypeBoolean:
outfile.write('<%s>%d</%s>' % (self.name, self.value, self.name))
elif self.content_type == MixedContainer.TypeFloat or \
self.content_type == MixedContainer.TypeDecimal:
outfile.write('<%s>%f</%s>' % (self.name, self.value, self.name))
elif self.content_type == MixedContainer.TypeDouble:
outfile.write('<%s>%g</%s>' % (self.name, self.value, self.name))
def exportLiteral(self, outfile, level, name):
if self.category == MixedContainer.CategoryText:
showIndent(outfile, level)
outfile.write('MixedContainer(%d, %d, "%s", "%s"),\n' % \
(self.category, self.content_type, self.name, self.value))
elif self.category == MixedContainer.CategorySimple:
showIndent(outfile, level)
outfile.write('MixedContainer(%d, %d, "%s", "%s"),\n' % \
(self.category, self.content_type, self.name, self.value))
else: # category == MixedContainer.CategoryComplex
showIndent(outfile, level)
outfile.write('MixedContainer(%d, %d, "%s",\n' % \
(self.category, self.content_type, self.name,))
self.value.exportLiteral(outfile, level + 1)
showIndent(outfile, level)
outfile.write(')\n')
class _MemberSpec(object):
def __init__(self, name='', data_type='', container=0):
self.name = name
self.data_type = data_type
self.container = container
def set_name(self, name): self.name = name
def get_name(self): return self.name
def set_data_type(self, data_type): self.data_type = data_type
def get_data_type(self): return self.data_type
def set_container(self, container): self.container = container
def get_container(self): return self.container
#
# Data representation classes.
#
class DoxygenType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, version=None, compound=None):
self.version = version
if compound is None:
self.compound = []
else:
self.compound = compound
def factory(*args_, **kwargs_):
if DoxygenType.subclass:
return DoxygenType.subclass(*args_, **kwargs_)
else:
return DoxygenType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_compound(self): return self.compound
def set_compound(self, compound): self.compound = compound
def add_compound(self, value): self.compound.append(value)
def insert_compound(self, index, value): self.compound[index] = value
def get_version(self): return self.version
def set_version(self, version): self.version = version
def export(self, outfile, level, namespace_='', name_='DoxygenType', namespacedef_=''):
showIndent(outfile, level)
outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))
self.exportAttributes(outfile, level, namespace_, name_='DoxygenType')
if self.hasContent_():
outfile.write('>\n')
self.exportChildren(outfile, level + 1, namespace_, name_)
showIndent(outfile, level)
outfile.write('</%s%s>\n' % (namespace_, name_))
else:
outfile.write(' />\n')
def exportAttributes(self, outfile, level, namespace_='', name_='DoxygenType'):
outfile.write(' version=%s' % (self.format_string(quote_attrib(self.version).encode(ExternalEncoding), input_name='version'), ))
def exportChildren(self, outfile, level, namespace_='', name_='DoxygenType'):
for compound_ in self.compound:
compound_.export(outfile, level, namespace_, name_='compound')
def hasContent_(self):
if (
self.compound is not None
):
return True
else:
return False
def exportLiteral(self, outfile, level, name_='DoxygenType'):
level += 1
self.exportLiteralAttributes(outfile, level, name_)
if self.hasContent_():
self.exportLiteralChildren(outfile, level, name_)
def exportLiteralAttributes(self, outfile, level, name_):
if self.version is not None:
showIndent(outfile, level)
outfile.write('version = %s,\n' % (self.version,))
def exportLiteralChildren(self, outfile, level, name_):
showIndent(outfile, level)
outfile.write('compound=[\n')
level += 1
for compound in self.compound:
showIndent(outfile, level)
outfile.write('model_.compound(\n')
compound.exportLiteral(outfile, level, name_='compound')
showIndent(outfile, level)
outfile.write('),\n')
level -= 1
showIndent(outfile, level)
outfile.write('],\n')
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(':')[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
if attrs.get('version'):
self.version = attrs.get('version').value
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and \
nodeName_ == 'compound':
obj_ = CompoundType.factory()
obj_.build(child_)
self.compound.append(obj_)
# end class DoxygenType
class CompoundType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, kind=None, refid=None, name=None, member=None):
self.kind = kind
self.refid = refid
self.name = name
if member is None:
self.member = []
else:
self.member = member
def factory(*args_, **kwargs_):
if CompoundType.subclass:
return CompoundType.subclass(*args_, **kwargs_)
else:
return CompoundType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_name(self): return self.name
def set_name(self, name): self.name = name
def get_member(self): return self.member
def set_member(self, member): self.member = member
def add_member(self, value): self.member.append(value)
def insert_member(self, index, value): self.member[index] = value
def get_kind(self): return self.kind
def set_kind(self, kind): self.kind = kind
def get_refid(self): return self.refid
def set_refid(self, refid): self.refid = refid
def export(self, outfile, level, namespace_='', name_='CompoundType', namespacedef_=''):
showIndent(outfile, level)
outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))
self.exportAttributes(outfile, level, namespace_, name_='CompoundType')
if self.hasContent_():
outfile.write('>\n')
self.exportChildren(outfile, level + 1, namespace_, name_)
showIndent(outfile, level)
outfile.write('</%s%s>\n' % (namespace_, name_))
else:
outfile.write(' />\n')
def exportAttributes(self, outfile, level, namespace_='', name_='CompoundType'):
outfile.write(' kind=%s' % (quote_attrib(self.kind), ))
outfile.write(' refid=%s' % (self.format_string(quote_attrib(self.refid).encode(ExternalEncoding), input_name='refid'), ))
def exportChildren(self, outfile, level, namespace_='', name_='CompoundType'):
if self.name is not None:
showIndent(outfile, level)
outfile.write('<%sname>%s</%sname>\n' % (namespace_, self.format_string(quote_xml(self.name).encode(ExternalEncoding), input_name='name'), namespace_))
for member_ in self.member:
member_.export(outfile, level, namespace_, name_='member')
def hasContent_(self):
if (
self.name is not None or
self.member is not None
):
return True
else:
return False
def exportLiteral(self, outfile, level, name_='CompoundType'):
level += 1
self.exportLiteralAttributes(outfile, level, name_)
if self.hasContent_():
self.exportLiteralChildren(outfile, level, name_)
def exportLiteralAttributes(self, outfile, level, name_):
if self.kind is not None:
showIndent(outfile, level)
outfile.write('kind = "%s",\n' % (self.kind,))
if self.refid is not None:
showIndent(outfile, level)
outfile.write('refid = %s,\n' % (self.refid,))
def exportLiteralChildren(self, outfile, level, name_):
showIndent(outfile, level)
outfile.write('name=%s,\n' % quote_python(self.name).encode(ExternalEncoding))
showIndent(outfile, level)
outfile.write('member=[\n')
level += 1
for member in self.member:
showIndent(outfile, level)
outfile.write('model_.member(\n')
member.exportLiteral(outfile, level, name_='member')
showIndent(outfile, level)
outfile.write('),\n')
level -= 1
showIndent(outfile, level)
outfile.write('],\n')
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(':')[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
if attrs.get('kind'):
self.kind = attrs.get('kind').value
if attrs.get('refid'):
self.refid = attrs.get('refid').value
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and \
nodeName_ == 'name':
name_ = ''
for text__content_ in child_.childNodes:
name_ += text__content_.nodeValue
self.name = name_
elif child_.nodeType == Node.ELEMENT_NODE and \
nodeName_ == 'member':
obj_ = MemberType.factory()
obj_.build(child_)
self.member.append(obj_)
# end class CompoundType
class MemberType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, kind=None, refid=None, name=None):
self.kind = kind
self.refid = refid
self.name = name
def factory(*args_, **kwargs_):
if MemberType.subclass:
return MemberType.subclass(*args_, **kwargs_)
else:
return MemberType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_name(self): return self.name
def set_name(self, name): self.name = name
def get_kind(self): return self.kind
def set_kind(self, kind): self.kind = kind
def get_refid(self): return self.refid
def set_refid(self, refid): self.refid = refid
def export(self, outfile, level, namespace_='', name_='MemberType', namespacedef_=''):
showIndent(outfile, level)
outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))
self.exportAttributes(outfile, level, namespace_, name_='MemberType')
if self.hasContent_():
outfile.write('>\n')
self.exportChildren(outfile, level + 1, namespace_, name_)
showIndent(outfile, level)
outfile.write('</%s%s>\n' % (namespace_, name_))
else:
outfile.write(' />\n')
def exportAttributes(self, outfile, level, namespace_='', name_='MemberType'):
outfile.write(' kind=%s' % (quote_attrib(self.kind), ))
outfile.write(' refid=%s' % (self.format_string(quote_attrib(self.refid).encode(ExternalEncoding), input_name='refid'), ))
def exportChildren(self, outfile, level, namespace_='', name_='MemberType'):
if self.name is not None:
showIndent(outfile, level)
outfile.write('<%sname>%s</%sname>\n' % (namespace_, self.format_string(quote_xml(self.name).encode(ExternalEncoding), input_name='name'), namespace_))
def hasContent_(self):
if (
self.name is not None
):
return True
else:
return False
def exportLiteral(self, outfile, level, name_='MemberType'):
level += 1
self.exportLiteralAttributes(outfile, level, name_)
if self.hasContent_():
self.exportLiteralChildren(outfile, level, name_)
def exportLiteralAttributes(self, outfile, level, name_):
if self.kind is not None:
showIndent(outfile, level)
outfile.write('kind = "%s",\n' % (self.kind,))
if self.refid is not None:
showIndent(outfile, level)
outfile.write('refid = %s,\n' % (self.refid,))
def exportLiteralChildren(self, outfile, level, name_):
showIndent(outfile, level)
outfile.write('name=%s,\n' % quote_python(self.name).encode(ExternalEncoding))
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(':')[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
if attrs.get('kind'):
self.kind = attrs.get('kind').value
if attrs.get('refid'):
self.refid = attrs.get('refid').value
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and \
nodeName_ == 'name':
name_ = ''
for text__content_ in child_.childNodes:
name_ += text__content_.nodeValue
self.name = name_
# end class MemberType
USAGE_TEXT = """
Usage: python <Parser>.py [ -s ] <in_xml_file>
Options:
-s Use the SAX parser, not the minidom parser.
"""
def usage():
print USAGE_TEXT
sys.exit(1)
def parse(inFileName):
doc = minidom.parse(inFileName)
rootNode = doc.documentElement
rootObj = DoxygenType.factory()
rootObj.build(rootNode)
# Enable Python to collect the space used by the DOM.
doc = None
sys.stdout.write('<?xml version="1.0" ?>\n')
rootObj.export(sys.stdout, 0, name_="doxygenindex",
namespacedef_='')
return rootObj
def parseString(inString):
doc = minidom.parseString(inString)
rootNode = doc.documentElement
rootObj = DoxygenType.factory()
rootObj.build(rootNode)
# Enable Python to collect the space used by the DOM.
doc = None
sys.stdout.write('<?xml version="1.0" ?>\n')
rootObj.export(sys.stdout, 0, name_="doxygenindex",
namespacedef_='')
return rootObj
def parseLiteral(inFileName):
doc = minidom.parse(inFileName)
rootNode = doc.documentElement
rootObj = DoxygenType.factory()
rootObj.build(rootNode)
# Enable Python to collect the space used by the DOM.
doc = None
sys.stdout.write('from index import *\n\n')
sys.stdout.write('rootObj = doxygenindex(\n')
rootObj.exportLiteral(sys.stdout, 0, name_="doxygenindex")
sys.stdout.write(')\n')
return rootObj
def main():
args = sys.argv[1:]
if len(args) == 1:
parse(args[0])
else:
usage()
if __name__ == '__main__':
main()
#import pdb
#pdb.run('main()')

View File

@ -0,0 +1,56 @@
#
# 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 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.
#
"""
Utilities for extracting text from generated classes.
"""
def is_string(txt):
if isinstance(txt, str):
return True
try:
if isinstance(txt, unicode):
return True
except NameError:
pass
return False
def description(obj):
if obj is None:
return None
return description_bit(obj).strip()
def description_bit(obj):
if hasattr(obj, 'content'):
contents = [description_bit(item) for item in obj.content]
result = ''.join(contents)
elif hasattr(obj, 'content_'):
contents = [description_bit(item) for item in obj.content_]
result = ''.join(contents)
elif hasattr(obj, 'value'):
result = description_bit(obj.value)
elif is_string(obj):
return obj
else:
raise StandardError('Expecting a string or something with content, content_ or value attribute')
# If this bit is a paragraph then add one some line breaks.
if hasattr(obj, 'name') and obj.name == 'para':
result += "\n\n"
return result

View File

@ -0,0 +1,7 @@
/*!
* \defgroup block GNU Radio HOWTO C++ Signal Processing Blocks
* \brief All C++ blocks that can be used from the HOWTO GNU Radio
* module are listed here or in the subcategories below.
*
*/

View File

@ -0,0 +1,10 @@
/*! \mainpage
Welcome to the GNU Radio HOWTO Block
This is the intro page for the Doxygen manual generated for the HOWTO
block (docs/doxygen/other/main_page.dox). Edit it to add more detailed
documentation about the new GNU Radio modules contained in this
project.
*/

View File

@ -0,0 +1,255 @@
#
# Copyright 2010,2011 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.
#
"""
Creates the swig_doc.i SWIG interface file.
Execute using: python swig_doc.py xml_path outputfilename
The file instructs SWIG to transfer the doxygen comments into the
python docstrings.
"""
import sys
try:
from doxyxml import DoxyIndex, DoxyClass, DoxyFriend, DoxyFunction, DoxyFile, base
except ImportError:
from gnuradio.doxyxml import DoxyIndex, DoxyClass, DoxyFriend, DoxyFunction, DoxyFile, base
def py_name(name):
bits = name.split('_')
return '_'.join(bits[1:])
def make_name(name):
bits = name.split('_')
return bits[0] + '_make_' + '_'.join(bits[1:])
class Block(object):
"""
Checks if doxyxml produced objects correspond to a gnuradio block.
"""
@classmethod
def includes(cls, item):
if not isinstance(item, DoxyClass):
return False
# Check for a parsing error.
if item.error():
return False
return item.has_member(make_name(item.name()), DoxyFriend)
def utoascii(text):
"""
Convert unicode text into ascii and escape quotes.
"""
if text is None:
return ''
out = text.encode('ascii', 'replace')
out = out.replace('"', '\\"')
return out
def combine_descriptions(obj):
"""
Combines the brief and detailed descriptions of an object together.
"""
description = []
bd = obj.brief_description.strip()
dd = obj.detailed_description.strip()
if bd:
description.append(bd)
if dd:
description.append(dd)
return utoascii('\n\n'.join(description)).strip()
entry_templ = '%feature("docstring") {name} "{docstring}"'
def make_entry(obj, name=None, templ="{description}", description=None):
"""
Create a docstring entry for a swig interface file.
obj - a doxyxml object from which documentation will be extracted.
name - the name of the C object (defaults to obj.name())
templ - an optional template for the docstring containing only one
variable named 'description'.
description - if this optional variable is set then it's value is
used as the description instead of extracting it from obj.
"""
if name is None:
name=obj.name()
if "operator " in name:
return ''
if description is None:
description = combine_descriptions(obj)
docstring = templ.format(description=description)
if not docstring:
return ''
return entry_templ.format(
name=name,
docstring=docstring,
)
def make_func_entry(func, name=None, description=None, params=None):
"""
Create a function docstring entry for a swig interface file.
func - a doxyxml object from which documentation will be extracted.
name - the name of the C object (defaults to func.name())
description - if this optional variable is set then it's value is
used as the description instead of extracting it from func.
params - a parameter list that overrides using func.params.
"""
if params is None:
params = func.params
params = [prm.declname for prm in params]
if params:
sig = "Params: (%s)" % ", ".join(params)
else:
sig = "Params: (NONE)"
templ = "{description}\n\n" + sig
return make_entry(func, name=name, templ=utoascii(templ),
description=description)
def make_class_entry(klass, description=None):
"""
Create a class docstring for a swig interface file.
"""
output = []
output.append(make_entry(klass, description=description))
for func in klass.in_category(DoxyFunction):
name = klass.name() + '::' + func.name()
output.append(make_func_entry(func, name=name))
return "\n\n".join(output)
def make_block_entry(di, block):
"""
Create class and function docstrings of a gnuradio block for a
swig interface file.
"""
descriptions = []
# Get the documentation associated with the class.
class_desc = combine_descriptions(block)
if class_desc:
descriptions.append(class_desc)
# Get the documentation associated with the make function
make_func = di.get_member(make_name(block.name()), DoxyFunction)
make_func_desc = combine_descriptions(make_func)
if make_func_desc:
descriptions.append(make_func_desc)
# Get the documentation associated with the file
try:
block_file = di.get_member(block.name() + ".h", DoxyFile)
file_desc = combine_descriptions(block_file)
if file_desc:
descriptions.append(file_desc)
except base.Base.NoSuchMember:
# Don't worry if we can't find a matching file.
pass
# And join them all together to make a super duper description.
super_description = "\n\n".join(descriptions)
# Associate the combined description with the class and
# the make function.
output = []
output.append(make_class_entry(block, description=super_description))
creator = block.get_member(block.name(), DoxyFunction)
output.append(make_func_entry(make_func, description=super_description,
params=creator.params))
return "\n\n".join(output)
def make_swig_interface_file(di, swigdocfilename, custom_output=None):
output = ["""
/*
* This file was automatically generated using swig_doc.py.
*
* Any changes to it will be lost next time it is regenerated.
*/
"""]
if custom_output is not None:
output.append(custom_output)
# Create docstrings for the blocks.
blocks = di.in_category(Block)
make_funcs = set([])
for block in blocks:
try:
make_func = di.get_member(make_name(block.name()), DoxyFunction)
make_funcs.add(make_func.name())
output.append(make_block_entry(di, block))
except block.ParsingError:
print('Parsing error for block %s' % block.name())
# Create docstrings for functions
# Don't include the make functions since they have already been dealt with.
funcs = [f for f in di.in_category(DoxyFunction) if f.name() not in make_funcs]
for f in funcs:
try:
output.append(make_func_entry(f))
except f.ParsingError:
print('Parsing error for function %s' % f.name())
# Create docstrings for classes
block_names = [block.name() for block in blocks]
klasses = [k for k in di.in_category(DoxyClass) if k.name() not in block_names]
for k in klasses:
try:
output.append(make_class_entry(k))
except k.ParsingError:
print('Parsing error for class %s' % k.name())
# Docstrings are not created for anything that is not a function or a class.
# If this excludes anything important please add it here.
output = "\n\n".join(output)
swig_doc = file(swigdocfilename, 'w')
swig_doc.write(output)
swig_doc.close()
if __name__ == "__main__":
# Parse command line options and set up doxyxml.
err_msg = "Execute using: python swig_doc.py xml_path outputfilename"
if len(sys.argv) != 3:
raise StandardError(err_msg)
xml_path = sys.argv[1]
swigdocfilename = sys.argv[2]
di = DoxyIndex(xml_path)
# gnuradio.gr.msq_queue.insert_tail and delete_head create errors unless docstrings are defined!
# This is presumably a bug in SWIG.
#msg_q = di.get_member(u'gr_msg_queue', DoxyClass)
#insert_tail = msg_q.get_member(u'insert_tail', DoxyFunction)
#delete_head = msg_q.get_member(u'delete_head', DoxyFunction)
output = []
#output.append(make_func_entry(insert_tail, name='gr_py_msg_queue__insert_tail'))
#output.append(make_func_entry(delete_head, name='gr_py_msg_queue__delete_head'))
custom_output = "\n\n".join(output)
# Generate the docstrings interface file.
make_swig_interface_file(di, swigdocfilename, custom_output=custom_output)

View File

@ -0,0 +1,23 @@
# Copyright 2011 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.
install(FILES
gn3s_source_cc.xml
DESTINATION share/gnuradio/grc/blocks
)

View File

@ -0,0 +1,13 @@
<?xml version="1.0"?>
<block>
<name>gn3s_source</name>
<key>gn3s_source_cc</key>
<category>GN3S</category>
<import>import gn3s</import>
<make>gn3s.source_cc()</make>
<source>
<name>out</name>
<type>complex</type>
</source>
</block>

View File

@ -0,0 +1,33 @@
# Copyright 2011 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.
########################################################################
# Install public header files
########################################################################
install(FILES
gn3s_api.h
gn3s_source_cc.h
gn3s_source.h
gn3s_defines.h
gn3s.h
fusb.h
libusb_types.h
fusb_linux.h
DESTINATION include/gn3s
)

View File

@ -0,0 +1,138 @@
/* -*- 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 "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_ */

View File

@ -0,0 +1,116 @@
/* -*- 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_ */

View File

@ -0,0 +1,142 @@
/*----------------------------------------------------------------------------------------------*/
/*! \file gn3s.h
//
// FILENAME: gn3s.h
//
// DESCRIPTION: Defines the GN3S class.
//
// DEVELOPERS: Gregory W. Heckler (2003-2009)
//
// LICENSE TERMS: Copyright (c) Gregory W. Heckler 2009
//
// This file is part of the GPS Software Defined Radio (GPS-SDR)
//
// The GPS-SDR is free software; you can redistribute it and/or modify it under the terms of the
// GNU General Public License as published by the Free Software Foundation; either version 2 of
// the License, or (at your option) any later version. The GPS-SDR 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.
//
// Note: Comments within this file follow a syntax that is compatible with
// DOXYGEN and are utilized for automated document extraction
//
// Reference:
*/
/*----------------------------------------------------------------------------------------------*/
#ifndef GN3S_H_
#define GN3S_H_
/* Includes */
/*--------------------------------------------------------------*/
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <math.h>
#include "fusb.h"
#include "fusb_linux.h"
//#include "usrp_bytesex.h"
//#include "usrp_prims.h"
/*--------------------------------------------------------------*/
/* FX2 Configuration Structure */
/*--------------------------------------------------------------*/
struct fx2Config
{
int interface;
int altinterface;
usb_dev_handle *udev;
fusb_ephandle *d_ephandle;
fusb_devhandle *d_devhandle;
};
/*--------------------------------------------------------------*/
/* FX2 Stuff */
/*--------------------------------------------------------------*/
#define RX_ENDPOINT (0x86)
#define VRT_VENDOR_IN (0xC0)
#define VRT_VENDOR_OUT (0x40)
#define RX_INTERFACE (2)
#define RX_ALTINTERFACE (0)
#define VRQ_GET_STATUS (0x80)
#define GS_RX_OVERRUN (1) //!< Returns 1 byte
#define VRQ_XFER (0x01)
/*--------------------------------------------------------------*/
/* GN3S Stuff */
/*--------------------------------------------------------------*/
#define GN3S_VID (0x16C0)
#define GN3S_PID (0x072F)
#define VID_OLD (0x1781)
#define PID_OLD (0x0B39)
#define PROG_SET_CMD (0xE600)
#define FUSB_BUFFER_SIZE (16 * (1L << 20)) //!< 8 MB
#define FUSB_BLOCK_SIZE (16 * (1L << 10)) //!< 16KB is hard limit
#define FUSB_NBLOCKS (FUSB_BUFFER_SIZE / FUSB_BLOCK_SIZE)
/*--------------------------------------------------------------*/
/* The firmware is embedded into the executable */
/*--------------------------------------------------------------*/
extern char _binary_usrp_gn3s_firmware_ihx_start[];
/*--------------------------------------------------------------*/
/*--------------------------------------------------------------*/
/*! \ingroup CLASSES
*
*/
class gn3s
{
private:
/* First or second board */
int which;
/* GN3S FX2 Stuff */
struct fx2Config fx2_config;
struct usb_device *fx2_device;
struct usb_dev_handle *fx2_handle;
/* USB IDs */
unsigned int gn3s_vid, gn3s_pid;
/* Pull in the binary firmware */
int fstart;
int fsize;
//char *gn3s_firmware;
public:
gn3s(int _which); //!< Constructor
~gn3s(); //!< Destructor
/* FX2 functions */
struct usb_device* usb_fx2_find(int vid, int pid, char info, int ignore);
bool usb_fx2_configure(struct usb_device *fx2, fx2Config *fx2c);
fusb_devhandle* make_devhandle (usb_dev_handle *udh);
int read(void *buff, int bytes);
int write_cmd(int request, int value, int index, unsigned char *bytes, int len);
bool _get_status(int which, bool *trouble);
bool check_rx_overrun();
bool usrp_xfer(char VRQ_TYPE, bool start);
/* Used to flash the GN3S */
int atoz(char *s);
void upload_ram(char *buf, int start, int len);
void program_fx2(char *filename, char mem);
int prog_gn3s_board();
};
/*--------------------------------------------------------------*/
#endif /*GN3S_H_ */

View File

@ -0,0 +1,42 @@
/*!
* \file gn3s_api.h
* \brief GNU Radio source block to acces to SiGe GN3S USB sampler.
* \author Javier Arribas, 2012. jarribas(at)cttc.es
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2012 (see AUTHORS file for a list of contributors)
*
* GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver
*
* This file is part of GNSS-SDR.
*
* GNSS-SDR 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.
*
* GNSS-SDR 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 GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
*
* -------------------------------------------------------------------------
*/
#ifndef INCLUDED_GN3S_API_H
#define INCLUDED_GN3S_API_H
#include <gruel/attributes.h>
#ifdef gr_gn3s_EXPORTS
# define GN3S_API __GR_ATTR_EXPORT
#else
# define GN3S_API __GR_ATTR_IMPORT
#endif
#endif /* INCLUDED_GN3S_API_H */

View File

@ -0,0 +1,25 @@
#ifndef GN3S_DEFINES_H_
#define GN3S_DEFINES_H_
typedef struct GN3S_CPX
{
short int i; //!< Real value
short int q; //!< Imaginary value
} GN3S_CPX;
//#define GN3S_SAMPS_MS (2048) //!< All incoming signals are resampled to this sampling frequency
#define GN3S_SAMPS_5MS (40919) // 5MS at fs=8.1838e6
//!< FIFO structure for linked list?
/*----------------------------------------------------------------------------------------------*/
/*! \ingroup STRUCTS
* @brief linked list structure for circular FIFO buffer */
typedef struct gn3s_ms_packet {
gn3s_ms_packet *next;
int count; //!< Number of packets
GN3S_CPX data[GN3S_SAMPS_5MS]; //!< Payload size
} gn3s_ms_packet;
/*----------------------------------------------------------------------------------------------*/
#endif //GN3S_DEFINES_H_

View File

@ -0,0 +1,80 @@
/*----------------------------------------------------------------------------------------------*/
//
// FILENAME: gps_source.h
//
// DESCRIPTION: Defines the GPS_Source class.
//
// DEVELOPERS: Gregory W. Heckler (2003-2009)
//
// LICENSE TERMS: Copyright (c) Gregory W. Heckler 2009
//
// This file is part of the GPS Software Defined Radio (GPS-SDR)
//
// The GPS-SDR is free software; you can redistribute it and/or modify it under the terms of the
// GNU General Public License as published by the Free Software Foundation; either version 2 of
// the License, or (at your option) any later version. The GPS-SDR 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.
//
// Note: Comments within this file follow a syntax that is compatible with
// DOXYGEN and are utilized for automated document extraction
//
// Reference:
/*----------------------------------------------------------------------------------------------*/
#ifndef GN3S_SOURCE_H_
#define GN3S_SOURCE_H_
#include "gn3s_defines.h"
#include "gn3s.h"
/*! \ingroup CLASSES
*
*/
class gn3s_Source
{
private:
/* Generic variables */
int source_type; //!< Source type
int sample_mode; //!< Sample mode
int leftover; //!< Leftover bytes for USRP double buffering
int bwrite; //!< Bytes somthing something?
int ms_count; //!< Count the numbers of ms processed
bool flag_first_read;
/* Tag overflows */
time_t rawtime;
struct tm * timeinfo;
/* AGC Values */
int agc_scale; //!< To do the AGC
int overflw; //!< Overflow counter
int soverflw; //!< Overflow counter
/* Data buffers */
signed char gbuff[GN3S_SAMPS_5MS*2]; //!< Byte buffer for GN3S
GN3S_CPX buff[GN3S_SAMPS_5MS]; //!< Base buffer for GN3S
/* SOURCE_SIGE_GN3S Handles */
gn3s *gn3s_a;
private:
void Open_GN3S(); //!< Open the SparkFun GN3S Sampler
void Close_GN3S(); //!< Close the SparkFun GN3S Sampler
void Read_GN3S(gn3s_ms_packet *_p,int n_samples); //!< Read from the SparkFun GN3S Sampler
public:
gn3s_Source(); //!< Create the GPS source with the proper hardware type
~gn3s_Source(); //!< Kill the object
void Read(gn3s_ms_packet *_p,int n_samples); //!< Read in a single ms of data
int getScale(){return(agc_scale);}
int getOvrflw(){return(overflw);}
};
#endif /* GN3S_SOURCE_H_ */

View File

@ -0,0 +1,96 @@
/*!
* \file gn3s_source_cc.h
* \brief GNU Radio source block to acces to SiGe GN3S USB sampler v2.
* \author Javier Arribas, 2012. jarribas(at)cttc.es
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2012 (see AUTHORS file for a list of contributors)
*
* GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver
*
* This file is part of GNSS-SDR.
*
* GNSS-SDR 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.
*
* GNSS-SDR 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 GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
*
* -------------------------------------------------------------------------
*/
#ifndef INCLUDED_GN3S_SOURCE_CC_H
#define INCLUDED_GN3S_SOURCE_CC_H
#include "gn3s_api.h"
#include <gr_block.h>
#include "gn3s_source.h"
#include "gn3s_defines.h"
class gn3s_source_cc;
/*
* We use boost::shared_ptr's instead of raw pointers for all access
* to gr_blocks (and many other data structures). The shared_ptr gets
* us transparent reference counting, which greatly simplifies storage
* management issues. This is especially helpful in our hybrid
* C++ / Python system.
*
* See http://www.boost.org/libs/smart_ptr/smart_ptr.htm
*
* As a convention, the _sptr suffix indicates a boost::shared_ptr
*/
typedef boost::shared_ptr<gn3s_source_cc> gn3s_source_cc_sptr;
/*!
* \brief Return a shared_ptr to a new instance of howto_square_ff.
*
* To avoid accidental use of raw pointers, gn3s_source's
* constructor is private. gn3s_source is the public
* interface for creating new instances.
*/
GN3S_API gn3s_source_cc_sptr gn3s_make_source_cc ();
/*!
* \brief SiGe GN3S V2 sampler USB driver.
* \ingroup block
*
* \sa gn3s_source for a version that subclasses gr_block.
*/
class GN3S_API gn3s_source_cc : public gr_block
{
private:
// The friend declaration allows gn3s_source to
// access the private constructor.
/* Create the GN3S object*/
gn3s_Source *gn3s_drv;
gn3s_ms_packet packet;
friend GN3S_API gn3s_source_cc_sptr gn3s_make_source_cc ();
/*!
* \brief
*/
gn3s_source_cc (); // private constructor
public:
~gn3s_source_cc (); // public destructor
// Where all the action really happens
int general_work (int noutput_items,
gr_vector_int &ninput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items);
};
#endif /* INCLUDED_GN3S_SOURCE_CC_H */

View File

@ -0,0 +1,38 @@
/* -*- 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 0
#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_ */

View File

@ -0,0 +1,51 @@
# Copyright 2011 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.
########################################################################
# Setup library
########################################################################
include(GrPlatform) #define LIB_SUFFIX
add_library(gr-gn3s SHARED gn3s_source_cc.cc gn3s_source.cc gn3s.cc fusb.cc fusb_linux.cc)
target_link_libraries(gr-gn3s ${Boost_LIBRARIES} ${GRUEL_LIBRARIES} ${GNURADIO_CORE_LIBRARIES} "usb")
set_target_properties(gr-gn3s PROPERTIES DEFINE_SYMBOL "gr_gn3s_EXPORTS")
########################################################################
# Install built library files
########################################################################
install(TARGETS gr-gn3s
LIBRARY DESTINATION lib${LIB_SUFFIX} # .so/.dylib file
ARCHIVE DESTINATION lib${LIB_SUFFIX} # .lib file
RUNTIME DESTINATION bin # .dll file
)
########################################################################
# Build and register unit test
########################################################################
find_package(Boost COMPONENTS unit_test_framework)
include(GrTest)
set(GR_TEST_TARGET_DEPS gr-gn3s)
#turn each test cpp file into an executable with an int main() function
add_definitions(-DBOOST_TEST_DYN_LINK -DBOOST_TEST_MAIN)
add_executable(qa_gn3s_source_cc qa_gn3s_source_cc.cc)
target_link_libraries(qa_gn3s_source_cc gr-gn3s ${Boost_LIBRARIES} "usb")
GR_ADD_TEST(qa_gn3s_source_cc qa_gn3s_source_cc)

View File

@ -0,0 +1,59 @@
/* -*- 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
}

View File

@ -0,0 +1,696 @@
/* -*- 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
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
// 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;
}

View File

@ -0,0 +1,49 @@
/* -*- 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;
}

549
drivers/gr-gn3s/lib/gn3s.cc Normal file
View File

@ -0,0 +1,549 @@
/*----------------------------------------------------------------------------------------------*/
/*! \file gn3s.cpp
//
// FILENAME: gn3s.cpp
//
// DESCRIPTION: Impelements the GN3S class.
//
// DEVELOPERS: Gregory W. Heckler (2003-2009)
//
// LICENSE TERMS: Copyright (c) Gregory W. Heckler 2009
//
// This file is part of the GPS Software Defined Radio (GPS-SDR)
//
// The GPS-SDR is free software; you can redistribute it and/or modify it under the terms of the
// GNU General Public License as published by the Free Software Foundation; either version 2 of
// the License, or (at your option) any later version. The GPS-SDR 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.
//
// Note: Comments within this file follow a syntax that is compatible with
// DOXYGEN and are utilized for automated document extraction
//
// Reference:
*/
/*----------------------------------------------------------------------------------------------*/
#include "gn3s.h"
#include <iostream>
#include <fstream>
#include <stdlib.h>
#include <usb.h>
#include "fusb_linux.h"
static char debug = 1; //!< 1 = Verbose
/*----------------------------------------------------------------------------------------------*/
gn3s::gn3s(int _which)
{
//int fsize;
bool ret;
which = _which;
fx2_device = NULL;
fx2_handle = NULL;
gn3s_vid = GN3S_VID;
gn3s_pid = GN3S_PID;
/* Get the firmware embedded in the executable */
//fstart = (int) &_binary_usrp_gn3s_firmware_ihx_start;
//fsize = strlen(_binary_usrp_gn3s_firmware_ihx_start);
//gn3s_firmware = new char[fsize + 10];
//memcpy(&gn3s_firmware[0], (void *)fstart, fsize);
// Load the firmware from external file (Javier)
//gn3s_firmware[fsize] = NULL;
/* Search all USB busses for the device specified by VID/PID */
fx2_device = usb_fx2_find(gn3s_vid, gn3s_pid, debug, 0);
if (!fx2_device)
{
/* Program the board */
ret = prog_gn3s_board();
if(ret)
{
fprintf(stdout, "Could not flash GN3S device\n");
throw(1);
}
/* Need to wait to catch change */
sleep(2);
/* Search all USB busses for the device specified by VID/PID */
fx2_device = usb_fx2_find(gn3s_vid, gn3s_pid, debug, 0);
}
else
{
fprintf(stdout, "Found GN3S Device\n");
}
/* Open and configure FX2 device if found... */
ret = usb_fx2_configure(fx2_device, &fx2_config);
if(ret)
{
fprintf(stdout, "Could not obtain a handle to the GN3S device\n");
throw(1);
}
}
/*----------------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------------*/
gn3s::~gn3s()
{
usrp_xfer(VRQ_XFER, 0);
//delete gn3s_firmware;
delete fx2_config.d_ephandle;
delete fx2_config.d_devhandle;
usb_release_interface(fx2_config.udev, fx2_config.interface);
usb_close(fx2_config.udev);
}
/*----------------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------------*/
int gn3s::prog_gn3s_board()
{
char a;
struct usb_bus *bus;
struct usb_device *dev;
//struct usb_dev_handle *han;
int vid, pid;
dev = NULL;
usb_init();
usb_find_busses();
usb_find_devices();
vid = (VID_OLD);
pid = (PID_OLD);
for(bus = usb_busses; bus; bus = bus->next)
{
for(dev = bus->devices; dev; dev = dev->next)
{
if((dev->descriptor.idVendor == vid) && (dev->descriptor.idProduct == pid))
{
fx2_device = dev;
fprintf(stdout,"GN3S Device Found... awaiting firmware flash \n");
break;
}
}
}
if(fx2_device == NULL)
{
fprintf(stderr,"Cannot find vid 0x%x pid 0x%x \n", vid, pid);
return -1;
}
printf("Using device vendor id 0x%04x product id 0x%04x\n",
fx2_device->descriptor.idVendor, fx2_device->descriptor.idProduct);
fx2_handle = usb_open(fx2_device);
/* Do the first set 0xE600 1 */
char c[] = "1";
char d[] = "0";
a = atoz(c);
fprintf(stdout,"GN3S flashing ... \n");
upload_ram(&a, (PROG_SET_CMD),1);
program_fx2(NULL, 1);
a = atoz(d);
upload_ram(&a, (PROG_SET_CMD),1);
fprintf(stdout,"GN3S flash complete! \n");
usb_close(fx2_handle);
return(0);
}
/*----------------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------------*/
int gn3s::atoz(char *s)
{
int a;
if(!strncasecmp("0x", s, 2)){
sscanf(s, "%x", &a);
return a;
}
return atoi(s);
}
/*----------------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------------*/
void gn3s::upload_ram(char *buf, int start, int len)
{
int i;
int tlen;
int quanta = 16;
int a;
for (i = start; i < start + len; i += quanta) {
tlen = len + start - i;
if (tlen > quanta)
tlen = quanta;
if (debug >= 3)
printf("i = %d, tlen = %d \n", i, tlen);
a = usb_control_msg(fx2_handle, 0x40, 0xa0, i, 0,
buf + (i - start), tlen, 1000);
if (a < 0) {
fprintf(stderr, "Request to upload ram contents failed: %s\n",
usb_strerror());
return;
}
}
}
/*----------------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------------*/
void gn3s::program_fx2(char *filename, char mem)
{
FILE *f;
char s[1024];
char data[256];
char checksum, a;
int length, addr, type, i;
unsigned int b;
// *** mod javier: load firmware from external file ***
//f = tmpfile();
/* Dump firmware into temp file */
//fputs(gn3s_firmware, f);
//rewind(f);
f = fopen ("gn3s_firmware.ihx","r");
if (f!=NULL)
{
printf("GN3S firmware file found!\n");
}else{
printf("Could not open GN3S firmware file!\n");
return;
}
while (!feof(f)) {
fgets(s, 1024, f); /* we should not use more than 263 bytes normally */
if (s[0] != ':') {
fprintf(stderr, "%s: invalid string: \"%s\"\n", filename, s);
continue;
}
sscanf(s + 1, "%02x", &length);
sscanf(s + 3, "%04x", &addr);
sscanf(s + 7, "%02x", &type);
if (type == 0) {
// printf("Programming %3d byte%s starting at 0x%04x",
// length, length==1?" ":"s", addr);
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) {
printf(" ** Checksum failed: got 0x%02x versus 0x%02x\n", (-a)
& 0xff, checksum);
continue;
} else {
//printf(", checksum ok\n");
}
upload_ram(data, addr, length);
} else {
if (type == 0x01) {
printf("End of file\n");
fclose(f);
return;
} else {
if (type == 0x02) {
printf("Extended address: whatever I do with it ?\n");
continue;
}
}
}
}
fclose(f);
}
/*----------------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------------*/
struct usb_device* gn3s::usb_fx2_find(int vid, int pid, char info, int ignore)
{
struct usb_bus *bus;
struct usb_device *dev;
struct usb_device *fx2 = NULL;
usb_dev_handle *udev;
int count = 0;
int ret;
char str[256];
usb_init();
usb_find_busses();
usb_find_devices();
for(bus = usb_busses; bus; bus = bus->next)
{
for(dev = bus->devices; dev; dev = dev->next)
{
if((dev->descriptor.idVendor == vid) && (dev->descriptor.idProduct == pid))
{
fx2 = dev;
}
if(fx2 != NULL && info)
{
udev = usb_open(fx2);
if(udev && dev->descriptor.idVendor == vid && dev->descriptor.idProduct == pid && count < ignore)
{
if(fx2->descriptor.iManufacturer)
{
ret = usb_get_string_simple(udev, fx2->descriptor.iManufacturer, str, sizeof(str));
if(ret > 0)
printf("- Manufacturer : %s\n", str);
else
printf("- Unable to fetch manufacturer string\n");
}
if(fx2->descriptor.iProduct)
{
ret = usb_get_string_simple(udev, fx2->descriptor.iProduct, str, sizeof(str));
if(ret > 0)
printf("- Product : %s\n", str);
else
printf("- Unable to fetch product string\n");
}
if(fx2->descriptor.iSerialNumber)
{
ret = usb_get_string_simple(udev, fx2->descriptor.iSerialNumber, str, sizeof(str));
if(ret > 0)
printf("- Serial Number: %s\n", str);
else
printf("- Unable to fetch serial number string\n");
}
usb_close (udev);
return fx2;
}
else if(udev && dev->descriptor.idVendor == vid && dev->descriptor.idProduct == pid && count >= ignore)
{
count++;
}
if(!fx2->config)
{
printf(" Could not retrieve descriptors\n");
continue;
}
for(int i = 0; i < fx2->descriptor.bNumConfigurations; i++)
{
//print_configuration(&fx2->config[i]);
}
}
}
}
return fx2;
}
/*----------------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------------*/
bool gn3s::usb_fx2_configure(struct usb_device *fx2, fx2Config *fx2c)
{
char status = 0;
int interface = RX_INTERFACE;
int altinterface = RX_ALTINTERFACE;
usb_dev_handle *udev;
fusb_ephandle *d_ephandle;
fusb_devhandle *d_devhandle;
udev = usb_open(fx2);
if(!udev)
{
fprintf(stdout, "Could not obtain a handle to GNSS Front-End device \n");
return -1;
}
else
{
if(debug)
printf("Received handle for GNSS Front-End device \n");
if(usb_set_configuration (udev, 1) < 0)
{
fprintf (stdout,
"error in %s, \n%s \n",
__FUNCTION__,
usb_strerror());
usb_close (udev);
status = -1;
}
if(usb_claim_interface (udev, interface) < 0)
{
fprintf (stdout,
"error in %s, \n%s \n",
__FUNCTION__,
usb_strerror());
usb_close (udev);
fprintf (stdout, "\nDevice not programmed? \n");
usb_close (udev);
status = -1;
throw(0);
}
if(usb_set_altinterface (udev, altinterface) < 0)
{
fprintf (stdout,
"error in %s, \n%s \n",
__FUNCTION__,
usb_strerror());
usb_close (udev);
usb_release_interface (udev, interface);
usb_close (udev);
status = -1;
}
d_devhandle = make_devhandle(udev);
d_ephandle = d_devhandle->make_ephandle(RX_ENDPOINT, true, FUSB_BLOCK_SIZE, FUSB_NBLOCKS);
if(!d_ephandle->start())
{
fprintf (stdout, "usrp0_rx: failed to start end point streaming");
usb_strerror ();
status = -1;
}
if(status == 0)
{
fx2c->interface = interface;
fx2c->altinterface = altinterface;
fx2c->udev = udev;
fx2c->d_devhandle = d_devhandle;
fx2c->d_ephandle = d_ephandle;
return 0;
}
else
{
return -1;
}
}
}
/*----------------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------------*/
fusb_devhandle* gn3s::make_devhandle(usb_dev_handle *udh)
{
return new fusb_devhandle_linux(udh);
}
/*----------------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------------*/
int gn3s::read(void *buff, int bytes)
{
return(fx2_config.d_ephandle->read(buff, bytes));
}
/*----------------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------------*/
bool gn3s::check_rx_overrun()
{
bool overrun;
_get_status(GS_RX_OVERRUN, &overrun);
return(overrun);
}
/*----------------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------------*/
bool gn3s::_get_status(int command, bool *trouble)
{
unsigned char status;
if(write_cmd(VRQ_GET_STATUS, 0, command, &status, sizeof(status)) != sizeof (status))
return false;
*trouble = status;
return true;
}
/*----------------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------------*/
bool gn3s::usrp_xfer(char VRQ_TYPE, bool start)
{
int r;
r = write_cmd(VRQ_TYPE, start, 0, 0, 0);
return(r == 0);
}
/*----------------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------------*/
int gn3s::write_cmd(int request, int value, int index, unsigned char *bytes, int len)
{
int requesttype;
int r;
requesttype = (request & 0x80) ? VRT_VENDOR_IN : VRT_VENDOR_OUT;
r = usb_control_msg (fx2_config.udev, requesttype, request, value, index, (char *) bytes, len, 1000);
if(r < 0)
{
/* We get EPIPE if the firmware stalls the endpoint. */
if(errno != EPIPE)
fprintf (stdout, "usb_control_msg failed: %s\n", usb_strerror());
}
return r;
}
/*----------------------------------------------------------------------------------------------*/

View File

@ -0,0 +1,526 @@
:06000000020FE702006B95
:03000B0002006B85
:0300130002006B7D
:03001B0002006B75
:0300230002006B6D
:03002B0002006B65
:0300330002006B5D
:03003B0002006B55
:0300430002006B4D
:03004B0002006B45
:0300530002006B3D
:03005B0002006B35
:0300630002006B2D
:01006B003262
:0900800002006B0002006B00029B
:08008900006B0002006B000295
:08009100006B0002006B00028D
:08009900006B0002006B000285
:0800A100006B0002006B00027D
:0800A900006B0002006B000275
:0700B100006B0002006B0070
:0901000002006B0002006B00021A
:08010900006B0002006B000214
:08011100006B0002006B00020C
:08011900006B0002006B000204
:08012100006B0002006B0002FC
:08012900006B0002006B0002F4
:08013100006B0002006B0002EC
:08013900006B0002006B0002E4
:08014100006B0002006B0002DC
:08014900006B0002006B0002D4
:08015100006B0002006B0002CC
:08015900006B0002006B0002C4
:08016100006B0002006B0002BC
:08016900006B0002006B0002B4
:08017100006B0002006B0002AC
:07017900006B0002006B00A7
:030FF000020FF3FA
:030FE700750A0088
:0310060002018064
:0501800012018580FE64
:0701850012057A12060212B6
:08018C000661120560C2AF120A
:0A0194000F1A120A7BD2EAD2AF1252
:06019E0009901206830225
:0201A40005272D
:0501A60090E68BE4F07F
:0901AB0090E6A0E0FA20E1F82240
:0A01B40090E6B8E0FABAC00280033A
:0301BE0002031425
:0A01C10090E6B9E0FABA800280125D
:0501CB00BAA2028057FA
:0501D000BAA3028052F9
:0501D500BAA9028047F9
:0301DA000203100D
:0E01DD0090E6BCE0FA601EBA013690E6C1E082
:0E01EB00FA235401FA90E740F090E68AE4F01F
:0901F90090E68B7401F00205236D
:0E02020090E6C1E0FA235401FA90E740F09034
:0D021000E68AE4F090E68B7401F00205230D
:04021D0075820022C4
:060221007508014309010C
:0A02270090E6BAE0FA8A0B750C00AD
:0C02310090E6BBE0FC8C05E4FC420BED09
:0A023D00420C90E6BEE0FC8C0D754B
:0C0247000E0090E6BFE0FE8E07E4FE42D1
:040253000DEF420E5B
:07025700E50D450E700302E6
:02025E00052376
:0C02600090E6A0E0FE20E1F8C3E50D945C
:0A026C0040E50E94005006AE0DAF01
:030276000E8004F3
:040279007E407F0044
:0C027D0090E6B9E0F8B8A32D7A007B00F1
:0E028900C3EA9EEB9F505EEA2440FCEB34E794
:0A029700FDA80BA90CEA28F582EB84
:0E02A10039F583E0F88C828D83F00ABA00DA1A
:0302AF000B80D7EA
:0402B2007C007D004F
:0E02B600C3EC9EED9F5014EC2440F582ED3415
:0D02C400E7F58374CDF00CBC00E80D80E57B
:0902D1008E137C407DE78C148D36
:0502DA0015850B828573
:0C02DF000C83C006C007120779D007D0BE
:0302EB0006E433F3
:0C02EE0090E68AE4F090E68BEEF0EE253E
:0502FA000BF50BEF35D0
:0402FF000CF50CE509
:060303000DC39EF50DE59F
:050309000E9FF50E023D
:02030E00025794
:0403100075820022D0
:0A03140090E6B8E0FCBC4002800354
:03031E0002051FB6
:0A03210090E6B9E0FCBC0102801573
:06032B00BCA2030203D88E
:06033100BCA3030203D887
:06033700BCA9030203D281
:03033D0002051B9B
:0D03400090E6BAE0606390E6C67480F0902D
:0E034D00E6C774EDF090E6C8E4F090E6C9F063
:0E035B0090E6CAF090E6CBF090E6CC7403F08A
:0D03690090E6CD7402F090E60CE4F00090F8
:0E037600E6F574FFF00075BB000090E6C7745A
:0E038400EDF00090E6047480F00090E6047442
:0E03920002F00090E6047406F00090E604E429
:0903A000F00075BB060002052304
:0E03A90075BB000090E6F574FFF00090E604CE
:0E03B7007480F00090E6047402F00090E604FA
:0D03C5007406F00090E604E4F00002052349
:0603D2007508014309015A
:0A03D80090E6BAE0FC8C0B750C00F7
:0C03E20090E6BBE0FC8C05E4FC420BED57
:0A03EE00420C90E6BEE0FC8C0D7599
:0C03F8000E0090E6BFE0FC8C05E4FC4227
:050404000DED420EE5C4
:080409000A70061208AA8582A0
:010411000AE0
:07041200E50D450E70030229
:020419000523B9
:09041B0090E68AE4F090E68BF013
:0E04240090E6A0E0FC20E1F890E68BE0FC8C76
:0E043200067F0090E6B9E0FCBCA3307A007BA8
:0104400000BB
:0A044100C3EA9EEB9F40030205038F
:0A044B00A80BA90CEA28F8EB39F918
:0E045500EA2440F582EB34E7F583E0FC888270
:0A0463008983F00ABA00D70B80D499
:04046D007C007D0092
:0A047100C3EC9EED9F40030205035B
:09047B00E50AF50FB40102804608
:09048400EC250BF9ED350CF8AA8A
:08048D000A7B001ABAFF011BF3
:0C049500EA5201EB5200E9486010AA0B8B
:0A04A100ECFB2AFAE50A145AD39581
:0404AB000AF4F50F4B
:0C04AF00EEC39CFAEF9DFBA80F7900C380
:0E04BB00EA98EB9950098E028C03EAC39BF578
:0104C9000F23
:0A04CA00EC250BF582ED350CF583EF
:0A04D400EC2440F510ED34E7F511BB
:0A04DE00850F12C004C005C006C05F
:0E04E800071206A5D007D006D005D004E433D5
:0B04F600A80F7A00E82CFCEA3DFD0294
:02050100047183
:07050300EE250BF50BEF35AF
:04050A000CF50CE5FB
:06050E000DC39EF50DE592
:050514000E9FF50E0230
:020519000412CA
:04051B0075820022C3
:04051F0075820022BF
:0405230075820122BA
:0D05270090E6C67480F090E6C774EDF09089
:0D053400E6C8E4F090E6C9F090E6CAF09049
:0E054100E6CBF090E6CC7403F090E6CD7402A9
:07054F00F090E60CE4F0005F
:070556003000FD120B11C281
:03055D000080F625
:0C056000750A0090E678E05410FAC454CC
:0A056C000FFA74504AF509740155A6
:0405760009F5082259
:0E057A0090E6007410F0758E0090E601740299
:0E058800F00090E61074A0F00090E61174E010
:0E059600F00090E612E4F00090E613E4F000AE
:0E05A40090E61474E0F00090E615E4F000908C
:0E05B200E6047480F00090E6047406F00090F9
:0E05C000E604E4F00090E618E4F090E619F08E
:0D05CE0090E61A740CF090E61BE4F000902B
:0E05DB00E68AE4F00090E68DE4F00090E6E29F
:0E05E9007402F00090E6E37401F00090E62446
:0B05F7007402F00090E625E4F0002202
:0E06020090E6F574FFF0009010ADE493FA90CE
:0E061000E6F3F09010AEE493FA90E6C3F0909B
:0E061E0010AFE493FA90E6C1F09010B0E493B0
:0E062C00FA90E6C2F09010B2E493FA90E6C0A5
:03063A00F07A0053
:03063D00BA800080
:0C06400050198A037CE4EA2409F582E4E6
:0C064C003410F583E493FD8B828C83F066
:030658000A80E233
:06065B0090E6C6E4F02267
:0E1009000101010101010107000000000000CB
:0E1017000000000000000000000000000000CB
:0E1025000000003F0101010101010107000070
:0E1033000000000000000000000000000000AF
:0E104100000000000000003F38010101010125
:0E104F0001070302020202020200000000007C
:0E105D0000000000360000000000003F3801D7
:0E106B0001010101010703020202020202005C
:0E107900000000000000000036000000000033
:02108700003F28
:0E108900000000000000000000000000000059
:0E1097000000000080ED000000000302008059
:0810A500EE0000000003020050
:0710AD00A0000000AE4E00A0
:0E066100C2B0C2B2D2B3C2B475B51DD280C24F
:0E066F0081C282D283C284C285C286C28775D0
:06067D00B2FF75820022AD
:08068300D284D28575820022A9
:08068B00C284C28575820022C1
:0E069300C284C285900001120FD6D284D28597
:0406A100758200223C
:0E06A500AA82AB83C002C003120770D003D03C
:0E06B30002C002C003120741D003D002C002F1
:0E06C100C00312088CD003D00250047C0180CC
:0106CF006BBF
:0C06D000E508601690E679EBF0C002C06F
:0E06DC000312088CD003D00250047C01805120
:0E06EA007B0090E679EAF012088C50047C0147
:0206F80080413F
:0606FA00AA10AB117D0007
:0C070000C3ED951250288A828B83E0FE26
:0E070C00A3AA82AB8390E679EEF0C002C00390
:0E071A00C005120876D005D003D00250047C32
:030728000180103D
:03072B000D80D26C
:0D072E0090E678E0FA4440F01207517C009C
:06073B0053B27F8C822204
:0A07410090E6787480F0E5092509C0
:06074B00FA90E679F022AD
:030751001207701C
:0E075400120741120876E43390E678E0FA448A
:0E07620040F012077090E678E0FA30E1E522F0
:0907700090E678E0FA20E6F82298
:0E077900AA82AB83C002C003120770D003D067
:0E07870002C002C003120741D003D002C0021C
:0E079500C00312088CD003D0025004758201FC
:0107A3002233
:0C07A400E508601690E679EBF0C002C09A
:0E07B0000312088CD003D0025004758201227F
:0E07BE007B0090E679EAF012088C50047582F8
:0207CC00012208
:0A07CE0090E6787480F0E509250933
:0E07D800FA90E67974014AF012087650047522
:0307E6008201226B
:0D07E90090E679E012087650047582012236
:0407F6007A007B000A
:0907FA00AC137D001CBCFF011DC5
:0E0803008B067F00C3EE9CEF64808DF063F0E7
:0B0811008095F05024EB2514FCE4352A
:0C081C0015FD90E679E0FE8C828D83F0E3
:0D082800C003120876D0035004758201222F
:050835000B8B0280C0E6
:0E083A0090E6787420F0C002120876D00250CA
:0508480004758201228D
:09084D00EA2514FAE43515FB90CC
:0E085600E679E0FC8A828B83F012087650046B
:040864007582012276
:0E08680090E6787440F090E679E07582002208
:0E08760090E678E0FA8A0330E0F6EB30E20418
:040884007582012256
:040888007582002253
:0E088C0090E678E0FA8A0330E0F6EB30E20402
:04089A007582012240
:08089E00EB20E1047582012248
:0408A6007582002235
:0808AA00E508700475820122CB
:0408B2007514407504
:0308B6001518759D
:0A08B90013409000001207797A0046
:0308C300BA400038
:0A08C600500FEA2400F582E4341814
:0708D000F583EAF00A80EC59
:0408D7007510007523
:0308DB001118757C
:0A08DE0012409000001206A57A00F7
:0308E800BA400013
:0A08EB005011EA2400F582E43418ED
:0908F500F583EAF4FBF00A80EA45
:0508FE007513407514A4
:0309030000751567
:0809060018900000120779901F
:0B090E001800E0FA30E0047B018006D6
:0609190063023F0A8A039D
:02091F007A005C
:03092100BA4000D9
:0A09240050208A047D007510407514
:03092E0011188B12
:0C093100128C828D83C002C0031206A548
:09093D00D003D002EB2AFA80DBA2
:030946008B82227F
:0EE0000012010002FFFFFF40C0162F070201B1
:04E00E000102060104
:0AE012000A060002FFFFFF400100B4
:0EE01C0009023200030100C0000904000000E8
:0EE02A00FFFFFF030904010001FFFFFF0407D1
:0EE038000502020002000904020001FFFFFFC2
:08E04600050705860200020037
:0EE04E0012010002FFFFFF40C0162F07020163
:04E05C0001020001BC
:0AE060000A060002FFFFFF40010066
:0EE06A0009021200010100C0000904000000BC
:04E07800FFFFFF03A4
:01E07C00079C
:02E07D008CE035
:02E07F0092E02D
:02E08100B8E005
:02E08300C8E0F3
:02E08500EAE0CF
:02E0870006E1B0
:02E0890020E194
:06E08C0006030000090478
:0EE0920026035300690047006500200053007C
:0EE0A00065006D00690063006F006E00640093
:0AE0AE007500630074006F0072003B
:0EE0B8001003530045003400310031003000E9
:02E0C6004C000C
:0EE0C800220343006F006D006D0061006E00CA
:0EE0D60064002000260020005300740061004A
:06E0E400740075007300DA
:0EE0EA001C035400720061006E0073006D0094
:0EE0F800690074002000500061007400680090
:0EE106001A0352006500630065006900760090
:0CE11400650020005000610074006800ED
:0CE120000C0331003000300030003000F3
:080949007880E84400600C799D
:0C09510001901800E4F0A3D8FCD9FAD003
:0E095D0083D082F6D8FDC082C083758200224E
:09096B0090E6A0E0FA4401F0223C
:0E097400AA8274805AFBC423541FFB740F5ACE
:0E09820090E6834BF090E683E0FA4420F022EA
:0E09900090E680E0FA440AF09000FA120FD6CA
:0E099E0090E65D74FFF090E65F74FFF05391F9
:0A09AC00EF90E680E0FA54F7F02225
:06100000E478FFF6D8FDC4
:060FEA00751600751700EA
:0A09B60090E680E0FA30E7197518AA
:0309C000007519A6
:0309C300E0751AC2
:0309C60012751B8C
:0309C900E0751CBA
:0309CC001C751D7A
:0309CF00E0751EB2
:0309D2006A751F24
:0209D500E0221E
:0409D70075184E75CC
:0309DB0019E075AB
:0309DE001A607527
:0309E1001BE075A3
:0309E4001C6A7515
:0309E7001DE0759B
:0309EA001E1C755B
:0309ED001FE022E6
:0909F0005391EF75A100D2003211
:0E09F900C0E0C0F0C082C083C002C003C004D2
:0E0A0700C005C006C007C000C001C0D075D039
:0E0A1500005391EF75A1001209B6D0D0D001A8
:0E0A2300D000D007D006D005D004D003D002FA
:090A3100D083D082D0F0D0E03275
:0E0A3A00C0E0C0F0C082C083C002C003C00490
:0E0A4800C005C006C007C000C001C0D075D0F8
:0E0A5600005391EF75A1001209B6D0D0D00167
:0E0A6400D000D007D006D005D004D003D002B9
:090A7200D083D082D0F0D0E03234
:050A7B001209B675210F
:030A8000F07522EC
:080A830009758200120E68756E
:030A8B0021F975D9
:060A8E002209758210121E
:040A94000E68752152
:030A98003A75228A
:0C0A9B000A758214120E6890E65C74313B
:020AA700F0223B
:0D0AA900E582547FFA24F750047582002284
:070AB600BA01047582012260
:080ABD00530201E4BA00010438
:030AC500F5822295
:0E0AC800AA82BA010C90E6A1E0FB7C008B82B2
:030AD6008C8322EC
:0E0AD900BA810C90E6A2E0FB7C008B828C833D
:010AE70022EC
:0E0AE80053027FEA700C90E6A0E0FB7C008BCE
:040AF600828C832249
:0E0AFA0090E6A3E0FB7C00EAC313FA7D00EA5D
:090B08002BFBED3C8B82F58322EE
:0C0B1100C20090E6B8E0FA530260BA009F
:030B1D000280282B
:050B2000BA2002800D67
:050B2500BA4002800E41
:050B2A00BA6002800327
:030B2F00020DFCB8
:060B320012096B020DFC2C
:0A0B38001201B4E5826003020DFC17
:060B420012096B020DFC1C
:0D0B480090E6B8E0FA530280BA8002800304
:030B5500020CCFC0
:0B0B580090E6B9E0FABA0003020C4B73
:050B6300BA0602803516
:050B6800BA080280083C
:050B6D00BA0A02801726
:030B7200020CC9A9
:0C0B750090E740E516F090E68AE4F0906E
:080B8100E68B7401F0020DFC8B
:0C0B890090E740E517F090E68AE4F09059
:080B9500E68B7401F0020DFC77
:0A0B9D0090E6BBE0FABA01028017EF
:050BA700BA02028038D3
:050BAC00BA03028059AC
:050BB100BA0602801BE2
:050BB600BA0702803CBB
:030BBB00020C45E4
:0A0BBE00AA18AB1990E6B3EBF07B28
:090BC8000090E6B4EAF0020DFC15
:0A0BD100AA1AAB1B90E6B3EBF07B11
:090BDB000090E6B4EAF0020DFC02
:0A0BE400AA1CAB1D90E6B3EBF07BFA
:090BEE000090E6B4EAF0020DFCEF
:0A0BF700AA1EAB1F90E6B3EBF07BE3
:090C01000090E6B4EAF0020DFCDB
:0E0C0A0090E6BAE0FA90E07CE0FBC3EA9B4083
:070C18000612096B020DFC3E
:0C0C1F0090E6BAE0FA75F002A4247DF51E
:0C0C2B008274E035F0F583E0FAA3E0FBF2
:0E0C370090E6B3F07B0090E6B4EAF0020DFC0C
:060C450012096B020DFC18
:0D0C4B0090E6B8E0FA53021FBA0002800ADA
:050C5800BA0102801C3E
:050C5D00BA0266802CC4
:0E0C620090E7407401F090E741E4F090E68ADC
:090C7000F090E68B7402F0805054
:0E0C790090E740E4F090E741F090E68AF090BA
:070C8700E68B7402F0803BD4
:0E0C8E0090E6BCE0FAF582120AA9E582602524
:0E0C9C0090E6BCE0FAF582120AC8E0FA5302B4
:0E0CAA000190E740EAF090E741E4F090E68A1E
:090CB800F090E68B7402F0800854
:050CC10012096B800325
:030CC60012096BA5
:060CC90012096B020DFC94
:0C0CCF0090E6B9E0FA24F45003020DF99D
:070CDB00EA2A2A900CE273E3
:070CE200020DF9020D1802DA
:060CE9000DAB020D8C02B0
:060CEF000DF9020DF902EF
:060CF5000DF9020DF902E9
:060CFB000DF9020D0602D6
:050D01000DF9020D0FC9
:090D060090E6BAE0F516020DFCBE
:090D0F0090E6BAE0F517020DFCB4
:0D0D180090E6B8E0FA53021FBA0002800511
:050D2500BA025E800A25
:0A0D2A0090E6BAE012096B020DFC1E
:0E0D340090E6BAE0704690E6BCE0FAF5821256
:0E0D42000AA9E582603890E6BCE0FAF582125C
:0E0D50000AC8AA82AB8390E6BCE0FCF582C024
:0E0D5E0002C003120AC8D003D002E0FC530406
:0E0D6C00FE8A828B83ECF090E6BCE0FAF58202
:060D7A00120974020DFCD9
:060D800012096B020DFCDC
:060D860012096B020DFCD6
:0E0D8C0090E6B8E0FA53021FBA006590E6BA8E
:070D9A00E0FABA0102800536
:050DA100BA02028056B9
:050DA60012096B8051F1
:090DAB0090E6BAE0FA6002804013
:0E0DB40090E6BCE0FAF582120AA9E582602DF5
:0E0DC20090E6BCE0FAF582120AC8AA82AB8362
:0E0DD00090E6BCE0FCF582C002C003120AC827
:0E0DDE00D003D002E0FC4304018A828B83EC38
:030DEC00F0800D87
:050DEF0012096B8008F1
:050DF40012096B8003F1
:030DF90012096B71
:090DFC0090E6A0E0FA4480F02228
:050E0500AA82BA0300FF
:070E0A004005EA249C5001A1
:010E110022BE
:090E1200740F5AFBBB03028007B8
:070E1B00740F5AFBBB0B45ED
:0A0E2200A2AF9202C2AFEA2400F56D
:0C0E2C0082E43400F5837402F07B007453
:0C0E3800012AFCE43BFDEC2400F582EDF7
:0A0E44003400F583E522FCF074028F
:0C0E4E002AFAE43BFBEA2400F582EB34B6
:0A0E5A0000F583AA217B00EAF0A254
:030E64000292AF48
:010E67002268
:050E6800AA82BA00009F
:070E6D004005EA2483500157
:010E7400225B
:060E7500EA5403600122B3
:0A0E7B00A2AF9203C2AFEA2400F513
:0C0E850082E43401F5837402F07B0074F9
:0C0E9100012AFCE43BFDEC2400F582ED9E
:0A0E9D003401F583E522FCF0740235
:0C0EA7002AFAE43BFBEA2400F582EB345D
:0A0EB30001F583AA217B00EAF0A2FA
:040EBD000392AF22CB
:050EC100AA82BA8000C6
:070EC6004005EA244B500136
:010ECD002202
:060ECE00EA54036001225A
:0A0ED400A2AF9204C2AFEA2480F539
:0C0EDE0082E43400F5837402F07B0074A1
:0C0EEA00012AFCE43BFDEC2480F582EDC5
:0A0EF6003400F583E522FCF07402DD
:0C0F00002AFAE43BFBEA2480F582EB3483
:0A0F0C0000F583AA217B00EAF0A2A1
:040F16000492AF2270
:080F1A00C2E8C2EA752100756E
:060F22002201758243125A
:040F28000E0575211C
:030F2C00807522AB
:0C0F2F0000758253120E050090E650E49D
:0E0F3B00F00090E652E4F00090E654E4F0007E
:0E0F490090E656E4F00090E65174FFF0009040
:0E0F5700E65374FFF00090E65574FFF0009032
:0E0F6500E65774FFF00090E658E4F090E6596D
:0E0F730074FFF090E65AE4F090E65B74FFF035
:0E0F810090E65CE4F090E65D74FFF090E65EB2
:0E0F8F00E4F090E65F74FFF00090E660E4F09E
:0D0F9D000090E66174FFF090E662E4F090D1
:0E0FAA00E66374FFF090E665E4F090E668748C
:0A0FB8000BF05391AFD2E8D2EA2209
:010FC200220C
:020FC300AA8200
:060FC500120FC2DAFB224C
:030FCB0090FB5048
:080FCE00A3E582458370F922BE
:040FD600AA82AB83BD
:080FDA00120FCB1ABAFF011B34
:050FE200EA4B70F4224F
:030FF300758122E3
:0A0FF600120949E582600302018040
:00000001FF

View File

@ -0,0 +1,233 @@
/*----------------------------------------------------------------------------------------------*/
/*! \file gps_source.cpp
//
// FILENAME: gps_source.cpp
//
// DESCRIPTION: Implements member functions of the GPS_Source class.
//
// DEVELOPERS: Gregory W. Heckler (2003-2009), Javier Arribas (2012)
//
// LICENSE TERMS: Copyright (c) Gregory W. Heckler 2009
//
// This file is part of the GPS Software Defined Radio (GPS-SDR)
//
// The GPS-SDR is free software; you can redistribute it and/or modify it under the terms of the
// GNU General Public License as published by the Free Software Foundation; either version 2 of
// the License, or (at your option) any later version. The GPS-SDR 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.
//
// Note: Comments within this file follow a syntax that is compatible with
// DOXYGEN and are utilized for automated document extraction
//
// Reference:
*/
/*----------------------------------------------------------------------------------------------*/
#include "gn3s_source.h"
#include <time.h>
/*----------------------------------------------------------------------------------------------*/
gn3s_Source::gn3s_Source()
{
Open_GN3S();
overflw = soverflw = 0;
agc_scale = 1;
/* Assign to base */
ms_count = 0;
flag_first_read=true;
fprintf(stdout,"Creating GPS Source\n");
}
/*----------------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------------*/
gn3s_Source::~gn3s_Source()
{
Close_GN3S();
fprintf(stdout,"Destructing GPS Source\n");
}
/*----------------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------------*/
void gn3s_Source::Read(gn3s_ms_packet *_p,int n_samples)
{
Read_GN3S(_p,n_samples);
ms_count++;
}
/*----------------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------------*/
void gn3s_Source::Open_GN3S()
{
/* Create the object */
gn3s_a = new gn3s(0);
/* Everything is super! */
//fprintf(stdout,"GN3S Start\n");
}
/*----------------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------------*/
void gn3s_Source::Close_GN3S()
{
if(gn3s_a != NULL) delete gn3s_a;
//fprintf(stdout,"Destructing GN3S\n");
}
/*----------------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------------*/
void gn3s_Source::Read_GN3S(gn3s_ms_packet *_p,int n_samples)
{
int bread;
int started=0;
int check;
bool overrun;
short int LUT4120[2] = {1,-1};
char shift = 0;
char endshift = 0;
short int *pbuff;
int BUFSIZE=n_samples*2;
if (flag_first_read==true)
{
/* Start transfer */
while(!started)
{
usleep(100);
started = gn3s_a->usrp_xfer(VRQ_XFER, 1);
}
fprintf(stdout,"started TX\n");
flag_first_read=false;
}
/* Check the overrun */
overrun = gn3s_a->check_rx_overrun();
if(overrun)
{
time(&rawtime);
timeinfo = localtime (&rawtime);
fprintf(stdout, "GN3S overflow at time %s\n", asctime(timeinfo));
fflush(stdout);
}
/* Read 5 ms */
bread = gn3s_a->read((void *)&gbuff[0], BUFSIZE);
// FUSB Read...
//ret = fx2c.d_ephandle->read (buf, bufsize);
if (bread != BUFSIZE) {
fprintf (stderr, "fusb_read: ret = %d (bufsize: %d) \n", bread, BUFSIZE);
fprintf (stderr, "%s\n", usb_strerror());
}
// Store IF data as 8bit signed values
pbuff = (short int *)&buff[0];
/* Make sure we are reading I0,Q0,I1,Q1,I2,Q2.... etc */
if ((gbuff[0] & 0x2) == 2) //if true, we don't have to shift data
{ shift = 0; }
else
{ shift = 1; }
if ((gbuff[BUFSIZE-1] & 0x02) == 0) //if true, we don't drop last data byte
{ endshift = 0; }
else
{ endshift = 1; }
for (int j=0;j<BUFSIZE;j++)
{
if (shift == 1)
{
if ((j == (BUFSIZE-1)) && (endshift == 0))
{ pbuff[j] = 0; }
else if ((j == (BUFSIZE-1)) && (endshift == 1))
{ pbuff[j-1] = 0; }
else
{
//printf("%i.",j);
pbuff[j] = LUT4120[gbuff[j+1] & 0x1];
}
} else if (shift == 0)
{
if ((j == (BUFSIZE-1)) && (endshift == 1))
{ pbuff[j] = 0; }
else
{ pbuff[j] = LUT4120[gbuff[j] & 0x1]; }
}
}
/* Copy to destination */
memcpy(_p->data, pbuff, n_samples*sizeof(GN3S_CPX));
}
// gregory way... with CUSTOM firmware!
//if (flag_first_read==true)
//{
// /* Start transfer */
// while(!started)
// {
// usleep(100);
// started = gn3s_a->usrp_xfer(VRQ_XFER, 1);
// }
// fprintf(stdout,"started TX\n");
// /* Make sure we are reading I0,Q0,I1,Q1,I2,Q2.... etc */
// bread = gn3s_a->read((void*)(&gbuff[0]),1);
// //fprintf(stdout,"R1\n");
// check = (gbuff[0] & 0x3); //0 or 1 -> I sample , 2 or 3 -> Q sample
// if(check < 2)
// {
// fprintf(stdout,"Shifted one sample");
// bread = gn3s_a->read((void*)(&gbuff[0]),1);
// }
// //fprintf(stdout,"R2\n");
// flag_first_read=false;
//}else{
//
// pbuff = (short int *)&buff[0];
//
// /* Read up to 5 ms */
// bread = gn3s_a->read((void *)&gbuff[0], n_samples*2);
//
// /* Convert to +-1 using Look Up Table*/
// for(lcv = 0; lcv < (n_samples*2); lcv++)
// pbuff[lcv] = LUT[gbuff[lcv] & 0x3];
//
// /* Check the overrun */
// overrun = gn3s_a->check_rx_overrun();
// if(overrun)
// {
// time(&rawtime);
// timeinfo = localtime (&rawtime);
// fprintf(stdout, "GN3S overflow at time %s\n", asctime(timeinfo));
// fflush(stdout);
// }
//}
///* Copy to destination */
//memcpy(_p->data, pbuff, n_samples*sizeof(GN3S_CPX));

View File

@ -0,0 +1,114 @@
/*!
* \file gn3s_source_cc.cc
* \brief GNU Radio source block to acces to SiGe GN3S USB sampler v2.
* \author Javier Arribas, 2012. jarribas(at)cttc.es
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2012 (see AUTHORS file for a list of contributors)
*
* GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver
*
* This file is part of GNSS-SDR.
*
* GNSS-SDR 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.
*
* GNSS-SDR 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 GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
*
* -------------------------------------------------------------------------
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <gn3s_source_cc.h>
#include <gn3s_defines.h>
#include <gr_io_signature.h>
/*
* Create a new instance of howto_square_ff and return
* a boost shared_ptr. This is effectively the public constructor.
*/
gn3s_source_cc_sptr
gn3s_make_source_cc ()
{
return gnuradio::get_initial_sptr(new gn3s_source_cc ());
}
/*
* Specify constraints on number of input and output streams.
* This info is used to construct the input and output signatures
* (2nd & 3rd args to gr_block's constructor). The input and
* output signatures are used by the runtime system to
* check that a valid number and type of inputs and outputs
* are connected to this block. In this case, we accept
* only 1 input and 1 output.
*/
static const int MIN_IN = 0; // mininum number of input streams
static const int MAX_IN = 0; // maximum number of input streams
static const int MIN_OUT = 1; // minimum number of output streams
static const int MAX_OUT = 1; // maximum number of output streams
/*
* The private constructor
*/
gn3s_source_cc::gn3s_source_cc ()
: gr_block ("gn3s_cc",
gr_make_io_signature (MIN_IN, MAX_IN, sizeof (gr_complex)),
gr_make_io_signature (MIN_OUT, MAX_OUT, sizeof (gr_complex)))
{
// constructor code here
gn3s_drv = new gn3s_Source();
fprintf(stdout,"GN3S Start\n");
}
/*
* Our virtual destructor.
*/
gn3s_source_cc::~gn3s_source_cc ()
{
// destructor code here
if(gn3s_drv != NULL)
{
fprintf(stdout,"Destructing GN3S\n");
delete gn3s_drv;
//delete packet;
}
}
int
gn3s_source_cc::general_work (int noutput_items,
gr_vector_int &ninput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items)
{
int n_samples_rx;
gr_complex *out = (gr_complex *) output_items[0];
if (noutput_items<=GN3S_SAMPS_5MS)
{
gn3s_drv->Read(&packet,noutput_items);
n_samples_rx=noutput_items;
}else{
gn3s_drv->Read(&packet,GN3S_SAMPS_5MS);
n_samples_rx=GN3S_SAMPS_5MS;
}
for (int i = 0; i < n_samples_rx; i++){
out[i]=gr_complex(packet.data[i].i,packet.data[i].q);
}
// Tell runtime system how many output items we produced.
return n_samples_rx;
}

View File

@ -0,0 +1,36 @@
/*!
* \file qa_gn3s_source_cc.h
* \brief GNU Radio source block to acces to SiGe GN3S USB sampler.
* \author Javier Arribas, 2012. jarribas(at)cttc.es
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2012 (see AUTHORS file for a list of contributors)
*
* GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver
*
* This file is part of GNSS-SDR.
*
* GNSS-SDR 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.
*
* GNSS-SDR 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 GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
*
* -------------------------------------------------------------------------
*/
#include <boost/test/unit_test.hpp>
BOOST_AUTO_TEST_CASE(qa_gn3s_source_t1){
BOOST_CHECK_EQUAL(2 + 2, 4);
// TODO BOOST_* test macros here
}

View File

@ -0,0 +1,44 @@
# Copyright 2011 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 python install macros
########################################################################
include(GrPython)
if(NOT PYTHONINTERP_FOUND)
return()
endif()
########################################################################
# Install python sources
########################################################################
GR_PYTHON_INSTALL(
FILES
__init__.py
DESTINATION ${GR_PYTHON_DIR}/gn3s
)
########################################################################
# Handle the unit tests
########################################################################
include(GrTest)
set(GR_TEST_TARGET_DEPS gr-gn3s)
set(GR_TEST_PYTHON_DIRS ${CMAKE_BINARY_DIR}/swig)
GR_ADD_TEST(qa_gn3s ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/qa_gn3s.py)

View File

@ -0,0 +1,190 @@
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 2.8
# Default target executed when no arguments are given to make.
default_target: all
.PHONY : default_target
#=============================================================================
# Special targets provided by cmake.
# Disable implicit rules so canonical targets will work.
.SUFFIXES:
# Remove some rules from gmake that .SUFFIXES does not remove.
SUFFIXES =
.SUFFIXES: .hpux_make_needs_suffix_list
# Suppress display of executed commands.
$(VERBOSE).SILENT:
# A target that is always out of date.
cmake_force:
.PHONY : cmake_force
#=============================================================================
# Set environment variables for the build.
# The shell in which to execute make rules.
SHELL = /bin/sh
# The CMake executable.
CMAKE_COMMAND = /usr/bin/cmake
# The command to remove a file.
RM = /usr/bin/cmake -E remove -f
# The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR = /home/javier/sdr/gr-gn3s
# The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR = /home/javier/sdr/gr-gn3s
#=============================================================================
# Targets provided globally by CMake.
# Special rule for the target edit_cache
edit_cache:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running interactive CMake command-line interface..."
/usr/bin/cmake -i .
.PHONY : edit_cache
# Special rule for the target edit_cache
edit_cache/fast: edit_cache
.PHONY : edit_cache/fast
# Special rule for the target install
install: preinstall
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
/usr/bin/cmake -P cmake_install.cmake
.PHONY : install
# Special rule for the target install
install/fast: preinstall/fast
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
/usr/bin/cmake -P cmake_install.cmake
.PHONY : install/fast
# Special rule for the target install/local
install/local: preinstall
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..."
/usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
.PHONY : install/local
# Special rule for the target install/local
install/local/fast: install/local
.PHONY : install/local/fast
# Special rule for the target install/strip
install/strip: preinstall
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..."
/usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
.PHONY : install/strip
# Special rule for the target install/strip
install/strip/fast: install/strip
.PHONY : install/strip/fast
# Special rule for the target list_install_components
list_install_components:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\""
.PHONY : list_install_components
# Special rule for the target list_install_components
list_install_components/fast: list_install_components
.PHONY : list_install_components/fast
# Special rule for the target rebuild_cache
rebuild_cache:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
/usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
.PHONY : rebuild_cache
# Special rule for the target rebuild_cache
rebuild_cache/fast: rebuild_cache
.PHONY : rebuild_cache/fast
# Special rule for the target test
test:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running tests..."
/usr/bin/ctest --force-new-ctest-process $(ARGS)
.PHONY : test
# Special rule for the target test
test/fast: test
.PHONY : test/fast
# The main all target
all: cmake_check_build_system
cd /home/javier/sdr/gr-gn3s && $(CMAKE_COMMAND) -E cmake_progress_start /home/javier/sdr/gr-gn3s/CMakeFiles /home/javier/sdr/gr-gn3s/python/CMakeFiles/progress.marks
cd /home/javier/sdr/gr-gn3s && $(MAKE) -f CMakeFiles/Makefile2 python/all
$(CMAKE_COMMAND) -E cmake_progress_start /home/javier/sdr/gr-gn3s/CMakeFiles 0
.PHONY : all
# The main clean target
clean:
cd /home/javier/sdr/gr-gn3s && $(MAKE) -f CMakeFiles/Makefile2 python/clean
.PHONY : clean
# The main clean target
clean/fast: clean
.PHONY : clean/fast
# Prepare targets for installation.
preinstall: all
cd /home/javier/sdr/gr-gn3s && $(MAKE) -f CMakeFiles/Makefile2 python/preinstall
.PHONY : preinstall
# Prepare targets for installation.
preinstall/fast:
cd /home/javier/sdr/gr-gn3s && $(MAKE) -f CMakeFiles/Makefile2 python/preinstall
.PHONY : preinstall/fast
# clear depends
depend:
cd /home/javier/sdr/gr-gn3s && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
.PHONY : depend
# Convenience name for target.
python/CMakeFiles/pygen_python_375e7.dir/rule:
cd /home/javier/sdr/gr-gn3s && $(MAKE) -f CMakeFiles/Makefile2 python/CMakeFiles/pygen_python_375e7.dir/rule
.PHONY : python/CMakeFiles/pygen_python_375e7.dir/rule
# Convenience name for target.
pygen_python_375e7: python/CMakeFiles/pygen_python_375e7.dir/rule
.PHONY : pygen_python_375e7
# fast build rule for target.
pygen_python_375e7/fast:
cd /home/javier/sdr/gr-gn3s && $(MAKE) -f python/CMakeFiles/pygen_python_375e7.dir/build.make python/CMakeFiles/pygen_python_375e7.dir/build
.PHONY : pygen_python_375e7/fast
# Help Target
help:
@echo "The following are some of the valid targets for this Makefile:"
@echo "... all (the default if no target is provided)"
@echo "... clean"
@echo "... depend"
@echo "... edit_cache"
@echo "... install"
@echo "... install/local"
@echo "... install/strip"
@echo "... list_install_components"
@echo "... pygen_python_375e7"
@echo "... rebuild_cache"
@echo "... test"
.PHONY : help
#=============================================================================
# Special targets to cleanup operation of make.
# Special rule to run CMake to check the build system integrity.
# No rule that depends on this can have commands that come from listfiles
# because they might be regenerated.
cmake_check_build_system:
cd /home/javier/sdr/gr-gn3s && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
.PHONY : cmake_check_build_system

View File

@ -0,0 +1,54 @@
#
# Copyright 2008,2009 Free Software Foundation, Inc.
#
# This application 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 application 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.
#
# The presence of this file turns this directory into a Python package
'''
This is the GNU Radio GN3S module. Place your Python package
description here (python/__init__.py).
'''
# ----------------------------------------------------------------
# Temporary workaround for ticket:181 (swig+python problem)
import sys
_RTLD_GLOBAL = 0
try:
from dl import RTLD_GLOBAL as _RTLD_GLOBAL
except ImportError:
try:
from DLFCN import RTLD_GLOBAL as _RTLD_GLOBAL
except ImportError:
pass
if _RTLD_GLOBAL != 0:
_dlopenflags = sys.getdlopenflags()
sys.setdlopenflags(_dlopenflags|_RTLD_GLOBAL)
# ----------------------------------------------------------------
# import swig generated symbols into the gn3s namespace
from gn3s_swig import *
# import any pure python here
#
# ----------------------------------------------------------------
# Tail of workaround
if _RTLD_GLOBAL != 0:
sys.setdlopenflags(_dlopenflags) # Restore original flags
# ----------------------------------------------------------------

View File

@ -0,0 +1,47 @@
#!/usr/bin/env python
#
# Copyright 2004,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 gnuradio import gr, gr_unittest
import gn3s_swig
class qa_gn3s (gr_unittest.TestCase):
def setUp (self):
self.tb = gr.top_block ()
def tearDown (self):
self.tb = None
def test_001_gn3s_source_cc (self):
#src_data = (-3, 4, -5.5, 2, 3)
expected_result = (9, 16, 30.25, 4, 9)
#src = gr.vector_source_f (src_data)
gn3s_src = gn3s_swig.source_cc ()
dst = gr.vector_sink_f ()
#self.tb.connect (src, sqr)
self.tb.connect (sqr, dst)
self.tb.run ()
result_data = dst.data ()
self.assertFloatTuplesAlmostEqual (expected_result, result_data, 6)
if __name__ == '__main__':
gr_unittest.main ()

View File

@ -0,0 +1,61 @@
# Copyright 2011 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 swig generation macros
########################################################################
find_package(SWIG)
find_package(PythonLibs)
if(NOT SWIG_FOUND OR NOT PYTHONLIBS_FOUND)
return()
endif()
include(GrSwig)
include(GrPython)
########################################################################
# Setup swig generation
########################################################################
foreach(incdir ${GNURADIO_CORE_INCLUDE_DIRS})
list(APPEND GR_SWIG_INCLUDE_DIRS ${incdir}/swig)
endforeach(incdir)
foreach(incdir ${GRUEL_INCLUDE_DIRS})
list(APPEND GR_SWIG_INCLUDE_DIRS ${incdir}/gruel/swig)
endforeach(incdir)
set(GR_SWIG_LIBRARIES gr-gn3s)
set(GR_SWIG_DOC_FILE ${CMAKE_CURRENT_BINARY_DIR}/gn3s_swig_doc.i)
set(GR_SWIG_DOC_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../include)
GR_SWIG_MAKE(gn3s_swig gn3s_swig.i)
########################################################################
# Install the build swig module
########################################################################
GR_SWIG_INSTALL(TARGETS gn3s_swig DESTINATION ${GR_PYTHON_DIR}/gn3s)
########################################################################
# Install swig .i files for development
########################################################################
install(
FILES
gn3s_swig.i
${CMAKE_CURRENT_BINARY_DIR}/gn3s_swig_doc.i
DESTINATION ${GR_INCLUDE_DIR}/gn3s/swig
)

View File

@ -0,0 +1,17 @@
/* -*- c++ -*- */
#define GN3S_API
%include "gnuradio.i" // the common stuff
//load generated python docstrings
%include "gn3s_swig_doc.i"
%{
#include "gn3s_source_cc.h"
%}
GR_SWIG_BLOCK_MAGIC(gn3s,source_cc);
%include "gn3s_source_cc.h"

View File

@ -0,0 +1,340 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

21
firmware/GN3S_v2/README Normal file
View File

@ -0,0 +1,21 @@
GN3S v2 CUSTOM FIRMWARE FOR GNSS-SDR
------------------------------------
Source maintainer:
Javier Arribas
jarribas@cttc.es
Here can be found a modified version of the Sparkfun SiGe v2 firmware.
The target is the 8051 MCU used in the Cypress FX2 USB 2.0 microcontroller.
Basically, the main modifications are:
- Disabled the capture filesize limit
- USB VID and PID changed
;; Original one
;;VID_FREE = 0x1781 ; GN3S Project
;;PID_USRP = 0x0B39 ; CU AAU SE4120L-EK3
;; New one
VID_FREE = 0x16C0 ; GN3S Modified driver Project
PID_USRP = 0x072F ; CU AAU SE4120L-EK3
Basically, you should follow the original Sparkfun SiGe GN3S driver build instructions, using SDCC and make

View File

@ -0,0 +1,544 @@
:06000000020FE002006B9C
:03000B0002006B85
:0300130002006B7D
:03001B0002006B75
:0300230002006B6D
:03002B0002006B65
:0300330002006B5D
:03003B0002006B55
:0300430002006B4D
:03004B0002006B45
:0300530002006B3D
:03005B0002006B35
:0300630002006B2D
:01006B003262
:0900800002006B0002006B00029B
:08008900006B0002006B000295
:08009100006B0002006B00028D
:08009900006B0002006B000285
:0800A100006B0002006B00027D
:0800A900006B0002006B000275
:0700B100006B0002006B0070
:0901000002006B0002006B00021A
:08010900006B0002006B000214
:08011100006B0002006B00020C
:08011900006B0002006B000204
:08012100006B0002006B0002FC
:08012900006B0002006B0002F4
:08013100006B0002006B0002EC
:08013900006B0002006B0002E4
:08014100006B0002006B0002DC
:08014900006B0002006B0002D4
:08015100006B0002006B0002CC
:08015900006B0002006B0002C4
:08016100006B0002006B0002BC
:08016900006B0002006B0002B4
:08017100006B0002006B0002AC
:07017900006B0002006B00A7
:030FF800021000E4
:070FE000E4F50AF50BE4F54E
:040FE7000CF50D7583
:020FEB000E00F6
:03101300020FFBCE
:050FFB0012018080FEE0
:0701800012059512061D1285
:08018700067012057CC2AF12E4
:0A018F000F13120AB2D2EAD2AF1227
:0601990009C112069202EA
:02019F00054316
:0501A10090E68BE4F084
:0901A60090E6A0E0FA20E1F82245
:0A01AF0090E6B8E0FABAC00280033F
:0301B9000203102E
:0A01BC0090E6B9E0FABA8002801262
:0501C600BAA202805501
:0501CB00BAA302805000
:0501D000BAA902804500
:0301D50002030C16
:0E01D80090E6BCE0FA601DBA013490E6C1E08A
:0E01E600235401FA90E740F090E68AE4F0908E
:0801F400E68B7401F002052CFA
:0D01FC0090E6C1E0235401FA90E740F09036
:0D020900E68AE4F090E68B7401F002052C0B
:0402160075820022CB
:06021A0075080143090113
:0A02200090E6BAE0FA8A0F751000AC
:0A022A0090E6BBE0FDE4420FED4258
:090234001090E6BEE0FC8C11758F
:0A023D00120090E6BFE0FFE4FE426D
:0402470011EF42125F
:07024B00E5114512700302EA
:02025200052C79
:0C02540090E6A0E0FE20E1F8C3E5119464
:0A02600040E51294005006AE11AF05
:03026A00128004FB
:04026D007E407F0050
:0C02710090E6B9E0F8B8A337E4F513F507
:01027D00146C
:0A027E00C3E5139EE5149F5063E5ED
:0A028800132440FCE51434E7FDA840
:040292000FA910E5BB
:0A0296001328F582E51439F583E022
:0A02A000F88C828D83F00513E4B59D
:0602AA0013D2051480CE02
:0402B0007C007D0051
:0E02B400C3EC9EED9F5014EC2440F582ED3417
:0D02C200E7F58374CDF00CBC00E80D80E57D
:0902CF008E1B7C407DE78C1C8D28
:0502D8001D850F828569
:0C02DD001083C006C0071207B3D007D082
:0102E900060E
:0C02EA0090E68AE4F090E68BEEF0EE2542
:0502F6000FF50FEF35CC
:0402FB0010F510E505
:0602FF0011C39EF511E59C
:05030500129FF5120239
:02030A00024BA4
:04030C0075820022D4
:0A03100090E6B8E0FCBC4002800358
:03031A00020528B1
:0A031D0090E6B9E0FCBC0102801577
:06032700BCA2030203DF8B
:06032D00BCA3030203DF84
:06033300BCA9030203D97E
:0303390002052496
:0D033C0090E6BAE0606990E6C67480F0902B
:0E034900E6C774EDF090E6C8E4F090E6C9F067
:0E03570090E6CAF090E6CBF090E6CC7403F08E
:0D03650090E6CD7402F090E60CE4F00090FC
:0E037200E6F574FFF00075BB000090E6C7745E
:0E038000EDF00090E6047480F00090E6047446
:0E038E0002F00090E6047406F00090E604E42D
:0A039C00F00075BB0600750CE97552
:0503A6000D0F02052C03
:0E03AB0075BB000090E6F574FFF00090E604CC
:0E03B9007480F00090E6047402F00090E604F8
:0C03C7007406F00090E604E4F000E4F599
:0403D3000CF50D0216
:0203D700052CF3
:0603D90075080143090153
:0A03DF0090E6BAE0FC8C0F751000E8
:0A03E90090E6BBE0FDE4420FED4298
:0903F3001090E6BEE0FC8C1175CF
:0A03FC00120090E6BFE0FDE4FC42B1
:0504060011ED4212E5BA
:08040B000E70061208DE858266
:010413000EDA
:07041400E51145127003021F
:02041B00052CAE
:09041D0090E68AE4F090E68BF011
:0E04260090E6A0E0FC20E1F890E68BE0FE7F7F
:0C0434000090E6B9E0FCBCA33AE4F5132C
:02044000F514B1
:0A044200C3E5139EE5149F4003027A
:02044C00050C9D
:05044E00A80FA910E554
:080453001328F8E51439F9E55E
:0A045B00132440F582E51434E7F5A0
:0C04650083E0FC88828983F00513E4B575
:0604710013CF051480CB3F
:040477007C007D0088
:0A047B00C3EC9EED9F400302050C48
:06048500850E157401B59F
:04048B000E02804697
:09048F00EC250FF9ED3510F8AA77
:080498000E7B001ABAFF011BE4
:0C04A000EA5201EB5200E9486010AA0F7C
:0A04AC00ECFB2AFAE50E145AD39572
:0404B6000EF4F51536
:0C04BA00EEC39CFAEF9DFBA8157900C36F
:0E04C600EA98EB9950098E028C03EAC39BF56D
:0104D4001512
:0A04D500EC250FF582ED3510F583DC
:0A04DF00EC2440F518ED34E7F519A0
:0A04E90085151AC004C005C006C046
:0D04F300071206EED007D006D005D004A8F1
:0C050000157A00E82CFCEA3DFD02047BAB
:07050C00EE250FF50FEF359E
:0405130010F510E5EA
:0605170011C39EF511E581
:05051D00129FF512021F
:020522000414BF
:0405240075820022BA
:0405280075820022B6
:04052C0075820122B1
:09053000C0E0E50C450D60067504
:050539000A01E4F50BCE
:05053E00C2CFD0E03245
:0D05430090E6C67480F090E6C774EDF0906D
:0D055000E6C8E4F090E6C9F090E6CAF0902D
:0E055D00E6CBF090E6CC7403F090E6CD74028D
:07056B00F090E60CE4F00043
:070572003000FD120B48C22E
:030579000080F609
:0C057C00750E0090E678E05410C4540F97
:0A058800FA74504AF5097401550990
:03059200F5082247
:0E05950090E6007410F0758E0090E60174027E
:0E05A300F00090E61074A0F00090E61174E0F5
:0E05B100F00090E612E4F00090E613E4F00093
:0E05BF0090E61474E0F00090E615E4F0009071
:0E05CD00E6047480F00090E6047406F00090DE
:0E05DB00E604E4F00090E618E4F090E619F073
:0D05E90090E61A740CF090E61BE4F0009010
:0E05F600E68AE4F00090E68DE4F00090E6E284
:0E0604007402F00090E6E37401F00090E6242A
:0B0612007402F00090E625E4F00022E6
:0D061D0090E6F574FFF0009010BAE49390A1
:0D062A00E6F3F09010BBE49390E6C3F0906F
:0E06370010BCE49390E6C1F09010BDE49390E7
:0E064500E6C2F09010BFE49390E6C0F07A0099
:03065300BA80006A
:0E06560050128A037CE4EA90101693FD8B820A
:060664008C83F00A80E91E
:06066A0090E6C6E4F02258
:0E1016000101010101010107000000000000BE
:0E1024000000000000000000000000000000BE
:0E1032000000003F0101010101010107000063
:0E1040000000000000000000000000000000A2
:0E104E00000000000000003F38010101010118
:0E105C0001070302020202020200000000006F
:0E106A0000000000360000000000003F3801CA
:0E10780001010101010703020202020202004F
:0E108600000000000000000036000000000026
:02109400003F1B
:0E10960000000000000000000000000000004C
:0E10A4000000000080ED00000000030200804C
:0810B200EE0000000003020043
:0710BA00A0000000AE4E0093
:050FED00E4F516F51704
:0E06700075B0FF75B5FFD280C281C282D28301
:0D067E00C284C285D28775B2BF758200228A
:07068B00851682851783220A
:0906920075B2FFC283C2807A0731
:0E069B00EA20E71E8AF005F074A43392D274B0
:0306A900A4800327
:0306AC00A2D213C4
:0E06AF00D5F0FAFB139281D282C2821A80DE4D
:0606BD00D280C2807A0722
:0E06C300EA20E71E8AF005F074183392D27414
:0306D1001880038B
:0306D400A2D2139C
:0E06D700D5F0FAFB139281D282C2821A80DE25
:0906E500D28075B2B975820022C1
:0E06EE00AA82AB83C002C0031207AA12077FC4
:0E06FC001208C1E582D003D00260047C0180A8
:01070A006E80
:0C070B00E508601890E679EBF0C002C031
:0E071700031208C1E582D003D00260047C0109
:02072500805200
:0E07270090E679EAF01208C1E58260047C01D8
:02073500804200
:06073700AA18AB197D00B9
:0C073D00C3ED951A502A8A828B83E0FEDF
:0E074900A3AA82AB8390E679EEF0C002C00353
:0E075700C0051208ACE582D005D003D00260C8
:05076500047C01800F7F
:03076A000D80D02F
:0C076D0090E678E04440F012078E7C001B
:0607790053B27F8C8222C6
:0A077F0090E6787480F0E509250982
:0507890090E679F0226A
:03078E001207AAA5
:0E07910012077F1208AC90E678E04440F012A8
:0B079F0007AA90E678E0FA30E1E822BB
:0907AA0090E678E0FA20E6F8225E
:0E07B300AA82AB83C002C0031207AA12077FFE
:0E07C1001208C1E582D003D0026004758201E7
:0107CF002207
:0C07D000E508601890E679EBF0C002C06C
:0E07DC00031208C1E582D003D00260047582CA
:0207EA000122EA
:0E07EC0090E679EAF01208C1E5826004758299
:0207FA000122DA
:0A07FC0090E6787480F0E509250905
:0E080600FA90E67974014AF01208ACE58260BF
:050814000475820122C1
:0E08190090E679E01208ACE582600475820179
:0108270022AE
:040828007A007B00D7
:09082C00AC1B7D001CBCFF011D8A
:0E0835008B067F00C3EE9CEF64808DF063F0B5
:0B0843008095F05025EB251CFCE435EF
:0C084E001DFD90E679E08C828D83F0C0E7
:0E085A00031208ACE582D0036004758201220F
:050868000B8B0280BFB4
:0E086D0090E6787420F0C0021208ACE582D04C
:07087B0002600475820122F6
:09088200EA251CFAE4351DFB9087
:0E088B00E679E08A828B83F01208ACE5826089
:0508990004758201223C
:0E089E0090E6787440F090E679E075820022D2
:0E08AC0090E678E0FAFB30E0F7EB30E20475FE
:0308BA0082012296
:0408BD00758200221E
:0E08C10090E678E0FAFB30E0F7EB30E20475E9
:0308CF0082012281
:0808D200EB20E1047582012214
:0408DA007582002201
:0808DE00E50870047582012297
:0408E600751C4075C8
:0308EA001D187561
:0A08ED001B409000001207B37A00D0
:0308F700BA400004
:0A08FA00500FEA2400F582E43418E0
:07090400F583EAF00A80EC24
:04090B0075180075E6
:03090F001918753F
:0A0912001A409000001206EE7A0071
:03091C00BA4000DE
:0A091F005011EA2400F582E43418B8
:09092900F583EAF4FBF00A80EA10
:05093200751B40751C5F
:0309370000751D2B
:08093A00189000001207B390B1
:0B0942001800E0FA30E0047B018006A2
:06094D0063023F0A8A0369
:020953007A0028
:03095500BA4000A5
:0A09580050208A047D0075184075D8
:0309620019188BD6
:0C0965001A8C828D83C002C0031206EEC3
:09097100D003D002EB2AFA80DB6E
:03097A008B82224B
:0EE0000012010002FFFFFF40C0162F070201B1
:04E00E000102060104
:0AE012000A060002FFFFFF400100B4
:0EE01C0009023200030100C0000904000000E8
:0EE02A00FFFFFF030904010001FFFFFF0407D1
:0EE038000502020002000904020001FFFFFFC2
:08E04600050705860200020037
:0EE04E0012010002FFFFFF40C0162F07020163
:04E05C0001020001BC
:0AE060000A060002FFFFFF40010066
:0EE06A0009021200010100C0000904000000BC
:04E07800FFFFFF03A4
:01E07C00079C
:02E07D008CE035
:02E07F0092E02D
:02E08100ACE011
:02E08300DCE0DF
:02E08500FEE0BB
:02E087001AE19C
:02E0890034E180
:06E08C0006030000090478
:0EE092001A0347004E003300530020005000D8
:0CE0A00072006F006A00650063007400ED
:0EE0AC003003430055002000410041005500A4
:0EE0BA0020005300690047006500200053005D
:0EE0C800450034003100310030004C002D00C6
:06E0D60045004B00330081
:0EE0DC00220343006F006D006D0061006E00B6
:0EE0EA00640020002600200053007400610036
:06E0F800740075007300C6
:0EE0FE001C035400720061006E0073006D0080
:0EE10C0069007400200050006100740068007B
:0EE11A001A035200650063006500690076007C
:0CE12800650020005000610074006800D9
:0CE134000C0331003000300030003000DF
:08097D007880E84400600C7969
:0C09850001901800E4F0A3D8FCD9FAD0CF
:0E09910083D082F6D8FDC082C083758200221A
:08099F0090E6A0E04401F02203
:0E09A700AA8274805AC423541FFB740F5A9006
:0C09B500E6834BF090E683E04420F02243
:0E09C10090E680E0440AF09000FA120FCF900A
:0E09CF00E65D74FFF090E65F74FFF05391EF69
:0809DD0090E680E054F7F022DF
:06100D00E478FFF6D8FDB7
:060FF200752200752300CA
:0A09E50090E680E0FA30E71975246F
:0309EF000075256B
:0309F200E0752687
:0309F50012752751
:0309F800E075287F
:0309FB001C75293F
:0309FE00E0752A77
:030A01006A752BE8
:020A0400E022EE
:040A060075244E7590
:030A0A0025E0756F
:030A0D00266075EB
:030A100027E07567
:030A1300286A75D9
:030A160029E0755F
:030A19002A1C751F
:030A1C002BE022AA
:090A1F005391EF75A100D20032E1
:0C0A2800C021C0E0C0F0C082C083C0024A
:0E0A3400C003C004C005C006C007C000C0015A
:0E0A4200C0D075D0005391EF75A1001209E5E8
:0E0A5000D0D0D001D000D007D006D005D00401
:0D0A5E00D003D002D083D082D0F0D0E0D001
:020A6B00213236
:0C0A6D00C021C0E0C0F0C082C083C00205
:0E0A7900C003C004C005C006C007C000C00115
:0E0A8700C0D075D0005391EF75A1001209E5A3
:0E0A9500D0D0D001D000D007D006D005D004BC
:0D0AA300D003D002D083D082D0F0D0E0D0BC
:020AB0002132F1
:050AB2001209E5751EAC
:030AB7001F751F89
:080ABA000A758200120E6C7532
:030AC2001E287576
:060AC5001F0A75821012E9
:040ACB000E6C751E1A
:030ACF006D751F23
:0C0AD2000A758214120E6C90E65C743100
:020ADE00F02204
:0D0AE000E582547FFA24F75004758200224D
:070AED00BA01047582012229
:080AF400530201E4BA00010401
:030AFC00F582225E
:0E0AFF00AA82BA010C90E6A1E0FB7C008B827B
:030B0D008C8322B4
:0E0B1000BA810C90E6A2E0FB7C008B828C8305
:010B1E0022B4
:0E0B1F0053027FEA700C90E6A0E0FB7C008B96
:040B2D00828C832211
:0E0B310090E6A3E0FB7C00EAC313FA7D00EA25
:090B3F002BFBED3C8B82F58322B7
:0C0B4800C20090E6B8E0FA530260BA0068
:030B5400028028F4
:050B5700BA2002800D30
:050B5C00BA4002800E0A
:050B6100BA60028003F0
:030B6600020E017B
:060B690012099F020E01BB
:0A0B6F001201AFE5826003020E01DF
:060B790012099F020E01AB
:0D0B7F0090E6B8E0FA530280BA80028003CD
:030B8C00020D0255
:0B0B8F0090E6B9E0FABA0003020C8007
:050B9A00BA06028035DF
:050B9F00BA0802800805
:050BA400BA0A028017EF
:030BA900020CFC3F
:0C0BAC0090E740E522F090E68AE4F0902B
:080BB800E68B7401F0020E014E
:0C0BC00090E740E523F090E68AE4F09016
:080BCC00E68B7401F0020E013A
:0A0BD40090E6BBE0FABA01028017B8
:050BDE00BA020280389C
:050BE300BA0302805975
:050BE800BA0602801BAB
:050BED00BA0702803C84
:030BF200020C7A78
:0A0BF500AA24AB2590E6B3EBF07BD9
:090BFF000090E6B4EAF0020E01D8
:0A0C0800AA26AB2790E6B3EBF07BC1
:090C12000090E6B4EAF0020E01C4
:0A0C1B00AA28AB2990E6B3EBF07BAA
:090C25000090E6B4EAF0020E01B1
:0A0C2E00AA2AAB2B90E6B3EBF07B93
:090C38000090E6B4EAF0020E019E
:0E0C410090E6BAE0FA90E07CE0FBC3EA9B404C
:070C4F000612099F020E01CD
:0C0C560090E6BAE075F002A4247DF5825F
:0B0C620074E035F0F583E0FAA3E090A9
:0D0C6D00E6B3F07B0090E6B4EAF0020E0161
:060C7A0012099F020E01A9
:0D0C800090E6B8E0FA53021FBA0002800AA5
:050C8D00BA0102801C09
:050C9200BA0264802C91
:0E0C970090E7407401F090E741E4F090E68AA7
:090CA500F090E68B7402F0804E21
:0E0CAE0090E740E4F090E741F090E68AF09085
:070CBC00E68B7402F08039A1
:0E0CC30090E6BCE0F582120AE0E58260249023
:0E0CD100E6BCE0F582120AFFE0FA5302019041
:0E0CDF00E740EAF090E741E4F090E68AF090FA
:070CED00E68B7402F08008A1
:050CF40012099F8003BE
:030CF90012099F3E
:060CFC0012099F020E0127
:0C0D020090E6B9E0FA24F45003020DFE64
:070D0E00EA2A2A900D15737B
:070D1500020DFE020D4B026E
:060D1C000DC6020DA70246
:060D22000DFE020DFE02B1
:060D28000DFE020DFE02AB
:060D2E000DFE020D39026A
:050D34000DFE020D425E
:090D390090E6BAE0F522020E0179
:090D420090E6BAE0F523020E016F
:0D0D4B0090E6B8E0FA53021FBA00028005DE
:050D5800BA0247800A09
:0A0D5D0090E6BAE012099F020E01B1
:0D0D670090E6BAE0703090E6BCE0F5821234
:0D0D74000AE0E582602390E6BCE0F5821203
:0E0D81000AFFAA82AB83E0FC5304FE8A828B39
:0E0D8F0083ECF090E6BCE0F5821209A78064C8
:050D9D0012099F805FB8
:050DA20012099F805AB8
:0E0DA70090E6B8E0FA53021FBA004F90E6BA89
:070DB500E0FABA010280051B
:050DBC00BA02028040B4
:050DC10012099F803BB8
:0E0DC60090E6BAE0FA702C90E6BCE0F58212DE
:0D0DD4000AE0E582601A90E6BCE0F58212AC
:0E0DE1000AFFAA82AB83E0FC4304018A828BE6
:050DEF0083ECF0800D13
:050DF40012099F8008B8
:050DF90012099F8003B8
:030DFE0012099F38
:080E010090E6A0E04480F0221D
:050E0900AA82BA0300FB
:070E0E004005EA249C50019D
:010E150022BA
:090E1600740F5AFBBB03028007B4
:070E1F00740F5AFBBB0B45E9
:0A0E2600A2AF9202C2AFEA2400F569
:0C0E300082E43400F5837402F07B00744F
:0C0E3C00012AFCE43BFDEC2400F582EDF3
:0A0E48003400F583E51FFCF074028E
:0C0E52002AFAE43BFBEA2400F582EB34B2
:0A0E5E0000F583AA1E7B00EAF0A253
:030E68000292AF44
:010E6B002264
:080E6C00E582FA248350012203
:060E7400EA5403600122B4
:0A0E7A00A2AF9203C2AFEA2400F514
:0C0E840082E43401F5837402F07B0074FA
:0C0E9000012AFCE43BFDEC2400F582ED9F
:0A0E9C003401F583E51FF074022A0B
:0B0EA600FAE43BFBEA2400F582EB3489
:080EB10001F583AA1EEAF0A27C
:040EB9000392AF22CF
:050EBD00AA82BA8000CA
:070EC2004005EA244B50013A
:010EC9002206
:060ECA00EA54036001225E
:0A0ED000A2AF9204C2AFEA2480F53D
:0C0EDA0082E43400F5837402F07B0074A5
:0C0EE600012AFCE43BFDEC2480F582EDC9
:0A0EF2003400F583E51FF074022AB6
:0B0EFC00FAE43BFBEA2480F582EB34B3
:080F070000F583AA1EEAF0A226
:040F0F000492AF2277
:080F1300C2E8C2EA751E007578
:060F1B001F017582431264
:040F21000E09751E22
:030F250080751FB5
:0C0F280000758253120E090090E650E4A0
:0E0F3400F00090E652E4F00090E654E4F00085
:0E0F420090E656E4F00090E65174FFF0009047
:0E0F5000E65374FFF00090E65574FFF0009039
:0E0F5E00E65774FFF00090E658E4F090E65974
:0E0F6C0074FFF090E65AE4F090E65B74FFF03C
:0E0F7A0090E65CE4F090E65D74FFF090E65EB9
:0E0F8800E4F090E65F74FFF00090E660E4F0A5
:0D0F96000090E66174FFF090E662E4F090D8
:0E0FA300E66374FFF090E665E4F090E6687493
:0A0FB1000BF05391AFD2E8D2EA2210
:010FBB002213
:020FBC00AA8207
:060FBE00120FBBDAFB225A
:030FC40090FB504F
:080FC700A3E582458370F922C5
:040FCF00AA82AB83C4
:080FD300120FC41ABAFF011B42
:050FDB00EA4B70F42256
:0310000075812BCC
:0A10030012097DE5826003020FFB75
:00000001FF

View File

@ -0,0 +1,38 @@
/* -*- 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 2, 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., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, 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_ */

View File

@ -0,0 +1,40 @@
#define EEPROM_ADDR 0x51
//-----------------------------------------------------------------------------
// Macros
//-----------------------------------------------------------------------------
// the 3684 DVK board uses port pin PA7 as an EEPROM write-protect enable/disable.
// If your design uses a different pin, modify the following macros accordingly.
#define EEPROM_ENABLE_WRITE_PROTECT() OEA &= ~0x80 // float PA7
#define EEPROM_DISABLE_WRITE_PROTECT() PA7 = 0; OEA |= 0x80 // drive PA7 low
#define MSB(word) (BYTE)(((WORD)(word) >> 8) & 0xff)
#define LSB(word) (BYTE)((WORD)(word) & 0xff)
#define SWAP_ENDIAN(word) ((BYTE*)&word)[0] ^= ((BYTE*)&word)[1];\
((BYTE*)&word)[1] ^= ((BYTE*)&word)[0];\
((BYTE*)&word)[0] ^= ((BYTE*)&word)[1]
//-----------------------------------------------------------------------------
// Function Prototypes
//-----------------------------------------------------------------------------
void EEWaitForStop();
BYTE EEWaitForAck();
static void EEStartAndAddr();
extern void WaitForEEPROMWrite();
BYTE EEPROMWritePage(WORD addr, BYTE xdata * ptr, BYTE len);
BYTE EEPROMRead(WORD addr, BYTE length, BYTE xdata *buf);
void WaitForEEPROMWrite2();
BYTE EEWaitForDone();
BYTE EEPROMGetPageSize();
//-----------------------------------------------------------------------------
// Global Variables
//-----------------------------------------------------------------------------
extern BYTE DB_Addr; // Dual Byte Address stat
extern BYTE I2C_Addr; // I2C address
extern BYTE EE_Page_Size; // EEPROM page size
//-----------------------------------------------------------------------------
// Global Constants
//-----------------------------------------------------------------------------
#define SERIAL_ADDR 0x50

View File

@ -0,0 +1,738 @@
/* -*- 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 2, 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., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/*
//-----------------------------------------------------------------------------
// File: FX2regs.h
// Contents: EZ-USB FX2 register declarations and bit mask definitions.
//
// $Archive: /USB/Target/Inc/fx2regs.h $
// $Date: 2003/12/08 03:26:57 $
// $Revision: 1.4 $
//
//
// 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.
-----------------------------------------------------------------------------*/
// Port A
sfr at 0x80 IOA;
// Bit addressing on Port A
sbit at 0x80+0 A0;
sbit at 0x80+1 A1;
sbit at 0x80+2 A2;
sbit at 0x80+3 A3;
sbit at 0x80+4 A4;
sbit at 0x80+5 A5;
sbit at 0x80+6 A6;
sbit at 0x80+7 A7;
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;
// Port D
sfr at 0xB0 IOD;
// Bit addressing on Port D
sbit at 0xB0+0 D0;
sbit at 0xB0+1 D1;
sbit at 0xB0+2 D2;
sbit at 0xB0+3 D3;
sbit at 0xB0+4 D4;
sbit at 0xB0+5 D5;
sbit at 0xB0+6 D6;
sbit at 0xB0+7 D7;
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 */

View File

@ -0,0 +1,31 @@
/* -*- 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 2, 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., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, 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_ */

View File

@ -0,0 +1,97 @@
/*
* Code from: USRP - Universal Software Radio Peripheral (GNU Radio)
*
* Initial modifications by:
*
* Stephan Esterhuizen, Aerospace Engineering Sciences
* University of Colorado at Boulder
* Boulder CO, USA
*
* Further modifications for use with the SiGe USB module to accompany
* the textbook: "A Software-Defined GPS and Galileo Receiver: A
* Single-Frequency Approach" by Kai Borre, Dennis Akos, et.al. by:
*
* Marcus Junered, GNSS Research Group
* Lulea University of Technology
* Lulea, Sweden
*
* http://ccar.colorado.edu/gnss
*
* ---------------------------------------------------------------------
*
* GN3S - GNSS IF Streamer for Windows
* Copyright (C) 2006 Marcus Junered
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _GN3S_MAIN_
#define _GN3S_MAIN_
#include "usrp_common.h"
#include "fx2regs.h"
#include "gn3s_regs.h"
#include "gpif_inline.h"
#include "timer.h"
#include "isr.h"
#include "usb_common.h"
#include "fx2utils.h"
#include "gn3s_se4110.h"
#include "eeprom.h"
#include <string.h>
// ----------------------------------------------------------------
// Vendor bmRequestType's
// ----------------------------------------------------------------
#define VRT_VENDOR_IN 0xC0
#define VRT_VENDOR_OUT 0x40
// 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
// OUT commands
#define VRQ_XFER 0x01
#define VRQ_XFER_TX 0x02
#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 GUARD 4073
#undef wordwide
// A9 specific
#define VRQ_EEPROM 0xa2 // loads (uploads) EEPROM
#define VRQ_RAM 0xa3 // loads (uploads) external ram
#define VRQ_DB_FX 0xa9 // Force use of double byte address EEPROM
#define EP0BUFF_SIZE 0x40
// Prototypes
static void get_ep0_data(void);
unsigned char app_vendor_cmd(void);
void guardC(void) interrupt;
static void main_loop(void);
void TD_Init();
#endif

View File

@ -0,0 +1,63 @@
/*
* Code from: USRP - Universal Software Radio Peripheral (GNU Radio)
*
* Initial modifications by:
*
* Stephan Esterhuizen, Aerospace Engineering Sciences
* University of Colorado at Boulder
* Boulder CO, USA
*
* Further modifications for use with the SiGe USB module to accompany
* the textbook: "A Software-Defined GPS and Galileo Receiver: A
* Single-Frequency Approach" by Kai Borre, Dennis Akos, et.al. by:
*
* Marcus Junered, GNSS Research Group
* Lulea University of Technology
* Lulea, Sweden
*
* http://ccar.colorado.edu/gnss
*
* ---------------------------------------------------------------------
*
* GN3S - GNSS IF Streamer for Windows
* Copyright (C) 2006 Marcus Junered
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _GN3S_REGS_H_
#define _GN3S_REGS_H_
/* Port A (bit addressable): */
#define bmPORT_A_OUTPUTS 0 /* All inputs */
#define bmPORT_A_INITIAL 0
/* Port B: GPIF FD[7:0] */
// FIFO Input
/* Port C */
#define bmPORT_C_OUTPUTS 0
#define bmPORT_C_INITIAL 0
/* Port D: GPIF FD[15:8] */
#define bmPORT_D_OUTPUTS 0
#define bmPORT_D_INITIAL 0
/* Port E: not bit addressible */
#define bmPORT_E_OUTPUTS 0
#define bmPORT_E_INITIAL 0
#endif

View File

@ -0,0 +1,53 @@
/*
* Code from: USRP - Universal Software Radio Peripheral (GNU Radio)
*
* Initial modifications by:
*
* Stephan Esterhuizen, Aerospace Engineering Sciences
* University of Colorado at Boulder
* Boulder CO, USA
*
* Further modifications for use with the SiGe USB module to accompany
* the textbook: "A Software-Defined GPS and Galileo Receiver: A
* Single-Frequency Approach" by Kai Borre, Dennis Akos, et.al. by:
*
* Marcus Junered, GNSS Research Group
* Lulea University of Technology
* Lulea, Sweden
*
* http://ccar.colorado.edu/gnss
*
* ---------------------------------------------------------------------
*
* GN3S - GNSS IF Streamer for Windows
* Copyright (C) 2006 Marcus Junered
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _GN3S_SE4110_
#define _GN3S_SE4110_
#include "fx2regs.h"
#include "delay.h"
/* Prototypes */
char init_se4110(void);
char enable_se4110(void);
char disable_se4110(void);
char reset_se4110(void);
char program_3w(void);
#endif

View File

@ -0,0 +1,27 @@
/*
* Machine generated by "edit-gpif". Do not edit by hand.
*/
#define setup_flowstate_common() \
do { \
FLOWSTATE = 0x80; \
FLOWLOGIC = 0xed; \
FLOWEQ0CTL = 0x00; \
FLOWEQ1CTL = 0x00; \
FLOWHOLDOFF = 0x00; \
FLOWSTB = 0x00; \
FLOWSTBEDGE = 0x03; \
FLOWSTBHPERIOD = 0x02; \
GPIFHOLDAMOUNT = 0x00; \
} while (0)
#define setup_flowstate_read() \
do { \
FLOWLOGIC = 0xed; \
} while (0)
#define setup_flowstate_write() \
do { \
FLOWLOGIC = 0xee; \
} while (0)

View File

@ -0,0 +1,172 @@
/* -*- 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 2, 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., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, 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 0x80
#define FGV_EP4PF 0x84
#define FGV_EP6PF 0x88
#define FGV_EP8PF 0x8c
#define FGV_EP2EF 0x90
#define FGV_EP4EF 0x94
#define FGV_EP6EF 0x98
#define FGV_EP8EF 0x9c
#define FGV_EP2FF 0xa0
#define FGV_EP4FF 0xa4
#define FGV_EP6FF 0xa8
#define FGV_EP8FF 0xac
#define FGV_GPIFDONE 0xb0
#define FGV_GPIFWF 0xb4
#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_ */

View File

@ -0,0 +1,65 @@
/* -*- 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 2, 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., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, 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_ */

View File

@ -0,0 +1,35 @@
/* -*- 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 2, 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., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, 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_ */

View File

@ -0,0 +1,38 @@
/* -*- 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 2, 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., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef _USB_COMMON_H_
#define _USB_COMMON_H_
extern volatile bit _usb_got_SUDAV;
extern volatile bit _usb_rx_overrun;
// 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_ */

View File

@ -0,0 +1,32 @@
/* -*- 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 2, 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., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, 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[];

View File

@ -0,0 +1,88 @@
/* -*- 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 2, 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., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, 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_ */

View File

@ -0,0 +1,97 @@
/*
* 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 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _USRP_COMMANDS_H_
#define _USRP_COMMANDS_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_ */

View File

@ -0,0 +1,70 @@
/*
* 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 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/*
* 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 "gn3s_regs.h"
#include "fx2regs.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);
#endif /* _USRPCOMMON_H_ */

View File

@ -0,0 +1,12 @@
INCLUDES=-I../include
CC=sdcc -mmcs51 --no-xinit-opt
all: delay.c fx2utils.c isr.c timer.c usb_common.c
$(CC) $(INCLUDES) -c delay.c -o delay.rel
$(CC) $(INCLUDES) -c fx2utils.c -o fx2utils.rel
$(CC) $(INCLUDES) -c isr.c -o isr.rel
$(CC) $(INCLUDES) -c timer.c -o timer.rel
$(CC) $(INCLUDES) -c usb_common.c -o usb_common.rel
clean:
rm -f *.ihx *.rel *.rst *.lnk *.lst *.map *.asm *.sym

View File

@ -0,0 +1,179 @@
;--------------------------------------------------------
; File Created by SDCC : free open source ANSI-C Compiler
; Version 2.9.0 #5416 (Feb 3 2010) (UNIX)
; This file was generated Mon Jul 30 11:40:52 2012
;--------------------------------------------------------
.module delay
.optsdcc -mmcs51 --model-small
;--------------------------------------------------------
; Public variables in this module
;--------------------------------------------------------
.globl _mdelay
.globl _udelay
;--------------------------------------------------------
; special function registers
;--------------------------------------------------------
.area RSEG (DATA)
;--------------------------------------------------------
; special function bits
;--------------------------------------------------------
.area RSEG (DATA)
;--------------------------------------------------------
; 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)
;--------------------------------------------------------
; indirectly addressable internal ram data
;--------------------------------------------------------
.area ISEG (DATA)
;--------------------------------------------------------
; absolute internal ram data
;--------------------------------------------------------
.area IABS (ABS,DATA)
.area IABS (ABS,DATA)
;--------------------------------------------------------
; bit data
;--------------------------------------------------------
.area BSEG (BIT)
;--------------------------------------------------------
; paged external ram data
;--------------------------------------------------------
.area PSEG (PAG,XDATA)
;--------------------------------------------------------
; external ram data
;--------------------------------------------------------
.area XSEG (XDATA)
;--------------------------------------------------------
; absolute external ram data
;--------------------------------------------------------
.area XABS (ABS,XDATA)
;--------------------------------------------------------
; external initialized ram data
;--------------------------------------------------------
.area HOME (CODE)
.area GSINIT0 (CODE)
.area GSINIT1 (CODE)
.area GSINIT2 (CODE)
.area GSINIT3 (CODE)
.area GSINIT4 (CODE)
.area GSINIT5 (CODE)
.area GSINIT (CODE)
.area GSFINAL (CODE)
.area CSEG (CODE)
;--------------------------------------------------------
; global & static initialisations
;--------------------------------------------------------
.area HOME (CODE)
.area GSINIT (CODE)
.area GSFINAL (CODE)
.area GSINIT (CODE)
;--------------------------------------------------------
; Home
;--------------------------------------------------------
.area HOME (CODE)
.area HOME (CODE)
;--------------------------------------------------------
; code
;--------------------------------------------------------
.area CSEG (CODE)
;------------------------------------------------------------
;Allocation info for local variables in function 'udelay1'
;------------------------------------------------------------
;------------------------------------------------------------
; delay.c:27: udelay1 (void) _naked
; -----------------------------------------
; function udelay1
; -----------------------------------------
_udelay1:
; naked function: no prologue.
; delay.c:31: _endasm;
; lcall that got us here took 4 bus cycles
ret ; 4 bus cycles
; naked function: no epilogue.
;------------------------------------------------------------
;Allocation info for local variables in function 'udelay'
;------------------------------------------------------------
;usecs Allocated to registers r2
;------------------------------------------------------------
; delay.c:38: udelay (unsigned char usecs)
; -----------------------------------------
; function udelay
; -----------------------------------------
_udelay:
ar2 = 0x02
ar3 = 0x03
ar4 = 0x04
ar5 = 0x05
ar6 = 0x06
ar7 = 0x07
ar0 = 0x00
ar1 = 0x01
mov r2,dpl
; delay.c:40: do {
00101$:
; delay.c:41: udelay1 ();
lcall _udelay1
; delay.c:42: } while (--usecs != 0);
djnz r2,00101$
ret
;------------------------------------------------------------
;Allocation info for local variables in function 'mdelay1'
;------------------------------------------------------------
;------------------------------------------------------------
; delay.c:54: mdelay1 (void) _naked
; -----------------------------------------
; function mdelay1
; -----------------------------------------
_mdelay1:
; naked function: no prologue.
; delay.c:65: _endasm;
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
; naked function: no epilogue.
;------------------------------------------------------------
;Allocation info for local variables in function 'mdelay'
;------------------------------------------------------------
;msecs Allocated to registers r2 r3
;------------------------------------------------------------
; delay.c:69: mdelay (unsigned int msecs)
; -----------------------------------------
; function mdelay
; -----------------------------------------
_mdelay:
mov r2,dpl
mov r3,dph
; delay.c:71: do {
00101$:
; delay.c:72: mdelay1 ();
lcall _mdelay1
; delay.c:73: } while (--msecs != 0);
dec r2
cjne r2,#0xff,00108$
dec r3
00108$:
mov a,r2
orl a,r3
jnz 00101$
ret
.area CSEG (CODE)
.area CONST (CODE)
.area CABS (ABS,CODE)

View File

@ -0,0 +1,76 @@
/* -*- 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 2, 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., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, 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);
}

View File

@ -0,0 +1,179 @@
1 ;--------------------------------------------------------
2 ; File Created by SDCC : free open source ANSI-C Compiler
3 ; Version 2.9.0 #5416 (Feb 3 2010) (UNIX)
4 ; This file was generated Mon Jul 30 11:40:52 2012
5 ;--------------------------------------------------------
6 .module delay
7 .optsdcc -mmcs51 --model-small
8
9 ;--------------------------------------------------------
10 ; Public variables in this module
11 ;--------------------------------------------------------
12 .globl _mdelay
13 .globl _udelay
14 ;--------------------------------------------------------
15 ; special function registers
16 ;--------------------------------------------------------
17 .area RSEG (DATA)
18 ;--------------------------------------------------------
19 ; special function bits
20 ;--------------------------------------------------------
21 .area RSEG (DATA)
22 ;--------------------------------------------------------
23 ; overlayable register banks
24 ;--------------------------------------------------------
25 .area REG_BANK_0 (REL,OVR,DATA)
0000 26 .ds 8
27 ;--------------------------------------------------------
28 ; internal ram data
29 ;--------------------------------------------------------
30 .area DSEG (DATA)
31 ;--------------------------------------------------------
32 ; overlayable items in internal ram
33 ;--------------------------------------------------------
34 .area OSEG (OVR,DATA)
35 ;--------------------------------------------------------
36 ; indirectly addressable internal ram data
37 ;--------------------------------------------------------
38 .area ISEG (DATA)
39 ;--------------------------------------------------------
40 ; absolute internal ram data
41 ;--------------------------------------------------------
42 .area IABS (ABS,DATA)
43 .area IABS (ABS,DATA)
44 ;--------------------------------------------------------
45 ; bit data
46 ;--------------------------------------------------------
47 .area BSEG (BIT)
48 ;--------------------------------------------------------
49 ; paged external ram data
50 ;--------------------------------------------------------
51 .area PSEG (PAG,XDATA)
52 ;--------------------------------------------------------
53 ; external ram data
54 ;--------------------------------------------------------
55 .area XSEG (XDATA)
56 ;--------------------------------------------------------
57 ; absolute external ram data
58 ;--------------------------------------------------------
59 .area XABS (ABS,XDATA)
60 ;--------------------------------------------------------
61 ; external initialized ram data
62 ;--------------------------------------------------------
63 .area HOME (CODE)
64 .area GSINIT0 (CODE)
65 .area GSINIT1 (CODE)
66 .area GSINIT2 (CODE)
67 .area GSINIT3 (CODE)
68 .area GSINIT4 (CODE)
69 .area GSINIT5 (CODE)
70 .area GSINIT (CODE)
71 .area GSFINAL (CODE)
72 .area CSEG (CODE)
73 ;--------------------------------------------------------
74 ; global & static initialisations
75 ;--------------------------------------------------------
76 .area HOME (CODE)
77 .area GSINIT (CODE)
78 .area GSFINAL (CODE)
79 .area GSINIT (CODE)
80 ;--------------------------------------------------------
81 ; Home
82 ;--------------------------------------------------------
83 .area HOME (CODE)
84 .area HOME (CODE)
85 ;--------------------------------------------------------
86 ; code
87 ;--------------------------------------------------------
88 .area CSEG (CODE)
89 ;------------------------------------------------------------
90 ;Allocation info for local variables in function 'udelay1'
91 ;------------------------------------------------------------
92 ;------------------------------------------------------------
93 ; delay.c:27: udelay1 (void) _naked
94 ; -----------------------------------------
95 ; function udelay1
96 ; -----------------------------------------
0000 97 _udelay1:
98 ; naked function: no prologue.
99 ; delay.c:31: _endasm;
100 ; lcall that got us here took 4 bus cycles
0000 22 101 ret ; 4 bus cycles
102
103 ; naked function: no epilogue.
104 ;------------------------------------------------------------
105 ;Allocation info for local variables in function 'udelay'
106 ;------------------------------------------------------------
107 ;usecs Allocated to registers r2
108 ;------------------------------------------------------------
109 ; delay.c:38: udelay (unsigned char usecs)
110 ; -----------------------------------------
111 ; function udelay
112 ; -----------------------------------------
0001 113 _udelay:
0002 114 ar2 = 0x02
0003 115 ar3 = 0x03
0004 116 ar4 = 0x04
0005 117 ar5 = 0x05
0006 118 ar6 = 0x06
0007 119 ar7 = 0x07
0000 120 ar0 = 0x00
0001 121 ar1 = 0x01
0001 AA 82 122 mov r2,dpl
123 ; delay.c:40: do {
0003 124 00101$:
125 ; delay.c:41: udelay1 ();
0003 12s00r00 126 lcall _udelay1
127 ; delay.c:42: } while (--usecs != 0);
0006 DA FB 128 djnz r2,00101$
0008 22 129 ret
130 ;------------------------------------------------------------
131 ;Allocation info for local variables in function 'mdelay1'
132 ;------------------------------------------------------------
133 ;------------------------------------------------------------
134 ; delay.c:54: mdelay1 (void) _naked
135 ; -----------------------------------------
136 ; function mdelay1
137 ; -----------------------------------------
0009 138 _mdelay1:
139 ; naked function: no prologue.
140 ; delay.c:65: _endasm;
141
0009 90 FB 50 142 mov dptr,#(-1200 & 0xffff)
000C 143 002$:
000C A3 144 inc dptr ; 3 bus cycles
000D E5 82 145 mov a, dpl ; 2 bus cycles
000F 45 83 146 orl a, dph ; 2 bus cycles
0011 70 F9 147 jnz 002$ ; 3 bus cycles
148
0013 22 149 ret
150
151 ; naked function: no epilogue.
152 ;------------------------------------------------------------
153 ;Allocation info for local variables in function 'mdelay'
154 ;------------------------------------------------------------
155 ;msecs Allocated to registers r2 r3
156 ;------------------------------------------------------------
157 ; delay.c:69: mdelay (unsigned int msecs)
158 ; -----------------------------------------
159 ; function mdelay
160 ; -----------------------------------------
0014 161 _mdelay:
0014 AA 82 162 mov r2,dpl
0016 AB 83 163 mov r3,dph
164 ; delay.c:71: do {
0018 165 00101$:
166 ; delay.c:72: mdelay1 ();
0018 12s00r09 167 lcall _mdelay1
168 ; delay.c:73: } while (--msecs != 0);
001B 1A 169 dec r2
001C BA FF 01 170 cjne r2,#0xff,00108$
001F 1B 171 dec r3
0020 172 00108$:
0020 EA 173 mov a,r2
0021 4B 174 orl a,r3
0022 70 F4 175 jnz 00101$
0024 22 176 ret
177 .area CSEG (CODE)
178 .area CONST (CODE)
179 .area CABS (ABS,CODE)

View File

@ -0,0 +1,63 @@
XH
H 17 areas 2 global symbols
M delay
O -mmcs51 --model-small
A _CODE size 0 flags 0 addr 0
A RSEG size 0 flags 0 addr 0
A REG_BANK_0 size 8 flags 4 addr 0
A DSEG size 0 flags 0 addr 0
A OSEG size 0 flags 4 addr 0
A ISEG size 0 flags 0 addr 0
A IABS size 0 flags 8 addr 0
A BSEG size 0 flags 80 addr 0
A PSEG size 0 flags 50 addr 0
A XSEG size 0 flags 40 addr 0
A XABS size 0 flags 48 addr 0
A HOME size 0 flags 20 addr 0
A GSINIT0 size 0 flags 20 addr 0
A GSINIT1 size 0 flags 20 addr 0
A GSINIT2 size 0 flags 20 addr 0
A GSINIT3 size 0 flags 20 addr 0
A GSINIT4 size 0 flags 20 addr 0
A GSINIT5 size 0 flags 20 addr 0
A GSINIT size 0 flags 20 addr 0
A GSFINAL size 0 flags 20 addr 0
A CSEG size 25 flags 20 addr 0
S _mdelay Def0014
S _udelay Def0001
A CONST size 0 flags 20 addr 0
A CABS size 0 flags 28 addr 0
T 00 00
R 00 00 00 02
T 00 00
R 00 00 00 14
T 00 00 22
R 00 00 00 14
T 00 01
R 00 00 00 14
T 00 01 AA 82
R 00 00 00 14
T 00 03
R 00 00 00 14
T 00 03 12 00 00 DA FB 22
R 00 00 00 14 00 03 00 14
T 00 09
R 00 00 00 14
T 00 09 90 FB 50
R 00 00 00 14
T 00 0C
R 00 00 00 14
T 00 0C A3 E5 82 45 83 70 F9 22
R 00 00 00 14
T 00 14
R 00 00 00 14
T 00 14 AA 82 AB 83
R 00 00 00 14
T 00 18
R 00 00 00 14
T 00 18 12 00 09 1A BA FF 01 1B
R 00 00 00 14 00 03 00 14
T 00 20
R 00 00 00 14
T 00 20 EA 4B 70 F4 22
R 00 00 00 14

View File

@ -0,0 +1,380 @@
ASxxxx Assembler V01.70 + NoICE + SDCC mods + Flat24 Feb-1999 (Intel 8051), page 1.
Symbol Table
A 00D6
AC 00D6
ACC 00E0
ACC.0 00E0
ACC.1 00E1
ACC.2 00E2
ACC.3 00E3
ACC.4 00E4
ACC.5 00E5
ACC.6 00E6
ACC.7 00E7
B 00F0
B.0 00F0
B.1 00F1
B.2 00F2
B.3 00F3
B.4 00F4
B.5 00F5
B.6 00F6
B.7 00F7
CPRL2 00C8
CT2 00C9
CY 00D7
DPH 0083
DPL 0082
EA 00AF
ES 00AC
ET0 00A9
ET1 00AB
ET2 00AD
EX0 00A8
EX1 00AA
EXEN2 00CB
EXF2 00CE
F0 00D5
IE 00A8
IE.0 00A8
IE.1 00A9
IE.2 00AA
IE.3 00AB
IE.4 00AC
IE.5 00AD
IE.7 00AF
IE0 0089
IE1 008B
INT0 00B2
INT1 00B3
IP 00B8
IP.0 00B8
IP.1 00B9
IP.2 00BA
IP.3 00BB
IP.4 00BC
IP.5 00BD
IT0 0088
IT1 008A
OV 00D2
P 00D0
P0 0080
P0.0 0080
P0.1 0081
P0.2 0082
P0.3 0083
P0.4 0084
P0.5 0085
P0.6 0086
P0.7 0087
P1 0090
P1.0 0090
P1.1 0091
P1.2 0092
P1.3 0093
P1.4 0094
P1.5 0095
P1.6 0096
P1.7 0097
P2 00A0
P2.0 00A0
P2.1 00A1
P2.2 00A2
P2.3 00A3
P2.4 00A4
P2.5 00A5
P2.6 00A6
P2.7 00A7
P3 00B0
P3.0 00B0
P3.1 00B1
P3.2 00B2
P3.3 00B3
P3.4 00B4
P3.5 00B5
P3.6 00B6
P3.7 00B7
PCON 0087
PS 00BC
PSW 00D0
PSW.0 00D0
PSW.1 00D1
PSW.2 00D2
PSW.3 00D3
PSW.4 00D4
PSW.5 00D5
PSW.6 00D6
PSW.7 00D7
PT0 00B9
PT1 00BB
PT2 00BD
PX0 00B8
PX1 00BA
RB8 009A
RCAP2H 00CB
RCAP2L 00CA
RCLK 00CD
REN 009C
RI 0098
RS0 00D3
RS1 00D4
RXD 00B0
SBUF 0099
SCON 0098
SCON.0 0098
SCON.1 0099
SCON.2 009A
SCON.3 009B
SCON.4 009C
SCON.5 009D
SCON.6 009E
SCON.7 009F
SM0 009F
SM1 009E
SM2 009D
SP 0081
T2CON 00C8
T2CON.0 00C8
T2CON.1 00C9
T2CON.2 00CA
T2CON.3 00CB
T2CON.4 00CC
T2CON.5 00CD
T2CON.6 00CE
T2CON.7 00CF
TB8 009B
TCLK 00CC
TCON 0088
TCON.0 0088
TCON.1 0089
TCON.2 008A
TCON.3 008B
TCON.4 008C
TCON.5 008D
TCON.6 008E
TCON.7 008F
TF0 008D
TF1 008F
TF2 00CF
TH0 008C
TH1 008D
TH2 00CD
TI 0099
TL0 008A
TL1 008B
TL2 00CC
TMOD 0089
TR0 008C
TR1 008E
TR2 00CA
TXD 00B1
14 _mdelay 0014 GR
14 _mdelay1 0009 R
14 _udelay 0001 GR
14 _udelay1 0000 R
a 00D6
ac 00D6
acc 00E0
acc.0 00E0
acc.1 00E1
acc.2 00E2
acc.3 00E3
acc.4 00E4
acc.5 00E5
acc.6 00E6
acc.7 00E7
ar0 = 0000
ar1 = 0001
ar2 = 0002
ar3 = 0003
ar4 = 0004
ar5 = 0005
ar6 = 0006
ar7 = 0007
b 00F0
b.0 00F0
b.1 00F1
b.2 00F2
b.3 00F3
b.4 00F4
b.5 00F5
b.6 00F6
b.7 00F7
cprl2 00C8
ct2 00C9
cy 00D7
dph 0083
dpl 0082
ea 00AF
es 00AC
et0 00A9
et1 00AB
et2 00AD
ex0 00A8
ex1 00AA
exen2 00CB
exf2 00CE
f0 00D5
ie 00A8
ie.0 00A8
ie.1 00A9
ie.2 00AA
ie.3 00AB
ie.4 00AC
ie.5 00AD
ie.7 00AF
ie0 0089
ie1 008B
int0 00B2
int1 00B3
ip 00B8
ip.0 00B8
ip.1 00B9
ip.2 00BA
ip.3 00BB
ip.4 00BC
ip.5 00BD
it0 0088
it1 008A
ov 00D2
p 00D0
p0 0080
p0.0 0080
p0.1 0081
p0.2 0082
p0.3 0083
p0.4 0084
p0.5 0085
p0.6 0086
p0.7 0087
p1 0090
p1.0 0090
p1.1 0091
p1.2 0092
p1.3 0093
p1.4 0094
p1.5 0095
p1.6 0096
p1.7 0097
p2 00A0
p2.0 00A0
p2.1 00A1
p2.2 00A2
p2.3 00A3
p2.4 00A4
p2.5 00A5
p2.6 00A6
p2.7 00A7
p3 00B0
p3.0 00B0
p3.1 00B1
p3.2 00B2
p3.3 00B3
p3.4 00B4
p3.5 00B5
p3.6 00B6
p3.7 00B7
pcon 0087
ps 00BC
psw 00D0
psw.0 00D0
psw.1 00D1
psw.2 00D2
psw.3 00D3
psw.4 00D4
psw.5 00D5
psw.6 00D6
psw.7 00D7
pt0 00B9
pt1 00BB
pt2 00BD
px0 00B8
px1 00BA
rb8 009A
rcap2h 00CB
rcap2l 00CA
rclk 00CD
ren 009C
ri 0098
rs0 00D3
rs1 00D4
rxd 00B0
sbuf 0099
scon 0098
scon.0 0098
scon.1 0099
scon.2 009A
scon.3 009B
scon.4 009C
scon.5 009D
scon.6 009E
scon.7 009F
sm0 009F
sm1 009E
sm2 009D
sp 0081
t2con 00C8
t2con.0 00C8
t2con.1 00C9
t2con.2 00CA
t2con.3 00CB
t2con.4 00CC
t2con.5 00CD
t2con.6 00CE
t2con.7 00CF
tb8 009B
tclk 00CC
tcon 0088
tcon.0 0088
tcon.1 0089
tcon.2 008A
tcon.3 008B
tcon.4 008C
tcon.5 008D
tcon.6 008E
tcon.7 008F
tf0 008D
tf1 008F
tf2 00CF
th0 008C
th1 008D
th2 00CD
ti 0099
tl0 008A
tl1 008B
tl2 00CC
tmod 0089
tr0 008C
tr1 008E
tr2 00CA
txd 00B1
ASxxxx Assembler V01.70 + NoICE + SDCC mods + Flat24 Feb-1999 (Intel 8051), page 2.
Area Table
0 _CODE size 0 flags 0
1 RSEG size 0 flags 0
2 REG_BANK_0 size 8 flags 4
3 DSEG size 0 flags 0
4 OSEG size 0 flags 4
5 ISEG size 0 flags 0
6 IABS size 0 flags 8
7 BSEG size 0 flags 80
8 PSEG size 0 flags 50
9 XSEG size 0 flags 40
A XABS size 0 flags 48
B HOME size 0 flags 20
C GSINIT0 size 0 flags 20
D GSINIT1 size 0 flags 20
E GSINIT2 size 0 flags 20
F GSINIT3 size 0 flags 20
10 GSINIT4 size 0 flags 20
11 GSINIT5 size 0 flags 20
12 GSINIT size 0 flags 20
13 GSFINAL size 0 flags 20
14 CSEG size 25 flags 20
15 CONST size 0 flags 20
16 CABS size 0 flags 28

View File

@ -0,0 +1,821 @@
;--------------------------------------------------------
; File Created by SDCC : free open source ANSI-C Compiler
; Version 2.9.0 #5416 (Feb 3 2010) (UNIX)
; This file was generated Mon Jul 30 11:40:52 2012
;--------------------------------------------------------
.module fx2utils
.optsdcc -mmcs51 --model-small
;--------------------------------------------------------
; Public variables in this module
;--------------------------------------------------------
.globl _EIPX6
.globl _EIPX5
.globl _EIPX4
.globl _PI2C
.globl _PUSB
.globl _EIEX6
.globl _EIEX5
.globl _EIEX4
.globl _EI2C
.globl _EIUSB
.globl _SMOD1
.globl _ERESI
.globl _RESI
.globl _INT6
.globl _CY
.globl _AC
.globl _F0
.globl _RS1
.globl _RS0
.globl _OV
.globl _FL
.globl _P
.globl _TF2
.globl _EXF2
.globl _RCLK
.globl _TCLK
.globl _EXEN2
.globl _TR2
.globl _C_T2
.globl _CP_RL2
.globl _SM01
.globl _SM11
.globl _SM21
.globl _REN1
.globl _TB81
.globl _RB81
.globl _TI1
.globl _RI1
.globl _PS1
.globl _PT2
.globl _PS0
.globl _PT1
.globl _PX1
.globl _PT0
.globl _PX0
.globl _D7
.globl _D6
.globl _D5
.globl _D4
.globl _D3
.globl _D2
.globl _D1
.globl _D0
.globl _EA
.globl _ES1
.globl _ET2
.globl _ES0
.globl _ET1
.globl _EX1
.globl _ET0
.globl _EX0
.globl _SM0
.globl _SM1
.globl _SM2
.globl _REN
.globl _TB8
.globl _RB8
.globl _TI
.globl _RI
.globl _TF1
.globl _TR1
.globl _TF0
.globl _TR0
.globl _IE1
.globl _IT1
.globl _IE0
.globl _IT0
.globl _SEL
.globl _A7
.globl _A6
.globl _A5
.globl _A4
.globl _A3
.globl _A2
.globl _A1
.globl _A0
.globl _EIP
.globl _B
.globl _EIE
.globl _ACC
.globl _EICON
.globl _PSW
.globl _TH2
.globl _TL2
.globl _RCAP2H
.globl _RCAP2L
.globl _T2CON
.globl _SBUF1
.globl _SCON1
.globl _GPIFSGLDATLNOX
.globl _GPIFSGLDATLX
.globl _GPIFSGLDATH
.globl _GPIFTRIG
.globl _EP01STAT
.globl _IP
.globl _OEE
.globl _OED
.globl _OEC
.globl _OEB
.globl _OEA
.globl _IOE
.globl _IOD
.globl _AUTOPTRSETUP
.globl _EP68FIFOFLGS
.globl _EP24FIFOFLGS
.globl _EP2468STAT
.globl _IE
.globl _INT4CLR
.globl _INT2CLR
.globl _IOC
.globl _AUTODAT2
.globl _AUTOPTRL2
.globl _AUTOPTRH2
.globl _AUTODAT1
.globl _APTR1L
.globl _APTR1H
.globl _SBUF0
.globl _SCON0
.globl _MPAGE
.globl _EXIF
.globl _IOB
.globl _CKCON
.globl _TH1
.globl _TH0
.globl _TL1
.globl _TL0
.globl _TMOD
.globl _TCON
.globl _PCON
.globl _DPS
.globl _DPH1
.globl _DPL1
.globl _DPH
.globl _DPL
.globl _SP
.globl _IOA
.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
.globl _fx2_stall_ep0
.globl _fx2_reset_data_toggle
.globl _fx2_renumerate
;--------------------------------------------------------
; special function registers
;--------------------------------------------------------
.area RSEG (DATA)
_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
;--------------------------------------------------------
.area RSEG (DATA)
_A0 = 0x0080
_A1 = 0x0081
_A2 = 0x0082
_A3 = 0x0083
_A4 = 0x0084
_A5 = 0x0085
_A6 = 0x0086
_A7 = 0x0087
_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
_D0 = 0x00b0
_D1 = 0x00b1
_D2 = 0x00b2
_D3 = 0x00b3
_D4 = 0x00b4
_D5 = 0x00b5
_D6 = 0x00b6
_D7 = 0x00b7
_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
;--------------------------------------------------------
; 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)
;--------------------------------------------------------
; indirectly addressable internal ram data
;--------------------------------------------------------
.area ISEG (DATA)
;--------------------------------------------------------
; absolute internal ram data
;--------------------------------------------------------
.area IABS (ABS,DATA)
.area IABS (ABS,DATA)
;--------------------------------------------------------
; bit data
;--------------------------------------------------------
.area BSEG (BIT)
;--------------------------------------------------------
; paged external ram data
;--------------------------------------------------------
.area PSEG (PAG,XDATA)
;--------------------------------------------------------
; 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
;--------------------------------------------------------
; absolute external ram data
;--------------------------------------------------------
.area XABS (ABS,XDATA)
;--------------------------------------------------------
; external initialized ram data
;--------------------------------------------------------
.area HOME (CODE)
.area GSINIT0 (CODE)
.area GSINIT1 (CODE)
.area GSINIT2 (CODE)
.area GSINIT3 (CODE)
.area GSINIT4 (CODE)
.area GSINIT5 (CODE)
.area GSINIT (CODE)
.area GSFINAL (CODE)
.area CSEG (CODE)
;--------------------------------------------------------
; global & static initialisations
;--------------------------------------------------------
.area HOME (CODE)
.area GSINIT (CODE)
.area GSFINAL (CODE)
.area GSINIT (CODE)
;--------------------------------------------------------
; Home
;--------------------------------------------------------
.area HOME (CODE)
.area HOME (CODE)
;--------------------------------------------------------
; code
;--------------------------------------------------------
.area CSEG (CODE)
;------------------------------------------------------------
;Allocation info for local variables in function 'fx2_stall_ep0'
;------------------------------------------------------------
;------------------------------------------------------------
; fx2utils.c:28: fx2_stall_ep0 (void)
; -----------------------------------------
; function fx2_stall_ep0
; -----------------------------------------
_fx2_stall_ep0:
ar2 = 0x02
ar3 = 0x03
ar4 = 0x04
ar5 = 0x05
ar6 = 0x06
ar7 = 0x07
ar0 = 0x00
ar1 = 0x01
; fx2utils.c:30: EP0CS |= bmEPSTALL;
mov dptr,#_EP0CS
movx a,@dptr
orl a,#0x01
movx @dptr,a
ret
;------------------------------------------------------------
;Allocation info for local variables in function 'fx2_reset_data_toggle'
;------------------------------------------------------------
;ep Allocated to registers r2
;------------------------------------------------------------
; fx2utils.c:34: fx2_reset_data_toggle (unsigned char ep)
; -----------------------------------------
; function fx2_reset_data_toggle
; -----------------------------------------
_fx2_reset_data_toggle:
mov r2,dpl
; fx2utils.c:36: TOGCTL = ((ep & 0x80) >> 3 | (ep & 0x0f));
mov a,#0x80
anl a,r2
swap a
rl a
anl a,#0x1f
mov r3,a
mov a,#0x0F
anl a,r2
mov dptr,#_TOGCTL
orl a,r3
movx @dptr,a
; fx2utils.c:37: TOGCTL |= bmRESETTOGGLE;
mov dptr,#_TOGCTL
movx a,@dptr
orl a,#0x20
movx @dptr,a
ret
;------------------------------------------------------------
;Allocation info for local variables in function 'fx2_renumerate'
;------------------------------------------------------------
;------------------------------------------------------------
; fx2utils.c:41: fx2_renumerate (void)
; -----------------------------------------
; function fx2_renumerate
; -----------------------------------------
_fx2_renumerate:
; fx2utils.c:43: USBCS |= bmDISCON | bmRENUM;
mov dptr,#_USBCS
movx a,@dptr
orl a,#0x0A
movx @dptr,a
; fx2utils.c:45: mdelay (250);
mov dptr,#0x00FA
lcall _mdelay
; fx2utils.c:47: USBIRQ = 0xff; // clear any pending USB irqs...
mov dptr,#_USBIRQ
mov a,#0xFF
movx @dptr,a
; fx2utils.c:48: EPIRQ = 0xff; // they're from before the renumeration
mov dptr,#_EPIRQ
mov a,#0xFF
movx @dptr,a
; fx2utils.c:50: EXIF &= ~bmEXIF_USBINT;
anl _EXIF,#0xEF
; fx2utils.c:52: USBCS &= ~bmDISCON; // reconnect USB
mov dptr,#_USBCS
movx a,@dptr
anl a,#0xF7
movx @dptr,a
ret
.area CSEG (CODE)
.area CONST (CODE)
.area CABS (ABS,CODE)

View File

@ -0,0 +1,53 @@
/* -*- 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 2, 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., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, 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 (250);
USBIRQ = 0xff; // clear any pending USB irqs...
EPIRQ = 0xff; // they're from before the renumeration
EXIF &= ~bmEXIF_USBINT;
USBCS &= ~bmDISCON; // reconnect USB
}

View File

@ -0,0 +1,821 @@
1 ;--------------------------------------------------------
2 ; File Created by SDCC : free open source ANSI-C Compiler
3 ; Version 2.9.0 #5416 (Feb 3 2010) (UNIX)
4 ; This file was generated Mon Jul 30 11:40:52 2012
5 ;--------------------------------------------------------
6 .module fx2utils
7 .optsdcc -mmcs51 --model-small
8
9 ;--------------------------------------------------------
10 ; Public variables in this module
11 ;--------------------------------------------------------
12 .globl _EIPX6
13 .globl _EIPX5
14 .globl _EIPX4
15 .globl _PI2C
16 .globl _PUSB
17 .globl _EIEX6
18 .globl _EIEX5
19 .globl _EIEX4
20 .globl _EI2C
21 .globl _EIUSB
22 .globl _SMOD1
23 .globl _ERESI
24 .globl _RESI
25 .globl _INT6
26 .globl _CY
27 .globl _AC
28 .globl _F0
29 .globl _RS1
30 .globl _RS0
31 .globl _OV
32 .globl _FL
33 .globl _P
34 .globl _TF2
35 .globl _EXF2
36 .globl _RCLK
37 .globl _TCLK
38 .globl _EXEN2
39 .globl _TR2
40 .globl _C_T2
41 .globl _CP_RL2
42 .globl _SM01
43 .globl _SM11
44 .globl _SM21
45 .globl _REN1
46 .globl _TB81
47 .globl _RB81
48 .globl _TI1
49 .globl _RI1
50 .globl _PS1
51 .globl _PT2
52 .globl _PS0
53 .globl _PT1
54 .globl _PX1
55 .globl _PT0
56 .globl _PX0
57 .globl _D7
58 .globl _D6
59 .globl _D5
60 .globl _D4
61 .globl _D3
62 .globl _D2
63 .globl _D1
64 .globl _D0
65 .globl _EA
66 .globl _ES1
67 .globl _ET2
68 .globl _ES0
69 .globl _ET1
70 .globl _EX1
71 .globl _ET0
72 .globl _EX0
73 .globl _SM0
74 .globl _SM1
75 .globl _SM2
76 .globl _REN
77 .globl _TB8
78 .globl _RB8
79 .globl _TI
80 .globl _RI
81 .globl _TF1
82 .globl _TR1
83 .globl _TF0
84 .globl _TR0
85 .globl _IE1
86 .globl _IT1
87 .globl _IE0
88 .globl _IT0
89 .globl _SEL
90 .globl _A7
91 .globl _A6
92 .globl _A5
93 .globl _A4
94 .globl _A3
95 .globl _A2
96 .globl _A1
97 .globl _A0
98 .globl _EIP
99 .globl _B
100 .globl _EIE
101 .globl _ACC
102 .globl _EICON
103 .globl _PSW
104 .globl _TH2
105 .globl _TL2
106 .globl _RCAP2H
107 .globl _RCAP2L
108 .globl _T2CON
109 .globl _SBUF1
110 .globl _SCON1
111 .globl _GPIFSGLDATLNOX
112 .globl _GPIFSGLDATLX
113 .globl _GPIFSGLDATH
114 .globl _GPIFTRIG
115 .globl _EP01STAT
116 .globl _IP
117 .globl _OEE
118 .globl _OED
119 .globl _OEC
120 .globl _OEB
121 .globl _OEA
122 .globl _IOE
123 .globl _IOD
124 .globl _AUTOPTRSETUP
125 .globl _EP68FIFOFLGS
126 .globl _EP24FIFOFLGS
127 .globl _EP2468STAT
128 .globl _IE
129 .globl _INT4CLR
130 .globl _INT2CLR
131 .globl _IOC
132 .globl _AUTODAT2
133 .globl _AUTOPTRL2
134 .globl _AUTOPTRH2
135 .globl _AUTODAT1
136 .globl _APTR1L
137 .globl _APTR1H
138 .globl _SBUF0
139 .globl _SCON0
140 .globl _MPAGE
141 .globl _EXIF
142 .globl _IOB
143 .globl _CKCON
144 .globl _TH1
145 .globl _TH0
146 .globl _TL1
147 .globl _TL0
148 .globl _TMOD
149 .globl _TCON
150 .globl _PCON
151 .globl _DPS
152 .globl _DPH1
153 .globl _DPL1
154 .globl _DPH
155 .globl _DPL
156 .globl _SP
157 .globl _IOA
158 .globl _EP8FIFOBUF
159 .globl _EP6FIFOBUF
160 .globl _EP4FIFOBUF
161 .globl _EP2FIFOBUF
162 .globl _EP1INBUF
163 .globl _EP1OUTBUF
164 .globl _EP0BUF
165 .globl _CT4
166 .globl _CT3
167 .globl _CT2
168 .globl _CT1
169 .globl _USBTEST
170 .globl _TESTCFG
171 .globl _DBUG
172 .globl _UDMACRCQUAL
173 .globl _UDMACRCL
174 .globl _UDMACRCH
175 .globl _GPIFHOLDAMOUNT
176 .globl _FLOWSTBHPERIOD
177 .globl _FLOWSTBEDGE
178 .globl _FLOWSTB
179 .globl _FLOWHOLDOFF
180 .globl _FLOWEQ1CTL
181 .globl _FLOWEQ0CTL
182 .globl _FLOWLOGIC
183 .globl _FLOWSTATE
184 .globl _GPIFABORT
185 .globl _GPIFREADYSTAT
186 .globl _GPIFREADYCFG
187 .globl _XGPIFSGLDATLNOX
188 .globl _XGPIFSGLDATLX
189 .globl _XGPIFSGLDATH
190 .globl _EP8GPIFTRIG
191 .globl _EP8GPIFPFSTOP
192 .globl _EP8GPIFFLGSEL
193 .globl _EP6GPIFTRIG
194 .globl _EP6GPIFPFSTOP
195 .globl _EP6GPIFFLGSEL
196 .globl _EP4GPIFTRIG
197 .globl _EP4GPIFPFSTOP
198 .globl _EP4GPIFFLGSEL
199 .globl _EP2GPIFTRIG
200 .globl _EP2GPIFPFSTOP
201 .globl _EP2GPIFFLGSEL
202 .globl _GPIFTCB0
203 .globl _GPIFTCB1
204 .globl _GPIFTCB2
205 .globl _GPIFTCB3
206 .globl _GPIFADRL
207 .globl _GPIFADRH
208 .globl _GPIFCTLCFG
209 .globl _GPIFIDLECTL
210 .globl _GPIFIDLECS
211 .globl _GPIFWFSELECT
212 .globl _SETUPDAT
213 .globl _SUDPTRCTL
214 .globl _SUDPTRL
215 .globl _SUDPTRH
216 .globl _EP8FIFOBCL
217 .globl _EP8FIFOBCH
218 .globl _EP6FIFOBCL
219 .globl _EP6FIFOBCH
220 .globl _EP4FIFOBCL
221 .globl _EP4FIFOBCH
222 .globl _EP2FIFOBCL
223 .globl _EP2FIFOBCH
224 .globl _EP8FIFOFLGS
225 .globl _EP6FIFOFLGS
226 .globl _EP4FIFOFLGS
227 .globl _EP2FIFOFLGS
228 .globl _EP8CS
229 .globl _EP6CS
230 .globl _EP4CS
231 .globl _EP2CS
232 .globl _EP1INCS
233 .globl _EP1OUTCS
234 .globl _EP0CS
235 .globl _EP8BCL
236 .globl _EP8BCH
237 .globl _EP6BCL
238 .globl _EP6BCH
239 .globl _EP4BCL
240 .globl _EP4BCH
241 .globl _EP2BCL
242 .globl _EP2BCH
243 .globl _EP1INBC
244 .globl _EP1OUTBC
245 .globl _EP0BCL
246 .globl _EP0BCH
247 .globl _FNADDR
248 .globl _MICROFRAME
249 .globl _USBFRAMEL
250 .globl _USBFRAMEH
251 .globl _TOGCTL
252 .globl _WAKEUPCS
253 .globl _SUSPEND
254 .globl _USBCS
255 .globl _XAUTODAT2
256 .globl _XAUTODAT1
257 .globl _I2CTL
258 .globl _I2DAT
259 .globl _I2CS
260 .globl _PORTECFG
261 .globl _PORTCCFG
262 .globl _PORTACFG
263 .globl _INTSETUP
264 .globl _INT4IVEC
265 .globl _INT2IVEC
266 .globl _CLRERRCNT
267 .globl _ERRCNTLIM
268 .globl _USBERRIRQ
269 .globl _USBERRIE
270 .globl _GPIFIRQ
271 .globl _GPIFIE
272 .globl _EPIRQ
273 .globl _EPIE
274 .globl _USBIRQ
275 .globl _USBIE
276 .globl _NAKIRQ
277 .globl _NAKIE
278 .globl _IBNIRQ
279 .globl _IBNIE
280 .globl _EP8FIFOIRQ
281 .globl _EP8FIFOIE
282 .globl _EP6FIFOIRQ
283 .globl _EP6FIFOIE
284 .globl _EP4FIFOIRQ
285 .globl _EP4FIFOIE
286 .globl _EP2FIFOIRQ
287 .globl _EP2FIFOIE
288 .globl _OUTPKTEND
289 .globl _INPKTEND
290 .globl _EP8ISOINPKTS
291 .globl _EP6ISOINPKTS
292 .globl _EP4ISOINPKTS
293 .globl _EP2ISOINPKTS
294 .globl _EP8FIFOPFL
295 .globl _EP8FIFOPFH
296 .globl _EP6FIFOPFL
297 .globl _EP6FIFOPFH
298 .globl _EP4FIFOPFL
299 .globl _EP4FIFOPFH
300 .globl _EP2FIFOPFL
301 .globl _EP2FIFOPFH
302 .globl _EP8AUTOINLENL
303 .globl _EP8AUTOINLENH
304 .globl _EP6AUTOINLENL
305 .globl _EP6AUTOINLENH
306 .globl _EP4AUTOINLENL
307 .globl _EP4AUTOINLENH
308 .globl _EP2AUTOINLENL
309 .globl _EP2AUTOINLENH
310 .globl _EP8FIFOCFG
311 .globl _EP6FIFOCFG
312 .globl _EP4FIFOCFG
313 .globl _EP2FIFOCFG
314 .globl _EP8CFG
315 .globl _EP6CFG
316 .globl _EP4CFG
317 .globl _EP2CFG
318 .globl _EP1INCFG
319 .globl _EP1OUTCFG
320 .globl _REVCTL
321 .globl _REVID
322 .globl _FIFOPINPOLAR
323 .globl _UART230
324 .globl _BPADDRL
325 .globl _BPADDRH
326 .globl _BREAKPT
327 .globl _FIFORESET
328 .globl _PINFLAGSCD
329 .globl _PINFLAGSAB
330 .globl _IFCONFIG
331 .globl _CPUCS
332 .globl _RES_WAVEDATA_END
333 .globl _GPIF_WAVE_DATA
334 .globl _fx2_stall_ep0
335 .globl _fx2_reset_data_toggle
336 .globl _fx2_renumerate
337 ;--------------------------------------------------------
338 ; special function registers
339 ;--------------------------------------------------------
340 .area RSEG (DATA)
0080 341 _IOA = 0x0080
0081 342 _SP = 0x0081
0082 343 _DPL = 0x0082
0083 344 _DPH = 0x0083
0084 345 _DPL1 = 0x0084
0085 346 _DPH1 = 0x0085
0086 347 _DPS = 0x0086
0087 348 _PCON = 0x0087
0088 349 _TCON = 0x0088
0089 350 _TMOD = 0x0089
008A 351 _TL0 = 0x008a
008B 352 _TL1 = 0x008b
008C 353 _TH0 = 0x008c
008D 354 _TH1 = 0x008d
008E 355 _CKCON = 0x008e
0090 356 _IOB = 0x0090
0091 357 _EXIF = 0x0091
0092 358 _MPAGE = 0x0092
0098 359 _SCON0 = 0x0098
0099 360 _SBUF0 = 0x0099
009A 361 _APTR1H = 0x009a
009B 362 _APTR1L = 0x009b
009C 363 _AUTODAT1 = 0x009c
009D 364 _AUTOPTRH2 = 0x009d
009E 365 _AUTOPTRL2 = 0x009e
009F 366 _AUTODAT2 = 0x009f
00A0 367 _IOC = 0x00a0
00A1 368 _INT2CLR = 0x00a1
00A2 369 _INT4CLR = 0x00a2
00A8 370 _IE = 0x00a8
00AA 371 _EP2468STAT = 0x00aa
00AB 372 _EP24FIFOFLGS = 0x00ab
00AC 373 _EP68FIFOFLGS = 0x00ac
00AF 374 _AUTOPTRSETUP = 0x00af
00B0 375 _IOD = 0x00b0
00B1 376 _IOE = 0x00b1
00B2 377 _OEA = 0x00b2
00B3 378 _OEB = 0x00b3
00B4 379 _OEC = 0x00b4
00B5 380 _OED = 0x00b5
00B6 381 _OEE = 0x00b6
00B8 382 _IP = 0x00b8
00BA 383 _EP01STAT = 0x00ba
00BB 384 _GPIFTRIG = 0x00bb
00BD 385 _GPIFSGLDATH = 0x00bd
00BE 386 _GPIFSGLDATLX = 0x00be
00BF 387 _GPIFSGLDATLNOX = 0x00bf
00C0 388 _SCON1 = 0x00c0
00C1 389 _SBUF1 = 0x00c1
00C8 390 _T2CON = 0x00c8
00CA 391 _RCAP2L = 0x00ca
00CB 392 _RCAP2H = 0x00cb
00CC 393 _TL2 = 0x00cc
00CD 394 _TH2 = 0x00cd
00D0 395 _PSW = 0x00d0
00D8 396 _EICON = 0x00d8
00E0 397 _ACC = 0x00e0
00E8 398 _EIE = 0x00e8
00F0 399 _B = 0x00f0
00F8 400 _EIP = 0x00f8
401 ;--------------------------------------------------------
402 ; special function bits
403 ;--------------------------------------------------------
404 .area RSEG (DATA)
0080 405 _A0 = 0x0080
0081 406 _A1 = 0x0081
0082 407 _A2 = 0x0082
0083 408 _A3 = 0x0083
0084 409 _A4 = 0x0084
0085 410 _A5 = 0x0085
0086 411 _A6 = 0x0086
0087 412 _A7 = 0x0087
0086 413 _SEL = 0x0086
0088 414 _IT0 = 0x0088
0089 415 _IE0 = 0x0089
008A 416 _IT1 = 0x008a
008B 417 _IE1 = 0x008b
008C 418 _TR0 = 0x008c
008D 419 _TF0 = 0x008d
008E 420 _TR1 = 0x008e
008F 421 _TF1 = 0x008f
0098 422 _RI = 0x0098
0099 423 _TI = 0x0099
009A 424 _RB8 = 0x009a
009B 425 _TB8 = 0x009b
009C 426 _REN = 0x009c
009D 427 _SM2 = 0x009d
009E 428 _SM1 = 0x009e
009F 429 _SM0 = 0x009f
00A8 430 _EX0 = 0x00a8
00A9 431 _ET0 = 0x00a9
00AA 432 _EX1 = 0x00aa
00AB 433 _ET1 = 0x00ab
00AC 434 _ES0 = 0x00ac
00AD 435 _ET2 = 0x00ad
00AE 436 _ES1 = 0x00ae
00AF 437 _EA = 0x00af
00B0 438 _D0 = 0x00b0
00B1 439 _D1 = 0x00b1
00B2 440 _D2 = 0x00b2
00B3 441 _D3 = 0x00b3
00B4 442 _D4 = 0x00b4
00B5 443 _D5 = 0x00b5
00B6 444 _D6 = 0x00b6
00B7 445 _D7 = 0x00b7
00B8 446 _PX0 = 0x00b8
00B9 447 _PT0 = 0x00b9
00BA 448 _PX1 = 0x00ba
00BB 449 _PT1 = 0x00bb
00BC 450 _PS0 = 0x00bc
00BD 451 _PT2 = 0x00bd
00BE 452 _PS1 = 0x00be
00C0 453 _RI1 = 0x00c0
00C1 454 _TI1 = 0x00c1
00C2 455 _RB81 = 0x00c2
00C3 456 _TB81 = 0x00c3
00C4 457 _REN1 = 0x00c4
00C5 458 _SM21 = 0x00c5
00C6 459 _SM11 = 0x00c6
00C7 460 _SM01 = 0x00c7
00C8 461 _CP_RL2 = 0x00c8
00C9 462 _C_T2 = 0x00c9
00CA 463 _TR2 = 0x00ca
00CB 464 _EXEN2 = 0x00cb
00CC 465 _TCLK = 0x00cc
00CD 466 _RCLK = 0x00cd
00CE 467 _EXF2 = 0x00ce
00CF 468 _TF2 = 0x00cf
00D0 469 _P = 0x00d0
00D1 470 _FL = 0x00d1
00D2 471 _OV = 0x00d2
00D3 472 _RS0 = 0x00d3
00D4 473 _RS1 = 0x00d4
00D5 474 _F0 = 0x00d5
00D6 475 _AC = 0x00d6
00D7 476 _CY = 0x00d7
00DB 477 _INT6 = 0x00db
00DC 478 _RESI = 0x00dc
00DD 479 _ERESI = 0x00dd
00DF 480 _SMOD1 = 0x00df
00E8 481 _EIUSB = 0x00e8
00E9 482 _EI2C = 0x00e9
00EA 483 _EIEX4 = 0x00ea
00EB 484 _EIEX5 = 0x00eb
00EC 485 _EIEX6 = 0x00ec
00F8 486 _PUSB = 0x00f8
00F9 487 _PI2C = 0x00f9
00FA 488 _EIPX4 = 0x00fa
00FB 489 _EIPX5 = 0x00fb
00FC 490 _EIPX6 = 0x00fc
491 ;--------------------------------------------------------
492 ; overlayable register banks
493 ;--------------------------------------------------------
494 .area REG_BANK_0 (REL,OVR,DATA)
0000 495 .ds 8
496 ;--------------------------------------------------------
497 ; internal ram data
498 ;--------------------------------------------------------
499 .area DSEG (DATA)
500 ;--------------------------------------------------------
501 ; overlayable items in internal ram
502 ;--------------------------------------------------------
503 .area OSEG (OVR,DATA)
504 ;--------------------------------------------------------
505 ; indirectly addressable internal ram data
506 ;--------------------------------------------------------
507 .area ISEG (DATA)
508 ;--------------------------------------------------------
509 ; absolute internal ram data
510 ;--------------------------------------------------------
511 .area IABS (ABS,DATA)
512 .area IABS (ABS,DATA)
513 ;--------------------------------------------------------
514 ; bit data
515 ;--------------------------------------------------------
516 .area BSEG (BIT)
517 ;--------------------------------------------------------
518 ; paged external ram data
519 ;--------------------------------------------------------
520 .area PSEG (PAG,XDATA)
521 ;--------------------------------------------------------
522 ; external ram data
523 ;--------------------------------------------------------
524 .area XSEG (XDATA)
E400 525 _GPIF_WAVE_DATA = 0xe400
E480 526 _RES_WAVEDATA_END = 0xe480
E600 527 _CPUCS = 0xe600
E601 528 _IFCONFIG = 0xe601
E602 529 _PINFLAGSAB = 0xe602
E603 530 _PINFLAGSCD = 0xe603
E604 531 _FIFORESET = 0xe604
E605 532 _BREAKPT = 0xe605
E606 533 _BPADDRH = 0xe606
E607 534 _BPADDRL = 0xe607
E608 535 _UART230 = 0xe608
E609 536 _FIFOPINPOLAR = 0xe609
E60A 537 _REVID = 0xe60a
E60B 538 _REVCTL = 0xe60b
E610 539 _EP1OUTCFG = 0xe610
E611 540 _EP1INCFG = 0xe611
E612 541 _EP2CFG = 0xe612
E613 542 _EP4CFG = 0xe613
E614 543 _EP6CFG = 0xe614
E615 544 _EP8CFG = 0xe615
E618 545 _EP2FIFOCFG = 0xe618
E619 546 _EP4FIFOCFG = 0xe619
E61A 547 _EP6FIFOCFG = 0xe61a
E61B 548 _EP8FIFOCFG = 0xe61b
E620 549 _EP2AUTOINLENH = 0xe620
E621 550 _EP2AUTOINLENL = 0xe621
E622 551 _EP4AUTOINLENH = 0xe622
E623 552 _EP4AUTOINLENL = 0xe623
E624 553 _EP6AUTOINLENH = 0xe624
E625 554 _EP6AUTOINLENL = 0xe625
E626 555 _EP8AUTOINLENH = 0xe626
E627 556 _EP8AUTOINLENL = 0xe627
E630 557 _EP2FIFOPFH = 0xe630
E631 558 _EP2FIFOPFL = 0xe631
E632 559 _EP4FIFOPFH = 0xe632
E633 560 _EP4FIFOPFL = 0xe633
E634 561 _EP6FIFOPFH = 0xe634
E635 562 _EP6FIFOPFL = 0xe635
E636 563 _EP8FIFOPFH = 0xe636
E637 564 _EP8FIFOPFL = 0xe637
E640 565 _EP2ISOINPKTS = 0xe640
E641 566 _EP4ISOINPKTS = 0xe641
E642 567 _EP6ISOINPKTS = 0xe642
E643 568 _EP8ISOINPKTS = 0xe643
E648 569 _INPKTEND = 0xe648
E649 570 _OUTPKTEND = 0xe649
E650 571 _EP2FIFOIE = 0xe650
E651 572 _EP2FIFOIRQ = 0xe651
E652 573 _EP4FIFOIE = 0xe652
E653 574 _EP4FIFOIRQ = 0xe653
E654 575 _EP6FIFOIE = 0xe654
E655 576 _EP6FIFOIRQ = 0xe655
E656 577 _EP8FIFOIE = 0xe656
E657 578 _EP8FIFOIRQ = 0xe657
E658 579 _IBNIE = 0xe658
E659 580 _IBNIRQ = 0xe659
E65A 581 _NAKIE = 0xe65a
E65B 582 _NAKIRQ = 0xe65b
E65C 583 _USBIE = 0xe65c
E65D 584 _USBIRQ = 0xe65d
E65E 585 _EPIE = 0xe65e
E65F 586 _EPIRQ = 0xe65f
E660 587 _GPIFIE = 0xe660
E661 588 _GPIFIRQ = 0xe661
E662 589 _USBERRIE = 0xe662
E663 590 _USBERRIRQ = 0xe663
E664 591 _ERRCNTLIM = 0xe664
E665 592 _CLRERRCNT = 0xe665
E666 593 _INT2IVEC = 0xe666
E667 594 _INT4IVEC = 0xe667
E668 595 _INTSETUP = 0xe668
E670 596 _PORTACFG = 0xe670
E671 597 _PORTCCFG = 0xe671
E672 598 _PORTECFG = 0xe672
E678 599 _I2CS = 0xe678
E679 600 _I2DAT = 0xe679
E67A 601 _I2CTL = 0xe67a
E67B 602 _XAUTODAT1 = 0xe67b
E67C 603 _XAUTODAT2 = 0xe67c
E680 604 _USBCS = 0xe680
E681 605 _SUSPEND = 0xe681
E682 606 _WAKEUPCS = 0xe682
E683 607 _TOGCTL = 0xe683
E684 608 _USBFRAMEH = 0xe684
E685 609 _USBFRAMEL = 0xe685
E686 610 _MICROFRAME = 0xe686
E687 611 _FNADDR = 0xe687
E68A 612 _EP0BCH = 0xe68a
E68B 613 _EP0BCL = 0xe68b
E68D 614 _EP1OUTBC = 0xe68d
E68F 615 _EP1INBC = 0xe68f
E690 616 _EP2BCH = 0xe690
E691 617 _EP2BCL = 0xe691
E694 618 _EP4BCH = 0xe694
E695 619 _EP4BCL = 0xe695
E698 620 _EP6BCH = 0xe698
E699 621 _EP6BCL = 0xe699
E69C 622 _EP8BCH = 0xe69c
E69D 623 _EP8BCL = 0xe69d
E6A0 624 _EP0CS = 0xe6a0
E6A1 625 _EP1OUTCS = 0xe6a1
E6A2 626 _EP1INCS = 0xe6a2
E6A3 627 _EP2CS = 0xe6a3
E6A4 628 _EP4CS = 0xe6a4
E6A5 629 _EP6CS = 0xe6a5
E6A6 630 _EP8CS = 0xe6a6
E6A7 631 _EP2FIFOFLGS = 0xe6a7
E6A8 632 _EP4FIFOFLGS = 0xe6a8
E6A9 633 _EP6FIFOFLGS = 0xe6a9
E6AA 634 _EP8FIFOFLGS = 0xe6aa
E6AB 635 _EP2FIFOBCH = 0xe6ab
E6AC 636 _EP2FIFOBCL = 0xe6ac
E6AD 637 _EP4FIFOBCH = 0xe6ad
E6AE 638 _EP4FIFOBCL = 0xe6ae
E6AF 639 _EP6FIFOBCH = 0xe6af
E6B0 640 _EP6FIFOBCL = 0xe6b0
E6B1 641 _EP8FIFOBCH = 0xe6b1
E6B2 642 _EP8FIFOBCL = 0xe6b2
E6B3 643 _SUDPTRH = 0xe6b3
E6B4 644 _SUDPTRL = 0xe6b4
E6B5 645 _SUDPTRCTL = 0xe6b5
E6B8 646 _SETUPDAT = 0xe6b8
E6C0 647 _GPIFWFSELECT = 0xe6c0
E6C1 648 _GPIFIDLECS = 0xe6c1
E6C2 649 _GPIFIDLECTL = 0xe6c2
E6C3 650 _GPIFCTLCFG = 0xe6c3
E6C4 651 _GPIFADRH = 0xe6c4
E6C5 652 _GPIFADRL = 0xe6c5
E6CE 653 _GPIFTCB3 = 0xe6ce
E6CF 654 _GPIFTCB2 = 0xe6cf
E6D0 655 _GPIFTCB1 = 0xe6d0
E6D1 656 _GPIFTCB0 = 0xe6d1
E6D2 657 _EP2GPIFFLGSEL = 0xe6d2
E6D3 658 _EP2GPIFPFSTOP = 0xe6d3
E6D4 659 _EP2GPIFTRIG = 0xe6d4
E6DA 660 _EP4GPIFFLGSEL = 0xe6da
E6DB 661 _EP4GPIFPFSTOP = 0xe6db
E6DC 662 _EP4GPIFTRIG = 0xe6dc
E6E2 663 _EP6GPIFFLGSEL = 0xe6e2
E6E3 664 _EP6GPIFPFSTOP = 0xe6e3
E6E4 665 _EP6GPIFTRIG = 0xe6e4
E6EA 666 _EP8GPIFFLGSEL = 0xe6ea
E6EB 667 _EP8GPIFPFSTOP = 0xe6eb
E6EC 668 _EP8GPIFTRIG = 0xe6ec
E6F0 669 _XGPIFSGLDATH = 0xe6f0
E6F1 670 _XGPIFSGLDATLX = 0xe6f1
E6F2 671 _XGPIFSGLDATLNOX = 0xe6f2
E6F3 672 _GPIFREADYCFG = 0xe6f3
E6F4 673 _GPIFREADYSTAT = 0xe6f4
E6F5 674 _GPIFABORT = 0xe6f5
E6C6 675 _FLOWSTATE = 0xe6c6
E6C7 676 _FLOWLOGIC = 0xe6c7
E6C8 677 _FLOWEQ0CTL = 0xe6c8
E6C9 678 _FLOWEQ1CTL = 0xe6c9
E6CA 679 _FLOWHOLDOFF = 0xe6ca
E6CB 680 _FLOWSTB = 0xe6cb
E6CC 681 _FLOWSTBEDGE = 0xe6cc
E6CD 682 _FLOWSTBHPERIOD = 0xe6cd
E60C 683 _GPIFHOLDAMOUNT = 0xe60c
E67D 684 _UDMACRCH = 0xe67d
E67E 685 _UDMACRCL = 0xe67e
E67F 686 _UDMACRCQUAL = 0xe67f
E6F8 687 _DBUG = 0xe6f8
E6F9 688 _TESTCFG = 0xe6f9
E6FA 689 _USBTEST = 0xe6fa
E6FB 690 _CT1 = 0xe6fb
E6FC 691 _CT2 = 0xe6fc
E6FD 692 _CT3 = 0xe6fd
E6FE 693 _CT4 = 0xe6fe
E740 694 _EP0BUF = 0xe740
E780 695 _EP1OUTBUF = 0xe780
E7C0 696 _EP1INBUF = 0xe7c0
F000 697 _EP2FIFOBUF = 0xf000
F400 698 _EP4FIFOBUF = 0xf400
F800 699 _EP6FIFOBUF = 0xf800
FC00 700 _EP8FIFOBUF = 0xfc00
701 ;--------------------------------------------------------
702 ; absolute external ram data
703 ;--------------------------------------------------------
704 .area XABS (ABS,XDATA)
705 ;--------------------------------------------------------
706 ; external initialized ram data
707 ;--------------------------------------------------------
708 .area HOME (CODE)
709 .area GSINIT0 (CODE)
710 .area GSINIT1 (CODE)
711 .area GSINIT2 (CODE)
712 .area GSINIT3 (CODE)
713 .area GSINIT4 (CODE)
714 .area GSINIT5 (CODE)
715 .area GSINIT (CODE)
716 .area GSFINAL (CODE)
717 .area CSEG (CODE)
718 ;--------------------------------------------------------
719 ; global & static initialisations
720 ;--------------------------------------------------------
721 .area HOME (CODE)
722 .area GSINIT (CODE)
723 .area GSFINAL (CODE)
724 .area GSINIT (CODE)
725 ;--------------------------------------------------------
726 ; Home
727 ;--------------------------------------------------------
728 .area HOME (CODE)
729 .area HOME (CODE)
730 ;--------------------------------------------------------
731 ; code
732 ;--------------------------------------------------------
733 .area CSEG (CODE)
734 ;------------------------------------------------------------
735 ;Allocation info for local variables in function 'fx2_stall_ep0'
736 ;------------------------------------------------------------
737 ;------------------------------------------------------------
738 ; fx2utils.c:28: fx2_stall_ep0 (void)
739 ; -----------------------------------------
740 ; function fx2_stall_ep0
741 ; -----------------------------------------
0000 742 _fx2_stall_ep0:
0002 743 ar2 = 0x02
0003 744 ar3 = 0x03
0004 745 ar4 = 0x04
0005 746 ar5 = 0x05
0006 747 ar6 = 0x06
0007 748 ar7 = 0x07
0000 749 ar0 = 0x00
0001 750 ar1 = 0x01
751 ; fx2utils.c:30: EP0CS |= bmEPSTALL;
0000 90 E6 A0 752 mov dptr,#_EP0CS
0003 E0 753 movx a,@dptr
0004 44 01 754 orl a,#0x01
0006 F0 755 movx @dptr,a
0007 22 756 ret
757 ;------------------------------------------------------------
758 ;Allocation info for local variables in function 'fx2_reset_data_toggle'
759 ;------------------------------------------------------------
760 ;ep Allocated to registers r2
761 ;------------------------------------------------------------
762 ; fx2utils.c:34: fx2_reset_data_toggle (unsigned char ep)
763 ; -----------------------------------------
764 ; function fx2_reset_data_toggle
765 ; -----------------------------------------
0008 766 _fx2_reset_data_toggle:
0008 AA 82 767 mov r2,dpl
768 ; fx2utils.c:36: TOGCTL = ((ep & 0x80) >> 3 | (ep & 0x0f));
000A 74 80 769 mov a,#0x80
000C 5A 770 anl a,r2
000D C4 771 swap a
000E 23 772 rl a
000F 54 1F 773 anl a,#0x1f
0011 FB 774 mov r3,a
0012 74 0F 775 mov a,#0x0F
0014 5A 776 anl a,r2
0015 90 E6 83 777 mov dptr,#_TOGCTL
0018 4B 778 orl a,r3
0019 F0 779 movx @dptr,a
780 ; fx2utils.c:37: TOGCTL |= bmRESETTOGGLE;
001A 90 E6 83 781 mov dptr,#_TOGCTL
001D E0 782 movx a,@dptr
001E 44 20 783 orl a,#0x20
0020 F0 784 movx @dptr,a
0021 22 785 ret
786 ;------------------------------------------------------------
787 ;Allocation info for local variables in function 'fx2_renumerate'
788 ;------------------------------------------------------------
789 ;------------------------------------------------------------
790 ; fx2utils.c:41: fx2_renumerate (void)
791 ; -----------------------------------------
792 ; function fx2_renumerate
793 ; -----------------------------------------
0022 794 _fx2_renumerate:
795 ; fx2utils.c:43: USBCS |= bmDISCON | bmRENUM;
0022 90 E6 80 796 mov dptr,#_USBCS
0025 E0 797 movx a,@dptr
0026 44 0A 798 orl a,#0x0A
0028 F0 799 movx @dptr,a
800 ; fx2utils.c:45: mdelay (250);
0029 90 00 FA 801 mov dptr,#0x00FA
002C 12s00r00 802 lcall _mdelay
803 ; fx2utils.c:47: USBIRQ = 0xff; // clear any pending USB irqs...
002F 90 E6 5D 804 mov dptr,#_USBIRQ
0032 74 FF 805 mov a,#0xFF
0034 F0 806 movx @dptr,a
807 ; fx2utils.c:48: EPIRQ = 0xff; // they're from before the renumeration
0035 90 E6 5F 808 mov dptr,#_EPIRQ
0038 74 FF 809 mov a,#0xFF
003A F0 810 movx @dptr,a
811 ; fx2utils.c:50: EXIF &= ~bmEXIF_USBINT;
003B 53 91 EF 812 anl _EXIF,#0xEF
813 ; fx2utils.c:52: USBCS &= ~bmDISCON; // reconnect USB
003E 90 E6 80 814 mov dptr,#_USBCS
0041 E0 815 movx a,@dptr
0042 54 F7 816 anl a,#0xF7
0044 F0 817 movx @dptr,a
0045 22 818 ret
819 .area CSEG (CODE)
820 .area CONST (CODE)
821 .area CABS (ABS,CODE)

View File

@ -0,0 +1,373 @@
XH
H 17 areas 146 global symbols
M fx2utils
O -mmcs51 --model-small
S _EP8FIFOCFG DefE61B
S _EPIRQ DefE65F
S _USBERRIE DefE662
S _EP6CS DefE6A5
S _GPIFHOLDAMOUNT DefE60C
S _SBUF1 Def00C1
S _EIEX6 Def00EC
S _EP1INBC DefE68F
S _EP8FIFOBCL DefE6B2
S _DBUG DefE6F8
S _B Def00F0
S _EXEN2 Def00CB
S _EPIE DefE65E
S _WAKEUPCS DefE682
S _EP1OUTBC DefE68D
S _EP8CS DefE6A6
S _EP2GPIFTRIG DefE6D4
S _SP Def0081
S _SCON0 Def0098
S _AUTODAT1 Def009C
S _EI2C Def00E9
S _INT2IVEC DefE666
S _AUTODAT2 Def009F
S _SCON1 Def00C0
S _SMOD1 Def00DF
S _MICROFRAME DefE686
S _SUDPTRCTL DefE6B5
S _EP4GPIFTRIG DefE6DC
S _EP2468STAT Def00AA
S _OV Def00D2
S _INT4IVEC DefE667
S _GPIFSGLDATLNOX Def00BF
S _T2CON Def00C8
S _EP6GPIFTRIG DefE6E4
S _ACC Def00E0
S _EP2FIFOBUF DefF000
S _C_T2 Def00C9
S _BREAKPT DefE605
S _EP2FIFOPFH DefE630
S _EP8GPIFTRIG DefE6EC
S _AUTOPTRH2 Def009D
S _SETUPDAT DefE6B8
S _EP2GPIFFLGSEL DefE6D2
S _EP4FIFOBUF DefF400
S _EIPX4 Def00FA
S _EP4FIFOPFH DefE632
S _EP2ISOINPKTS DefE640
S _GPIFREADYCFG DefE6F3
S _EIPX5 Def00FB
S _EP4GPIFFLGSEL DefE6DA
S _FLOWSTBHPERIOD DefE6CD
S _EP6FIFOBUF DefF800
S _EXIF Def0091
S _RCLK Def00CD
S _EIPX6 Def00FC
S _EP2FIFOPFL DefE631
S _EP6FIFOPFH DefE634
S _EP4ISOINPKTS DefE641
S _DPH1 Def0085
S _AUTOPTRL2 Def009E
S _EP6GPIFFLGSEL DefE6E2
S _EP8FIFOBUF DefFC00
S _TCLK Def00CC
S _PI2C Def00F9
S _EP4FIFOPFL DefE633
S _EP8FIFOPFH DefE636
S _EP6ISOINPKTS DefE642
S _FNADDR DefE687
S _EP8GPIFFLGSEL DefE6EA
S _TESTCFG DefE6F9
S _PCON Def0087
S _P Def00D0
S _GPIF_WAVE_DATA DefE400
S _EP6FIFOPFL DefE635
S _EP8ISOINPKTS DefE643
S _I2CS DefE678
S _DPL1 Def0084
S _GPIFIRQ DefE661
S _EP0BCH DefE68A
S _EP01STAT Def00BA
S _EP8FIFOPFL DefE637
S _EP1INCS DefE6A2
S _EIE Def00E8
S _RESI Def00DC
S _GPIFIE DefE660
S _EP2BCH DefE690
S _EP1OUTCS DefE6A1
S _TCON Def0088
S _TMOD Def0089
S _OEA Def00B2
S _EXF2 Def00CE
S _EP0BCL DefE68B
S _EP4BCH DefE694
S _OEB Def00B3
S _REN1 Def00C4
S _EP2CFG DefE612
S _EP2FIFOIRQ DefE651
S _GPIFREADYSTAT DefE6F4
S _OEC Def00B4
S _EP2BCL DefE691
S _EP6BCH DefE698
S _OED Def00B5
S _EP4CFG DefE613
S _EP2FIFOIE DefE650
S _EP4FIFOIRQ DefE653
S _IOA Def0080
S _OEE Def00B6
S _EP4BCL DefE695
S _EP8BCH DefE69C
S _IOB Def0090
S _PUSB Def00F8
S _EP6CFG DefE614
S _EP4FIFOIE DefE652
S _EP6FIFOIRQ DefE655
S _IOC Def00A0
S _mdelay Ref0000
S _INTSETUP DefE668
S _EP6BCL DefE699
S _DPH Def0083
S _IOD Def00B0
S _EP8CFG DefE615
S _EP6FIFOIE DefE654
S _EP8FIFOIRQ DefE657
S _USBFRAMEH DefE684
S _IOE Def00B1
S _RB81 Def00C2
S _EP2AUTOINLENH DefE620
S _EP8BCL DefE69D
S _GPIFABORT DefE6F5
S _INT2CLR Def00A1
S _EIP Def00F8
S _IE0 Def0089
S _EP8FIFOIE DefE656
S _IE1 Def008B
S _TB81 Def00C3
S _EP4AUTOINLENH DefE622
S _DPL Def0082
S _INT4CLR Def00A2
S _AUTOPTRSETUP Def00AF
S _RCAP2H Def00CB
S _USBFRAMEL DefE685
S _XGPIFSGLDATLX DefE6F1
S _FLOWEQ0CTL DefE6C8
S _FLOWSTB DefE6CB
S _SM01 Def00C7
S _INT6 Def00DB
S _EP2AUTOINLENL DefE621
S _EP6AUTOINLENH DefE624
S _SUSPEND DefE681
S _FLOWEQ1CTL DefE6C9
S _EP0BUF DefE740
S _SM11 Def00C6
S _CP_RL2 Def00C8
S _GPIFWFSELECT DefE6C0
S _SM21 Def00C5
S _EP4AUTOINLENL DefE623
S _EP8AUTOINLENH DefE626
S _RCAP2L Def00CA
S _SEL Def0086
S _AC Def00D6
S _IFCONFIG DefE601
S _IBNIRQ DefE659
S _GPIFADRH DefE6C4
S _XGPIFSGLDATH DefE6F0
S _REN Def009C
S _EP6AUTOINLENL DefE625
S _NAKIRQ DefE65B
S _FLOWLOGIC DefE6C7
S _EA Def00AF
S _FIFORESET DefE604
S _IBNIE DefE658
S _GPIFIDLECTL DefE6C2
S _UDMACRCH DefE67D
S _DPS Def0086
S _EP8AUTOINLENL DefE627
S _NAKIE DefE65A
S _CT1 DefE6FB
S _ES0 Def00AC
S _FIFOPINPOLAR DefE609
S _GPIFADRL DefE6C5
S _EP2GPIFPFSTOP DefE6D3
S _CT2 DefE6FC
S _GPIFSGLDATLX Def00BE
S _ET0 Def00A9
S _ES1 Def00AE
S _SUDPTRH DefE6B3
S _USBTEST DefE6FA
S _CT3 DefE6FD
S _MPAGE Def0092
S _TF0 Def008D
S _ET1 Def00AB
S _EP4GPIFPFSTOP DefE6DB
S _UDMACRCL DefE67E
S _CT4 DefE6FE
S _EP24FIFOFLGS Def00AB
S _TF1 Def008F
S _ET2 Def00AD
S _RES_WAVEDATA_END DefE480
S _TH0 Def008C
S _RB8 Def009A
S _RI1 Def00C0
S _TF2 Def00CF
S _EP1INCFG DefE611
S _TOGCTL DefE683
S _EP6GPIFPFSTOP DefE6E3
S _TH1 Def008D
S _GPIFSGLDATH Def00BD
S _IT0 Def0088
S _EX0 Def00A8
S _EP1OUTCFG DefE610
S _SUDPTRL DefE6B4
S _CKCON Def008E
S _IE Def00A8
S _TH2 Def00CD
S _EICON Def00D8
S _IT1 Def008A
S _TB8 Def009B
S _EX1 Def00AA
S _TI1 Def00C1
S _CLRERRCNT DefE665
S _GPIFTCB0 DefE6D1
S _EP8GPIFPFSTOP DefE6EB
S _REVCTL DefE60B
S _ERRCNTLIM DefE664
S _GPIFTCB1 DefE6D0
S _TL0 Def008A
S _APTR1H Def009A
S _SM0 Def009F
S _UART230 DefE608
S _GPIFTCB2 DefE6CF
S _TL1 Def008B
S _A0 Def0080
S _SM1 Def009E
S _GPIFTCB3 DefE6CE
S _UDMACRCQUAL DefE67F
S _TL2 Def00CC
S _A1 Def0081
S _SM2 Def009D
S _FL Def00D1
S _EP68FIFOFLGS Def00AC
S _A2 Def0082
S _PS0 Def00BC
S _I2DAT DefE679
S _APTR1L Def009B
S _A3 Def0083
S _D0 Def00B0
S _PT0 Def00B9
S _PS1 Def00BE
S _BPADDRH DefE606
S _A4 Def0084
S _D1 Def00B1
S _PT1 Def00BB
S _RS0 Def00D3
S _USBIRQ DefE65D
S _PORTACFG DefE670
S _FLOWSTBEDGE DefE6CC
S _A5 Def0085
S _TR0 Def008C
S _D2 Def00B2
S _PT2 Def00BD
S _RS1 Def00D4
S _F0 Def00D5
S _PINFLAGSAB DefE602
S _EP2FIFOFLGS DefE6A7
S _A6 Def0086
S _TR1 Def008E
S _D3 Def00B3
S _USBIE DefE65C
S _PORTCCFG DefE671
S _EP2FIFOBCH DefE6AB
S _A7 Def0087
S _D4 Def00B4
S _PX0 Def00B8
S _TR2 Def00CA
S _ERESI Def00DD
S _EIUSB Def00E8
S _BPADDRL DefE607
S _EP4FIFOFLGS DefE6A8
S _GPIFCTLCFG DefE6C3
S _FLOWSTATE DefE6C6
S _IP Def00B8
S _D5 Def00B5
S _PX1 Def00BA
S _REVID DefE60A
S _PORTECFG DefE672
S _EP4FIFOBCH DefE6AD
S _GPIFIDLECS DefE6C1
S _FLOWHOLDOFF DefE6CA
S _EP1INBUF DefE7C0
S _PSW Def00D0
S _D6 Def00B6
S _PINFLAGSCD DefE603
S _EP2FIFOCFG DefE618
S _XAUTODAT1 DefE67B
S _EP0CS DefE6A0
S _EP6FIFOFLGS DefE6A9
S _EP1OUTBUF DefE780
S _RI Def0098
S _D7 Def00B7
S _XAUTODAT2 DefE67C
S _EP2FIFOBCL DefE6AC
S _EP6FIFOBCH DefE6AF
S _GPIFTRIG Def00BB
S _CY Def00D7
S _EP4FIFOCFG DefE619
S _INPKTEND DefE648
S _EP2CS DefE6A3
S _EP8FIFOFLGS DefE6AA
S _TI Def0099
S _CPUCS DefE600
S _OUTPKTEND DefE649
S _I2CTL DefE67A
S _EP4FIFOBCL DefE6AE
S _EP8FIFOBCH DefE6B1
S _XGPIFSGLDATLNOX DefE6F2
S _EP6FIFOCFG DefE61A
S _USBERRIRQ DefE663
S _EP4CS DefE6A4
S _EIEX4 Def00EA
S _USBCS DefE680
S _EP6FIFOBCL DefE6B0
S _SBUF0 Def0099
S _EIEX5 Def00EB
A _CODE size 0 flags 0 addr 0
A RSEG size 0 flags 0 addr 0
A REG_BANK_0 size 8 flags 4 addr 0
A DSEG size 0 flags 0 addr 0
A OSEG size 0 flags 4 addr 0
A ISEG size 0 flags 0 addr 0
A IABS size 0 flags 8 addr 0
A BSEG size 0 flags 80 addr 0
A PSEG size 0 flags 50 addr 0
A XSEG size 0 flags 40 addr 0
A XABS size 0 flags 48 addr 0
A HOME size 0 flags 20 addr 0
A GSINIT0 size 0 flags 20 addr 0
A GSINIT1 size 0 flags 20 addr 0
A GSINIT2 size 0 flags 20 addr 0
A GSINIT3 size 0 flags 20 addr 0
A GSINIT4 size 0 flags 20 addr 0
A GSINIT5 size 0 flags 20 addr 0
A GSINIT size 0 flags 20 addr 0
A GSFINAL size 0 flags 20 addr 0
A CSEG size 46 flags 20 addr 0
S _fx2_renumerate Def0022
S _fx2_reset_data_toggle Def0008
S _fx2_stall_ep0 Def0000
A CONST size 0 flags 20 addr 0
A CABS size 0 flags 28 addr 0
T 00 00
R 00 00 00 02
T 00 00
R 00 00 00 14
T 00 00 90 E6 A0 E0 44 01 F0 22
R 00 00 00 14
T 00 08
R 00 00 00 14
T 00 08 AA 82 74 80 5A C4 23 54 1F FB 74 0F 5A 90
R 00 00 00 14
T 00 16 E6 83 4B F0 90 E6 83 E0 44 20 F0 22
R 00 00 00 14
T 00 22
R 00 00 00 14
T 00 22 90 E6 80 E0 44 0A F0 90 00 FA 12 00 00 90
R 00 00 00 14 02 0D 00 73
T 00 30 E6 5D 74 FF F0 90 E6 5F 74 FF F0 53 91 EF
R 00 00 00 14
T 00 3E 90 E6 80 E0 54 F7 F0 22
R 00 00 00 14

View File

@ -0,0 +1,702 @@
ASxxxx Assembler V01.70 + NoICE + SDCC mods + Flat24 Feb-1999 (Intel 8051), page 1.
Symbol Table
A 00D6
AC 00D6
ACC 00E0
ACC.0 00E0
ACC.1 00E1
ACC.2 00E2
ACC.3 00E3
ACC.4 00E4
ACC.5 00E5
ACC.6 00E6
ACC.7 00E7
B 00F0
B.0 00F0
B.1 00F1
B.2 00F2
B.3 00F3
B.4 00F4
B.5 00F5
B.6 00F6
B.7 00F7
CPRL2 00C8
CT2 00C9
CY 00D7
DPH 0083
DPL 0082
EA 00AF
ES 00AC
ET0 00A9
ET1 00AB
ET2 00AD
EX0 00A8
EX1 00AA
EXEN2 00CB
EXF2 00CE
F0 00D5
IE 00A8
IE.0 00A8
IE.1 00A9
IE.2 00AA
IE.3 00AB
IE.4 00AC
IE.5 00AD
IE.7 00AF
IE0 0089
IE1 008B
INT0 00B2
INT1 00B3
IP 00B8
IP.0 00B8
IP.1 00B9
IP.2 00BA
IP.3 00BB
IP.4 00BC
IP.5 00BD
IT0 0088
IT1 008A
OV 00D2
P 00D0
P0 0080
P0.0 0080
P0.1 0081
P0.2 0082
P0.3 0083
P0.4 0084
P0.5 0085
P0.6 0086
P0.7 0087
P1 0090
P1.0 0090
P1.1 0091
P1.2 0092
P1.3 0093
P1.4 0094
P1.5 0095
P1.6 0096
P1.7 0097
P2 00A0
P2.0 00A0
P2.1 00A1
P2.2 00A2
P2.3 00A3
P2.4 00A4
P2.5 00A5
P2.6 00A6
P2.7 00A7
P3 00B0
P3.0 00B0
P3.1 00B1
P3.2 00B2
P3.3 00B3
P3.4 00B4
P3.5 00B5
P3.6 00B6
P3.7 00B7
PCON 0087
PS 00BC
PSW 00D0
PSW.0 00D0
PSW.1 00D1
PSW.2 00D2
PSW.3 00D3
PSW.4 00D4
PSW.5 00D5
PSW.6 00D6
PSW.7 00D7
PT0 00B9
PT1 00BB
PT2 00BD
PX0 00B8
PX1 00BA
RB8 009A
RCAP2H 00CB
RCAP2L 00CA
RCLK 00CD
REN 009C
RI 0098
RS0 00D3
RS1 00D4
RXD 00B0
SBUF 0099
SCON 0098
SCON.0 0098
SCON.1 0099
SCON.2 009A
SCON.3 009B
SCON.4 009C
SCON.5 009D
SCON.6 009E
SCON.7 009F
SM0 009F
SM1 009E
SM2 009D
SP 0081
T2CON 00C8
T2CON.0 00C8
T2CON.1 00C9
T2CON.2 00CA
T2CON.3 00CB
T2CON.4 00CC
T2CON.5 00CD
T2CON.6 00CE
T2CON.7 00CF
TB8 009B
TCLK 00CC
TCON 0088
TCON.0 0088
TCON.1 0089
TCON.2 008A
TCON.3 008B
TCON.4 008C
TCON.5 008D
TCON.6 008E
TCON.7 008F
TF0 008D
TF1 008F
TF2 00CF
TH0 008C
TH1 008D
TH2 00CD
TI 0099
TL0 008A
TL1 008B
TL2 00CC
TMOD 0089
TR0 008C
TR1 008E
TR2 00CA
TXD 00B1
_A0 = 0080 G
_A1 = 0081 G
_A2 = 0082 G
_A3 = 0083 G
_A4 = 0084 G
_A5 = 0085 G
_A6 = 0086 G
_A7 = 0087 G
_AC = 00D6 G
_ACC = 00E0 G
_APTR1H = 009A G
_APTR1L = 009B G
_AUTODAT1 = 009C G
_AUTODAT2 = 009F G
_AUTOPTRH2 = 009D G
_AUTOPTRL2 = 009E G
_AUTOPTRSETUP = 00AF G
_B = 00F0 G
_BPADDRH = E606 G
_BPADDRL = E607 G
_BREAKPT = E605 G
_CKCON = 008E G
_CLRERRCNT = E665 G
_CPUCS = E600 G
_CP_RL2 = 00C8 G
_CT1 = E6FB G
_CT2 = E6FC G
_CT3 = E6FD G
_CT4 = E6FE G
_CY = 00D7 G
_C_T2 = 00C9 G
_D0 = 00B0 G
_D1 = 00B1 G
_D2 = 00B2 G
_D3 = 00B3 G
_D4 = 00B4 G
_D5 = 00B5 G
_D6 = 00B6 G
_D7 = 00B7 G
_DBUG = E6F8 G
_DPH = 0083 G
_DPH1 = 0085 G
_DPL = 0082 G
_DPL1 = 0084 G
_DPS = 0086 G
_EA = 00AF G
_EI2C = 00E9 G
_EICON = 00D8 G
_EIE = 00E8 G
_EIEX4 = 00EA G
_EIEX5 = 00EB G
_EIEX6 = 00EC G
_EIP = 00F8 G
_EIPX4 = 00FA G
_EIPX5 = 00FB G
_EIPX6 = 00FC G
_EIUSB = 00E8 G
_EP01STAT = 00BA G
_EP0BCH = E68A G
_EP0BCL = E68B G
_EP0BUF = E740 G
_EP0CS = E6A0 G
_EP1INBC = E68F G
_EP1INBUF = E7C0 G
_EP1INCFG = E611 G
_EP1INCS = E6A2 G
_EP1OUTBC = E68D G
_EP1OUTBUF = E780 G
_EP1OUTCFG = E610 G
_EP1OUTCS = E6A1 G
_EP2468STAT = 00AA G
_EP24FIFOFLGS = 00AB G
_EP2AUTOINLENH = E620 G
_EP2AUTOINLENL = E621 G
_EP2BCH = E690 G
_EP2BCL = E691 G
_EP2CFG = E612 G
_EP2CS = E6A3 G
_EP2FIFOBCH = E6AB G
_EP2FIFOBCL = E6AC G
_EP2FIFOBUF = F000 G
_EP2FIFOCFG = E618 G
_EP2FIFOFLGS = E6A7 G
_EP2FIFOIE = E650 G
_EP2FIFOIRQ = E651 G
_EP2FIFOPFH = E630 G
_EP2FIFOPFL = E631 G
_EP2GPIFFLGSEL = E6D2 G
_EP2GPIFPFSTOP = E6D3 G
_EP2GPIFTRIG = E6D4 G
_EP2ISOINPKTS = E640 G
_EP4AUTOINLENH = E622 G
_EP4AUTOINLENL = E623 G
_EP4BCH = E694 G
_EP4BCL = E695 G
_EP4CFG = E613 G
_EP4CS = E6A4 G
_EP4FIFOBCH = E6AD G
_EP4FIFOBCL = E6AE G
_EP4FIFOBUF = F400 G
_EP4FIFOCFG = E619 G
_EP4FIFOFLGS = E6A8 G
_EP4FIFOIE = E652 G
_EP4FIFOIRQ = E653 G
_EP4FIFOPFH = E632 G
_EP4FIFOPFL = E633 G
_EP4GPIFFLGSEL = E6DA G
_EP4GPIFPFSTOP = E6DB G
_EP4GPIFTRIG = E6DC G
_EP4ISOINPKTS = E641 G
_EP68FIFOFLGS = 00AC G
_EP6AUTOINLENH = E624 G
_EP6AUTOINLENL = E625 G
_EP6BCH = E698 G
_EP6BCL = E699 G
_EP6CFG = E614 G
_EP6CS = E6A5 G
_EP6FIFOBCH = E6AF G
_EP6FIFOBCL = E6B0 G
_EP6FIFOBUF = F800 G
_EP6FIFOCFG = E61A G
_EP6FIFOFLGS = E6A9 G
_EP6FIFOIE = E654 G
_EP6FIFOIRQ = E655 G
_EP6FIFOPFH = E634 G
_EP6FIFOPFL = E635 G
_EP6GPIFFLGSEL = E6E2 G
_EP6GPIFPFSTOP = E6E3 G
_EP6GPIFTRIG = E6E4 G
_EP6ISOINPKTS = E642 G
_EP8AUTOINLENH = E626 G
_EP8AUTOINLENL = E627 G
_EP8BCH = E69C G
_EP8BCL = E69D G
_EP8CFG = E615 G
_EP8CS = E6A6 G
_EP8FIFOBCH = E6B1 G
_EP8FIFOBCL = E6B2 G
_EP8FIFOBUF = FC00 G
_EP8FIFOCFG = E61B G
_EP8FIFOFLGS = E6AA G
_EP8FIFOIE = E656 G
_EP8FIFOIRQ = E657 G
_EP8FIFOPFH = E636 G
_EP8FIFOPFL = E637 G
_EP8GPIFFLGSEL = E6EA G
_EP8GPIFPFSTOP = E6EB G
_EP8GPIFTRIG = E6EC G
_EP8ISOINPKTS = E643 G
_EPIE = E65E G
_EPIRQ = E65F G
_ERESI = 00DD G
_ERRCNTLIM = E664 G
_ES0 = 00AC G
_ES1 = 00AE G
_ET0 = 00A9 G
_ET1 = 00AB G
_ET2 = 00AD G
_EX0 = 00A8 G
_EX1 = 00AA G
_EXEN2 = 00CB G
_EXF2 = 00CE G
_EXIF = 0091 G
_F0 = 00D5 G
_FIFOPINPOLAR = E609 G
_FIFORESET = E604 G
_FL = 00D1 G
_FLOWEQ0CTL = E6C8 G
_FLOWEQ1CTL = E6C9 G
_FLOWHOLDOFF = E6CA G
_FLOWLOGIC = E6C7 G
_FLOWSTATE = E6C6 G
_FLOWSTB = E6CB G
_FLOWSTBEDGE = E6CC G
_FLOWSTBHPERIOD = E6CD G
_FNADDR = E687 G
_GPIFABORT = E6F5 G
_GPIFADRH = E6C4 G
_GPIFADRL = E6C5 G
_GPIFCTLCFG = E6C3 G
_GPIFHOLDAMOUNT = E60C G
_GPIFIDLECS = E6C1 G
_GPIFIDLECTL = E6C2 G
_GPIFIE = E660 G
_GPIFIRQ = E661 G
_GPIFREADYCFG = E6F3 G
_GPIFREADYSTAT = E6F4 G
_GPIFSGLDATH = 00BD G
_GPIFSGLDATLNOX = 00BF G
_GPIFSGLDATLX = 00BE G
_GPIFTCB0 = E6D1 G
_GPIFTCB1 = E6D0 G
_GPIFTCB2 = E6CF G
_GPIFTCB3 = E6CE G
_GPIFTRIG = 00BB G
_GPIFWFSELECT = E6C0 G
_GPIF_WAVE_DATA = E400 G
_I2CS = E678 G
_I2CTL = E67A G
_I2DAT = E679 G
_IBNIE = E658 G
_IBNIRQ = E659 G
_IE = 00A8 G
_IE0 = 0089 G
_IE1 = 008B G
_IFCONFIG = E601 G
_INPKTEND = E648 G
_INT2CLR = 00A1 G
_INT2IVEC = E666 G
_INT4CLR = 00A2 G
_INT4IVEC = E667 G
_INT6 = 00DB G
_INTSETUP = E668 G
_IOA = 0080 G
_IOB = 0090 G
_IOC = 00A0 G
_IOD = 00B0 G
_IOE = 00B1 G
_IP = 00B8 G
_IT0 = 0088 G
_IT1 = 008A G
_MICROFRAME = E686 G
_MPAGE = 0092 G
_NAKIE = E65A G
_NAKIRQ = E65B G
_OEA = 00B2 G
_OEB = 00B3 G
_OEC = 00B4 G
_OED = 00B5 G
_OEE = 00B6 G
_OUTPKTEND = E649 G
_OV = 00D2 G
_P = 00D0 G
_PCON = 0087 G
_PI2C = 00F9 G
_PINFLAGSAB = E602 G
_PINFLAGSCD = E603 G
_PORTACFG = E670 G
_PORTCCFG = E671 G
_PORTECFG = E672 G
_PS0 = 00BC G
_PS1 = 00BE G
_PSW = 00D0 G
_PT0 = 00B9 G
_PT1 = 00BB G
_PT2 = 00BD G
_PUSB = 00F8 G
_PX0 = 00B8 G
_PX1 = 00BA G
_RB8 = 009A G
_RB81 = 00C2 G
_RCAP2H = 00CB G
_RCAP2L = 00CA G
_RCLK = 00CD G
_REN = 009C G
_REN1 = 00C4 G
_RESI = 00DC G
_RES_WAVEDATA_END = E480 G
_REVCTL = E60B G
_REVID = E60A G
_RI = 0098 G
_RI1 = 00C0 G
_RS0 = 00D3 G
_RS1 = 00D4 G
_SBUF0 = 0099 G
_SBUF1 = 00C1 G
_SCON0 = 0098 G
_SCON1 = 00C0 G
_SEL = 0086 G
_SETUPDAT = E6B8 G
_SM0 = 009F G
_SM01 = 00C7 G
_SM1 = 009E G
_SM11 = 00C6 G
_SM2 = 009D G
_SM21 = 00C5 G
_SMOD1 = 00DF G
_SP = 0081 G
_SUDPTRCTL = E6B5 G
_SUDPTRH = E6B3 G
_SUDPTRL = E6B4 G
_SUSPEND = E681 G
_T2CON = 00C8 G
_TB8 = 009B G
_TB81 = 00C3 G
_TCLK = 00CC G
_TCON = 0088 G
_TESTCFG = E6F9 G
_TF0 = 008D G
_TF1 = 008F G
_TF2 = 00CF G
_TH0 = 008C G
_TH1 = 008D G
_TH2 = 00CD G
_TI = 0099 G
_TI1 = 00C1 G
_TL0 = 008A G
_TL1 = 008B G
_TL2 = 00CC G
_TMOD = 0089 G
_TOGCTL = E683 G
_TR0 = 008C G
_TR1 = 008E G
_TR2 = 00CA G
_UART230 = E608 G
_UDMACRCH = E67D G
_UDMACRCL = E67E G
_UDMACRCQUAL = E67F G
_USBCS = E680 G
_USBERRIE = E662 G
_USBERRIRQ = E663 G
_USBFRAMEH = E684 G
_USBFRAMEL = E685 G
_USBIE = E65C G
_USBIRQ = E65D G
_USBTEST = E6FA G
_WAKEUPCS = E682 G
_XAUTODAT1 = E67B G
_XAUTODAT2 = E67C G
_XGPIFSGLDATH = E6F0 G
_XGPIFSGLDATLNOX = E6F2 G
_XGPIFSGLDATLX = E6F1 G
14 _fx2_renumerate 0022 GR
14 _fx2_reset_data_toggle 0008 GR
14 _fx2_stall_ep0 0000 GR
_mdelay **** GX
a 00D6
ac 00D6
acc 00E0
acc.0 00E0
acc.1 00E1
acc.2 00E2
acc.3 00E3
acc.4 00E4
acc.5 00E5
acc.6 00E6
acc.7 00E7
ar0 = 0000
ar1 = 0001
ar2 = 0002
ar3 = 0003
ar4 = 0004
ar5 = 0005
ar6 = 0006
ar7 = 0007
b 00F0
b.0 00F0
b.1 00F1
b.2 00F2
b.3 00F3
b.4 00F4
b.5 00F5
b.6 00F6
b.7 00F7
cprl2 00C8
ct2 00C9
cy 00D7
dph 0083
dpl 0082
ea 00AF
es 00AC
et0 00A9
et1 00AB
et2 00AD
ex0 00A8
ex1 00AA
exen2 00CB
exf2 00CE
f0 00D5
ie 00A8
ie.0 00A8
ie.1 00A9
ie.2 00AA
ie.3 00AB
ie.4 00AC
ie.5 00AD
ie.7 00AF
ie0 0089
ie1 008B
int0 00B2
int1 00B3
ip 00B8
ip.0 00B8
ip.1 00B9
ip.2 00BA
ip.3 00BB
ip.4 00BC
ip.5 00BD
it0 0088
it1 008A
ov 00D2
p 00D0
p0 0080
p0.0 0080
p0.1 0081
p0.2 0082
p0.3 0083
p0.4 0084
p0.5 0085
p0.6 0086
p0.7 0087
p1 0090
p1.0 0090
p1.1 0091
p1.2 0092
p1.3 0093
p1.4 0094
p1.5 0095
p1.6 0096
p1.7 0097
p2 00A0
p2.0 00A0
p2.1 00A1
p2.2 00A2
p2.3 00A3
p2.4 00A4
p2.5 00A5
p2.6 00A6
p2.7 00A7
p3 00B0
p3.0 00B0
p3.1 00B1
p3.2 00B2
p3.3 00B3
p3.4 00B4
p3.5 00B5
p3.6 00B6
p3.7 00B7
pcon 0087
ps 00BC
psw 00D0
psw.0 00D0
psw.1 00D1
psw.2 00D2
psw.3 00D3
psw.4 00D4
psw.5 00D5
psw.6 00D6
psw.7 00D7
pt0 00B9
pt1 00BB
pt2 00BD
px0 00B8
px1 00BA
rb8 009A
rcap2h 00CB
rcap2l 00CA
rclk 00CD
ren 009C
ri 0098
rs0 00D3
rs1 00D4
rxd 00B0
sbuf 0099
scon 0098
scon.0 0098
scon.1 0099
scon.2 009A
scon.3 009B
scon.4 009C
scon.5 009D
scon.6 009E
scon.7 009F
sm0 009F
sm1 009E
sm2 009D
sp 0081
t2con 00C8
t2con.0 00C8
t2con.1 00C9
t2con.2 00CA
t2con.3 00CB
t2con.4 00CC
t2con.5 00CD
t2con.6 00CE
t2con.7 00CF
tb8 009B
tclk 00CC
tcon 0088
tcon.0 0088
tcon.1 0089
tcon.2 008A
tcon.3 008B
tcon.4 008C
tcon.5 008D
tcon.6 008E
tcon.7 008F
tf0 008D
tf1 008F
tf2 00CF
th0 008C
th1 008D
th2 00CD
ti 0099
tl0 008A
tl1 008B
tl2 00CC
tmod 0089
tr0 008C
tr1 008E
tr2 00CA
txd 00B1
ASxxxx Assembler V01.70 + NoICE + SDCC mods + Flat24 Feb-1999 (Intel 8051), page 2.
Area Table
0 _CODE size 0 flags 0
1 RSEG size 0 flags 0
2 REG_BANK_0 size 8 flags 4
3 DSEG size 0 flags 0
4 OSEG size 0 flags 4
5 ISEG size 0 flags 0
6 IABS size 0 flags 8
7 BSEG size 0 flags 80
8 PSEG size 0 flags 50
9 XSEG size 0 flags 40
A XABS size 0 flags 48
B HOME size 0 flags 20
C GSINIT0 size 0 flags 20
D GSINIT1 size 0 flags 20
E GSINIT2 size 0 flags 20
F GSINIT3 size 0 flags 20
10 GSINIT4 size 0 flags 20
11 GSINIT5 size 0 flags 20
12 GSINIT size 0 flags 20
13 GSFINAL size 0 flags 20
14 CSEG size 46 flags 20
15 CONST size 0 flags 20
16 CABS size 0 flags 28

123
firmware/GN3S_v2/lib/i2c.c Normal file
View File

@ -0,0 +1,123 @@
/* -*- 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 2, 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., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, 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;
}

1138
firmware/GN3S_v2/lib/isr.asm Normal file

File diff suppressed because it is too large Load Diff

167
firmware/GN3S_v2/lib/isr.c Normal file
View File

@ -0,0 +1,167 @@
/* -*- 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 2, 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., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, 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;
}

1138
firmware/GN3S_v2/lib/isr.lst Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,513 @@
XH
H 17 areas 14C global symbols
M isr
O -mmcs51 --model-small
S _EP8FIFOCFG DefE61B
S _EPIRQ DefE65F
S _USBERRIE DefE662
S _EP6CS DefE6A5
S _GPIFHOLDAMOUNT DefE60C
S _SBUF1 Def00C1
S _EIEX6 Def00EC
S _EP1INBC DefE68F
S _EP8FIFOBCL DefE6B2
S _DBUG DefE6F8
S _B Def00F0
S _EXEN2 Def00CB
S _EPIE DefE65E
S _WAKEUPCS DefE682
S _EP1OUTBC DefE68D
S _EP8CS DefE6A6
S _EP2GPIFTRIG DefE6D4
S _SP Def0081
S _SCON0 Def0098
S _AUTODAT1 Def009C
S _EI2C Def00E9
S _INT2IVEC DefE666
S _AUTODAT2 Def009F
S _SCON1 Def00C0
S _SMOD1 Def00DF
S _MICROFRAME DefE686
S _SUDPTRCTL DefE6B5
S _EP4GPIFTRIG DefE6DC
S _EP2468STAT Def00AA
S _OV Def00D2
S _INT4IVEC DefE667
S _GPIFSGLDATLNOX Def00BF
S _T2CON Def00C8
S _EP6GPIFTRIG DefE6E4
S _ACC Def00E0
S _EP2FIFOBUF DefF000
S _C_T2 Def00C9
S _BREAKPT DefE605
S _EP2FIFOPFH DefE630
S _EP8GPIFTRIG DefE6EC
S _AUTOPTRH2 Def009D
S _SETUPDAT DefE6B8
S _EP2GPIFFLGSEL DefE6D2
S _EP4FIFOBUF DefF400
S _EIPX4 Def00FA
S _EP4FIFOPFH DefE632
S _EP2ISOINPKTS DefE640
S _GPIFREADYCFG DefE6F3
S _EIPX5 Def00FB
S _EP4GPIFFLGSEL DefE6DA
S _FLOWSTBHPERIOD DefE6CD
S _EP6FIFOBUF DefF800
S _EXIF Def0091
S _RCLK Def00CD
S _EIPX6 Def00FC
S _EP2FIFOPFL DefE631
S _EP6FIFOPFH DefE634
S _EP4ISOINPKTS DefE641
S _DPH1 Def0085
S _AUTOPTRL2 Def009E
S __standard_interrupt_vector Ref0000
S _EP6GPIFFLGSEL DefE6E2
S _EP8FIFOBUF DefFC00
S _TCLK Def00CC
S _PI2C Def00F9
S _EP4FIFOPFL DefE633
S _EP8FIFOPFH DefE636
S _EP6ISOINPKTS DefE642
S _FNADDR DefE687
S _EP8GPIFFLGSEL DefE6EA
S _TESTCFG DefE6F9
S _PCON Def0087
S _P Def00D0
S _GPIF_WAVE_DATA DefE400
S _EP6FIFOPFL DefE635
S _EP8ISOINPKTS DefE643
S _I2CS DefE678
S _DPL1 Def0084
S _GPIFIRQ DefE661
S _EP0BCH DefE68A
S _EP01STAT Def00BA
S __fifo_gpif_autovector Ref0000
S _EP8FIFOPFL DefE637
S _EP1INCS DefE6A2
S _EIE Def00E8
S _RESI Def00DC
S _GPIFIE DefE660
S _EP2BCH DefE690
S _EP1OUTCS DefE6A1
S _TCON Def0088
S _TMOD Def0089
S _OEA Def00B2
S _EXF2 Def00CE
S _EP0BCL DefE68B
S _EP4BCH DefE694
S _OEB Def00B3
S _REN1 Def00C4
S _EP2CFG DefE612
S _EP2FIFOIRQ DefE651
S _GPIFREADYSTAT DefE6F4
S _OEC Def00B4
S _EP2BCL DefE691
S _EP6BCH DefE698
S _OED Def00B5
S _EP4CFG DefE613
S _EP2FIFOIE DefE650
S _EP4FIFOIRQ DefE653
S _IOA Def0080
S _OEE Def00B6
S _EP4BCL DefE695
S _EP8BCH DefE69C
S _IOB Def0090
S _PUSB Def00F8
S _EP6CFG DefE614
S _EP4FIFOIE DefE652
S _EP6FIFOIRQ DefE655
S _IOC Def00A0
S _INTSETUP DefE668
S _EP6BCL DefE699
S _DPH Def0083
S _IOD Def00B0
S _EP8CFG DefE615
S _EP6FIFOIE DefE654
S _EP8FIFOIRQ DefE657
S _USBFRAMEH DefE684
S _IOE Def00B1
S _RB81 Def00C2
S _EP2AUTOINLENH DefE620
S _EP8BCL DefE69D
S _GPIFABORT DefE6F5
S _INT2CLR Def00A1
S _EIP Def00F8
S _IE0 Def0089
S _EP8FIFOIE DefE656
S _IE1 Def008B
S _TB81 Def00C3
S _EP4AUTOINLENH DefE622
S _DPL Def0082
S _INT4CLR Def00A2
S _AUTOPTRSETUP Def00AF
S _RCAP2H Def00CB
S _USBFRAMEL DefE685
S _XGPIFSGLDATLX DefE6F1
S _FLOWEQ0CTL DefE6C8
S _FLOWSTB DefE6CB
S _SM01 Def00C7
S _INT6 Def00DB
S _EP2AUTOINLENL DefE621
S _EP6AUTOINLENH DefE624
S _SUSPEND DefE681
S _FLOWEQ1CTL DefE6C9
S _EP0BUF DefE740
S _SM11 Def00C6
S _CP_RL2 Def00C8
S _GPIFWFSELECT DefE6C0
S _SM21 Def00C5
S _EP4AUTOINLENL DefE623
S _EP8AUTOINLENH DefE626
S _RCAP2L Def00CA
S _SEL Def0086
S _AC Def00D6
S _IFCONFIG DefE601
S _IBNIRQ DefE659
S _GPIFADRH DefE6C4
S _XGPIFSGLDATH DefE6F0
S _REN Def009C
S _EP6AUTOINLENL DefE625
S _NAKIRQ DefE65B
S _FLOWLOGIC DefE6C7
S _EA Def00AF
S _FIFORESET DefE604
S _IBNIE DefE658
S _GPIFIDLECTL DefE6C2
S _UDMACRCH DefE67D
S _DPS Def0086
S _EP8AUTOINLENL DefE627
S _NAKIE DefE65A
S _CT1 DefE6FB
S _ES0 Def00AC
S _FIFOPINPOLAR DefE609
S _GPIFADRL DefE6C5
S _EP2GPIFPFSTOP DefE6D3
S _CT2 DefE6FC
S _GPIFSGLDATLX Def00BE
S _ET0 Def00A9
S _ES1 Def00AE
S _SUDPTRH DefE6B3
S _USBTEST DefE6FA
S _CT3 DefE6FD
S _MPAGE Def0092
S _TF0 Def008D
S _ET1 Def00AB
S _EP4GPIFPFSTOP DefE6DB
S _UDMACRCL DefE67E
S _CT4 DefE6FE
S _EP24FIFOFLGS Def00AB
S _TF1 Def008F
S _ET2 Def00AD
S _RES_WAVEDATA_END DefE480
S _TH0 Def008C
S _RB8 Def009A
S _RI1 Def00C0
S _TF2 Def00CF
S _EP1INCFG DefE611
S _TOGCTL DefE683
S _EP6GPIFPFSTOP DefE6E3
S _TH1 Def008D
S _GPIFSGLDATH Def00BD
S _IT0 Def0088
S _EX0 Def00A8
S _EP1OUTCFG DefE610
S _SUDPTRL DefE6B4
S _CKCON Def008E
S _IE Def00A8
S _TH2 Def00CD
S _EICON Def00D8
S _IT1 Def008A
S _TB8 Def009B
S _EX1 Def00AA
S _TI1 Def00C1
S _CLRERRCNT DefE665
S _GPIFTCB0 DefE6D1
S _EP8GPIFPFSTOP DefE6EB
S _REVCTL DefE60B
S _ERRCNTLIM DefE664
S _GPIFTCB1 DefE6D0
S _TL0 Def008A
S _APTR1H Def009A
S _SM0 Def009F
S _UART230 DefE608
S _GPIFTCB2 DefE6CF
S _TL1 Def008B
S _A0 Def0080
S _SM1 Def009E
S _GPIFTCB3 DefE6CE
S _UDMACRCQUAL DefE67F
S _TL2 Def00CC
S _A1 Def0081
S _SM2 Def009D
S _FL Def00D1
S _EP68FIFOFLGS Def00AC
S _A2 Def0082
S _PS0 Def00BC
S __usb_autovector Ref0000
S _I2DAT DefE679
S _APTR1L Def009B
S _A3 Def0083
S _D0 Def00B0
S _PT0 Def00B9
S _PS1 Def00BE
S _BPADDRH DefE606
S _A4 Def0084
S _D1 Def00B1
S _PT1 Def00BB
S _RS0 Def00D3
S _USBIRQ DefE65D
S _PORTACFG DefE670
S _FLOWSTBEDGE DefE6CC
S _A5 Def0085
S _TR0 Def008C
S _D2 Def00B2
S _PT2 Def00BD
S _RS1 Def00D4
S _F0 Def00D5
S _PINFLAGSAB DefE602
S _EP2FIFOFLGS DefE6A7
S _A6 Def0086
S _TR1 Def008E
S _D3 Def00B3
S _USBIE DefE65C
S _PORTCCFG DefE671
S _EP2FIFOBCH DefE6AB
S _A7 Def0087
S _D4 Def00B4
S _PX0 Def00B8
S _TR2 Def00CA
S _ERESI Def00DD
S _EIUSB Def00E8
S _BPADDRL DefE607
S _EP4FIFOFLGS DefE6A8
S _GPIFCTLCFG DefE6C3
S _FLOWSTATE DefE6C6
S _IP Def00B8
S _D5 Def00B5
S _PX1 Def00BA
S _REVID DefE60A
S _PORTECFG DefE672
S _EP4FIFOBCH DefE6AD
S _GPIFIDLECS DefE6C1
S _FLOWHOLDOFF DefE6CA
S _EP1INBUF DefE7C0
S _PSW Def00D0
S _D6 Def00B6
S _PINFLAGSCD DefE603
S _EP2FIFOCFG DefE618
S _XAUTODAT1 DefE67B
S _EP0CS DefE6A0
S _EP6FIFOFLGS DefE6A9
S _EP1OUTBUF DefE780
S _RI Def0098
S _D7 Def00B7
S _XAUTODAT2 DefE67C
S _EP2FIFOBCL DefE6AC
S _EP6FIFOBCH DefE6AF
S _GPIFTRIG Def00BB
S _CY Def00D7
S _EP4FIFOCFG DefE619
S _INPKTEND DefE648
S _EP2CS DefE6A3
S _EP8FIFOFLGS DefE6AA
S _TI Def0099
S _CPUCS DefE600
S _OUTPKTEND DefE649
S _I2CTL DefE67A
S _EP4FIFOBCL DefE6AE
S _EP8FIFOBCH DefE6B1
S _XGPIFSGLDATLNOX DefE6F2
S _EP6FIFOCFG DefE61A
S _USBERRIRQ DefE663
S _EP4CS DefE6A4
S _EIEX4 Def00EA
S _USBCS DefE680
S _EP6FIFOBCL DefE6B0
S _SBUF0 Def0099
S _EIEX5 Def00EB
A _CODE size 0 flags 0 addr 0
A RSEG size 0 flags 0 addr 0
A REG_BANK_0 size 8 flags 4 addr 0
A DSEG size 0 flags 0 addr 0
A OSEG size 2 flags 4 addr 0
S _hook_fgv_PARM_2 Def0000
S _hook_sv_PARM_2 Def0000
S _hook_uv_PARM_2 Def0000
A ISEG size 0 flags 0 addr 0
A IABS size 0 flags 8 addr 0
A BSEG size 3 flags 80 addr 0
A PSEG size 0 flags 50 addr 0
A XSEG size 0 flags 40 addr 0
A XABS size 0 flags 48 addr 0
A HOME size 0 flags 20 addr 0
A GSINIT0 size 0 flags 20 addr 0
A GSINIT1 size 0 flags 20 addr 0
A GSINIT2 size 0 flags 20 addr 0
A GSINIT3 size 0 flags 20 addr 0
A GSINIT4 size 0 flags 20 addr 0
A GSINIT5 size 0 flags 20 addr 0
A GSINIT size 0 flags 20 addr 0
A GSFINAL size 0 flags 20 addr 0
A CSEG size 1B2 flags 20 addr 0
S _hook_sv Def0000
S _hook_uv Def0063
S _setup_autovectors Def010A
S _hook_fgv Def00B4
A CONST size 0 flags 20 addr 0
A CABS size 0 flags 28 addr 0
T 00 00
R 00 00 00 02
T 00 00
R 00 00 00 04
T 00 00
R 00 00 00 04
T 00 00
R 00 00 00 04
T 00 00
R 00 00 00 04
T 00 00
R 00 00 00 04
T 00 00
R 00 00 00 04
T 00 00
R 00 00 00 07
T 00 00
R 00 00 00 07
T 00 01
R 00 00 00 07
T 00 01
R 00 00 00 07
T 00 02
R 00 00 00 07
T 00 02
R 00 00 00 07
T 00 00
R 00 00 00 14
T 00 00 AA 82 BA 03 00
R 00 00 00 14
T 00 05
R 00 00 00 14
T 00 05 40 05 EA 24 9C 50 01
R 00 00 00 14
T 00 0C
R 00 00 00 14
T 00 0C 22
R 00 00 00 14
T 00 0D
R 00 00 00 14
T 00 0D 74 0F 5A FB BB 03 02 80 07
R 00 00 00 14
T 00 16
R 00 00 00 14
T 00 16 74 0F 5A FB BB 0B 45
R 00 00 00 14
T 00 1D
R 00 00 00 14
T 00 1D A2 AF 92 00 00 00 C2 AF EA 24 00 00 00 F5
R 00 00 00 14 F1 21 05 00 07 F1 03 0C 00 3C
T 00 27 82 E4 34 00 00 00 F5 83 74 02 F0 7B 00 74
R 00 00 00 14 F1 83 05 00 3C
T 00 33 01 2A FC E4 3B FD EC 24 00 00 00 F5 82 ED
R 00 00 00 14 F1 03 0A 00 3C
T 00 3F 34 00 00 00 F5 83 E5 00 00 01 FC F0 74 02
R 00 00 00 14 F1 83 03 00 3C F1 21 09 00 04
T 00 49 2A FA E4 3B FB EA 24 00 00 00 F5 82 EB 34
R 00 00 00 14 F1 03 09 00 3C
T 00 55 00 00 00 F5 83 AA 00 00 00 7B 00 EA F0 A2
R 00 00 00 14 F1 83 02 00 3C F1 21 08 00 04
T 00 5F 00 00 00 92 AF
R 00 00 00 14 F1 21 02 00 07
T 00 62
R 00 00 00 14
T 00 62 22
R 00 00 00 14
T 00 63
R 00 00 00 14
T 00 63 E5 82 FA 24 83 50 01 22
R 00 00 00 14
T 00 6B
R 00 00 00 14
T 00 6B EA 54 03 60 01 22
R 00 00 00 14
T 00 71
R 00 00 00 14
T 00 71 A2 AF 92 00 00 01 C2 AF EA 24 00 00 00 F5
R 00 00 00 14 F1 21 05 00 07 F1 03 0C 00 F3
T 00 7B 82 E4 34 00 00 00 F5 83 74 02 F0 7B 00 74
R 00 00 00 14 F1 83 05 00 F3
T 00 87 01 2A FC E4 3B FD EC 24 00 00 00 F5 82 ED
R 00 00 00 14 F1 03 0A 00 F3
T 00 93 34 00 00 00 F5 83 E5 00 00 01 F0 74 02 2A
R 00 00 00 14 F1 83 03 00 F3 F1 21 09 00 04
T 00 9D FA E4 3B FB EA 24 00 00 00 F5 82 EB 34
R 00 00 00 14 F1 03 08 00 F3
T 00 A8 00 00 00 F5 83 AA 00 00 00 EA F0 A2
R 00 00 00 14 F1 83 02 00 F3 F1 21 08 00 04
T 00 B0 00 00 01 92 AF 22
R 00 00 00 14 F1 21 02 00 07
T 00 B4
R 00 00 00 14
T 00 B4 AA 82 BA 80 00
R 00 00 00 14
T 00 B9
R 00 00 00 14
T 00 B9 40 05 EA 24 4B 50 01
R 00 00 00 14
T 00 C0
R 00 00 00 14
T 00 C0 22
R 00 00 00 14
T 00 C1
R 00 00 00 14
T 00 C1 EA 54 03 60 01 22
R 00 00 00 14
T 00 C7
R 00 00 00 14
T 00 C7 A2 AF 92 00 00 02 C2 AF EA 24 00 00 00 F5
R 00 00 00 14 F1 21 05 00 07 F1 03 0C 00 51
T 00 D1 82 E4 34 00 00 00 F5 83 74 02 F0 7B 00 74
R 00 00 00 14 F1 83 05 00 51
T 00 DD 01 2A FC E4 3B FD EC 24 00 00 00 F5 82 ED
R 00 00 00 14 F1 03 0A 00 51
T 00 E9 34 00 00 00 F5 83 E5 00 00 01 F0 74 02 2A
R 00 00 00 14 F1 83 03 00 51 F1 21 09 00 04
T 00 F3 FA E4 3B FB EA 24 00 00 00 F5 82 EB 34
R 00 00 00 14 F1 03 08 00 51
T 00 FE 00 00 00 F5 83 AA 00 00 00 EA F0 A2
R 00 00 00 14 F1 83 02 00 51 F1 21 08 00 04
T 01 06 00 00 02 92 AF 22
R 00 00 00 14 F1 21 02 00 07
T 01 0A
R 00 00 00 14
T 01 0A C2 E8 C2 EA 75 00 00 00 00 00 00 75
R 00 00 00 14 F1 21 07 00 04 F1 03 0A 00 F3
T 01 12 00 00 01 00 00 00 75 82 43 12
R 00 00 00 14 F1 21 02 00 04 F1 83 05 00 F3
T 01 18 00 00 75 00 00 00
R 00 00 00 14 00 02 00 14 F1 21 05 00 04
T 01 1C 00 00 00 75 00 00 01
R 00 00 00 14 F1 03 02 00 51 F1 21 06 00 04
T 01 1F 00 00 00 75 82 53 12 00 00 00 90 E6 50 E4
R 00 00 00 14 F1 83 02 00 51 00 09 00 14
T 01 2B F0 00 90 E6 52 E4 F0 00 90 E6 54 E4 F0 00
R 00 00 00 14
T 01 39 90 E6 56 E4 F0 00 90 E6 51 74 FF F0 00 90
R 00 00 00 14
T 01 47 E6 53 74 FF F0 00 90 E6 55 74 FF F0 00 90
R 00 00 00 14
T 01 55 E6 57 74 FF F0 00 90 E6 58 E4 F0 90 E6 59
R 00 00 00 14
T 01 63 74 FF F0 90 E6 5A E4 F0 90 E6 5B 74 FF F0
R 00 00 00 14
T 01 71 90 E6 5C E4 F0 90 E6 5D 74 FF F0 90 E6 5E
R 00 00 00 14
T 01 7F E4 F0 90 E6 5F 74 FF F0 00 90 E6 60 E4 F0
R 00 00 00 14
T 01 8D 00 90 E6 61 74 FF F0 90 E6 62 E4 F0 90
R 00 00 00 14
T 01 9A E6 63 74 FF F0 90 E6 65 E4 F0 90 E6 68 74
R 00 00 00 14
T 01 A8 0B F0 53 91 AF D2 E8 D2 EA 22
R 00 00 00 14

Some files were not shown because too many files have changed in this diff Show More