Struct maia_httpd::fpga::IpCore

source ·
pub struct IpCore { /* private fields */ }
Expand description

Maia SDR FPGA IP core.

This struct represents the FPGA IP core and gives access to its registers and DMA buffers.

Implementations§

source§

impl IpCore

source

pub async fn take() -> Result<(IpCore, InterruptHandler)>

Opens the FPGA IP core.

This function can only be run successfully once in the lifetime of the process. If this function has returned Ok previously, all subsequent calls will return Err. This ensures that there is only a single IpCore object in the program.

On success, the IpCore and the corresponding InterruptHandler are returned.

source

pub fn spectrometer_last_buffer(&self) -> usize

Gives the value of the last buffer register of the spectrometer.

This register indicates the index of the last buffer to which the spectrometer has written.

source

pub fn spectrometer_number_integrations(&self) -> u32

Gives the value of the number of integrations register of the spectrometer.

This register indicates how many FFTs are non-coherently accumulated by the spectrometer.

Note: IpCore caches in RAM the value of this register every time that it is updated, so calls to this function are very fast because the FPGA register doesn’t need to be accessed.

source

pub fn spectrometer_mode(&self) -> SpectrometerMode

Returns the current spectrometer mode.

This register indicates whether the spectrometer is running in average power mode or in peak detect mode.

Note: IpCore caches in RAM the value of this register every time that it is updated, so calls to this function are very fast because the FPGA register doesn’t need to be accessed.

source

pub fn set_spectrometer_number_integrations(&self, value: u32) -> Result<()>

Sets the value of the number of integrations register of the spectrometer.

See IpCore::spectrometer_number_integrations.

source

pub fn set_spectrometer_mode(&self, mode: SpectrometerMode)

Sets the spectrometer mode.

See IpCore::spectrometer_mode.

source

pub fn get_spectrometer_buffers(&mut self) -> impl Iterator<Item = &[u64]>

Returns the new buffers that have been written by the spectrometer.

This function returns an iterator that iterates over the buffers to which the spectrometter has written since the last call to get_spectrometer_buffers.

source

pub fn recorder_mode(&self) -> RecorderMode

Gives the value of the recorder mode register of the recorder.

This register is used to select 8-bit mode or 12-bit mode.

source

pub fn set_recorder_mode(&self, mode: RecorderMode)

Sets the value of the recorder mode register of the recorder.

See IpCore::recorder_mode.

source

pub fn recorder_start(&self)

Starts a recording.

The recording will end when the recording DMA buffer is exhausted or when IpCore::recorder_stop is called.

source

pub fn recorder_stop(&self)

Stops a recording.

This stops a currently running recording.

source

pub fn recorder_next_address(&self) -> usize

Gives the value of the next address register of the recorder.

This register indicates the next physical address to which the recorder would have written if it had not stopped. It can be used to calculate the size of the recording.

Trait Implementations§

source§

impl Debug for IpCore

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for IpCore

§

impl Send for IpCore

§

impl !Sync for IpCore

§

impl Unpin for IpCore

§

impl !UnwindSafe for IpCore

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> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

§

type Output = T

Should always be Self
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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more