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

Timing configuration for reading or writing

A Timing object can be created using Timing::default() or Default::default().

The default timing uses access mode C and the slowest possible timings, for maximum compatibility.

If the LCD controller and wiring allow, you can reduce the times to make transactions faster.

All time fields are in units of HCLK cycles.

Implementations§

source§

impl Timing

source

pub const BUS_TURNAROUND_MAX: u8 = 15u8

Maximum allowed value of the bus turnaround time

source

pub const DATA_MIN: u8 = 1u8

Minimum allowed value of the data phase time

source

pub const ADDRESS_HOLD_MIN: u8 = 1u8

Maximum allowed value of the address hold time

source

pub const ADDRESS_HOLD_MAX: u8 = 15u8

Maximum allowed value of the address hold time

source

pub const ADDRESS_SETUP_MAX: u8 = 15u8

Maximum allowed value of the address setup time

source

pub fn access_mode(self, access_mode: AccessMode) -> Self

Sets the access mode

source

pub fn bus_turnaround(self, bus_turnaround: u8) -> Self

Sets the bus turnaround time, in units of HCLK cycles

This corresponds to the BUSTURN field of FSMC_BTR or FSMC_BWTR.

Panics

This function panics if bus_turnaround is greater than Timing::BUS_TURNAROUND_MAX.

source

pub fn data(self, data: u8) -> Self

Sets the data phase time, in units of HCLK cycles

This corresponds to the DATAST field of FSMC_BTR or FSMC_BWTR.

Panics

This function panics if data is less than Timing::DATA_MIN.

source

pub fn address_hold(self, address_hold: u8) -> Self

Sets the address hold phase time, in units of HCLK cycles

This corresponds to the ADDHLD field of FSMC_BTR or FSMC_BWTR.

Panics

This function panics if address_hold is less than Timing::ADDRESS_HOLD_MIN or greater than Timing::ADDRESS_HOLD_MAX.

source

pub fn address_setup(self, address_setup: u8) -> Self

Sets the address setup phase time, in units of HCLK cycles

This corresponds to the ADDSET field of FSMC_BTR or FSMC_BWTR.

Panics

This function panics if address_setup is greater than Timing::ADDRESS_SETUP_MAX.

Trait Implementations§

source§

impl Clone for Timing

source§

fn clone(&self) -> Timing

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Timing

source§

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

Formats the value using the given formatter. Read more
source§

impl Default for Timing

source§

fn default() -> Self

Returns a conservative (slow) timing configuration with access mode C

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.