Skip to main content

Ocotp

Struct Ocotp 

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

The OCOTP driver.

Implementations§

Source§

impl Ocotp

Source

pub fn new(ocotp: OCOTP) -> Self

Construct the driver interface, given the peripheral instance.

Source

pub fn blocking_fuse_read( &mut self, fuse_address: FuseAddress, ) -> Result<u32, Error>

Read a fuse, blocking indefinitely until it returns a value.

This simply spins on the future returned by spin_fuse_read. The approach does not give you a way to specify any timeout. Use only when you’re confident the fuse read will complete.

Source

pub fn blocking_fuse_write( &mut self, fuse_address: FuseAddress, fuse_value: u32, ) -> Result<(), Error>

Write a fuse, blocking indefinitely until it completes.

This simply spins on the future returned by spin_fuse_write. The approach does not give you a way to control a timeout. Use only when you’re confident the write will complete.

Source

pub async fn spin_fuse_read( &mut self, fuse_address: FuseAddress, ) -> Result<u32, Error>

Returns a spinning state machine that reads a fuse value.

The returned task does not consult a waker! You’re expected to spin the CPU on poll() until it returns a value.

The future is not cancel safe. There is no way to cancel an in-flight fuse read. Therefore, errors from prior, incomplete reads may be returned in a subsequent access.

You may compose your own timeouts by using another spinning task, and selecting the winner of the timeout / read.

Source

pub async fn spin_fuse_write( &mut self, fuse_address: FuseAddress, fuse_value: u32, ) -> Result<(), Error>

Returns a spinning state machine that writes a fuse value.

The returned task does not consult a waker! You’re expected to spin the CPU on poll() until it returns a value.

The future is not cancel safe. There is no way to cancel an in-flight fuse write. Therefore, errors from prior, incomplete writes may be returned in a subsequent access.

You may compose your own timeouts by using another spinning task, and selecting the winner of the timeout / write.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Ocotp

§

impl !Sync for Ocotp

§

impl !UnwindSafe for Ocotp

§

impl Freeze for Ocotp

§

impl Send for Ocotp

§

impl Unpin for Ocotp

§

impl UnsafeUnpin for Ocotp

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.