pub struct BulkRegisterOperation<'b, B, AddressType: Address, Fieldsets, Access> { /* private fields */ }Expand description
A register operation for reading or writing multiple registers in one transaction
Implementations§
Source§impl<'b, B, AddressType, FieldSets> BulkRegisterOperation<'b, B, AddressType, FieldSets, WO>
impl<'b, B, AddressType, FieldSets> BulkRegisterOperation<'b, B, AddressType, FieldSets, WO>
Sourcepub fn with<FS: Fieldset, LocalAccess: WriteCapability>(
self,
f: impl FnOnce(&mut B) -> Plan<AddressType, FS, LocalAccess>,
) -> BulkRegisterOperation<'b, B, AddressType, FieldSets::Appended, WO>where
FieldSets: Append<FS>,
pub fn with<FS: Fieldset, LocalAccess: WriteCapability>(
self,
f: impl FnOnce(&mut B) -> Plan<AddressType, FS, LocalAccess>,
) -> BulkRegisterOperation<'b, B, AddressType, FieldSets::Appended, WO>where
FieldSets: Append<FS>,
Chain an extra write onto the bulk-write.
The closure must return a plan for the register you want to write.
The plan is created by calling RegisterOperation::plan or RegisterOperation::plan_with_zero.
After chaining, call Self::execute.
Source§impl<'b, B, AddressType, FieldSets> BulkRegisterOperation<'b, B, AddressType, FieldSets, RO>
impl<'b, B, AddressType, FieldSets> BulkRegisterOperation<'b, B, AddressType, FieldSets, RO>
Sourcepub fn with<FS: Fieldset, LocalAccess: ReadCapability>(
self,
f: impl FnOnce(&mut B) -> Plan<AddressType, FS, LocalAccess>,
) -> BulkRegisterOperation<'b, B, AddressType, FieldSets::Appended, RO>where
FieldSets: Append<FS>,
pub fn with<FS: Fieldset, LocalAccess: ReadCapability>(
self,
f: impl FnOnce(&mut B) -> Plan<AddressType, FS, LocalAccess>,
) -> BulkRegisterOperation<'b, B, AddressType, FieldSets::Appended, RO>where
FieldSets: Append<FS>,
Chain an extra read onto the bulk-read.
The closure must return a plan for the register you want to read.
The plan is created by calling RegisterOperation::plan.
After chaining, call Self::execute.
Source§impl<'b, B, AddressType, FieldSets> BulkRegisterOperation<'b, B, AddressType, FieldSets, RW>
impl<'b, B, AddressType, FieldSets> BulkRegisterOperation<'b, B, AddressType, FieldSets, RW>
Sourcepub fn with<FS: Fieldset, LocalAccess: ReadCapability + WriteCapability>(
self,
f: impl FnOnce(&mut B) -> Plan<AddressType, FS, LocalAccess>,
) -> BulkRegisterOperation<'b, B, AddressType, FieldSets::Appended, RW>where
FieldSets: Append<FS>,
pub fn with<FS: Fieldset, LocalAccess: ReadCapability + WriteCapability>(
self,
f: impl FnOnce(&mut B) -> Plan<AddressType, FS, LocalAccess>,
) -> BulkRegisterOperation<'b, B, AddressType, FieldSets::Appended, RW>where
FieldSets: Append<FS>,
Chain an extra modify onto the bulk-modify.
The closure must return a plan for the register you want to modify.
The plan is created by calling RegisterOperation::plan.
After chaining, call Self::execute.
Source§impl<B, Fieldsets> BulkRegisterOperation<'_, B, <B::Interface as RegisterInterfaceBase>::AddressType, Fieldsets, RO>
impl<B, Fieldsets> BulkRegisterOperation<'_, B, <B::Interface as RegisterInterfaceBase>::AddressType, Fieldsets, RO>
Sourcepub fn execute(
self,
) -> Result<Fieldsets::Tuple, <B::Interface as RegisterInterfaceBase>::Error>where
B::Interface: RegisterInterface,
pub fn execute(
self,
) -> Result<Fieldsets::Tuple, <B::Interface as RegisterInterfaceBase>::Error>where
B::Interface: RegisterInterface,
Execute the read.
If ok, the fieldset values are returned as a tuple. If the bulk-read was illegal or the read failed, an error is returned.
Sourcepub async fn execute_async(
self,
) -> Result<Fieldsets::Tuple, <B::Interface as RegisterInterfaceBase>::Error>where
B::Interface: AsyncRegisterInterface,
pub async fn execute_async(
self,
) -> Result<Fieldsets::Tuple, <B::Interface as RegisterInterfaceBase>::Error>where
B::Interface: AsyncRegisterInterface,
Execute the read.
If ok, the fieldset values are returned as a tuple. If the bulk-read was illegal or the read failed, an error is returned.
Source§impl<B, Fieldsets> BulkRegisterOperation<'_, B, <B::Interface as RegisterInterfaceBase>::AddressType, Fieldsets, WO>where
B: Block,
B::Interface: RegisterInterfaceBase,
Fieldsets: Fieldset,
for<'a> &'a mut Fieldsets: ToTuple,
impl<B, Fieldsets> BulkRegisterOperation<'_, B, <B::Interface as RegisterInterfaceBase>::AddressType, Fieldsets, WO>where
B: Block,
B::Interface: RegisterInterfaceBase,
Fieldsets: Fieldset,
for<'a> &'a mut Fieldsets: ToTuple,
Sourcepub fn execute(
self,
f: impl FnOnce(<&mut Fieldsets as ToTuple>::Tuple),
) -> Result<(), <B::Interface as RegisterInterfaceBase>::Error>where
B::Interface: RegisterInterface,
pub fn execute(
self,
f: impl FnOnce(<&mut Fieldsets as ToTuple>::Tuple),
) -> Result<(), <B::Interface as RegisterInterfaceBase>::Error>where
B::Interface: RegisterInterface,
Execute the write.
Use the closure to change contents of the fieldset values that will be written. The fieldset values are either the reset value or all-0’s based on which plan was used in the chaining phase.
If ok, the return value of the closure is returned. If the bulk-write was illegal or the read failed, an error is returned.
Sourcepub fn execute_async(
self,
f: impl FnOnce(<&mut Fieldsets as ToTuple>::Tuple),
) -> impl Future<Output = Result<(), <B::Interface as RegisterInterfaceBase>::Error>>where
B::Interface: AsyncRegisterInterface,
pub fn execute_async(
self,
f: impl FnOnce(<&mut Fieldsets as ToTuple>::Tuple),
) -> impl Future<Output = Result<(), <B::Interface as RegisterInterfaceBase>::Error>>where
B::Interface: AsyncRegisterInterface,
Execute the write.
Use the closure to change contents of the fieldset values that will be written. The fieldset values are either the reset value or all-0’s based on which plan was used in the chaining phase.
If ok, the return value of the closure is returned. If the bulk-write was illegal or the read failed, an error is returned.
Source§impl<B, Fieldsets> BulkRegisterOperation<'_, B, <B::Interface as RegisterInterfaceBase>::AddressType, Fieldsets, RW>where
B: Block,
B::Interface: RegisterInterfaceBase,
Fieldsets: Fieldset,
for<'a> &'a mut Fieldsets: ToTuple,
impl<B, Fieldsets> BulkRegisterOperation<'_, B, <B::Interface as RegisterInterfaceBase>::AddressType, Fieldsets, RW>where
B: Block,
B::Interface: RegisterInterfaceBase,
Fieldsets: Fieldset,
for<'a> &'a mut Fieldsets: ToTuple,
Sourcepub fn execute(
self,
f: impl FnOnce(<&mut Fieldsets as ToTuple>::Tuple),
) -> Result<(), <B::Interface as RegisterInterfaceBase>::Error>where
B::Interface: RegisterInterface,
pub fn execute(
self,
f: impl FnOnce(<&mut Fieldsets as ToTuple>::Tuple),
) -> Result<(), <B::Interface as RegisterInterfaceBase>::Error>where
B::Interface: RegisterInterface,
Execute the modify.
Use the closure to change contents of the fieldset values that have been read. The modified values will be written back to the device.
If ok, the return value of the closure is returned. If the bulk-modify was illegal or the read failed, an error is returned.
Sourcepub async fn execute_async(
self,
f: impl FnOnce(<&mut Fieldsets as ToTuple>::Tuple),
) -> Result<(), <B::Interface as RegisterInterfaceBase>::Error>where
B::Interface: AsyncRegisterInterface,
pub async fn execute_async(
self,
f: impl FnOnce(<&mut Fieldsets as ToTuple>::Tuple),
) -> Result<(), <B::Interface as RegisterInterfaceBase>::Error>where
B::Interface: AsyncRegisterInterface,
Execute the modify.
Use the closure to change contents of the fieldset values that have been read. The modified values will be written back to the device.
If ok, the return value of the closure is returned. If the bulk-modify was illegal or the read failed, an error is returned.