Skip to main content

spmi_write_contiguous

Macro spmi_write_contiguous 

Source
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

  1. $regs:expr: The block struct instance.
  2. $( $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!(
    &regs,
    my_reg => val_a,
    status_be_reg => val_b
).await?;