Skip to content

Commit

Permalink
Merge branch 'split-legacy-api' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
rjonaitis committed Nov 21, 2024
2 parents 69c59e1 + 80df37f commit a28c837
Show file tree
Hide file tree
Showing 19 changed files with 91 additions and 276 deletions.
2 changes: 1 addition & 1 deletion GUI/boards/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
target_sources(
limeGUI PRIVATE pnlBoardControls.cpp pnlBuffers.cpp pnlGPIO.cpp pnlX3.cpp pnlX8.cpp pnlXTRX.cpp pnluLimeSDR.cpp pnlLimeSDR.cpp)
limeGUI PRIVATE pnlBoardControls.cpp pnlGPIO.cpp pnlX3.cpp pnlX8.cpp pnlXTRX.cpp pnluLimeSDR.cpp pnlLimeSDR.cpp)
147 changes: 2 additions & 145 deletions docs/development/migration/LMS/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,158 +11,15 @@ This is the table noting all the known differences to the functionality of the l

* - LMS API function
- Changes
* - ``LMS_GetDeviceList()``
- No functional difference.
* - ``LMS_Open()``
- No functional difference.
* - ``LMS_Close()``
- No functional difference.
* - ``LMS_Init()``
- No functional difference.
* - ``LMS_GetNumChannels()``
- No functional difference.
* - ``LMS_EnableChannel()``
- No functional difference.
* - ``LMS_SetSampleRate()``
- No functional difference.
* - ``LMS_GetSampleRate()``
- ``rf_Hz`` will always be the same as ``host_Hz`` (i.e. :math:`2^{ratio}` times smaller compared to the old API).
* - ``LMS_GetSampleRateRange()``
- No functional difference.
* - ``LMS_SetLOFrequency()``
- No functional difference once the bugs are fixed.
* - ``LMS_GetLOFrequency()``
- The NCO offset is currently not applied.
* - ``LMS_GetLOFrequencyRange()``
- No functional difference.
* - ``LMS_GetAntennaList()``
- No functional difference.
* - ``LMS_SetAntenna()``
- No functional difference.
* - ``LMS_GetAntenna()``
- No functional difference.
* - ``LMS_GetAntennaBW()``
- No functional difference.
* - ``LMS_SetNormalizedGain()``
- No functional difference.
* - ``LMS_SetGaindB()``
- No functional difference.
* - ``LMS_GetNormalizedGain()``
- No functional difference.
* - ``LMS_GetGaindB()``
- No functional difference.
* - ``LMS_SetLPFBW()``
- No functional difference.
* - ``LMS_GetLPFBW()``
- No functional difference.
* - ``LMS_GetLPFBWRange()``
- No functional difference.
* - ``LMS_SetLPF()``
- Currently broken, just sets the last saved LPF value for the direction channel combo.
* - ``LMS_SetGFIRLPF()``
- No functional difference.
* - ``LMS_Calibrate()``
- No functional difference.
* - ``LMS_LoadConfig()``
- No functional difference.
* - ``LMS_SaveConfig()``
- No functional difference.
* - ``LMS_SetTestSignal()``
- No functional difference.
* - ``LMS_GetTestSignal()``
- No functional difference.
* - ``LMS_GetChipTemperature()``
- No functional difference.
- Currently just sets the last saved LPF value from LMS_SetLPFBW call.
* - ``LMS_SetSampleRateDir()``
- Sets the sample rate for the whole device anyway, regardless of the direction used.
* - ``LMS_SetNCOFrequency()``
- No functional difference.
- Sets both Rx and Tx to the same sample rate.
* - ``LMS_GetNCOFrequency()``
- Negative values can be returned as well, use ``std::fabs()`` to fix that.
* - ``LMS_SetNCOPhase()``
- No functional difference.
* - ``LMS_GetNCOPhase()``
- No functional difference.
* - ``LMS_SetNCOIndex()``
- No functional difference.
* - ``LMS_GetNCOIndex()``
- No functional difference.
* - ``LMS_SetGFIRCoeff()``
- No functional difference.
* - ``LMS_GetGFIRCoeff()``
- No functional difference.
* - ``LMS_SetGFIR()``
- No functional difference.
* - ``LMS_EnableCache()``
- No functional difference.
* - ``LMS_Reset()``
- No functional difference.
* - ``LMS_ReadLMSReg()``
- No functional difference.
* - ``LMS_WriteLMSReg()``
- No functional difference.
* - ``LMS_ReadParam()``
- No functional difference.
* - ``LMS_WriteParam()``
- No functional difference.
* - ``LMS_ReadFPGAReg()``
- No functional difference.
* - ``LMS_WriteFPGAReg()``
- No functional difference.
* - ``LMS_ReadCustomBoardParam()``
- No functional difference.
* - ``LMS_WriteCustomBoardParam()``
- No functional difference.
* - ``LMS_GetClockFreq()``
- No functional difference.
* - ``LMS_SetClockFreq()``
- No functional difference.
* - ``LMS_VCTCXOWrite()``
- No functional difference.
* - ``LMS_VCTCXORead()``
- No functional difference.
* - ``LMS_Synchronize()``
- No functional difference.
* - ``LMS_GPIORead()``
- No functional difference.
* - ``LMS_GPIOWrite()``
- No functional difference.
* - ``LMS_GPIODirRead()``
- No functional difference.
* - ``LMS_GPIODirWrite()``
- No functional difference.
* - ``LMS_SetupStream()``
- Only one call is now needed to set up all the streams on all the channels on a given device now,
multiple calls are still fine, albeit wasteful.
* - ``LMS_DestroyStream()``
- Does not stop the stream anymore, a call to ``LMS_StopStream()`` before hand is necessary.
* - ``LMS_StartStream()``
- Starts all the set up streams at the same time, multiple calls are allowed for legacy reasons only.
* - ``LMS_StopStream()``
- Stops all the set up streams at the same time, multiple calls are allowed for legacy reasons only.
* - ``LMS_RecvStream()``
- + SISO mode - no functional difference.
+ MIMO mode - on the first call data for both channels is received and cached,
on the second call (to the other channel) it returns the previously cached samples.
* - ``LMS_GetStreamStatus()``
- No functional difference.
* - ``LMS_SendStream()``
- + SISO mode - no functional difference.
+ MIMO mode - on the first call data is cached and return value is returned as if all the samples were sent,
on the second call (to the other channel) the samples are actually sent to the device and the correct sent sample count is being returned.
* - ``LMS_UploadWFM()``
- No functional difference.
* - ``LMS_EnableTxWFM()``
- No functional difference.
* - ``LMS_GetProgramModes()``
- No functional difference.
* - ``LMS_Program()``
- No functional difference.
* - ``LMS_GetDeviceInfo()``
- No functional difference.
* - ``LMS_GetLibraryVersion()``
- No functional difference.
* - ``LMS_GetLastErrorMessage()``
- No functional difference.
* - ``LMS_RegisterLogHandler()``
- No functional difference.
2 changes: 1 addition & 1 deletion docs/development/migration/index.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
API changes and migrations
==========================

This section contains information about how to migrate existing programs using the legacy LimeSuite LMS API to the newer SDRDevice API.
This section contains information about how to migrate existing programs from the legacy LimeSuite LMS API to the newer LimeSuiteNG API.

.. toctree::

Expand Down
2 changes: 1 addition & 1 deletion docs/doxygen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if(ENABLE_DOXYGEN)
add_custom_target(
doxygen ALL
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/DoxygenConfig
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating Doxygen documentation"
VERBATIM)
endif()
40 changes: 15 additions & 25 deletions docs/doxygen/DoxygenConfig.in
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ FULL_PATH_NAMES = YES
# will be relative from the directory where doxygen is started.
# This tag requires that the tag FULL_PATH_NAMES is set to YES.

STRIP_FROM_PATH = "@CMAKE_SOURCE_DIR@"
STRIP_FROM_PATH = "@PROJECT_SOURCE_DIR@"

# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
# path mentioned in the documentation of a class, which tells the reader which
Expand Down Expand Up @@ -471,7 +471,7 @@ LOOKUP_CACHE_SIZE = 0
# DOT_NUM_THREADS setting.
# Minimum value: 0, maximum value: 32, default value: 1.

NUM_PROC_THREADS = 1
NUM_PROC_THREADS = 0

#---------------------------------------------------------------------------
# Build related configuration options
Expand Down Expand Up @@ -794,7 +794,7 @@ CITE_BIB_FILES =
# messages are off.
# The default value is: NO.

QUIET = NO
QUIET = YES

# The WARNINGS tag can be used to turn on/off the warning messages that are
# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES
Expand All @@ -810,7 +810,7 @@ WARNINGS = YES
# will automatically be disabled.
# The default value is: YES.

WARN_IF_UNDOCUMENTED = YES
WARN_IF_UNDOCUMENTED = NO

# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
# potential errors in the documentation, such as not documenting some parameters
Expand Down Expand Up @@ -864,7 +864,7 @@ WARN_LOGFILE =
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.

INPUT = @CMAKE_SOURCE_DIR@/src @CMAKE_SOURCE_DIR@/plugins
INPUT = @PROJECT_SOURCE_DIR@/src @PROJECT_SOURCE_DIR@/plugins

# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
Expand Down Expand Up @@ -898,24 +898,17 @@ FILE_PATTERNS = *.c \
*.cxx \
*.cpp \
*.c++ \
*.ii \
*.ixx \
*.ipp \
*.i++ \
*.inl \
*.idl \
*.h \
*.hh \
*.hxx \
*.hpp \
*.h++ \
*.cs \
*.inc \
*.m \
*.markdown \
*.md \
*.mm \
*.dox
#*.m \
#*.markdown \
# *.md \
#*.mm \
#*.dox

# The RECURSIVE tag can be used to specify whether or not subdirectories should
# be searched for input files as well.
Expand All @@ -930,14 +923,11 @@ RECURSIVE = YES
# Note that relative paths are relative to the directory from which doxygen is
# run.

EXCLUDE = @CMAKE_SOURCE_DIR@/external @CMAKE_SOURCE_DIR@/plugins

EXCLUDE += @CMAKE_SOURCE_DIR@/src/tests
EXCLUDE += @CMAKE_SOURCE_DIR@/src/boards_wxgui
EXCLUDE += @CMAKE_SOURCE_DIR@/src/fftviewer_wxgui
EXCLUDE += @CMAKE_SOURCE_DIR@/src/FPGAcontrols_wxgui
EXCLUDE += @CMAKE_SOURCE_DIR@/src/lms7002_wxgui
EXCLUDE += @CMAKE_SOURCE_DIR@/src/utilities_gui
# @PROJECT_SOURCE_DIR@/external @PROJECT_SOURCE_DIR@/plugins
EXCLUDE =
EXCLUDE += @PROJECT_SOURCE_DIR@/plugins/amarisoft-plugin/include
EXCLUDE += @PROJECT_SOURCE_DIR@/plugins/HDSDR
EXCLUDE += @PROJECT_SOURCE_DIR@/src/tests

# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded
Expand Down
8 changes: 4 additions & 4 deletions plugins/gr-limesdr/docs/doxygen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
########################################################################
# 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)
file(TO_NATIVE_PATH ${PROJECT_SOURCE_DIR} top_srcdir)
file(TO_NATIVE_PATH ${PROJECT_BINARY_DIR} top_builddir)
file(TO_NATIVE_PATH ${PROJECT_SOURCE_DIR} abs_top_srcdir)
file(TO_NATIVE_PATH ${PROJECT_BINARY_DIR} abs_top_builddir)

set(HAVE_DOT ${DOXYGEN_DOT_FOUND})
set(enable_html_docs YES)
Expand Down
2 changes: 1 addition & 1 deletion plugins/gr-limesdr/docs/doxygen/Doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ INPUT_FILTER =
# info on how filters are used. If FILTER_PATTERNS is empty or if
# non of the patterns match the file name, INPUT_FILTER is applied.

FILTER_PATTERNS = *.py="@top_srcdir@"/doc/doxygen/other/doxypy.py
FILTER_PATTERNS = *.py=\"@top_srcdir@\"/doc/doxygen/other/doxypy.py

# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
# INPUT_FILTER) will be used to filter the input files when producing source
Expand Down
7 changes: 4 additions & 3 deletions src/API/LMS_APIWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1497,9 +1497,10 @@ API_EXPORT int CALL_CONV LMS_SetNCOPhase(lms_device_t* device, bool dir_tx, size
apiDevice->device->WriteRegister(apiDevice->moduleIndex, addr + i, pho);
}

auto& selectionParameter = dir_tx ? SEL_TX : SEL_RX;
apiDevice->device->SetParameter(
apiDevice->moduleIndex, ch, selectionParameter.address, selectionParameter.msb, selectionParameter.lsb, 0);
const uint16_t addr = dir_tx ? 0x0240 : 0x0440; // SEL_TX, SEL_RX
const uint8_t msb = 4;
const uint8_t lsb = 1;
apiDevice->device->SetParameter(apiDevice->moduleIndex, ch, addr, msb, lsb, 0);
}

return 0;
Expand Down
10 changes: 9 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ set(LIME_SUITE_SOURCES
FPGA/WriteRegistersBatch.cpp
threadHelper/threadHelper.cpp
memory/MemoryPool.cpp
API/LMS_APIWrapper.cpp
API/LimePlugin.cpp
include/limesuiteng/SDRDevice.cpp
utilities/toString.cpp)
Expand Down Expand Up @@ -140,3 +139,12 @@ if(ENABLE_HEADERS AND ENABLE_LIBRARY)

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/limesuiteng.pc DESTINATION lib${LIB_SUFFIX}/pkgconfig)
endif(ENABLE_HEADERS AND ENABLE_LIBRARY)


########################################################################
# LMS_API Wrapper lib
# wrapper functions split into separate library to avoid symbols collision
# if both limesuiteng and LimeSuite would be linked to application.
########################################################################
add_library(limesuiteng-legacyapi API/LMS_APIWrapper.cpp)
target_link_libraries(limesuiteng-legacyapi PRIVATE limesuiteng)
26 changes: 2 additions & 24 deletions src/examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
include(FeatureSummary)
include(CMakeDependentOption)
cmake_dependent_option(ENABLE_EXAMPLES "Enable library example programs" ON "ENABLE_LIBRARY" OFF)
add_feature_info(EXAMPLES ENABLE_EXAMPLES "LimeSuite library API examples")
add_feature_info(EXAMPLES ENABLE_EXAMPLES "LimeSuiteNG API examples")
if(NOT ENABLE_EXAMPLES)
return()
endif()
Expand Down Expand Up @@ -34,26 +34,4 @@ target_link_libraries(
PRIVATE limesuiteng
PRIVATE cli-shared kissfft taywee::args)

add_executable(legacyBasicRX legacy/basicRX.cpp)
set_target_properties(legacyBasicRX PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${examplesOutputDir}/legacy RUNTIME_OUTPUT_NAME basicRX)
target_link_libraries(legacyBasicRX PRIVATE limesuiteng)

add_executable(legacyBasicTX legacy/basicTX.cpp)
set_target_properties(legacyBasicTX PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${examplesOutputDir}/legacy RUNTIME_OUTPUT_NAME basicTX)
target_link_libraries(legacyBasicTX PRIVATE limesuiteng)

add_executable(legacyDualRXTX legacy/dualRXTX.cpp)
set_target_properties(legacyDualRXTX PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${examplesOutputDir}/legacy RUNTIME_OUTPUT_NAME dualRXTX)
target_link_libraries(legacyDualRXTX PRIVATE limesuiteng)

add_executable(legacyGpio_example legacy/gpio_example.cpp)
set_target_properties(
legacyGpio_example PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${examplesOutputDir}/legacy RUNTIME_OUTPUT_NAME gpio_example)
target_link_libraries(legacyGpio_example PRIVATE limesuiteng)

add_executable(legacySingleRX legacy/singleRX.cpp)
set_target_properties(legacySingleRX PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${examplesOutputDir}/legacy RUNTIME_OUTPUT_NAME singleRX)
target_link_libraries(legacySingleRX PRIVATE limesuiteng)
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
target_compile_options(legacySingleRX PRIVATE -Wno-unused-but-set-variable)
endif()
add_subdirectory(legacy)
23 changes: 23 additions & 0 deletions src/examples/legacy/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

set(examplesOutputDir "${CMAKE_BINARY_DIR}/bin/examples")

add_executable(legacyBasicRX basicRX.cpp)
set_target_properties(legacyBasicRX PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${examplesOutputDir}/legacy RUNTIME_OUTPUT_NAME basicRX)
target_link_libraries(legacyBasicRX PRIVATE limesuiteng-legacyapi)

add_executable(legacyBasicTX basicTX.cpp)
set_target_properties(legacyBasicTX PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${examplesOutputDir}/legacy RUNTIME_OUTPUT_NAME basicTX)
target_link_libraries(legacyBasicTX PRIVATE limesuiteng-legacyapi)

add_executable(legacyDualRXTX dualRXTX.cpp)
set_target_properties(legacyDualRXTX PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${examplesOutputDir}/legacy RUNTIME_OUTPUT_NAME dualRXTX)
target_link_libraries(legacyDualRXTX PRIVATE limesuiteng-legacyapi)

add_executable(legacyGpio_example gpio_example.cpp)
set_target_properties(
legacyGpio_example PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${examplesOutputDir}/legacy RUNTIME_OUTPUT_NAME gpio_example)
target_link_libraries(legacyGpio_example PRIVATE limesuiteng-legacyapi)

add_executable(legacySingleRX singleRX.cpp)
set_target_properties(legacySingleRX PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${examplesOutputDir}/legacy RUNTIME_OUTPUT_NAME singleRX)
target_link_libraries(legacySingleRX PRIVATE limesuiteng-legacyapi)
Loading

0 comments on commit a28c837

Please sign in to comment.