rp-pac

Crates

git

Versions

rp235x

Flavors

Struct rp_pac::qmi::regs::DirectCsr

source ·
#[repr(transparent)]
pub struct DirectCsr(pub u32);
Expand description

Control and status for direct serial mode Direct serial mode allows the processor to send and receive raw serial frames, for programming, configuration and control of the external memory devices. Only SPI mode 0 (CPOL=0 CPHA=0) is supported.

Tuple Fields§

§0: u32

Implementations§

source§

impl DirectCsr

source

pub const fn en(&self) -> bool

Enable direct mode. In direct mode, software controls the chip select lines, and can perform direct SPI transfers by pushing data to the DIRECT_TX FIFO, and popping the same amount of data from the DIRECT_RX FIFO. Memory-mapped accesses will generate bus errors when direct serial mode is enabled.

source

pub fn set_en(&mut self, val: bool)

Enable direct mode. In direct mode, software controls the chip select lines, and can perform direct SPI transfers by pushing data to the DIRECT_TX FIFO, and popping the same amount of data from the DIRECT_RX FIFO. Memory-mapped accesses will generate bus errors when direct serial mode is enabled.

source

pub const fn busy(&self) -> bool

Direct mode busy flag. If 1, data is currently being shifted in/out (or would be if the interface were not stalled on the RX FIFO), and the chip select must not yet be deasserted. The busy flag will also be set to 1 if a memory-mapped transfer is still in progress when direct mode is enabled. Direct mode blocks new memory-mapped transfers, but can’t halt a transfer that is already in progress. If there is a chance that memory-mapped transfers may be in progress, the busy flag should be polled for 0 before asserting the chip select. (In practice you will usually discover this timing condition through other means, because any subsequent memory-mapped transfers when direct mode is enabled will return bus errors, which are difficult to ignore.)

source

pub fn set_busy(&mut self, val: bool)

Direct mode busy flag. If 1, data is currently being shifted in/out (or would be if the interface were not stalled on the RX FIFO), and the chip select must not yet be deasserted. The busy flag will also be set to 1 if a memory-mapped transfer is still in progress when direct mode is enabled. Direct mode blocks new memory-mapped transfers, but can’t halt a transfer that is already in progress. If there is a chance that memory-mapped transfers may be in progress, the busy flag should be polled for 0 before asserting the chip select. (In practice you will usually discover this timing condition through other means, because any subsequent memory-mapped transfers when direct mode is enabled will return bus errors, which are difficult to ignore.)

source

pub const fn assert_cs0n(&self) -> bool

When 1, assert (i.e. drive low) the CS0n chip select line. Note that this applies even when DIRECT_CSR_EN is 0.

source

pub fn set_assert_cs0n(&mut self, val: bool)

When 1, assert (i.e. drive low) the CS0n chip select line. Note that this applies even when DIRECT_CSR_EN is 0.

source

pub const fn assert_cs1n(&self) -> bool

When 1, assert (i.e. drive low) the CS1n chip select line. Note that this applies even when DIRECT_CSR_EN is 0.

source

pub fn set_assert_cs1n(&mut self, val: bool)

When 1, assert (i.e. drive low) the CS1n chip select line. Note that this applies even when DIRECT_CSR_EN is 0.

source

pub const fn auto_cs0n(&self) -> bool

When 1, automatically assert the CS0n chip select line whenever the BUSY flag is set.

source

pub fn set_auto_cs0n(&mut self, val: bool)

When 1, automatically assert the CS0n chip select line whenever the BUSY flag is set.

source

pub const fn auto_cs1n(&self) -> bool

When 1, automatically assert the CS1n chip select line whenever the BUSY flag is set.

source

pub fn set_auto_cs1n(&mut self, val: bool)

When 1, automatically assert the CS1n chip select line whenever the BUSY flag is set.

source

pub const fn txfull(&self) -> bool

When 1, the DIRECT_TX FIFO is currently full. If the processor tries to write more data, that data will be ignored.

source

pub fn set_txfull(&mut self, val: bool)

When 1, the DIRECT_TX FIFO is currently full. If the processor tries to write more data, that data will be ignored.

source

pub const fn txempty(&self) -> bool

When 1, the DIRECT_TX FIFO is currently empty. Unless the processor pushes more data, transmission will stop and BUSY will go low once the current 8-bit serial frame completes.

source

pub fn set_txempty(&mut self, val: bool)

When 1, the DIRECT_TX FIFO is currently empty. Unless the processor pushes more data, transmission will stop and BUSY will go low once the current 8-bit serial frame completes.

source

pub const fn txlevel(&self) -> u8

Current level of DIRECT_TX FIFO

source

pub fn set_txlevel(&mut self, val: u8)

Current level of DIRECT_TX FIFO

source

pub const fn rxempty(&self) -> bool

When 1, the DIRECT_RX FIFO is currently empty. If the processor attempts to read more data, the FIFO state is not affected, but the value returned to the processor is undefined.

source

pub fn set_rxempty(&mut self, val: bool)

When 1, the DIRECT_RX FIFO is currently empty. If the processor attempts to read more data, the FIFO state is not affected, but the value returned to the processor is undefined.

source

pub const fn rxfull(&self) -> bool

When 1, the DIRECT_RX FIFO is currently full. The serial interface will be stalled until data is popped; the interface will not begin a new serial frame when the DIRECT_TX FIFO is empty or the DIRECT_RX FIFO is full.

source

pub fn set_rxfull(&mut self, val: bool)

When 1, the DIRECT_RX FIFO is currently full. The serial interface will be stalled until data is popped; the interface will not begin a new serial frame when the DIRECT_TX FIFO is empty or the DIRECT_RX FIFO is full.

source

pub const fn rxlevel(&self) -> u8

Current level of DIRECT_RX FIFO

source

pub fn set_rxlevel(&mut self, val: u8)

Current level of DIRECT_RX FIFO

source

pub const fn clkdiv(&self) -> u8

Clock divisor for direct serial mode. Divisors of 1..255 are encoded directly, and the maximum divisor of 256 is encoded by a value of CLKDIV=0. The clock divisor can be changed on-the-fly by software, without halting or otherwise coordinating with the serial interface. The serial interface will sample the latest clock divisor each time it begins the transmission of a new byte.

source

pub fn set_clkdiv(&mut self, val: u8)

Clock divisor for direct serial mode. Divisors of 1..255 are encoded directly, and the maximum divisor of 256 is encoded by a value of CLKDIV=0. The clock divisor can be changed on-the-fly by software, without halting or otherwise coordinating with the serial interface. The serial interface will sample the latest clock divisor each time it begins the transmission of a new byte.

source

pub const fn rxdelay(&self) -> u8

Delay the read data sample timing, in units of one half of a system clock cycle. (Not necessarily half of an SCK cycle.)

source

pub fn set_rxdelay(&mut self, val: u8)

Delay the read data sample timing, in units of one half of a system clock cycle. (Not necessarily half of an SCK cycle.)

Trait Implementations§

source§

impl Clone for DirectCsr

source§

fn clone(&self) -> DirectCsr

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 Default for DirectCsr

source§

fn default() -> DirectCsr

Returns the “default value” for a type. Read more
source§

impl PartialEq for DirectCsr

source§

fn eq(&self, other: &DirectCsr) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for DirectCsr

source§

impl Eq for DirectCsr

source§

impl StructuralPartialEq for DirectCsr

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> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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.