SoapySDR
0.8.0-gab626068
Vendor and platform neutral SDR interface library
|
#include <Device.hpp>
Public Member Functions | |
virtual | ~Device (void) |
virtual destructor for inheritance More... | |
virtual std::string | getDriverKey (void) const |
virtual std::string | getHardwareKey (void) const |
virtual Kwargs | getHardwareInfo (void) const |
virtual void | setFrontendMapping (const int direction, const std::string &mapping) |
virtual std::string | getFrontendMapping (const int direction) const |
virtual size_t | getNumChannels (const int direction) const |
virtual Kwargs | getChannelInfo (const int direction, const size_t channel) const |
virtual bool | getFullDuplex (const int direction, const size_t channel) const |
virtual std::vector< std::string > | getStreamFormats (const int direction, const size_t channel) const |
virtual std::string | getNativeStreamFormat (const int direction, const size_t channel, double &fullScale) const |
virtual ArgInfoList | getStreamArgsInfo (const int direction, const size_t channel) const |
virtual Stream * | setupStream (const int direction, const std::string &format, const std::vector< size_t > &channels=std::vector< size_t >(), const Kwargs &args=Kwargs()) |
virtual void | closeStream (Stream *stream) |
virtual size_t | getStreamMTU (Stream *stream) const |
virtual int | activateStream (Stream *stream, const int flags=0, const long long timeNs=0, const size_t numElems=0) |
virtual int | deactivateStream (Stream *stream, const int flags=0, const long long timeNs=0) |
virtual int | readStream (Stream *stream, void *const *buffs, const size_t numElems, int &flags, long long &timeNs, const long timeoutUs=100000) |
virtual int | writeStream (Stream *stream, const void *const *buffs, const size_t numElems, int &flags, const long long timeNs=0, const long timeoutUs=100000) |
virtual int | readStreamStatus (Stream *stream, size_t &chanMask, int &flags, long long &timeNs, const long timeoutUs=100000) |
virtual size_t | getNumDirectAccessBuffers (Stream *stream) |
virtual int | getDirectAccessBufferAddrs (Stream *stream, const size_t handle, void **buffs) |
virtual int | acquireReadBuffer (Stream *stream, size_t &handle, const void **buffs, int &flags, long long &timeNs, const long timeoutUs=100000) |
virtual void | releaseReadBuffer (Stream *stream, const size_t handle) |
virtual int | acquireWriteBuffer (Stream *stream, size_t &handle, void **buffs, const long timeoutUs=100000) |
virtual void | releaseWriteBuffer (Stream *stream, const size_t handle, const size_t numElems, int &flags, const long long timeNs=0) |
virtual std::vector< std::string > | listAntennas (const int direction, const size_t channel) const |
virtual void | setAntenna (const int direction, const size_t channel, const std::string &name) |
virtual std::string | getAntenna (const int direction, const size_t channel) const |
virtual bool | hasDCOffsetMode (const int direction, const size_t channel) const |
virtual void | setDCOffsetMode (const int direction, const size_t channel, const bool automatic) |
virtual bool | getDCOffsetMode (const int direction, const size_t channel) const |
virtual bool | hasDCOffset (const int direction, const size_t channel) const |
virtual void | setDCOffset (const int direction, const size_t channel, const std::complex< double > &offset) |
virtual std::complex< double > | getDCOffset (const int direction, const size_t channel) const |
virtual bool | hasIQBalance (const int direction, const size_t channel) const |
virtual void | setIQBalance (const int direction, const size_t channel, const std::complex< double > &balance) |
virtual std::complex< double > | getIQBalance (const int direction, const size_t channel) const |
virtual bool | hasIQBalanceMode (const int direction, const size_t channel) const |
virtual void | setIQBalanceMode (const int direction, const size_t channel, const bool automatic) |
virtual bool | getIQBalanceMode (const int direction, const size_t channel) const |
virtual bool | hasFrequencyCorrection (const int direction, const size_t channel) const |
virtual void | setFrequencyCorrection (const int direction, const size_t channel, const double value) |
virtual double | getFrequencyCorrection (const int direction, const size_t channel) const |
virtual std::vector< std::string > | listGains (const int direction, const size_t channel) const |
virtual bool | hasGainMode (const int direction, const size_t channel) const |
virtual void | setGainMode (const int direction, const size_t channel, const bool automatic) |
virtual bool | getGainMode (const int direction, const size_t channel) const |
virtual void | setGain (const int direction, const size_t channel, const double value) |
virtual void | setGain (const int direction, const size_t channel, const std::string &name, const double value) |
virtual double | getGain (const int direction, const size_t channel) const |
virtual double | getGain (const int direction, const size_t channel, const std::string &name) const |
virtual Range | getGainRange (const int direction, const size_t channel) const |
virtual Range | getGainRange (const int direction, const size_t channel, const std::string &name) const |
virtual void | setFrequency (const int direction, const size_t channel, const double frequency, const Kwargs &args=Kwargs()) |
virtual void | setFrequency (const int direction, const size_t channel, const std::string &name, const double frequency, const Kwargs &args=Kwargs()) |
virtual double | getFrequency (const int direction, const size_t channel) const |
virtual double | getFrequency (const int direction, const size_t channel, const std::string &name) const |
virtual std::vector< std::string > | listFrequencies (const int direction, const size_t channel) const |
virtual RangeList | getFrequencyRange (const int direction, const size_t channel) const |
virtual RangeList | getFrequencyRange (const int direction, const size_t channel, const std::string &name) const |
virtual ArgInfoList | getFrequencyArgsInfo (const int direction, const size_t channel) const |
virtual void | setSampleRate (const int direction, const size_t channel, const double rate) |
virtual double | getSampleRate (const int direction, const size_t channel) const |
virtual std::vector< double > | listSampleRates (const int direction, const size_t channel) const |
virtual RangeList | getSampleRateRange (const int direction, const size_t channel) const |
virtual void | setBandwidth (const int direction, const size_t channel, const double bw) |
virtual double | getBandwidth (const int direction, const size_t channel) const |
virtual std::vector< double > | listBandwidths (const int direction, const size_t channel) const |
virtual RangeList | getBandwidthRange (const int direction, const size_t channel) const |
virtual void | setMasterClockRate (const double rate) |
virtual double | getMasterClockRate (void) const |
virtual RangeList | getMasterClockRates (void) const |
virtual void | setReferenceClockRate (const double rate) |
virtual double | getReferenceClockRate (void) const |
virtual RangeList | getReferenceClockRates (void) const |
virtual std::vector< std::string > | listClockSources (void) const |
virtual void | setClockSource (const std::string &source) |
virtual std::string | getClockSource (void) const |
virtual std::vector< std::string > | listTimeSources (void) const |
virtual void | setTimeSource (const std::string &source) |
virtual std::string | getTimeSource (void) const |
virtual bool | hasHardwareTime (const std::string &what="") const |
virtual long long | getHardwareTime (const std::string &what="") const |
virtual void | setHardwareTime (const long long timeNs, const std::string &what="") |
virtual void | setCommandTime (const long long timeNs, const std::string &what="") |
virtual std::vector< std::string > | listSensors (void) const |
virtual ArgInfo | getSensorInfo (const std::string &key) const |
virtual std::string | readSensor (const std::string &key) const |
template<typename Type > | |
Type | readSensor (const std::string &key) const |
virtual std::vector< std::string > | listSensors (const int direction, const size_t channel) const |
virtual ArgInfo | getSensorInfo (const int direction, const size_t channel, const std::string &key) const |
virtual std::string | readSensor (const int direction, const size_t channel, const std::string &key) const |
template<typename Type > | |
Type | readSensor (const int direction, const size_t channel, const std::string &key) const |
virtual std::vector< std::string > | listRegisterInterfaces (void) const |
virtual void | writeRegister (const std::string &name, const unsigned addr, const unsigned value) |
virtual unsigned | readRegister (const std::string &name, const unsigned addr) const |
virtual void | writeRegister (const unsigned addr, const unsigned value) |
virtual unsigned | readRegister (const unsigned addr) const |
virtual void | writeRegisters (const std::string &name, const unsigned addr, const std::vector< unsigned > &value) |
virtual std::vector< unsigned > | readRegisters (const std::string &name, const unsigned addr, const size_t length) const |
virtual ArgInfoList | getSettingInfo (void) const |
virtual void | writeSetting (const std::string &key, const std::string &value) |
template<typename Type > | |
void | writeSetting (const std::string &key, const Type &value) |
virtual std::string | readSetting (const std::string &key) const |
template<typename Type > | |
Type | readSetting (const std::string &key) |
virtual ArgInfoList | getSettingInfo (const int direction, const size_t channel) const |
virtual void | writeSetting (const int direction, const size_t channel, const std::string &key, const std::string &value) |
template<typename Type > | |
void | writeSetting (const int direction, const size_t channel, const std::string &key, const Type &value) |
virtual std::string | readSetting (const int direction, const size_t channel, const std::string &key) const |
template<typename Type > | |
Type | readSetting (const int direction, const size_t channel, const std::string &key) |
virtual std::vector< std::string > | listGPIOBanks (void) const |
virtual void | writeGPIO (const std::string &bank, const unsigned value) |
virtual void | writeGPIO (const std::string &bank, const unsigned value, const unsigned mask) |
virtual unsigned | readGPIO (const std::string &bank) const |
virtual void | writeGPIODir (const std::string &bank, const unsigned dir) |
virtual void | writeGPIODir (const std::string &bank, const unsigned dir, const unsigned mask) |
virtual unsigned | readGPIODir (const std::string &bank) const |
virtual void | writeI2C (const int addr, const std::string &data) |
virtual std::string | readI2C (const int addr, const size_t numBytes) |
virtual unsigned | transactSPI (const int addr, const unsigned data, const size_t numBits) |
virtual std::vector< std::string > | listUARTs (void) const |
virtual void | writeUART (const std::string &which, const std::string &data) |
virtual std::string | readUART (const std::string &which, const long timeoutUs=100000) const |
virtual void * | getNativeDeviceHandle (void) const |
Static Public Member Functions | |
static KwargsList | enumerate (const Kwargs &args=Kwargs()) |
static KwargsList | enumerate (const std::string &args) |
static Device * | make (const Kwargs &args=Kwargs()) |
static Device * | make (const std::string &args) |
static void | unmake (Device *device) |
static std::vector< Device * > | make (const KwargsList &argsList) |
static std::vector< Device * > | make (const std::vector< std::string > &argsList) |
static void | unmake (const std::vector< Device * > &devices) |
Abstraction for an SDR tranceiver device - configuration and streaming.
|
virtual |
virtual destructor for inheritance
|
virtual |
Acquire direct buffers from a receive stream. This call is part of the direct buffer access API.
The buffs array will be filled with a stream pointer for each channel. Each pointer can be read up to the number of return value elements.
The handle will be set by the implementation so that the caller may later release access to the buffers with releaseReadBuffer(). Handle represents an index into the internal scatter/gather table such that handle is between 0 and num direct buffers - 1.
stream | the opaque pointer to a stream handle |
handle | an index value used in the release() call |
buffs | an array of void* buffers num chans in size |
flags | optional flag indicators about the result |
timeNs | the buffer's timestamp in nanoseconds |
timeoutUs | the timeout in microseconds |
|
virtual |
Acquire direct buffers from a transmit stream. This call is part of the direct buffer access API.
The buffs array will be filled with a stream pointer for each channel. Each pointer can be written up to the number of return value elements.
The handle will be set by the implementation so that the caller may later release access to the buffers with releaseWriteBuffer(). Handle represents an index into the internal scatter/gather table such that handle is between 0 and num direct buffers - 1.
stream | the opaque pointer to a stream handle |
handle | an index value used in the release() call |
buffs | an array of void* buffers num chans in size |
timeoutUs | the timeout in microseconds |
|
virtual |
Activate a stream. Call activate to prepare a stream before using read/write(). The implementation control switches or stimulate data flow.
The timeNs is only valid when the flags have SOAPY_SDR_HAS_TIME. The numElems count can be used to request a finite burst size. The SOAPY_SDR_END_BURST flag can signal end on the finite burst. Not all implementations will support the full range of options. In this case, the implementation returns SOAPY_SDR_NOT_SUPPORTED.
stream | the opaque pointer to a stream handle |
flags | optional flag indicators about the stream |
timeNs | optional activation time in nanoseconds |
numElems | optional element count for burst control |
|
virtual |
Close an open stream created by setupStream The implementation may change switches or power-down components.
stream | the opaque pointer to a stream handle |
|
virtual |
Deactivate a stream. Call deactivate when not using using read/write(). The implementation control switches or halt data flow.
The timeNs is only valid when the flags have SOAPY_SDR_HAS_TIME. Not all implementations will support the full range of options. In this case, the implementation returns SOAPY_SDR_NOT_SUPPORTED.
stream | the opaque pointer to a stream handle |
flags | optional flag indicators about the stream |
timeNs | optional deactivation time in nanoseconds |
|
static |
Enumerate a list of available devices on the system.
args | device construction key/value argument filters |
|
static |
Enumerate a list of available devices on the system. Markup format for args: "keyA=valA, keyB=valB".
args | a markup string of key/value argument filters |
|
virtual |
Get the selected antenna on a chain.
direction | the channel direction RX or TX |
channel | an available channel on the device |
|
virtual |
Get the baseband filter width of the chain.
direction | the channel direction RX or TX |
channel | an available channel on the device |
|
virtual |
Get the range of possible baseband filter widths.
direction | the channel direction RX or TX |
channel | an available channel on the device |
|
virtual |
Query a dictionary of available channel information. This dictionary can any number of values like decoder type, version, available functions... This information can be displayed to the user to help identify the instantiated channel.
direction | the channel direction RX or TX |
channel | an available channel on the device |
|
virtual |
Get the clock source of the device
|
virtual |
Get the frontend DC offset correction.
direction | the channel direction RX or TX |
channel | an available channel on the device |
|
virtual |
Get the automatic DC offset corrections mode.
direction | the channel direction RX or TX |
channel | an available channel on the device |
|
virtual |
Get the buffer addresses for a scatter/gather table entry. When the underlying DMA implementation uses scatter/gather then this call provides the user addresses for that table.
Example: The caller may query the DMA memory addresses once after stream creation to pre-allocate a re-usable ring-buffer.
stream | the opaque pointer to a stream handle |
handle | an index value between 0 and num direct buffers - 1 |
buffs | an array of void* buffers num chans in size |
|
virtual |
A key that uniquely identifies the device driver. This key identifies the underlying implementation. Serveral variants of a product may share a driver.
|
virtual |
Get the overall center frequency of the chain.
direction | the channel direction RX or TX |
channel | an available channel on the device |
|
virtual |
Get the frequency of a tunable element in the chain.
direction | the channel direction RX or TX |
channel | an available channel on the device |
name | the name of a tunable element |
|
virtual |
Query the argument info description for tune args.
direction | the channel direction RX or TX |
channel | an available channel on the device |
|
virtual |
Get the frontend frequency correction value.
direction | the channel direction RX or TX |
channel | an available channel on the device |
|
virtual |
Get the range of overall frequency values.
direction | the channel direction RX or TX |
channel | an available channel on the device |
|
virtual |
Get the range of tunable values for the specified element.
direction | the channel direction RX or TX |
channel | an available channel on the device |
name | the name of a tunable element |
|
virtual |
Get the mapping configuration string.
direction | the channel direction RX or TX |
|
virtual |
Find out if the specified channel is full or half duplex.
direction | the channel direction RX or TX |
channel | an available channel on the device |
|
virtual |
Get the overall value of the gain elements in a chain.
direction | the channel direction RX or TX |
channel | an available channel on the device |
|
virtual |
Get the value of an individual amplification element in a chain.
direction | the channel direction RX or TX |
channel | an available channel on the device |
name | the name of an amplification element |
|
virtual |
Get the automatic gain mode on the chain.
direction | the channel direction RX or TX |
channel | an available channel on the device |
|
virtual |
Get the overall range of possible gain values.
direction | the channel direction RX or TX |
channel | an available channel on the device |
|
virtual |
Get the range of possible gain values for a specific element.
direction | the channel direction RX or TX |
channel | an available channel on the device |
name | the name of an amplification element |
|
virtual |
Query a dictionary of available device information. This dictionary can any number of values like vendor name, product name, revisions, serials... This information can be displayed to the user to help identify the instantiated device.
|
virtual |
A key that uniquely identifies the hardware. This key should be meaningful to the user to optimize for the underlying hardware.
|
virtual |
Read the time from the hardware clock on the device. The what argument can refer to a specific time counter.
what | optional argument |
|
virtual |
Get the frontend IQ balance correction.
direction | the channel direction RX or TX |
channel | an available channel on the device |
|
virtual |
Set the automatic IQ balance corrections mode.
direction | the channel direction RX or TX |
channel | an available channel on the device |
|
virtual |
Get the master clock rate of the device.
|
virtual |
Get the range of available master clock rates.
|
virtual |
A handle to the native device used by the driver. The implementation may return a null value if it does not support or does not wish to provide access to the native handle.
|
virtual |
Get the hardware's native stream format for this channel. This is the format used by the underlying transport layer, and the direct buffer access API calls (when available).
direction | the channel direction RX or TX | |
channel | an available channel on the device | |
[out] | fullScale | the maximum possible value |
|
virtual |
Get a number of channels given the streaming direction
|
virtual |
How many direct access buffers can the stream provide? This is the number of times the user can call acquire() on a stream without making subsequent calls to release(). A return value of 0 means that direct access is not supported.
stream | the opaque pointer to a stream handle |
|
virtual |
Get the reference clock rate of the device.
|
virtual |
Get the range of available reference clock rates.
|
virtual |
Get the baseband sample rate of the chain.
direction | the channel direction RX or TX |
channel | an available channel on the device |
|
virtual |
Get the range of possible baseband sample rates.
direction | the channel direction RX or TX |
channel | an available channel on the device |
|
virtual |
Get meta-information about a channel sensor. Example: displayable name, type, range.
direction | the channel direction RX or TX |
channel | an available channel on the device |
key | the ID name of an available sensor |
|
virtual |
Get meta-information about a sensor. Example: displayable name, type, range.
key | the ID name of an available sensor |
|
virtual |
Describe the allowed keys and values used for channel settings.
direction | the channel direction RX or TX |
channel | an available channel on the device |
|
virtual |
Describe the allowed keys and values used for settings.
|
virtual |
Query the argument info description for stream args.
direction | the channel direction RX or TX |
channel | an available channel on the device |
|
virtual |
Query a list of the available stream formats.
direction | the channel direction RX or TX |
channel | an available channel on the device |
|
virtual |
Get the stream's maximum transmission unit (MTU) in number of elements. The MTU specifies the maximum payload transfer in a stream operation. This value can be used as a stream buffer allocation size that can best optimize throughput given the underlying stream implementation.
stream | the opaque pointer to a stream handle |
|
virtual |
Get the time source of the device
|
virtual |
Does the device support frontend DC offset correction?
direction | the channel direction RX or TX |
channel | an available channel on the device |
|
virtual |
Does the device support automatic DC offset corrections?
direction | the channel direction RX or TX |
channel | an available channel on the device |
|
virtual |
Does the device support frontend frequency correction?
direction | the channel direction RX or TX |
channel | an available channel on the device |
|
virtual |
Does the device support automatic gain control?
direction | the channel direction RX or TX |
channel | an available channel on the device |
|
virtual |
Does this device have a hardware clock?
what | optional argument |
|
virtual |
Does the device support frontend IQ balance correction?
direction | the channel direction RX or TX |
channel | an available channel on the device |
|
virtual |
Does the device support automatic frontend IQ balance correction?
direction | the channel direction RX or TX |
channel | an available channel on the device |
|
virtual |
Get a list of available antennas to select on a given chain.
direction | the channel direction RX or TX |
channel | an available channel on the device |
|
virtual |
Get the range of possible baseband filter widths.
direction | the channel direction RX or TX |
channel | an available channel on the device |
|
virtual |
Get the list of available clock sources.
|
virtual |
List available tunable elements in the chain. Elements should be in order RF to baseband.
direction | the channel direction RX or TX |
channel | an available channel |
|
virtual |
List available amplification elements. Elements should be in order RF to baseband.
direction | the channel direction RX or TX |
channel | an available channel |
|
virtual |
Get a list of available GPIO banks by name.
|
virtual |
Get a list of available register interfaces by name.
|
virtual |
Get the range of possible baseband sample rates.
direction | the channel direction RX or TX |
channel | an available channel on the device |
|
virtual |
List the available channel readback sensors. A sensor can represent a reference lock, RSSI, temperature.
direction | the channel direction RX or TX |
channel | an available channel on the device |
|
virtual |
List the available global readback sensors. A sensor can represent a reference lock, RSSI, temperature.
|
virtual |
Get the list of available time sources.
|
virtual |
Enumerate the available UART devices.
Make a new Device object given device construction args. The device pointer will be stored in a table so subsequent calls with the same arguments will produce the same device. For every call to make, there should be a matched call to unmake.
args | device construction key/value argument map |
|
static |
Create a list of devices from a list of construction arguments. This is a convenience call to parallelize device construction, and is fundamentally a parallel for loop of make(Kwargs).
argsList | a list of device arguments per each device |
|
static |
Make a new Device object given device construction args. The device pointer will be stored in a table so subsequent calls with the same arguments will produce the same device. For every call to make, there should be a matched call to unmake.
args | a markup string of key/value arguments |
|
static |
Create a list of devices from a list of construction arguments. This is a convenience call to parallelize device construction, and is fundamentally a parallel for loop of make(args).
argsList | a list of device arguments per each device |
|
virtual |
Readback the value of a GPIO bank.
bank | the name of an available bank |
|
virtual |
Read the data direction of a GPIO bank. 1 bits represent outputs, 0 bits represent inputs.
bank | the name of an available bank |
|
virtual |
Read from an available I2C slave. If the device contains multiple I2C masters, the address bits can encode which master.
addr | the address of the slave |
numBytes | the number of bytes to read |
|
virtual |
Read a register on the device given the interface name.
name | the name of a available register interface |
addr | the register address |
|
virtual |
Read a register on the device.
addr | the register address |
|
virtual |
Read a memory block on the device given the interface name.
name | the name of a available memory block interface |
addr | the memory block start address |
length | number of words to be read from memory block |
|
virtual |
Readback a channel sensor given the name. The value returned is a string which can represent a boolean ("true"/"false"), an integer, or float.
direction | the channel direction RX or TX |
channel | an available channel on the device |
key | the ID name of an available sensor |
Type SoapySDR::Device::readSensor | ( | const int | direction, |
const size_t | channel, | ||
const std::string & | key | ||
) | const |
Readback a channel sensor given the name.
Type | the return type for the sensor value |
direction | the channel direction RX or TX |
channel | an available channel on the device |
key | the ID name of an available sensor |
|
virtual |
Readback a global sensor given the name. The value returned is a string which can represent a boolean ("true"/"false"), an integer, or float.
key | the ID name of an available sensor |
Type SoapySDR::Device::readSensor | ( | const std::string & | key | ) | const |
Readback a global sensor given the name.
Type | the return type for the sensor value |
key | the ID name of an available sensor |
Type SoapySDR::Device::readSetting | ( | const int | direction, |
const size_t | channel, | ||
const std::string & | key | ||
) |
Read an arbitrary channel setting on the device.
Type | the return type for the sensor value |
direction | the channel direction RX or TX |
channel | an available channel on the device |
key | the setting identifier |
|
virtual |
Read an arbitrary channel setting on the device.
direction | the channel direction RX or TX |
channel | an available channel on the device |
key | the setting identifier |
Type SoapySDR::Device::readSetting | ( | const std::string & | key | ) |
Read an arbitrary setting on the device.
Type | the return type for the sensor value |
key | the setting identifier |
|
virtual |
Read an arbitrary setting on the device.
key | the setting identifier |
|
virtual |
Read elements from a stream for reception. This is a multi-channel call, and buffs should be an array of void *, where each pointer will be filled with data from a different channel.
Client code compatibility: The readStream() call should be well defined at all times, including prior to activation and after deactivation. When inactive, readStream() should implement the timeout specified by the caller and return SOAPY_SDR_TIMEOUT.
stream | the opaque pointer to a stream handle |
buffs | an array of void* buffers num chans in size |
numElems | the number of elements in each buffer |
flags | optional flag indicators about the result |
timeNs | the buffer's timestamp in nanoseconds |
timeoutUs | the timeout in microseconds |
|
virtual |
Readback status information about a stream. This call is typically used on a transmit stream to report time errors, underflows, and burst completion.
Client code compatibility: Client code may continually poll readStreamStatus() in a loop. Implementations of readStreamStatus() should wait in the call for a status change event or until the timeout expiration. When stream status is not implemented on a particular stream, readStreamStatus() should return SOAPY_SDR_NOT_SUPPORTED. Client code may use this indication to disable a polling loop.
stream | the opaque pointer to a stream handle |
chanMask | to which channels this status applies |
flags | optional input flags and output flags |
timeNs | the buffer's timestamp in nanoseconds |
timeoutUs | the timeout in microseconds |
|
virtual |
Read bytes from a UART until timeout or newline. Its up to the implementation to set the baud rate, carriage return settings, flushing on newline.
which | the name of an available UART |
timeoutUs | a timeout in microseconds |
|
virtual |
Release an acquired buffer back to the receive stream. This call is part of the direct buffer access API.
stream | the opaque pointer to a stream handle |
handle | the opaque handle from the acquire() call |
|
virtual |
Release an acquired buffer back to the transmit stream. This call is part of the direct buffer access API.
Stream meta-data is provided as part of the release call, and not the acquire call so that the caller may acquire buffers without committing to the contents of the meta-data, which can be determined by the user as the buffers are filled.
stream | the opaque pointer to a stream handle |
handle | the opaque handle from the acquire() call |
numElems | the number of elements written to each buffer |
flags | optional input flags and output flags |
timeNs | the buffer's timestamp in nanoseconds |
|
virtual |
Set the selected antenna on a chain.
direction | the channel direction RX or TX |
channel | an available channel on the device |
name | the name of an available antenna |
|
virtual |
Set the baseband filter width of the chain.
direction | the channel direction RX or TX |
channel | an available channel on the device |
bw | the baseband filter width in Hz |
|
virtual |
Set the clock source on the device
source | the name of a clock source |
|
virtual |
Set the time of subsequent configuration calls. The what argument can refer to a specific command queue. Implementations may use a time of 0 to clear.
timeNs | time in nanoseconds |
what | optional argument |
|
virtual |
Set the frontend DC offset correction.
direction | the channel direction RX or TX |
channel | an available channel on the device |
offset | the relative correction (1.0 max) |
|
virtual |
Set the automatic DC offset corrections mode.
direction | the channel direction RX or TX |
channel | an available channel on the device |
automatic | true for automatic offset correction |
|
virtual |
Set the center frequency of the chain.
The default implementation of setFrequency() will tune the "RF" component as close as possible to the requested center frequency. Tuning inaccuracies will be compensated for with the "BB" component.
The args can be used to augment the tuning algorithm.
direction | the channel direction RX or TX |
channel | an available channel on the device |
frequency | the center frequency in Hz |
args | optional tuner arguments |
|
virtual |
Tune the center frequency of the specified element.
Recommended names used to represent tunable components:
direction | the channel direction RX or TX |
channel | an available channel on the device |
name | the name of a tunable element |
frequency | the center frequency in Hz |
args | optional tuner arguments |
|
virtual |
Fine tune the frontend frequency correction.
direction | the channel direction RX or TX |
channel | an available channel on the device |
value | the correction in PPM |
|
virtual |
Set the frontend mapping of available DSP units to RF frontends. This mapping controls channel mapping and channel availability.
direction | the channel direction RX or TX |
mapping | a vendor-specific mapping string |
|
virtual |
Set the overall amplification in a chain. The gain will be distributed automatically across available element.
direction | the channel direction RX or TX |
channel | an available channel on the device |
value | the new amplification value in dB |
|
virtual |
Set the value of a amplification element in a chain.
direction | the channel direction RX or TX |
channel | an available channel on the device |
name | the name of an amplification element |
value | the new amplification value in dB |
|
virtual |
Set the automatic gain mode on the chain.
direction | the channel direction RX or TX |
channel | an available channel on the device |
automatic | true for automatic gain setting |
|
virtual |
Write the time to the hardware clock on the device. The what argument can refer to a specific time counter.
timeNs | time in nanoseconds |
what | optional argument |
|
virtual |
Set the frontend IQ balance correction.
direction | the channel direction RX or TX |
channel | an available channel on the device |
balance | the relative correction (1.0 max) |
|
virtual |
Set the automatic frontend IQ balance correction.
direction | the channel direction RX or TX |
channel | an available channel on the device |
automatic | true for automatic correction |
|
virtual |
Set the master clock rate of the device.
rate | the clock rate in Hz |
|
virtual |
Set the reference clock rate of the device.
rate | the clock rate in Hz |
|
virtual |
Set the baseband sample rate of the chain.
direction | the channel direction RX or TX |
channel | an available channel on the device |
rate | the sample rate in samples per second |
|
virtual |
Set the time source on the device
source | the name of a time source |
|
virtual |
Initialize a stream given a list of channels and stream arguments. The implementation may change switches or power-up components. All stream API calls should be usable with the new stream object after setupStream() is complete, regardless of the activity state.
The API allows any number of simultaneous TX and RX streams, but many dual-channel devices are limited to one stream in each direction, using either one or both channels. This call will throw an exception if an unsupported combination is requested, or if a requested channel in this direction is already in use by another stream.
When multiple channels are added to a stream, they are typically expected to have the same sample rate. See setSampleRate().
direction | the channel direction (SOAPY_SDR_RX or SOAPY_SDR_TX ) |
format | A string representing the desired buffer format in read/writeStream()
The first character selects the number type:
The type character is followed by the number of bits per number (complex is 2x this size per sample) Example format strings:
|
channels | a list of channels or empty for automatic. |
args | stream args or empty for defaults.
Recommended keys to use in the args dictionary:
|
The returned stream is not required to have internal locking, and may not be used concurrently from multiple threads.
|
virtual |
Perform a SPI transaction and return the result. Its up to the implementation to set the clock rate, and read edge, and the write edge of the SPI core. SPI slaves without a readback pin will return 0.
If the device contains multiple SPI masters, the address bits can encode which master.
addr | an address of an available SPI slave |
data | the SPI data, numBits-1 is first out |
numBits | the number of bits to clock out |
|
static |
Unmake or release a list of device handles. This is a convenience call to parallelize device destruction, and is fundamentally a parallel for loop of unmake(Device *).
devices | a list of pointers to device objects |
|
static |
Unmake or release a device object handle.
device | a pointer to a device object |
|
virtual |
Write the value of a GPIO bank.
bank | the name of an available bank |
value | an integer representing GPIO bits |
|
virtual |
Write the value of a GPIO bank with modification mask.
bank | the name of an available bank |
value | an integer representing GPIO bits |
mask | a modification mask where 1 = modify |
|
virtual |
Write the data direction of a GPIO bank. 1 bits represent outputs, 0 bits represent inputs.
bank | the name of an available bank |
dir | an integer representing data direction bits |
|
virtual |
Write the data direction of a GPIO bank with modification mask. 1 bits represent outputs, 0 bits represent inputs.
bank | the name of an available bank |
dir | an integer representing data direction bits |
mask | a modification mask where 1 = modify |
|
virtual |
Write to an available I2C slave. If the device contains multiple I2C masters, the address bits can encode which master.
addr | the address of the slave |
data | an array of bytes write out |
|
virtual |
Write a register on the device given the interface name. This can represent a register on a soft CPU, FPGA, IC; the interpretation is up the implementation to decide.
name | the name of a available register interface |
addr | the register address |
value | the register value |
|
virtual |
Write a register on the device. This can represent a register on a soft CPU, FPGA, IC; the interpretation is up the implementation to decide.
addr | the register address |
value | the register value |
|
virtual |
Write a memory block on the device given the interface name. This can represent a memory block on a soft CPU, FPGA, IC; the interpretation is up the implementation to decide.
name | the name of a available memory block interface |
addr | the memory block start address |
value | the memory block content |
|
virtual |
Write an arbitrary channel setting on the device. The interpretation is up the implementation.
direction | the channel direction RX or TX |
channel | an available channel on the device |
key | the setting identifier |
value | the setting value |
void SoapySDR::Device::writeSetting | ( | const int | direction, |
const size_t | channel, | ||
const std::string & | key, | ||
const Type & | value | ||
) |
Write an arbitrary channel setting on the device.
Type | the data type of the value |
direction | the channel direction RX or TX |
channel | an available channel on the device |
key | the setting identifier |
value | the setting value |
|
virtual |
Write an arbitrary setting on the device. The interpretation is up the implementation.
key | the setting identifier |
value | the setting value |
void SoapySDR::Device::writeSetting | ( | const std::string & | key, |
const Type & | value | ||
) |
Write a setting with an arbitrary value type.
Type | the data type of the value |
key | the setting identifier |
value | the setting value |
|
virtual |
Write elements to a stream for transmission. This is a multi-channel call, and buffs should be an array of void *, where each pointer will be filled with data for a different channel.
Client code compatibility: Client code relies on writeStream() for proper back-pressure. The writeStream() implementation must enforce the timeout such that the call blocks until space becomes available or timeout expiration.
stream | the opaque pointer to a stream handle |
buffs | an array of void* buffers num chans in size |
numElems | the number of elements in each buffer |
flags | optional input flags and output flags |
timeNs | the buffer's timestamp in nanoseconds |
timeoutUs | the timeout in microseconds |
|
virtual |
Write data to a UART device. Its up to the implementation to set the baud rate, carriage return settings, flushing on newline.
which | the name of an available UART |
data | an array of bytes to write out |