pub struct PounderDevices { /* private fields */ }
Expand description

A structure containing implementation for Pounder hardware.

Implementations§

source§

impl PounderDevices

source

pub fn new( i2c: I2c1Proxy, attenuator_spi: Spi<SPI1, Enabled, u8>, pwr: (AdcChannel<'static, ADC1, PF11<Analog>>, AdcChannel<'static, ADC2, PF14<Analog>>), aux_adc: (AdcChannel<'static, ADC3, PF3<Analog>>, AdcChannel<'static, ADC3, PF4<Analog>>) ) -> Result<Self, Error>

Construct and initialize pounder-specific hardware.

Args:

  • i2c - A Proxy to I2C1.
  • attenuator_spi - A SPI interface to control digital attenuators.
  • pwr - The ADC channels to measure the IN0/1 input power.
  • aux_adc - The ADC channels to measure the ADC0/1 auxiliary input.
source

pub fn sample_aux_adc(&mut self, channel: Channel) -> Result<f32, Error>

Sample one of the two auxiliary ADC channels associated with the respective RF input channel.

source

pub fn set_ext_clk(&mut self, enabled: bool) -> Result<(), Error>

Select external reference clock input.

source

pub fn reset_dds(&mut self) -> Result<(), Error>

Reset the DDS via the GPIO extender (Pounder v1.2 and later)

source

pub fn temperature(&mut self) -> Result<f32, Error>

Read the temperature reported by the LM75 temperature sensor on Pounder in deg C.

Trait Implementations§

source§

impl AttenuatorInterface for PounderDevices

source§

fn reset_attenuators(&mut self) -> Result<(), Error>

Reset all of the attenuators to a power-on default state.

source§

fn latch_attenuator(&mut self, channel: Channel) -> Result<(), Error>

Latch a configuration into a digital attenuator.

Args:

  • channel - The attenuator channel to latch.
source§

fn transfer_attenuators(&mut self, channels: &mut [u8; 4]) -> Result<(), Error>

Read the raw attenuation codes stored in the attenuator shift registers.

Args:

  • channels - A 4 byte slice to be shifted into the attenuators and to contain the data shifted out.
source§

fn set_attenuation( &mut self, channel: Channel, attenuation: f32 ) -> Result<f32, Error>

Set the attenuation of a single channel. Read more
source§

fn get_attenuation(&mut self, channel: Channel) -> Result<f32, Error>

Get the attenuation of a channel. Read more
source§

fn validate(attenuation: f32) -> Result<f32, Error>

source§

impl PowerMeasurementInterface for PounderDevices

source§

fn sample_converter(&mut self, channel: Channel) -> Result<f32, Error>

Sample an ADC channel.

Args:

  • channel - The channel to sample.

Returns: The sampled voltage of the specified channel.

source§

fn measure_power(&mut self, channel: Channel) -> Result<f32, Error>

Measure the power of an input channel in dBm. Read more

Auto Trait Implementations§

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>,

§

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>,

§

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.