pub struct AvrTester { /* private fields */ }
Expand description
The Tester; use AvrTester::atmega328p()
etc. to construct it.
Implementations§
Source§impl AvrTester
impl AvrTester
Sourcepub fn run(&mut self) -> AvrDuration
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:
Sourcepub fn run_for(&mut self, n: impl IntoCycles)
pub fn run_for(&mut self, n: impl IntoCycles)
Runs firmware for given number of cycles (when given u64
) or given
AvrDuration
.
See also:
Sourcepub fn run_for_us(&mut self, n: u64)
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()
.
Sourcepub fn run_for_ms(&mut self, n: u64)
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()
.
Sourcepub fn run_for_s(&mut self, n: u64)
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()
.
Sourcepub fn pins(&mut self) -> Pins<'_>
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.
Sourcepub fn spi0(&mut self) -> Spi<'_>
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.
Sourcepub fn spi1(&mut self) -> Spi<'_>
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.
Sourcepub fn twi0(&mut self) -> Twi<'_>
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.
Sourcepub fn twi1(&mut self) -> Twi<'_>
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.
Sourcepub fn uart0(&mut self) -> Uart<'_>
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.
Sourcepub fn uart1(&mut self) -> Uart<'_>
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.
Sourcepub fn components(&mut self) -> &mut Components
pub fn components(&mut self) -> &mut Components
Returns an object providing acccess to components (aka peripherals) attached to the AVR.