Config

Struct Config 

Source
pub struct Config {
    pub vga_db: u16,
    pub txvga_db: u16,
    pub lna_db: u16,
    pub amp_enable: bool,
    pub antenna_enable: bool,
    pub frequency_hz: u64,
    pub sample_rate_hz: u32,
    pub sample_rate_div: u32,
}
Expand description

Configurable parameters on the hackrf

Fields§

§vga_db: u16

Baseband gain, 0-62dB in 2dB increments (rx only)

§txvga_db: u16

0 - 47 dB in 1dB increments (tx only)

§lna_db: u16

Low-noise amplifier gain, in 0-40dB in 8dB increments (rx only)

§amp_enable: bool

RF amplifier (on/off)

§antenna_enable: bool

Antenna power port control

§frequency_hz: u64

Frequency in hz

§sample_rate_hz: u32

Sample rate in Hz.

§sample_rate_div: u32

Sample rate divider.

Implementations§

Source§

impl Config

Source

pub fn tx_default() -> Self

Returns the default configuration for transmitting.

Source

pub fn rx_default() -> Self

Returns the default configuration for receiving.

Trait Implementations§

Source§

impl Debug for Config

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Config

§

impl RefUnwindSafe for Config

§

impl Send for Config

§

impl Sync for Config

§

impl Unpin for Config

§

impl UnwindSafe for Config

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.