Struct AvrTester

Source
pub struct AvrTester { /* private fields */ }
Expand description

The Tester; use AvrTester::atmega328p() etc. to construct it.

Implementations§

Source§

impl AvrTester

Source

pub fn run(&mut self) -> AvrDuration

Runs a full single instruction, returning the number of cycles it took to execute that instruction (e.g. MUL takes two cycles or so).

Note that the number returned here is somewhat approximate (see AvrDuration), but it’s guaranteed to be at least one cycle.

See also:

Source

pub fn run_for(&mut self, n: impl IntoCycles)

Runs firmware for given number of cycles (when given u64) or given AvrDuration.

See also:

Source

pub fn run_for_us(&mut self, n: u64)

Runs firmware for given number of AVR microseconds, considering the clock specified through AvrTesterBuilder::with_clock().

See:

See also: Self::run().

Source

pub fn run_for_ms(&mut self, n: u64)

Runs firmware for given number of AVR milliseconds, considering the clock specified through AvrTesterBuilder::with_clock().

See:

See also: Self::run().

Source

pub fn run_for_s(&mut self, n: u64)

Runs firmware for given number of AVR seconds, considering the clock specified through AvrTesterBuilder::with_clock().

See:

See also: Self::run().

Source

pub fn pins(&mut self) -> Pins<'_>

Returns an object providing access to the analog and digital pins, such as ADC1, PD4 etc.

Note that the returned object contains all possible pins for all of the existing AVRs, while the AVR of yours probably supports only a subset of those pins - trying to access a pin that does not exist for your AVR will panic.

Source

pub fn spi0(&mut self) -> Spi<'_>

Returns an object providing access to SPI0 (i.e. the default one).

Note that if your AVR doesn’t have SPI0, operating on it will panic.

Source

pub fn spi1(&mut self) -> Spi<'_>

Returns an object providing access to SPI1.

Note that if your AVR doesn’t have SPI1, operating on it will panic.

Source

pub fn twi0(&mut self) -> Twi<'_>

Returns an object providing access to TWI0 (i.e. the default one), also known as I2C.

Note that if your AVR doesn’t have TWI0, operating on it will panic.

Source

pub fn twi1(&mut self) -> Twi<'_>

Returns an object providing access to TWI1.

Note that if your AVR doesn’t have TWI1, operating on it will panic.

Source

pub fn uart0(&mut self) -> Uart<'_>

Returns an object providing access to UART0 (i.e. the default one).

Note that if your AVR doesn’t have UART0, operating on it will panic.

Source

pub fn uart1(&mut self) -> Uart<'_>

Returns an object providing access to UART1.

Note that if your AVR doesn’t have UART1, operating on it will panic.

Source

pub fn components(&mut self) -> &mut Components

Returns an object providing acccess to components (aka peripherals) attached to the AVR.

Source§

impl AvrTester

Source

pub fn atmega8() -> AvrTesterBuilder

Source

pub fn atmega81() -> AvrTesterBuilder

Source

pub fn atmega16() -> AvrTesterBuilder

Source

pub fn atmega16m1() -> AvrTesterBuilder

Source

pub fn atmega32() -> AvrTesterBuilder

Source

pub fn atmega32u4() -> AvrTesterBuilder

Source

pub fn atmega48() -> AvrTesterBuilder

Source

pub fn atmega48p() -> AvrTesterBuilder

Source

pub fn atmega48pa() -> AvrTesterBuilder

Source

pub fn atmega64m1() -> AvrTesterBuilder

Source

pub fn atmega88() -> AvrTesterBuilder

Source

pub fn atmega88p() -> AvrTesterBuilder

Source

pub fn atmega88pa() -> AvrTesterBuilder

Source

pub fn atmega128() -> AvrTesterBuilder

Source

pub fn atmega128l() -> AvrTesterBuilder

Source

pub fn atmega128rfa1() -> AvrTesterBuilder

Source

pub fn atmega128rfr2() -> AvrTesterBuilder

Source

pub fn atmega164() -> AvrTesterBuilder

Source

pub fn atmega164p() -> AvrTesterBuilder

Source

pub fn atmega164pa() -> AvrTesterBuilder

Source

pub fn atmega168() -> AvrTesterBuilder

Source

pub fn atmega168p() -> AvrTesterBuilder

Source

pub fn atmega168pa() -> AvrTesterBuilder

Source

pub fn atmega169p() -> AvrTesterBuilder

Source

pub fn atmega324() -> AvrTesterBuilder

Source

pub fn atmega324p() -> AvrTesterBuilder

Source

pub fn atmega324a() -> AvrTesterBuilder

Source

pub fn atmega324pa() -> AvrTesterBuilder

Source

pub fn atmega328() -> AvrTesterBuilder

Source

pub fn atmega328p() -> AvrTesterBuilder

Source

pub fn atmega328pb() -> AvrTesterBuilder

Source

pub fn atmega644() -> AvrTesterBuilder

Source

pub fn atmega644p() -> AvrTesterBuilder

Source

pub fn atmega1280() -> AvrTesterBuilder

Source

pub fn atmega1281() -> AvrTesterBuilder

Source

pub fn atmega1284p() -> AvrTesterBuilder

Source

pub fn atmega1284() -> AvrTesterBuilder

Source

pub fn atmega2560() -> AvrTesterBuilder

Source

pub fn atmega2561() -> AvrTesterBuilder

Source

pub fn attiny13() -> AvrTesterBuilder

Source

pub fn attiny13a() -> AvrTesterBuilder

Source

pub fn attiny24() -> AvrTesterBuilder

Source

pub fn attiny25() -> AvrTesterBuilder

Source

pub fn attiny44() -> AvrTesterBuilder

Source

pub fn attiny45() -> AvrTesterBuilder

Source

pub fn attiny84() -> AvrTesterBuilder

Source

pub fn attiny85() -> AvrTesterBuilder

Source

pub fn attiny2313() -> AvrTesterBuilder

Source

pub fn attiny2313v() -> AvrTesterBuilder

Source

pub fn attiny2313a() -> AvrTesterBuilder

Source

pub fn attiny4313() -> AvrTesterBuilder

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

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.