Skip to main content

HramAccess

Trait HramAccess 

Source
pub trait HramAccess {
    type Value: CellValue;

    // Required methods
    fn get_cs(&self, cs: CriticalSection<'_>) -> Self::Value;
    fn set_cs(&self, cs: CriticalSection<'_>, value: Self::Value);
    fn as_ptr(&self) -> *mut Self::Value;
}
Expand description

Read and write an HRAM cell under a CriticalSection.

Implemented by every handle the hram! macro generates. An HramAtomicCell handle implements it too, so code holding a token can reach either kind through one interface.

Required Associated Types§

Source

type Value: CellValue

The stored type.

Required Methods§

Source

fn get_cs(&self, cs: CriticalSection<'_>) -> Self::Value

Read the cell.

HRAM starts zeroed, so a Value whose all-zero bit pattern is valid may be read before its first write.

Source

fn set_cs(&self, cs: CriticalSection<'_>, value: Self::Value)

Write the cell.

Source

fn as_ptr(&self) -> *mut Self::Value

The cell’s address, for raw access or to feed an ldh-based routine.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§