mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-18 21:23:02 +00:00
remove EZDMA files
This commit is contained in:
parent
8b512d997b
commit
3df8b9e83f
@ -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);
|
||||
}
|
@ -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
|
Loading…
Reference in New Issue
Block a user