macro_rules! spmi_write_contiguous {
(
$regs:expr,
$head:ident => $head_val:expr $(, $tail:ident => $tail_val:expr )* $(,)?
) => { ... };
}Expand description
Writes multiple contiguous registers in a single async call to the hardware.
This macro accepts an SPMI device proxy and a mapping of register modules to their values, serializes the values using their correct endianness, and performs a single async contiguous write.
§Arguments
$regs:expr: The block struct instance.$( $reg:ident => $val:expr ),*: A comma-separated mapping from register modules to their values.
§Examples
// Write both 'general' and 'status' registers together:
// let regs = MySpmiRegisters::new(spmi_proxy);
spmi_write_contiguous!(
®s,
my_reg => val_a,
status_be_reg => val_b
).await?;