From 204a9f135ac2408dd62b55462ebe4b2d10be4f56 Mon Sep 17 00:00:00 2001 From: Thomas Tsou Date: Tue, 29 Oct 2013 18:34:16 -0400 Subject: Transceiver52M: Add multi channel transceiver support This patch primarily addresses devices with multiple RF front end support. Currently device support is limited to UmTRX. Vectorize transceiver variables to allow multiple asynchronous threads on the upper layer with single downlink and uplink threads driving the UHD I/O interface synchronously. Signed-off-by: Thomas Tsou --- Transceiver52M/radioInterface.h | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) (limited to 'Transceiver52M/radioInterface.h') diff --git a/Transceiver52M/radioInterface.h b/Transceiver52M/radioInterface.h index 84de1e5..1e58ecb 100644 --- a/Transceiver52M/radioInterface.h +++ b/Transceiver52M/radioInterface.h @@ -30,19 +30,20 @@ protected: Thread mAlignRadioServiceLoopThread; ///< thread that synchronizes transmit and receive sections - VectorFIFO mReceiveFIFO; ///< FIFO that holds receive bursts + std::vector mReceiveFIFO; ///< FIFO that holds receive bursts RadioDevice *mRadio; ///< the USRP object - int mSPSTx; - int mSPSRx; - signalVector *sendBuffer; - signalVector *recvBuffer; + size_t mSPSTx; + size_t mSPSRx; + size_t mChans; + std::vector sendBuffer; + std::vector recvBuffer; unsigned sendCursor; unsigned recvCursor; - short *convertRecvBuffer; - short *convertSendBuffer; + std::vector convertRecvBuffer; + std::vector convertSendBuffer; bool underrun; ///< indicates writes to USRP are too slow bool overrun; ///< indicates reads from USRP are too slow @@ -89,43 +90,41 @@ public: /** constructor */ RadioInterface(RadioDevice* wRadio = NULL, int receiveOffset = 3, - int wSPS = 4, + size_t sps = 4, size_t chans = 1, GSM::Time wStartTime = GSM::Time(0)); - + /** destructor */ virtual ~RadioInterface(); /** check for underrun, resets underrun value */ bool isUnderrun(); - - /** attach an existing USRP to this interface */ - void attach(RadioDevice *wRadio, int wRadioOversampling); /** return the receive FIFO */ - VectorFIFO* receiveFIFO() { return &mReceiveFIFO;} + VectorFIFO* receiveFIFO(size_t chan = 0); /** return the basestation clock */ RadioClock* getClock(void) { return &mClock;}; /** set transmit frequency */ - bool tuneTx(double freq); + bool tuneTx(double freq, size_t chan = 0); /** set receive frequency */ - bool tuneRx(double freq); + bool tuneRx(double freq, size_t chan = 0); /** set receive gain */ - double setRxGain(double dB); + double setRxGain(double dB, size_t chan = 0); /** get receive gain */ - double getRxGain(void); + double getRxGain(size_t chan = 0); /** drive transmission of GSM bursts */ - void driveTransmitRadio(signalVector &radioBurst, bool zeroBurst); + void driveTransmitRadio(std::vector &bursts, + std::vector &zeros); /** drive reception of GSM bursts */ - void driveReceiveRadio(); + bool driveReceiveRadio(); - void setPowerAttenuation(double atten); + void setPowerAttenuation(double atten, size_t chan = 0); /** returns the full-scale transmit amplitude **/ double fullScaleInputValue(); @@ -169,7 +168,7 @@ public: RadioInterfaceResamp(RadioDevice* wRadio = NULL, int receiveOffset = 3, - int wSPS = 4, + size_t wSPS = 4, size_t chans = 1, GSM::Time wStartTime = GSM::Time(0)); ~RadioInterfaceResamp(); -- cgit v1.2.3