pub struct Ocotp { /* private fields */ }Expand description
The OCOTP driver.
Implementations§
Source§impl Ocotp
impl Ocotp
Sourcepub fn new(ocotp: OCOTP) -> Self
pub fn new(ocotp: OCOTP) -> Self
Construct the driver interface, given the peripheral instance.
Sourcepub fn blocking_fuse_read(
&mut self,
fuse_address: FuseAddress,
) -> Result<u32, Error>
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.
Sourcepub fn blocking_fuse_write(
&mut self,
fuse_address: FuseAddress,
fuse_value: u32,
) -> Result<(), Error>
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.
Sourcepub async fn spin_fuse_read(
&mut self,
fuse_address: FuseAddress,
) -> Result<u32, Error>
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.
Sourcepub async fn spin_fuse_write(
&mut self,
fuse_address: FuseAddress,
fuse_value: u32,
) -> Result<(), Error>
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.