Documentation
¶
Overview ¶
Package pluto contains an sdr.Sdr implementation for the Analog Devices ADALM-PLUTO SDR.
Index ¶
- type CyclicTx
- type Options
- type Sdr
- func (s *Sdr) Close() error
- func (s *Sdr) GetCenterFrequency() (rf.Hz, error)
- func (s *Sdr) GetGain(sdr.GainStage) (float32, error)
- func (s *Sdr) GetGainStages() (sdr.GainStages, error)
- func (s *Sdr) GetSampleRate() (uint, error)
- func (s *Sdr) HardwareInfo() sdr.HardwareInfo
- func (p *Sdr) Loopback(ctx context.Context) (sdr.Reader, sdr.Writer, error)
- func (s *Sdr) SampleFormat() sdr.SampleFormat
- func (s *Sdr) SetAutomaticGain(autoGain bool) error
- func (s *Sdr) SetCenterFrequency(r rf.Hz) error
- func (s *Sdr) SetGain(gainStage sdr.GainStage, gain float32) error
- func (s *Sdr) SetLoopback(b bool) error
- func (s *Sdr) SetSampleRate(sps uint) error
- func (s *Sdr) StartCyclicTx(buf sdr.SamplesI16) (*CyclicTx, error)
- func (s *Sdr) StartRx() (sdr.ReadCloser, error)
- func (s *Sdr) StartTx() (sdr.WriteCloser, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CyclicTx ¶
type CyclicTx struct {
// contains filtered or unexported fields
}
CyclicTx will transmit a specific buffer in a loop. If the buffer is to be updated after the fact, be sure to invoke 'Push'.
func (*CyclicTx) Close ¶
Close will cancel the context, and then wait for the cleanup routine to close out any resources it's holding on to.
type Options ¶
type Options struct { // RxBufferLength defines the size of the buffer that is used to copy // samples into in the process of copying data out of the PlutoSDR. RxBufferLength int // TxBufferLength defines the size of the buffer that will be used to // copy samples into the process of writing data out of the PlutoSDR. TxBufferLength int // RxKernelBuffersCount controlls the number of kernelspace buffers that // are to be used for the rx channel. Leaving this at 0 will use the // iio default. RxKernelBuffersCount uint // TxKernelBuffersCount controlls the number of kernelspace buffers that // are to be used for the tx channel. Leaving this at 0 will use the // iio default. TxKernelBuffersCount uint // CheckOverruns will check to see if there's been an overrun when refilling // the IQ buffer. CheckOverruns bool }
Options are the tunable knobs that control the behavior of the PlutoSDR driver.
type Sdr ¶
type Sdr struct {
// contains filtered or unexported fields
}
Sdr is an interface to the underlying PlutoSDR endpoint. This will allow the user to interact with the Pluto as any other hz.tools/sdr.Sdr. This implements both the Receiver and Transmitter (Transceiver) interface.
func Open ¶
Open will create a PlutoSDR handle with the default set of options.
The endpoint string is the URI that would be passed to the iio* tools, such as ip:192.168.2.1, or ip:pluto3.hz.tools
func OpenWithOptions ¶
OpenWithOptions will establish a connection to a PlutoSDR, and return a handle to interact with that device. The endpoint string is the URI that would be passed to the iio* tools, such as ip:192.168.2.1, or ip:pluto3.hz.tools
func (*Sdr) GetCenterFrequency ¶
GetCenterFrequency implements the sdr.Sdr interface.
func (*Sdr) GetGainStages ¶
func (s *Sdr) GetGainStages() (sdr.GainStages, error)
GetGainStages implements the sdr.Sdr interface.
func (*Sdr) GetSampleRate ¶
GetSampleRate implements the sdr.Sdr interface.
func (*Sdr) HardwareInfo ¶
func (s *Sdr) HardwareInfo() sdr.HardwareInfo
HardwareInfo implements the sdr.Sdr interface
func (*Sdr) Loopback ¶
Loopback will enable Pluto's Loopback mode, and return a TX and RX stream to be used like an sdr.Pipe. This will put your IQ data through the signal path and into your RX channel.
Loopback mode is only disabled on context cancel. Please remember to cancel your context!
func (*Sdr) SampleFormat ¶
func (s *Sdr) SampleFormat() sdr.SampleFormat
SampleFormat implements the sdr.Sdr interface.
func (*Sdr) SetAutomaticGain ¶
SetAutomaticGain implements the sdr.Sdr interface.
func (*Sdr) SetCenterFrequency ¶
SetCenterFrequency implements the sdr.Sdr interface.
func (*Sdr) SetLoopback ¶
SetLoopback will set BIST Loopback to send TX data to the RX port.
func (*Sdr) SetSampleRate ¶
SetSampleRate implements the sdr.Sdr interface.
func (*Sdr) StartCyclicTx ¶
func (s *Sdr) StartCyclicTx(buf sdr.SamplesI16) (*CyclicTx, error)
StartCyclicTx allows for the creation of a cyclic transmit buffer, and to manage the updating of that buffer.