pub struct I2cDriver { /* private fields */ }
Expand description
Implementation of the low level interface via Google I2C protocol.
Implementations§
Trait Implementations§
Source§impl Driver for I2cDriver
impl Driver for I2cDriver
Source§fn read_register(&self, register: Register, data: &mut [u8]) -> Result<()>
fn read_register(&self, register: Register, data: &mut [u8]) -> Result<()>
Read from the given TPM register, number of bytes to read given by length of data slice.
Source§fn write_register(&self, register: Register, data: &[u8]) -> Result<()>
fn write_register(&self, register: Register, data: &[u8]) -> Result<()>
Write to the given TPM register.
Source§fn execute_command(&self, cmd: &[u8]) -> Result<Vec<u8>>
fn execute_command(&self, cmd: &[u8]) -> Result<Vec<u8>>
Execute a TPM command and return the result as a
Vec<u8>
or time out.Source§fn read_status(&self) -> Result<TpmStatus>
fn read_status(&self) -> Result<TpmStatus>
Fetches the current status.
Source§fn poll_for_data_available(&self) -> Result<TpmStatus>
fn poll_for_data_available(&self) -> Result<TpmStatus>
Poll the status register until the status is valid and data is available or time out.
Source§fn poll_for_ready(&self) -> Result<TpmStatus>
fn poll_for_ready(&self) -> Result<TpmStatus>
Poll the status register until the status is valid and the tpm is ready or time out.
Auto Trait Implementations§
impl Freeze for I2cDriver
impl !RefUnwindSafe for I2cDriver
impl !Send for I2cDriver
impl !Sync for I2cDriver
impl Unpin for I2cDriver
impl !UnwindSafe for I2cDriver
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more