remove EZDMA files

This commit is contained in:
Marc Majoral 2023-12-20 17:01:24 +01:00
parent ad23e1c398
commit ac3319d906
No known key found for this signature in database
GPG Key ID: 4EB5F809DF941320
2 changed files with 0 additions and 132 deletions

View File

@ -1,68 +0,0 @@
/*!
* \file fpga_edma.cc
* \brief FPGA DMA control using the ezdma (See https://github.com/jeremytrimble/ezdma).
* \author Marc Majoral, mmajoral(at)cttc.es
*
* -----------------------------------------------------------------------------
*
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
* This file is part of GNSS-SDR.
*
* Copyright (C) 2010-2022 (see AUTHORS file for a list of contributors)
* SPDX-License-Identifier: GPL-3.0-or-later
*
* -----------------------------------------------------------------------------
*/
#include "fpga_ezdma.h"
#include <fcntl.h>
#include <iostream> // for std::cerr
#include <unistd.h>
int Fpga_DMA::DMA_open()
{
tx_fd = open("/dev/loop_tx", O_WRONLY);
if (tx_fd < 1)
{
return tx_fd;
}
// note: a problem was identified with the DMA: when switching from tx to rx or rx to tx mode
// the DMA transmission may hang. This problem will be fixed soon.
// for the moment this problem can be avoided by closing and opening the DMA a second time
if (close(tx_fd) < 0)
{
std::cerr << "Error closing loop device " << '\n';
return -1;
}
// open the DMA a second time
tx_fd = open("/dev/loop_tx", O_WRONLY);
if (tx_fd < 1)
{
std::cerr << "Cannot open loop device\n";
// stop the receiver
return tx_fd;
}
return 0;
}
int8_t *Fpga_DMA::get_buffer_address()
{
return buffer;
}
int Fpga_DMA::DMA_write(int nbytes) const
{
const int num_bytes_sent = write(tx_fd, buffer, nbytes);
if (num_bytes_sent != nbytes)
{
return -1;
}
return 0;
}
int Fpga_DMA::DMA_close() const
{
return close(tx_fd);
}

View File

@ -1,64 +0,0 @@
/*!
* \file fpga_ezdma.h
* \brief FPGA DMA control using the ezdma (See https://github.com/jeremytrimble/ezdma).
* \author Marc Majoral, mmajoral(at)cttc.es
*
* -----------------------------------------------------------------------------
*
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
* This file is part of GNSS-SDR.
*
* Copyright (C) 2010-2022 (see AUTHORS file for a list of contributors)
* SPDX-License-Identifier: GPL-3.0-or-later
*
* -----------------------------------------------------------------------------
*/
#ifndef GNSS_SDR_FPGA_EDMA_H
#define GNSS_SDR_FPGA_EDMA_H
#include <cstdint> // for std::int8_t
/*!
* \brief Class that controls the switch DMA in the FPGA
*/
class Fpga_DMA
{
public:
/*!
* \brief Default constructor.
*/
Fpga_DMA() = default;
/*!
* \brief Default destructor.
*/
~Fpga_DMA() = default;
/*!
* \brief Open the DMA device driver.
*/
int DMA_open(void);
/*!
* \brief Obtain DMA buffer address.
*/
int8_t *get_buffer_address(void); // NOLINT(readability-make-member-function-const)
/*!
* \brief Transfer DMA data
*/
int DMA_write(int nbytes) const;
/*!
* \brief Close the DMA device driver
*/
int DMA_close(void) const;
private:
static const uint32_t DMA_MAX_BUFFER_SIZE = 4 * 16384; // 4-channel 16384-sample buffers
int8_t buffer[DMA_MAX_BUFFER_SIZE];
int tx_fd;
};
#endif // GNSS_SDR_FPGA_EDMA_H