Documentation ¶
Overview ¶
limedrv is a LMS7 API Wrapper to Go made to be easy to use. Currently this documentation is WIP. Some examples are available in _examples folder.
Index ¶
- Constants
- Variables
- func Close(device *LMSDevice)
- func ConvertC64toI16(dst []int16, src []complex64)
- func FastI16BufferIQConvert(data []byte) []complex64
- type DeviceInfo
- type LMSAntenna
- type LMSCallbackFuncTx
- type LMSChannel
- func (c *LMSChannel) Disable() *LMSChannel
- func (c *LMSChannel) DisableDigitalLPF() *LMSChannel
- func (c *LMSChannel) DisableLPF() *LMSChannel
- func (c *LMSChannel) Enable() *LMSChannel
- func (c *LMSChannel) EnableDigitalLPF() *LMSChannel
- func (c *LMSChannel) EnableLPF() *LMSChannel
- func (c *LMSChannel) GetCenterFrequency() float64
- func (c *LMSChannel) GetGainDB() uint
- func (c *LMSChannel) GetGainNormalized() float64
- func (c *LMSChannel) GetLPF() float64
- func (c *LMSChannel) SetAntenna(idx int) *LMSChannel
- func (c *LMSChannel) SetAntennaByName(name string) *LMSChannel
- func (c *LMSChannel) SetCenterFrequency(centerFrequency float64) *LMSChannel
- func (c *LMSChannel) SetDigitalLPF(bandwidth float64) *LMSChannel
- func (c *LMSChannel) SetGainDB(gain uint) *LMSChannel
- func (c *LMSChannel) SetGainNormalized(gain float64) *LMSChannel
- func (c *LMSChannel) SetLPF(bandwidth float64) *LMSChannel
- func (c *LMSChannel) String() string
- type LMSDevice
- func (d *LMSDevice) Close()
- func (d *LMSDevice) DisableChannel(channelNumber int, isRX bool)
- func (d *LMSDevice) DisableDigitalFilter(channelNumber int, isRX bool)
- func (d *LMSDevice) DisableLPF(channelNumber int, isRX bool)
- func (d *LMSDevice) EnableChannel(channelNumber int, isRX bool)
- func (d *LMSDevice) EnableDigitalFilter(channelNumber int, isRX bool)
- func (d *LMSDevice) EnableLPF(channelNumber int, isRX bool)
- func (d *LMSDevice) GetCenterFrequency(channelNumber int, isRX bool) (centerFrequency float64)
- func (d *LMSDevice) GetGainDB(channelNumber int, isRX bool) (gain uint)
- func (d *LMSDevice) GetGainNormalized(channelNumber int, isRX bool) (gain float64)
- func (d *LMSDevice) GetLPF(channelNumber int, isRX bool) (bandwidth float64)
- func (d *LMSDevice) GetSampleRate() (host float64, rf float64)
- func (d *LMSDevice) GetTemperature() (temp float64)
- func (d *LMSDevice) IsRunning() bool
- func (d *LMSDevice) SetAntenna(antennaNumber, channelNumber int, isRX bool)
- func (d *LMSDevice) SetAntennaByName(name string, channelNumber int, isRX bool)
- func (d *LMSDevice) SetCallback(cb func([]complex64, int, uint64))
- func (d *LMSDevice) SetCenterFrequency(channelNumber int, isRX bool, centerFrequency float64)
- func (d *LMSDevice) SetDigitalFilter(channelNumber int, isRX bool, bandwidth float64)
- func (d *LMSDevice) SetGainDB(channelNumber int, isRX bool, gain uint)
- func (d *LMSDevice) SetGainNormalized(channelNumber int, isRX bool, gain float64)
- func (d *LMSDevice) SetLPF(channelNumber int, isRX bool, bandwidth float64)
- func (d *LMSDevice) SetSampleRate(sampleRate float64, oversample int)
- func (d *LMSDevice) SetTXCallback(cb func([]complex64, int) int)
- func (d *LMSDevice) Start()
- func (d *LMSDevice) Stop()
- func (d *LMSDevice) String() string
- type LMSDeviceAdvanced
Constants ¶
const ( // ChannelA represents the ID of Channel A in LMS Devices ( = 0 ) ChannelA = 0 // ChannelB represents the ID of Channel B in LMS Devices ( = 1 ) ChannelB = 1 )
Preset of channel IDs by name. To be used in channel calls.
const ( // RX Antennas LNAW = "LNAW" LNAH = "LNAH" LNAL = "LNAL" // Loopback Antennas (works for both RX and TX) LB1 = "LB1" LB2 = "LB2" // TX Antennas BAND1 = "BAND1" BAND2 = "BAND2" // Not connected NONE = "NONE" )
Preset of Antenna Names to be used in SetAntennaByName
Variables ¶
var ( // FormatFloat32 defines the output of LMS Device to have samples using 32 bit float FormatFloat32 = limewrap.Lms_stream_tLMS_FMT_F32 // FormatInt16 defines the output of LMS Device to have samples using 16 bit int FormatInt16 = limewrap.Lms_stream_tLMS_FMT_I16 // FormatInt12 defines the output of LMS Device to have samples using 12 bit int FormatInt12 = limewrap.Lms_stream_tLMS_FMT_I12 )
IQ Formats to be set in IQFormat of LMSDevice. This sets the communication between the LMS Device and the computer.
Functions ¶
func Close ¶
func Close(device *LMSDevice)
Close closes a LMSDevice. This makes the LMSDevice instance useless.
func ConvertC64toI16 ¶
func FastI16BufferIQConvert ¶
Types ¶
type DeviceInfo ¶
type DeviceInfo struct { DeviceName string Media string Module string Addr string Serial string ProtocolVersion string FirmwareVersion string HardwareVersion string GatewareVersion string GatewareTargetBoard string // contains filtered or unexported fields }
DeviceInfo is a struct with driver information required to open a connection
func GetDevices ¶
func GetDevices() []DeviceInfo
GetDevices return an array of available devices in the LMS7 driver.
type LMSAntenna ¶
type LMSAntenna struct { Name string Channel int MinimumFrequency float64 MaximumFrequency float64 Step float64 // contains filtered or unexported fields }
LMSAntenna is a struct that represents the Antenna Port information
func (*LMSAntenna) Set ¶
func (a *LMSAntenna) Set()
Set sets this antenna port as the default in parent channel
func (*LMSAntenna) String ¶
func (a *LMSAntenna) String() string
String returns a representation of the antenna port data
type LMSCallbackFuncTx ¶
type LMSChannel ¶
type LMSChannel struct { Antennas []LMSAntenna IsRX bool // contains filtered or unexported fields }
LMSChannel is the struct that represents a Channel from a LMSDevice. It can be either a RX or TX Channel, defined by the field IsRX. It also contains the list of available antenna ports.
func (*LMSChannel) Disable ¶
func (c *LMSChannel) Disable() *LMSChannel
Disable disables this channel from the read / write callback
func (*LMSChannel) DisableDigitalLPF ¶
func (c *LMSChannel) DisableDigitalLPF() *LMSChannel
DisableDigitalLPF disables current channel digital filter (GFIR)
func (*LMSChannel) DisableLPF ¶
func (c *LMSChannel) DisableLPF() *LMSChannel
DisableLPF disables the Analog Low Pass filter for the current channel.
func (*LMSChannel) Enable ¶
func (c *LMSChannel) Enable() *LMSChannel
Enable enables this channel from the read / write callback
func (*LMSChannel) EnableDigitalLPF ¶
func (c *LMSChannel) EnableDigitalLPF() *LMSChannel
EnableDigitalLPF enables current channel digital filter (GFIR)
func (*LMSChannel) EnableLPF ¶
func (c *LMSChannel) EnableLPF() *LMSChannel
EnableLPF enables the Analog Low Pass filter for the current channel.
func (*LMSChannel) GetCenterFrequency ¶
func (c *LMSChannel) GetCenterFrequency() float64
GetCenterFrequency returns the current channel center frequency in hertz.
func (*LMSChannel) GetGainDB ¶
func (c *LMSChannel) GetGainDB() uint
GetGainDB returns the channel current gain in decibels
func (*LMSChannel) GetGainNormalized ¶
func (c *LMSChannel) GetGainNormalized() float64
GetGainNormalized returns the channel current normalized gain. [0-1]
func (*LMSChannel) GetLPF ¶
func (c *LMSChannel) GetLPF() float64
GetLPF gets the current Analog Low Pass filter bandwidth for the current channel.
func (*LMSChannel) SetAntenna ¶
func (c *LMSChannel) SetAntenna(idx int) *LMSChannel
SetAntenna sets the current channel antenna port
func (*LMSChannel) SetAntennaByName ¶
func (c *LMSChannel) SetAntennaByName(name string) *LMSChannel
SetAntennaByName sets the current channel antenna port by name. Example: LNAW
func (*LMSChannel) SetCenterFrequency ¶
func (c *LMSChannel) SetCenterFrequency(centerFrequency float64) *LMSChannel
SetCenterFrequency sets the current channel center frequency in hertz.
func (*LMSChannel) SetDigitalLPF ¶
func (c *LMSChannel) SetDigitalLPF(bandwidth float64) *LMSChannel
SetDigitalLPF sets the current channel digital filter (GFIR) to low pass with specified bandwidth.
func (*LMSChannel) SetGainDB ¶
func (c *LMSChannel) SetGainDB(gain uint) *LMSChannel
SetGainDB sets this channel gain in decibels
func (*LMSChannel) SetGainNormalized ¶
func (c *LMSChannel) SetGainNormalized(gain float64) *LMSChannel
SetGainNormalized sets the channel normalized gain. [0-1]
func (*LMSChannel) SetLPF ¶
func (c *LMSChannel) SetLPF(bandwidth float64) *LMSChannel
SetLPF sets the Analog Low Pass filter bandwidth for the current channel.
func (*LMSChannel) String ¶
func (c *LMSChannel) String() string
String returns a representation of the channel
type LMSDevice ¶
type LMSDevice struct { // DeviceInfo contains all Device Information Provided by the API DeviceInfo DeviceInfo // RXChannels represents all Receive Channels RXChannels []*LMSChannel // TXChannels represents all Transmit Channels TXChannels []*LMSChannel // MinimumSampleRate represents the minimum supported sample rate by the device in Hertz MinimumSampleRate float64 // MaximumSampleRate represents the minimum supported sample rate by the device in Hertz MaximumSampleRate float64 // IQFormat of the output data from the device. Defaults to FormatInt16. // Notice that the callback from LMSDevice always returns complex64 which is converted internally by limedrv. // This IQFormat only specifies what the driver receives from the device itself, reducing bus bandwidth. IQFormat int // RXLPFMaxFrequency is the maximum Analog Low Pass Filter Frequency Suported by the Receive Channels in Hertz RXLPFMaxFrequency float64 // RXLPFMinFrequency is the minimum Analog Low Pass Filter Frequency Suported by the Receive Channels in Hertz RXLPFMinFrequency float64 // TXLPFMaxFrequency is the maximum Analog Low Pass Filter Frequency Suported by the Transmit Channels in Hertz TXLPFMaxFrequency float64 // TXLPFMinFrequency is the minimum Analog Low Pass Filter Frequency Suported by the Transmit Channels in Hertz TXLPFMinFrequency float64 // Advanced is the object for advanced manipulation of the LMS Device itself. Use with care. Advanced LMSDeviceAdvanced // contains filtered or unexported fields }
LMSDevice is a class representing a Open LimeSDR Device. Use limedrv.Open function to create an instance
func Open ¶
func Open(device DeviceInfo) *LMSDevice
Open opens a device specified by a DeviceInfo instance and returns a reference to LMSDevice
func (*LMSDevice) Close ¶
func (d *LMSDevice) Close()
Close closes the device connection with the hardware. This instance will be unusable after this call.
func (*LMSDevice) DisableChannel ¶
DisableChannel disables a channel to be received in callback
func (*LMSDevice) DisableDigitalFilter ¶
DisableDigitalFilter disables digital (GFIR) Low Pass filter for specified channel.
func (*LMSDevice) DisableLPF ¶
DisableLPF disables the Analog Low Pass filter in the specified channel
func (*LMSDevice) EnableChannel ¶
EnableChannel enables a channel to be received in callback
func (*LMSDevice) EnableDigitalFilter ¶
EnableDigitalFilter enables the digital (GFIR) Low pass filter for specified channel.
func (*LMSDevice) GetCenterFrequency ¶
GetCenterFrequency gets the center frequency currently set in the channel.
func (*LMSDevice) GetGainNormalized ¶
GetGainNormalized returns the currently set gain in specified channel
func (*LMSDevice) GetSampleRate ¶
GetSampleRate returns both host sample rate and rf sample rate (defined by oversample) If a SetSampleRate has been called with samplerate of 1e6 and overSample of 8, This call will return 1e6 in host and 8e6 in rf.
func (*LMSDevice) GetTemperature ¶
GetTemperature returns the temperature in degrees celsius of the LMS Device
func (*LMSDevice) SetAntenna ¶
SetAntenna sets the input antenna for the specified channel.
func (*LMSDevice) SetAntennaByName ¶
SetAntennaByName sets the input antenna for the specified channel by using its representation name, for example LNAW
func (*LMSDevice) SetCallback ¶
endregion region Public Methods SetCallback sets the callback for samples.
func (*LMSDevice) SetCenterFrequency ¶
SetCenterFrequency sets the center frequency of the channel in Hertz. Although two channels can have two different center frequencies, they share the same LO, because of that some hardware tricks are done to be able to work at different frequencies leading to a certain limit of how spaced these two channels can be.
func (*LMSDevice) SetDigitalFilter ¶
SetDigitalFilter sets the Digital (GFIR) Low Pass filter frequency for the specified channel. bandwidth in hertz Requires Sample Rate to be set before calling this.
func (*LMSDevice) SetGainNormalized ¶
SetGainNormalized sets the gain of the channel to specified normalized value [0-1] with 0 being no gain, 1 being maximum gain.
func (*LMSDevice) SetLPF ¶
SetLPF sets the analog Low Pass Filter bandwidth for the specified channel. bandwidth is passed in Hertz
func (*LMSDevice) SetSampleRate ¶
SetSampleRate sets the sampleRate for specified value. oversample sets the over sampling done in hardware. for example if you set 1e6 for the sample rate and a oversample to 8, the limesdr hardware will run at 8e6 sps and decimate by 8 before sending to the FPGA this way you can increase the resolution without affecting the bandwidth to the computer
func (*LMSDevice) SetTXCallback ¶
SetTXCallback sets the callback to be called when any TX Channel needs samples
type LMSDeviceAdvanced ¶
type LMSDeviceAdvanced struct {
// contains filtered or unexported fields
}
LMSDeviceAdvanced is a dummy structure just to separated the methods considered for "Advanced Usage" It does not have any data besides the methods to allow advanced settings of LMSDevice object.
func (*LMSDeviceAdvanced) DisableGFir ¶
func (d *LMSDeviceAdvanced) DisableGFir(gFirIdx, channelNumber int, isRX bool)
DisableGFIR disables a manually set GFIR Taps in the channel
func (*LMSDeviceAdvanced) EnableGFir ¶
func (d *LMSDeviceAdvanced) EnableGFir(gFirIdx, channelNumber int, isRX bool)
EnableGFIR enables a manually set GFIR Taps in the channel
func (*LMSDeviceAdvanced) SetDigitalFilterTaps ¶
func (d *LMSDeviceAdvanced) SetDigitalFilterTaps(gFirIdx, channelNumber int, isRX bool, taps []float64)
SetDigitalFilterTaps allows to manually set the GFIR digital filter taps from a channel. For enabling / disabling the GFIR when setting manual taps please use EnableGFIR / DisableGFIR in Advanced Section