Skip to content

Commit

Permalink
Update boards naming
Browse files Browse the repository at this point in the history
  • Loading branch information
rjonaitis committed Mar 25, 2024
1 parent a4dc27e commit 82aa770
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 50 deletions.
1 change: 1 addition & 0 deletions src/boards/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ if (ENABLE_LITE_PCIE)
include(${CMAKE_CURRENT_LIST_DIR}/LimeSDR_X3/CMakeLists.txt)
include(${CMAKE_CURRENT_LIST_DIR}/LimeSDR_XTRX/CMakeLists.txt)
include(${CMAKE_CURRENT_LIST_DIR}/MMX8/CMakeLists.txt)
include(${CMAKE_CURRENT_LIST_DIR}/external/AmberSDR/CMakeLists.txt)
endif()

include(${CMAKE_CURRENT_LIST_DIR}/LimeSDR/CMakeLists.txt)
Expand Down
5 changes: 4 additions & 1 deletion src/boards/DeviceFactoryPCIe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
#include "LMS64C_FPGA_Over_PCIe_MMX8.h"
#include "LMS64C_LMS7002M_Over_PCIe_MMX8.h"

#include "boards/LimeSDR_Nano/LimeSDR_Nano.h"
#include "boards/LimeSDR_XTRX/LimeSDR_XTRX.h"
#include "boards/LimeSDR_X3/LimeSDR_X3.h"
#include "boards/MMX8/MM_X8.h"
#include "boards/external/AmberSDR/AmberSDR.h"

using namespace lime;

Expand Down Expand Up @@ -133,7 +133,10 @@ SDRDevice* DeviceFactoryPCIe::make(const DeviceHandle& handle)

return new LimeSDR_MMX8(controls, fpga, std::move(streamPorts), controlPipe, adfComms);
}
case LMS_DEV_EXTERNAL_AMBERSDR:
return new AmberSDR(route_lms7002m, route_fpga, streamPorts.front(), controlPipe);
default:
lime::ReportError(OpStatus::INVALID_VALUE, "Unrecognized device ID (%i)", fw.deviceId);
return nullptr;
}
}
15 changes: 0 additions & 15 deletions src/boards/LimeSDR_Nano/CMakeLists.txt

This file was deleted.

25 changes: 0 additions & 25 deletions src/boards/LimeSDR_Nano/LimeSDR_Nano.h

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,30 +1,28 @@
#include "LimeSDR_Nano.h"
#include "AmberSDR.h"

#include "LMSBoards.h"

namespace lime {

/// @brief Constructs a new LimeSDR_Nano object
/// @brief Constructs a new AmberSDR object
///
/// @param spiRFsoc The communications port to the LMS7002M chip.
/// @param spiFPGA The communications port to the device's FPGA.
/// @param sampleStream The communications port to send and receive sample data.
/// @param control The serial port communication of the device.
/// @param refClk The reference clock of the device.
LimeSDR_Nano::LimeSDR_Nano(std::shared_ptr<IComms> spiRFsoc,
AmberSDR::AmberSDR(std::shared_ptr<IComms> spiRFsoc,
std::shared_ptr<IComms> spiFPGA,
std::shared_ptr<LitePCIe> sampleStream,
std::shared_ptr<ISerialPort> control,
double refClk)
: LimeSDR_XTRX(spiRFsoc, spiFPGA, sampleStream, control, refClk)
{
/// Do not perform any unnecessary configuring to device in constructor, so you
/// could read back it's state for debugging purposes.
SDRDevice::Descriptor& desc = mDeviceDescriptor;
desc.name = GetDeviceName(LMS_DEV_LIMESDR_NANO);
desc.name = GetDeviceName(LMS_DEV_EXTERNAL_AMBERSDR);
}

LimeSDR_Nano::~LimeSDR_Nano()
AmberSDR::~AmberSDR()
{
}

Expand Down
26 changes: 26 additions & 0 deletions src/boards/external/AmberSDR/AmberSDR.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#ifndef LIME_EXTERNAL_AMBERSDR_H
#define LIME_EXTERNAL_AMBERSDR_H

#include "boards/LimeSDR_XTRX/LimeSDR_XTRX.h"

namespace lime {

static const float AMBERSDR_DEFAULT_REFERENCE_CLOCK = 26e6;

// Non LimeSDR board, but with compatible gateware similar to XTRX

class AmberSDR : public LimeSDR_XTRX
{
public:
AmberSDR() = delete;
AmberSDR(std::shared_ptr<IComms> spiLMS7002M,
std::shared_ptr<IComms> spiFPGA,
std::shared_ptr<LitePCIe> sampleStream,
std::shared_ptr<ISerialPort> control,
double refClk = AMBERSDR_DEFAULT_REFERENCE_CLOCK);
virtual ~AmberSDR();
};

} // namespace lime

#endif // LIME_EXTERNAL_AMBERSDR_H
5 changes: 5 additions & 0 deletions src/boards/external/AmberSDR/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
set(AMBERSDR_SOURCES
${CMAKE_CURRENT_LIST_DIR}/AmberSDR.cpp
)

target_sources(${MAIN_LIBRARY_NAME} PRIVATE ${AMBERSDR_SOURCES})
4 changes: 2 additions & 2 deletions src/protocols/LMSBoards.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ enum eLMS_DEV {
LMS_DEV_LIMESDR_X3 = 26, // 3xLMS
LMS_DEV_LIMESDR_XTRX = 27, // XTRX
LMS_DEV_LIMESDR_MMX8 = 28,
LMS_DEV_LIMESDR_NANO = 29,
LMS_DEV_EXTERNAL_AMBERSDR = 29,

LMS_DEV_COUNT
};
Expand Down Expand Up @@ -75,7 +75,7 @@ const std::array<const std::string, LMS_DEV_COUNT> LMS_DEV_NAMES = {
"LimeSDR X3",
"LimeSDR XTRX",
"LimeSDR MMX8",
"LimeSDR Nano",
"AmberSDR",
};

static constexpr const std::string& GetDeviceName(const eLMS_DEV device)
Expand Down

0 comments on commit 82aa770

Please sign in to comment.