Struct airspy::Airspy
[−]
[src]
pub struct Airspy { // some fields omitted }
Store a reference to an opened Airspy device.
Methods
impl Airspy
[src]
fn new() -> Result<Airspy>
Try to open the next available Airspy device.
fn from_serial(serial_number: u64) -> Result<Airspy>
Try to open a specific Airspy device by serial number.
fn get_sample_rates(&mut self) -> Result<Vec<u32>>
Get available sample rates for this Airspy.
fn set_sample_rate_by_idx(&mut self, rate_idx: u32) -> Result<()>
Set this Airspy's sample rate by an index into available rates.
rate_idx
is an index from the Vector returned by get_sample_rates
.
fn set_sample_rate(&mut self, target_rate: u32) -> Result<()>
Set this Airspy's sample rate to a specific rate.
This rate must be in the available rates or an error is returned.
fn start_rx<T>(&mut self, sender: Sender<Vec<T>>) -> Result<()> where T: Clone
Start RX streaming from the Airspy.
The given channel will be sent Vec
T must match with whatever was set for SampleType, and must be one of f32, i16 or u16.
fn stop_rx(&mut self) -> Result<()>
Stop the Airspy streaming.
Causes the Sender from start_rx to leak. Consider destroying the Receiver half instead, which will also trigger libairspy to stop sending samples, but does not leak.
fn is_streaming(&mut self) -> bool
Check if the Airspy is currently streaming.
fn si5351c_write(&mut self, register: u8, value: u8) -> Result<()>
Write a register on the Si5351C
fn si5351c_read(&mut self, register: u8) -> Result<u8>
Read a register on the Si5351C
fn r820t_write(&mut self, register: u8, value: u8) -> Result<()>
Write a register on the R820t
fn r820t_read(&mut self, register: u8) -> Result<u8>
Read a register on the R820t
fn gpio_write(&mut self, port: GPIOPort, pin: GPIOPin, val: bool) -> Result<()>
Write a GPIO port:pin to val
, false to clear or true to set.
fn gpio_read(&mut self, port: GPIOPort, pin: GPIOPin) -> Result<bool>
Read a GPIO port:pin
fn gpio_set_direction(&mut self, port: GPIOPort, pin: GPIOPin, dir: GPIODirection) -> Result<()>
Set a GPIO port:pin direction.
fn gpio_get_direction(&mut self, port: GPIOPort, pin: GPIOPin) -> Result<GPIODirection>
Get a GPIO port:pin direction.
fn get_board_id(&mut self) -> Result<&str>
Get the Airspy board type.
fn get_version(&mut self) -> Result<String>
Get the Airspy firmware version number.
fn get_partid_serial(&mut self) -> Result<PartID>
Get the Airspy part ID and serial number.
fn set_sample_type(&mut self, stype: SampleType) -> Result<()>
Set sample type for data from this Airspy.
fn set_freq(&mut self, freq: u32) -> Result<()>
Set Airspy centre frequency, freq
24000000 to 1750000000 (in Hz)
fn set_lna_gain(&mut self, gain: u8) -> Result<()>
Set LNA gain, 0 to 15dB
fn set_mixer_gain(&mut self, gain: u8) -> Result<()>
Set mixer gain, 0 to 15dB
fn set_vga_gain(&mut self, gain: u8) -> Result<()>
Set VGA gain, 0 to 15dB
fn set_lna_agc(&mut self, enable: bool) -> Result<()>
Enable/disable LNA AGC
fn set_mixer_agc(&mut self, enable: bool) -> Result<()>
Enable/disable mixer AGC
fn set_rf_bias(&mut self, enable: bool) -> Result<()>
Enable/disable RF bias voltage
fn set_packing(&mut self, _enable: bool) -> Result<()>
Enable/disable USB sample packing NB: Not yet enabled as changes between shipping Ubuntu library and latest development library.
Trait Implementations
impl Drop for Airspy
[src]
Ensure whenever the Airspy goes out of scope it is closed.